00001
00002
00003
00004
00005
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
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
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 }