diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/ARA_selection.xml b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/ARA_selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..bc98ed7328d0999825e4b3b4690d8d6279208ff9 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/ARA_selection.xml @@ -0,0 +1,24 @@ +<lcgdict> + + <class name="TruthEtIsolationsContainerCnv_p1"/> + + <class name="ITPConverterFor<TruthParticleContainer>"/> + + <class name="T_TPCnv<TruthParticleContainer,TruthParticleContainer_p6>"/> + <class name="TruthParticleContainerCnv_p6"/> + <class name="T_AthenaPoolTPCnvBase<TruthParticleContainer,TruthParticleContainer_p6>"/> + <class name="T_AthenaPoolTPPolyCnvBase<TruthParticleContainer,TruthParticleContainer,TruthParticleContainer_p6>"/> + <class name="T_AthenaPoolTPAbstractPolyCnvBase<TruthParticleContainer,TruthParticleContainer,TruthParticleContainer_p6>"/> + + <class name="T_TPCnv<TruthParticleContainer,TruthParticleContainer_p5>"/> + <class name="TruthParticleContainerCnv_p5"/> + <class name="T_AthenaPoolTPCnvBase<TruthParticleContainer,TruthParticleContainer_p5>"/> + <class name="T_AthenaPoolTPPolyCnvBase<TruthParticleContainer,TruthParticleContainer,TruthParticleContainer_p5>"/> + <class name="T_AthenaPoolTPAbstractPolyCnvBase<TruthParticleContainer,TruthParticleContainer,TruthParticleContainer_p5>"/> + + <class name="T_TPCnv<TruthParticleContainer,TruthParticleContainer_p4>"/> + <class name="T_AthenaPoolTPCnvBase<TruthParticleContainer,TruthParticleContainer_p4>"/> + <class name="T_AthenaPoolTPPolyCnvBase<TruthParticleContainer,TruthParticleContainer,TruthParticleContainer_p4>"/> + <class name="T_AthenaPoolTPAbstractPolyCnvBase<TruthParticleContainer,TruthParticleContainer,TruthParticleContainer_p4>"/> + +</lcgdict> diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/McParticleEventTPCnvDict.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/McParticleEventTPCnvDict.h new file mode 100644 index 0000000000000000000000000000000000000000..44101a64a84a3b1367fe79aaacc5ed38488489a1 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/McParticleEventTPCnvDict.h @@ -0,0 +1,43 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/// File: McParticleEventTPCnv/McParticleEventTPCnvDict.h +/// Dictionary file for persistent representation(s) of McParticleEvent classes +/// Author: Sebastien Binet <binet@cern.ch> +/// Date: July 2007 + +#ifndef MCPARTICLEEVENTTPCNV_MCPARTICLEEVENTTPCNVDICT_H +#define MCPARTICLEEVENTTPCNV_MCPARTICLEEVENTTPCNVDICT_H + +#include "McParticleEventTPCnv/TruthParticleContainer_p1.h" +#include "McParticleEventTPCnv/TruthParticleContainer_p2.h" +#include "McParticleEventTPCnv/TruthParticleContainer_p3.h" +#include "McParticleEventTPCnv/TruthParticleContainer_p4.h" +#include "McParticleEventTPCnv/TruthParticleContainer_p5.h" +#include "McParticleEventTPCnv/TruthParticleContainer_p6.h" + +#include "McParticleEventTPCnv/TruthEtIsolationsContainer_p1.h" + +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p5.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p6.h" +#include "McParticleEventTPCnv/RootTruthParticleContainerCnv_p4.h" + +#include "McParticleEventTPCnv/TruthEtIsolationsContainerCnv_p1.h" + + +namespace McParticleEventTPCnv_dict { + + struct tmp { + TruthEtIsolations_p1::EtIsolMap_t m_etIsolMap_p1; + TruthEtIsolations_p1::EtIsolBc_t m_etIsolBc_p1; + + T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4> m_truthparticlecontainer_p4; + + }; + +} //> namespace McParticleEventTPCnv_dict + +#endif //MCPARTICLEEVENTTPCNV_MCPARTICLEEVENTTPCNVDICT_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/OLD_selection.xml b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/OLD_selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..be096ceee66a94712ac3bf25826b54e93bbd4cc1 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/OLD_selection.xml @@ -0,0 +1,7 @@ +<lcgdict> + + <class name="TruthParticleContainer_p1" id="6B56623E-05D2-4BEA-9EBA-86F5E9BD8047" /> + <class name="TruthParticleContainer_p2" id="D835E375-E3D3-41DB-A781-8C55768553E1" /> + <class name="TruthParticleContainer_p3" id="E52F9F90-71CD-46C0-8572-587D9F768E1A" /> + +</lcgdict> diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/RootTruthParticleContainerCnv_p4.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/RootTruthParticleContainerCnv_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..ae4c653d88f8686159692c97b034b4f1989bd2e4 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/RootTruthParticleContainerCnv_p4.h @@ -0,0 +1,86 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// RootTruthParticleContainerCnv_p4.h +// Header file for root converters +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_ROOTTRUTHPARTICLECONTAINERCNV_P4_H +#define MCPARTICLEEVENTTPCNV_ROOTTRUTHPARTICLECONTAINERCNV_P4_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// DataModel converters +#include "DataModelAthenaPool/ElementLinkCnv_p1.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p4.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +template <> +class T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4> + : public T_AthenaPoolTPCnvBase<TruthParticleContainer, + TruthParticleContainer_p4> +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Constructor. + */ + T_TPCnv(); + ~T_TPCnv(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p4 + */ + virtual void persToTrans( const TruthParticleContainer_p4* persObj, + TruthParticleContainer* transObj, + MsgStream &log ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p4 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p4* persObj, + MsgStream &log ) ; + + protected: + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + + /** Converter for the ElementLink<McEventCollection> data member + */ + ElementLinkCnv_p1<ElementLink<McEventCollection> > m_genEvtCnv; +}; + +#endif //> MCPARTICLEEVENTTPCNV_ROOTTRUTHPARTICLECONTAINERCNV_P4_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsCnv_p1.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsCnv_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..6fcc13d6e91404c542265a95321c48eb58d58865 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsCnv_p1.h @@ -0,0 +1,78 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolationsCnv_p1.h +// Header file for class TruthEtIsolationsCnv_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCNV_P1_H +#define MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCNV_P1_H + +// STL includes + +// DataModel converters +#include "DataModelAthenaPool/ElementLinkCnv_p1.h" + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthEtIsolations_p1.h" + +// Forward declaration +class MsgStream; +class TruthEtIsolations; + +class TruthEtIsolationsCnv_p1 : public T_AthenaPoolTPCnvBase<TruthEtIsolations, TruthEtIsolations_p1> +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthEtIsolationsCnv_p1(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthEtIsolations + * from its persistent representation @c TruthEtIsolations_p1 + */ + virtual void persToTrans( const TruthEtIsolations_p1* persObj, + TruthEtIsolations* transObj, + MsgStream& msg ); + + /** Method creating the persistent representation @c TruthEtIsolations_p1 + * from its transient representation @c TruthEtIsolations + */ + virtual void transToPers( const TruthEtIsolations* transObj, + TruthEtIsolations_p1* persObj, + MsgStream& msg ); + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /** Converter for the ElementLink<McEventCollection> data member + */ + ElementLinkCnv_p1<ElementLink<McEventCollection> > m_genEvtCnv; + +}; + +/////////////////////////////////////////////////////////////////// +// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthEtIsolationsCnv_p1::TruthEtIsolationsCnv_p1() : + m_genEvtCnv ( ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCNV_P1_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsContainerCnv_p1.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsContainerCnv_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..c7f9942128ef20de450d8b701342c4f2720975bc --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsContainerCnv_p1.h @@ -0,0 +1,41 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolationsContainerCnv_p1.h +// Header file for class TruthEtIsolationsContainerCnv_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCONTAINERCNV_P1_H +#define MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCONTAINERCNV_P1_H + +// STL includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// McParticleEvent includes +#include "McParticleEvent/TruthEtIsolationsContainer.h" + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthEtIsolationsContainer_p1.h" +#include "McParticleEventTPCnv/TruthEtIsolationsCnv_p1.h" + +typedef T_AthenaPoolTPCnvVector< + TruthEtIsolationsContainer, + TruthEtIsolationsContainer_p1, + TruthEtIsolationsCnv_p1 + > TruthEtIsolationsContainerCnv_p1; + +// template <> +// class T_TPCnv<TruthEtIsolationsContainer, TruthEtIsolationsContainer_p1 > +// : public TruthEtIsolationsContainerCnv_p1 +// { +// public: +// }; + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCONTAINERCNV_P1_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsContainer_p1.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsContainer_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..eae5a2469f8999253d28f9f1e0cc3e944ad6d3ba --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolationsContainer_p1.h @@ -0,0 +1,24 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolationsContainer_p1.h +// Header file for class TruthEtIsolationsContainer_p1 +// Author: S.Binet<binet@cern.ch> +// Date: July 2007 +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCONTAINER_P1_H +#define MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCONTAINER_P1_H + +// STL includes +#include <vector> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthEtIsolations_p1.h" + +class TruthEtIsolationsContainer_p1 : public std::vector<TruthEtIsolations_p1> +{}; + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONSCONTAINER_P1_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolations_p1.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolations_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..e6bda65f2e9650b0062c1826dc4c52303082f662 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthEtIsolations_p1.h @@ -0,0 +1,101 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolations_p1.h +// Header file for class TruthEtIsolations_p1 +// Author: S.Binet<binet@cern.ch> +// Date: July 2007 +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONS_P1_H +#define MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONS_P1_H + +// STL includes +#include <vector> +#include <utility> // for std::pair + +// Boost includes +#include "boost/array.hpp" + +// Persistent ElementLink +#include "DataModelAthenaPool/ElementLink_p1.h" + +// McParticleEvent includes +#include "McParticleEvent/TruthParticleParamDefs.h" + +// forward declarations +class TruthEtIsolationsCnv_p1; + +class TruthEtIsolations_p1 +{ + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthEtIsolationsCnv_p1; + + /////////////////////////////////////////////////////////////////// + // Public typedefs: + /////////////////////////////////////////////////////////////////// +public: + + typedef boost::array<float, + TruthParticleParameters::NbrOfCones> EtIsolations_t; + + typedef std::pair<int, EtIsolations_t> EtIsolBc_t; + typedef std::vector<EtIsolBc_t> EtIsolMap_t; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// +public: + + /** Default constructor: + */ + TruthEtIsolations_p1(); + + /** Destructor: + */ + ~TruthEtIsolations_p1(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Private data: + /////////////////////////////////////////////////////////////////// +private: + + /** The persistent pointer toward the @c McEventCollection the (transient) + * @c TruthEtIsolations has been computed from (or its alias). + */ + ElementLinkInt_p1 m_genEvent; + + /// The persistent representation of Et-isolations: + /// a vector pairs (barcode, array-of-Et-isols) + EtIsolMap_t m_etIsolations; +}; + +/////////////////////////////////////////////////////////////////// +// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline +TruthEtIsolations_p1::TruthEtIsolations_p1() : + m_genEvent ( ), + m_etIsolations( ) +{} + +inline +TruthEtIsolations_p1::~TruthEtIsolations_p1() +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHETISOLATIONS_P1_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p1.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..c24859ba3414839aa236f751383a1e2de1e37260 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p1.h @@ -0,0 +1,116 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p1.h +// Header file for class TruthParticleContainerCnv_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P1_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P1_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p1.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +class TruthParticleContainerCnv_p1 : public T_AthenaPoolTPCnvBase< + TruthParticleContainer, + TruthParticleContainer_p1 + > +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainerCnv_p1(); + + /** Constructor with parameters: + */ + TruthParticleContainerCnv_p1( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p1 + */ + virtual void persToTrans( const TruthParticleContainer_p1* persObj, + TruthParticleContainer* transObj, + MsgStream &log ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p1 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p1* persObj, + MsgStream &log ) ; + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** Pointer to the StoreGateSvc: we need this as we'll have to fetch + * the @c McEventCollection which is the parent collection (the + * collection from it has been made) of the transient + * @c TruthParticleContainer has been created. + */ + StoreGateSvc* m_storeGate; + + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainerCnv_p1::TruthParticleContainerCnv_p1() : + m_storeGate ( 0 ), + m_cnvTool ( 0 ) +{} + +inline +TruthParticleContainerCnv_p1::TruthParticleContainerCnv_p1( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ) : + m_storeGate ( storeGate ), + m_cnvTool ( cnvTool ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P1_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p2.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..06758ec65416b83830d6fef6aac61f3a97a04812 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p2.h @@ -0,0 +1,116 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p2.h +// Header file for class TruthParticleContainerCnv_p2 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P2_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P2_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p2.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +class TruthParticleContainerCnv_p2 : public T_AthenaPoolTPCnvBase< + TruthParticleContainer, + TruthParticleContainer_p2 + > +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainerCnv_p2(); + + /** Constructor with parameters: + */ + TruthParticleContainerCnv_p2( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p2 + */ + virtual void persToTrans( const TruthParticleContainer_p2* persObj, + TruthParticleContainer* transObj, + MsgStream &log ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p2 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p2* persObj, + MsgStream &log ) ; + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** Pointer to the StoreGateSvc: we need this as we'll have to fetch + * the @c McEventCollection which is the parent collection (the + * collection from it has been made) of the transient + * @c TruthParticleContainer has been created. + */ + StoreGateSvc* m_storeGate; + + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainerCnv_p2::TruthParticleContainerCnv_p2() : + m_storeGate ( 0 ), + m_cnvTool ( 0 ) +{} + +inline +TruthParticleContainerCnv_p2::TruthParticleContainerCnv_p2( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ) : + m_storeGate ( storeGate ), + m_cnvTool ( cnvTool ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P2_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p3.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p3.h new file mode 100644 index 0000000000000000000000000000000000000000..f2b3252fb795e630522c5ec9f3a9edb081c60afb --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p3.h @@ -0,0 +1,123 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p3.h +// Header file for class TruthParticleContainerCnv_p3 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P3_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P3_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// DataModel converters +#include "DataModelAthenaPool/ElementLinkCnv_p1.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p3.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +class TruthParticleContainerCnv_p3 : public T_AthenaPoolTPCnvBase< + TruthParticleContainer, + TruthParticleContainer_p3 + > +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainerCnv_p3(); + + /** Constructor with parameters: + */ + TruthParticleContainerCnv_p3( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p3 + */ + virtual void persToTrans( const TruthParticleContainer_p3* persObj, + TruthParticleContainer* transObj, + MsgStream &log ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p3 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p3* persObj, + MsgStream &log ) ; + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** Pointer to the StoreGateSvc: we need this as we'll have to record + * the @c TruthEtIsolations container. + */ + StoreGateSvc* m_storeGate; + + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + + /** Converter for the ElementLink<McEventCollection> data member + */ + ElementLinkCnv_p1<ElementLink<McEventCollection> > m_genEvtCnv; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainerCnv_p3::TruthParticleContainerCnv_p3() : + m_storeGate ( 0 ), + m_cnvTool ( 0 ), + m_genEvtCnv ( ) +{} + +inline +TruthParticleContainerCnv_p3::TruthParticleContainerCnv_p3( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ) : + m_storeGate ( storeGate ), + m_cnvTool ( cnvTool ), + m_genEvtCnv ( ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P3_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p4.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..dcd26321e55c52b65079a113c9c5ae5d711c02a1 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p4.h @@ -0,0 +1,123 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p4.h +// Header file for class TruthParticleContainerCnv_p4 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P4_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P4_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// DataModel converters +#include "DataModelAthenaPool/ElementLinkCnv_p1.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p4.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +class TruthParticleContainerCnv_p4 : public T_AthenaPoolTPCnvBase< + TruthParticleContainer, + TruthParticleContainer_p4 + > +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainerCnv_p4(); + + /** Constructor with parameters: + */ + TruthParticleContainerCnv_p4( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p4 + */ + virtual void persToTrans( const TruthParticleContainer_p4* persObj, + TruthParticleContainer* transObj, + MsgStream &log ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p4 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p4* persObj, + MsgStream &log ) ; + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** Pointer to the StoreGateSvc: we need this as we'll have to record + * the @c TruthEtIsolations container. + */ + StoreGateSvc* m_storeGate; + + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + + /** Converter for the ElementLink<McEventCollection> data member + */ + ElementLinkCnv_p1<ElementLink<McEventCollection> > m_genEvtCnv; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainerCnv_p4::TruthParticleContainerCnv_p4() : + m_storeGate ( 0 ), + m_cnvTool ( 0 ), + m_genEvtCnv ( ) +{} + +inline +TruthParticleContainerCnv_p4::TruthParticleContainerCnv_p4( StoreGateSvc* storeGate, + ITruthParticleCnvTool* cnvTool ) : + m_storeGate ( storeGate ), + m_cnvTool ( cnvTool ), + m_genEvtCnv ( ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P4_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p5.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p5.h new file mode 100644 index 0000000000000000000000000000000000000000..66bf0911fc9c9c05a508209f8fd6afb833db9ffe --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p5.h @@ -0,0 +1,129 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p5.h +// Header file for class TruthParticleContainerCnv_p5 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P5_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P5_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// DataModel converters +#include "DataModelAthenaPool/ElementLinkCnv_p1.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p5.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +class TruthParticleContainerCnv_p5 : public T_AthenaPoolTPCnvBase< + TruthParticleContainer, + TruthParticleContainer_p5 + > +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainerCnv_p5(); + + /** Constructor with parameters: + */ + TruthParticleContainerCnv_p5( ITruthParticleCnvTool* cnvTool ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p5 + */ + virtual void persToTrans( const TruthParticleContainer_p5* persObj, + TruthParticleContainer* transObj, + MsgStream& msg ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p5 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p5* persObj, + MsgStream& msg ) ; + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + + /** Converter for the ElementLink<McEventCollection> data member + */ + ElementLinkCnv_p1<ElementLink<McEventCollection> > m_genEvtCnv; + + /** Converter for the ElementLink<TruthEtIsolationsContainer> data member + */ + ElementLinkCnv_p1<ElementLink<TruthEtIsolationsContainer> > m_etIsolCnv; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainerCnv_p5::TruthParticleContainerCnv_p5() : + m_cnvTool ( 0 ), + m_genEvtCnv ( ), + m_etIsolCnv ( ) +{} + +inline +TruthParticleContainerCnv_p5::TruthParticleContainerCnv_p5( ITruthParticleCnvTool* cnvTool ) : + m_cnvTool ( cnvTool ), + m_genEvtCnv ( ), + m_etIsolCnv ( ) +{} + +template<> +class T_TPCnv<TruthParticleContainer, TruthParticleContainer_p5> + : public TruthParticleContainerCnv_p5 +{ +public: + T_TPCnv(); + ~T_TPCnv(); +}; + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P5_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p6.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p6.h new file mode 100644 index 0000000000000000000000000000000000000000..500ad694dcf57bb5a082924234cb0e25d0c36a7f --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainerCnv_p6.h @@ -0,0 +1,129 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p6.h +// Header file for class TruthParticleContainerCnv_p6 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P6_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P6_H + +// STL includes + +// HepMC / CLHEP includes + +// Gaudi includes + +// AthenaPoolCnvSvc includes +#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" + +// DataModel converters +#include "DataModelAthenaPool/ElementLinkCnv_p3.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p6.h" + +// Forward declaration +class MsgStream; +class StoreGateSvc; +class ITruthParticleCnvTool; + +class TruthParticleContainerCnv_p6 : public T_AthenaPoolTPCnvBase< + TruthParticleContainer, + TruthParticleContainer_p6 + > +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainerCnv_p6(); + + /** Constructor with parameters: + */ + TruthParticleContainerCnv_p6( ITruthParticleCnvTool* cnvTool ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Method creating the transient representation of @c TruthParticleContainer + * from its persistent representation @c TruthParticleContainer_p6 + */ + virtual void persToTrans( const TruthParticleContainer_p6* persObj, + TruthParticleContainer* transObj, + MsgStream& msg ) ; + + /** Method creating the persistent representation @c TruthParticleContainer_p6 + * from its transient representation @c TruthParticleContainer + */ + virtual void transToPers( const TruthParticleContainer* transObj, + TruthParticleContainer_p6* persObj, + MsgStream& msg ) ; + + /////////////////////////////////////////////////////////////////// + // Protected method: + /////////////////////////////////////////////////////////////////// + protected: + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** Pointer to the IAlgTool providing the conversion from a + * @c McEventCollection to a @c TruthParticleContainer + */ + ITruthParticleCnvTool* m_cnvTool; + + /** Converter for the ElementLink<McEventCollection> data member + */ + ElementLinkCnv_p3<ElementLink<McEventCollection> > m_genEvtCnv; + + /** Converter for the ElementLink<TruthEtIsolationsContainer> data member + */ + ElementLinkCnv_p3<ElementLink<TruthEtIsolationsContainer> > m_etIsolCnv; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainerCnv_p6::TruthParticleContainerCnv_p6() : + m_cnvTool ( 0 ), + m_genEvtCnv ( ), + m_etIsolCnv ( ) +{} + +inline +TruthParticleContainerCnv_p6::TruthParticleContainerCnv_p6( ITruthParticleCnvTool* cnvTool ) : + m_cnvTool ( cnvTool ), + m_genEvtCnv ( ), + m_etIsolCnv ( ) +{} + +template<> +class T_TPCnv<TruthParticleContainer, TruthParticleContainer_p6> + : public TruthParticleContainerCnv_p6 +{ +public: + T_TPCnv(); + ~T_TPCnv(); +}; + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINERCNV_P6_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p1.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p1.h new file mode 100644 index 0000000000000000000000000000000000000000..178819719afe5d3f3c51dd69935824cb57ff666b --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p1.h @@ -0,0 +1,92 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p1.h +// Header file for class TruthParticleContainer_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P1_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P1_H + +// STL includes +#include <string> + +// HepMC / CLHEP includes + +// Gaudi includes + +// Forward declaration +class TruthParticleContainerCnv_p1; + +class TruthParticleContainer_p1 +{ + + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthParticleContainerCnv_p1; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainer_p1(); + + /** Constructor with parameters: we give the key of the + * parent @c McEventCollection. + */ + TruthParticleContainer_p1( const std::string& parentKey ); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /** Set the key of the @c McEventCollection from which the (transient) + * @c TruthParticleContainer has been made. + */ + void setParentKey( const std::string& parentKey ); + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** The key of the @c McEventCollection from which the (transient) + * @c TruthParticleContainer has been made. + */ + std::string m_parentKey; + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainer_p1::TruthParticleContainer_p1() : + m_parentKey( "NO_KEY" ) +{} + +inline +TruthParticleContainer_p1::TruthParticleContainer_p1( const std::string& key ): + m_parentKey( key ) +{} + +inline void +TruthParticleContainer_p1::setParentKey( const std::string& parentKey ) +{ + m_parentKey = parentKey; +} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P1_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p2.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p2.h new file mode 100644 index 0000000000000000000000000000000000000000..cf766ae96a0c566da0c90534167f2cb597021bfd --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p2.h @@ -0,0 +1,86 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p2.h +// Header file for class TruthParticleContainer_p2 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P2_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P2_H + +// STL includes +#include <vector> +#include <string> +#include <map> + +// HepMC / CLHEP includes + +// Gaudi includes + +// Forward declaration +class TruthParticleContainerCnv_p2; + +class TruthParticleContainer_p2 +{ + + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthParticleContainerCnv_p2; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainer_p2(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Retrieve the transverse energies (for different isolation cones) for a + * given particle (through its barcode) + */ + const std::vector<float>& etIsol( const unsigned int barcode ) const; + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** The key of the @c McEventCollection from which the (transient) + * @c TruthParticleContainer has been made. + */ + std::string m_parentKey; + + /** Persistent representation of a vector of @c TruthParticles + * we only store the vector of transverse energy isolation for + * different (pre-defined) isolation cones, this vector being + * labeled by the barcode of the @c GenParticle from which it has + * been computed. + */ + std::map< unsigned int, std::vector<float> > m_particles; +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainer_p2::TruthParticleContainer_p2() : + m_parentKey( "NO_KEY" ), + m_particles( ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P2_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p3.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p3.h new file mode 100644 index 0000000000000000000000000000000000000000..a3fe9cdd031653b04c658f68cb3553d0ab7c229e --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p3.h @@ -0,0 +1,89 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p3.h +// Header file for class TruthParticleContainer_p3 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P3_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P3_H + +// STL includes +#include <vector> +#include <map> + +// Persistent ElementLink +#include "DataModelAthenaPool/ElementLink_p1.h" + +// HepMC / CLHEP includes +#include "GeneratorObjects/McEventCollection.h" + +// Gaudi includes + +// Forward declaration +class TruthParticleContainerCnv_p3; + +class TruthParticleContainer_p3 +{ + + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthParticleContainerCnv_p3; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainer_p3(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Retrieve the transverse energies (for different isolation cones) for a + * given particle (through its barcode) + */ + const std::vector<float>& etIsol( const unsigned int barcode ) const; + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** The persistent pointer toward the @c McEventCollection the (transient) + * @c TruthParticleContainer is proxying + */ + ElementLinkInt_p1 m_genEvent; + + /** Persistent representation of a vector of @c TruthParticles + * we only store the vector of transverse energy isolation for + * different (pre-defined) isolation cones, this vector being + * labeled by the barcode of the @c GenParticle from which it has + * been computed. + */ + std::map< unsigned int, std::vector<float> > m_particles; +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainer_p3::TruthParticleContainer_p3() : + m_genEvent ( ), + m_particles( ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P3_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p4.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p4.h new file mode 100644 index 0000000000000000000000000000000000000000..094ed9044d47e3b703b314fe7613810cad08ace8 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p4.h @@ -0,0 +1,121 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p4.h +// Header file for class TruthParticleContainer_p4 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P4_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P4_H + +// STL includes +#include <vector> +#include <utility> + +// Persistent ElementLink +#include "DataModelAthenaPool/ElementLink_p1.h" + +// HepMC / CLHEP includes +#include "GeneratorObjects/McEventCollection.h" + +// Gaudi includes + +// Forward declaration +class TruthParticleContainer; +class TruthParticleContainer_p4; +class TruthParticleContainerCnv_p4; +template <typename TRANS, typename PERS> class T_TPCnv; +template <> +class T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4>; + +class TruthParticleContainer_p4 +{ + + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthParticleContainerCnv_p4; + friend class T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4>; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainer_p4(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** Retrieve the transverse energies (for different isolation cones) for a + * given particle (through its barcode) + */ + const std::vector<float>& etIsol( const unsigned int barcode ) const; + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** The persistent pointer toward the @c McEventCollection the (transient) + * @c TruthParticleContainer is proxying + */ + ElementLinkInt_p1 m_genEvent; + + //typedef GaudiUtils::VectorMap< unsigned int, std::vector<float> > Particles_t; + typedef std::vector< std::pair< unsigned int, std::vector<float> > > Particles_t; + /** Persistent representation of a vector of @c TruthParticles + * we only store the vector of transverse energy isolation for + * different (pre-defined) isolation cones, this vector being + * labeled by the barcode of the @c GenParticle from which it has + * been computed. + */ + Particles_t m_particles; + + protected: + + struct BarcodeFinder + { + BarcodeFinder( const std::size_t barcode ) : m_barcode(barcode) {} + + bool operator()( const Particles_t::value_type& p ) const { + return p.first == m_barcode; + } + + // the barcode we are looking for + std::size_t m_barcode; + }; + + struct BarcodeSorter + { + bool operator()( const Particles_t::value_type& lhs, + const Particles_t::value_type& rhs ) const { + return lhs.first < rhs.first; + } + }; + + +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainer_p4::TruthParticleContainer_p4() : + m_genEvent ( ), + m_particles( ) +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P4_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p5.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p5.h new file mode 100644 index 0000000000000000000000000000000000000000..0ce6183d4fe878f01a5435c74598ea3e4874c495 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p5.h @@ -0,0 +1,87 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p5.h +// Header file for class TruthParticleContainer_p5 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P5_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P5_H + +// STL includes +#include <vector> +#include <utility> + +// Persistent ElementLink +#include "DataModelAthenaPool/ElementLink_p1.h" + +// Gaudi includes + +// Forward declaration +class TruthParticleContainerCnv_p5; + +class TruthParticleContainer_p5 +{ + + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthParticleContainerCnv_p5; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainer_p5(); + + /** Destructor: + */ + ~TruthParticleContainer_p5(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** The persistent pointer toward the @c McEventCollection the (transient) + * @c TruthParticleContainer is proxying + */ + ElementLinkInt_p1 m_genEvent; + + /** + * The persistent pointer toward the @c TruthEtIsolations container the + * (transient) @c TruthParticleContainer may or may not be connected to. + */ + ElementLinkInt_p1 m_etIsolations; +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainer_p5::TruthParticleContainer_p5() : + m_genEvent ( ), + m_etIsolations( ) +{} + +inline +TruthParticleContainer_p5::~TruthParticleContainer_p5() +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P5_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p6.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p6.h new file mode 100644 index 0000000000000000000000000000000000000000..c65687aa0243164f08b48899fb1cf5e40d482c2e --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/TruthParticleContainer_p6.h @@ -0,0 +1,87 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p6.h +// Header file for class TruthParticleContainer_p6 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P6_H +#define MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P6_H + +// STL includes +#include <vector> +#include <utility> + +// Persistent ElementLink +#include "DataModelAthenaPool/ElementLink_p3.h" + +// Gaudi includes + +// Forward declaration +class TruthParticleContainerCnv_p6; + +class TruthParticleContainer_p6 +{ + + /////////////////////////////////////////////////////////////////// + // Friend classes + /////////////////////////////////////////////////////////////////// + + // Make the AthenaPoolCnv class our friend + friend class TruthParticleContainerCnv_p6; + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Default constructor: + */ + TruthParticleContainer_p6(); + + /** Destructor: + */ + ~TruthParticleContainer_p6(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Protected data: + /////////////////////////////////////////////////////////////////// + protected: + + /** The persistent pointer toward the @c McEventCollection the (transient) + * @c TruthParticleContainer is proxying + */ + ElementLinkInt_p3 m_genEvent; + + /** + * The persistent pointer toward the @c TruthEtIsolations container the + * (transient) @c TruthParticleContainer may or may not be connected to. + */ + ElementLinkInt_p3 m_etIsolations; +}; + +/////////////////////////////////////////////////////////////////// +/// Inline methods: +/////////////////////////////////////////////////////////////////// + +inline TruthParticleContainer_p6::TruthParticleContainer_p6() : + m_genEvent ( ), + m_etIsolations( ) +{} + +inline +TruthParticleContainer_p6::~TruthParticleContainer_p6() +{} + +#endif //> MCPARTICLEEVENTTPCNV_TRUTHPARTICLECONTAINER_P6_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/selection.xml b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..f8ecc5100e3cf79b4842843761e1ba8709dd0e36 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/McParticleEventTPCnv/selection.xml @@ -0,0 +1,16 @@ +<lcgdict> + + <class name="TruthParticleContainer_p4" id="545F1E63-AA6C-4490-B0E4-1BF71F1A170D" /> + + <class name="TruthParticleContainer_p5" id="2D25E3D9-950B-49E0-A51F-2B6EC93D1A23" /> + + <class name="TruthParticleContainer_p6" id="97AC2CEE-7E8A-4E2E-B6B5-FD8545D77FC4" /> + + <class name="TruthEtIsolationsContainer_p1" id="EB6EC9D5-4D99-4565-9E4A-65BE1C21B35D" /> + <class name="std::vector<TruthEtIsolations_p1>" /> + <class name="TruthEtIsolations_p1" /> + <class name="TruthEtIsolations_p1::EtIsolMap_t" /> + <class name="TruthEtIsolations_p1::EtIsolBc_t" /> + + +</lcgdict> diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/cmt/requirements b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/cmt/requirements new file mode 100644 index 0000000000000000000000000000000000000000..126037f828869d4e662cf7409d5d24896aa28146 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/cmt/requirements @@ -0,0 +1,39 @@ +package McParticleEventTPCnv +author Sebastien Binet <binet@cern.ch> + +## For Athena policies: it has to be the first use statement +use AtlasPolicy AtlasPolicy-* + +use GaudiInterface GaudiInterface-* External +use AtlasBoost AtlasBoost-* External +use AtlasROOT AtlasROOT-* External +use AtlasReflex AtlasReflex-* External +use AtlasHepMC AtlasHepMC-* External + +use AthenaKernel AthenaKernel-* Control +use DataModelAthenaPool DataModelAthenaPool-* Control +use StoreGate StoreGate-* Control + +use AthenaPoolCnvSvc AthenaPoolCnvSvc-* Database/AthenaPOOL + +use GeneratorObjects GeneratorObjects-* Generators + +use McParticleKernel McParticleKernel-* PhysicsAnalysis/TruthParticleID +use McParticleEvent McParticleEvent-* PhysicsAnalysis/TruthParticleID + +branches McParticleEventTPCnv src + +private +macro_append ROOT_linkopts " -lEG" +end_private + +library McParticleEventTPCnv *.cxx + +apply_pattern tpcnv_library + +apply_pattern lcgdict dict=McParticleEventTPCnv selectionfile=selection.xml headerfiles="-s=${McParticleEventTPCnv_root}/McParticleEventTPCnv McParticleEventTPCnvDict.h" +apply_pattern lcgdict dict=OLD_McParticleEventTPCnv selectionfile=OLD_selection.xml headerfiles="-s=${McParticleEventTPCnv_root}/McParticleEventTPCnv McParticleEventTPCnvDict.h" +apply_pattern lcgdict dict=ARA_McParticleEventTPCnv selectionfile=ARA_selection.xml headerfiles="-s=${McParticleEventTPCnv_root}/McParticleEventTPCnv McParticleEventTPCnvDict.h" + +macro_append McParticleEventTPCnvDict_dependencies " McParticleEventTPCnv" + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/McEtIsolVisitor.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/McEtIsolVisitor.h new file mode 100644 index 0000000000000000000000000000000000000000..e6a99673f63aac42bf0b7762b04571fde3b3a611 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/McEtIsolVisitor.h @@ -0,0 +1,146 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// McEtIsolVisitor.h +// Header file for class McEtIsolVisitor +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// +#ifndef MCPARTICLEEVENTTPCNV_MCETISOLVISITOR_H +#define MCPARTICLEEVENTTPCNV_MCETISOLVISITOR_H + +// STL includes +#include <stdexcept> + +// HepMC / CLHEP includes + +// Gaudi includes +#include "GaudiKernel/MsgStream.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleVisitor.h" + +// McParticleEvent includes +#include "McParticleEvent/TruthEtIsolations.h" + +// Forward declaration + +template <class TruthParticleContainer_pX> +class McEtIsolVisitor : public ITruthParticleVisitor +{ + + /////////////////////////////////////////////////////////////////// + // Public methods: + /////////////////////////////////////////////////////////////////// + public: + + /** Copy constructor: + */ + McEtIsolVisitor( const McEtIsolVisitor& rhs ) : + ITruthParticleVisitor(rhs), + m_msg ( rhs.m_msg ), + m_persObj( rhs.m_persObj ), + m_etIsols( rhs.m_etIsols ) + {} + + /** Constructor with parameters: + */ + McEtIsolVisitor( const TruthParticleContainer_pX& persObj, + TruthEtIsolations* etIsols, + MsgStream& msg ) : + ITruthParticleVisitor(), + m_msg ( &msg ), + m_persObj( persObj ), + m_etIsols( etIsols ) + {} + + /** Destructor: + */ + virtual ~McEtIsolVisitor(); + + /////////////////////////////////////////////////////////////////// + // Const methods: + /////////////////////////////////////////////////////////////////// + + /** The method to visit a @c TruthParticle to apply further modifications + * to the instance at hand. + */ + virtual void visit( TruthParticle* truthParticle ) const; + + /////////////////////////////////////////////////////////////////// + // Non-const methods: + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // Protected methods: + /////////////////////////////////////////////////////////////////// + protected: + + /** Default constructor: + */ + McEtIsolVisitor(); + + /** Assignment operator: + */ + McEtIsolVisitor& operator=( const McEtIsolVisitor& rhs ); + + /////////////////////////////////////////////////////////////////// + // Private data: + /////////////////////////////////////////////////////////////////// + private: + + mutable MsgStream* m_msg; + const TruthParticleContainer_pX& m_persObj; + + mutable TruthEtIsolations* m_etIsols; +}; + +/////////////////////////////////////////////////////////////////// +// Inline methods: +/////////////////////////////////////////////////////////////////// + +template<class TruthParticleContainer_pX> +McEtIsolVisitor<TruthParticleContainer_pX>::~McEtIsolVisitor() +{} + +template<class TruthParticleContainer_pX> +void +McEtIsolVisitor<TruthParticleContainer_pX>::visit( TruthParticle* mc ) const +{ + if ( 0 == mc ) { + return; + } + + const int barcode = mc->barcode(); + try { + const std::vector<float>& etIsolations = m_persObj.etIsol(barcode); + if ( etIsolations.empty() ) { + // do nothing: no particle will be registered in the TruthEtIsolations. + } else { + const HepMC::GenParticle* hepMcPart = mc->genParticle(); + for ( std::size_t j = 0; + j != static_cast<std::size_t>(TruthParticleParameters::NbrOfCones); + ++j ) { + m_etIsols->setEtIsol( hepMcPart, + static_cast<TruthParticleParameters::ConeSize>(j), + etIsolations[j] ); + + } + } + } catch (std::out_of_range& e) { + *m_msg << MSG::WARNING + << "Caught an out of range exception for this barcode: " << barcode + << endreq + << e.what() << endreq + << "This particle won't have any et isolation informations !!" + << endreq; + // we don't want to have a buggy McTruth, do we ? + throw std::runtime_error("Reqested an UNKNOWN TruthParticle/barcode"); + } + + return; +} + +#endif //> MCPARTICLEEVENTTPCNV_MCETISOLVISITOR_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/McParticleEventTPCnv.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/McParticleEventTPCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..3fd3f4e8509dac8bb4b4ee0a288f427753a4eb97 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/McParticleEventTPCnv.cxx @@ -0,0 +1,93 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// generate the T/P converter entries +#include "AthenaKernel/TPCnvFactory.h" + +// HepMc includes +#include "GeneratorObjects/McEventCollection.h" +#include "McParticleEvent/TruthEtIsolations.h" + +#include "McParticleEventTPCnv/TruthEtIsolationsCnv_p1.h" +#include "McParticleEventTPCnv/TruthEtIsolationsContainerCnv_p1.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p1.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p2.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p3.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p4.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p5.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p6.h" + +#include "McParticleEventTPCnv/RootTruthParticleContainerCnv_p4.h" + +DECLARE_TPCNV_FACTORY(TruthEtIsolationsCnv_p1, + TruthEtIsolations, + TruthEtIsolations_p1, + Athena::TPCnvVers::Current) + +DECLARE_NAMED_TPCNV_FACTORY(TruthEtIsolationsContainerCnv_p1, + TruthEtIsolationsContainerCnv_p1, + TruthEtIsolationsContainer, + TruthEtIsolationsContainer_p1, + Athena::TPCnvVers::Current) + +DECLARE_TPCNV_FACTORY(TruthParticleContainerCnv_p1, + TruthParticleContainer, + TruthParticleContainer_p1, + Athena::TPCnvVers::Old) + +DECLARE_TPCNV_FACTORY(TruthParticleContainerCnv_p2, + TruthParticleContainer, + TruthParticleContainer_p2, + Athena::TPCnvVers::Old) + +DECLARE_TPCNV_FACTORY(TruthParticleContainerCnv_p3, + TruthParticleContainer, + TruthParticleContainer_p3, + Athena::TPCnvVers::Old) + +DECLARE_TPCNV_FACTORY(TruthParticleContainerCnv_p4, + TruthParticleContainer, + TruthParticleContainer_p4, + Athena::TPCnvVers::Old) + +DECLARE_TPCNV_FACTORY(TruthParticleContainerCnv_p5, + TruthParticleContainer, + TruthParticleContainer_p5, + Athena::TPCnvVers::Old) + +DECLARE_TPCNV_FACTORY(TruthParticleContainerCnv_p6, + TruthParticleContainer, + TruthParticleContainer_p6, + Athena::TPCnvVers::Current) + +typedef T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4> +RootTruthParticleContainerCnv_p4; + +// DECLARE_NAMED_TPCNV_FACTORY(RootTruthParticleContainerCnv_p4, +// RootTruthParticleContainerCnv_p4, +// TruthParticleContainer, +// TruthParticleContainer_p4, +// Athena::TPCnvVers::Old) + +typedef T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4> +RootTruthParticleContainerCnv_p4; +DECLARE_ARATPCNV_FACTORY(RootTruthParticleContainerCnv_p4, + TruthParticleContainer, + TruthParticleContainer_p4, + Athena::TPCnvVers::Old) + +typedef T_TPCnv<TruthParticleContainer, TruthParticleContainer_p5> +RootTruthParticleContainerCnv_p5; +DECLARE_ARATPCNV_FACTORY(RootTruthParticleContainerCnv_p5, + TruthParticleContainer, + TruthParticleContainer_p5, + Athena::TPCnvVers::Old) + +typedef T_TPCnv<TruthParticleContainer, TruthParticleContainer_p6> +RootTruthParticleContainerCnv_p6; +DECLARE_ARATPCNV_FACTORY(RootTruthParticleContainerCnv_p6, + TruthParticleContainer, + TruthParticleContainer_p6, + Athena::TPCnvVers::Current) + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..ac1a2b27225a6f92904d7cbe5eca1fdf711b1775 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.cxx @@ -0,0 +1,211 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "RootTruthParticleCnvTool.h" +#include "GeneratorObjects/McEventCollection.h" +#include "McParticleEvent/TruthParticle.h" +#include "McParticleEvent/TruthParticleContainer.h" +#include "boost/array.hpp" +#include "TError.h" +#include "TDatabasePDG.h" +#include "TParticlePDG.h" + + +// GeneratorObjects includes +#include "GeneratorObjects/HepMcParticleLink.h" + +namespace { + +/** 3*charge for basic pdgId codes -- used to parse unknown id's + Fix from Frank for the charge of the MC Truth Particle */ +static const boost::array<int, 100> qcharge = { + {+0, -1, +2, -1, +2, -1, +2, -1, +2, +0, // 0-9 + +0, -3, +0, -3, +0, -3, +0, -3, +0, +0, // 10-19 + +0, +0, +0, +3, +0, +0, +0, +0, +0, +0, // 20-29 + +0, +0, +0, +3, +0, +0, +0, +3, +0, +0, // 30-39 + +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, + +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, + +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, + +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, + +0, +0, +0, +0, +0, +0, +0, +0, +0, +0, + +0, +0, +0, +0, +0, +0, +0, +0, +0, +0} +}; + +} + +StatusCode +RootTruthParticleCnvTool::convert(const McEventCollection *mcCollection, + const unsigned int genEventIndex, + TruthParticleContainer * container, + const ITruthParticleVisitor* visitor ) + const +{ + container->clear(); + + if ( 0 == mcCollection ) { + ::Warning ("RootTruthParticleCnvTool", + "Null pointer to McEventCollection !"); + return StatusCode::RECOVERABLE; + } + + if ( mcCollection->size() <= genEventIndex ) { + ::Warning ("RootTruthParticleCnvTool", + "McEventCollection size: %ui; Requested element nbr : %ui !!", + // we could use %zd instead of using %ui and casting size_t to + // unsigned int, but %zd is not ANSI... + (unsigned int)mcCollection->size(), + genEventIndex); + return StatusCode::RECOVERABLE; + } + + const HepMC::GenEvent * evt = (*mcCollection)[genEventIndex]; + container->setGenEvent( mcCollection, genEventIndex ); + + // reserve enough space for the container so we don't have to relocate it + container->reserve( evt->particles_size() ); + + /// Create a map to enhance access between GenParticles and TruthParticles + TruthParticleContainer::Map_t bcToMcPart; + + const HepMC::GenEvent::particle_const_iterator itrEnd = evt->particles_end(); + for ( HepMC::GenEvent::particle_const_iterator itrPart=evt->particles_begin(); + itrPart != itrEnd; + ++itrPart ) { + const HepMC::GenParticle * hepMcPart = (*itrPart); + + TruthParticle * mcPart = new TruthParticle( hepMcPart, container ); + container->push_back( mcPart ); + + if ( visitor ) { + visitor->visit( mcPart ); + } + + mcPart->setCharge( chargeFromPdgId( mcPart->pdgId() ) ); + mcPart->setGenEventIndex( genEventIndex); + + if ( hepMcPart != mcPart->genParticle() ) { + ::Error ("RootTruthParticleCnvTool", + "TruthParticle is not wrapping the GenParticle : %d !!", + hepMcPart->barcode()); + } + //bcToMcPart[ hepMcPart->barcode() ] = mcPart; + HepMcParticleLink mcLink( hepMcPart->barcode(), genEventIndex ); + bcToMcPart[ mcLink.compress() ] = mcPart; + + }//> end loop over particles + + // at this point the whole GenEvent has been proxied. + // so we can setup its VectorMap + container->setParticles( bcToMcPart ); + +#if 0 + // connect the TruthParticleContainer to the container of TruthEtIsolations + // if it exists and if we are asked for + if ( m_doEtIsolation.value() ) { + const std::string& etIsolName + = m_isolationTool->etIsolationsName( container->genEventName() ); + if ( etIsolName.empty() ) { + m_msg << MSG::WARNING + << "Could not retrieve the name of the TruthEtIsolations container" + << endreq; + return StatusCode::RECOVERABLE; + } + + const TruthEtIsolationsContainer* etIsols = 0; + if ( !m_storeGate->retrieve( etIsols, etIsolName ).isSuccess() ) { + m_msg << MSG::WARNING + << "Could not retrieve the TruthEtIsolations container at [" + << etIsolName << "] !!" + << endreq; + return StatusCode::RECOVERABLE; + } + + // index of HepMC::GenEvent within the McEventCollection is the same + // than the one of the TruthEtIsolations within the TruthEtIsolationsCont. + container->setEtIsolations( etIsols, genEventIndex ); + } +#endif + + return StatusCode::SUCCESS; +} + + +double RootTruthParticleCnvTool::chargeFromPdgId (int pdgId) const +{ + if (0 == pdgId) + return -999; + TParticlePDG* ap = TDatabasePDG::Instance()->GetParticle (pdgId); + if ( ap ) { + return ap->Charge()/3; + } else { + /** Set charge using PDG convention: + id = nnnnijkl + i == 0, j == 0: see qcharge[100] + i == 0: meson, j kbar quarks l = 2*spin+1 + i != 0: baryon, i j k quarks l = 2*spin+1 + Default is 0; */ + const int idmod = std::abs(pdgId) % 10000; + const int q1 = (idmod/10) % 10; + const int q2 = (idmod/100) % 10; + const int q3 = (idmod/1000) % 10; + double q = 0; + + if (abs(pdgId) >= 1000000000) { + // Seems to be a nucleus: 100pppnnn0 + q = (abs(pdgId) / 10000) % 1000; + } + else if( idmod < 100 ) { + q = qcharge[idmod]/3.; + } + else if ( idmod < 1000 ) { + q = (qcharge[q1]-qcharge[q2])/3.; + if ( qcharge[q2] == 2 ) { + q *= -1.; + } + } + else if( idmod < 10000 ) { + q = (qcharge[q3]+qcharge[q2]+qcharge[q1])/3.; + } + if (q == 0) q = 0; // Change -0 to 0. + return (pdgId < 0) ? -q : q; + } +} + + +StatusCode RootTruthParticleCnvTool::queryInterface(const InterfaceID&, + void** ){abort();} +unsigned long RootTruthParticleCnvTool::addRef(){abort();} +unsigned long RootTruthParticleCnvTool::release(){abort();} +StatusCode RootTruthParticleCnvTool::setProperty( const Property& ){abort();} + +StatusCode RootTruthParticleCnvTool::setProperty(const std::string&){abort();} +StatusCode RootTruthParticleCnvTool::setProperty( const std::string&, const std::string& ){abort();} +StatusCode RootTruthParticleCnvTool::getProperty( Property* ) const{abort();} +const Property& RootTruthParticleCnvTool::getProperty( const std::string&) const{abort();} +StatusCode RootTruthParticleCnvTool::getProperty( const std::string&, std::string& ) const{abort();} +const std::vector<Property*>& RootTruthParticleCnvTool::getProperties( ) const{abort();} + +const std::string& RootTruthParticleCnvTool::type() const{abort();} +const IInterface* RootTruthParticleCnvTool::parent() const{abort();} + +StatusCode RootTruthParticleCnvTool::configure(){abort();} +StatusCode RootTruthParticleCnvTool::initialize(){abort();} +StatusCode RootTruthParticleCnvTool::sysInitialize(){abort();} +StatusCode RootTruthParticleCnvTool::reinitialize(){abort();} +StatusCode RootTruthParticleCnvTool::sysReinitialize(){abort();} +StatusCode RootTruthParticleCnvTool::start(){abort();} +StatusCode RootTruthParticleCnvTool::sysStart(){abort();} +StatusCode RootTruthParticleCnvTool::restart(){abort();} +StatusCode RootTruthParticleCnvTool::sysRestart(){abort();} +StatusCode RootTruthParticleCnvTool::stop(){abort();} +StatusCode RootTruthParticleCnvTool::sysStop(){abort();} +StatusCode RootTruthParticleCnvTool::finalize(){abort();} +StatusCode RootTruthParticleCnvTool::sysFinalize(){abort();} +StatusCode RootTruthParticleCnvTool::terminate(){abort();} +unsigned long RootTruthParticleCnvTool::refCount() const{abort();} +const std::string& RootTruthParticleCnvTool::name() const{abort();} +StatusCode RootTruthParticleCnvTool::execute() {abort();} +#ifdef GAUDIKERNEL_STATEMACHINE_H_ +Gaudi::StateMachine::State RootTruthParticleCnvTool::FSMState() const{abort();} +#endif diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.h b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.h new file mode 100644 index 0000000000000000000000000000000000000000..16c382fbd572c50d1028f2bea34f1e1069c3f43c --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleCnvTool.h @@ -0,0 +1,69 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MCPARTICLEEVENTTPCNV_ROOTTRUTHPARTICLECNVTOOL_H +#define MCPARTICLEEVENTTPCNV_ROOTTRUTHPARTICLECNVTOOL_H + +#include "McParticleKernel/ITruthParticleCnvTool.h" + +class RootTruthParticleCnvTool + : public ITruthParticleCnvTool +{ +public: + /** Converts a @c McEventCollection into an @c TruthParticleContainer (ie: + * converts it into an AOD compliant collection). + * @in mcEvts the @c McEventCollection holding the @c HepMC::GenEvent we + * want to convert into a @c TruthParticleContainer + * @in genEvtIndex the index to the @c HepMC::GenEvent to be converted + * @out mcParts a valid pointer to a @c TruthParticleContainer which will + * be filled with adaptors to @c HepMC::GenParticles. + */ + StatusCode convert( const McEventCollection* mcEvts, + const unsigned int genEvtIndex, + TruthParticleContainer* mcParts, + const ITruthParticleVisitor* visitor ) const; + + /** Helper method to get the charge of a particle given its PDG Id. + */ + double chargeFromPdgId( int pdgId ) const; + + virtual StatusCode queryInterface(const InterfaceID& riid, + void** ppvInterface); + virtual unsigned long addRef(); + virtual unsigned long release(); + virtual StatusCode setProperty( const Property& p ); + virtual StatusCode setProperty( const std::string& s ); + virtual StatusCode setProperty( const std::string& n, const std::string& v ); + virtual StatusCode getProperty( Property* p ) const; + virtual const Property& getProperty( const std::string& name) const; + virtual StatusCode getProperty( const std::string& n, std::string& v ) const; + virtual const std::vector<Property*>& getProperties( ) const; + + virtual const std::string& type() const; + virtual const IInterface* parent() const; + virtual StatusCode configure(); + virtual StatusCode initialize(); + virtual StatusCode sysInitialize(); + virtual StatusCode reinitialize(); + virtual StatusCode sysReinitialize(); + virtual StatusCode start(); + virtual StatusCode sysStart(); + virtual StatusCode restart(); + virtual StatusCode sysRestart(); + virtual StatusCode stop(); + virtual StatusCode sysStop(); + virtual StatusCode finalize(); + virtual StatusCode sysFinalize(); + virtual StatusCode terminate(); + virtual unsigned long refCount() const; + virtual const std::string& name() const; + virtual StatusCode execute(); +#ifdef GAUDIKERNEL_STATEMACHINE_H_ + virtual Gaudi::StateMachine::State FSMState() const; +#endif +}; + +#endif // not MCPARTICLEEVENTTPCNV_ROOTTRUTHPARTICLECNVTOOL_H diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleContainerCnv_p4.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleContainerCnv_p4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6c6caf05abaded0ec97c51f212cf26330bbcf7f8 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/RootTruthParticleContainerCnv_p4.cxx @@ -0,0 +1,167 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// RootTruthParticleContainerCnv_p4.cxx +// Implementation file for root converters. +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" +#include "StoreGate/StoreGateSvc.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticle.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McEtIsolVisitor.h" +#include "McParticleEventTPCnv/RootTruthParticleContainerCnv_p4.h" +#include "RootTruthParticleCnvTool.h" +#include "TError.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4>::T_TPCnv() +{ + m_cnvTool = new RootTruthParticleCnvTool; +} + +// Destructor +/////////////// + +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4>::~T_TPCnv() +{ + delete m_cnvTool; +} + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4> + ::persToTrans( const TruthParticleContainer_p4* pers, + TruthParticleContainer* trans, + MsgStream& msg ) +{ + // convert the ElementLink<McEventCollection> + m_genEvtCnv.persToTrans( &pers->m_genEvent, + &trans->m_genEvent, + msg ); + + const McEventCollection* evt = trans->m_genEvent.getStorableObjectPointer(); + if ( 0 == evt ) { + ::Error ("RootTruthParticleContainerCnv_p4", + "NULL pointer to McEventCollection !!"); + throw std::runtime_error("conversion error"); + } + +#if 0 + // now extract the etIsolations from the persistent representation of + // the TruthParticleContainer and put them into a TruthEtIsolations container + TruthEtIsolationsContainer * etIsols = new TruthEtIsolationsContainer; + const std::string etIsolName = "TruthEtIsol_" + trans->genEventName(); + if ( !m_storeGate->record( etIsols, etIsolName ).isSuccess() ) { + msg << MSG::ERROR + << "Could not record a TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + delete etIsols; etIsols = 0; + throw std::runtime_error("No TruthEtIsolationsContainer could be stored !!"); + } + if ( !m_storeGate->setConst( etIsols ).isSuccess() ) { + msg << MSG::WARNING + << "Could not setConst the TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + } +#endif + + const unsigned int genEventIndex = pers->m_genEvent.m_elementIndex; + +#if 0 + TruthEtIsolations * etIsol = new TruthEtIsolations( trans->genEventName(), + genEventIndex ); + etIsols->push_back( etIsol ); + + // create a visitor which takes the persistent representation of the + // TruthParticleContainer as a parameter. + // This visitor will setup each TruthParticle with its EtIsol cone vector. + const McEtIsolVisitor<TruthParticleContainer_p4> visitor( *pers, + etIsol, + msg ); +#endif + + if ( !m_cnvTool->convert( evt, + genEventIndex, + trans, + 0/*&visitor*/ ).isSuccess() ) { + ::Error ("RootTruthParticleContainerCnv_p4", + "Problem converting HepMC::GenEvent [%s][%d] " + "to TruthParticleContainer !", + pers->m_genEvent.m_contName.c_str(), + pers->m_genEvent.m_elementIndex); + throw std::runtime_error("conversion error"); + } + + if ( !trans->m_genEvent.isValid() ) { + ::Error ("RootTruthParticleContainerCnv_p4", + "ElementLink to McEventCollection is not valid !"); + throw std::runtime_error("conversion error"); + } + +#if 0 + // connect the TruthParticleContainer to the container of TruthEtIsolations + trans->setEtIsolations( etIsols, genEventIndex ); +#endif + + return; +} + +void +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p4> + ::transToPers( const TruthParticleContainer*, + TruthParticleContainer_p4*, + MsgStream& /*msg*/ ) +{ + abort(); +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolationsCnv_p1.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolationsCnv_p1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c77f6019ae884f37c233e56fd2921f37d35a0cc5 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolationsCnv_p1.cxx @@ -0,0 +1,146 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolationsCnv_p1.cxx +// Implementation file for class TruthEtIsolationsCnv_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" + +// HepMc includes +#include "GeneratorObjects/McEventCollection.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthEtIsolations.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthEtIsolationsCnv_p1.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +typedef TruthEtIsolations_p1::EtIsolMap_t EtIsolMap_p; +typedef TruthEtIsolations_p1::EtIsolBc_t EtIsolBc_p; +typedef TruthEtIsolations_p1::EtIsolations_t EtIsolations_p; +typedef TruthEtIsolations::EtIsolMap_t EtIsolMap_t; + +void +TruthEtIsolationsCnv_p1::persToTrans( const TruthEtIsolations_p1* pers, + TruthEtIsolations* trans, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Loading TruthEtIsolations from persistent state..." + << endreq; + + if (0==pers || 0==trans) { + msg << MSG::WARNING + << "null pointer(s) received ! trans=[" << trans << "] pers=[" + << pers << "]" + << endmsg; + return; + } + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.persToTrans( &pers->m_genEvent, + &trans->m_genEvtLink, + msg ); + + const McEventCollection* evt= trans->m_genEvtLink.getStorableObjectPointer(); + if ( 0 == evt ) { + const std::string error("NULL pointer to McEventCollection !!"); + msg << MSG::ERROR << error + << endreq; + throw std::runtime_error(error); + } + + for ( EtIsolMap_p::const_iterator + i = pers->m_etIsolations.begin(), + iEnd = pers->m_etIsolations.end(); + i != iEnd; + ++i ) { + McAod::EtIsolations& etIsols = trans->m_etIsolations[i->first]; + std::copy( i->second.begin(), i->second.end(), + etIsols.begin() ); + } + + msg << MSG::DEBUG + << "Loaded TruthEtIsolations from persistent state [OK]" + << endreq; + return; +} + +void +TruthEtIsolationsCnv_p1::transToPers( const TruthEtIsolations* trans, + TruthEtIsolations_p1* pers, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Creating persistent state of TruthEtIsolations..." + << endreq; + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.transToPers( &trans->m_genEvtLink, + &pers->m_genEvent, + msg ); + + if ( !trans->m_genEvtLink.isValid() ) { + msg << MSG::WARNING + << "Transient ElementLink to McEventCollection is NOT valid !!" + << endreq; + } + + pers->m_etIsolations.reserve( trans->size() ); + for ( EtIsolMap_t::const_iterator + i = trans->m_etIsolations.begin(), + iEnd = trans->m_etIsolations.end(); + i != iEnd; + ++i ) { + pers->m_etIsolations.push_back( EtIsolBc_p( i->first, EtIsolations_p() ) ); + EtIsolations_p& etIsols = pers->m_etIsolations.back().second; + std::copy( i->second.begin(), + i->second.end(), + etIsols.begin() ); + } + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolationsContainerCnv_p1.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolationsContainerCnv_p1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f85082b189a38ff83d44e1eba6b421b8d2fe822e --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolationsContainerCnv_p1.cxx @@ -0,0 +1,14 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolationsContainerCnv_p1.cxx +// Implementation file for class TruthEtIsolationsContainerCnv_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthEtIsolationsContainerCnv_p1.h" diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolations_p1.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolations_p1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0230b19d7ed7d8110597b2c0cee14096ab6405b8 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthEtIsolations_p1.cxx @@ -0,0 +1,41 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthEtIsolations_p1.cxx +// Implementation file for class TruthEtIsolations_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> +#include <algorithm> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthEtIsolations_p1.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p1.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..99b1de44c2567afc24ecfa55777b26a32cf7fd83 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p1.cxx @@ -0,0 +1,137 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p1.cxx +// Implementation file for class TruthParticleContainerCnv_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" +#include "StoreGate/StoreGateSvc.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p1.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +TruthParticleContainerCnv_p1::persToTrans( const TruthParticleContainer_p1* pers, + TruthParticleContainer* trans, + MsgStream &log ) +{ + log << MSG::DEBUG + << "Loading TruthParticleContainer from persistent state..." + << endreq; + + if ( 0 == m_cnvTool ) { + log << MSG::ERROR + << "NULL pointer to ITruthParticleCnvTool !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to ITruthParticleCnvTool !!"); + } + + if ( 0 == m_storeGate ) { + log << MSG::ERROR + << "NULL pointer to StoreGateSvc !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to StoreGateSvc !!"); + } + + const McEventCollection* mcEvt = 0; + if ( m_storeGate->retrieve(mcEvt, pers->m_parentKey).isFailure() || + 0 == mcEvt ) { + log << MSG::ERROR + << "Could not retrieve McEventCollection at [" + << pers->m_parentKey + << "] !!" + << endreq; + throw std::runtime_error("No McEventCollection retrieved !!"); + } + + // at that time, the default was to write the first element + // of the McEventCollection (now we have more flexibility) + const unsigned int genEventIndex = 0; + if ( !m_cnvTool->convert( mcEvt, + genEventIndex, + trans ).isSuccess() ) { + log << MSG::ERROR + << "Problem converting McEventCollection to TruthParticleContainer !" + << endreq; + throw std::runtime_error("No TruthParticleContainer created !!"); + } + + log << MSG::DEBUG + << "Loaded TruthParticleContainer from persistent state [OK]" + << endreq; + return; +} + +void +TruthParticleContainerCnv_p1::transToPers( const TruthParticleContainer* /*trans*/, + TruthParticleContainer_p1* /*pers*/, + MsgStream &log ) +{ + log << MSG::DEBUG + << "Creating persistent state of TruthParticleContainer..." + << endreq; + + log << MSG::ERROR + << "This transient-to-persistent converter method has been RETIRED !!" + << endreq + << "You are not supposed to end-up here ! Go away !" + << endreq; + + throw std::runtime_error( "Retired TruthParticleContainerCnv_p1::transToPers() !!" ); + + log << MSG::DEBUG + << "Created persistent state of TruthParticleContainer [OK]" + << endreq; + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p2.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..28e218ba897737b0b7b9a6cdb63d4b12336a8254 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p2.cxx @@ -0,0 +1,180 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p2.cxx +// Implementation file for class TruthParticleContainerCnv_p2 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" +#include "StoreGate/StoreGateSvc.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticle.h" +#undef private +#undef protected +#include "McParticleEvent/TruthParticleParamDefs.h" + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p2.h" +#include "McEtIsolVisitor.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +TruthParticleContainerCnv_p2::persToTrans( const TruthParticleContainer_p2* pers, + TruthParticleContainer* trans, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Loading TruthParticleContainer from persistent state..." + << endreq; + + if ( 0 == m_cnvTool ) { + msg << MSG::ERROR + << "NULL pointer to ITruthParticleCnvTool !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to ITruthParticleCnvTool !!"); + } + + if ( 0 == m_storeGate ) { + msg << MSG::ERROR + << "NULL pointer to StoreGateSvc !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to StoreGateSvc !!"); + } + + const McEventCollection* mcEvt = 0; + if ( m_storeGate->retrieve(mcEvt, pers->m_parentKey).isFailure() || + 0 == mcEvt ) { + msg << MSG::ERROR + << "Could not retrieve McEventCollection at [" + << pers->m_parentKey + << "] !!" + << endreq; + throw std::runtime_error("No McEventCollection retrieved !!"); + } + + // now extract the etIsolations from the persistent representation of + // the TruthParticleContainer and put them into a TruthEtIsolations container + TruthEtIsolationsContainer * etIsols = new TruthEtIsolationsContainer; + const std::string etIsolName = "TruthEtIsol_" + pers->m_parentKey; + if ( !m_storeGate->record( etIsols, etIsolName ).isSuccess() ) { + msg << MSG::ERROR + << "Could not record a TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + delete etIsols; etIsols = 0; + throw std::runtime_error("No TruthEtIsolationsContainer could be stored !!"); + } + if ( !m_storeGate->setConst( etIsols ).isSuccess() ) { + msg << MSG::WARNING + << "Could not setConst the TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + } + + // at that time, the default was to write the first element + // of the McEventCollection (now we have more flexibility) + const unsigned int genEventIndex = 0; + + TruthEtIsolations * etIsol = new TruthEtIsolations( pers->m_parentKey, + genEventIndex ); + etIsols->push_back( etIsol ); + + // Create a visitor to fill the TruthEtIsolations container as we walk + // through the (huge) loop over TruthParticles + McEtIsolVisitor<TruthParticleContainer_p2> visitor( *pers, + etIsol, + msg ); + + if ( !m_cnvTool->convert( mcEvt, + genEventIndex, + trans, + &visitor ).isSuccess() ) { + msg << MSG::ERROR + << "Problem converting McEventCollection to TruthParticleContainer !" + << endreq; + throw std::runtime_error("No TruthParticleContainer created !!"); + } + + // connect the TruthParticleContainer to the container of TruthEtIsolations + trans->setEtIsolations( etIsols, genEventIndex ); + + msg << MSG::DEBUG + << "Loaded TruthParticleContainer from persistent state [OK]" + << endreq; + return; +} + +void +TruthParticleContainerCnv_p2::transToPers( const TruthParticleContainer* /*trans*/, + TruthParticleContainer_p2* /*pers*/, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Creating persistent state of TruthParticleContainer..." + << endreq; + + msg << MSG::ERROR + << "This transient-to-persistent converter method has been RETIRED !!" + << endreq + << "You are not supposed to end-up here ! Go away !" + << endreq; + + throw std::runtime_error( "Retired TruthParticleContainerCnv_p2::transToPers() !!" ); + + msg << MSG::DEBUG + << "Created persistent state of TruthParticleContainer [OK]" + << endreq; + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p3.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..4b16cf4f57baac1f1dd1852fb69c4536b78d55d9 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p3.cxx @@ -0,0 +1,186 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p3.cxx +// Implementation file for class TruthParticleContainerCnv_p3 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" +#include "StoreGate/StoreGateSvc.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticle.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McEtIsolVisitor.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p3.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +TruthParticleContainerCnv_p3::persToTrans( const TruthParticleContainer_p3* pers, + TruthParticleContainer* trans, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Loading TruthParticleContainer from persistent state..." + << endreq; + + if ( 0 == m_cnvTool ) { + msg << MSG::ERROR + << "NULL pointer to ITruthParticleCnvTool !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to ITruthParticleCnvTool !!"); + } + + if ( 0 == m_storeGate ) { + msg << MSG::ERROR + << "NULL pointer to StoreGateSvc !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to StoreGateSvc !!"); + } + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.persToTrans( &pers->m_genEvent, + &trans->m_genEvent, + msg ); + + const McEventCollection* evt = trans->m_genEvent.getStorableObjectPointer(); + if ( 0 == evt ) { + const std::string error("NULL pointer to McEventCollection !!"); + msg << MSG::ERROR << error + << endreq; + throw std::runtime_error(error); + } + + // now extract the etIsolations from the persistent representation of + // the TruthParticleContainer and put them into a TruthEtIsolations container + TruthEtIsolationsContainer * etIsols = new TruthEtIsolationsContainer; + const std::string etIsolName = "TruthEtIsol_" + trans->genEventName(); + if ( !m_storeGate->record( etIsols, etIsolName ).isSuccess() ) { + msg << MSG::ERROR + << "Could not record a TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + delete etIsols; etIsols = 0; + throw std::runtime_error("No TruthEtIsolationsContainer could be stored !!"); + } + if ( !m_storeGate->setConst( etIsols ).isSuccess() ) { + msg << MSG::WARNING + << "Could not setConst the TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + } + + const unsigned int genEventIndex = pers->m_genEvent.m_elementIndex; + + TruthEtIsolations * etIsol = new TruthEtIsolations( trans->genEventName(), + genEventIndex ); + etIsols->push_back( etIsol ); + + // create a visitor which takes the persistent representation of the + // TruthParticleContainer as a parameter. + // This visitor will setup each TruthParticle with its EtIsol cone vector. + const McEtIsolVisitor<TruthParticleContainer_p3> visitor( *pers, + etIsol, + msg ); + + if ( !m_cnvTool->convert( evt, + genEventIndex, + trans, + &visitor ).isSuccess() ) { + msg << MSG::ERROR + << "Problem converting HepMC::GenEvent [" + << pers->m_genEvent.m_contName << "][" + << pers->m_genEvent.m_elementIndex << "]" + << " to TruthParticleContainer !" + << endreq; + throw std::runtime_error("No TruthParticleContainer created !!"); + } + + if ( !trans->m_genEvent.isValid() ) { + const std::string err = "ElementLink to McEventCollection is not valid !"; + msg << MSG::ERROR << err << endreq; + throw std::runtime_error(err); + } + + // connect the TruthParticleContainer to the container of TruthEtIsolations + trans->setEtIsolations( etIsols, genEventIndex ); + + msg << MSG::DEBUG + << "Loaded TruthParticleContainer from persistent state [OK]" + << endreq; + return; +} + +void +TruthParticleContainerCnv_p3::transToPers( const TruthParticleContainer* /*trans*/, + TruthParticleContainer_p3* /*pers*/, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Creating persistent state of TruthParticleContainer..." + << endreq; + + msg << MSG::ERROR + << "This transient-to-persistent converter method has been RETIRED !!" + << endreq + << "You are not supposed to end-up here ! Go away !" + << endreq; + + throw std::runtime_error( "Retired TruthParticleContainerCnv_p3::transToPers() !!" ); + + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p4.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bcd1a7ab6bbc70d11e5775571408d72a21d6dce7 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p4.cxx @@ -0,0 +1,177 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p4.cxx +// Implementation file for class TruthParticleContainerCnv_p4 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" +#include "StoreGate/StoreGateSvc.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticle.h" +#undef private +#undef protected + +// McParticleEventTPCnv includes +#include "McEtIsolVisitor.h" +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p4.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +TruthParticleContainerCnv_p4::persToTrans( const TruthParticleContainer_p4* pers, + TruthParticleContainer* trans, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Loading TruthParticleContainer from persistent state..." + << endreq; + + if ( 0 == m_cnvTool ) { + msg << MSG::ERROR + << "NULL pointer to ITruthParticleCnvTool !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to ITruthParticleCnvTool !!"); + } + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.persToTrans( &pers->m_genEvent, + &trans->m_genEvent, + msg ); + + const McEventCollection* evt = trans->m_genEvent.getStorableObjectPointer(); + if ( 0 == evt ) { + const std::string error("NULL pointer to McEventCollection !!"); + msg << MSG::ERROR << error + << endreq; + throw std::runtime_error(error); + } + + // now extract the etIsolations from the persistent representation of + // the TruthParticleContainer and put them into a TruthEtIsolations container + TruthEtIsolationsContainer * etIsols = new TruthEtIsolationsContainer; + const std::string etIsolName = "TruthEtIsol_" + trans->genEventName(); + if ( !m_storeGate->record( etIsols, etIsolName ).isSuccess() ) { + msg << MSG::ERROR + << "Could not record a TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + delete etIsols; etIsols = 0; + throw std::runtime_error("No TruthEtIsolationsContainer could be stored !!"); + } + if ( !m_storeGate->setConst( etIsols ).isSuccess() ) { + msg << MSG::WARNING + << "Could not setConst the TruthEtIsolationsContainer at [" + << etIsolName << "] !!" + << endreq; + } + + const unsigned int genEventIndex = pers->m_genEvent.m_elementIndex; + + TruthEtIsolations * etIsol = new TruthEtIsolations( trans->genEventName(), + genEventIndex ); + etIsols->push_back( etIsol ); + + // create a visitor which takes the persistent representation of the + // TruthParticleContainer as a parameter. + // This visitor will setup each TruthParticle with its EtIsol cone vector. + const McEtIsolVisitor<TruthParticleContainer_p4> visitor( *pers, + etIsol, + msg ); + + if ( !m_cnvTool->convert( evt, + genEventIndex, + trans, + &visitor ).isSuccess() ) { + msg << MSG::ERROR + << "Problem converting HepMC::GenEvent [" + << pers->m_genEvent.m_contName << "][" + << pers->m_genEvent.m_elementIndex << "]" + << " to TruthParticleContainer !" + << endreq; + throw std::runtime_error("No TruthParticleContainer created !!"); + } + + if ( !trans->m_genEvent.isValid() ) { + const std::string err = "ElementLink to McEventCollection is not valid !"; + msg << MSG::ERROR << err << endreq; + throw std::runtime_error(err); + } + + // connect the TruthParticleContainer to the container of TruthEtIsolations + trans->setEtIsolations( etIsols, genEventIndex ); + + msg << MSG::DEBUG + << "Loaded TruthParticleContainer from persistent state [OK]" + << endreq; + return; +} + +void +TruthParticleContainerCnv_p4::transToPers( const TruthParticleContainer*, + TruthParticleContainer_p4*, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Creating persistent state of TruthParticleContainer..." + << endreq; + + msg << MSG::ERROR + << "This transient-to-persistent converter method has been RETIRED !!" + << endreq + << "You are not supposed to end-up here ! Go away !" + << endreq; + + throw std::runtime_error( "Retired TruthParticleContainerCnv_p4::transToPers() !!" ); + + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p5.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p5.cxx new file mode 100644 index 0000000000000000000000000000000000000000..431e8f56cd392098a0776274f64d4d74dbb488dd --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p5.cxx @@ -0,0 +1,159 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p5.cxx +// Implementation file for class TruthParticleContainerCnv_p5 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticle.h" +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected +#include "McParticleEvent/TruthEtIsolationsContainer.h" + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p5.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +TruthParticleContainerCnv_p5::persToTrans( const TruthParticleContainer_p5* pers, + TruthParticleContainer* trans, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Loading TruthParticleContainer from persistent state..." + << endreq; + + if ( 0 == m_cnvTool ) { + msg << MSG::ERROR + << "NULL pointer to ITruthParticleCnvTool !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to ITruthParticleCnvTool !!"); + } + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.persToTrans( &pers->m_genEvent, + &trans->m_genEvent, + msg ); + + const McEventCollection* evt = trans->m_genEvent.getStorableObjectPointer(); + if ( 0 == evt ) { + const std::string error("NULL pointer to McEventCollection !!"); + msg << MSG::ERROR << error + << endreq; + throw std::runtime_error(error); + } + + if ( !m_cnvTool->convert( evt, + pers->m_genEvent.m_elementIndex, + trans ).isSuccess() ) { + msg << MSG::ERROR + << "Problem converting HepMC::GenEvent [" + << pers->m_genEvent.m_contName << "][" + << pers->m_genEvent.m_elementIndex << "]" + << " to TruthParticleContainer !" + << endreq; + throw std::runtime_error("No TruthParticleContainer created !!"); + } + + if ( !trans->m_genEvent.isValid() ) { + const std::string err = "ElementLink to McEventCollection is not valid !"; + msg << MSG::ERROR << err << endreq; + throw std::runtime_error(err); + } + + // convert the ElementLink<TruthEtIsolationsContainer> + // this needs to be done *AFTER* the GenEvent->TPContainer conversion !! + m_etIsolCnv.persToTrans( &pers->m_etIsolations, + &trans->m_etIsolations, + msg ); + + msg << MSG::DEBUG + << "Loaded TruthParticleContainer from persistent state [OK]" + << endreq; + return; +} + +void +TruthParticleContainerCnv_p5::transToPers( const TruthParticleContainer*, + TruthParticleContainer_p5*, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Creating persistent state of TruthParticleContainer..." + << endreq; + + msg << MSG::ERROR + << "This transient-to-persistent converter method has been RETIRED !!" + << endreq + << "You are not supposed to end-up here ! Go away !" + << endreq; + + throw std::runtime_error( "Retired TruthParticleContainerCnv_p4::transToPers() !!" ); + + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + + + +#include "RootTruthParticleCnvTool.h" +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p5>::T_TPCnv() +{ + m_cnvTool = new RootTruthParticleCnvTool; +} + + +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p5>::~T_TPCnv() +{ + delete m_cnvTool; +} diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p6.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p6.cxx new file mode 100644 index 0000000000000000000000000000000000000000..97b055267f2a348348668b9eb91828ba400efe11 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainerCnv_p6.cxx @@ -0,0 +1,178 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainerCnv_p6.cxx +// Implementation file for class TruthParticleContainerCnv_p6 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + +// STL includes + +// Framework includes +#include "GaudiKernel/MsgStream.h" + +// HepMC includes +#include "HepMC/GenParticle.h" +#include "GeneratorObjects/McEventCollection.h" + +// McParticleKernel includes +#include "McParticleKernel/ITruthParticleCnvTool.h" + +// McParticleEvent includes +#define private public +#define protected public +#include "McParticleEvent/TruthParticle.h" +#include "McParticleEvent/TruthParticleContainer.h" +#undef private +#undef protected +#include "McParticleEvent/TruthEtIsolationsContainer.h" + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainerCnv_p6.h" + +#include "McParticleEvent/PileUpClassification.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +void +TruthParticleContainerCnv_p6::persToTrans( const TruthParticleContainer_p6* pers, + TruthParticleContainer* trans, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Loading TruthParticleContainer from persistent state..." + << endreq; + + if ( 0 == m_cnvTool ) { + msg << MSG::ERROR + << "NULL pointer to ITruthParticleCnvTool !!" + << endreq + << "Can't create *ANY* TruthParticleContainer !!" + << endreq; + throw std::runtime_error("NULL pointer to ITruthParticleCnvTool !!"); + } + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.persToTrans( &pers->m_genEvent, + &trans->m_genEvent, + msg ); + + const McEventCollection* evt = trans->m_genEvent.getStorableObjectPointer(); + if ( 0 == evt ) { + const std::string error("NULL pointer to McEventCollection !!"); + msg << MSG::ERROR << error + << endreq; + throw std::runtime_error(error); + } + + // retrieve the pileup type of this container : it is the same as the GenEvent it is linked to. + PileUpClassification::PileuType_t putype = PileUpClassification::pileUpType(evt,pers->m_genEvent.m_elementIndex); + // retrieve all GenEvent corresponding to this pile-up type : + size_t firstEvt, lastEvt; + PileUpClassification::findEventIterators(putype, evt, firstEvt, lastEvt); + msg << MSG::DEBUG << " Converting pile-up type = "<< putype << " from McEventCollection index "<< firstEvt << " to "<< lastEvt << endreq; + // loop on the GenEvent to fill the container. + for( ; firstEvt != lastEvt; firstEvt++){ + + if ( !m_cnvTool->convert( evt, + firstEvt, + trans ).isSuccess() ) { + msg << MSG::ERROR + << "Problem converting HepMC::GenEvent [" + << trans->m_genEvent.dataID() << "][" + << firstEvt << "]" + << " to TruthParticleContainer !" + << endreq; + throw std::runtime_error("No TruthParticleContainer created !!"); + } + } + + if ( !trans->m_genEvent.isValid() ) { + const std::string err = "ElementLink to McEventCollection is not valid !"; + msg << MSG::ERROR << err << endreq; + throw std::runtime_error(err); + } + + // convert the ElementLink<TruthEtIsolationsContainer> + // this needs to be done *AFTER* the GenEvent->TPContainer conversion !! + m_etIsolCnv.persToTrans( &pers->m_etIsolations, + &trans->m_etIsolations, + msg ); + + msg << MSG::DEBUG + << "Loaded TruthParticleContainer from persistent state [OK]" + << endreq; + return; +} + +void +TruthParticleContainerCnv_p6::transToPers( const TruthParticleContainer* trans, + TruthParticleContainer_p6* pers, + MsgStream& msg ) +{ + msg << MSG::DEBUG + << "Creating persistent state of TruthParticleContainer..." + << endreq; + + // convert the ElementLink<McEventCollection> + m_genEvtCnv.transToPers( &trans->m_genEvent, + &pers->m_genEvent, + msg ); + + if ( !trans->m_genEvent.isValid() ) { + msg << MSG::WARNING + << "Transient ElementLink is NOT valid !!" << endreq; + } + + // convert the ElementLink<TruthEtIsolationsContainer> + m_etIsolCnv.transToPers( &trans->m_etIsolations, + &pers->m_etIsolations, + msg ); + + return; +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + + + +#include "RootTruthParticleCnvTool.h" +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p6>::T_TPCnv() +{ + m_cnvTool = new RootTruthParticleCnvTool; +} + + +T_TPCnv<TruthParticleContainer, TruthParticleContainer_p6>::~T_TPCnv() +{ + delete m_cnvTool; +} diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p1.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..69a66feb537d80990ca99a63b6a66ac59066cbba --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p1.cxx @@ -0,0 +1,40 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p1.cxx +// Implementation file for class TruthParticleContainer_p1 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p1.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p2.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8f30c7610d65793edaa2d88837e573663f8ed656 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p2.cxx @@ -0,0 +1,52 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p2.cxx +// Implementation file for class TruthParticleContainer_p2 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p2.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +const std::vector<float>& +TruthParticleContainer_p2::etIsol( const unsigned int barcode ) const +{ + std::map<unsigned int, std::vector<float> >::const_iterator itr = m_particles.find(barcode); + if ( itr != m_particles.end() ) { + return itr->second; + } else { + std::string error = "TruthParticleContainer_p2::etIsol: No matching barcode has been found !"; + throw std::out_of_range(error); + } +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p3.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..655b9ef9ff957c1e513c998389010f9d791c8e70 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p3.cxx @@ -0,0 +1,52 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p3.cxx +// Implementation file for class TruthParticleContainer_p3 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p3.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +const std::vector<float>& +TruthParticleContainer_p3::etIsol( const unsigned int barcode ) const +{ + std::map<unsigned int, std::vector<float> >::const_iterator itr = m_particles.find(barcode); + if ( itr != m_particles.end() ) { + return itr->second; + } else { + std::string error = "TruthParticleContainer_p3::etIsol: No matching barcode has been found !"; + throw std::out_of_range(error); + } +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p4.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p4.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cf180d6f9efb94dfb7c4342268135d936a66dbaf --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p4.cxx @@ -0,0 +1,55 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p4.cxx +// Implementation file for class TruthParticleContainer_p4 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> +#include <algorithm> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p4.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +const std::vector<float>& +TruthParticleContainer_p4::etIsol( const unsigned int barcode ) const +{ + Particles_t::const_iterator itr = std::find_if( m_particles.begin(), + m_particles.end(), + BarcodeFinder(barcode) ); + if ( itr != m_particles.end() ) { + return itr->second; + } else { + std::string error = "TruthParticleContainer_p4::etIsol: No matching barcode has been found !"; + throw std::out_of_range(error); + } +} + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p5.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p5.cxx new file mode 100644 index 0000000000000000000000000000000000000000..15c5d61d23e68e0a3487b974bb6d114331339ba4 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p5.cxx @@ -0,0 +1,41 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p5.cxx +// Implementation file for class TruthParticleContainer_p5 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> +#include <algorithm> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p5.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// + diff --git a/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p6.cxx b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p6.cxx new file mode 100644 index 0000000000000000000000000000000000000000..79697738f7612871b6f38a9000599148eeb56da0 --- /dev/null +++ b/PhysicsAnalysis/TruthParticleID/McParticleEventTPCnv/src/TruthParticleContainer_p6.cxx @@ -0,0 +1,41 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// TruthParticleContainer_p6.cxx +// Implementation file for class TruthParticleContainer_p6 +// Author: S.Binet<binet@cern.ch> +/////////////////////////////////////////////////////////////////// + + +// STL includes +#include <stdexcept> +#include <algorithm> + +// McParticleEventTPCnv includes +#include "McParticleEventTPCnv/TruthParticleContainer_p6.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// + +// Destructor +/////////////// + +/////////////////////////////////////////////////////////////////// +// Const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Non-const methods: +/////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////// +// Protected methods: +/////////////////////////////////////////////////////////////////// +