00001
00002 #ifndef COMPONENTS_MCTRUTHMANAGER_H
00003 #define COMPONENTS_MCTRUTHMANAGER_H 1
00004
00005 #include <utility>
00006
00007
00008 #include "HepMC/GenEvent.h"
00009
00010 namespace LHCb {
00011 class MCParticle ;
00012 };
00013
00020 class MCTruthManager
00021 {
00022 public:
00023
00024
00025 enum MCTruthBarCode {
00026 DummyBarCode = 20000000,
00027 SplitBarCode = 100000000
00028 };
00029
00031 enum MCTruthPDGID {
00032 DummyPDGID = -99000000
00033 };
00034
00035 virtual ~MCTruthManager( );
00036
00037 static MCTruthManager* GetInstance();
00038
00039 void NewEvent();
00040 HepMC::GenEvent* GetCurrentEvent() {
00041 return event;
00042 };
00043
00044 void PrintEvent();
00045
00046 void AddParticle(HepMC::FourVector& fourMom,
00047 HepMC::FourVector& prodPos, HepMC::FourVector& endPos,
00048 int pdg, int trID, int parentID, bool directParent,
00049 int creatorID, LHCb::MCParticle * motherMCP ,
00050 bool oscillated = false );
00051
00052 const std::vector<int>& GetPrimaryBarcodes();
00053
00054 int GetCreatorID(int barcode);
00055
00056 const std::vector<int>& GetOscillatedBarcodes();
00057
00059 LHCb::MCParticle * GetMotherMCParticle( const int barcode ) ;
00060
00061 protected:
00062 MCTruthManager( );
00063
00064
00065 private:
00066 HepMC::GenEvent* event;
00067
00068
00069 std::vector<int> primarybarcodes;
00070
00071
00072 std::map<int,int> creators;
00073
00074
00075 std::vector<int> oscillated;
00076
00077
00078
00079
00080 std::map<int,int> segmentations;
00081
00083 std::map< int , LHCb::MCParticle * > m_mcparticles ;
00084
00085
00086 void printTree(HepMC::GenParticle*,std::string);
00087
00088 };
00089 #endif // COMPONENTS_MCTRUTHMANAGER_H