Skip to content
Snippets Groups Projects
Commit 13c30107 authored by hallc-online's avatar hallc-online Committed by Mark K Jones
Browse files

Updated THcCherenkov.cxx and h

Add new ntuple variables
goodAdcMult == the number of hits in raw ADc for that channel
goodAdcHitUsed == which hit number of the raw ADC hits passed the
                      the ADC time window cut

Modified fAdcTimeWindowMin  and fAdcTimeWindowMax to be arrays
  that are the size of the number of Cerenkov pmts.
parent 122bade7
No related branches found
No related tags found
No related merge requests found
...@@ -64,6 +64,8 @@ THcCherenkov::THcCherenkov( const char* name, const char* description, ...@@ -64,6 +64,8 @@ THcCherenkov::THcCherenkov( const char* name, const char* description,
fNumTracksFired = vector<Int_t> (MaxNumCerPmt, 0.0); fNumTracksFired = vector<Int_t> (MaxNumCerPmt, 0.0);
fNpe = vector<Double_t> (MaxNumCerPmt, 0.0); fNpe = vector<Double_t> (MaxNumCerPmt, 0.0);
fGoodAdcPed = vector<Double_t> (MaxNumCerPmt, 0.0); fGoodAdcPed = vector<Double_t> (MaxNumCerPmt, 0.0);
fGoodAdcMult = vector<Double_t> (MaxNumCerPmt, 0.0);
fGoodAdcHitUsed = vector<Double_t> (MaxNumCerPmt, 0.0);
fGoodAdcPulseInt = vector<Double_t> (MaxNumCerPmt, 0.0); fGoodAdcPulseInt = vector<Double_t> (MaxNumCerPmt, 0.0);
fGoodAdcPulseIntRaw = vector<Double_t> (MaxNumCerPmt, 0.0); fGoodAdcPulseIntRaw = vector<Double_t> (MaxNumCerPmt, 0.0);
fGoodAdcPulseAmp = vector<Double_t> (MaxNumCerPmt, 0.0); fGoodAdcPulseAmp = vector<Double_t> (MaxNumCerPmt, 0.0);
...@@ -204,7 +206,8 @@ Int_t THcCherenkov::ReadDatabase( const TDatime& date ) ...@@ -204,7 +206,8 @@ Int_t THcCherenkov::ReadDatabase( const TDatime& date )
fPedLimit = new Int_t[fNelem]; fPedLimit = new Int_t[fNelem];
fGain = new Double_t[fNelem]; fGain = new Double_t[fNelem];
fPedMean = new Double_t[fNelem]; fPedMean = new Double_t[fNelem];
fAdcTimeWindowMin = new Double_t[fNelem];
fAdcTimeWindowMax= new Double_t[fNelem];
// Region parameters // Region parameters
fRegionsValueMax = fNRegions * 8; fRegionsValueMax = fNRegions * 8;
fRegionValue = new Double_t[fRegionsValueMax]; fRegionValue = new Double_t[fRegionsValueMax];
...@@ -223,14 +226,17 @@ Int_t THcCherenkov::ReadDatabase( const TDatime& date ) ...@@ -223,14 +226,17 @@ Int_t THcCherenkov::ReadDatabase( const TDatime& date )
{"_mirror_zpos", &fMirrorZPos, kDouble}, {"_mirror_zpos", &fMirrorZPos, kDouble},
{"_npe_thresh", &fNpeThresh, kDouble}, {"_npe_thresh", &fNpeThresh, kDouble},
{"_debug_adc", &fDebugAdc, kInt, 0, 1}, {"_debug_adc", &fDebugAdc, kInt, 0, 1},
{"_adcTimeWindowMin", &fAdcTimeWindowMin, kDouble}, {"_adcTimeWindowMin", fAdcTimeWindowMin, kDouble,(UInt_t) fNelem,1},
{"_adcTimeWindowMax", &fAdcTimeWindowMax, kDouble}, {"_adcTimeWindowMax", fAdcTimeWindowMax, kDouble, (UInt_t) fNelem,1},
{"_adc_tdc_offset", &fAdcTdcOffset, kDouble, 0, 1}, {"_adc_tdc_offset", &fAdcTdcOffset, kDouble, 0, 1},
{"_region", &fRegionValue[0], kDouble, (UInt_t) fRegionsValueMax}, {"_region", &fRegionValue[0], kDouble, (UInt_t) fRegionsValueMax},
{"_adcrefcut", &fADC_RefTimeCut, kInt, 0, 1}, {"_adcrefcut", &fADC_RefTimeCut, kInt, 0, 1},
{0} {0}
}; };
for (Int_t i=0;i<fNelem;i++) {
fAdcTimeWindowMin[i]=-1000.;
fAdcTimeWindowMax[i]=1000.;
}
fDebugAdc = 0; // Set ADC debug parameter to false unless set in parameter file fDebugAdc = 0; // Set ADC debug parameter to false unless set in parameter file
fAdcTdcOffset = 0.0; fAdcTdcOffset = 0.0;
fADC_RefTimeCut = 0; fADC_RefTimeCut = 0;
...@@ -302,6 +308,8 @@ Int_t THcCherenkov::DefineVariables( EMode mode ) ...@@ -302,6 +308,8 @@ Int_t THcCherenkov::DefineVariables( EMode mode )
{"npeSum", "Total Number of PEs", "fNpeSum"}, {"npeSum", "Total Number of PEs", "fNpeSum"},
{"goodAdcPed", "Good ADC pedestals", "fGoodAdcPed"}, {"goodAdcPed", "Good ADC pedestals", "fGoodAdcPed"},
{"goodAdcMult", "Good ADC Multiplicity", "fGoodAdcMult"},
{"goodAdcHitUsed", "Good ADC Hit Used", "fGoodAdcHitUsed"},
{"goodAdcPulseInt", "Good ADC pulse integrals", "fGoodAdcPulseInt"}, {"goodAdcPulseInt", "Good ADC pulse integrals", "fGoodAdcPulseInt"},
{"goodAdcPulseIntRaw", "Good ADC raw pulse integrals", "fGoodAdcPulseIntRaw"}, {"goodAdcPulseIntRaw", "Good ADC raw pulse integrals", "fGoodAdcPulseIntRaw"},
{"goodAdcPulseAmp", "Good ADC pulse amplitudes", "fGoodAdcPulseAmp"}, {"goodAdcPulseAmp", "Good ADC pulse amplitudes", "fGoodAdcPulseAmp"},
...@@ -349,6 +357,8 @@ void THcCherenkov::Clear(Option_t* opt) ...@@ -349,6 +357,8 @@ void THcCherenkov::Clear(Option_t* opt)
fNumTracksFired.at(ielem) = 0; fNumTracksFired.at(ielem) = 0;
for (UInt_t ielem = 0; ielem < fGoodAdcPed.size(); ielem++) { for (UInt_t ielem = 0; ielem < fGoodAdcPed.size(); ielem++) {
fGoodAdcPed.at(ielem) = 0.0; fGoodAdcPed.at(ielem) = 0.0;
fGoodAdcMult.at(ielem) = 0.0;
fGoodAdcHitUsed.at(ielem) = 0.0;
fGoodAdcPulseInt.at(ielem) = 0.0; fGoodAdcPulseInt.at(ielem) = 0.0;
fGoodAdcPulseIntRaw.at(ielem) = 0.0; fGoodAdcPulseIntRaw.at(ielem) = 0.0;
fGoodAdcPulseAmp.at(ielem) = 0.0; fGoodAdcPulseAmp.at(ielem) = 0.0;
...@@ -438,11 +448,13 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& ) ...@@ -438,11 +448,13 @@ Int_t THcCherenkov::CoarseProcess( TClonesArray& )
Double_t pulseTime = ((THcSignalHit*) frAdcPulseTime->ConstructedAt(ielem))->GetData(); Double_t pulseTime = ((THcSignalHit*) frAdcPulseTime->ConstructedAt(ielem))->GetData();
Double_t adctdcdiffTime = StartTime-pulseTime; Double_t adctdcdiffTime = StartTime-pulseTime;
Bool_t errorFlag = ((THcSignalHit*) fAdcErrorFlag->ConstructedAt(ielem))->GetData(); Bool_t errorFlag = ((THcSignalHit*) fAdcErrorFlag->ConstructedAt(ielem))->GetData();
Bool_t pulseTimeCut = adctdcdiffTime > fAdcTimeWindowMin && adctdcdiffTime < fAdcTimeWindowMax; Bool_t pulseTimeCut = adctdcdiffTime > fAdcTimeWindowMin[npmt] && adctdcdiffTime < fAdcTimeWindowMax[npmt];
// By default, the last hit within the timing cut will be considered "good" // By default, the last hit within the timing cut will be considered "good"
if (!errorFlag && pulseTimeCut) { if (!errorFlag && pulseTimeCut) {
fGoodAdcPed.at(npmt) = pulsePed; fGoodAdcPed.at(npmt) = pulsePed;
fGoodAdcHitUsed.at(npmt) = ielem+1;
fGoodAdcMult.at(npmt) =frAdcPulseInt->GetEntries() ;
fGoodAdcPulseInt.at(npmt) = pulseInt; fGoodAdcPulseInt.at(npmt) = pulseInt;
fGoodAdcPulseIntRaw.at(npmt) = pulseIntRaw; fGoodAdcPulseIntRaw.at(npmt) = pulseIntRaw;
fGoodAdcPulseAmp.at(npmt) = pulseAmp; fGoodAdcPulseAmp.at(npmt) = pulseAmp;
......
...@@ -66,6 +66,8 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList { ...@@ -66,6 +66,8 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList {
vector<Int_t> fNumTracksMatched; vector<Int_t> fNumTracksMatched;
vector<Int_t> fNumTracksFired; vector<Int_t> fNumTracksFired;
vector<Double_t> fGoodAdcPed; vector<Double_t> fGoodAdcPed;
vector<Double_t> fGoodAdcMult;
vector<Double_t> fGoodAdcHitUsed;
vector<Double_t> fGoodAdcPulseInt; vector<Double_t> fGoodAdcPulseInt;
vector<Double_t> fGoodAdcPulseIntRaw; vector<Double_t> fGoodAdcPulseIntRaw;
vector<Double_t> fGoodAdcPulseAmp; vector<Double_t> fGoodAdcPulseAmp;
...@@ -87,8 +89,8 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList { ...@@ -87,8 +89,8 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList {
Double_t fXAtCer; Double_t fXAtCer;
Double_t fYAtCer; Double_t fYAtCer;
Double_t fNpeThresh; Double_t fNpeThresh;
Double_t fAdcTimeWindowMin; Double_t* fAdcTimeWindowMin;
Double_t fAdcTimeWindowMax; Double_t* fAdcTimeWindowMax;
Double_t fAdcTdcOffset; Double_t fAdcTdcOffset;
Double_t* fRegionValue; Double_t* fRegionValue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment