Hall C ROOT/C++ Analyzer (hcana)
THcShowerArray.h
Go to the documentation of this file.
1 #ifndef ROOT_THcShowerArray
2 #define ROOT_THcShowerArray
3 
4 //#define HITPIC 1
5 #ifdef HITPIC
6 #define NPERLINE 5
7 #endif
8 
10 //
11 // THcShowerArray
12 //
13 // A Hall C Fly's Eye Shower Array
14 //
15 // Subdetector for the fly's eye part of the SHMS shower counter.
16 //
18 
19 #include "THaSubDetector.h"
20 #include "THaTrack.h"
21 #include "TClonesArray.h"
22 #include "THcShowerHit.h"
23 
24 #include <iostream>
25 
26 #include <fstream>
27 
28 class THaEvData;
29 class THaSignalHit;
30 class THcHodoscope;
31 
32 class THcShowerArray : public THaSubDetector {
33 
34 public:
35  THcShowerArray( const char* name, const char* description,
36  Int_t planenum, THaDetectorBase* parent = NULL);
37  virtual ~THcShowerArray();
38 
39  virtual void Clear( Option_t* opt="" );
40  virtual Int_t Decode( const THaEvData& );
41  virtual EStatus Init( const TDatime& run_time );
42 
43  virtual Int_t CoarseProcess( TClonesArray& tracks );
44  virtual Int_t FineProcess( TClonesArray& tracks );
45  Bool_t IsTracking() { return kFALSE; }
46  virtual Bool_t IsPid() { return kFALSE; }
47 
48  virtual Int_t ProcessHits(TClonesArray* rawhits, Int_t nexthit);
49  virtual Int_t CoarseProcessHits();
50  virtual Int_t AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit);
51  virtual void CalculatePedestals( );
52  virtual void InitializePedestals( );
53  virtual void FillADC_DynamicPedestal( );
54  virtual void FillADC_SampleIntegral( );
55  virtual void FillADC_SampIntDynPed( );
56  virtual void FillADC_Standard( );
57 
58  // Cluster to track association method.
59  Int_t MatchCluster(THaTrack*, Double_t&, Double_t&);
60 
61  // Get total energy deposited in the cluster matched to the given
62  // spectrometer Track.
63 
64  Float_t GetShEnergy(THaTrack*);
67  };
69  return fClustSize;
70  };
72  return fMatchClX;
73  };
75  return fMatchClY;
76  };
77 
78  // Double_t fSpacing; not used
79 
80  // TClonesArray* fParentHitList; not used
81 
83  return fEarray;
84  };
85 
86  // Fiducial volume limits.
87  Double_t fvXmin();
88  Double_t fvYmax();
89  Double_t fvXmax();
90  Double_t fvYmin();
92 
94 
95 protected:
96 
97 #ifdef HITPIC
98  char **hitpic;
99  Int_t piccolumn;
100 #endif
101 
102 
103 
104 
105 
106  //counting variables
107  Int_t fTotNumAdcHits; // Total number of ADC hits
108  Int_t fTotNumGoodAdcHits; // Total number of good ADC hits (pass threshold)
109 
110  vector<Int_t> fNumGoodAdcHits; // shower good occupancy
111  vector<Double_t> fGoodAdcPulseIntRaw; // [fNelem] Good Raw ADC pulse Integrals of blocks
112 
113  vector<Double_t> fGoodAdcPed; // [fNelem] Event by event (FADC) good pulse pedestals
114  vector<Double_t> fGoodAdcMult;
115  vector<Double_t> fGoodAdcPulseInt; // [fNelem] good pedestal subtracted pulse integrals
116  vector<Double_t> fGoodAdcPulseAmp;
117  vector<Double_t> fGoodAdcPulseTime;
118  vector<Double_t> fGoodAdcTdcDiffTime;
119 
120  vector<Double_t> fE; //[fNelem] energy deposition in shower blocks
121 
122  Int_t* fBlock_ClusterID; // [fNelem] Cluster ID of the block -1 then not in a cluster
123  Double_t fEarray; // Total Energy deposition in the array.
124  TClonesArray* fADCHits; // List of ADC hits
125 
126  // Parameters
127 
130  Double_t fXFront; // Front position X
131  Double_t fYFront; // Front position Y
132  Double_t fZFront; // Front position Z, from FP
133  Double_t fXStep; // distance btw centers of blocks along X
134  Double_t fYStep; // distance btw centers of blocks along Y
135  Double_t fZSize; // Block size along Z
136  Double_t** fXPos; // block X coordinates
137  Double_t** fYPos; // block Y coordinates
138  Double_t** fZPos; // block Z coordinates
139 
140  Int_t fUsingFADC; // != 0 if using FADC in sample mode
142  // 1 == Use the pulse int - pulse ped
143  // 2 == Use the sample integral - known ped
144  // 3 == Use the sample integral - sample ped
145  static const Int_t kADCStandard=0;
146  static const Int_t kADCDynamicPedestal=1;
147  static const Int_t kADCSampleIntegral=2;
148  static const Int_t kADCSampIntDynPed=3;
154 
156  Int_t fPedSampLow; // Sample range for
157  Int_t fPedSampHigh; // dynamic pedestal
158  Int_t fDataSampLow; // Sample range for
159  Int_t fDataSampHigh; // sample integration
160 
161  Int_t fLayerNum; // 2 for SHMS
162 
163  // Accumulators for pedestals go here
164 
165  Int_t fNPedestalEvents; /* Pedestal event counter */
166  Int_t fMinPeds; /* Only analyze/update if num events > */
167 
168  // 2D arrays
169 
170  Int_t *fPedSum; /* Accumulators for pedestals */
172  Int_t *fPedLimit; // Analyze pedestal if ADC signal < PedLimit
173  Int_t *fPedCount; // [fNelem] counter of pedestal analysis
174 
175  Float_t *fPed; // [fNelem] pedestal positions
176  Float_t *fSig; // [fNelem] pedestal rms-s
177  Float_t *fThresh; // [fNelem] ADC thresholds
178 
179  Double_t* fGain; // [fNelem] Gain constants from calibration
180 
181  Int_t fNclust; // Number of hit clusters
182  Int_t fNtracks; // Number of shower tracks, i.e. number of
183  // cluster-to-track associations
184 
189 
190  THcShowerClusterList* fClusterList; // List of hit clusters
191 
197 
202 
203  //Quatitites for efficiency calculations.
204 
208  vector<Int_t> fStatNumTrk;
209  vector<Int_t> fStatNumHit;
212 
213  virtual Int_t ReadDatabase( const TDatime& date );
214  virtual Int_t DefineVariables( EMode mode = kDefine );
215  THcHodoscope* fglHod; // Hodoscope to get start time
216 
217  THaDetectorBase* fParent;
218 
219  ClassDef(THcShowerArray,0); // Fly;s Eye calorimeter array
220 };
221 
222 #endif
THcShowerArray(const char *name, const char *description, Int_t planenum, THaDetectorBase *parent=NULL)
virtual EStatus Init(const TDatime &run_time)
static const Int_t kADCSampIntDynPed
virtual void FillADC_SampleIntegral()
TClonesArray * frAdcPulseAmp
vector< Int_t > fNumGoodAdcHits
vector< Double_t > fGoodAdcPed
vector< Double_t > fE
Double_t GetClSize()
TClonesArray * frAdcPulseTime
Fly's eye array of shower blocks.
float Float_t
const char Option_t
Double_t GetClMaxEnergyBlock()
Int_t fTotNumGoodAdcHits
TClonesArray * frAdcErrorFlag
Double_t clMaxEnergyBlock(THcShowerCluster *cluster)
TClonesArray * fADCHits
virtual void InitializePedestals()
vector< Int_t > fStatNumHit
vector< Double_t > fGoodAdcMult
vector< THcShowerCluster * > THcShowerClusterList
Definition: THcShowerHit.h:88
vector< Double_t > fGoodAdcPulseAmp
int Int_t
bool Bool_t
Double_t ** fYPos
TClonesArray * frAdcPed
vector< Double_t > fGoodAdcTdcDiffTime
Float_t * fThresh
Double_t fMatchClY
Double_t fStatMaxChi2
virtual void FillADC_DynamicPedestal()
virtual Int_t FineProcess(TClonesArray &tracks)
vector< Double_t > fGoodAdcPulseIntRaw
virtual void FillADC_SampIntDynPed()
virtual Int_t CoarseProcessHits()
Double_t fMatchClMaxEnergyBlock
Int_t MatchCluster(THaTrack *, Double_t &, Double_t &)
Float_t GetShEnergy(THaTrack *)
TClonesArray * frAdcPedRaw
virtual Int_t DefineVariables(EMode mode=kDefine)
Double_t fAdcThreshold
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
Double_t ** fXPos
Double_t * fGain
Double_t ** fZPos
virtual void FillADC_Standard()
Double_t GetClY()
Int_t * fBlock_ClusterID
unsigned int UInt_t
static const Int_t kADCSampleIntegral
vector< Double_t > fGoodAdcPulseInt
TClonesArray * frAdcPulseTimeRaw
virtual void Clear(Option_t *opt="")
const Bool_t kFALSE
THcShowerHitSet THcShowerCluster
Definition: THcShowerHit.h:81
Bool_t IsTracking()
Int_t AccumulateStat(TClonesArray &tracks)
virtual void CalculatePedestals()
double Double_t
TClonesArray * frAdcPulseAmpRaw
ClassDef(THcShowerArray, 0)
vector< Double_t > fGoodAdcPulseTime
Double_t fStatSlop
TClonesArray * frAdcPulseIntRaw
virtual ~THcShowerArray()
Double_t * fAdcTimeWindowMax
vector< Int_t > fStatNumTrk
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
Double_t GetClX()
Double_t GetEarray()
virtual Int_t Decode(const THaEvData &)
THcHodoscope * fglHod
static const Int_t kADCDynamicPedestal
THcShowerClusterList * fClusterList
TClonesArray * frAdcPulseInt
Double_t fMatchClX
virtual Bool_t IsPid()
Double_t fClustSize
Generic hodoscope consisting of multiple planes with multiple paddles with phototubes on both ends...
Definition: THcHodoscope.h:37
virtual Int_t ReadDatabase(const TDatime &date)
THaDetectorBase * fParent
Double_t * fAdcTimeWindowMin
char name[80]
virtual Int_t CoarseProcess(TClonesArray &tracks)
Double_t fAdcTdcOffset
Double_t fStatCerMin
static const Int_t kADCStandard