NtupleReader/NtupleReader/MyElectron.ixx

00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002 // 23.10.2006, AUTHOR: OLIVER KORTNER
00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00004 
00005 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00006 //:: IMPLEMENTATION OF INLINE METHODS DEFINED IN THE CLASS MyElectron ::
00007 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00008 
00009 //*****************************************************************************
00010 
00011   //:::::::::::::::::
00012   //:: METHOD init ::
00013   //:::::::::::::::::
00014 
00015 inline void MyElectron::init(const TLorentzVector & p,
00016                              const TLorentzVector & p_track,
00017                              const double & echarge,
00018                              const bool & egamma_flag,
00019                              const bool & softe_flag,
00020                              const double & eoverp,
00021                              const double & isem,
00022                              const double & neuralnet,
00023                              const int & index,
00024                              const double et_cone[4],
00025                              const double & ethad1,
00026                              const std::vector<double> * track_et_cone,
00027                              int vertex_index,
00028                              const std::vector<double> * trackIsolationEnergy) {
00029 
00030     m_tlv = p;
00031     m_tlv_track = p_track;
00032     m_charge = echarge;
00033     m_egamma_flag = egamma_flag;
00034     m_softe_flag = softe_flag;
00035     m_E_over_p = eoverp;
00036     m_isEM = (int)isem;
00037     m_NeuralNet = neuralnet;
00038     m_index = index;
00039     m_type = "electron";
00040     m_pdgId = (int)m_charge*-11;
00041     for (unsigned int k=0; k<4; k++) {
00042         if (et_cone!=0) {
00043             m_Et_in_cone[k] = et_cone[k];
00044         } else {
00045             m_Et_in_cone[k] = 0.0;
00046         }
00047     }
00048     m_matchingflag = 0;
00049     m_ethad1 = ethad1;
00050     m_vertex_index = vertex_index;
00051 
00052     if (track_et_cone!=0) {
00053         if (track_et_cone->size()!=4) {
00054             std::cerr << std::endl
00055                       << "Class MyElectron, method init: ERROR!\n"
00056                       << "Wrong dimension of track_et_cone!\n"
00057                       << "Size should be 4!\n"
00058                       << std::endl;
00059             exit(1);
00060         }
00061         m_track_Et_in_cone[0] = (*track_et_cone)[0];
00062         m_track_Et_in_cone[1] = (*track_et_cone)[1];
00063         m_track_Et_in_cone[2] = (*track_et_cone)[2];
00064         m_track_Et_in_cone[3] = (*track_et_cone)[3];
00065     } else {
00066         m_track_Et_in_cone[0] = 0;
00067         m_track_Et_in_cone[1] = 0;
00068         m_track_Et_in_cone[2] = 0;
00069         m_track_Et_in_cone[3] = 0;
00070     }
00071     if (trackIsolationEnergy!=0) {
00072         if (trackIsolationEnergy->size()!=4) {
00073             std::cerr << std::endl
00074                       << "Class MyElectron, method init: ERROR!\n"
00075                       << "Wrong dimension of trackIsolationEnergy!\n"
00076                       << "Size should be 4!\n"
00077                       << std::endl;
00078             exit(1);
00079         }
00080         m_trackIsolationEnergy[0] = (*trackIsolationEnergy)[0];
00081         m_trackIsolationEnergy[1] = (*trackIsolationEnergy)[1];
00082         m_trackIsolationEnergy[2] = (*trackIsolationEnergy)[2];
00083         m_trackIsolationEnergy[3] = (*trackIsolationEnergy)[3];
00084     } else {
00085         m_trackIsolationEnergy[0] = 0;
00086         m_trackIsolationEnergy[1] = 0;
00087         m_trackIsolationEnergy[2] = 0;
00088         m_trackIsolationEnergy[3] = 0;
00089     }
00090 
00091     m_id_flag = -1;
00092 
00093     return;
00094 
00095   }
00096 
00097 //*****************************************************************************
00098 
00099   //:::::::::::::::::::::::::
00100   //:: METHOD e_gamma_flag ::
00101   //:::::::::::::::::::::::::
00102 
00103 inline bool MyElectron::e_gamma_flag(void) const {
00104 
00105     return m_egamma_flag;
00106 
00107   }
00108 
00109 //*****************************************************************************
00110 
00111   //::::::::::::::::::
00112   //:: METHOD is_em ::
00113   //::::::::::::::::::
00114 
00115 inline int MyElectron::is_em(void) const {
00116 
00117     return m_isEM;
00118 
00119   }
00120 //*****************************************************************************
00121 
00122   //::::::::::::::::::::::
00123   //:: METHOD NeuralNet ::
00124   //::::::::::::::::::::::
00125 
00126 inline double MyElectron::NeuralNet(void) const {
00127 
00128     return m_NeuralNet;
00129 
00130   }
00131 //*****************************************************************************
00132 
00133   //::::::::::::::::::::::::
00134   //:: METHOD soft_e_flag ::
00135   //::::::::::::::::::::::::
00136 
00137 inline bool MyElectron::soft_e_flag(void) const {
00138 
00139     return m_softe_flag;
00140 
00141   }
00142 
00143 //*****************************************************************************
00144 
00145   //:::::::::::::::::::::
00146   //:: METHOD e_over_p ::
00147   //:::::::::::::::::::::
00148 
00149 inline double MyElectron::e_over_p(void) const {
00150 
00151     return m_E_over_p;
00152 
00153   }
00154 
00155 //*****************************************************************************
00156 
00157   //:::::::::::::::::::::::
00158   //:: METHOD Et_in_cone ::
00159   //:::::::::::::::::::::::
00160 
00161 inline double MyElectron::Et_in_cone(const int & delta_R_index) const {
00162 
00164     // CHECK INDEX //
00166 
00167     if (delta_R_index<0 || delta_R_index>4) {
00168         std::cerr << "\n"
00169                   << "Class MyElectron, method Et_in_cone: ERROR!\n"
00170                   << "Wrong delta_R_index " << delta_R_index
00171                   << ", must be >=0 and <=3.\n";
00172         exit(1);
00173     }
00174 
00176     // RETURN THE REQUESTED ENERGY //
00178 
00179     return m_Et_in_cone[delta_R_index];
00180 
00181   }
00182 
00183 //*****************************************************************************
00184 
00185   //:::::::::::::::::::
00186   //:: METHOD ethad1 ::
00187   //:::::::::::::::::::
00188 
00189 inline double MyElectron::ethad1(void) const {
00190 
00191     return m_ethad1;
00192 
00193   }
00194 
00195 
00196 //*****************************************************************************
00197 
00198 //:::::::::::::::::::::::::::::
00199 //:: METHOD track_Et_in_cone ::
00200 //:::::::::::::::::::::::::::::
00201 
00202 inline double MyElectron::track_Et_in_cone(const int & delta_R_index) const {
00203 
00205 // CHECK INDEX //
00207 
00208     if (delta_R_index<0 || delta_R_index>4) {
00209         std::cerr << "\n"
00210                   << "Class MyElectron, "
00211                   << "method track_Et_in_cone: ERROR!\n"
00212                   << "Wrong delta_R_index " << delta_R_index
00213                   << ", must be >=0 and <=3.\n";
00214         exit(1);
00215     }
00216     
00218 // RETURN THE REQUESTED ENERGY //
00220 
00221     return m_track_Et_in_cone[delta_R_index];
00222 
00223 }
00224 
00225 //*****************************************************************************
00226 
00227 //:::::::::::::::::::::::::::::::::
00228 //:: METHOD trackIsolationEnergy ::
00229 //:::::::::::::::::::::::::::::::::
00230 
00231 inline double MyElectron::trackIsolationEnergy(const int & delta_R_index) const {
00232 
00234 // CHECK INDEX //
00236 
00237     if (delta_R_index<0 || delta_R_index>4) {
00238         std::cerr << "\n"
00239                   << "Class MyElectron, "
00240                   << "method trackIsolationEnergy: ERROR!\n"
00241                   << "Wrong delta_R_index " << delta_R_index
00242                   << ", must be >=0 and <=3.\n";
00243         exit(1);
00244     }
00245     
00247 // RETURN THE REQUESTED ENERGY //
00249 
00250     return m_trackIsolationEnergy[delta_R_index];
00251 
00252 }
00253 
00254 //*****************************************************************************
00255 
00256   //::::::::::::::::::::
00257   //:: METHOD id_flag ::
00258   //::::::::::::::::::::
00259 
00260 inline int MyElectron::id_flag(void) const {
00261 
00262     return m_id_flag;
00263 
00264   }
00265 
00266 //*****************************************************************************
00267 
00268   //:::::::::::::::::::::::::::::
00269   //:: METHOD set_e_gamma_flag ::
00270   //:::::::::::::::::::::::::::::
00271 
00272 inline void MyElectron::set_e_gamma_flag(const bool & flag) {
00273 
00274     m_egamma_flag = flag;
00275     return;
00276 
00277   }
00278 
00279 //*****************************************************************************
00280 
00281   //::::::::::::::::::::::::::::
00282   //:: METHOD set_soft_e_flag ::
00283   //::::::::::::::::::::::::::::
00284 
00285 inline void MyElectron::set_soft_e_flag(const bool & flag) {
00286 
00287     m_softe_flag = flag;
00288     return;
00289 
00290   }
00291 
00292 //*****************************************************************************
00293 
00294   //::::::::::::::::::
00295   //:: set_e_over_p ::
00296   //::::::::::::::::::
00297 
00298 inline void MyElectron::set_e_over_p(const double & eoverp) {
00299 
00300     m_E_over_p = eoverp;
00301     return;
00302 
00303   }
00304 
00305 //*****************************************************************************
00306 
00307   //:::::::::::::::::::::::::::
00308   //:: METHOD set_Et_in_cone ::
00309   //:::::::::::::::::::::::::::
00310 
00311 inline void MyElectron::set_Et_in_cone(const double et_in_cone[4]) {
00312 
00313     for (int k=0; k<4; k++) {
00314         m_Et_in_cone[k] = et_in_cone[k];
00315     }
00316 
00317     return;
00318 
00319   }
00320 
00321 //*****************************************************************************
00322 
00323   //::::::::::::::::
00324   //:: set_ethad1 ::
00325   //::::::::::::::::
00326 
00327 inline void MyElectron::set_ethad1(const double & ethad1) {
00328 
00329     m_ethad1 = ethad1;
00330     return;
00331 
00332   }
00333 
00334 
00335 //*****************************************************************************
00336 
00337 //:::::::::::::::::::::::::::::::::
00338 //:: METHOD set_track_Et_in_cone ::
00339 //:::::::::::::::::::::::::::::::::
00340 
00341 inline void MyElectron::set_track_Et_in_cone(const double et_in_cone[4]) {
00342 
00343     for (int k=0; k<4; k++) {
00344         m_track_Et_in_cone[k] = et_in_cone[k];
00345     }
00346     
00347     return;
00348     
00349   }
00350 
00351 //*****************************************************************************
00352 
00353 //:::::::::::::::::::::::::::::::::::::
00354 //:: METHOD set_trackIsolationEnergy ::
00355 //:::::::::::::::::::::::::::::::::::::
00356 
00357 inline void MyElectron::set_trackIsolationEnergy(const double et_in_cone[4]) {
00358 
00359     for (int k=0; k<4; k++) {
00360         m_trackIsolationEnergy[k] = et_in_cone[k];
00361     }
00362     
00363     return;
00364     
00365   }
00366 
00367 //*****************************************************************************
00368 
00369   //::::::::::::::::::::::::
00370   //:: METHOD set_id_flag ::
00371   //::::::::::::::::::::::::
00372 
00373 inline void MyElectron::set_id_flag(const int & flag) {
00374 
00375     m_id_flag = flag;
00376     return;
00377 
00378   }
00379 
00380 //*****************************************************************************
00381 
00382   //::::::::::::::::::::::::::
00383   //:: METHOD PrintParticle ::
00384   //::::::::::::::::::::::::::
00385 
00386 inline void MyElectron::PrintParticle(std::string option) {
00387     
00388     if(option=="v"){
00389         std::cout << "   ethad1:                       " 
00390                   << m_ethad1 << std::endl;
00391     }
00392     
00393     return;
00394   }
00395 
00396 //*****************************************************************************
00397 
00398 //::::::::::::::::::::
00399 //:: METHOD p_track ::
00400 //::::::::::::::::::::
00401 
00402 inline TLorentzVector MyElectron::tlv_track(void) const {
00403 
00404     return m_tlv_track;
00405 
00406 }
00407 

Generated on Tue Oct 21 11:50:45 2008 for NtupleAnalysis by  doxygen 1.5.1