StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HitHistograms.cxx
1 
9 #include "StMultiH1F.h"
10 #include "HitHistograms.h"
11 #include "StMaker.h"
12 
13 // StEvent
14 #include "StEventTypes.h"
15 
16 //_____________________________________________________________________________
17 HitHistograms::HitHistograms() :
18  m_innerSectorDeDxHist(0),
19  m_outerSectorDeDxHist(0),
20  m_allSectorsDeDxHist(0)
21 {
22  /* noop */
23 }
24 //_____________________________________________________________________________
25 HitHistograms::HitHistograms(const char *name,const char *title,
26  Int_t nbinsx,Axis_t xlow,Axis_t xup, Int_t nbinsy,
27  StMaker* mk)
28 {
29  // if you change these constants, be sure to change them in StQABookHist
30  // for the "dE/dx for all TPC sectors" histogram (m_dedx_all_sectors)
31  double xmin = 0.;
32  //double xmax = 1.e-4;
33  double xmax = 1.e-5;
34  int xbins = 100;
35  const char* name1 = "StEQaInnerSectorDeDx";
36  const char* name2 = "StEQaOuterSectorDeDx";
37  const char* title1 = "Inner Sector De/Dx Distribution";
38  const char* title2 = "Outer Sector De/Dx Distribution";
39 
40  m_innerSectorDeDxHist = new TH1F(name1,title1,xbins,xmin,xmax);
41  m_outerSectorDeDxHist = new TH1F(name2,title2,xbins,xmin,xmax);
42  m_allSectorsDeDxHist = new StMultiH1F(name,title,nbinsx,xlow,xup,nbinsy);
43  m_allSectorsDeDxHist->SetStats(kFALSE);
44  if (nbinsy == 2) {
45  m_allSectorsDeDxHist->Rebin(0,"Outer");
46  m_allSectorsDeDxHist->Rebin(1,"Inner");
47  }
48  if (mk) {
49  mk->AddHist(m_innerSectorDeDxHist);
50  mk->AddHist(m_outerSectorDeDxHist);
51  mk->AddHist(m_allSectorsDeDxHist);
52  }
53 }
54 //_____________________________________________________________________________
55 HitHistograms::~HitHistograms()
56 {
57  if (m_innerSectorDeDxHist) delete m_innerSectorDeDxHist;
58  if (m_outerSectorDeDxHist) delete m_outerSectorDeDxHist;
59  if (m_allSectorsDeDxHist) delete m_allSectorsDeDxHist;
60 }
61 //_____________________________________________________________________________
62 void HitHistograms::buildHistMaps()
63 {
64  /* depracated */
65  return;
66 }
67 //_____________________________________________________________________________
68 void HitHistograms::fillHistograms()
69 {
70  for (vector<StTpcHit*>::const_iterator it=m_tpcHitVec.begin(); it!=m_tpcHitVec.end(); it++) {
71  double ds = dx(*it);
72  //Keep only hit.flag()==0 points
73  if ( (ds != 0.) && (keepHit(*it)) ) {
74  if ((*it)->padrow() <= 13){
75  m_innerSectorDeDxHist->Fill( (*it)->charge()/ds );
76  m_allSectorsDeDxHist->Fill((*it)->charge()/ds,1.);
77  }
78  if ((*it)->padrow() > 13) {
79  m_outerSectorDeDxHist->Fill( (*it)->charge()/ds );
80  m_allSectorsDeDxHist->Fill((*it)->charge()/ds,0.);
81  }
82  }
83  }
84  return;
85 }
86 //_____________________________________________________________________________
87 TH1F* HitHistograms::innerSectorDeDxHist() const {
88  return m_innerSectorDeDxHist;
89 }
90 //_____________________________________________________________________________
91 TH1F* HitHistograms::outerSectorDeDxHist() const {
92  return m_outerSectorDeDxHist;
93 }
94 
96 // $Id: HitHistograms.cxx,v 1.11 2009/11/19 20:12:10 genevb Exp $
97 // $Log: HitHistograms.cxx,v $
98 // Revision 1.11 2009/11/19 20:12:10 genevb
99 // Clean up compiler warnings
100 //
101 // Revision 1.10 2007/03/13 18:43:43 genevb
102 // Use StE prefix
103 //
104 // Revision 1.9 2006/05/22 18:27:34 genevb
105 // Remove patch to observe fast offline issues
106 //
107 // Revision 1.8 2006/05/18 03:27:41 genevb
108 // Patch to observe fast offline issues
109 //
110 // Revision 1.7 2003/09/19 22:58:10 genevb
111 // Initialize pointers to zero, some doxygenization
112 //
113 // Revision 1.6 2002/02/12 22:17:11 genevb
114 // Forgot to remove some print statements
115 //
116 // Revision 1.5 2002/02/12 18:41:59 genevb
117 // Additional FTPC histograms
118 //
119 // Revision 1.4 2001/05/16 20:57:02 lansdell
120 // new histograms added for qa_shift printlist; some histogram ranges changed; StMcEvent now used in StEventQA
121 //
122 // Revision 1.3 2000/08/25 16:04:09 genevb
123 // Introduction of files
124 //
125 // Revision 1.2 2000/08/09 18:57:43 lansdell
126 // improvements in TPC gains code reduces CPU time per event by factor of 2
127 //
128 
vector< StTpcHit * > m_tpcHitVec
Map of 3 points in each padrow.