|
ATLAS Offline Software
|
Go to the documentation of this file.
15 #include "GaudiKernel/MsgStream.h"
38 MsgStream&
msg )
const
41 <<
"Loading TruthParticleContainer from persistent state..."
46 <<
"NULL pointer to ITruthParticleCnvTool !!"
48 <<
"Can't create *ANY* TruthParticleContainer !!"
50 throw std::runtime_error(
"NULL pointer to ITruthParticleCnvTool !!");
62 const std::string
error(
"NULL pointer to McEventCollection !!");
65 throw std::runtime_error(
error);
71 size_t firstEvt, lastEvt;
73 msg <<
MSG::DEBUG <<
" Converting pile-up type = "<< putype <<
" from McEventCollection index "<< firstEvt <<
" to "<< lastEvt <<
endmsg;
75 for( ; firstEvt != lastEvt; firstEvt++){
79 trans ).isSuccess() ) {
81 <<
"Problem converting HepMC::GenEvent ["
84 <<
" to TruthParticleContainer !"
86 throw std::runtime_error(
"No TruthParticleContainer created !!");
91 const std::string
err =
"ElementLink to McEventCollection is not valid !";
93 throw std::runtime_error(
err);
105 <<
"Loaded TruthParticleContainer from persistent state [OK]"
113 MsgStream&
msg )
const
116 <<
"Creating persistent state of TruthParticleContainer..."
126 <<
"Transient ElementLink is NOT valid !!" <<
endmsg;
virtual StatusCode convert(const McEventCollection *mcEvts, const unsigned int genEvtIndex, TruthParticleContainer *mcParts, const ITruthParticleVisitor *visitor=0) const =0
Convert a McEventCollection into an TruthParticleContainer.
void persToTrans(const PersLink_t &pers, Link_t &trans, MsgStream &log) const
void setEtIsolations(const ElementLink< TruthEtIsolationsContainer > &etIsolations)
Setup the persistent pointer toward the TruthEtIsolations.
ElementLinkInt_p3 m_etIsolations
The persistent pointer toward the TruthEtIsolations container the (transient) TruthParticleContainer ...
BaseConstPointer getStorableObjectPointer() const
Return a pointer to the currently-referenced container object.
PileuType_t
define some Pile-up classification Important : this classification is copied in McParticleAlgs/python...
ITruthParticleCnvTool * m_cnvTool
Pointer to the IAlgTool providing the conversion from a McEventCollection to a TruthParticleContainer...
bool isValid() const
Test to see if the link can be dereferenced.
ElementLinkInt_p3 m_genEvent
The persistent pointer toward the McEventCollection the (transient) TruthParticleContainer is proxyin...
const ID_type & dataID() const
Get the key that we reference, as a string.
const ElementLink< TruthEtIsolationsContainer > & etIsolationsLink() const
return the link to truth Et isolations.
void transToPers(const Link_t &trans, PersLink_t &pers, const SG::ThinningCache *cache, MsgStream &log) const
ElementLinkCnv_p3< ElementLink< McEventCollection > > m_genEvtCnv
Converter for the ElementLink<McEventCollection> data member.
void setGenEvent(const ElementLink< McEventCollection > &genEvent)
Setup the persistent pointer toward the HepMC::GenEvent this TruthParticleContainer is proxying.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
virtual void persToTrans(const TruthParticleContainer_p6 *persObj, TruthParticleContainer *transObj, MsgStream &msg) const override
Method creating the transient representation of TruthParticleContainer from its persistent representa...
virtual void transToPers(const TruthParticleContainer *transObj, TruthParticleContainer_p6 *persObj, MsgStream &msg) const override
Method creating the persistent representation TruthParticleContainer_p6 from its transient representa...
const ElementLink< McEventCollection > & genEventLink() const
Retrieve the HepMC::GenEvent this TruthParticleContainer is proxying, as a link.
static PileuType_t pileUpType(const McEventCollection *evts, size_t evtIndex)
Return the type of pile-up event of the GenEvent number evtIndex in the McEventCollection.
ElementLinkCnv_p3< ElementLink< TruthEtIsolationsContainer > > m_etIsolCnv
Converter for the ElementLink<TruthEtIsolationsContainer> data member.
static void findEventIterators(PileuType_t putype, McEventCollection::const_iterator &fEvt, McEventCollection::const_iterator &lEvt)
Find interval [fEvt,lEvt] containing all GenEvents of type putype from the McEventCollection.