#include <TesIO.h>
Public Types | |
typedef std::string | String |
Public Methods | |
TesIO () | |
TesIoStat | getMC (MCparticleCollection &) const |
TesIoStat | getMC (MCparticleCollection &, const HepMC_helper::IMCselector *) const |
template<class T> TesIoStat | copy (std::vector< T * > &) const |
template<class T> TesIoStat | copy (std::vector< T * > &, String key) const |
template<class T> TesIoStat | getDH (const DataHandle< T > &) const |
template<class T> TesIoStat | getDH (const DataHandle< T > &, String key) const |
template<class T> TesIoStat | store (T *) const |
template<class T> TesIoStat | store (T *, String key) const |
Private Attributes | |
StoreGateSvc * | m_sgSvc |
|
|
|
Definition at line 72 of file TesIO.h. References m_sgSvc.
|
|
Definition at line 16 of file TesIO.cxx.
00016 { 00017 const HepMC_helper::IMCselector* selector = new HepMC_helper::All(); 00018 TesIoStat stat = this->getMC(mcParticles, selector); 00019 return stat; 00020 } |
|
Definition at line 23 of file TesIO.cxx. References getDH().
00024 { 00025 00026 const DataHandle<McEventCollection> mcCollptr; 00027 TesIoStat stat = this->getDH(mcCollptr); 00028 if(!stat){ 00029 return TesIoStat(StatusCode::FAILURE,"Could not find MC ptcles in TES"); 00030 } 00031 00032 // HepMC_helper::MCselectorWrapper wrappedSelector(selector); 00033 00034 // Iterate over all McEvent records 00035 McEventCollection::const_iterator itr; 00036 for (itr = mcCollptr->begin(); itr!=mcCollptr->end(); ++itr) { 00037 // Access the HepMC record which is wrapped within McEvent 00038 HepMC::GenEvent* genEvt = (*itr)->pGenEvt() ; 00039 if(genEvt == 0) return TesIoStat(StatusCode::FAILURE, 00040 "Could not find HEP Gen event"); 00041 00042 // Copy all final state particles of the correct type into the 00043 // collection 00044 00045 // HepMC::copy_if( genEvt->particles_begin(), 00046 // genEvt->particles_end(), 00047 // back_inserter( mcParticles), 00048 // wrappedSelector 00049 // ); 00050 // HepMC::copy_if( genEvt->particles_begin(), 00051 // genEvt->particles_end(), 00052 // back_inserter( mcParticles), 00053 // *(selector->create()) 00054 // ); 00055 GenEvent::particle_const_iterator it= genEvt->particles_begin(); 00056 GenEvent::particle_const_iterator en= genEvt->particles_end(); 00057 for(; it!=en; ++it){ 00058 if((*selector)(*it)){mcParticles.push_back(*it);} 00059 } 00060 } 00061 00062 return TesIoStat(StatusCode::SUCCESS); 00063 00064 } |
|
Definition at line 82 of file TesIO.h. References getDH(), and Atlfast::TesIoStat::message().
00082 { 00083 DataHandle<ObjectVector<T> > objects; 00084 TesIoStat stat = this->getDH(objects); 00085 if(!stat) { 00086 return TesIoStat(StatusCode::FAILURE, 00087 "Could not copy collection: "+stat.message()); 00088 } 00089 00090 std::copy(objects->begin(),objects->end(),back_inserter(localCopy)); 00091 return TesIoStat(StatusCode::SUCCESS, "Copied Collection from TDS"); 00092 00093 } |
|
Definition at line 98 of file TesIO.h. References getDH(), and Atlfast::TesIoStat::message().
00098 { 00099 DataHandle<ObjectVector<T> > objects; 00100 TesIoStat stat = this->getDH(objects, key); 00101 if(!stat){ 00102 return TesIoStat(StatusCode::FAILURE, 00103 "Could not copy keyed collection: "+stat.message()); 00104 } 00105 00106 std::copy(objects->begin(),objects->end(),back_inserter(localCopy)); 00107 return TesIoStat(StatusCode::SUCCESS, "Copied Collection from TDS"); 00108 00109 } |
|
Definition at line 114 of file TesIO.h. References m_sgSvc. Referenced by copy(), and getMC().
00114 { 00115 if((m_sgSvc->retrieve(dh)).isFailure() ){ 00116 return TesIoStat(StatusCode::FAILURE, 00117 "Could not find a valid DataHandle"); 00118 } 00119 return TesIoStat(StatusCode::SUCCESS, "Found unkeyed DH in TDS"); 00120 } |
|
Definition at line 125 of file TesIO.h. References m_sgSvc.
00125 { 00126 if( (m_sgSvc->retrieve(dh, key)).isFailure() ){ 00127 return TesIoStat(StatusCode::FAILURE, 00128 "Could not find a valid keyed DataHandle"); 00129 } 00130 return TesIoStat(StatusCode::SUCCESS, "Found keyed DH in TDS"); 00131 } |
|
Definition at line 135 of file TesIO.h. References m_sgSvc.
00135 { 00136 return (TesIoStat(m_sgSvc->record(pObject)) ) ; 00137 } |
|
Definition at line 142 of file TesIO.h. References m_sgSvc.
00142 { 00143 return (TesIoStat(m_sgSvc->record(storee, key)) ) ; 00144 } |
|
|