Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcShowerPlane.cxx
Go to the documentation of this file.
1
8#include "THcShowerPlane.h"
9#include "THcHodoscope.h"
10#include "TClonesArray.h"
11#include "THcSignalHit.h"
12#include "THcGlobals.h"
13#include "THcParmList.h"
14#include "THcHitList.h"
15#include "THcShower.h"
16#include "THcRawShowerHit.h"
17#include "TClass.h"
18#include "math.h"
19#include "THaTrack.h"
20#include "THaTrackProj.h"
22
23#include <cstring>
24#include <cstdio>
25#include <cstdlib>
26#include <iostream>
27
28#include <fstream>
29
30using namespace std;
31
33
34//______________________________________________________________________________
35THcShowerPlane::THcShowerPlane( const char* name,
36 const char* description,
37 const Int_t layernum,
38 THaDetectorBase* parent )
39 : THaSubDetector(name,description,parent)
40{
41 // Normal constructor with name and description
42 fPosADCHits = new TClonesArray("THcSignalHit",fNelem);
43 fNegADCHits = new TClonesArray("THcSignalHit",fNelem);
44
45 frPosAdcErrorFlag = new TClonesArray("THcSignalHit", 16);
46 frPosAdcPedRaw = new TClonesArray("THcSignalHit", 16);
47 frPosAdcThreshold = new TClonesArray("THcSignalHit", 16);
48 frPosAdcPulseIntRaw = new TClonesArray("THcSignalHit", 16);
49 frPosAdcPulseAmpRaw = new TClonesArray("THcSignalHit", 16);
50 frPosAdcPulseTimeRaw = new TClonesArray("THcSignalHit", 16);
51
52 frPosAdcPed = new TClonesArray("THcSignalHit", 16);
53 frPosAdcPulseInt = new TClonesArray("THcSignalHit", 16);
54 frPosAdcPulseAmp = new TClonesArray("THcSignalHit", 16);
55 frPosAdcPulseTime = new TClonesArray("THcSignalHit", 16);
56
57 frNegAdcErrorFlag = new TClonesArray("THcSignalHit", 16);
58 frNegAdcPedRaw = new TClonesArray("THcSignalHit", 16);
59 frNegAdcThreshold = new TClonesArray("THcSignalHit", 16);
60 frNegAdcPulseIntRaw = new TClonesArray("THcSignalHit", 16);
61 frNegAdcPulseAmpRaw = new TClonesArray("THcSignalHit", 16);
62 frNegAdcPulseTimeRaw = new TClonesArray("THcSignalHit", 16);
63
64 frNegAdcPed = new TClonesArray("THcSignalHit", 16);
65 frNegAdcPulseInt = new TClonesArray("THcSignalHit", 16);
66 frNegAdcPulseAmp = new TClonesArray("THcSignalHit", 16);
67 frNegAdcPulseTime = new TClonesArray("THcSignalHit", 16);
68
69 frPosAdcSampPedRaw = new TClonesArray("THcSignalHit", 16);
70 frPosAdcSampPulseIntRaw = new TClonesArray("THcSignalHit", 16);
71 frPosAdcSampPulseAmpRaw = new TClonesArray("THcSignalHit", 16);
72 frPosAdcSampPulseTimeRaw = new TClonesArray("THcSignalHit", 16);
73 frPosAdcSampPed = new TClonesArray("THcSignalHit", 16);
74 frPosAdcSampPulseInt = new TClonesArray("THcSignalHit", 16);
75 frPosAdcSampPulseAmp = new TClonesArray("THcSignalHit", 16);
76 frPosAdcSampPulseTime = new TClonesArray("THcSignalHit", 16);
77
78 frNegAdcSampPedRaw = new TClonesArray("THcSignalHit", 16);
79 frNegAdcSampPulseIntRaw = new TClonesArray("THcSignalHit", 16);
80 frNegAdcSampPulseAmpRaw = new TClonesArray("THcSignalHit", 16);
81 frNegAdcSampPulseTimeRaw = new TClonesArray("THcSignalHit", 16);
82 frNegAdcSampPed = new TClonesArray("THcSignalHit", 16);
83 frNegAdcSampPulseInt = new TClonesArray("THcSignalHit", 16);
84 frNegAdcSampPulseAmp = new TClonesArray("THcSignalHit", 16);
85 frNegAdcSampPulseTime = new TClonesArray("THcSignalHit", 16);
86
87
88 //#if ROOT_VERSION_CODE < ROOT_VERSION(5,32,0)
89 // fPosADCHitsClass = fPosADCHits->GetClass();
90 // fNegADCHitsClass = fNegADCHits->GetClass();
91 //#endif
92
93 fLayerNum = layernum;
94}
95
96//______________________________________________________________________________
98{
99 // Destructor
100 delete fPosADCHits; fPosADCHits = NULL;
101 delete fNegADCHits; fNegADCHits = NULL;
102
104 delete frPosAdcPedRaw; frPosAdcPedRaw = NULL;
109
110 delete frPosAdcPed; frPosAdcPed = NULL;
111 delete frPosAdcPulseInt; frPosAdcPulseInt = NULL;
112 delete frPosAdcPulseAmp; frPosAdcPulseAmp = NULL;
114
116 delete frNegAdcPedRaw; frNegAdcPedRaw = NULL;
121
126 delete frPosAdcSampPed; frPosAdcSampPed = NULL;
130
135 delete frNegAdcSampPed; frNegAdcSampPed = NULL;
139
140 delete frNegAdcPed; frNegAdcPed = NULL;
141 delete frNegAdcPulseInt; frNegAdcPulseInt = NULL;
142 delete frNegAdcPulseAmp; frNegAdcPulseAmp = NULL;
144
145 delete [] fPosPedSum;
146 delete [] fPosPedSum2;
147 delete [] fPosPedLimit;
148 delete [] fPosPedCount;
149
150 delete [] fNegPedSum;
151 delete [] fNegPedSum2;
152 delete [] fNegPedLimit;
153 delete [] fNegPedCount;
154
155 delete [] fPosPed;
156 delete [] fPosSig;
157 delete [] fPosThresh;
158
159 delete [] fNegPed;
160 delete [] fNegSig;
161 delete [] fNegThresh;
162
163// delete [] fEpos;
164 // delete [] fEneg;
165 // delete [] fEmean;
166}
167
168//_____________________________________________________________________________
170{
171 // Extra initialization for shower layer: set up DataDest map
172
173 if( IsZombie())
174 return fStatus = kInitError;
175
176 // How to get information for parent
177 // if( GetParent() )
178 // fOrigin = GetParent()->GetOrigin();
179 fParent = GetParent();
180
181 // Get pointer to Cherenkov object. "hgcer" if SHMS, "cer" if other
183 if (fParent->GetPrefix()[0] == 'P') {
184 fCherenkov = dynamic_cast<THcCherenkov*>(app->GetDetector("hgcer"));
185 } else {
186 fCherenkov = dynamic_cast<THcCherenkov*>(app->GetDetector("cer"));
187 }
188 if (!fCherenkov) {
189 cout << "****** THcShowerPlane::Init Cherenkov not found! ******" << endl;
190 cout << "****** THcShowerPlane::Accumulate will be skipped ******" << endl;
191 }
192
193 if( !app ||
194 !(fglHod = dynamic_cast<THcHodoscope*>(app->GetDetector("hod"))) ) {
195 static const char* const here = "ReadDatabase()";
196 Warning(Here(here),"Hodoscope \"%s\" not found. ","hod");
197 }
198
199 EStatus status;
200 if( (status=THaSubDetector::Init( date )) )
201 return fStatus = status;
202
203 return fStatus = kOK;
204
205}
206
207//_____________________________________________________________________________
209{
210
211 // Retrieve FADC parameters. In principle may want different dynamic
212 // pedestal and integration range for preshower and shower, but for now
213 // use same parameters
214 char prefix[2];
215 prefix[0]=tolower(fParent->GetPrefix()[0]);
216 prefix[1]='\0';
217 fPedSampLow=0;
218 fPedSampHigh=9;
219 fDataSampLow=23;
220 fDataSampHigh=49;
223 fStatCerMin=1.;
224 fStatSlop=2.;
225 fStatMaxChi2=10.;
226 DBRequest list[]={
227 {"cal_AdcNegThreshold", &fAdcNegThreshold, kDouble, 0, 1},
228 {"cal_AdcPosThreshold", &fAdcPosThreshold, kDouble, 0, 1},
229 {"cal_ped_sample_low", &fPedSampLow, kInt, 0, 1},
230 {"cal_ped_sample_high", &fPedSampHigh, kInt, 0, 1},
231 {"cal_data_sample_low", &fDataSampLow, kInt, 0, 1},
232 {"cal_data_sample_high", &fDataSampHigh, kInt, 0, 1},
233 {"cal_debug_adc", &fDebugAdc, kInt, 0, 1},
234 {"cal_SampThreshold", &fSampThreshold, kDouble,0,1},
235 {"cal_SampNSA", &fSampNSA, kInt,0,1},
236 {"cal_SampNSAT", &fSampNSAT, kInt,0,1},
237 {"cal_SampNSB", &fSampNSB, kInt,0,1},
238 {"cal_OutputSampWaveform", &fOutputSampWaveform, kInt,0,1},
239 {"cal_UseSampWaveform", &fUseSampWaveform, kInt,0,1},
240 {"stat_cermin", &fStatCerMin, kDouble, 0, 1},
241 {"stat_slop", &fStatSlop, kDouble, 0, 1},
242 {"stat_maxchisq", &fStatMaxChi2, kDouble, 0, 1},
243 {0}
244 };
245
246 fDebugAdc = 0; // Set ADC debug parameter to false unless set in parameter file
247
248 fSampThreshold = 5.;
249 fSampNSA = 0; // use value stored in event 125 info
250 fSampNSB = 0; // use value stored in event 125 info
251 fSampNSAT = 2; // default value in THcRawHit::SetF250Params
252 fOutputSampWaveform = 0; // 0= no output , 1 = output Sample Waveform
253 fUseSampWaveform = 0; // 0= do not use , 1 = use Sample Waveform
254
255 gHcParms->LoadParmValues((DBRequest*)&list, prefix);
256
257 // Retrieve more parameters we need from parent class
258 //
259 THcShower* parent = static_cast<THcShower*>(fParent);
260
261 // Find the number of elements
262 fNelem = parent->GetNBlocks(fLayerNum-1);
263
264 // Origin of the plane:
265 //
266 // X is average of top X coordinates of the top and bottom blocks
267 // shifted by a half of the block thickness;
268 // Y is average of left and right edges;
269 // Z is _front_ position of the plane along the beam.
270
271 Double_t BlockThick = parent->GetBlockThick(fLayerNum-1);
272
273 Double_t xOrig = (parent->GetXPos(fLayerNum-1,0) +
274 parent->GetXPos(fLayerNum-1,fNelem-1))/2 +
275 BlockThick/2;
276
277 Double_t yOrig = (parent->GetYPos(fLayerNum-1,0) +
278 parent->GetYPos(fLayerNum-1,1))/2;
279
280 Double_t zOrig = parent->GetZPos(fLayerNum-1);
281
282 fOrigin.SetXYZ(xOrig, yOrig, zOrig);
283
285
286 // Create arrays to hold results here
287 //
288
289 // Pedestal limits per channel.
290
291 fPosPedLimit = new Int_t [fNelem];
292 fNegPedLimit = new Int_t [fNelem];
293
294 for(Int_t i=0;i<fNelem;i++) {
295 fPosPedLimit[i] = parent->GetPedLimit(i,fLayerNum-1,0);
296 fNegPedLimit[i] = parent->GetPedLimit(i,fLayerNum-1,1);
297 }
298
299 fMinPeds = parent->GetMinPeds();
300
302
303 fNumGoodPosAdcHits = vector<Int_t> (fNelem, 0.0);
304 fNumGoodNegAdcHits = vector<Int_t> (fNelem, 0.0);
305
306 fGoodPosAdcPulseIntRaw = vector<Double_t> (fNelem, 0.0);
307 fGoodNegAdcPulseIntRaw = vector<Double_t> (fNelem, 0.0);
308
309 fGoodPosAdcPed = vector<Double_t> (fNelem, 0.0);
310 fGoodPosAdcPulseInt = vector<Double_t> (fNelem, 0.0);
311 fGoodPosAdcPulseAmp = vector<Double_t> (fNelem, 0.0);
312 fGoodPosAdcPulseTime = vector<Double_t> (fNelem, 0.0);
313 fGoodPosAdcTdcDiffTime = vector<Double_t> (fNelem, 0.0);
314
315 fGoodNegAdcPed = vector<Double_t> (fNelem, 0.0);
316 fGoodNegAdcPulseInt = vector<Double_t> (fNelem, 0.0);
317 fGoodNegAdcPulseAmp = vector<Double_t> (fNelem, 0.0);
318 fGoodNegAdcPulseTime = vector<Double_t> (fNelem, 0.0);
319 fGoodNegAdcTdcDiffTime = vector<Double_t> (fNelem, 0.0);
320
321 fGoodPosAdcMult = vector<Double_t> (fNelem, 0.0);
322 fGoodNegAdcMult = vector<Double_t> (fNelem, 0.0);
323
324 // Energy depositions per block (not corrected for track coordinate)
325
326 fEpos = vector<Double_t> (fNelem, 0.0);
327 fEneg = vector<Double_t> (fNelem, 0.0);
328 fEmean = vector<Double_t> (fNelem, 0.0);
329 // fEpos = new Double_t[fNelem];
330 // fEneg = new Double_t[fNelem];
331 // fEmean= new Double_t[fNelem];
332
333 // Numbers of tracks and hits , for efficiency calculations.
334
335 fStatNumTrk = vector<Int_t> (fNelem, 0);
336 fStatNumHit = vector<Int_t> (fNelem, 0);
337 fTotStatNumTrk = 0;
338 fTotStatNumHit = 0;
339
340 // Debug output.
341
342 if (parent->fdbg_init_cal) {
343 cout << "---------------------------------------------------------------\n";
344 cout << "Debug output from THcShowerPlane::ReadDatabase for "
345 << fParent->GetPrefix() << ":" << endl;
346
347 cout << " Layer #" << fLayerNum << ", number of elements " << dec << fNelem
348 << endl;
349
350 cout << " Origin of Layer at X = " << fOrigin.X()
351 << " Y = " << fOrigin.Y() << " Z = " << fOrigin.Z() << endl;
352
353 cout << " fPosPedLimit:";
354 for(Int_t i=0;i<fNelem;i++) cout << " " << fPosPedLimit[i];
355 cout << endl;
356 cout << " fNegPedLimit:";
357 for(Int_t i=0;i<fNelem;i++) cout << " " << fNegPedLimit[i];
358 cout << endl;
359
360 cout << " fMinPeds = " << fMinPeds << endl;
361 cout << "---------------------------------------------------------------\n";
362 }
363
364 return kOK;
365}
366
367//_____________________________________________________________________________
369{
370 // Initialize global variables and lookup table for decoder
371
372 if( mode == kDefine && fIsSetup ) return kOK;
373 fIsSetup = ( mode == kDefine );
374
375 // Register variables in global list
376
377 if (fDebugAdc) {
378 RVarDef vars[] = {
379 {"posAdcPedRaw", "List of positive raw ADC pedestals", "frPosAdcPedRaw.THcSignalHit.GetData()"},
380 {"posAdcPulseIntRaw", "List of positive raw ADC pulse integrals.", "frPosAdcPulseIntRaw.THcSignalHit.GetData()"},
381 {"posAdcPulseAmpRaw", "List of positive raw ADC pulse amplitudes.", "frPosAdcPulseAmpRaw.THcSignalHit.GetData()"},
382 {"posAdcPulseTimeRaw", "List of positive raw ADC pulse times.", "frPosAdcPulseTimeRaw.THcSignalHit.GetData()"},
383
384 {"posAdcPed", "List of positive ADC pedestals", "frPosAdcPed.THcSignalHit.GetData()"},
385 {"posAdcPulseInt", "List of positive ADC pulse integrals.", "frPosAdcPulseInt.THcSignalHit.GetData()"},
386 {"posAdcPulseAmp", "List of positive ADC pulse amplitudes.", "frPosAdcPulseAmp.THcSignalHit.GetData()"},
387 {"posAdcPulseTime", "List of positive ADC pulse times.", "frPosAdcPulseTime.THcSignalHit.GetData()"},
388
389 {"posAdcSampPedRaw", "Positive Raw Samp ADC pedestals", "frPosAdcSampPedRaw.THcSignalHit.GetData()"},
390 {"posAdcSampPulseIntRaw", "Positive Raw Samp ADC pulse integrals", "frPosAdcSampPulseIntRaw.THcSignalHit.GetData()"},
391 {"posAdcSampPulseAmpRaw", "Positive Raw Samp ADC pulse amplitudes", "frPosAdcSampPulseAmpRaw.THcSignalHit.GetData()"},
392 {"posAdcSampPulseTimeRaw", "Positive Raw Samp ADC pulse times", "frPosAdcSampPulseTimeRaw.THcSignalHit.GetData()"},
393 {"posAdcSampPed", "Positive Samp ADC pedestals", "frPosAdcSampPed.THcSignalHit.GetData()"},
394 {"posAdcSampPulseInt", "Positive Samp ADC pulse integrals", "frPosAdcSampPulseInt.THcSignalHit.GetData()"},
395 {"posAdcSampPulseAmp", "Positive Samp ADC pulse amplitudes", "frPosAdcSampPulseAmp.THcSignalHit.GetData()"},
396 {"posAdcSampPulseTime", "Positive Samp ADC pulse times", "frPosAdcSampPulseTime.THcSignalHit.GetData()"},
397
398 {"negAdcPedRaw", "List of negative raw ADC pedestals", "frNegAdcPedRaw.THcSignalHit.GetData()"},
399 {"negAdcPulseIntRaw", "List of negative raw ADC pulse integrals.", "frNegAdcPulseIntRaw.THcSignalHit.GetData()"},
400 {"negAdcPulseAmpRaw", "List of negative raw ADC pulse amplitudes.", "frNegAdcPulseAmpRaw.THcSignalHit.GetData()"},
401 {"negAdcPulseTimeRaw", "List of negative raw ADC pulse times.", "frNegAdcPulseTimeRaw.THcSignalHit.GetData()"},
402
403 {"negAdcPed", "List of negative ADC pedestals", "frNegAdcPed.THcSignalHit.GetData()"},
404 {"negAdcPulseInt", "List of negative ADC pulse integrals.", "frNegAdcPulseInt.THcSignalHit.GetData()"},
405 {"negAdcPulseAmp", "List of negative ADC pulse amplitudes.", "frNegAdcPulseAmp.THcSignalHit.GetData()"},
406 {"negAdcPulseTime", "List of negative ADC pulse times.", "frNegAdcPulseTime.THcSignalHit.GetData()"},
407
408 {"negAdcSampPedRaw", "Negative Raw Samp ADC pedestals", "frNegAdcSampPedRaw.THcSignalHit.GetData()"},
409 {"negAdcSampPulseIntRaw", "Negative Raw Samp ADC pulse integrals", "frNegAdcSampPulseIntRaw.THcSignalHit.GetData()"},
410 {"negAdcSampPulseAmpRaw", "Negative Raw Samp ADC pulse amplitudes", "frNegAdcSampPulseAmpRaw.THcSignalHit.GetData()"},
411 {"negAdcSampPulseTimeRaw", "Negative Raw Samp ADC pulse times", "frNegAdcSampPulseTimeRaw.THcSignalHit.GetData()"},
412 {"negAdcSampPed", "Negative Samp ADC pedestals", "frNegAdcSampPed.THcSignalHit.GetData()"},
413 {"negAdcSampPulseInt", "Negative Samp ADC pulse integrals", "frNegAdcSampPulseInt.THcSignalHit.GetData()"},
414 {"negAdcSampPulseAmp", "Negative Samp ADC pulse amplitudes", "frNegAdcSampPulseAmp.THcSignalHit.GetData()"},
415 {"negAdcSampPulseTime", "Negative Samp ADC pulse times", "frNegAdcSampPulseTime.THcSignalHit.GetData()"},
416
417 { 0 }
418 };
419 DefineVarsFromList( vars, mode);
420 } //end debug statement
421
422 if (fOutputSampWaveform==1) {
423 RVarDef vars[] = {
424 {"adcNegSampWaveform", "FADC Neg ADCSample Waveform", "fNegAdcSampWaveform"},
425 {"adcPosSampWaveform", "FADC Pos ADCSample Waveform", "fPosAdcSampWaveform"},
426 { 0 }
427 };
428 DefineVarsFromList( vars, mode);
429 }
430 //
431
432 // Register counters for efficiency calculations in gHcParms so that the
433 // variables can be used in end of run reports.
434
435 gHcParms->Define(Form("%sstat_trksum%d", fParent->GetPrefix(), fLayerNum),
436 Form("Number of tracks in calo. layer %d",fLayerNum), fTotStatNumTrk);
437 gHcParms->Define(Form("%sstat_hitsum%d", fParent->GetPrefix(), fLayerNum),
438 Form("Number of hits in calo. layer %d", fLayerNum), fTotStatNumHit);
439
440 cout << "THcShowerPlane::DefineVariables: registered counters "
441 << Form("%sstat_trksum%d",fParent->GetPrefix(),fLayerNum) << " and "
442 << Form("%sstat_hitsum%d",fParent->GetPrefix(),fLayerNum) << endl;
443 // getchar();
444
445 RVarDef vars[] = {
446 {"posAdcErrorFlag", "List of positive raw ADC Error Flags", "frPosAdcErrorFlag.THcSignalHit.GetData()"},
447 {"negAdcErrorFlag", "List of negative raw ADC Error Flags ", "frNegAdcErrorFlag.THcSignalHit.GetData()"},
448
449 {"posAdcCounter", "List of positive ADC counter numbers.", "frPosAdcPulseIntRaw.THcSignalHit.GetPaddleNumber()"}, //PreSh+ raw occupancy
450 {"negAdcCounter", "List of negative ADC counter numbers.", "frNegAdcPulseIntRaw.THcSignalHit.GetPaddleNumber()"}, //PreSh- raw occupancy
451
452 {"totNumPosAdcHits", "Total Number of Positive ADC Hits", "fTotNumPosAdcHits"}, // PreSh+ raw multiplicity
453 {"totNumNegAdcHits", "Total Number of Negative ADC Hits", "fTotNumNegAdcHits"}, // PreSh+ raw multiplicity
454 {"totnumAdcHits", "Total Number of ADC Hits Per PMT", "fTotNumAdcHits"}, // PreSh raw multiplicity
455
456 {"numGoodPosAdcHits", "Number of Good Positive ADC Hits Per PMT", "fNumGoodPosAdcHits"}, // PreSh occupancy
457 {"numGoodNegAdcHits", "Number of Good Negative ADC Hits Per PMT", "fNumGoodNegAdcHits"}, // PreSh occupancy
458 {"totNumGoodPosAdcHits", "Total Number of Good Positive ADC Hits", "fTotNumGoodPosAdcHits"}, // PreSh multiplicity
459 {"totNumGoodNegAdcHits", "Total Number of Good Negative ADC Hits", "fTotNumGoodNegAdcHits"}, // PreSh multiplicity
460 {"totnumGoodAdcHits", "TotalNumber of Good ADC Hits Per PMT", "fTotNumGoodAdcHits"}, // PreSh multiplicity
461
462 {"goodPosAdcPulseIntRaw", "Good Positive Raw ADC Pulse Integrals", "fGoodPosAdcPulseIntRaw"},
463 {"goodNegAdcPulseIntRaw", "Good Negative Raw ADC Pulse Integrals", "fGoodNegAdcPulseIntRaw"},
464
465 {"goodPosAdcPed", "Good Positive ADC pedestals", "fGoodPosAdcPed"},
466 {"goodPosAdcPulseInt", "Good Positive ADC integrals", "fGoodPosAdcPulseInt"},
467 {"goodPosAdcPulseAmp", "Good Positive ADC amplitudes", "fGoodPosAdcPulseAmp"},
468 {"goodPosAdcPulseTime","Good Positive ADC times", "fGoodPosAdcPulseTime"},
469 {"goodPosAdcTdcDiffTime","Good Positive Hodo Start time-ADC times", "fGoodPosAdcTdcDiffTime"},
470
471 {"goodNegAdcPed", "Good Negative ADC pedestals", "fGoodNegAdcPed"},
472 {"goodNegAdcPulseInt", "Good Negative ADC integrals", "fGoodNegAdcPulseInt"},
473 {"goodNegAdcPulseAmp", "Good Negative ADC amplitudes", "fGoodNegAdcPulseAmp"},
474 {"goodNegAdcPulseTime","Good Negative ADC times", "fGoodNegAdcPulseTime"},
475 {"goodNegAdcTdcDiffTime","Good Negative Hodo Start time-ADC times", "fGoodNegAdcTdcDiffTime"},
476 {"goodPosAdcMult", "Good Positive ADC Multiplicity", "fGoodPosAdcMult"},
477 {"goodNegAdcMult", "Good Negative ADC Multiplicity", "fGoodNegAdcMult"},
478 {"epos", "Energy Depositions from Positive Side PMTs", "fEpos"},
479 {"eneg", "Energy Depositions from Negative Side PMTs", "fEneg"},
480 {"emean", "Mean Energy Depositions", "fEmean"},
481 {"eplane", "Energy Deposition per plane", "fEplane"},
482 {"eplane_pos", "Energy Deposition per plane from pos. PMTs", "fEplane_pos"},
483 {"eplane_neg", "Energy Deposition per plane from neg. PMTs", "fEplane_neg"},
484 { 0 }
485 };
486
487 return DefineVarsFromList(vars, mode);
488}
489
490//_____________________________________________________________________________
492{
493 // Clears the hit lists
494
497
504
509
518
525
530
539
540 for (UInt_t ielem = 0; ielem < fGoodPosAdcPed.size(); ielem++) {
541 fGoodPosAdcPed.at(ielem) = 0.0;
542 fGoodPosAdcPulseIntRaw.at(ielem) = 0.0;
543 fGoodPosAdcPulseInt.at(ielem) = 0.0;
544 fGoodPosAdcPulseAmp.at(ielem) = 0.0;
545 fGoodPosAdcPulseTime.at(ielem) = kBig;
546 fGoodPosAdcTdcDiffTime.at(ielem) = kBig;
547 fGoodPosAdcMult.at(ielem) = 0.0;
548 fEpos.at(ielem) = 0.0;
549 fNumGoodPosAdcHits.at(ielem) = 0.0;
550 }
551
552 for (UInt_t ielem = 0; ielem < fGoodNegAdcPed.size(); ielem++) {
553 fGoodNegAdcPed.at(ielem) = 0.0;
554 fGoodNegAdcPulseIntRaw.at(ielem) = 0.0;
555 fGoodNegAdcPulseInt.at(ielem) = 0.0;
556 fGoodNegAdcPulseAmp.at(ielem) = 0.0;
557 fGoodNegAdcPulseTime.at(ielem) = kBig;
558 fGoodNegAdcTdcDiffTime.at(ielem) = kBig;
559 fGoodNegAdcMult.at(ielem) = 0.0;
560 fEneg.at(ielem) = 0.0;
561 fNumGoodNegAdcHits.at(ielem) = 0.0;
562 }
563
564 for (UInt_t ielem = 0; ielem < fEmean.size(); ielem++) {
565 fEmean.at(ielem) = 0.0;
566 }
567
568 fTotNumAdcHits = 0;
571
575
576
577 // Debug output.
578 if ( static_cast<THcShower*>(GetParent())->fdbg_decoded_cal ) {
579 cout << "---------------------------------------------------------------\n";
580 cout << "Debug output from THcShowerPlane::Clear for "
581 << GetParent()->GetPrefix() << ":" << endl;
582
583 cout << " Cleared ADC hits for plane " << GetName() << endl;
584 cout << "---------------------------------------------------------------\n";
585 }
586}
587
588//_____________________________________________________________________________
590{
591 // Doesn't actually get called. Use Fill method instead
592
593 //Debug output.
594 if ( static_cast<THcShower*>(fParent)->fdbg_decoded_cal ) {
595 cout << "---------------------------------------------------------------\n";
596 cout << "Debug output from THcShowerPlane::Decode for "
597 << fParent->GetPrefix() << ":" << endl;
598
599 cout << " Called for plane " << GetName() << endl;
600 cout << "---------------------------------------------------------------\n";
601 }
602
603 return 0;
604}
605
606//_____________________________________________________________________________
608{
609
610 // Nothing is done here. See ProcessHits method instead.
611 //
612
613 return 0;
614}
615
616//_____________________________________________________________________________
618{
619 return 0;
620}
621
622//_____________________________________________________________________________
624{
625 // Extract the data for this layer from hit list
626 // Assumes that the hit list is sorted by layer, so we stop when the
627 // plane doesn't agree and return the index for the next hit.
628
629 // Initialize variables.
630
633
640
645
654
661
666
675
676 /*
677 for(Int_t i=0;i<fNelem;i++) {
678
679 fEpos[i] = 0;
680 fEneg[i] = 0;
681 fEmean[i] = 0;
682 }
683 */
684
685 fEplane = 0;
686 fEplane_pos = 0;
687 fEplane_neg = 0;
688
689 UInt_t nrPosAdcHits = 0;
690 UInt_t nrNegAdcHits = 0;
691 UInt_t nrSampPosAdcHits = 0;
692 UInt_t nrSampNegAdcHits = 0;
693 fPosAdcSampWaveform.clear();
694 fNegAdcSampWaveform.clear();
695
696 // Process raw hits. Get ADC hits for the plane, assign variables for each
697 // channel.
698
699 Int_t nrawhits = rawhits->GetLast()+1;
700
701 Int_t ihit = nexthit;
702
703 while(ihit < nrawhits) {
704 THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ihit);
705
706 // This is OK as far as the hit list is sorted by layer.
707 //
708 if(hit->fPlane > fLayerNum) {
709 break;
710 }
711
712 Int_t padnum = hit->fCounter;
713
714 THcRawAdcHit& rawPosAdcHit = hit->GetRawAdcHitPos();
715
716 if ( fUseSampWaveform == 0 ) {
717 for (UInt_t thit=0; thit<rawPosAdcHit.GetNPulses(); ++thit) {
718 ((THcSignalHit*) frPosAdcPedRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPedRaw());
719 ((THcSignalHit*) frPosAdcThreshold->ConstructedAt(nrPosAdcHits))->Set(padnum,rawPosAdcHit.GetPedRaw()*rawPosAdcHit.GetF250_PeakPedestalRatio()+fAdcPosThreshold);
720 ((THcSignalHit*) frPosAdcPed->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPed());
721
722 ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseIntRaw(thit));
723 ((THcSignalHit*) frPosAdcPulseInt->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseInt(thit));
724
725 ((THcSignalHit*) frPosAdcPulseAmpRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseAmpRaw(thit));
726 ((THcSignalHit*) frPosAdcPulseAmp->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseAmp(thit));
727
728 ((THcSignalHit*) frPosAdcPulseTimeRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseTimeRaw(thit));
729 ((THcSignalHit*) frPosAdcPulseTime->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetPulseTime(thit)+fAdcTdcOffset);
730
731 if (rawPosAdcHit.GetPulseAmpRaw(thit) > 0) ((THcSignalHit*) frPosAdcErrorFlag->ConstructedAt(nrPosAdcHits))->Set(padnum, 0);
732 if (rawPosAdcHit.GetPulseAmpRaw(thit) <= 0) ((THcSignalHit*) frPosAdcErrorFlag->ConstructedAt(nrPosAdcHits))->Set(padnum, 1);
733 if (rawPosAdcHit.GetPulseAmpRaw(thit) <= 0 && rawPosAdcHit.GetNSamples() >0) ((THcSignalHit*) frPosAdcErrorFlag->ConstructedAt(nrPosAdcHits))->Set(padnum, 2);
734
735 if (rawPosAdcHit.GetPulseAmpRaw(thit) <= 0) {
736 Double_t PeakPedRatio= rawPosAdcHit.GetF250_PeakPedestalRatio();
737 Int_t NPedSamples= rawPosAdcHit.GetF250_NPedestalSamples();
738 Double_t AdcToC = rawPosAdcHit.GetAdcTopC();
739 Double_t AdcToV = rawPosAdcHit.GetAdcTomV();
740 Int_t PedDefaultTemp = static_cast<THcShower*>(fParent)->GetPedDefault(padnum-1,fLayerNum-1,0);
741 if (PedDefaultTemp !=0) {
742 Double_t tPulseInt = AdcToC*(rawPosAdcHit.GetPulseIntRaw(thit) - PedDefaultTemp*PeakPedRatio);
743 ((THcSignalHit*) frPosAdcPulseInt->ConstructedAt(nrPosAdcHits))->Set(padnum, tPulseInt);
744 ((THcSignalHit*) frPosAdcPedRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, PedDefaultTemp);
745 ((THcSignalHit*) frPosAdcPed->ConstructedAt(nrPosAdcHits))->Set(padnum, float(PedDefaultTemp)/float(NPedSamples)*AdcToV);
746
747 }
748 ((THcSignalHit*) frPosAdcPulseAmp->ConstructedAt(nrPosAdcHits))->Set(padnum, 0.);
749 }
750 ++nrPosAdcHits;
753
754 }
755 }
756 //
757 if (rawPosAdcHit.GetNSamples()>0 ) {
758 rawPosAdcHit.SetSampThreshold(fSampThreshold);
759 if (fSampNSA == 0) fSampNSA=rawPosAdcHit.GetF250_NSA();
760 if (fSampNSB == 0) fSampNSB=rawPosAdcHit.GetF250_NSB();
761 rawPosAdcHit.SetF250Params(fSampNSA,fSampNSB,4); // Set NPED =4
762 if (fSampNSAT != 2) rawPosAdcHit.SetSampNSAT(fSampNSAT);
763 rawPosAdcHit.SetSampIntTimePedestalPeak();
764 fPosAdcSampWaveform.push_back(float(padnum));
765 fPosAdcSampWaveform.push_back(float(rawPosAdcHit.GetNSamples()));
766 for (UInt_t thit = 0; thit < rawPosAdcHit.GetNSamples(); thit++) {
767 fPosAdcSampWaveform.push_back(rawPosAdcHit.GetSample(thit)); // ped subtracted sample (mV)
768 }
769 for (UInt_t thit = 0; thit < rawPosAdcHit.GetNSampPulses(); thit++) {
770 ((THcSignalHit*) frPosAdcSampPedRaw->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPedRaw());
771 ((THcSignalHit*) frPosAdcSampPed->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPed());
772
773 ((THcSignalHit*) frPosAdcSampPulseIntRaw->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseIntRaw(thit));
774 ((THcSignalHit*) frPosAdcSampPulseInt->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseInt(thit));
775
776 ((THcSignalHit*) frPosAdcSampPulseAmpRaw->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseAmpRaw(thit));
777 ((THcSignalHit*) frPosAdcSampPulseAmp->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseAmp(thit));
778 ((THcSignalHit*) frPosAdcSampPulseTimeRaw->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseTimeRaw(thit));
779 ((THcSignalHit*) frPosAdcSampPulseTime->ConstructedAt(nrSampPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseTime(thit)+fAdcTdcOffset);
780 //
781 if ( rawPosAdcHit.GetNPulses() ==0 || fUseSampWaveform ==1 ) {
782 ((THcSignalHit*) frPosAdcPedRaw->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPedRaw());
783 ((THcSignalHit*) frPosAdcPed->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPed());
784
785 ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(nrPosAdcHits))->Set(padnum,rawPosAdcHit.GetSampPulseIntRaw(thit));
786 ((THcSignalHit*) frPosAdcPulseInt->ConstructedAt(nrPosAdcHits))->Set(padnum,rawPosAdcHit.GetSampPulseInt(thit));
787
788 ((THcSignalHit*) frPosAdcPulseAmpRaw->ConstructedAt(nrPosAdcHits))->Set(padnum,rawPosAdcHit.GetSampPulseAmpRaw(thit));
789 ((THcSignalHit*) frPosAdcPulseAmp->ConstructedAt(nrPosAdcHits))->Set(padnum,rawPosAdcHit.GetSampPulseAmp(thit) );
790
791 ((THcSignalHit*) frPosAdcPulseTimeRaw->ConstructedAt(nrPosAdcHits))->Set(padnum,rawPosAdcHit.GetSampPulseTimeRaw(thit) );
792 ((THcSignalHit*) frPosAdcPulseTime->ConstructedAt(nrPosAdcHits))->Set(padnum, rawPosAdcHit.GetSampPulseTime(thit)+fAdcTdcOffset);
793 ((THcSignalHit*) frPosAdcErrorFlag->ConstructedAt(nrPosAdcHits))->Set(padnum, 3);
794 if (fUseSampWaveform ==1) ((THcSignalHit*) frPosAdcErrorFlag->ConstructedAt(nrPosAdcHits))->Set(padnum, 0);
795 ++nrPosAdcHits;
798 }
799 ++nrSampPosAdcHits;
800 }
801 }
802
803 THcRawAdcHit& rawNegAdcHit = hit->GetRawAdcHitNeg();
804
805 if ( fUseSampWaveform == 0 ) {
806
807 for (UInt_t thit=0; thit<rawNegAdcHit.GetNPulses(); ++thit) {
808 ((THcSignalHit*) frNegAdcPedRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPedRaw());
809 ((THcSignalHit*) frNegAdcThreshold->ConstructedAt(nrNegAdcHits))->Set(padnum,rawNegAdcHit.GetPedRaw()*rawNegAdcHit.GetF250_PeakPedestalRatio()+fAdcNegThreshold);
810 ((THcSignalHit*) frNegAdcPed->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPed());
811
812 ((THcSignalHit*) frNegAdcPulseIntRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseIntRaw(thit));
813 ((THcSignalHit*) frNegAdcPulseInt->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseInt(thit));
814
815 ((THcSignalHit*) frNegAdcPulseAmpRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseAmpRaw(thit));
816 ((THcSignalHit*) frNegAdcPulseAmp->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseAmp(thit));
817
818 ((THcSignalHit*) frNegAdcPulseTimeRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseTimeRaw(thit));
819 ((THcSignalHit*) frNegAdcPulseTime->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetPulseTime(thit)+fAdcTdcOffset);
820
821 if (rawNegAdcHit.GetPulseAmpRaw(thit) > 0) ((THcSignalHit*) frNegAdcErrorFlag->ConstructedAt(nrNegAdcHits))->Set(padnum, 0);
822 if (rawNegAdcHit.GetPulseAmpRaw(thit) <= 0) ((THcSignalHit*) frNegAdcErrorFlag->ConstructedAt(nrNegAdcHits))->Set(padnum, 1);
823 if (rawNegAdcHit.GetPulseAmpRaw(thit) <= 0 && rawNegAdcHit.GetNSamples() >0) ((THcSignalHit*) frNegAdcErrorFlag->ConstructedAt(nrNegAdcHits))->Set(padnum, 2);
824
825 if (rawNegAdcHit.GetPulseAmpRaw(thit) <= 0) {
826 Double_t PeakPedRatio= rawNegAdcHit.GetF250_PeakPedestalRatio();
827 Int_t NPedSamples= rawNegAdcHit.GetF250_NPedestalSamples();
828 Double_t AdcToC = rawNegAdcHit.GetAdcTopC();
829 Double_t AdcToV = rawNegAdcHit.GetAdcTomV();
830 Int_t PedDefaultTemp = static_cast<THcShower*>(fParent)->GetPedDefault(padnum-1,fLayerNum-1,1);
831 if (PedDefaultTemp !=0) {
832 Double_t tPulseInt = AdcToC*(rawNegAdcHit.GetPulseIntRaw(thit) - PedDefaultTemp*PeakPedRatio);
833 ((THcSignalHit*) frNegAdcPulseInt->ConstructedAt(nrNegAdcHits))->Set(padnum, tPulseInt);
834 ((THcSignalHit*) frNegAdcPedRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, PedDefaultTemp);
835 ((THcSignalHit*) frNegAdcPed->ConstructedAt(nrNegAdcHits))->Set(padnum, float(PedDefaultTemp)/float(NPedSamples)*AdcToV);
836
837 }
838 ((THcSignalHit*) frNegAdcPulseAmp->ConstructedAt(nrNegAdcHits))->Set(padnum, 0.);
839 }
840 ++nrNegAdcHits;
843 }
844 }
845
846 if (rawNegAdcHit.GetNSamples()>0 ) {
847 rawNegAdcHit.SetSampThreshold(fSampThreshold);
848 if (fSampNSA == 0) fSampNSA=rawNegAdcHit.GetF250_NSA();
849 if (fSampNSB == 0) fSampNSB=rawNegAdcHit.GetF250_NSB();
850 rawNegAdcHit.SetF250Params(fSampNSA,fSampNSB,4); // Set NPED =4
851 if (fSampNSAT != 2) rawNegAdcHit.SetSampNSAT(fSampNSAT);
852 rawNegAdcHit.SetSampIntTimePedestalPeak();
853 fNegAdcSampWaveform.push_back(float(padnum));
854 fNegAdcSampWaveform.push_back(float(rawNegAdcHit.GetNSamples()));
855 for (UInt_t thit = 0; thit < rawNegAdcHit.GetNSamples(); thit++) {
856 fNegAdcSampWaveform.push_back(rawNegAdcHit.GetSample(thit)); // ped subtracted sample (mV)
857 }
858 for (UInt_t thit = 0; thit < rawNegAdcHit.GetNSampPulses(); thit++) {
859 ((THcSignalHit*) frNegAdcSampPedRaw->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPedRaw());
860 ((THcSignalHit*) frNegAdcSampPed->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPed());
861 ((THcSignalHit*) frNegAdcSampPulseIntRaw->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseIntRaw(thit));
862 ((THcSignalHit*) frNegAdcSampPulseInt->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseInt(thit));
863
864 ((THcSignalHit*) frNegAdcSampPulseAmpRaw->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseAmpRaw(thit));
865 ((THcSignalHit*) frNegAdcSampPulseAmp->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseAmp(thit));
866 ((THcSignalHit*) frNegAdcSampPulseTimeRaw->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseTimeRaw(thit));
867 ((THcSignalHit*) frNegAdcSampPulseTime->ConstructedAt(nrSampNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseTime(thit));
868 //
869 if ( rawNegAdcHit.GetNPulses() ==0 || fUseSampWaveform ==1 ) {
870 ((THcSignalHit*) frNegAdcPedRaw->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPedRaw());
871 ((THcSignalHit*) frNegAdcPed->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPed());
872
873 ((THcSignalHit*) frNegAdcPulseIntRaw->ConstructedAt(nrNegAdcHits))->Set(padnum,rawNegAdcHit.GetSampPulseIntRaw(thit));
874 ((THcSignalHit*) frNegAdcPulseInt->ConstructedAt(nrNegAdcHits))->Set(padnum,rawNegAdcHit.GetSampPulseInt(thit));
875
876 ((THcSignalHit*) frNegAdcPulseAmpRaw->ConstructedAt(nrNegAdcHits))->Set(padnum,rawNegAdcHit.GetSampPulseAmpRaw(thit));
877 ((THcSignalHit*) frNegAdcPulseAmp->ConstructedAt(nrNegAdcHits))->Set(padnum,rawNegAdcHit.GetSampPulseAmp(thit) );
878
879 ((THcSignalHit*) frNegAdcPulseTimeRaw->ConstructedAt(nrNegAdcHits))->Set(padnum,rawNegAdcHit.GetSampPulseTimeRaw(thit) );
880 ((THcSignalHit*) frNegAdcPulseTime->ConstructedAt(nrNegAdcHits))->Set(padnum, rawNegAdcHit.GetSampPulseTime(thit));
881 ((THcSignalHit*) frNegAdcErrorFlag->ConstructedAt(nrNegAdcHits))->Set(padnum, 3);
882 if (fUseSampWaveform ==1) ((THcSignalHit*) frNegAdcErrorFlag->ConstructedAt(nrNegAdcHits))->Set(padnum, 0);
883 ++nrNegAdcHits;
886 }
887 ++nrSampNegAdcHits;
888 }
889 }
890
891 //
892 ihit++;
893 }
894
895 return(ihit);
896}
897//_____________________________________________________________________________
899{
900 Int_t ADCMode=static_cast<THcShower*>(fParent)->GetADCMode();
901 if(ADCMode == kADCDynamicPedestal) {
903 } else if (ADCMode == kADCSampleIntegral) {
905 } else if (ADCMode == kADCSampIntDynPed) {
907 } else {
909 }
910 //
911 if (static_cast<THcShower*>(fParent)->fdbg_decoded_cal) {
912
913 cout << "---------------------------------------------------------------\n";
914 cout << "Debug output from THcShowerPlane::ProcessHits for "
915 << fParent->GetPrefix() << ":" << endl;
916
917 cout << " Sparsified hits for HMS calorimeter plane #" << fLayerNum
918 << ", " << GetName() << ":" << endl;
919
920 Int_t nspar = 0;
921
922 for (Int_t i=0; i<fNelem; i++) {
923
924 if (GetAposP(i) > 0 || GetAnegP(i) >0) { //hit
925 cout << " counter = " << i
926 << " Emean = " << fEmean[i]
927 << " Epos = " << fEpos[i]
928 << " Eneg = " << fEneg[i]
929 << endl;
930 nspar++;
931 }
932 }
933
934 if (nspar == 0) cout << " No hits\n";
935
936 cout << " Eplane = " << fEplane
937 << " Eplane_pos = " << fEplane_pos
938 << " Eplane_neg = " << fEplane_neg
939 << endl;
940 cout << "---------------------------------------------------------------\n";
941 }
942 //
943 return 1;
944 //
945}
946//_____________________________________________________________________________
948{
949 // adc_pos = hit->GetRawAdcHitPos().GetSampleInt();
950 // adc_neg = hit->GetRawAdcHitNeg().GetSampleInt();
951 // adc_pos_pedsub = hit->GetRawAdcHitPos().GetSampleIntRaw();
952 // adc_neg_pedsub = hit->GetRawAdcHitNeg().GetSampleIntRaw();
953 // Need to create
954}
955//_____________________________________________________________________________
957{
959 // adc_neg_pedsub = hit->GetRawAdcHitNeg().GetSampleIntRaw() - fNegPed[hit->fCounter -1];
960 // adc_pos = hit->GetRawAdcHitPos().GetSampleIntRaw();
961 // adc_neg = hit->GetRawAdcHitNeg().GetSampleIntRaw();
962 // need to create
963}
964//_____________________________________________________________________________
966{
967 for (Int_t ielem=0;ielem<frNegAdcPulseIntRaw->GetEntries();ielem++) {
968 Int_t npad = ((THcSignalHit*) frNegAdcPulseIntRaw->ConstructedAt(ielem))->GetPaddleNumber() - 1;
969 Double_t pulseIntRaw = ((THcSignalHit*) frNegAdcPulseIntRaw->ConstructedAt(ielem))->GetData();
970 fGoodNegAdcPulseIntRaw.at(npad) = pulseIntRaw;
971 if(fGoodNegAdcPulseIntRaw.at(npad) > fNegThresh[npad]) {
972 fGoodNegAdcPulseInt.at(npad) = pulseIntRaw-fNegPed[npad];
973 fEneg.at(npad) = fGoodNegAdcPulseInt.at(npad)*static_cast<THcShower*>(fParent)->GetGain(npad,fLayerNum-1,1);
974 fEmean.at(npad) += fEneg.at(npad);
975 fEplane_neg += fEneg.at(npad);
976 }
977 }
978 for (Int_t ielem=0;ielem<frPosAdcPulseIntRaw->GetEntries();ielem++) {
979 Int_t npad = ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(ielem))->GetPaddleNumber() - 1;
980 Double_t pulseIntRaw = ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(ielem))->GetData();
981 fGoodPosAdcPulseIntRaw.at(npad) =pulseIntRaw;
982 if(fGoodPosAdcPulseIntRaw.at(npad) > fPosThresh[npad]) {
983 fGoodPosAdcPulseInt.at(npad) =pulseIntRaw-fPosPed[npad] ;
984 fEpos.at(npad) =fGoodPosAdcPulseInt.at(npad)*static_cast<THcShower*>(fParent)->GetGain(npad,fLayerNum-1,0);
985 fEmean.at(npad) += fEpos.at(npad);
986 fEplane_pos += fEpos.at(npad);
987 }
988 }
990}
991//_____________________________________________________________________________
993{
994 Double_t StartTime = 0.0;
995 if( fglHod ) StartTime = fglHod->GetStartTime();
996 Double_t OffsetTime = 0.0;
997 if( fglHod ) OffsetTime = fglHod->GetOffsetTime();
998 for (Int_t ielem=0;ielem<frNegAdcPulseInt->GetEntries();ielem++) {
999 Int_t npad = ((THcSignalHit*) frNegAdcPulseInt->ConstructedAt(ielem))->GetPaddleNumber() - 1;
1000 Double_t pulseInt = ((THcSignalHit*) frNegAdcPulseInt->ConstructedAt(ielem))->GetData();
1001 Double_t pulsePed = ((THcSignalHit*) frNegAdcPed->ConstructedAt(ielem))->GetData();
1002 Double_t pulseAmp = ((THcSignalHit*) frNegAdcPulseAmp->ConstructedAt(ielem))->GetData();
1003 Double_t pulseIntRaw = ((THcSignalHit*) frNegAdcPulseIntRaw->ConstructedAt(ielem))->GetData();
1004 Double_t pulseTime = ((THcSignalHit*) frNegAdcPulseTime->ConstructedAt(ielem))->GetData();
1005 Double_t adctdcdiffTime = StartTime-pulseTime+OffsetTime;
1007 Bool_t pulseTimeCut = (adctdcdiffTime > static_cast<THcShower*>(fParent)->GetWindowMin(npad,fLayerNum-1,1)) && (adctdcdiffTime < static_cast<THcShower*>(fParent)->GetWindowMax(npad,fLayerNum-1,1) );
1008 fGoodNegAdcMult.at(npad) += 1;
1009 if (pulseTimeCut) {
1010 fGoodNegAdcPulseIntRaw.at(npad) =pulseIntRaw;
1011
1012 if(fGoodNegAdcPulseIntRaw.at(npad) > threshold && fGoodNegAdcPulseInt.at(npad)==0) {
1013 fGoodNegAdcPulseInt.at(npad) =pulseInt ;
1014 fEneg.at(npad) = fGoodNegAdcPulseInt.at(npad)*static_cast<THcShower*>(fParent)->GetGain(npad,fLayerNum-1,1);
1015 fEmean.at(npad) += fEneg.at(npad);
1016 fEplane_neg += fEneg.at(npad);
1017
1018 fGoodNegAdcPed.at(npad) = pulsePed;
1019 fGoodNegAdcPulseAmp.at(npad) = pulseAmp;
1020 fGoodNegAdcPulseTime.at(npad) = pulseTime;
1021 fGoodNegAdcTdcDiffTime.at(npad) = adctdcdiffTime;
1022
1025 fNumGoodNegAdcHits.at(npad) = npad + 1;
1026
1027 }
1028
1029 }
1030 }
1031 //
1032 for (Int_t ielem=0;ielem<frPosAdcPulseInt->GetEntries();ielem++) {
1033 Int_t npad = ((THcSignalHit*) frPosAdcPulseInt->ConstructedAt(ielem))->GetPaddleNumber() - 1;
1034 Double_t pulsePed = ((THcSignalHit*) frPosAdcPed->ConstructedAt(ielem))->GetData();
1036 Double_t pulseAmp = ((THcSignalHit*) frPosAdcPulseAmp->ConstructedAt(ielem))->GetData();
1037 Double_t pulseInt = ((THcSignalHit*) frPosAdcPulseInt->ConstructedAt(ielem))->GetData();
1038 Double_t pulseIntRaw = ((THcSignalHit*) frPosAdcPulseIntRaw->ConstructedAt(ielem))->GetData();
1039 Double_t pulseTime = ((THcSignalHit*) frPosAdcPulseTime->ConstructedAt(ielem))->GetData();
1040 Double_t adctdcdiffTime = StartTime-pulseTime+OffsetTime;
1041 Bool_t pulseTimeCut = (adctdcdiffTime > static_cast<THcShower*>(fParent)->GetWindowMin(npad,fLayerNum-1,0)) && (adctdcdiffTime < static_cast<THcShower*>(fParent)->GetWindowMax(npad,fLayerNum-1,0) );
1042 fGoodPosAdcMult.at(npad) += 1;
1043 if (pulseTimeCut) {
1044 fGoodPosAdcPulseIntRaw.at(npad) = pulseIntRaw;
1045
1046 if(fGoodPosAdcPulseIntRaw.at(npad) > threshold && fGoodPosAdcPulseInt.at(npad)==0) {
1047
1048 fGoodPosAdcPulseInt.at(npad) =pulseInt ;
1049 fEpos.at(npad) = fGoodPosAdcPulseInt.at(npad)*static_cast<THcShower*>(fParent)->GetGain(npad,fLayerNum-1,0);
1050 fEmean.at(npad) += fEpos[npad];
1051 fEplane_pos += fEpos.at(npad);
1052
1053 fGoodPosAdcPed.at(npad) = pulsePed;
1054 fGoodPosAdcPulseAmp.at(npad) = pulseAmp;
1055 fGoodPosAdcPulseTime.at(npad) = pulseTime;
1056 fGoodPosAdcTdcDiffTime.at(npad) = adctdcdiffTime;
1057
1060 fNumGoodPosAdcHits.at(npad) = npad + 1;
1061
1062 }
1063 }
1064 }
1065 //
1067
1068}
1069//_____________________________________________________________________________
1071{
1072 // Extract the data for this plane from hit list, accumulating into
1073 // arrays for calculating pedestals.
1074
1075 Int_t nrawhits = rawhits->GetLast()+1;
1076
1077 Int_t ihit = nexthit;
1078 while(ihit < nrawhits) {
1079
1080 THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ihit);
1081
1082 // OK for hit list sorted by layer.
1083 if(hit->fPlane > fLayerNum) {
1084 break;
1085 }
1086 Int_t element = hit->fCounter - 1; // Should check if in range
1087 Int_t adcpos = hit->GetData(0);
1088 Int_t adcneg = hit->GetData(1);
1089
1090 if(adcpos <= fPosPedLimit[element]) {
1091 fPosPedSum[element] += adcpos;
1092 fPosPedSum2[element] += adcpos*adcpos;
1093 fPosPedCount[element]++;
1094 if(fPosPedCount[element] == fMinPeds/5) {
1095 fPosPedLimit[element] = 100 + fPosPedSum[element]/fPosPedCount[element];
1096 }
1097 }
1098 if(adcneg <= fNegPedLimit[element]) {
1099 fNegPedSum[element] += adcneg;
1100 fNegPedSum2[element] += adcneg*adcneg;
1101 fNegPedCount[element]++;
1102 if(fNegPedCount[element] == fMinPeds/5) {
1103 fNegPedLimit[element] = 100 + fNegPedSum[element]/fNegPedCount[element];
1104 }
1105 }
1106 ihit++;
1107 }
1108
1110
1111 // Debug output.
1112
1113 if ( static_cast<THcShower*>(fParent)->fdbg_raw_cal ) {
1114
1115 cout << "---------------------------------------------------------------\n";
1116 cout << "Debug output from THcShowerPlane::AcculatePedestals for "
1117 << fParent->GetPrefix() << ":" << endl;
1118
1119 cout << "Processed hit list for plane " << GetName() << ":\n";
1120
1121 for (Int_t ih=nexthit; ih<nrawhits; ih++) {
1122
1123 THcRawShowerHit* hit = (THcRawShowerHit *) rawhits->At(ih);
1124
1125 // OK for hit list sorted by layer.
1126 if(hit->fPlane > fLayerNum) {
1127 break;
1128 }
1129
1130 cout << " hit " << ih << ":"
1131 << " plane = " << hit->fPlane
1132 << " counter = " << hit->fCounter
1133 << " ADCpos = " << hit->GetData(0)
1134 << " ADCneg = " << hit->GetData(1)
1135 << endl;
1136 }
1137
1138 cout << "---------------------------------------------------------------\n";
1139
1140 }
1141
1142 return(ihit);
1143}
1144
1145//_____________________________________________________________________________
1147{
1148 // Use the accumulated pedestal data to calculate pedestals
1149 // Later add check to see if pedestals have drifted ("Danger Will Robinson!")
1150
1151 for(Int_t i=0; i<fNelem;i++) {
1152
1153 // Positive tubes
1154 fPosPed[i] = ((Float_t) fPosPedSum[i]) / TMath::Max(1, fPosPedCount[i]);
1156 - fPosPed[i]*fPosPed[i]);
1157 fPosThresh[i] = fPosPed[i] + TMath::Min(50., TMath::Max(10., 3.*fPosSig[i]));
1158
1159 // Negative tubes
1160 fNegPed[i] = ((Float_t) fNegPedSum[i]) / TMath::Max(1, fNegPedCount[i]);
1162 - fNegPed[i]*fNegPed[i]);
1163 fNegThresh[i] = fNegPed[i] + TMath::Min(50., TMath::Max(10., 3.*fNegSig[i]));
1164
1165 }
1166
1167 // Debug output.
1168
1169 if ( static_cast<THcShower*>(fParent)->fdbg_raw_cal ) {
1170
1171 cout << "---------------------------------------------------------------\n";
1172 cout << "Debug output from THcShowerPlane::CalculatePedestals for "
1173 << fParent->GetPrefix() << ":" << endl;
1174
1175 cout << " ADC pedestals and thresholds for calorimeter plane "
1176 << GetName() << endl;
1177 for(Int_t i=0; i<fNelem;i++) {
1178 cout << " element " << i << ": "
1179 << " Pos. pedestal = " << fPosPed[i]
1180 << " Pos. threshold = " << fPosThresh[i]
1181 << " Neg. pedestal = " << fNegPed[i]
1182 << " Neg. threshold = " << fNegThresh[i]
1183 << endl;
1184 }
1185 cout << "---------------------------------------------------------------\n";
1186
1187 }
1188
1189}
1190
1191//_____________________________________________________________________________
1193{
1194 fNPedestalEvents = 0;
1195 fPosPedSum = new Int_t [fNelem];
1196 fPosPedSum2 = new Int_t [fNelem];
1197 fPosPedCount = new Int_t [fNelem];
1198 fNegPedSum = new Int_t [fNelem];
1199 fNegPedSum2 = new Int_t [fNelem];
1200 fNegPedCount = new Int_t [fNelem];
1201
1202 fPosSig = new Float_t [fNelem];
1203 fNegSig = new Float_t [fNelem];
1204 fPosPed = new Float_t [fNelem];
1205 fNegPed = new Float_t [fNelem];
1206 fPosThresh = new Float_t [fNelem];
1207 fNegThresh = new Float_t [fNelem];
1208 for(Int_t i=0;i<fNelem;i++) {
1209 fPosPedSum[i] = 0;
1210 fPosPedSum2[i] = 0;
1211 fPosPedCount[i] = 0;
1212 fNegPedSum[i] = 0;
1213 fNegPedSum2[i] = 0;
1214 fNegPedCount[i] = 0;
1215 }
1216}
1217
1218//_____________________________________________________________________________
1220{
1221 // Accumumate statistics for efficiency calculations.
1222 //
1223 // Choose electron events in gas Cherenkov with good Chisq of the best track.
1224 // Project best track to the plane,
1225 // calculate row number for the track,
1226 // accrue number of tracks for the row,
1227 // accrue number of hits for the row, if row is hit.
1228 // Accrue total numbers of tracks and hits for plane.
1229
1230 if(!fCherenkov) return 0;
1231
1232 THaTrack* BestTrack = static_cast<THaTrack*>( tracks[0]);
1233 if (BestTrack->GetChi2()/BestTrack->GetNDoF() > fStatMaxChi2) return 0;
1234
1235 if (fCherenkov->GetCerNPE() < fStatCerMin) return 0;
1236
1237 Double_t XTrk = kBig;
1238 Double_t YTrk = kBig;
1239 Double_t pathl = kBig;
1240
1241 // Track interception with plane. The coordinates are in the calorimeter's
1242 // local system.
1243
1244 fOrigin = GetOrigin();
1245 static_cast<THcShower*>(fParent)->CalcTrackIntercept(BestTrack, pathl, XTrk, YTrk);
1246
1247 // Transform coordiantes to the spectrometer's coordinate system.
1248 XTrk += GetOrigin().X();
1249 YTrk += GetOrigin().Y();
1250
1251 for (Int_t i=0; i<fNelem; i++) {
1252
1253 if (TMath::Abs(XTrk - static_cast<THcShower*>(fParent)->GetXPos(fLayerNum-1,i)) < fStatSlop &&
1254 YTrk > static_cast<THcShower*>(fParent)->GetYPos(fLayerNum-1,1) &&
1255 YTrk < static_cast<THcShower*>(fParent)->GetYPos(fLayerNum-1,0) ) {
1256
1257 fStatNumTrk.at(i)++;
1259
1260 if (fGoodPosAdcPulseInt.at(i) > 0. || fGoodNegAdcPulseInt.at(i) > 0.) {
1261 fStatNumHit.at(i)++;
1263 }
1264
1265 }
1266
1267 }
1268
1269 if ( static_cast<THcShower*>(fParent)->fdbg_tracks_cal ) {
1270 cout << "---------------------------------------------------------------\n";
1271 cout << "THcShowerPlane::AccumulateStat:" << endl;
1272 cout << " Chi2/NDF = " <<BestTrack->GetChi2()/BestTrack->GetNDoF() << endl;
1273 cout << " HGCER Npe = " << fCherenkov->GetCerNPE() << endl;
1274 cout << " XTrk, YTrk = " << XTrk << " " << YTrk << endl;
1275 for (Int_t i=0; i<fNelem; i++) {
1276 if (TMath::Abs(XTrk - static_cast<THcShower*>(fParent)->GetXPos(fLayerNum-1,i)) < fStatSlop) {
1277
1278 cout << " Module " << i << ", X=" << static_cast<THcShower*>(fParent)->GetXPos(fLayerNum-1,i)
1279 << " matches track" << endl;
1280
1281 if (fGoodPosAdcPulseInt.at(i) > 0. || fGoodNegAdcPulseInt.at(i) > 0.)
1282 cout << " PulseIntegrals = " << fGoodPosAdcPulseInt.at(i) << " "
1283 << fGoodNegAdcPulseInt.at(i) << endl;
1284 }
1285 }
1286 cout << "---------------------------------------------------------------\n";
1287 // getchar();
1288 }
1289
1290 return 1;
1291}
int Int_t
unsigned int UInt_t
const Data_t kBig
bool Bool_t
float Float_t
double Double_t
const char Option_t
Option_t Option_t TPoint TPoint const char mode
ClassImp(VDC::AnalyticTTDConv) using namespace std
R__EXTERN class THcParmList * gHcParms
Definition THcGlobals.h:11
char * Form(const char *fmt,...)
UInt_t threshold[NUMSLOTS][NADCCHAN]
void Clear(Option_t *option="") override
TObject * ConstructedAt(Int_t idx)
static Int_t DefineVarsFromList(const void *list, EType type, EMode mode, const char *def_prefix, const TObject *obj, const char *prefix, const char *here, const char *comment_subst="")
virtual const char * Here(const char *) const
const char * GetPrefix() const
TVector3 fOrigin
THaDetectorBase * GetParent() const
THaApparatus * GetApparatus() const
Double_t GetChi2() const
Int_t GetNDoF() const
THaVar * Define(const char *name, const Byte_t &var, const Int_t *count=nullptr)
Class for gas Cherenkov detectors.
Double_t GetCerNPE()
A standard Hall C spectrometer apparatus.
Generic hodoscope consisting of multiple planes with multiple paddles with phototubes on both ends.
Double_t GetStartTime() const
Double_t GetOffsetTime() const
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Retrieve parameter values from the parameter cache.
Class representing a single raw ADC hit.
Definition THcRawAdcHit.h:7
Int_t GetSampPulseIntRaw(UInt_t iPulse=0) const
UInt_t GetNSampPulses() const
Double_t GetSampPulseInt(UInt_t iPulse=0) const
Int_t GetPedRaw() const
Gets raw signal pedestal. In channels.
Int_t GetSampPulseAmpRaw(UInt_t iPulse=0) const
Double_t GetSampPulseTime(UInt_t iPulse=0) const
UInt_t GetNPulses() const
Gets number of set pulses.
Int_t GetF250_NSB() const
UInt_t GetNSamples() const
Gets number of set samples.
Int_t GetSampPedRaw() const
void SetSampNSAT(Int_t nsat)
static constexpr Double_t GetAdcTopC()
void SetSampThreshold(Double_t thres)
Double_t GetPulseAmp(UInt_t iPulse=0) const
Gets pedestal subtracted pulse amplitude. In channels.
Double_t GetSample(UInt_t iSample=0) const
void SetSampIntTimePedestalPeak()
Int_t GetPulseAmpRaw(UInt_t iPulse=0) const
Gets raw pulse amplitude. In channels.
Double_t GetPed() const
Gets sample pedestal. In channels.
Double_t GetF250_PeakPedestalRatio() const
Int_t GetPulseTimeRaw(UInt_t iPulse=0) const
Gets raw pulse time. In subsamples.
Double_t GetSampPulseAmp(UInt_t iPulse=0) const
Double_t GetPulseTime(UInt_t iPulse=0) const
Int_t GetF250_NPedestalSamples() const
Int_t GetPulseIntRaw(UInt_t iPulse=0) const
Gets raw pulse integral. In channels.
Int_t GetSampPulseTimeRaw(UInt_t iPulse=0) const
Double_t GetSampPed() const
Int_t GetF250_NSA() const
static constexpr Double_t GetAdcTomV()
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
Sets F250 parameters used for pedestal subtraction.
Double_t GetPulseInt(UInt_t iPulse=0) const
Gets pedestal subtracted pulse integral. In channels.
Int_t fPlane
Definition THcRawHit.h:52
Int_t fCounter
Definition THcRawHit.h:53
Class representing a single raw hit for a shower paddle.
THcRawAdcHit & GetRawAdcHitNeg()
virtual Int_t GetData(Int_t signal)
THcRawAdcHit & GetRawAdcHitPos()
One plane of shower blocks with side readout.
vector< Int_t > fStatNumHit
vector< Double_t > fNegAdcSampWaveform
TClonesArray * fNegADCHits
vector< Double_t > fEpos
TClonesArray * frNegAdcSampPedRaw
virtual void FillADC_SampleIntegral()
TClonesArray * frPosAdcErrorFlag
virtual void FillADC_DynamicPedestal()
vector< Double_t > fGoodNegAdcPed
vector< Double_t > fGoodPosAdcPulseAmp
TClonesArray * frPosAdcThreshold
TClonesArray * frPosAdcSampPulseInt
TClonesArray * frPosAdcSampPulseAmp
TClonesArray * frPosAdcSampPulseIntRaw
virtual Int_t CoarseProcessHits()
TClonesArray * frNegAdcPulseAmpRaw
vector< Double_t > fGoodPosAdcTdcDiffTime
TClonesArray * frPosAdcPulseAmpRaw
TClonesArray * frPosAdcSampPedRaw
Float_t * fPosThresh
vector< Double_t > fEneg
Double_t GetAposP(Int_t i)
virtual ~THcShowerPlane()
virtual void FillADC_SampIntDynPed()
TClonesArray * frNegAdcThreshold
static const Int_t kADCSampIntDynPed
vector< Int_t > fNumGoodPosAdcHits
THcShowerPlane(const char *name, const char *description, Int_t planenum, THaDetectorBase *parent=NULL)
TClonesArray * frNegAdcPulseTime
virtual void FillADC_Standard()
virtual Int_t CoarseProcess(TClonesArray &tracks)
TClonesArray * frNegAdcSampPulseInt
virtual void Clear(Option_t *opt="")
THcCherenkov * fCherenkov
vector< Double_t > fGoodNegAdcMult
virtual Int_t ReadDatabase(const TDatime &date)
vector< Double_t > fEmean
TClonesArray * frPosAdcSampPulseAmpRaw
Int_t fTotNumGoodPosAdcHits
static const Int_t kADCSampleIntegral
virtual void InitializePedestals()
vector< Double_t > fPosAdcSampWaveform
TClonesArray * frNegAdcPulseIntRaw
vector< Double_t > fGoodPosAdcPulseInt
vector< Double_t > fGoodNegAdcPulseInt
TClonesArray * frPosAdcPulseInt
TClonesArray * frPosAdcPulseTimeRaw
Int_t fTotNumGoodNegAdcHits
vector< Double_t > fGoodNegAdcPulseIntRaw
TClonesArray * frPosAdcSampPulseTimeRaw
virtual Int_t FineProcess(TClonesArray &tracks)
TClonesArray * frNegAdcPulseTimeRaw
TClonesArray * frNegAdcSampPulseTime
TClonesArray * frNegAdcPulseAmp
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
TClonesArray * frNegAdcPed
TClonesArray * frPosAdcSampPed
Double_t GetAnegP(Int_t i)
vector< Double_t > fGoodPosAdcPulseIntRaw
vector< Int_t > fStatNumTrk
TClonesArray * frNegAdcErrorFlag
THaDetectorBase * fParent
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
TClonesArray * frNegAdcSampPulseTimeRaw
TClonesArray * frPosAdcSampPulseTime
TClonesArray * frPosAdcPulseTime
Double_t fAdcTdcOffset
TClonesArray * frNegAdcPedRaw
virtual void CalculatePedestals()
vector< Double_t > fGoodPosAdcPed
vector< Double_t > fGoodPosAdcMult
TClonesArray * frNegAdcPulseInt
virtual Int_t Decode(const THaEvData &)
TClonesArray * frNegAdcSampPulseAmp
Float_t * fNegThresh
TClonesArray * frNegAdcSampPulseAmpRaw
TClonesArray * fPosADCHits
static const Int_t kADCDynamicPedestal
TClonesArray * frPosAdcPed
Double_t fAdcPosThreshold
vector< Double_t > fGoodNegAdcPulseTime
TClonesArray * frPosAdcPedRaw
TVector3 GetOrigin()
vector< Double_t > fGoodNegAdcTdcDiffTime
TClonesArray * frPosAdcPulseAmp
TClonesArray * frNegAdcSampPulseIntRaw
THcHodoscope * fglHod
Int_t AccumulateStat(TClonesArray &tracks)
vector< Double_t > fGoodNegAdcPulseAmp
Double_t fStatMaxChi2
TClonesArray * frNegAdcSampPed
Double_t fSampThreshold
vector< Double_t > fGoodPosAdcPulseTime
vector< Int_t > fNumGoodNegAdcHits
TClonesArray * frPosAdcPulseIntRaw
Double_t fAdcNegThreshold
virtual Int_t DefineVariables(EMode mode=kDefine)
Generic segmented shower detector.
Definition THcShower.h:18
Double_t GetXPos(Int_t NLayer, Int_t NRow) const
Definition THcShower.h:36
Int_t GetPedLimit(Int_t NBlock, Int_t NLayer, Int_t Side)
Definition THcShower.h:52
Double_t GetZPos(Int_t NLayer) const
Definition THcShower.h:48
Double_t GetWindowMax(Int_t NBlock, Int_t NLayer, Int_t Side)
Definition THcShower.h:96
Double_t GetAdcTdcOffset()
Definition THcShower.h:122
Int_t GetNBlocks(Int_t NLayer) const
Definition THcShower.h:34
Double_t GetYPos(Int_t NLayer, Int_t Side) const
Definition THcShower.h:40
Int_t fdbg_raw_cal
Definition THcShower.h:268
Int_t GetMinPeds()
Definition THcShower.h:125
Int_t fdbg_init_cal
Definition THcShower.h:273
Double_t GetBlockThick(Int_t NLayer)
Definition THcShower.h:50
const char * GetName() const override
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
Int_t GetLast() const override
virtual void Warning(const char *method, const char *msgfmt,...) const
R__ALWAYS_INLINE Bool_t IsZombie() const
Double_t Z() const
void SetXYZ(Double_t x, Double_t y, Double_t z)
Double_t Y() const
Double_t X() const
Expr< UnaryOp< Sqrt< T >, Expr< A, T, D, D2, R >, T >, T, D, D2, R > sqrt(const Expr< A, T, D, D2, R > &rhs)
Double_t Min(Double_t a, Double_t b)
Double_t Abs(Double_t d)
Double_t Max(Double_t a, Double_t b)
STL namespace.
void tracks()