40 const char* description,
55 frAdcPulseTimeRaw =
new TClonesArray(
"THcSignalHit", 16);
63 frAdcSampPulseIntRaw =
new TClonesArray(
"THcSignalHit", 16);
64 frAdcSampPulseAmpRaw =
new TClonesArray(
"THcSignalHit", 16);
65 frAdcSampPulseTimeRaw =
new TClonesArray(
"THcSignalHit", 16);
67 frAdcSampPulseInt =
new TClonesArray(
"THcSignalHit", 16);
68 frAdcSampPulseAmp =
new TClonesArray(
"THcSignalHit", 16);
69 frAdcSampPulseTime =
new TClonesArray(
"THcSignalHit", 16);
151 static const char*
const here =
"ReadDatabase()";
152 Warning(
Here(here),
"Hodoscope \"%s\" not found. ",
"hod");
156 std::transform(kwPrefix.begin(), kwPrefix.end(), kwPrefix.begin(), ::tolower);
161 fKwPrefix = kwPrefix.erase(kwPrefix.size()-1);
254 cout <<
"---------------------------------------------------------------\n";
255 cout <<
"Debug output from THcNPSArray::ReadDatabase for "
258 cout <<
" Layer #" <<
fLayerNum <<
", number of elements " << dec <<
fNelem
265 cout <<
" Block to block X and Y distances: " <<
fXStep <<
", " <<
fYStep
268 cout <<
" Block size along Z: " <<
fZSize <<
" cm" << endl;
270 cout <<
"Block X coordinates:" << endl;
273 cout <<
fXPos[i][j] <<
" ";
279 cout <<
"Block Y coordinates:" << endl;
282 cout <<
fYPos[i][j] <<
" ";
288 cout <<
"Block Z coordinates:" << endl;
291 cout <<
fZPos[i][j] <<
" ";
297 cout <<
" Origin of Array:" << endl;
298 cout <<
" Xorig = " <<
GetOrigin().
X() << endl;
299 cout <<
" Yorig = " <<
GetOrigin().
Y() << endl;
300 cout <<
" Zorig = " <<
GetOrigin().
Z() << endl;
305 cout <<
" FADC pedestal sample low = " <<
fPedSampLow <<
", high = "
307 cout <<
" FADC data sample low = " <<
fDataSampLow <<
", high = "
334 {
"_cal_arr_adc_tdc_offset_all", &fAdcTdcOffset_All,
kDouble, 0,1},
377 cout <<
" fPedLimit:" << endl;
387 cout <<
" cal_arr_adc_tdc_offset:" << endl;
397 cout <<
" cal_arr_cal_const:" << endl;
402 cout << cal_arr_cal_const[el++] <<
" ";
407 cout <<
" cal_arr_gain_cor:" << endl;
412 cout << cal_arr_gain_cor[el++] <<
" ";
422 fGain[i] = cal_arr_cal_const[i] * cal_arr_gain_cor[i];
428 cout <<
" fGain:" << endl;
433 cout <<
fGain[el++] <<
" ";
449 fE = vector<Double_t> (
fNelem, 0.0);
491 hitpic =
new char*[
fNRows];
493 hitpic[row] =
new char[NPERLINE*(
fNColumns+1)+2];
502 cout <<
" fMinPeds = " <<
fMinPeds << endl;
504 cout <<
"---------------------------------------------------------------\n";
531 {
"adcPedRaw",
"List of raw ADC pedestals",
"frAdcPedRaw.THcSignalHit.GetData()"},
532 {
"adcPulseIntRaw",
"List of raw ADC pulse integrals.",
"frAdcPulseIntRaw.THcSignalHit.GetData()"},
533 {
"adcPulseAmpRaw",
"List of raw ADC pulse amplitudes.",
"frAdcPulseAmpRaw.THcSignalHit.GetData()"},
534 {
"adcPulseTimeRaw",
"List of raw ADC pulse times.",
"frAdcPulseTimeRaw.THcSignalHit.GetData()"},
536 {
"adcPed",
"List of ADC pedestals",
"frAdcPed.THcSignalHit.GetData()"},
537 {
"adcPulseInt",
"List of ADC pulse integrals.",
"frAdcPulseInt.THcSignalHit.GetData()"},
538 {
"adcPulseAmp",
"List of ADC pulse amplitudes.",
"frAdcPulseAmp.THcSignalHit.GetData()"},
539 {
"adcPulseTime",
"List of ADC pulse times.",
"frAdcPulseTime.THcSignalHit.GetData()"},
542 {
"adcSampPedRaw",
"Raw ADCSAMP pedestals",
"frAdcSampPedRaw.THcSignalHit.GetData()"},
543 {
"adcSampPulseIntRaw",
"Raw ADCSAMP pulse integrals",
"frAdcSampPulseIntRaw.THcSignalHit.GetData()"},
544 {
"adcSampPulseAmpRaw",
"Raw ADCSAMP pulse amplitudes",
"frAdcSampPulseAmpRaw.THcSignalHit.GetData()"},
545 {
"adcSampPulseTimeRaw",
"Raw ADCSAMP pulse times",
"frAdcSampPulseTimeRaw.THcSignalHit.GetData()"},
546 {
"adcSampPed",
"ADCSAMP pedestals",
"frAdcSampPed.THcSignalHit.GetData()"},
547 {
"adcSampPulseInt",
"ADCSAMP pulse integrals",
"frAdcSampPulseInt.THcSignalHit.GetData()"},
548 {
"adcSampPulseAmp",
"ADCSAMP pulse amplitudes",
"frAdcSampPulseAmp.THcSignalHit.GetData()"},
549 {
"adcSampPulseTime",
"ADCSAMP pulse times",
"frAdcSampPulseTime.THcSignalHit.GetData()"},
559 {
"adcSampWaveform",
"FADC Sample Waveform",
"fSampWaveform"},
568 {
"adcErrorFlag",
"Error Flag When FPGA Fails",
"frAdcErrorFlag.THcSignalHit.GetData()"},
570 {
"adcCounter",
"List of ADC counter numbers.",
"frAdcPulseIntRaw.THcSignalHit.GetPaddleNumber()"},
571 {
"numGoodAdcHits",
"Number of Good ADC Hits per PMT",
"fNumGoodAdcHits" },
573 {
"totNumAdcHits",
"Total Number of ADC Hits",
"fTotNumAdcHits" },
574 {
"totNumGoodAdcHits",
"Total Number of Good ADC Hits",
"fTotNumGoodAdcHits" },
577 {
"goodAdcPulseIntRaw",
"Good Raw ADC Pulse Integrals",
"fGoodAdcPulseIntRaw"},
578 {
"goodAdcPed",
"Good ADC Pedestals",
"fGoodAdcPed"},
579 {
"goodAdcMult",
"Good ADC Multiplicity",
"fGoodAdcMult"},
580 {
"goodAdcPulseInt",
"Good ADC Pulse Integrals",
"fGoodAdcPulseInt"},
581 {
"goodAdcPulseAmp",
"Good ADC Pulse Amplitudes",
"fGoodAdcPulseAmp"},
582 {
"goodAdcPulseTime",
"Good ADC Pulse Times",
"fGoodAdcPulseTime"},
583 {
"goodAdcTdcDiffTime",
"Good Hodo Starttime - ADC Pulse Times",
"fGoodAdcTdcDiffTime"},
586 {
"e",
"Energy Depositions per block",
"fE"},
587 {
"earray",
"Energy Deposition in Shower Array",
"fEarray"},
589 {
"nclust",
"Number of clusters",
"fNclust" },
590 {
"block_clusterID",
"Cluster ID number",
"fBlock_ClusterID"},
591 {
"ntracks",
"Number of shower tracks",
"fNtracks" },
618 Podd::DeleteContainer(**i);
713 cout <<
"---------------------------------------------------------------\n";
714 cout <<
"Debug output from THcNPSArray::CoarseProcess for " <<
GetName()
717 cout <<
" List of unclustered hits. Total hits: " <<
fTotNumAdcHits << endl;
723 cout <<
"---Calling clustering process---" << endl;
747 assert( HitSet.empty() );
748 fNclust = (*fClusterList).size();
755 ppcl != (*fClusterList).end(); ++ppcl) {
760 block = ((**pph).hitRow())*
fNColumns + (**pph).hitColumn();
770 cout <<
" Clustered hits. Number of clusters: " <<
fNclust << endl;
774 ppcl != (*fClusterList).end(); ++ppcl) {
776 cout <<
" Cluster #" << i++
777 <<
": E=" <<
clE(*ppcl)
778 <<
" Epr=" <<
clEpr(*ppcl)
779 <<
" X=" <<
clX(*ppcl)
780 <<
" Y=" <<
clY(*ppcl)
781 <<
" Z=" <<
clZ(*ppcl)
782 <<
" T=" <<
clT(*ppcl)
783 <<
" size=" << (**ppcl).size()
789 cout <<
" hit " << j++ <<
": ";
795 cout <<
"---------------------------------------------------------------\n";
824 cout <<
"---------------------------------------------------------------\n";
825 cout <<
"Debug output from THcNPSArray::ProcessHits for "
828 cout <<
" Sparsified hits for shower array, plane #" <<
fLayerNum
829 <<
", " <<
GetName() <<
":" << endl;
837 cout <<
" counter = " << k
846 if (nspar == 0) cout <<
" No hits\n";
848 cout <<
" Earray = " <<
fEarray << endl;
849 cout <<
"---------------------------------------------------------------\n";
887 if (npad >
fNelem-1)
continue;
893 Double_t adctdcdiffTime = pulseTime-(StartTime-50);
904 if (!errorflag && pulseTimeCut) {
1059 Int_t ihit = nexthit;
1062 UInt_t nrSampAdcHits = 0;
1068 while(ihit < nrawhits) {
1379 cout <<
"+" << endl;
1390 cout <<
"|" << endl;
1398 hitpic[row][0] =
'|';
1403 hitpic[row][piccolumn*(
fNColumns+1)+column+1] =
'X';
1405 hitpic[row][piccolumn*(
fNColumns+1)+column+1] =
' ';
1407 hitpic[row][(piccolumn+1)*(
fNColumns+1)] =
'|';
1411 if(piccolumn==NPERLINE) {
1413 for(
Int_t pc=0;pc<NPERLINE;pc++) {
1421 hitpic[row][(piccolumn+1)*(
fNColumns+1)+1] =
'\0';
1422 cout << hitpic[row] << endl;
1442 Int_t ihit = nexthit;
1444 while(ihit < nrawhits) {
1480 cout <<
"---------------------------------------------------------------\n";
1481 cout <<
"Debug output from THcNPSArray::AcculatePedestals for "
1484 cout <<
"Processed hit list for plane " <<
GetName() <<
":\n";
1486 for (
Int_t ih=nexthit; ih<nrawhits; ih++) {
1504 cout <<
" hit " << ih <<
":"
1505 <<
" plane = " << hit->
fPlane
1511 cout <<
"---------------------------------------------------------------\n";
1536 cout <<
"---------------------------------------------------------------\n";
1537 cout <<
"Debug output from THcNPSArray::CalculatePedestals for "
1540 cout <<
" ADC pedestals and thresholds for calorimeter plane "
1543 cout <<
" element " << i <<
": "
1544 <<
" Pedestal = " <<
fPed[i]
1545 <<
" threshold = " <<
fThresh[i]
1548 cout <<
"---------------------------------------------------------------\n";
1604 if(transform>0 && transform < 4) {
1605 if(transform%2 == 1) {
1608 if(transform/2 == 1) {
1611 }
else if (transform>4 && transform < 8) {
1612 if(transform%2 == 1) {
1615 if((transform-4)/2 == 1) {
1616 row =
fNRows/2 - row - 1;
1624 if(transform==0 || transform==2){
1628 if(transform==1 || transform==3){
1632 padnum = column*
fNRows + row;
1649 int itmp, jtmp, id_tmp;
1650 itmp = jtmp = id_tmp = -1;
1666 return std::make_pair(itmp, jtmp);
1733 Int_t ik_offset, jk_offset;
1734 ik_offset = jk_offset = 1;
1738 ik_offset = 1, jk_offset = -1;
1741 if (k==0) { ik = i + ik_offset, jk = j + jk_offset; }
1742 else if(k==1) { ik = i + ik_offset, jk = j; }
1743 else if(k==2) { ik = i + ik_offset, jk = j - jk_offset; }
1744 else if(k==3) { ik = i, jk = j - jk_offset; }
1745 else if(k==4) { ik = i - ik_offset, jk = j - jk_offset; }
1746 else if(k==5) { ik = i - ik_offset, jk = j; }
1747 else if(k==6) { ik = i - ik_offset, jk = j + jk_offset; }
1748 else if(k==7) { ik = i, jk = j + jk_offset; }
1751 if(i<0 || j <0){ik=-1, jk=-1;}
1778 for(
Int_t k=0; k<8; k++){
1813 if ( (**it).hitE() > max_energy ) {
1814 max_energy = (**it).hitE();
1815 max_block = ((**it).hitColumn())*
fNRows + (**it).hitRow()+1;
1875 cout <<
"---------------------------------------------------------------\n";
1876 cout <<
"THcNPSArray::AccumulateStat:" << endl;
1877 cout <<
" Chi2/NDF = " <<BestTrack->
GetChi2()/BestTrack->
GetNDoF() <<endl;
1879 cout <<
" XTrk, YTrk = " << XTrk <<
" " << YTrk << endl;
1896 cout <<
"---------------------------------------------------------------\n";
Option_t Option_t TPoint TPoint const char mode
ClassImp(VDC::AnalyticTTDConv) using namespace std
R__EXTERN class THcParmList * gHcParms
Double_t clT(THcNPSShowerCluster *cluster)
THcNPSShowerCluster::iterator THcNPSShowerClusterIt
THcNPSShowerClusterList::iterator THcNPSShowerClusterListIt
vector< THcNPSShowerCluster * > THcNPSShowerClusterList
THcNPSShowerHitSet THcNPSShowerCluster
THcNPSShowerHitSet::iterator THcNPSShowerHitIt
set< THcNPSShowerHit * > THcNPSShowerHitSet
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
THaAnalysisObject * FindModule(const char *name, const char *classname, bool do_error=true)
const TVector3 & GetOrigin() const
THaDetectorBase * GetParent() const
THaApparatus * GetApparatus() const
THaVar * Define(const char *name, const Byte_t &var, const Int_t *count=nullptr)
Double_t GetStartTime() const
Fly's eye array of shower blocks.
Double_t * fAdcPulseTimeMin
THcNPSArray(const char *name, const char *description, Int_t planenum, THaDetectorBase *parent=NULL)
Double_t * fAdcPulseTimeMax
Int_t GetBlockID(UInt_t irow, UInt_t jcol)
TClonesArray * frAdcPulseTimeRaw
vector< Int_t > fNumGoodAdcHits
TClonesArray * frAdcPulseIntRaw
vector< Double_t > fGoodAdcPulseTime
TClonesArray * frAdcSampPulseIntRaw
std::pair< int, int > GetBlockij(Int_t id)
vector< Double_t > fGoodAdcMult
virtual void FillADC_DynamicPedestal()
vector< Double_t > fGoodAdcPulseAmp
virtual Int_t AccumulatePedestals(TClonesArray *rawhits, Int_t nexthit)
vector< Double_t > fGoodAdcPulseInt
virtual void FillADC_SampIntDynPed()
TClonesArray * frAdcSampPulseTime
virtual Int_t CoarseProcessHits()
THaDetectorBase * fParent
TClonesArray * frAdcPulseAmp
Int_t fOutputSampWaveform
virtual void FillADC_SampleIntegral()
Double_t fAdcSampThreshold
vector< Double_t > fGoodAdcPulseIntRaw
virtual void CalculatePedestals()
vector< Double_t > fGoodAdcTdcDiffTime
vector< Double_t > fSampWaveform
THcNPSShowerClusterList * fClusterList
TClonesArray * frAdcPedRaw
virtual void Clear(Option_t *opt="")
virtual Int_t ClearProcessedHits()
TClonesArray * frAdcPulseAmpRaw
TClonesArray * frAdcSampPed
Double_t * fAdcTimeWindowMax
vector< Int_t > fStatNumTrk
Double_t fMatchClMaxEnergyBlock
virtual Int_t AccumulateHits(TClonesArray *rawhits, Int_t nexthit, Int_t quadrant)
TClonesArray * frAdcErrorFlag
TClonesArray * frAdcSampPulseAmp
Int_t fOutputSampRawWaveform
TClonesArray * frAdcPulseTime
Double_t * fAdcTimeWindowMin
virtual Int_t CoarseProcess(TClonesArray &tracks)
vector< Int_t > fStatNumHit
TClonesArray * frAdcSampPulseAmpRaw
Int_t AccumulateStat(TClonesArray &tracks)
virtual Int_t FineProcess(TClonesArray &tracks)
Double_t clMaxEnergyBlock(THcNPSShowerCluster *cluster)
vector< Double_t > fGoodAdcPed
TClonesArray * frAdcSampPulseTimeRaw
TClonesArray * frAdcPulseInt
TClonesArray * frAdcSampPulseInt
virtual void FillADC_Standard()
Int_t GetNeighbor(UInt_t id, UInt_t k)
TClonesArray * frAdcSampPedRaw
virtual Int_t ReadDatabase(const TDatime &date)
void GetMax(Float_t pInei[8], Int_t nei[8], Int_t &virus_blk, Float_t &max)
virtual void InitializePedestals()
Int_t shms2nps_transform(Int_t padnum, Int_t transform)
virtual Int_t DefineVariables(EMode mode=kDefine)
virtual Int_t Decode(const THaEvData &)
Generic segmented shower detector.
Int_t LoadParmValues(const DBRequest *list, const char *prefix="")
Int_t GetSampPulseIntRaw(UInt_t iPulse=0) const
Double_t GetF250_PeakPedestalRatio()
UInt_t GetNSampPulses() const
Double_t GetAdcTopC() const
Double_t GetSampPulseInt(UInt_t iPulse=0) const
Int_t GetSampPulseAmpRaw(UInt_t iPulse=0) const
Double_t GetSampPulseTime(UInt_t iPulse=0) const
UInt_t GetNPulses() const
UInt_t GetNSamples() const
Double_t GetAdcTomV() const
Int_t GetSampPedRaw() const
void SetSampNSAT(Int_t nsat)
void SetSampThreshold(Double_t thres)
Double_t GetPulseAmp(UInt_t iPulse=0) const
Double_t GetSample(UInt_t iSample=0) const
void SetSampIntTimePedestalPeak()
Int_t GetPulseAmpRaw(UInt_t iPulse=0) const
Int_t GetPulseTimeRaw(UInt_t iPulse=0) const
Double_t GetSampPulseAmp(UInt_t iPulse=0) const
Double_t GetPulseTime(UInt_t iPulse=0) const
Int_t GetSampleRaw(UInt_t iSample=0) const
Int_t GetPulseIntRaw(UInt_t iPulse=0) const
Int_t GetSampPulseTimeRaw(UInt_t iPulse=0) const
Double_t GetSampPed() const
Int_t GetF250_NPedestalSamples()
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
Double_t GetData(UInt_t iPedLow, UInt_t iPedHigh, UInt_t iIntLow, UInt_t iIntHigh) const
Double_t GetPulseInt(UInt_t iPulse=0) const
virtual Int_t GetData(Int_t signal)
THcRawAdcHit & GetRawAdcHitPos()
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 max(double x, double y)
Double_t Min(Double_t a, Double_t b)
Double_t Max(Double_t a, Double_t b)