Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jlab/hallc/analyzer_software/hcana
  • whit/hcana
2 results
Show changes
Showing
with 2129 additions and 1373 deletions
......@@ -73,6 +73,7 @@ protected:
Int_t slot;
Int_t channel;
Int_t reftime;
Int_t refdifftime;
};
std::vector<RefIndexMap> fRefIndexMaps;
// Should this be a sparse list instead in case user
......
......@@ -34,6 +34,9 @@ public:
Double_t GetNegADCpeak() const { return fNegADC_Peak; }
Double_t GetPosADCtime() const { return fPosADC_Time; }
Double_t GetNegADCtime() const { return fNegADC_Time; }
Double_t GetPosADCCorrtime() const { return fPosADC_CorrTime; }
Double_t GetNegADCCorrtime() const { return fNegADC_CorrTime; }
Double_t GetCalcPosition() const { return fCalcPosition; }
Int_t GetPosTDC() const { return fPosTDC; }
Int_t GetNegTDC() const { return fNegTDC; }
Double_t GetPosCorrectedTime() const { return fPosCorrectedTime;}
......@@ -46,8 +49,9 @@ public:
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) {
fPosCorrectedTime = pos; fNegCorrectedTime = neg;
fHasCorrectedTimes = kFALSE;
}
void SetCorrectedTimes(Double_t pos, Double_t neg,
Double_t postof, Double_t negtof,
......@@ -75,6 +79,15 @@ public:
void SetNegADCtime( Double_t ptime) {
fNegADC_Time =ptime;
}
void SetPosADCCorrtime( Double_t ptime) {
fPosADC_CorrTime =ptime;
}
void SetNegADCCorrtime( Double_t ptime) {
fNegADC_CorrTime =ptime;
}
void SetCalcPosition( Double_t calcpos) {
fCalcPosition =calcpos;
}
protected:
static const Double_t kBig; //!
......@@ -86,6 +99,9 @@ protected:
Double_t fNegADC_Peak; // ADC peak amplitude
Double_t fPosADC_Time; // ADC time
Double_t fNegADC_Time; // ADC time
Double_t fPosADC_CorrTime; // ADC time
Double_t fNegADC_CorrTime; // ADC time
Double_t fCalcPosition; // Position along paddle calculated by time diff
Int_t fPaddleNumber;
Double_t fPosCorrectedTime; // Pulse height corrected time
......
This diff is collapsed.
......@@ -76,11 +76,14 @@ public:
virtual Int_t FineProcess( TClonesArray& tracks );
virtual Int_t End(THaRunBase* run=0);
Double_t DetermineTimePeak(Int_t FillFlag);
void EstimateFocalPlaneTime(void);
void OriginalTrackEffTest(void);
void TrackEffTest(void);
void CalcCluster(void);
virtual Int_t ApplyCorrections( void );
Double_t GetStartTime() const { return fStartTime; }
Double_t GetOffsetTime() const { return fOffsetTime; }
Bool_t IsStartTimeGood() const {return fGoodStartTime;};
Int_t GetNfptimes() const {return fNfptimes;};
Int_t GetScinIndex(Int_t nPlane, Int_t nPaddle);
......@@ -192,12 +195,19 @@ protected:
Bool_t fSHMS;
Bool_t fGoodStartTime;
Double_t fStartTime;
Double_t fADCStartTime;
Double_t fOffsetTime;
Double_t fFPTimeAll;
Int_t fNfptimes;
Bool_t* fPresentP;
Double_t fTimeHist_Peak;
Double_t fTimeHist_Sigma;
Double_t fTimeHist_Hits;
Double_t fTimeHist_StartTime_NumPeaks;
Double_t fTimeHist_StartTime_Peak;
Double_t fTimeHist_StartTime_Sigma;
Double_t fTimeHist_StartTime_Hits;
Double_t fTimeHist_FpTime_NumPeaks;
Double_t fTimeHist_FpTime_Peak;
Double_t fTimeHist_FpTime_Sigma;
Double_t fTimeHist_FpTime_Hits;
Double_t fBeta;
......@@ -207,7 +217,7 @@ protected:
// Potential Hall C parameters. Mostly here for demonstration
Int_t fNPlanes; // Number of planes
UInt_t fMaxScinPerPlane,fMaxHodoScin; // max number of scin/plane; product of the first two
UInt_t fMaxScinPerPlane,fMaxHodoScin,fTotHodScin; // max number of scin/plane; product of the first two
Double_t fStartTimeCenter, fStartTimeSlop, fScinTdcToTime;
Double_t fTofTolerance;
Int_t fCosmicFlag; //
......@@ -216,6 +226,7 @@ protected:
Double_t fScinTdcMin, fScinTdcMax; // min and max TDC values
char** fPlaneNames;
UInt_t* fNPaddle; // Number of paddles per plane
Int_t fTrackBetaIncludeSinglePmtHits;
Double_t *fHodoNegAdcTimeWindowMin;
Double_t *fHodoNegAdcTimeWindowMax;
......@@ -265,6 +276,7 @@ protected:
Int_t fCheckEvent;
Int_t fEventType;
Int_t fEventNum;
Int_t fGoodTrack;
Double_t fScin2XZpos;
......@@ -407,6 +419,10 @@ protected:
std::vector<Int_t > fNClust; // # scins clusters for the plane
std::vector<std::vector<Int_t> > fClustSize; // # scin cluster size
std::vector<std::vector<Double_t> > fClustPos; // # scin cluster position
std::vector<Int_t > fNCluster; // # scins clusters for the plane
std::vector<std::vector<Int_t> > fClusterSize; // # scin cluster size
std::vector<std::vector<Double_t> > fClusterXPos; // # scin cluster position
std::vector<std::vector<Double_t> > fClusterYPos; // # scin cluster position
std::vector<Int_t > fThreeScin; // # scins three clusters for the plane
std::vector<Int_t > fGoodScinHitsX; // # hits in fid x range
// Could combine the above into a structure
......
This diff is collapsed.
......@@ -258,6 +258,10 @@ void THcRawAdcHit::SetRefTime(Int_t refTime) {
fHasRefTime = kTRUE;
}
void THcRawAdcHit::SetRefDiffTime(Int_t refDiffTime) {
fRefDiffTime = refDiffTime;
}
void THcRawAdcHit::SetSample(Int_t data) {
if (fNSamples >= fMaxNSamples) {
// throw std::out_of_range("`THcRawAdcHit::SetSample`: too many samples!");
......@@ -481,6 +485,22 @@ Int_t THcRawAdcHit::GetRefTime() const {
}
}
Bool_t THcRawAdcHit::HasRefTime() const { return fHasRefTime; }
Int_t THcRawAdcHit::GetRefDiffTime() const {
if (fHasRefTime) {
return fRefDiffTime;
}
else {
TString msg = TString::Format(
"`THcRawAdcHit::GetRefTime`: Reference time not available!"
);
throw std::runtime_error(msg.Data());
}
}
Bool_t THcRawAdcHit::HasRefTime() const {
return fHasRefTime;
}
ClassImp(THcRawAdcHit)
......@@ -16,12 +16,14 @@ class THcRawAdcHit : public podd2::HitLogging<TObject> {
void SetData(Int_t data);
void SetSample(Int_t data);
void SetRefTime(Int_t refTime);
void SetRefDiffTime(Int_t refDiffTime);
void SetDataTimePedestalPeak(
Int_t data, Int_t time, Int_t pedestal, Int_t peak
);
Int_t GetRawData(UInt_t iPulse=0) const;
Double_t GetF250_PeakPedestalRatio() {return fPeakPedestalRatio;};
Int_t GetF250_NPedestalSamples() {return fNPedestalSamples;};
Double_t GetAverage(UInt_t iSampleLow, UInt_t iSampleHigh) const;
Int_t GetIntegral(UInt_t iSampleLow, UInt_t iSampleHigh) const;
......@@ -41,6 +43,7 @@ class THcRawAdcHit : public podd2::HitLogging<TObject> {
Int_t GetPulseTimeRaw(UInt_t iPulse=0) const;
Int_t GetSampleRaw(UInt_t iSample=0) const;
Int_t GetRefTime() const;
Int_t GetRefDiffTime() const;
Double_t GetPed() const;
Double_t GetPulseInt(UInt_t iPulse=0) const;
......@@ -82,6 +85,7 @@ class THcRawAdcHit : public podd2::HitLogging<TObject> {
Int_t fPulseTime[fMaxNPulses];
Int_t fSample[fMaxNSamples]; // the big buffer
Int_t fRefTime;
Int_t fRefDiffTime;
Bool_t fHasMulti;
Bool_t fHasRefTime;
......
......@@ -59,6 +59,17 @@ void THcRawDCHit::SetReference(Int_t signal, Int_t reference) {
}
}
void THcRawDCHit::SetReferenceDiff(Int_t signal, Int_t reference) {
if (signal == 0) {
fTdcHit.SetRefDiffTime(reference);
}
else {
throw std::out_of_range(
"`THcRawDCHit::SetReference`: only signal `0` available!"
);
}
}
Int_t THcRawDCHit::GetData(Int_t signal) {
if (signal == 0) {
......@@ -95,6 +106,17 @@ Int_t THcRawDCHit::GetReference(Int_t signal) {
}
}
Int_t THcRawDCHit::GetReferenceDiff(Int_t signal) {
if (signal == 0) {
return fTdcHit.GetRefDiffTime();
}
else {
throw std::out_of_range(
"`THcRawDCHit::GetReference`: only signal `0` available!"
);
}
}
THcRawHit::ESignalType THcRawDCHit::GetSignalType(Int_t signal) {
if (signal == 0) {
......
......@@ -18,10 +18,12 @@ class THcRawDCHit : public THcRawHit {
virtual void SetData(Int_t signal, Int_t data);
virtual void SetReference(Int_t signal, Int_t reference);
virtual void SetReferenceDiff(Int_t signal, Int_t reference);
virtual Int_t GetData(Int_t signal);
virtual Int_t GetRawData(Int_t signal);
virtual Int_t GetReference(Int_t signal);
virtual Int_t GetReferenceDiff(Int_t signal);
virtual ESignalType GetSignalType(Int_t signal);
virtual Int_t GetNSignals();
......
......@@ -29,20 +29,21 @@ public:
// virtual Bool_t operator==( const THcRawHit& ) = 0;
// virtual Bool_t operator!=( const THcRawHit& ) = 0;
virtual void SetData(Int_t signal, Int_t data) {};
virtual void SetSample(Int_t signal, Int_t data) {};
virtual void SetDataTimePedestalPeak(Int_t signal, Int_t data,
Int_t time, Int_t pedestal, Int_t peak) {};
virtual Int_t GetData(Int_t signal) {return 0;}; /* Ref time subtracted */
virtual Int_t GetRawData(Int_t signal) {return 0;} /* Ref time not subtracted */
virtual ESignalType GetSignalType(Int_t signal) {return kUndefined;}
virtual void SetData(Int_t /* signal */, Int_t /* data */) {};
virtual void SetSample(Int_t /* signal */, Int_t /* data */) {};
virtual void SetDataTimePedestalPeak(Int_t /* signal */, Int_t /* data */,
Int_t /* time */, Int_t /* pedestal */, Int_t /* peak */) {};
virtual Int_t GetData(Int_t /* signal */) {return 0;}; /* Ref time subtracted */
virtual Int_t GetRawData(Int_t /* signal */) {return 0;} /* Ref time not subtracted */
virtual ESignalType GetSignalType(Int_t /* signal */) {return kUndefined;}
virtual Int_t GetNSignals() { return 1;}
virtual void SetReference(Int_t signal, Int_t reference) {};
virtual void SetReferenceDiff(Int_t signal, Int_t reference) {};
virtual Bool_t HasReference(Int_t signal) {return kFALSE;};
virtual Int_t GetReference(Int_t signal) {return 0;};
virtual void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED) {};
virtual void SetF250Params(Int_t /* NSA */, Int_t /* NSB */, Int_t /* NPED */) {};
// Derived objects must be sortable and supply Compare method
// virtual Bool_t IsSortable () const {return kFALSE; }
......
......@@ -105,6 +105,18 @@ void THcRawHodoHit::SetReference(Int_t signal, Int_t reference) {
}
}
void THcRawHodoHit::SetReferenceDiff(Int_t signal, Int_t referenceDiff) {
if (signal < fNAdcSignals) {
fAdcHits[signal].SetRefDiffTime(referenceDiff);
} else if (signal < fNAdcSignals+fNTdcSignals) {
fTdcHits[signal-fNAdcSignals].SetRefDiffTime(referenceDiff);
} else {
throw std::out_of_range(
"`THcRawHodoHit::SetReference`: only signals `2` and `3` available!"
);
}
}
Int_t THcRawHodoHit::GetData(Int_t signal) {
if (0 <= signal && signal < fNAdcSignals) {
......@@ -147,6 +159,17 @@ Int_t THcRawHodoHit::GetReference(Int_t signal) {
}
}
Int_t THcRawHodoHit::GetReferenceDiff(Int_t signal) {
if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
return fTdcHits[signal-fNAdcSignals].GetRefDiffTime();
}
else {
throw std::out_of_range(
"`THcRawHodoHit::GetReference`: only signals `2` and `3` available!"
);
}
}
THcRawHit::ESignalType THcRawHodoHit::GetSignalType(Int_t signal) {
if (0 <= signal && signal < fNAdcSignals) {
......
......@@ -25,10 +25,12 @@ class THcRawHodoHit : public THcRawHit {
Int_t signal, Int_t data, Int_t time, Int_t pedestal, Int_t peak
);
virtual void SetReference(Int_t signal, Int_t reference);
virtual void SetReferenceDiff(Int_t signal, Int_t referenceDiff);
virtual Int_t GetData(Int_t signal);
virtual Int_t GetRawData(Int_t signal);
virtual Int_t GetReference(Int_t signal);
virtual Int_t GetReferenceDiff(Int_t signal);
virtual ESignalType GetSignalType(Int_t signal);
virtual Int_t GetNSignals();
......
......@@ -92,6 +92,16 @@ void THcRawShowerHit::SetReference(Int_t signal, Int_t reference) {
}
}
void THcRawShowerHit::SetReferenceDiff(Int_t signal, Int_t reference) {
if (signal < fNAdcSignals) {
fAdcHits[signal].SetRefDiffTime(reference);
} else {
throw std::out_of_range(
"`THcRawHodoHit::SetReference`: only signals `2` and `3` available!"
);
}
}
Int_t THcRawShowerHit::GetData(Int_t signal) {
if (0 <= signal && signal < fNAdcSignals) {
......
......@@ -22,6 +22,7 @@ class THcRawShowerHit : public THcRawHit {
Int_t signal, Int_t data, Int_t time, Int_t pedestal, Int_t peak
);
virtual void SetReference(Int_t signal, Int_t reference);
virtual void SetReferenceDiff(Int_t signal, Int_t reference);
virtual Int_t GetData(Int_t signal);
virtual Int_t GetRawData(Int_t signal);
......
......@@ -95,6 +95,7 @@ THcRawTdcHit& THcRawTdcHit::operator=(const THcRawTdcHit& right) {
fTime[iHit] = right.fTime[iHit];
}
fRefTime = right.fRefTime;
fRefDiffTime = right.fRefDiffTime;
fHasRefTime = right.fHasRefTime;
fNHits = right.fNHits;
}
......@@ -113,6 +114,7 @@ void THcRawTdcHit::Clear(Option_t* opt) {
fTime[iHit] = 0;
}
fRefTime = 0;
fRefDiffTime = 0;
fHasRefTime = kFALSE;
fNHits = 0;
}
......@@ -138,6 +140,10 @@ void THcRawTdcHit::SetRefTime(Int_t refTime) {
fHasRefTime = kTRUE;
}
void THcRawTdcHit::SetRefDiffTime(Int_t refDiffTime) {
fRefDiffTime = refDiffTime;
}
Int_t THcRawTdcHit::GetTimeRaw(UInt_t iHit) const {
if (iHit < fNHits) {
......@@ -177,6 +183,18 @@ Int_t THcRawTdcHit::GetRefTime() const {
}
}
Int_t THcRawTdcHit::GetRefDiffTime() const {
if (fHasRefTime) {
return fRefDiffTime;
}
else {
TString msg = TString::Format(
"`THcRawTdcHit::GetRefDiffTime`: Reference time not available!"
);
throw std::runtime_error(msg.Data());
}
}
Bool_t THcRawTdcHit::HasRefTime() const {
return fHasRefTime;
......
......@@ -14,10 +14,12 @@ class THcRawTdcHit : public TObject {
void SetTime(Int_t time);
void SetRefTime(Int_t refTime);
void SetRefDiffTime(Int_t refDiffTime);
Int_t GetTimeRaw(UInt_t iHit=0) const;
Int_t GetTime(UInt_t iHit=0) const;
Int_t GetRefTime() const;
Int_t GetRefDiffTime() const;
Bool_t HasRefTime() const;
......@@ -30,6 +32,7 @@ class THcRawTdcHit : public TObject {
Int_t fTime[fMaxNHits];
Int_t fRefTime;
Int_t fRefDiffTime;
Bool_t fHasRefTime;
UInt_t fNHits;
......
This diff is collapsed.
......@@ -59,6 +59,8 @@ public:
Int_t fNumBCMs;
Double_t *fBCM_Gain;
Double_t *fBCM_Offset;
Double_t *fBCM_SatOffset;
Double_t *fBCM_SatQuadratic;
Double_t *fBCM_delta_charge;
Double_t fTotalTime;
Double_t fDeltaTime;
......
This diff is collapsed.
......@@ -63,6 +63,8 @@ class THcScintillatorPlane : public THaSubDetector {
void SetFpTime(Double_t f) {fFptime=f;};
void SetNGoodHits(Int_t ng) {fNGoodHits=ng;};
void SetHitDistance(Double_t f) {fHitDistance=f;}; // Distance between track and hit paddle
void SetScinYPos(Double_t f) {fScinYPos=f;}; // Scint Average Y position at plane (cm)
void SetScinXPos(Double_t f) {fScinXPos=f;}; // Scint Average X position at plane (cm)
void SetTrackXPosition(Double_t f) {fTrackXPosition=f;}; // Distance track X position at plane
void SetTrackYPosition(Double_t f) {fTrackYPosition=f;}; // Distance track Y position at plane
void SetNumberClusters(Int_t nclus) {fNumberClusters=nclus;}; // number of paddle
......@@ -181,7 +183,17 @@ class THcScintillatorPlane : public THaSubDetector {
vector<Double_t> fGoodDiffDistTrack;
Int_t fDebugAdc;
Double_t fPosTdcRefTime;
Double_t fPosAdcRefTime;
Double_t fNegTdcRefTime;
Double_t fNegAdcRefTime;
Double_t fPosTdcRefDiffTime;
Double_t fPosAdcRefDiffTime;
Double_t fNegTdcRefDiffTime;
Double_t fNegAdcRefDiffTime;
Double_t fHitDistance;
Double_t fScinXPos;
Double_t fScinYPos;
Double_t fTrackXPosition;
Double_t fTrackYPosition;
Int_t fCosmicFlag; //
......@@ -272,7 +284,10 @@ class THcScintillatorPlane : public THaSubDetector {
Double_t *fNegPed;
Double_t *fNegSig;
Double_t *fNegThresh;
//
Int_t fEventType;
Int_t fEventNum;
//
Int_t fNScinGoodHits; // number of hits for which both ends of the paddle fired in time!
Double_t fpTime; // the original code only has one fpTime per plane!
......