Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcScintillatorPlane.h
Go to the documentation of this file.
1#ifndef ROOT_THcScintillatorPlane
2#define ROOT_THcScintillatorPlane
3
5//
6// THcScintillatorPlane
7//
8// A Hall C scintillator 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 "TClonesArray.h"
18
19using namespace std;
20
21class THaEvData;
22class THaSignalHit;
23
25
26 public:
27 THcScintillatorPlane( const char* name, const char* description,
28 Int_t planenum, THaDetectorBase* parent = NULL);
29 virtual ~THcScintillatorPlane();
30
31 virtual void Clear( Option_t* opt="" );
32 virtual Int_t Decode( const THaEvData& );
33 virtual EStatus Init( const TDatime& run_time );
34
35 virtual Int_t CoarseProcess( TClonesArray& tracks );
36 virtual Int_t FineProcess( TClonesArray& tracks );
37 Bool_t IsTracking() { return kFALSE; }
38 virtual Bool_t IsPid() { return kFALSE; }
39
40 virtual Int_t ProcessHits(TClonesArray* rawhits, Int_t nexthit);
41
42 virtual Int_t AccumulatePedestals(TClonesArray* rawhits, Int_t nexthit);
43 virtual void CalculatePedestals( );
44
45 Int_t GetNelem() {return fNelem;}; // return number of paddles in this plane
46 Int_t GetNScinHits() {return fNScinHits;}; // Get # hits in plane (that pass min/max TDC cuts)
47 Int_t GetNGoodHits() {return fNGoodHits;}; // Get # hits in plane (used in determining focal plane time)
48 Double_t GetHitDistance() {return fHitDistance;}; // Distance between track and hit paddle
49 Double_t GetTrackXPosition() {return fTrackXPosition;}; // Distance track X position at plane
50 Double_t GetTrackYPosition() {return fTrackYPosition;}; // Distance track Y position at plane
51 Double_t GetSpacing() {return fSpacing;}; // spacing of paddles
52 Double_t GetSize() {return fSize;}; // paddle size
53 Double_t GetHodoSlop() {return fHodoSlop;}; // hodo slop
54 Double_t GetZpos() {return fZpos;}; //return the z position
59 Double_t GetPosCenter(Int_t PaddleNo) {return fPosCenter[PaddleNo];}; // counting from zero!
61 Double_t GetNumberClusters() {return fNumberClusters;}; // number of paddle clusters
62
65 void SetHitDistance(Double_t f) {fHitDistance=f;}; // Distance between track and hit paddle
66 void SetScinYPos(Double_t f) {fScinYPos=f;}; // Scint Average Y position at plane (cm)
67 void SetScinXPos(Double_t f) {fScinXPos=f;}; // Scint Average X position at plane (cm)
68 void SetTrackXPosition(Double_t f) {fTrackXPosition=f;}; // Distance track X position at plane
69 void SetTrackYPosition(Double_t f) {fTrackYPosition=f;}; // Distance track Y position at plane
70 void SetNumberClusters(Int_t nclus) {fNumberClusters=nclus;}; // number of paddle
73 void SetClusterFlag(Int_t ic,Double_t flag) {((THcScintPlaneCluster*) fCluster->ConstructedAt(ic))->SetFlag(flag);}
74 void SetClusterUsedFlag(Int_t ic,Double_t flag) {((THcScintPlaneCluster*) fCluster->ConstructedAt(ic))->SetUsedFlag(flag);}
75
77
79
81
82 protected:
83
86
87
97
103
109
115
121
138
139 //Hodoscopes Multiplicities
144
148
152
156
157 //Hodoscope "GOOD" Occupancies
158 vector<Int_t> fNumGoodPosAdcHits;
159 vector<Int_t> fNumGoodNegAdcHits;
160
161 vector<Int_t> fNumGoodPosTdcHits;
162 vector<Int_t> fNumGoodNegTdcHits;
163
164 //Hodoscopoe "GOOD" ADC Ped/Amps/Ints/Time
165 vector<Double_t> fGoodPosAdcPed;
166 vector<Double_t> fGoodNegAdcPed;
167
168 vector<Double_t> fGoodPosAdcMult;
169 vector<Double_t> fGoodNegAdcMult;
170
171 vector<Double_t> fGoodPosAdcHitUsed;
172 vector<Double_t> fGoodNegAdcHitUsed;
173
174 vector<Double_t> fGoodPosAdcPulseAmp;
175 vector<Double_t> fGoodNegAdcPulseAmp;
176
177 vector<Double_t> fGoodPosAdcPulseInt;
178 vector<Double_t> fGoodNegAdcPulseInt;
179
180 vector<Double_t> fGoodPosAdcPulseTime;
181 vector<Double_t> fGoodNegAdcPulseTime;
182
183 vector<Double_t> fGoodPosAdcTdcDiffTime;
184 vector<Double_t> fGoodNegAdcTdcDiffTime;
185
186 vector<Double_t> fNegAdcSampWaveform;
187 vector<Double_t> fPosAdcSampWaveform;
188
189 //Hodoscopoe "GOOD" TDC Variables
190 vector<Double_t> fGoodPosTdcTimeUnCorr;
191 vector<Double_t> fGoodPosTdcTimeCorr;
192 vector<Double_t> fGoodPosTdcTimeTOFCorr;
193
194 vector<Double_t> fGoodNegTdcTimeUnCorr;
195 vector<Double_t> fGoodNegTdcTimeCorr;
196 vector<Double_t> fGoodNegTdcTimeTOFCorr;
197
198 //Time Walk Corrected
199 vector<Double_t> fGoodPosTdcTimeWalkCorr;
200 vector<Double_t> fGoodNegTdcTimeWalkCorr;
201 vector<Double_t> fGoodDiffDistTrack;
202
218 Int_t fPlaneNum; /* Which plane am I 1-4 */
219 UInt_t fTotPlanes; /* so we can read variables that are not indexed by plane id */
220 UInt_t fNelem; /* Need since we don't inherit from
221 detector base class */
222 Int_t fNScinHits; /* number of hits in plane (that pass min/max TDC cuts) */
223 Int_t fNGoodHits; /* number of hits in plane (used in determining focal plane time) */
224
225 // Constants
226 Int_t fADCMode; // 0: standard, 1: use FADC ped, 2: integrate sample
227 // 3: integrate sample, subract dynamic pedestal
228 static const Int_t kADCStandard=0;
230 static const Int_t kADCSampleIntegral=2;
231 static const Int_t kADCSampIntDynPed=3;
232 Double_t fADCPedScaleFactor; // Multiply dynamic pedestal by this before subtracting
233 Int_t fADCDiagCut; // Cut for ADC in hit maps. Defaults to 50
234 Int_t fTdcOffset; /* Overall offset to raw tdc */
235 Double_t fAdcTdcOffset; /* Overall offset to raw adc times */
236
243
244 Int_t fMaxHits; /* maximum number of hits to be considered - useful for dimensioning arrays */
245 Double_t fSpacing; /* paddle spacing */
246 Double_t fSize; /* paddle size */
247 Double_t fZpos; /* z position */
249 Double_t fHodoSlop; /* max allowed slop for this plane */
250 Double_t fPosLeft; /* NOTE: "left" = "bottom" for a Y scintillator */
251 Double_t fPosRight; /* NOTE: "right" = "top" for a Y scintillator */
253 Double_t *fPosCenter; /* array with centers for all scintillators in the plane */
261 Double_t *fHodoPosMinPh; // Minimum pulse height per paddle for this plane
262 Double_t *fHodoNegMinPh; // Minimum pulse height per paddle for this plane
263 Double_t *fHodoPosPhcCoeff; // Pulse height to time coefficient per paddle for this plane
264 Double_t *fHodoNegPhcCoeff; // Pulse height to time coefficient per paddlefor this plane
279 //Time-Walk Parameters
288
291
293 Double_t fTolerance; /* need this for Focal Plane Time estimation */
295 /* Pedestal Quantities */
296 Int_t fNPedestalEvents; /* Number of pedestal events */
297 Int_t fMinPeds; /* Only analyze/update if num events > */
298 Int_t *fPosPedSum; /* Accumulators for pedestals */
306
313 //
316
317 //
318 Int_t fNScinGoodHits; // number of hits for which both ends of the paddle fired in time!
319 Double_t fpTime; // the original code only has one fpTime per plane!
320
321 virtual Int_t ReadDatabase( const TDatime& date );
322 virtual Int_t DefineVariables( EMode mode = kDefine );
323 virtual void InitializePedestals( );
324
325 ClassDef(THcScintillatorPlane,0); // Scintillator bars in a plane
326};
327#endif
int Int_t
unsigned int UInt_t
#define f(i)
size_t size(const MatrixT &matrix)
bool Bool_t
const Bool_t kFALSE
double Double_t
const char Option_t
string::size_type pos
TObject * ConstructedAt(Int_t idx)
A single plane of scintillators.
void SetCluster(Int_t ic, Double_t pos)
TClonesArray * frPosAdcSampPulseInt
vector< Double_t > fGoodPosAdcPulseTime
vector< Double_t > fGoodNegAdcHitUsed
TClonesArray * frPosAdcPulseAmpRaw
vector< Double_t > fGoodNegTdcTimeTOFCorr
TClonesArray * frNegAdcSampPulseInt
vector< Double_t > fGoodPosAdcPulseInt
vector< Double_t > fGoodPosTdcTimeUnCorr
vector< Double_t > fGoodNegAdcTdcDiffTime
virtual Int_t FineProcess(TClonesArray &tracks)
TClonesArray * frPosAdcSampPulseIntRaw
TClonesArray * frPosAdcSampPulseAmp
virtual void Clear(Option_t *opt="")
TClonesArray * frNegAdcPulseTimeRaw
TClonesArray * frNegAdcSampPulseTimeRaw
vector< Double_t > fNegAdcSampWaveform
vector< Double_t > fGoodNegAdcPulseAmp
TClonesArray * frPosAdcPulseTimeRaw
THcScintillatorPlane(const char *name, const char *description, Int_t planenum, THaDetectorBase *parent=NULL)
void SetTrackXPosition(Double_t f)
vector< Int_t > fNumGoodNegTdcHits
static const Int_t kADCDynamicPedestal
virtual Int_t ReadDatabase(const TDatime &date)
TClonesArray * frNegAdcSampPedRaw
vector< Double_t > fGoodPosAdcPed
vector< Double_t > fGoodPosAdcPulseAmp
ClassDef(THcScintillatorPlane, 0)
vector< Int_t > fNumGoodPosAdcHits
void SetScinXPos(Double_t f)
void SetScinYPos(Double_t f)
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
TClonesArray * frNegAdcSampPulseTime
TClonesArray * frNegAdcPulseIntRaw
TClonesArray * frPosAdcSampPedRaw
virtual Int_t Decode(const THaEvData &)
vector< Int_t > fNumGoodPosTdcHits
void SetNumberClusters(Int_t nclus)
TClonesArray * frPosAdcSampPulseTime
vector< Int_t > fNumGoodNegAdcHits
TClonesArray * frPosAdcSampPulseAmpRaw
static const Int_t kADCSampleIntegral
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
static const Int_t kADCStandard
virtual Int_t DefineVariables(EMode mode=kDefine)
vector< Double_t > fGoodDiffDistTrack
vector< Double_t > fGoodPosTdcTimeWalkCorr
TClonesArray * frNegAdcPulseAmpRaw
void SetHitDistance(Double_t f)
TClonesArray * frPosAdcErrorFlag
TClonesArray * frNegAdcSampPulseAmp
TClonesArray * frPosAdcSampPulseTimeRaw
vector< Double_t > fGoodNegAdcPed
vector< Double_t > fGoodPosAdcTdcDiffTime
vector< Double_t > fGoodNegTdcTimeUnCorr
vector< Double_t > fGoodNegTdcTimeCorr
vector< Double_t > fGoodNegAdcPulseInt
vector< Double_t > fGoodPosAdcHitUsed
TClonesArray * frNegAdcSampPulseIntRaw
void SetClusterUsedFlag(Int_t ic, Double_t flag)
vector< Double_t > fGoodPosAdcMult
vector< Double_t > fGoodNegAdcPulseTime
vector< Double_t > fGoodPosTdcTimeCorr
vector< Double_t > fGoodNegAdcMult
static const Int_t kADCSampIntDynPed
virtual Int_t CoarseProcess(TClonesArray &tracks)
void SetTrackYPosition(Double_t f)
TClonesArray * frNegAdcSampPulseAmpRaw
Double_t GetPosCenter(Int_t PaddleNo)
TClonesArray * frNegAdcErrorFlag
void SetClusterSize(Int_t ic, Double_t size)
vector< Double_t > fGoodNegTdcTimeWalkCorr
TClonesArray * frPosAdcPulseIntRaw
vector< Double_t > fPosAdcSampWaveform
void SetClusterFlag(Int_t ic, Double_t flag)
vector< Double_t > fGoodPosTdcTimeTOFCorr
STL namespace.