38 const char* description,
50 frAdcPulseTimeRaw =
new TClonesArray(
"THcSignalHit", 16);
57 frAdcSampPulseIntRaw =
new TClonesArray(
"THcSignalHit", 16);
58 frAdcSampPulseAmpRaw =
new TClonesArray(
"THcSignalHit", 16);
59 frAdcSampPulseTimeRaw =
new TClonesArray(
"THcSignalHit", 16);
61 frAdcSampPulseInt =
new TClonesArray(
"THcSignalHit", 16);
62 frAdcSampPulseAmp =
new TClonesArray(
"THcSignalHit", 16);
63 frAdcSampPulseTime =
new TClonesArray(
"THcSignalHit", 16);
141 static const char*
const here =
"ReadDatabase()";
142 Warning(
Here(here),
"Hodoscope \"%s\" not found. ",
"hod");
232 cout <<
"---------------------------------------------------------------\n";
233 cout <<
"Debug output from THcShowerArray::ReadDatabase for "
236 cout <<
" Layer #" <<
fLayerNum <<
", number of elements " << dec <<
fNelem
243 cout <<
" Block to block X and Y distances: " <<
fXStep <<
", " <<
fYStep
246 cout <<
" Block size along Z: " <<
fZSize <<
" cm" << endl;
248 cout <<
"Block X coordinates:" << endl;
251 cout <<
fXPos[i][j] <<
" ";
257 cout <<
"Block Y coordinates:" << endl;
260 cout <<
fYPos[i][j] <<
" ";
266 cout <<
"Block Z coordinates:" << endl;
269 cout <<
fZPos[i][j] <<
" ";
275 cout <<
" Origin of Array:" << endl;
276 cout <<
" Xorig = " <<
GetOrigin().
X() << endl;
277 cout <<
" Yorig = " <<
GetOrigin().
Y() << endl;
278 cout <<
" Zorig = " <<
GetOrigin().
Z() << endl;
283 cout <<
" FADC pedestal sample low = " <<
fPedSampLow <<
", high = "
285 cout <<
" FADC data sample low = " <<
fDataSampLow <<
", high = "
338 cout <<
" fPedLimit:" << endl;
348 cout <<
" cal_arr_cal_const:" << endl;
353 cout << cal_arr_cal_const[el++] <<
" ";
358 cout <<
" cal_arr_gain_cor:" << endl;
363 cout << cal_arr_gain_cor[el++] <<
" ";
373 fGain[i] = cal_arr_cal_const[i] * cal_arr_gain_cor[i];
379 cout <<
" fGain:" << endl;
384 cout <<
fGain[el++] <<
" ";
400 fE = vector<Double_t> (
fNelem, 0.0);
425 hitpic =
new char*[
fNRows];
427 hitpic[row] =
new char[NPERLINE*(
fNColumns+1)+2];
436 cout <<
" fMinPeds = " <<
fMinPeds << endl;
438 cout <<
"---------------------------------------------------------------\n";
463 {
"adcPedRaw",
"List of raw ADC pedestals",
"frAdcPedRaw.THcSignalHit.GetData()"},
464 {
"adcPulseIntRaw",
"List of raw ADC pulse integrals.",
"frAdcPulseIntRaw.THcSignalHit.GetData()"},
465 {
"adcPulseAmpRaw",
"List of raw ADC pulse amplitudes.",
"frAdcPulseAmpRaw.THcSignalHit.GetData()"},
466 {
"adcPulseTimeRaw",
"List of raw ADC pulse times.",
"frAdcPulseTimeRaw.THcSignalHit.GetData()"},
468 {
"adcPed",
"List of ADC pedestals",
"frAdcPed.THcSignalHit.GetData()"},
469 {
"adcPulseInt",
"List of ADC pulse integrals.",
"frAdcPulseInt.THcSignalHit.GetData()"},
470 {
"adcPulseAmp",
"List of ADC pulse amplitudes.",
"frAdcPulseAmp.THcSignalHit.GetData()"},
471 {
"adcPulseTime",
"List of ADC pulse times.",
"frAdcPulseTime.THcSignalHit.GetData()"},
473 {
"adcSampPedRaw",
"Raw ADCSAMP pedestals",
"frAdcSampPedRaw.THcSignalHit.GetData()"},
474 {
"adcSampPulseIntRaw",
"Raw ADCSAMP pulse integrals",
"frAdcSampPulseIntRaw.THcSignalHit.GetData()"},
475 {
"adcSampPulseAmpRaw",
"Raw ADCSAMP pulse amplitudes",
"frAdcSampPulseAmpRaw.THcSignalHit.GetData()"},
476 {
"adcSampPulseTimeRaw",
"Raw ADCSAMP pulse times",
"frAdcSampPulseTimeRaw.THcSignalHit.GetData()"},
477 {
"adcSampPed",
"ADCSAMP pedestals",
"frAdcSampPed.THcSignalHit.GetData()"},
478 {
"adcSampPulseInt",
"ADCSAMP pulse integrals",
"frAdcSampPulseInt.THcSignalHit.GetData()"},
479 {
"adcSampPulseAmp",
"ADCSAMP pulse amplitudes",
"frAdcSampPulseAmp.THcSignalHit.GetData()"},
480 {
"adcSampPulseTime",
"ADCSAMP pulse times",
"frAdcSampPulseTime.THcSignalHit.GetData()"},
488 {
"adcSampWaveform",
"FADC Sample Waveform",
"fSampWaveform"},
497 {
"adcErrorFlag",
"Error Flag When FPGA Fails",
"frAdcErrorFlag.THcSignalHit.GetData()"},
499 {
"adcCounter",
"List of ADC counter numbers.",
"frAdcPulseIntRaw.THcSignalHit.GetPaddleNumber()"},
500 {
"adcSampleCounter",
"ADC SAMP counter numbers",
"frAdcSampPulseIntRaw.THcSignalHit.GetPaddleNumber()"},
501 {
"numGoodAdcHits",
"Number of Good ADC Hits per PMT",
"fNumGoodAdcHits" },
503 {
"totNumAdcHits",
"Total Number of ADC Hits",
"fTotNumAdcHits" },
504 {
"totNumGoodAdcHits",
"Total Number of Good ADC Hits",
"fTotNumGoodAdcHits" },
507 {
"goodAdcPulseIntRaw",
"Good Raw ADC Pulse Integrals",
"fGoodAdcPulseIntRaw"},
508 {
"goodAdcPed",
"Good ADC Pedestals",
"fGoodAdcPed"},
509 {
"goodAdcMult",
"Good ADC Multiplicity",
"fGoodAdcMult"},
510 {
"goodAdcPulseInt",
"Good ADC Pulse Integrals",
"fGoodAdcPulseInt"},
511 {
"goodAdcPulseAmp",
"Good ADC Pulse Amplitudes",
"fGoodAdcPulseAmp"},
512 {
"goodAdcPulseTime",
"Good ADC Pulse Times",
"fGoodAdcPulseTime"},
513 {
"goodAdcTdcDiffTime",
"Good Hodo Starttime - ADC Pulse Times",
"fGoodAdcTdcDiffTime"},
516 {
"e",
"Energy Depositions per block",
"fE"},
517 {
"earray",
"Energy Deposition in Shower Array",
"fEarray"},
519 {
"nclust",
"Number of clusters",
"fNclust" },
520 {
"block_clusterID",
"Cluster ID number",
"fBlock_ClusterID"},
521 {
"ntracks",
"Number of shower tracks",
"fNtracks" },
545 Podd::DeleteContainer(**i);
622 cout <<
"---------------------------------------------------------------\n";
623 cout <<
"Debug output from THcShowerArray::CoarseProcess for " <<
GetName()
626 cout <<
" List of unclustered hits. Total hits: " <<
fTotNumAdcHits << endl;
629 cout <<
" hit " << i <<
": ";
646 assert( HitSet.empty() );
648 fNclust = (*fClusterList).size();
654 ppcl != (*fClusterList).end(); ++ppcl) {
657 block = ((**pph).hitColumn())*
fNRows + (**pph).hitRow()+1;
667 cout <<
" Clustered hits. Number of clusters: " <<
fNclust << endl;
671 ppcl != (*fClusterList).end(); ++ppcl) {
673 cout <<
" Cluster #" << i++
674 <<
": E=" <<
clE(*ppcl)
675 <<
" Epr=" <<
clEpr(*ppcl)
676 <<
" X=" <<
clX(*ppcl)
677 <<
" Y=" <<
clY(*ppcl)
678 <<
" Z=" <<
clZ(*ppcl)
679 <<
" size=" << (**ppcl).size()
685 cout <<
" hit " << j++ <<
": ";
691 cout <<
"---------------------------------------------------------------\n";
768 cout <<
" match clust = " << i <<
" clX = " <<
clX(cluster)<<
" clY = " <<
clY(cluster) <<
" distacne = " << distance <<
" test = " << (0.5*(
fXStep +
fYStep) +
static_cast<THcShower*
>(
fParent)->
fSlop) << endl;
775 if (distance < Delta) {
789 cout <<
"---------------------------------------------------------------\n";
790 cout <<
"Debug output from THcShowerArray::MatchCluster for " <<
GetName()
793 cout <<
" Track at DC:"
794 <<
" X = " <<
Track->GetX()
795 <<
" Y = " <<
Track->GetY()
796 <<
" Theta = " <<
Track->GetTheta()
797 <<
" Phi = " <<
Track->GetPhi()
799 cout <<
" Track at the front of Array:"
800 <<
" X = " << XTrFront
801 <<
" Y = " << YTrFront
802 <<
" Pathl = " << pathl
805 cout <<
" Fiducial volume test: inFidVol = " << inFidVol << endl;
807 cout <<
" Matched cluster #" << mclust <<
", Delta = " << Delta << endl;
808 cout <<
"---------------------------------------------------------------\n";
844 cout <<
"---------------------------------------------------------------\n";
845 cout <<
"Debug output from THcShowerArray::GetShEnergy for "
848 cout <<
" Track at Array: X = " << Xtr <<
" Y = " << Ytr;
850 cout <<
", matched cluster #" << mclust <<
"." << endl;
852 cout <<
", no matched cluster found." << endl;
854 cout <<
" Track's Array energy = " << Etrk <<
"." << endl;
855 cout <<
"---------------------------------------------------------------\n";
883 cout <<
"---------------------------------------------------------------\n";
884 cout <<
"Debug output from THcShowerArray::ProcessHits for "
887 cout <<
" Sparsified hits for shower array, plane #" <<
fLayerNum
888 <<
", " <<
GetName() <<
":" << endl;
895 cout <<
" counter = " << k
904 if (nspar == 0) cout <<
" No hits\n";
906 cout <<
" Earray = " <<
fEarray << endl;
907 cout <<
"---------------------------------------------------------------\n";
949 Double_t adctdcdiffTime = StartTime-pulseTime+OffsetTime;
1022 Int_t ihit = nexthit;
1025 UInt_t nrSampAdcHits = 0;
1028 while(ihit < nrawhits) {
1135 cout <<
"+" << endl;
1146 cout <<
"|" << endl;
1154 hitpic[row][0] =
'|';
1159 hitpic[row][piccolumn*(
fNColumns+1)+column+1] =
'X';
1161 hitpic[row][piccolumn*(
fNColumns+1)+column+1] =
' ';
1163 hitpic[row][(piccolumn+1)*(
fNColumns+1)] =
'|';
1167 if(piccolumn==NPERLINE) {
1169 for(
Int_t pc=0;pc<NPERLINE;pc++) {
1177 hitpic[row][(piccolumn+1)*(
fNColumns+1)+1] =
'\0';
1178 cout << hitpic[row] << endl;
1198 Int_t ihit = nexthit;
1200 while(ihit < nrawhits) {
1237 cout <<
"---------------------------------------------------------------\n";
1238 cout <<
"Debug output from THcShowerArray::AcculatePedestals for "
1241 cout <<
"Processed hit list for plane " <<
GetName() <<
":\n";
1243 for (
Int_t ih=nexthit; ih<nrawhits; ih++) {
1261 cout <<
" hit " << ih <<
":"
1262 <<
" plane = " << hit->
fPlane
1268 cout <<
"---------------------------------------------------------------\n";
1293 cout <<
"---------------------------------------------------------------\n";
1294 cout <<
"Debug output from THcShowerArray::CalculatePedestals for "
1297 cout <<
" ADC pedestals and thresholds for calorimeter plane "
1300 cout <<
" element " << i <<
": "
1301 <<
" Pedestal = " <<
fPed[i]
1302 <<
" threshold = " <<
fThresh[i]
1305 cout <<
"---------------------------------------------------------------\n";
1353 if ( (**it).hitE() > max_energy ) {
1354 max_energy = (**it).hitE();
1355 max_block = ((**it).hitColumn())*
fNRows + (**it).hitRow()+1;
1380 detc = app->GetDetector(
"hgcer");
1382 detc = app->GetDetector(
"cer");
1386 cout <<
"****** THcShowerArray::AccumulateStat: HGCer not found! ******"
1401 static_cast<THcShower*
>(
fParent)->CalcTrackIntercept(BestTrack, pathl, XTrk, YTrk);
1428 cout <<
"---------------------------------------------------------------\n";
1429 cout <<
"THcShowerArray::AccumulateStat:" << endl;
1430 cout <<
" Chi2/NDF = " <<BestTrack->
GetChi2()/BestTrack->
GetNDoF() <<endl;
1431 cout <<
" HGCER Npe = " << hgcer->
GetCerNPE() << endl;
1432 cout <<
" XTrk, YTrk = " << XTrk <<
" " << YTrk << endl;
1449 cout <<
"---------------------------------------------------------------\n";
Option_t Option_t TPoint TPoint const char mode
ClassImp(VDC::AnalyticTTDConv) using namespace std
R__EXTERN class THcParmList * gHcParms
THcShowerClusterList::iterator THcShowerClusterListIt
THcShowerHitSet::iterator THcShowerHitIt
THcShowerCluster::iterator THcShowerClusterIt
THcShowerHitSet THcShowerCluster
vector< THcShowerCluster * > THcShowerClusterList
set< THcShowerHit * > THcShowerHitSet
Double_t clE(THcShowerCluster *cluster)
Double_t clX(THcShowerCluster *cluster)
Double_t clEpr(THcShowerCluster *cluster)
Double_t clZ(THcShowerCluster *cluster)
Double_t clY(THcShowerCluster *cluster)
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
const TVector3 & GetOrigin() const
THaDetectorBase * GetParent() const
THaApparatus * GetApparatus() const
THaVar * Define(const char *name, const Byte_t &var, const Int_t *count=nullptr)
Class for gas Cherenkov detectors.
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.
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 GetData(UInt_t iPedLow, UInt_t iPedHigh, UInt_t iIntLow, UInt_t iIntHigh) const
Gets pedestal subtracted integral of samples. In channels.
Double_t GetPulseInt(UInt_t iPulse=0) const
Gets pedestal subtracted pulse integral. In channels.
Class representing a single raw hit for a shower paddle.
virtual Int_t GetData(Int_t signal)
THcRawAdcHit & GetRawAdcHitPos()
Fly's eye array of shower blocks.
virtual Int_t CoarseProcessHits()
TClonesArray * frAdcSampPulseIntRaw
TClonesArray * frAdcSampPulseAmp
vector< Double_t > fGoodAdcMult
vector< Double_t > fGoodAdcPulseInt
virtual Int_t DefineVariables(EMode mode=kDefine)
static const Int_t kADCSampleIntegral
TClonesArray * frAdcSampPulseTime
TClonesArray * frAdcSampPulseTimeRaw
Double_t fMatchClMaxEnergyBlock
TClonesArray * frAdcSampPed
virtual void FillADC_Standard()
vector< Double_t > fGoodAdcPulseTime
virtual void Clear(Option_t *opt="")
virtual Int_t Decode(const THaEvData &)
static const Int_t kADCSampIntDynPed
TClonesArray * frAdcSampPulseInt
vector< Double_t > fGoodAdcPulseIntRaw
virtual Int_t ReadDatabase(const TDatime &date)
virtual Int_t CoarseProcess(TClonesArray &tracks)
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
vector< Double_t > fGoodAdcPulseAmp
THcShowerClusterList * fClusterList
Double_t clMaxEnergyBlock(THcShowerCluster *cluster)
TClonesArray * frAdcPulseAmpRaw
virtual void CalculatePedestals()
virtual ~THcShowerArray()
virtual void InitializePedestals()
Float_t GetShEnergy(THaTrack *)
THaDetectorBase * fParent
vector< Int_t > fStatNumTrk
TClonesArray * frAdcPulseAmp
Int_t AccumulateStat(TClonesArray &tracks)
virtual Int_t FineProcess(TClonesArray &tracks)
vector< Int_t > fStatNumHit
vector< Double_t > fGoodAdcPed
virtual void FillADC_DynamicPedestal()
virtual void FillADC_SampleIntegral()
TClonesArray * frAdcPulseIntRaw
TClonesArray * frAdcPedRaw
virtual Int_t ProcessHits(TClonesArray *rawhits, Int_t nexthit)
Double_t * fAdcTimeWindowMin
Double_t * fAdcTimeWindowMax
vector< Double_t > fGoodAdcTdcDiffTime
TClonesArray * frAdcPulseTime
TClonesArray * frAdcPulseInt
TClonesArray * frAdcErrorFlag
vector< Double_t > fSampWaveform
Int_t fOutputSampWaveform
vector< Int_t > fNumGoodAdcHits
TClonesArray * frAdcPulseTimeRaw
virtual void FillADC_SampIntDynPed()
Int_t MatchCluster(THaTrack *, Double_t &, Double_t &)
static const Int_t kADCDynamicPedestal
THcShowerArray(const char *name, const char *description, Int_t planenum, THaDetectorBase *parent=NULL)
TClonesArray * frAdcSampPedRaw
TClonesArray * frAdcSampPulseAmpRaw
Generic segmented shower detector.
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
void SetXYZ(Double_t x, Double_t y, Double_t z)
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 Sqrt(Double_t x)
Double_t Max(Double_t a, Double_t b)