Skip to content
Snippets Groups Projects
Commit 87bb8d6e authored by Cdaq Account's avatar Cdaq Account
Browse files

Modify THcHodoHit.h and THcScintillatorPlane.cxx

THcHodoHit.h add methods to set and get the ADC peak amp and time
THcScintillatorPlane::ProcessHits changed to set the ADC peak amp and time in the Hodohit
DefineVariable added variables to tree
parent f8b5f84b
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,10 @@ public: ...@@ -30,6 +30,10 @@ public:
// Get and Set Functions // Get and Set Functions
Double_t GetPosADC() const { return fPosADC_Ped; } Double_t GetPosADC() const { return fPosADC_Ped; }
Double_t GetNegADC() const { return fNegADC_Ped; } Double_t GetNegADC() const { return fNegADC_Ped; }
Double_t GetPosADCpeak() const { return fPosADC_Peak; }
Double_t GetNegADCpeak() const { return fNegADC_Peak; }
Double_t GetPosADCtime() const { return fPosADC_Time; }
Double_t GetNegADCtime() const { return fNegADC_Time; }
Int_t GetPosTDC() const { return fPosTDC; } Int_t GetPosTDC() const { return fPosTDC; }
Int_t GetNegTDC() const { return fNegTDC; } Int_t GetNegTDC() const { return fNegTDC; }
Double_t GetPosCorrectedTime() const { return fPosCorrectedTime;} Double_t GetPosCorrectedTime() const { return fPosCorrectedTime;}
...@@ -40,6 +44,7 @@ public: ...@@ -40,6 +44,7 @@ public:
Bool_t GetTwoGoodTimes() const { return fTwoGoodTimes;} Bool_t GetTwoGoodTimes() const { return fTwoGoodTimes;}
Bool_t GetHasCorrectedTimes() const { return fHasCorrectedTimes;} Bool_t GetHasCorrectedTimes() const { return fHasCorrectedTimes;}
Int_t GetPaddleNumber() const { return fPaddleNumber; } Int_t GetPaddleNumber() const { return fPaddleNumber; }
Double_t GetPaddleCenter() const { return fPaddleCenter; }
void SetCorrectedTimes(Double_t pos, Double_t neg, Double_t) { void SetCorrectedTimes(Double_t pos, Double_t neg, Double_t) {
fPosCorrectedTime = pos; fNegCorrectedTime = neg; fPosCorrectedTime = pos; fNegCorrectedTime = neg;
...@@ -55,7 +60,21 @@ public: ...@@ -55,7 +60,21 @@ public:
void SetTwoGoodTimes(Bool_t flag) { void SetTwoGoodTimes(Bool_t flag) {
fTwoGoodTimes = flag; fTwoGoodTimes = flag;
} }
void SetPaddleCenter(Double_t padcenter) {
fPaddleCenter = padcenter;
}
void SetPosADCpeak( Double_t adc) {
fPosADC_Peak =adc;
}
void SetNegADCpeak( Double_t adc) {
fNegADC_Peak =adc;
}
void SetPosADCtime( Double_t ptime) {
fPosADC_Time =ptime;
}
void SetNegADCtime( Double_t ptime) {
fNegADC_Time =ptime;
}
protected: protected:
static const Double_t kBig; //! static const Double_t kBig; //!
...@@ -63,6 +82,10 @@ protected: ...@@ -63,6 +82,10 @@ protected:
Int_t fNegTDC; Int_t fNegTDC;
Double_t fPosADC_Ped; // Pedestal subtracted ADC Double_t fPosADC_Ped; // Pedestal subtracted ADC
Double_t fNegADC_Ped; // Pedestal subtracted ADC Double_t fNegADC_Ped; // Pedestal subtracted ADC
Double_t fPosADC_Peak; // ADC peak amplitude
Double_t fNegADC_Peak; // ADC peak amplitude
Double_t fPosADC_Time; // ADC time
Double_t fNegADC_Time; // ADC time
Int_t fPaddleNumber; Int_t fPaddleNumber;
Double_t fPosCorrectedTime; // Pulse height corrected time Double_t fPosCorrectedTime; // Pulse height corrected time
...@@ -74,6 +97,7 @@ protected: ...@@ -74,6 +97,7 @@ protected:
Bool_t fHasCorrectedTimes; Bool_t fHasCorrectedTimes;
Bool_t fTwoGoodTimes; Bool_t fTwoGoodTimes;
Double_t fPaddleCenter;
THcScintillatorPlane* fPlane; // Pointer to parent scintillator plane THcScintillatorPlane* fPlane; // Pointer to parent scintillator plane
......
...@@ -346,6 +346,10 @@ Int_t THcScintillatorPlane::DefineVariables( EMode mode ) ...@@ -346,6 +346,10 @@ Int_t THcScintillatorPlane::DefineVariables( EMode mode )
{"GoodPosTdcTimeCorr", "List of positive corrected TDC values (corrected for PMT offset and ADC)", "fHodoHits.THcHodoHit.GetPosCorrectedTime()"}, {"GoodPosTdcTimeCorr", "List of positive corrected TDC values (corrected for PMT offset and ADC)", "fHodoHits.THcHodoHit.GetPosCorrectedTime()"},
{"GoodPosTdcTimeTOFCorr", "List of positive corrected TDC values (corrected for TOF)", "fHodoHits.THcHodoHit.GetPosTOFCorrectedTime()"}, {"GoodPosTdcTimeTOFCorr", "List of positive corrected TDC values (corrected for TOF)", "fHodoHits.THcHodoHit.GetPosTOFCorrectedTime()"},
{"GoodPosAdcPulseInt", "List of positive ADC values (passed TDC Min and Max cuts for either end)", "fHodoHits.THcHodoHit.GetPosADC()"}, {"GoodPosAdcPulseInt", "List of positive ADC values (passed TDC Min and Max cuts for either end)", "fHodoHits.THcHodoHit.GetPosADC()"},
{"GoodPosAdcPulseAmp", "List of positive ADC peak amp (passed TDC Min and Max cuts for either end)", "fHodoHits.THcHodoHit.GetPosADCpeak()"},
{"GoodNegAdcPulseAmp", "List of Negative ADC peak amp (passed TDC Min and Max cuts for either end)", "fHodoHits.THcHodoHit.GetNegADCpeak()"},
{"GoodPosAdcPulseTime", "List of positive ADC peak amp (passed TDC Min and Max cuts for either end)", "fHodoHits.THcHodoHit.GetPosADCtime()"},
{"GoodNegAdcPulseTime", "List of Negative ADC peak amp (passed TDC Min and Max cuts for either end)", "fHodoHits.THcHodoHit.GetNegADCtime()"},
{"ngoodhits", "Number of paddle hits (passed tof tolerance and used to determine the focal plane time )", "GetNGoodHits() "}, {"ngoodhits", "Number of paddle hits (passed tof tolerance and used to determine the focal plane time )", "GetNGoodHits() "},
{ 0 } { 0 }
}; };
...@@ -492,7 +496,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -492,7 +496,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// cout << "THcScintillatorPlane::ProcessHits " << fPlaneNum << " " << nexthit << "/" << nrawhits << endl; // cout << "THcScintillatorPlane::ProcessHits " << fPlaneNum << " " << nexthit << "/" << nrawhits << endl;
Int_t ihit = nexthit; Int_t ihit = nexthit;
// cout << "THcScintillatorPlane: raw htis = " << nrawhits << endl; //cout << "THcScintillatorPlane: " << GetName() << " raw hits = " << nrawhits << endl;
// A THcRawHodoHit contains all the information (tdc and adc for both // A THcRawHodoHit contains all the information (tdc and adc for both
// pmts) for a single paddle for a single trigger. The tdc information // pmts) for a single paddle for a single trigger. The tdc information
...@@ -500,6 +504,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -500,6 +504,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
// Use "ihit" as the index over THcRawHodoHit objects. Use // Use "ihit" as the index over THcRawHodoHit objects. Use
// "thit" to index over multiple tdc hits within an "ihit". // "thit" to index over multiple tdc hits within an "ihit".
while(ihit < nrawhits) { while(ihit < nrawhits) {
//cout << " ihit = " << ihit << endl;
THcRawHodoHit* hit = (THcRawHodoHit *) rawhits->At(ihit); THcRawHodoHit* hit = (THcRawHodoHit *) rawhits->At(ihit);
if(hit->fPlane > fPlaneNum) { if(hit->fPlane > fPlaneNum) {
break; break;
...@@ -595,6 +600,14 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -595,6 +600,14 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
Int_t tdc_pos=-999; Int_t tdc_pos=-999;
Int_t tdc_neg=-999; Int_t tdc_neg=-999;
// Find first in range hit from multihit tdc // Find first in range hit from multihit tdc
/*
for(UInt_t thit=0; thit<hit->GetRawTdcHitPos().GetNHits(); thit++) {
cout << " plane = " << hit->fPlane << " pos paddle = " << hit->fCounter << " " << hit->GetRawTdcHitPos().GetTime(thit)<< " hit = " << thit << endl;
}
for(UInt_t thit=0; thit<hit->GetRawTdcHitNeg().GetNHits(); thit++) {
cout << " plane = " << hit->fPlane << " Neg paddle = " << hit->fCounter << " " << hit->GetRawTdcHitNeg().GetTime(thit) << " hit = " << thit << endl;
}
*/
for(UInt_t thit=0; thit<hit->GetRawTdcHitPos().GetNHits(); thit++) { for(UInt_t thit=0; thit<hit->GetRawTdcHitPos().GetNHits(); thit++) {
tdc_pos = hit->GetRawTdcHitPos().GetTime(thit)+fTdcOffset; tdc_pos = hit->GetRawTdcHitPos().GetTime(thit)+fTdcOffset;
if(tdc_pos >= fScinTdcMin && tdc_pos <= fScinTdcMax) { if(tdc_pos >= fScinTdcMin && tdc_pos <= fScinTdcMax) {
...@@ -617,6 +630,14 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -617,6 +630,14 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
new( (*fHodoHits)[fNScinHits]) THcHodoHit(tdc_pos, tdc_neg, new( (*fHodoHits)[fNScinHits]) THcHodoHit(tdc_pos, tdc_neg,
adc_pos, adc_neg, adc_pos, adc_neg,
hit->fCounter, this); hit->fCounter, this);
Double_t adc_peak=hit->GetRawAdcHitPos().GetPulseAmp();
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetPosADCpeak(adc_peak);
adc_peak=hit->GetRawAdcHitNeg().GetPulseAmp();
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetNegADCpeak(adc_peak);
Double_t time_peak=hit->GetRawAdcHitPos().GetPulseTimeRaw();
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetPosADCtime(time_peak);
time_peak=hit->GetRawAdcHitNeg().GetPulseTimeRaw();
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetNegADCtime(time_peak);
// Do corrections if valid TDC on both ends of bar // Do corrections if valid TDC on both ends of bar
if(btdcraw_pos && btdcraw_neg) { if(btdcraw_pos && btdcraw_neg) {
...@@ -664,6 +685,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -664,6 +685,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
negtime = negtime-(fZpos+(index%2)*fDzpos)/(29.979*fBetaNominal); negtime = negtime-(fZpos+(index%2)*fDzpos)/(29.979*fBetaNominal);
} }
// cout << fNScinHits<< " " << timec_pos << " " << timec_neg << endl; // cout << fNScinHits<< " " << timec_pos << " " << timec_neg << endl;
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetPaddleCenter(fPosCenter[index]);
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetCorrectedTimes(timec_pos,timec_neg, ((THcHodoHit*) fHodoHits->At(fNScinHits))->SetCorrectedTimes(timec_pos,timec_neg,
postime, negtime, postime, negtime,
scin_corrected_time); scin_corrected_time);
...@@ -693,6 +715,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit) ...@@ -693,6 +715,7 @@ Int_t THcScintillatorPlane::ProcessHits(TClonesArray* rawhits, Int_t nexthit)
- fHodoNegTimeOffset[index]; - fHodoNegTimeOffset[index];
} }
} }
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetPaddleCenter(fPosCenter[index]);
((THcHodoHit*) fHodoHits->At(fNScinHits))->SetCorrectedTimes(timec_pos,timec_neg, ((THcHodoHit*) fHodoHits->At(fNScinHits))->SetCorrectedTimes(timec_pos,timec_neg,
timec_pos,timec_neg, timec_pos,timec_neg,
0.0); 0.0);
......
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