00001
00009 #include "StMultiH1F.h"
00010 #include "HitHistograms.h"
00011 #include "StMaker.h"
00012
00013
00014 #include "StEventTypes.h"
00015
00016
00017 HitHistograms::HitHistograms() :
00018 m_innerSectorDeDxHist(0),
00019 m_outerSectorDeDxHist(0),
00020 m_allSectorsDeDxHist(0)
00021 {
00022
00023 }
00024
00025 HitHistograms::HitHistograms(const char *name,const char *title,
00026 Int_t nbinsx,Axis_t xlow,Axis_t xup, Int_t nbinsy,
00027 StMaker* mk)
00028 {
00029
00030
00031 double xmin = 0.;
00032
00033 double xmax = 1.e-5;
00034 int xbins = 100;
00035 const char* name1 = "StEQaInnerSectorDeDx";
00036 const char* name2 = "StEQaOuterSectorDeDx";
00037 const char* title1 = "Inner Sector De/Dx Distribution";
00038 const char* title2 = "Outer Sector De/Dx Distribution";
00039
00040 m_innerSectorDeDxHist = new TH1F(name1,title1,xbins,xmin,xmax);
00041 m_outerSectorDeDxHist = new TH1F(name2,title2,xbins,xmin,xmax);
00042 m_allSectorsDeDxHist = new StMultiH1F(name,title,nbinsx,xlow,xup,nbinsy);
00043 m_allSectorsDeDxHist->SetStats(kFALSE);
00044 if (nbinsy == 2) {
00045 m_allSectorsDeDxHist->Rebin(0,"Outer");
00046 m_allSectorsDeDxHist->Rebin(1,"Inner");
00047 }
00048 if (mk) {
00049 mk->AddHist(m_innerSectorDeDxHist);
00050 mk->AddHist(m_outerSectorDeDxHist);
00051 mk->AddHist(m_allSectorsDeDxHist);
00052 }
00053 }
00054
00055 HitHistograms::~HitHistograms()
00056 {
00057 if (m_innerSectorDeDxHist) delete m_innerSectorDeDxHist;
00058 if (m_outerSectorDeDxHist) delete m_outerSectorDeDxHist;
00059 if (m_allSectorsDeDxHist) delete m_allSectorsDeDxHist;
00060 }
00061
00062 void HitHistograms::buildHistMaps()
00063 {
00064
00065 return;
00066 }
00067
00068 void HitHistograms::fillHistograms()
00069 {
00070 for (vector<StTpcHit*>::const_iterator it=m_tpcHitVec.begin(); it!=m_tpcHitVec.end(); it++) {
00071 double ds = dx(*it);
00072
00073 if ( (ds != 0.) && (keepHit(*it)) ) {
00074 if ((*it)->padrow() <= 13){
00075 m_innerSectorDeDxHist->Fill( (*it)->charge()/ds );
00076 m_allSectorsDeDxHist->Fill((*it)->charge()/ds,1.);
00077 }
00078 if ((*it)->padrow() > 13) {
00079 m_outerSectorDeDxHist->Fill( (*it)->charge()/ds );
00080 m_allSectorsDeDxHist->Fill((*it)->charge()/ds,0.);
00081 }
00082 }
00083 }
00084 return;
00085 }
00086
00087 TH1F* HitHistograms::innerSectorDeDxHist() const {
00088 return m_innerSectorDeDxHist;
00089 }
00090
00091 TH1F* HitHistograms::outerSectorDeDxHist() const {
00092 return m_outerSectorDeDxHist;
00093 }
00094
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
00126
00127
00128