Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

TMBTrackCalJet.cpp

Go to the documentation of this file.
00001 
00002 //                                                                      //
00003 //  TMBTrackCalJet                                                      //
00004 //                                                                      //
00005 //  Ariel Schwartzman
00006 //                                                                      //
00008 
00009 #include "tmb_tree/TMBTrackCalJet.hpp"
00010 #include "tmb_tree/TMBTrack.hpp"
00011 #include "tmb_tree/TMBVertex.hpp"
00012 
00013 ClassImp(TMBTrackCalJet);
00014 
00015 
00016 
00017 TMBTrackCalJet::TMBTrackCalJet() 
00018 {
00019   //
00020 }
00021 
00022 TMBTrackCalJet::TMBTrackCalJet(TRef jet, TRefArray* trackCalList, 
00023                                Float_t C, Float_t Cin, 
00024                                Float_t Cout, Float_t Csub, 
00025                                std::vector<Float_t> Efraction, 
00026                                std::vector<Int_t> Ncells) : 
00027   _q(999.9)
00028 {
00029   SetPxPyPzE(999.9, 999.9, 999.9, 999.9);
00030   
00031   _jet     = jet;
00032   
00033   _trackCalList.Clear();
00034   if (trackCalList) {
00035     for (Int_t i=0; i<trackCalList->GetLast()+1; i++) {
00036       _trackCalList.Add( trackCalList->At(i) );
00037     }
00038   }
00039   
00040   _Corr = C;
00041   _Cin  = Cin;
00042   _Cout = Cout;
00043   _Csub = Csub;
00044 
00045   _Efraction.clear();
00046   for(Int_t i=0; i < (Int_t )Efraction.size(); i++) {
00047     _Efraction.push_back(Efraction[i]);
00048   }
00049   
00050   _Ncells.clear();
00051   for(Int_t i=0; i < (Int_t )Ncells.size(); i++) {
00052     _Ncells.push_back(Ncells[i]);
00053   }
00054 
00055 
00056   TMBJet* Jet = (TMBJet*) this->GetJet();
00057   if(Jet) {
00058     Jet->ActAsUnCorrected();
00059     SetPxPyPzE(Jet->Px()*_Corr, 
00060                Jet->Py()*_Corr, 
00061                Jet->Pz()*_Corr,
00062                Jet->E()*_Corr);
00063     _q  = Jet->charge();
00064   } else {
00065     std::cout << "TMBTrackCalJet::ERROR no matching TMBJet" << std::endl;
00066   }
00067 
00068 }
00069 
00070 
00071 TMBTrackCalJet::~TMBTrackCalJet() 
00072 {
00073   //
00074 }
00075 
00076 /*
00077 void TMBTrackCalJet::MatchTracks(float& Ein, int& ntrkin, 
00078                                  float& Eout, int& ntrkout, 
00079                                  float track_cone_size,
00080                                  float ptMin, float ptMax, 
00081                                  float dcaRmax, float dcaZmax,
00082                                  int cftMin, int smtMin)
00083 {
00084   Ein = 0; ntrkin = 0;
00085   Eout = 0; ntrkout = 0;
00086 
00087   int np=_trackCalList.GetLast()+1;
00088   for(int i=0; i<np; ++i){
00089     TMBTrackCal* tmbtrkcal = (TMBTrackCal*) this->GetTrackCal(i);
00090     TMBTrack*  tmbtrk = (TMBTrack*) tmbtrkcal->GetChargedTrack();
00091     TMBVertex* tmbvtx = (TMBVertex*) tmbtrkcal->GetVertex();
00092 
00093     float pT = tmbtrk->Pt();
00094     float ztrk  = tmbtrk->trpars(1);
00095     int smt = tmbtrk->nsmt();
00096     int cft = tmbtrk->ncft();
00097     float dcaZ = tmbtrkcal->getDCAz();
00098     float dcaR = tmbtrkcal->getDCAr();
00099     float DR_PV = this->GetDR(i);
00100     float EoverP = tmbtrkcal->getE015(15)/E;
00101     float expectedTrackCalEnergy = tmbtrkcal->SinglePionResponse();
00102 
00103     if(Vertex==0 && pT>ptMin && pT<ptMax && 
00104        dcaR<dcaRmax && dcaZ<dcaZmax && 
00105        DR_PV<track_cone_size && cft>=cftMin && smt>=smtMin) {
00106       
00107       //in
00108       if(_Efraction[i]>0) {
00109         ntrkin ++;
00110         if(EoverP>0.5) Ein += E - expectedTrackCalEnergy;
00111         else Ein += p;
00112       } else {
00113         //if(DR_CH>0.5) {
00114         ntrkout++;
00115         Eout += E;
00116         //}
00117       }
00118     }
00119   }
00120 
00121 }
00122 */
00123 
00124 
00125 void TMBTrackCalJet::print(std::ostream& os) const
00126 {
00127   TMBJet* tmbjet = (TMBJet*) this->GetJet();
00128 
00129   os << std::endl;
00130   os << "TrackCalJet::print" << std::endl;
00131   os << "pT;  eta, phi = " << tmbjet->Pt() << ";   ";
00132   os << tmbjet->Eta() << ", " << tmbjet->Phi() << std::endl;
00133    
00134   int np=_trackCalList.GetLast()+1;
00135   os << np << " tracks: ";
00136   os << std::endl;
00137   os << " properties: " << std::endl;
00138   for(int i=0; i<np; ++i){
00139     TMBTrackCal* tmbtrkcal = (TMBTrackCal*) this->GetTrackCal(i);
00140     TMBTrack*  tmbtrk = (TMBTrack*) tmbtrkcal->GetChargedTrack();
00141     TMBVertex* tmbvtx = (TMBVertex*) tmbtrkcal->GetVertex();
00142 
00143     float pt = tmbtrk->Pt();
00144     float p  = tmbtrk->P();
00145     float Deta  = tmbtrkcal->PtWeighteDetectorEta();
00146     float ztrk  = tmbtrk->trpars(1);
00147     int smt = tmbtrk->nsmt();
00148     int cft = tmbtrk->ncft();
00149 
00150     os << "   pT = " << pt << ", P = " << p << ", deta = " << Deta << ", ztrk = "
00151        << ztrk << std::endl;
00152     os << "   phi = " << tmbtrk->Phi() << std::endl;
00153     os << "   smt = " << smt << ", cft = " << cft << std::endl;
00154     os << "   Etrackcal = " << tmbtrkcal->getE015(15) << std::endl;
00155     os << "   Efraction = " << _Efraction[i] << std::endl;
00156     os << "   Ncells    = " << _Ncells[i] << std::endl;
00157     os << "   DR        = " << this->GetDR(i) << std::endl;
00158     os << "   dr1       = " << this->GetDR(i,1) << std::endl;
00159     os << "   dr15      = " << this->GetDR(i,15) << std::endl;
00160     os << "   vtx Z     = " << tmbvtx->vz() << std::endl;
00161     os << "   dca(Z,R)  = " << tmbtrkcal->getDCAz() << ", ";
00162     os << tmbtrkcal->getDCAr() << std::endl;
00163     os << std::endl;
00164   }
00165   os << std::endl;
00166   os << "Correction factor = " << _Corr << std::endl;
00167   os << "Corrected jet pT: "<< std::endl;
00168   os << "    in       = " << this->Pt()/_Corr*_Cin << std::endl;
00169   os << "    out      = " << this->Pt()/_Corr*_Cout << std::endl;
00170   os << "    full     = " << this->Pt()/_Corr*_Corr << std::endl;
00171   os << "    subtract = " << this->Pt()/_Corr*_Csub << std::endl;
00172   os << std::endl;
00173   os << "---------------------------------------------------" << std::endl;
00174   os << std::endl;
00175 }

Generated on Tue Mar 28 10:13:05 2006 for CAF by doxygen 1.3.4