Hall C ROOT/C++ Analyzer (hcana)
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"
17 #include "THcScintPlaneCluster.h"
18 
19 using namespace std;
20 
21 class THaEvData;
22 class THaSignalHit;
23 
24 class THcScintillatorPlane : public THaSubDetector {
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
55  Double_t GetDzpos() {return fDzpos;};
56  Double_t GetPosLeft() {return fPosLeft;};
57  Double_t GetPosRight() {return fPosRight;};
58  Double_t GetPosOffset() {return fPosOffset;};
59  Double_t GetPosCenter(Int_t PaddleNo) {return fPosCenter[PaddleNo];}; // counting from zero!
60  Double_t GetFpTime() {return fFptime;};
61  Double_t GetNumberClusters() {return fNumberClusters;}; // number of paddle clusters
62 
63  void SetFpTime(Double_t f) {fFptime=f;};
64  void SetNGoodHits(Int_t ng) {fNGoodHits=ng;};
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
71  void SetCluster(Int_t ic,Double_t pos) {((THcScintPlaneCluster*) fCluster->ConstructedAt(ic))->Set(ic,pos);}
72  void SetClusterSize(Int_t ic,Double_t size) {((THcScintPlaneCluster*) fCluster->ConstructedAt(ic))->SetSize(size);}
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 
78  TClonesArray* GetHits() { return fHodoHits;};
79 
80  TClonesArray* fCluster;
81 
82  protected:
83 
86 
87 
97 
103 
109 
115 
121 
122  //Hodoscopes Multiplicities
127 
131 
135 
139 
140  //Hodoscope "GOOD" Occupancies
141  vector<Int_t> fNumGoodPosAdcHits;
142  vector<Int_t> fNumGoodNegAdcHits;
143 
144  vector<Int_t> fNumGoodPosTdcHits;
145  vector<Int_t> fNumGoodNegTdcHits;
146 
147  //Hodoscopoe "GOOD" ADC Ped/Amps/Ints/Time
148  vector<Double_t> fGoodPosAdcPed;
149  vector<Double_t> fGoodNegAdcPed;
150 
151  vector<Double_t> fGoodPosAdcMult;
152  vector<Double_t> fGoodNegAdcMult;
153 
154  vector<Double_t> fGoodPosAdcHitUsed;
155  vector<Double_t> fGoodNegAdcHitUsed;
156 
157  vector<Double_t> fGoodPosAdcPulseAmp;
158  vector<Double_t> fGoodNegAdcPulseAmp;
159 
160  vector<Double_t> fGoodPosAdcPulseInt;
161  vector<Double_t> fGoodNegAdcPulseInt;
162 
163  vector<Double_t> fGoodPosAdcPulseTime;
164  vector<Double_t> fGoodNegAdcPulseTime;
165 
166  vector<Double_t> fGoodPosAdcTdcDiffTime;
167  vector<Double_t> fGoodNegAdcTdcDiffTime;
168 
169  //Hodoscopoe "GOOD" TDC Variables
170  vector<Double_t> fGoodPosTdcTimeUnCorr;
171  vector<Double_t> fGoodPosTdcTimeCorr;
172  vector<Double_t> fGoodPosTdcTimeTOFCorr;
173 
174  vector<Double_t> fGoodNegTdcTimeUnCorr;
175  vector<Double_t> fGoodNegTdcTimeCorr;
176  vector<Double_t> fGoodNegTdcTimeTOFCorr;
177 
178  //Time Walk Corrected
179  vector<Double_t> fGoodPosTdcTimeWalkCorr;
180  vector<Double_t> fGoodNegTdcTimeWalkCorr;
181  vector<Double_t> fGoodDiffDistTrack;
182 
198  Int_t fPlaneNum; /* Which plane am I 1-4 */
199  UInt_t fTotPlanes; /* so we can read variables that are not indexed by plane id */
200  UInt_t fNelem; /* Need since we don't inherit from
201  detector base class */
202  Int_t fNScinHits; /* number of hits in plane (that pass min/max TDC cuts) */
203  Int_t fNGoodHits; /* number of hits in plane (used in determining focal plane time) */
204 
205  // Constants
206  Int_t fADCMode; // 0: standard, 1: use FADC ped, 2: integrate sample
207  // 3: integrate sample, subract dynamic pedestal
208  static const Int_t kADCStandard=0;
209  static const Int_t kADCDynamicPedestal=1;
210  static const Int_t kADCSampleIntegral=2;
211  static const Int_t kADCSampIntDynPed=3;
212  Double_t fADCPedScaleFactor; // Multiply dynamic pedestal by this before subtracting
213  Int_t fADCDiagCut; // Cut for ADC in hit maps. Defaults to 50
214  Int_t fTdcOffset; /* Overall offset to raw tdc */
215  Double_t fAdcTdcOffset; /* Overall offset to raw adc times */
216  Int_t fMaxHits; /* maximum number of hits to be considered - useful for dimensioning arrays */
217  Double_t fSpacing; /* paddle spacing */
218  Double_t fSize; /* paddle size */
219  Double_t fZpos; /* z position */
221  Double_t fHodoSlop; /* max allowed slop for this plane */
222  Double_t fPosLeft; /* NOTE: "left" = "bottom" for a Y scintillator */
223  Double_t fPosRight; /* NOTE: "right" = "top" for a Y scintillator */
225  Double_t *fPosCenter; /* array with centers for all scintillators in the plane */
233  Double_t *fHodoPosMinPh; // Minimum pulse height per paddle for this plane
234  Double_t *fHodoNegMinPh; // Minimum pulse height per paddle for this plane
235  Double_t *fHodoPosPhcCoeff; // Pulse height to time coefficient per paddle for this plane
236  Double_t *fHodoNegPhcCoeff; // Pulse height to time coefficient per paddlefor this plane
251  //Time-Walk Parameters
260 
263 
265  Double_t fTolerance; /* need this for Focal Plane Time estimation */
267  /* Pedestal Quantities */
268  Int_t fNPedestalEvents; /* Number of pedestal events */
269  Int_t fMinPeds; /* Only analyze/update if num events > */
270  Int_t *fPosPedSum; /* Accumulators for pedestals */
278 
285  //
288 
289  //
290  Int_t fNScinGoodHits; // number of hits for which both ends of the paddle fired in time!
291  Double_t fpTime; // the original code only has one fpTime per plane!
292 
293  virtual Int_t ReadDatabase( const TDatime& date );
294  virtual Int_t DefineVariables( EMode mode = kDefine );
295  virtual void InitializePedestals( );
296 
297  ClassDef(THcScintillatorPlane,0); // Scintillator bars in a plane
298 };
299 #endif
vector< Double_t > fGoodNegTdcTimeCorr
TClonesArray * GetHits()
A single plane of scintillators.
vector< Int_t > fNumGoodNegTdcHits
vector< Double_t > fGoodPosTdcTimeUnCorr
TClonesArray * frNegAdcPulseAmp
vector< Double_t > fGoodPosAdcPulseTime
const char Option_t
TClonesArray * frNegAdcPulseAmpRaw
void SetClusterUsedFlag(Int_t ic, Double_t flag)
void SetScinYPos(Double_t f)
TClonesArray * frPosAdcPulseInt
vector< Double_t > fGoodNegAdcMult
TClonesArray * frNegAdcPulseTimeRaw
TClonesArray * frPosTdcTimeRaw
void SetFpTime(Double_t f)
int Int_t
TClonesArray * frNegAdcErrorFlag
bool Bool_t
vector< Double_t > fGoodPosTdcTimeTOFCorr
vector< Double_t > fGoodNegTdcTimeTOFCorr
STL namespace.
TClonesArray * fParentHitList
vector< Double_t > fGoodNegAdcPulseInt
vector< Double_t > fGoodNegAdcPulseAmp
vector< Double_t > fGoodNegTdcTimeWalkCorr
vector< Double_t > fGoodNegAdcHitUsed
#define ClassDef(name, id)
vector< Double_t > fGoodPosAdcHitUsed
vector< Double_t > fGoodPosTdcTimeCorr
TClonesArray * frNegAdcPulseTime
TClonesArray * frNegTdcTimeRaw
TClonesArray * frPosAdcErrorFlag
void SetClusterFlag(Int_t ic, Double_t flag)
vector< Int_t > fNumGoodPosAdcHits
vector< Double_t > fGoodPosTdcTimeWalkCorr
vector< Double_t > fGoodPosAdcPulseAmp
void SetClusterSize(Int_t ic, Double_t size)
vector< Int_t > fNumGoodPosTdcHits
TClonesArray * frNegAdcPulseInt
TClonesArray * frPosAdcPulseAmp
unsigned int UInt_t
vector< Double_t > fGoodPosAdcPed
void SetNumberClusters(Int_t nclus)
TClonesArray * frPosAdcPulseAmpRaw
vector< Double_t > fGoodPosAdcMult
vector< Double_t > fGoodPosAdcPulseInt
const Bool_t kFALSE
TClonesArray * frPosAdcPedRaw
double Double_t
vector< Double_t > fGoodNegAdcTdcDiffTime
string::size_type pos
void SetTrackXPosition(Double_t f)
TClonesArray * frNegAdcPulseIntRaw
vector< Double_t > fGoodNegAdcPulseTime
void SetCluster(Int_t ic, Double_t pos)
vector< Int_t > fNumGoodNegAdcHits
void SetScinXPos(Double_t f)
vector< Double_t > fGoodNegTdcTimeUnCorr
void SetHitDistance(Double_t f)
TClonesArray * frPosAdcPulseTimeRaw
void SetTrackYPosition(Double_t f)
vector< Double_t > fGoodDiffDistTrack
TClonesArray * frPosAdcPulseIntRaw
vector< Double_t > fGoodPosAdcTdcDiffTime
Double_t GetPosCenter(Int_t PaddleNo)
vector< Double_t > fGoodNegAdcPed
char name[80]
TClonesArray * frPosAdcPulseTime