Hall C ROOT/C++ Analyzer (hcana)
THcShowerPlane.h
Go to the documentation of this file.
1 #ifndef ROOT_THcShowerPlane
2 #define ROOT_THcShowerPlane
3 
5 //
6 // THcShowerPlane
7 //
8 // A Hall C Shower plane
9 //
10 // May want to later inherit from a THcPlane class if there are similarities
11 // in what a plane is shared with other detector types (shower, etc.)
12 //
14 
15 #include "THaSubDetector.h"
16 #include "THcCherenkov.h"
17 #include "TClonesArray.h"
18 
19 #include <iostream>
20 #include <vector>
21 #include <fstream>
22 
23 using namespace std;
24 
25 class THaEvData;
26 class THaSignalHit;
27 class THcHodoscope;
28 
29 class THcShowerPlane : public THaSubDetector {
30 
31 public:
32  THcShowerPlane( const char* name, const char* description,
33  Int_t planenum, THaDetectorBase* parent = NULL);
34  virtual ~THcShowerPlane();
35 
36  virtual void Clear( Option_t* opt="" );
37  virtual Int_t Decode( const THaEvData& );
38  virtual EStatus Init( const TDatime& run_time );
39 
40  virtual Int_t CoarseProcess( TClonesArray& tracks );
41  virtual Int_t FineProcess( TClonesArray& tracks );
42  Bool_t IsTracking() { return kFALSE; }
43  virtual Bool_t IsPid() { return kFALSE; }
44 
45  virtual Int_t ProcessHits(TClonesArray* rawhits, Int_t nexthit);
46  virtual Int_t CoarseProcessHits();
47  virtual Int_t AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit);
48  virtual void CalculatePedestals( );
49 
50  // Double_t fSpacing; not used
51 
52  // TClonesArray* fParentHitList; not used
53 
55  return fOrigin;
56  }
57 
59  return fEplane;
60  };
61 
63  return fEplane_pos;
64  };
65 
67  return fEplane_neg;
68  };
69 
71  return fEmean[i];
72  };
73 
75  return fEpos[i];
76  };
77 
79  return fEneg[i];
80  };
81 
83  return fGoodPosAdcPulseInt[i];
84  };
85 
87  return fGoodNegAdcPulseInt[i];
88  };
89 
91  return fGoodPosAdcPulseIntRaw[i];
92  };
93 
95  return fGoodNegAdcPulseIntRaw[i];
96  };
97 
99  return fPosThresh[i];
100  };
101 
103  return fNegThresh[i];
104  };
105 
107  return fPosPed[i];
108  };
109 
111  return fNegPed[i];
112  };
113 
114  Int_t AccumulateStat(TClonesArray& tracks);
115 
116 protected:
117 
118  THaDetectorBase* fParent;
120 
121  // Flash ADC parameters
122  Int_t fUsingFADC; // != 0 if using FADC in sample mode
123  // 1 == Use the pulse int - pulse ped
124  // 2 == Use the sample integral - known ped
125  // 3 == Use the sample integral - sample ped
126  static const Int_t kADCStandard=0;
127  static const Int_t kADCDynamicPedestal=1;
128  static const Int_t kADCSampleIntegral=2;
129  static const Int_t kADCSampIntDynPed=3;
130 
131  Int_t fDebugAdc; // fADC debug flag
132  Int_t fPedSampLow; // Sample range for
133  Int_t fPedSampHigh; // dynamic pedestal
134  Int_t fDataSampLow; // Sample range for
135  Int_t fDataSampHigh; // sample integration
139 
140  //counting variables
144 
148 
149  //individual pmt data objects
150  vector<Int_t> fNumGoodPosAdcHits;
151  vector<Int_t> fNumGoodNegAdcHits;
152 
153  vector<Double_t> fGoodPosAdcPed;
154  vector<Double_t> fGoodPosAdcPulseInt;
155  vector<Double_t> fGoodPosAdcPulseAmp;
156  vector<Double_t> fGoodPosAdcPulseTime;
157  vector<Double_t> fGoodPosAdcTdcDiffTime;
158 
159  vector<Double_t> fGoodNegAdcPed;
160  vector<Double_t> fGoodNegAdcPulseInt;
161  vector<Double_t> fGoodNegAdcPulseAmp;
162  vector<Double_t> fGoodNegAdcPulseTime;
163  vector<Double_t> fGoodNegAdcTdcDiffTime;
164 
165  vector<Double_t> fGoodPosAdcPulseIntRaw;
166  vector<Double_t> fGoodNegAdcPulseIntRaw;
167 
168  vector<Double_t> fGoodPosAdcMult;
169  vector<Double_t> fGoodNegAdcMult;
170 
171 
172  vector<Double_t> fEpos; // [fNelem] energy depositions seen by positive PMTs
173  vector<Double_t> fEneg; // [fNelem] energy depositions seen by negative PMTs
174  vector<Double_t> fEmean; // [fNelem] mean energy depositions (pos + neg)
175 
176 
177  Double_t fEplane_pos; // Energy deposition in the plane from positive PMTs
178  Double_t fEplane_neg; // Energy deposition in the plane from negative PMTs
180 
181  // These lists are not used actively for now.
182  TClonesArray* fPosADCHits; // List of positive ADC hits
183  TClonesArray* fNegADCHits; // List of negative ADC hits
184 
185  Int_t fLayerNum; // Layer # 1-4
186 
187  Int_t fNPedestalEvents; /* Pedestal event counter */
188  Int_t fMinPeds; /* Only analyze/update if num events > */
189  Int_t *fPosPedSum; /* Accumulators for pedestals */
191  Int_t *fPosPedLimit; // Analyze pedestal if ADC signal < PedLimit
192  Int_t *fPosPedCount; // [fNelem] counter of pedestal analysis
195  Int_t *fNegPedLimit; // Analyze pedestal if ADC signal < PedLimit
196  Int_t *fNegPedCount; // [fNelem] counter of pedestal analysis
197 
198  Float_t *fPosPed; // [fNelem] pedestal positions
199  Float_t *fPosSig; // [fNelem] pedestal rms-s
200  Float_t *fPosThresh; // [fNelem] ADC thresholds
204 
211 
216 
223 
228 
229  virtual Int_t ReadDatabase( const TDatime& date );
230  virtual Int_t DefineVariables( EMode mode = kDefine );
231  virtual void InitializePedestals( );
232  virtual void FillADC_DynamicPedestal( );
233  virtual void FillADC_SampleIntegral( );
234  virtual void FillADC_SampIntDynPed( );
235  virtual void FillADC_Standard( );
236 
237  //Quatitites for efficiency calculations.
238 
242  vector<Int_t> fStatNumTrk;
243  vector<Int_t> fStatNumHit;
246 
247  THcHodoscope* fglHod; // Hodoscope to get start time
248 
249  ClassDef(THcShowerPlane,0); // Calorimeter bars in a plane
250 };
251 #endif
Double_t GetNegThr(Int_t i)
TClonesArray * frPosAdcThreshold
virtual Bool_t IsPid()
Double_t GetEneg(Int_t i)
vector< Double_t > fGoodNegAdcTdcDiffTime
Int_t fTotNumGoodAdcHits
vector< Int_t > fStatNumHit
vector< Double_t > fGoodPosAdcPulseAmp
float Float_t
TClonesArray * frNegAdcPulseAmpRaw
const char Option_t
Class for gas Cherenkov detectors.
Definition: THcCherenkov.h:16
TClonesArray * frPosAdcPulseIntRaw
vector< Int_t > fNumGoodNegAdcHits
Double_t fEplane_neg
Float_t * fPosSig
vector< Double_t > fGoodNegAdcPed
TClonesArray * frPosAdcPulseTimeRaw
Double_t GetEplane()
vector< Double_t > fGoodPosAdcPulseTime
TClonesArray * frPosAdcPed
int Int_t
bool Bool_t
vector< Double_t > fGoodPosAdcPed
STL namespace.
vector< Double_t > fGoodPosAdcMult
Float_t * fPosPed
TClonesArray * frNegAdcPulseTimeRaw
vector< Double_t > fEneg
vector< Double_t > fGoodPosAdcPulseInt
TClonesArray * frNegAdcPedRaw
Int_t * fPosPedCount
Double_t GetAnegP(Int_t i)
TClonesArray * frPosAdcPulseAmpRaw
vector< Double_t > fGoodNegAdcMult
THcHodoscope * fglHod
Double_t fEplane_pos
Double_t fStatMaxChi2
#define ClassDef(name, id)
Double_t GetEmean(Int_t i)
Double_t GetPosPed(Int_t i)
vector< Double_t > fGoodPosAdcTdcDiffTime
Int_t fTotNumGoodNegAdcHits
vector< Double_t > fGoodNegAdcPulseTime
vector< Double_t > fGoodNegAdcPulseAmp
TClonesArray * frNegAdcThreshold
Double_t fAdcTdcOffset
Float_t * fNegThresh
TVector3 GetOrigin()
Double_t GetEplane_neg()
Float_t * fNegPed
TClonesArray * frNegAdcErrorFlag
Float_t * fNegSig
THaDetectorBase * fParent
Double_t GetAneg(Int_t i)
Double_t GetEplane_pos()
Int_t * fPosPedLimit
const Bool_t kFALSE
TClonesArray * frNegAdcPulseTime
double Double_t
Double_t GetEpos(Int_t i)
Bool_t IsTracking()
Int_t fTotNumGoodPosAdcHits
Double_t fAdcNegThreshold
vector< Double_t > fGoodPosAdcPulseIntRaw
Double_t fAdcPosThreshold
TClonesArray * frPosAdcErrorFlag
vector< Double_t > fEmean
Int_t * fNegPedLimit
Int_t * fNegPedCount
vector< Double_t > fGoodNegAdcPulseInt
TClonesArray * frPosAdcPulseAmp
TClonesArray * frNegAdcPulseAmp
One plane of shower blocks with side readout.
TClonesArray * frNegAdcPulseInt
Double_t GetAposP(Int_t i)
Double_t fStatCerMin
vector< Double_t > fGoodNegAdcPulseIntRaw
TClonesArray * frPosAdcPulseInt
Double_t GetApos(Int_t i)
TClonesArray * fNegADCHits
TClonesArray * fPosADCHits
Double_t fStatSlop
TClonesArray * frNegAdcPulseIntRaw
Float_t * fPosThresh
vector< Int_t > fNumGoodPosAdcHits
Generic hodoscope consisting of multiple planes with multiple paddles with phototubes on both ends...
Definition: THcHodoscope.h:37
Double_t GetPosThr(Int_t i)
Double_t GetNegPed(Int_t i)
THcCherenkov * fCherenkov
TClonesArray * frPosAdcPulseTime
TClonesArray * frPosAdcPedRaw
vector< Double_t > fEpos
char name[80]
vector< Int_t > fStatNumTrk
TClonesArray * frNegAdcPed