Neutral Particle Spectrometer analysis code
Loading...
Searching...
No Matches
THcNPSArray.h
Go to the documentation of this file.
1#ifndef ROOT_THcNPSArray
2#define ROOT_THcNPSArray
3
4//#define HITPIC 1
5#ifdef HITPIC
6#define NPERLINE 5
7#endif
8
10//
11// THcNPSArray
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 "THcNPSShowerHit.h"
23
24#include <iostream>
25
26#include <fstream>
27
28class THaEvData;
29class THaSignalHit;
30class THcHodoscope;
31class THcRawAdcHit;
32
34
35public:
36 THcNPSArray( const char* name, const char* description,
37 Int_t planenum, THaDetectorBase* parent = NULL);
38 virtual ~THcNPSArray();
39
40 virtual void Clear( Option_t* opt="" );
41 virtual Int_t Decode( const THaEvData& );
42 virtual EStatus Init( const TDatime& run_time );
43
44 virtual Int_t CoarseProcess(TClonesArray& tracks);
45 virtual Int_t FineProcess( TClonesArray& tracks );
46 Bool_t IsTracking() { return kFALSE; }
47 virtual Bool_t IsPid() { return kFALSE; }
48
49 virtual Int_t ClearProcessedHits();
50 virtual Int_t AccumulateHits(TClonesArray* rawhits, Int_t nexthit, Int_t quadrant);
51 virtual Int_t CoarseProcessHits();
52 virtual Int_t AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit);
53 virtual void CalculatePedestals( );
54 virtual void InitializePedestals( );
55 virtual void FillADC_DynamicPedestal( );
56 virtual void FillADC_SampleIntegral( );
57 virtual void FillADC_SampIntDynPed( );
58 virtual void FillADC_Standard( );
59
64 return fClustSize;
65 };
67 return fMatchClX;
68 };
70 return fMatchClY;
71 };
72
73
74
75 //C.Y. Feb 09, 2021: Create method prototype to transform shms to nps block numbering
76 //(used when moving data from shms calorimeter to "fake" nps quadrants to mimic NPS
77 Int_t shms2nps_transform(Int_t padnum, Int_t transform);
78
79
80
81 //C.Y. Feb 11, 2021 : Introduce various method (or function) prototypes necessary for the NPS Clustering algorithm
82 std::pair<int, int> GetBlockij(Int_t id); //get block index (irow, jcol), given the block number id
83 Int_t GetBlockID(UInt_t irow, UInt_t jcol); //get block id given the block index (irow, jcol)
84 Int_t GetNeighbor(UInt_t id, UInt_t k); //get neighboring block number id_k, given the central
85 //block id and nearest neighboring k block indices (0, 1, 2 . . .)
86
87 //C.Y. Mar 30, 2021: Method that returns (by reference) the highest (out of at most 8)
88 //pulse integral neighbor block hit index (virus_blk) and corresponding pulse
89 //integral (max).
90 void GetMax(Float_t pInei[8], Int_t nei[8], Int_t &virus_blk, Float_t &max);
91
92 // Double_t fSpacing; not used
93
94 // TClonesArray* fParentHitList; not used
95
97 return fEarray;
98 };
99
100 // Fiducial volume limits.
106
108
109protected:
110
111 std::string fKwPrefix;
112
113#ifdef HITPIC
114 char **hitpic;
115 Int_t piccolumn;
116#endif
117
118
119
120
121
122 //counting variables
123 Int_t fTotNumAdcHits; // Total number of ADC hits
124 Int_t fTotNumGoodAdcHits; // Total number of good ADC hits (pass threshold)
125
126 vector<Int_t> fNumGoodAdcHits; // shower good occupancy
127 vector<Double_t> fGoodAdcPulseIntRaw; // [fNelem] Good Raw ADC pulse Integrals of blocks
128
129 vector<Double_t> fGoodAdcPed; // [fNelem] Event by event (FADC) good pulse pedestals
130 vector<Double_t> fGoodAdcMult;
131 vector<Double_t> fGoodAdcPulseInt; // [fNelem] good pedestal subtracted pulse integrals
132 vector<Double_t> fGoodAdcPulseAmp;
133 vector<Double_t> fGoodAdcPulseTime;
134 vector<Double_t> fGoodAdcTdcDiffTime;
135 vector<Double_t> fSampWaveform;
136
137 vector<Double_t> fE; //[fNelem] energy deposition in shower blocks
138 vector<Double_t> fT; //[fNelem] time of hit in shower blocks
139
140 /*
141 //C.Y. Mar 16, 2021: Variables same as above but with an additional dimension to store possible multiple hits
142 //(to be used for NPS.) [block_id][hit]
143
144 vector<vector<Int_t>> fNumGoodAdcHits_2D; // shower good occupancy
145 vector<vector<Double_t>> fGoodAdcPulseIntRaw_2D; // [fNelem] Good Raw ADC pulse Integrals of blocks
146
147 vector<vector<Double_t>> fGoodAdcPed_2D; // [fNelem] Event by event (FADC) good pulse pedestals
148 vector<vector<Double_t>> fGoodAdcMult_2D;
149 vector<vector<Double_t>> fGoodAdcPulseInt_2D; // [fNelem] good pedestal subtracted pulse integrals
150 vector<vector<Double_t>> fGoodAdcPulseAmp_2D;
151 vector<vector<Double_t>> fGoodAdcPulseTime_2D;
152 vector<vector<Double_t>> fGoodAdcTdcDiffTime_2D;
153
154 vector<vector<Double_t>> fE_2D; //[fNelem] energy deposition in shower blocks
155 vector<vector<Double_t>> fT_2D; //[fNelem] time of hit in shower blocks
156
157 //------------------------------------------------------------
158 */
159
160 Int_t* fBlock_ClusterID; // [fNelem] Cluster ID of the block -1 then not in a cluster
161 Double_t fEarray; // Total Energy deposition in the array.
162 TClonesArray* fADCHits; // List of ADC hits
163
164 // Parameters
165
168 Double_t fXFront; // Front position X
169 Double_t fYFront; // Front position Y
170 Double_t fZFront; // Front position Z, from FP
171 Double_t fXStep; // distance btw centers of blocks along X
172 Double_t fYStep; // distance btw centers of blocks along Y
173 Double_t fZSize; // Block size along Z
174 Double_t** fXPos; // block X coordinates
175 Double_t** fYPos; // block Y coordinates
176 Double_t** fZPos; // block Z coordinates
177
179 Int_t fUsingFADC; // != 0 if using FADC in sample mode
181 // 1 == Use the pulse int - pulse ped
182 // 2 == Use the sample integral - known ped
183 // 3 == Use the sample integral - sample ped
184 static const Int_t kADCStandard=0;
186 static const Int_t kADCSampleIntegral=2;
187 static const Int_t kADCSampIntDynPed=3;
194
195 //C.Y. Feb 09, 2021: Added fAdcPulseTime window parameters to be used in
196 //the NPS clustering algorithm to select good adc pulse signals
199
201 Int_t fPedSampLow; // Sample range for
202 Int_t fPedSampHigh; // dynamic pedestal
203 Int_t fDataSampLow; // Sample range for
204 Int_t fDataSampHigh; // sample integration
205 Int_t fDataSampWidth; // Integration range
206
207 Int_t fLayerNum; // 2 for SHMS
208
216
217 // Accumulators for pedestals go here
218
219 Int_t fNPedestalEvents; /* Pedestal event counter */
220 Int_t fMinPeds; /* Only analyze/update if num events > */
221
222 // 2D arrays
223
224 Int_t *fPedSum; /* Accumulators for pedestals */
226 Int_t *fPedLimit; // Analyze pedestal if ADC signal < PedLimit
227 Int_t *fPedCount; // [fNelem] counter of pedestal analysis
228
229 Float_t *fPed; // [fNelem] pedestal positions
230 Float_t *fSig; // [fNelem] pedestal rms-s
231 Float_t *fThresh; // [fNelem] ADC thresholds
232
233 Double_t* fGain; // [fNelem] Gain constants from calibration
234
235 Int_t fNclust; // Number of hit clusters
236 Int_t fNtracks; // Number of shower tracks, i.e. number of
237 // cluster-to-track associations
238
244
245 THcNPSShowerClusterList* fClusterList; // List of hit clusters
246
256
266
267 //Quatitites for efficiency calculations.
268
272 vector<Int_t> fStatNumTrk;
273 vector<Int_t> fStatNumHit;
276
277 virtual Int_t ReadDatabase( const TDatime& date );
278 virtual Int_t DefineVariables( EMode mode = kDefine );
279 THcHodoscope* fglHod; // Hodoscope to get start time
280
282
283
284 ClassDef(THcNPSArray,0); // Fly;s Eye calorimeter array
285};
286
287#endif
int Int_t
unsigned int UInt_t
bool Bool_t
const Bool_t kFALSE
float Float_t
double Double_t
const char Option_t
vector< THcNPSShowerCluster * > THcNPSShowerClusterList
THcNPSShowerHitSet THcNPSShowerCluster
Fly's eye array of shower blocks.
Definition THcNPSArray.h:33
Int_t * fBlock_ClusterID
static const Int_t kADCSampIntDynPed
TClonesArray * fADCHits
Double_t * fGain
Double_t * fAdcPulseTimeMin
Bool_t fHodoscope_found
THcNPSArray(const char *name, const char *description, Int_t planenum, THaDetectorBase *parent=NULL)
Double_t fXStep
Double_t * fAdcTdcOffset
std::string fKwPrefix
Double_t * fAdcPulseTimeMax
Int_t GetBlockID(UInt_t irow, UInt_t jcol)
Float_t * fSig
TClonesArray * frAdcPulseTimeRaw
Double_t fStatSlop
vector< Int_t > fNumGoodAdcHits
TClonesArray * frAdcPulseIntRaw
Double_t fStatMaxChi2
Double_t fMatchClY
vector< Double_t > fGoodAdcPulseTime
Int_t * fPedLimit
TClonesArray * frAdcSampPulseIntRaw
Int_t fTotStatNumHit
std::pair< int, int > GetBlockij(Int_t id)
vector< Double_t > fGoodAdcMult
virtual void FillADC_DynamicPedestal()
Double_t fXFront
vector< Double_t > fGoodAdcPulseAmp
static const Int_t kADCSampleIntegral
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
vector< Double_t > fGoodAdcPulseInt
Int_t fDataSampHigh
Int_t fPedSampLow
virtual void FillADC_SampIntDynPed()
Int_t fTotStatNumTrk
TClonesArray * frAdcSampPulseTime
virtual Int_t CoarseProcessHits()
THaDetectorBase * fParent
Double_t fClustSize
TClonesArray * frAdcPulseAmp
Int_t fSampNSAT
TClonesArray * frAdcSampWaveform
Double_t fvYmax()
Int_t * fPedCount
Int_t fTotNumAdcHits
vector< Double_t > fE
Int_t fOutputSampWaveform
Double_t ** fXPos
virtual void FillADC_SampleIntegral()
Double_t fMatchClX
Double_t fAdcSampThreshold
vector< Double_t > fGoodAdcPulseIntRaw
Double_t fvXmin()
virtual void CalculatePedestals()
vector< Double_t > fGoodAdcTdcDiffTime
vector< Double_t > fSampWaveform
Int_t fUsingFADC
virtual Bool_t IsPid()
Definition THcNPSArray.h:47
THcNPSShowerClusterList * fClusterList
TClonesArray * frAdcPedRaw
Double_t fSampThreshold
virtual void Clear(Option_t *opt="")
virtual Int_t ClearProcessedHits()
TClonesArray * frAdcPulseAmpRaw
TClonesArray * frAdcSampPed
ClassDef(THcNPSArray, 0)
Double_t * fAdcTimeWindowMax
vector< Int_t > fStatNumTrk
Double_t fvYmin()
vector< Double_t > fT
Int_t fTotNumGoodAdcHits
Double_t fMatchClMaxEnergyBlock
virtual Int_t AccumulateHits(TClonesArray *rawhits, Int_t nexthit, Int_t quadrant)
Int_t fNPedestalEvents
Int_t fDataSampWidth
Double_t GetClX()
Definition THcNPSArray.h:66
Double_t ** fZPos
Double_t fEarray
TClonesArray * frAdcErrorFlag
Double_t GetClY()
Definition THcNPSArray.h:69
Double_t fYFront
TClonesArray * frAdcSampPulseAmp
Int_t fLayerNum
Int_t fOutputSampRawWaveform
Int_t fDebugAdc
Double_t fStatCerMin
TClonesArray * frAdcPulseTime
Double_t * fAdcTimeWindowMin
virtual Int_t CoarseProcess(TClonesArray &tracks)
Bool_t IsTracking()
Definition THcNPSArray.h:46
virtual ~THcNPSArray()
Int_t fUseSampWaveform
Int_t fDataSampLow
vector< Int_t > fStatNumHit
Double_t fZFront
Int_t fPedSampHigh
Double_t ** fYPos
Float_t * fThresh
UInt_t fNColumns
TClonesArray * frAdcSampPulseAmpRaw
Float_t * fPed
Int_t AccumulateStat(TClonesArray &tracks)
virtual Int_t FineProcess(TClonesArray &tracks)
Double_t clMaxEnergyBlock(THcNPSShowerCluster *cluster)
vector< Double_t > fGoodAdcPed
TClonesArray * frAdcSampPulseTimeRaw
TClonesArray * frAdcPulseInt
Int_t * fPedSum
Double_t fvXmax()
TClonesArray * frAdcSampPulseInt
virtual void FillADC_Standard()
Int_t GetNeighbor(UInt_t id, UInt_t k)
Double_t fAdcThreshold
Double_t fZSize
Int_t fClustMethod
TClonesArray * frAdcSampPedRaw
static const Int_t kADCStandard
virtual Int_t ReadDatabase(const TDatime &date)
void GetMax(Float_t pInei[8], Int_t nei[8], Int_t &virus_blk, Float_t &max)
virtual void InitializePedestals()
Int_t * fPedDefault
Int_t shms2nps_transform(Int_t padnum, Int_t transform)
Double_t GetEarray()
Definition THcNPSArray.h:96
TClonesArray * frAdcPed
virtual Int_t DefineVariables(EMode mode=kDefine)
Double_t GetClSize()
Definition THcNPSArray.h:63
Double_t GetClMaxEnergyBlock()
Definition THcNPSArray.h:60
UInt_t fNRows
static const Int_t kADCDynamicPedestal
Int_t * fPedSum2
Double_t fYStep
virtual Int_t Decode(const THaEvData &)
THcHodoscope * fglHod