00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00002 // 06.12.2006, AUTHOR: MANFRED GROH 00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00004 00005 #ifndef MyTruthParticleManagerH 00006 #define MyTruthParticleManagerH 00007 00008 //:::::::::::::::::::::::::::::::::: 00009 //:: CLASS MyTruthParticleManager :: 00010 //:::::::::::::::::::::::::::::::::: 00011 00031 00032 //:::::::::::::::::: 00033 //:: HEADER FILES :: 00034 //:::::::::::::::::: 00035 00036 // standard C++ // 00037 #include <iostream> 00038 #include <vector> 00039 00040 // ROOT // 00041 #include "TLorentzVector.h" 00042 00043 // MyParticle base class // 00044 #include "MyTruthParticle.h" 00045 00046 class MyTruthParticleManager { 00047 00048 public: 00049 // Constructors // 00050 00052 MyTruthParticleManager(void) { 00053 std::vector<MyParticle*> empty_v_truth_particles; 00054 empty_v_truth_particles.clear(); 00055 init(empty_v_truth_particles); 00056 } 00057 00059 MyTruthParticleManager(const std::vector<MyParticle*> in_truth_particles){ 00060 init(in_truth_particles); 00061 } 00062 00063 00064 00065 // Methods // 00067 void set_generator(std::string gen); 00068 // general get methods // 00071 std::vector<MyParticle*> getParticles_with_ID(unsigned int pdgId) const; 00072 00074 MyTruthParticle* getParticle_with_barcode(unsigned int tmp_barcode)const; 00075 00078 MyTruthParticle* get_mother(MyTruthParticle* truth_particle) const; 00079 00087 MyTruthParticle* get_primary_mother(MyTruthParticle* truth_particle) const; 00088 00095 std::vector<MyTruthParticle*> 00096 get_children(MyTruthParticle* truth_particle) const; 00097 00103 MyTruthParticle* get_last_instance(MyTruthParticle* part_in); 00104 00109 std::vector<MyParticle*> remove_multiples_wo_using_genstat(std::vector<MyParticle*> v_input); 00110 00114 std::vector<MyParticle*> remove_multiples(std::vector<MyParticle*> v_input); 00115 00116 00117 // interesting decay chain get methods // 00121 unsigned int get_n_of_decay_chains(void) const ; 00122 00127 MyTruthParticle* get_primary_intpart(int n_decay_chain) const ; 00128 00134 std::vector<MyTruthParticle*> 00135 get_gen1_children_intpart(int n_decay_chain) const; 00136 00144 std::vector< std::vector<MyTruthParticle*> > 00145 get_gen2_children_intpart(int n_decay_chain) const ; 00146 00147 // methods to find & process interesting decays // 00154 int find_decay_chain_of(std::vector<unsigned int> interesting_pdgIds); 00155 00158 bool process_decay_chains(void); 00159 00160 00161 00162 private: 00163 // TruthParticle data // 00164 // full truth data 00165 std::vector<MyTruthParticle*> v_truth_particles; 00166 // name of the generator 00167 std::string generator; 00168 // the usefull genstat values, set at set_generator 00169 unsigned int genstat_e; 00170 unsigned int genstat_mu; 00171 unsigned int genstat_tau; 00172 // number of interesting decay chains found 00173 int n_of_decay_chains; 00174 // decay chain data of first interesting particle 00175 // the primary particle 00176 MyTruthParticle* primary_intpart_0; 00177 // vector that holds 1st generation children of this particle 00178 std::vector<MyTruthParticle*> v_intpart_0_children_gen1; 00179 // vector that holds 2nd generation children of this particle 00180 std::vector< std::vector<MyTruthParticle*> > vv_intpart_0_children_gen2; 00181 // vector of second interesting particle 00182 // decay chain data of second interesting particle 00183 MyTruthParticle* primary_intpart_1; 00184 std::vector<MyTruthParticle*> v_intpart_1_children_gen1; 00185 std::vector< std::vector<MyTruthParticle*> > vv_intpart_1_children_gen2; 00186 00187 // Methods // 00188 // initialize the object 00189 // set the vector of given truth particles as full truth data 00190 // returns true if all input particles were stored 00191 // returns false in case of errors 00192 bool init(std::vector<MyParticle*> in_truth_particles); 00193 }; 00194 00195 #endif