00001
00002
00003
00004
00005
00006
00008
00009 #include <iostream>
00010 #include "tmb_tree/TMBTrackCal.hpp"
00011 #include "tmb_tree/TMBTrack.hpp"
00012 #include "tmb_tree/TMBVertex.hpp"
00013
00014 ClassImp(TMBTrackCal);
00015
00016
00017 TMBTrackCal::TMBTrackCal()
00018 {
00019
00020 }
00021
00022 TMBTrackCal::TMBTrackCal(TRef chptr, TRef vtxref, Float_t dcaZ, Float_t dcaR,
00023 Float_t* eta, Float_t* phi,
00024 Float_t* e010, Float_t* e015, Float_t* e020, Float_t* e030, Float_t* e040,
00025 Float_t* e050, Float_t* e070)
00026 {
00027 _dcaR = dcaR;
00028 _dcaZ = dcaZ;
00029 _chptr = chptr;
00030 _vtxref = vtxref;
00031
00032 for (Int_t j=0; j<17; j++){
00033 _eta[j] = *(eta++);
00034 _phi[j] = *(phi++);
00035 _e010[j] = *(e010++);
00036 _e015[j] = *(e015++);
00037 _e020[j] = *(e020++);
00038 _e030[j] = *(e030++);
00039 _e040[j] = *(e040++);
00040 _e050[j] = *(e050++);
00041 _e070[j] = *(e070++);
00042 }
00043
00044
00045 }
00046
00047 TMBTrackCal::~TMBTrackCal()
00048 {
00049
00050 }
00051
00052
00053
00054 void TMBTrackCal::getCalEtaPhi(Int_t layer, Float_t& eta, Float_t& phi) const
00055 {
00056 eta = _eta[layer-1];
00057 phi = _phi[layer-1];
00058 }
00059
00060 Float_t TMBTrackCal::getE010(Int_t ly) const
00061 {
00062 return _e010[ly-1];
00063 }
00064 Float_t TMBTrackCal::getE015(Int_t ly) const
00065 {
00066 return _e015[ly-1];
00067 }
00068 Float_t TMBTrackCal::getE020(Int_t ly) const
00069 {
00070 return _e020[ly-1];
00071 }
00072 Float_t TMBTrackCal::getE030(Int_t ly) const
00073 {
00074 return _e030[ly-1];
00075 }
00076 Float_t TMBTrackCal::getE040(Int_t ly) const
00077 {
00078 return _e040[ly-1];
00079 }
00080 Float_t TMBTrackCal::getE050(Int_t ly) const
00081 {
00082 return _e050[ly-1];
00083 }
00084 Float_t TMBTrackCal::getE070(Int_t ly) const
00085 {
00086 return _e070[ly-1];
00087 }
00088
00089 Float_t TMBTrackCal::PtWeighteDetectorEta() const
00090 {
00091 float deta = -999;
00092 float sum = _e030[17-1];
00093
00094 float eta_sum = 0;
00095 for(int i=2; i<=17; i++) {
00096 float eta = _eta[i-1];
00097 float e = _e030[i-1] - _e030[i-2];
00098 eta_sum += eta*e;
00099 }
00100 eta_sum += _eta[0]*_e030[0];
00101
00102 if(sum>0)
00103 deta = eta_sum/sum;
00104 return deta;
00105 }
00106
00107
00108 void TMBTrackCal::print(std::ostream& os) const
00109 {
00110 TMBTrack* tmbtrk = (TMBTrack*) this->GetChargedTrack();
00111 TMBVertex* tmbvtx = (TMBVertex*) this->GetVertex();
00112
00113 os << std::endl;
00114 os << "TMBTrackCal::print" << std::endl;
00115 os << "Vertex Z = " << tmbvtx->vz() << ", track pT = " << tmbtrk->Pt();
00116 os << std::endl << "DCA(R,Z) = " << _dcaR;
00117 os << ", " << _dcaZ << std::endl;
00118 for(int i=1; i<=17; i++) {
00119 os << " layer: " << i << ", (eta,phi) = (" << _eta[i-1];
00120 os << ", " << _phi[i-1] << ")" << std::endl;
00121 }
00122 os << " PtWeighteDetectorEta = " << this->PtWeighteDetectorEta() << std::endl;
00123 os << " EFlow cal energy = " << std::endl;
00124 os << " DR=0.10 = " << this->getE010(4) << ", " << this->getE010(17) << std::endl;
00125 os << " DR=0.15 = " << this->getE015(4) << ", " << this->getE015(17) << std::endl;
00126 os << " DR=0.30 = " << this->getE030(4) << ", " << this->getE030(17) << std::endl;
00127 os << std::endl;
00128 }