NtupleReader/NtupleReader/MyMuon.ixx

00001 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00002 // 22.10.2006, AUTHOR: OLIVER KORTNER
00003 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00004 
00005 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00006 //:: IMPLEMENTATION OF INLINE METHODS DEFINED IN THE CLASS MyMuon ::
00007 //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
00008 
00009 //*****************************************************************************
00010 
00011 //:::::::::::::::::
00012 //:: METHOD init ::
00013 //:::::::::::::::::
00014 
00015 inline void MyMuon::init( const TLorentzVector & p,
00016                           const double & mu_charge,
00017                           const int & alg_flag,
00018                           const int & rec_flag,
00019                           const int & index,
00020                           const double Et_cone[8],
00021                           const int nb_tracks_cone[8],
00022                           const double & fitChi2,
00023                           const int & fitNumberDoF,
00024                           const double & fitChi2OverDoF,
00025                           const double & matchChi2,
00026                           const int & matchNumberDoF,
00027                           const double & matchChi2OverDoF,
00028                           const int & hasCombMuonTrackParticle,
00029                           const std::vector<double> * track_Et_cone,
00030                           int vertex_index,
00031                           const std::vector<double> * trackIsolationEnergy) {
00032 
00033         m_tlv = p;
00034         m_charge = mu_charge;
00035         m_alg_flag = alg_flag;
00036         m_flag = rec_flag;
00037         m_index = index;
00038         m_type = "muon";
00039         m_pdgId = (int)m_charge*-13;
00040         for (unsigned int k=0; k<8; k++) {
00041                 if (Et_cone!=0) {
00042                         m_Et_cone[k] = Et_cone[k];
00043                 } else {
00044                         m_Et_cone[k] = 0.0;     
00045                 }
00046                 if (nb_tracks_cone!=0) {
00047                         m_nb_tracks_cone[k] = nb_tracks_cone[k];
00048                 } else {
00049                         m_nb_tracks_cone[k] = 0;
00050                 }
00051         }
00052         m_fitChi2 = fitChi2;
00053         m_fitNumberDoF = fitNumberDoF;
00054         m_fitChi2OverDoF = fitChi2OverDoF;
00055         m_matchChi2 = matchChi2;
00056         m_matchNumberDoF = matchNumberDoF;
00057         m_matchChi2OverDoF = matchChi2OverDoF;
00058         
00059         m_matchingflag = 0;
00060         
00061         m_hasCombinedMuonTrackParticle = (bool)hasCombMuonTrackParticle;
00062         m_vertex_index = vertex_index;
00063         
00064         if (track_Et_cone!=0) {
00065             if (track_Et_cone->size()!=8) {
00066                 std::cerr << std::endl
00067                           << "Class MyMuon, method init: ERROR!\n"
00068                           << "Wrong dimension of track_et_cone!\n"
00069                           << "Size should be 8!\n"
00070                           << std::endl;
00071                 exit(1);
00072             }
00073             for (unsigned int k=0; k<8; k++) {
00074                 m_track_Et_cone[k] = (*track_Et_cone)[k];
00075             }
00076         } else {
00077             for (unsigned int k=0; k<8; k++) {
00078                 m_track_Et_cone[k] = 0;
00079             }
00080         }
00081         if (trackIsolationEnergy!=0) {
00082             if (trackIsolationEnergy->size()!=8) {
00083                 std::cerr << std::endl
00084                           << "Class MyMuon, method init: ERROR!\n"
00085                           << "Wrong dimension of trackIsolationEnergy!\n"
00086                           << "Size should be 8!\n"
00087                           << std::endl;
00088                 exit(1);
00089             }
00090             for (unsigned int k=0; k<8; k++) {
00091                 m_trackIsolationEnergy[k] = (*trackIsolationEnergy)[k];
00092             }
00093         } else {
00094             for (unsigned int k=0; k<8; k++) {
00095                 m_trackIsolationEnergy[k] = 0;
00096             }
00097         }
00098 
00099 
00100         return;
00101 
00102 }
00103 
00104 //*****************************************************************************
00105 
00106 //:::::::::::::::::::::::::::
00107 //:: METHOD algorithm_flag ::
00108 //:::::::::::::::::::::::::::
00109 
00110 inline int MyMuon::algorithm_flag(void) const {
00111 
00112     return m_alg_flag;
00113 
00114 }
00115 
00116 //*****************************************************************************
00117 
00118 //::::::::::::::::::::::::::::::::
00119 //:: METHOD reconstruction_flag ::
00120 //::::::::::::::::::::::::::::::::
00121 
00122 inline int MyMuon::reconstruction_flag(void) const {
00123 
00124         return m_flag;
00125 
00126 }
00127 
00128 //*****************************************************************************
00129 
00130 //:::::::::::::::::::::::::::::::::::::::::
00131 //:: METHOD hasCombinedMuonTrackParticle ::
00132 //:::::::::::::::::::::::::::::::::::::::::
00133 
00134 inline bool MyMuon::hasCombinedMuonTrackParticle(void) const {
00135         return m_hasCombinedMuonTrackParticle;
00136 
00137 }
00138 
00139 //*****************************************************************************
00140 
00141 //:::::::::::::::::::::::
00142 //:: METHOD Et_in_cone ::
00143 //:::::::::::::::::::::::
00144 
00145 inline double MyMuon::Et_in_cone(const int & delta_R_index) const {
00146 
00148 // CHECK THE INDEX //
00150 
00151         if (delta_R_index<0 || delta_R_index>7) {
00152                 std::cerr << "\n"
00153                         << "Class MyMuon, method Et_in_cone: ERROR!\n"
00154                         << "Wrong delta_R_index " << delta_R_index
00155                         << ", must be >=0 and <=7.\n";
00156                 exit(1);
00157         }
00158 
00160 // RETURN THE REQUESTED TRANSVERSE ENERGY //
00162 
00163         return m_Et_cone[delta_R_index];
00164 
00165 }
00166 
00167 //*****************************************************************************
00168 
00169 //:::::::::::::::::::::::::::::
00170 //:: METHOD track_Et_in_cone ::
00171 //:::::::::::::::::::::::::::::
00172 
00173 inline double MyMuon::track_Et_in_cone(const int & delta_R_index) const {
00174 
00176 // CHECK THE INDEX //
00178 
00179     if (delta_R_index<0 || delta_R_index>7) {
00180         std::cerr << "\n"
00181                   << "Class MyMuon, method track_Et_in_cone: ERROR!\n"
00182                   << "Wrong delta_R_index " << delta_R_index
00183                   << ", must be >=0 and <=7.\n";
00184         exit(1);
00185     }
00186 
00188 // RETURN THE REQUESTED TRANSVERSE ENERGY //
00190     
00191     return m_track_Et_cone[delta_R_index];
00192 
00193 }
00194 
00195 //*****************************************************************************
00196 
00197 //:::::::::::::::::::::::::::::
00198 //:: METHOD trackIsolationEnergy ::
00199 //:::::::::::::::::::::::::::::
00200 
00201 inline double MyMuon::trackIsolationEnergy(const int & delta_R_index) const {
00202 
00204 // CHECK THE INDEX //
00206 
00207     if (delta_R_index<0 || delta_R_index>7) {
00208         std::cerr << "\n"
00209                   << "Class MyMuon, method trackIsolationEnergy: ERROR!\n"
00210                   << "Wrong delta_R_index " << delta_R_index
00211                   << ", must be >=0 and <=7.\n";
00212         exit(1);
00213     }
00214 
00216 // RETURN THE REQUESTED TRANSVERSE ENERGY //
00218     
00219     return m_trackIsolationEnergy[delta_R_index];
00220 
00221 }
00222 //*****************************************************************************
00223 
00224 //::::::::::::::::::::::::::::::
00225 //:: METHOD nb_tracks_in_cone ::
00226 //::::::::::::::::::::::::::::::
00227 
00228 inline int MyMuon::nb_tracks_in_cone(const int & delta_R_index) const {
00229 
00231 // CHECK THE INDEX //
00233 
00234         if (delta_R_index<0 || delta_R_index>7) {
00235                 std::cerr << "\n"
00236                         << "Class MyMuon, nb_tracks_in_cone Et_in_cone: "
00237                         << "ERROR!\n"
00238                         << "Wrong delta_R_index " << delta_R_index
00239                         << ", must be >=0 and <=7.\n";
00240                 exit(1);
00241         }
00242 
00244 // RETURN THE REQUESTED TRANSVERSE ENERGY //
00246 
00247         return m_nb_tracks_cone[delta_R_index];
00248 
00249 }
00250 
00251 //*****************************************************************************
00252 
00253 //::::::::::::::::::::
00254 //:: METHOD fitChi2 ::
00255 //::::::::::::::::::::
00256 
00257 inline double MyMuon::fitChi2(void) const {
00258 
00259         return m_fitChi2;
00260 
00261 }
00262 
00263 //*****************************************************************************
00264 
00265 //:::::::::::::::::::::::::
00266 //:: METHOD fitNumberDoF ::
00267 //:::::::::::::::::::::::::
00268 
00269 inline int MyMuon::fitNumberDoF(void) const {
00270 
00271         return m_fitNumberDoF;
00272 
00273 }
00274 
00275 //*****************************************************************************
00276 
00277 //:::::::::::::::::::::::::::
00278 //:: METHOD  fitChi2OverDoF::
00279 //:::::::::::::::::::::::::::
00280 
00281 inline double MyMuon::fitChi2OverDoF(void) const {
00282 
00283         return m_fitChi2OverDoF;
00284 
00285 }
00286 
00287 //*****************************************************************************
00288 
00289 //::::::::::::::::::::::
00290 //:: METHOD matchChi2 ::
00291 //::::::::::::::::::::::
00292 
00293 inline double MyMuon::matchChi2(void) const {
00294 
00295         return m_matchChi2;
00296 
00297 }
00298 
00299 //*****************************************************************************
00300 
00301 //:::::::::::::::::::::::::::
00302 //:: METHOD matchNumberDoF ::
00303 //:::::::::::::::::::::::::::
00304 
00305 inline int MyMuon::matchNumberDoF(void) const {
00306 
00307         return m_matchNumberDoF;
00308 
00309 }
00310 
00311 //*****************************************************************************
00312 
00313 //:::::::::::::::::::::::::::::
00314 //:: METHOD matchChi2OverDoF ::
00315 //:::::::::::::::::::::::::::::
00316 
00317 inline double MyMuon::matchChi2OverDoF(void) const {
00318 
00319         return m_matchChi2OverDoF;
00320 
00321 }
00322 
00323 //*****************************************************************************
00324 
00325 //::::::::::::::::::::::::::::::::::::
00326 //:: METHOD set_reconstruction_flag ::
00327 //::::::::::::::::::::::::::::::::::::
00328 
00329 inline void MyMuon::set_reconstruction_flag(const int & flag) {
00330 
00331         m_flag = flag;
00332         return;
00333 
00334 }
00335 
00336 //*****************************************************************************
00337 
00338 //:::::::::::::::::::::::::::
00339 //:: METHOD set_Et_in_cone ::
00340 //:::::::::::::::::::::::::::
00341 
00342 inline void MyMuon::set_Et_in_cone(const double Et_cone[8]) {
00343 
00344         for (unsigned int k=0; k<8; k++) {
00345                 m_Et_cone[k] = Et_cone[k];
00346         }
00347 
00348         return;
00349 
00350 }
00351 
00352 //*****************************************************************************
00353 
00354 //:::::::::::::::::::::::::::::::::
00355 //:: METHOD set_track_Et_in_cone ::
00356 //:::::::::::::::::::::::::::::::::
00357 
00358 inline void MyMuon::set_track_Et_in_cone(const double Et_cone[8]) {
00359 
00360         for (unsigned int k=0; k<8; k++) {
00361                 m_track_Et_cone[k] = Et_cone[k];
00362         }
00363 
00364         return;
00365 
00366 }
00367 
00368 //*****************************************************************************
00369 
00370 //:::::::::::::::::::::::::::::::::::::
00371 //:: METHOD set_trackIsolationEnergy ::
00372 //:::::::::::::::::::::::::::::::::::::
00373 
00374 inline void MyMuon::set_trackIsolationEnergy(const double Et_cone[8]) {
00375 
00376         for (unsigned int k=0; k<8; k++) {
00377                 m_trackIsolationEnergy[k] = Et_cone[k];
00378         }
00379 
00380         return;
00381 
00382 }
00383 
00384 //*****************************************************************************
00385 
00386 //::::::::::::::::::::::::::::::::::
00387 //:: METHOD set_nb_tracks_in_cone ::
00388 //::::::::::::::::::::::::::::::::::
00389 
00390 inline void MyMuon::set_nb_tracks_in_cone(const int nb_tracks_cone[8]) {
00391 
00392         for (unsigned int k=0; k<8; k++) {
00393                 m_nb_tracks_cone[k] = nb_tracks_cone[k];
00394         }
00395 
00396         return;
00397 
00398 }
00399 
00400 //*****************************************************************************
00401 
00402 //::::::::::::::::::::::::::
00403 //:: METHOD PrintParticle ::
00404 //::::::::::::::::::::::::::
00405 
00406 inline void MyMuon::PrintParticle(std::string option) {
00407 
00408 
00409    //  std::cout << "algorithm flag:               " 
00410 //          << Form("%i", this->algorithm_flag()) << std::endl;
00411 //     std::cout << "reco flag, hasCombMuTrkPart:  " 
00412 //          << Form("%i, %i",
00413 //                  this->reconstruction_flag(),
00414 //                  this->hasCombinedMuonTrackParticle() ) << std::endl;
00415     std::cout << "   alg, rec flag, CombMuTrkPart: " 
00416          << Form("%i, %i, %i",
00417                  this->algorithm_flag(),
00418                  this->reconstruction_flag(),
00419                  this->hasCombinedMuonTrackParticle() ) << std::endl;
00420     std::cout << "   fit: chi2, dof, chi2/dof:     "
00421          << Form("%.2f, %i, %.2f",
00422                  this->fitChi2(),
00423                  this->fitNumberDoF(),
00424                  this->fitChi2OverDoF()) << std::endl;
00425     std::cout << "   match: chi2, dof, chi2/dof:   "
00426          << Form("%.2f, %i, %.2f",
00427                  this->matchChi2(),
00428                  this->matchNumberDoF(),
00429                  this->matchChi2OverDoF()) << std::endl;
00430 
00431     
00432     if (option=="v"){
00433         std::cout << "   cone:                         " 
00434                   << "0.1\t  0.2\t  0.3\t  0.4\t  0.45\t  0.5\t  0.6\t  0.7" << std::endl
00435                   << "   Et:                           "
00436                   << Form("%.2f\t %.2f\t %.2f\t %.2f\t %.2f\t %.2f\t %.2f\t %.2f",
00437                           this->Et_in_cone(0),
00438                           this->Et_in_cone(1),
00439                           this->Et_in_cone(2),
00440                           this->Et_in_cone(3),
00441                           this->Et_in_cone(4),
00442                           this->Et_in_cone(5),
00443                           this->Et_in_cone(6),
00444                           this->Et_in_cone(7) ) 
00445                   << std::endl;
00446         std::cout << "   n_trk:                        "
00447                   << Form("%i\t  %i\t  %i\t  %i\t  %i\t  %i\t  %i\t  %i",
00448                           this->nb_tracks_in_cone(0),
00449                           this->nb_tracks_in_cone(1),
00450                           this->nb_tracks_in_cone(2),
00451                           this->nb_tracks_in_cone(3),
00452                           this->nb_tracks_in_cone(4),
00453                           this->nb_tracks_in_cone(5),
00454                           this->nb_tracks_in_cone(6),
00455                           this->nb_tracks_in_cone(7) ) 
00456                   << std::endl;
00457     }
00458     
00459     return;
00460 }

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