Skip to content
Snippets Groups Projects
Commit 2a597ecc authored by Stephen A. Wood's avatar Stephen A. Wood Committed by Mark K Jones
Browse files

Suppress missing ref time messages for THcTrigDet when not expected.

  To do this suppression, a trigger detector object needs to know the
  name of spectrometer it is associated with.  By default it will get
  this name from the first character of the it's own name.  This can
  be overridden with the SetSpectName method.
parent e2c0eb6f
No related branches found
No related tags found
No related merge requests found
......@@ -129,7 +129,11 @@ THcTrigDet::THcTrigDet(
fAdcPedRaw(), fAdcPulseIntRaw(), fAdcPulseAmpRaw(), fAdcPulseTimeRaw(),
fAdcPed(), fAdcPulseInt(), fAdcPulseAmp(), fAdcPulseTime(),
fTdcMultiplicity(), fAdcMultiplicity()
{}
{
// Guess at spectrometer name that this trigger detector is associated with
// Can override with SetSpectName
fSpectName = name[0];
}
THcTrigDet::~THcTrigDet() {}
......@@ -178,6 +182,12 @@ THaAnalysisObject::EStatus THcTrigDet::Init(const TDatime& date) {
// printf(" Init trig det hitlist\n");
InitHitList(fDetMap, "THcTrigRawHit", 100);
fPresentP = 0;
THaVar* vpresent = gHaVars->Find(Form("%s.present",fSpectName.Data()));
if(vpresent) {
fPresentP = (Bool_t *) vpresent->GetValuePointer();
}
fStatus = kOK;
return fStatus;
}
......@@ -208,7 +218,11 @@ void THcTrigDet::Clear(Option_t* opt) {
Int_t THcTrigDet::Decode(const THaEvData& evData) {
// Decode raw data for this event.
Int_t numHits = DecodeToHitList(evData);
Bool_t present = kTRUE; // Suppress reference time warnings
if(fPresentP) { // if this spectrometer not part of trigger
present = *fPresentP;
}
Int_t numHits = DecodeToHitList(evData, !present);
// Process each hit and fill variables.
Int_t iHit = 0;
......@@ -426,6 +440,11 @@ Int_t THcTrigDet::DefineVariables(THaAnalysisObject::EMode mode) {
return DefineVarsFromList(vars.data(), mode);
}
void THcTrigDet::SetSpectName( const char* name)
{
fSpectName = name;
}
ClassImp(THcTrigDet)
......@@ -26,6 +26,8 @@ class THcTrigDet : public THaDetector, public THcHitList {
virtual void Clear(Option_t* opt="");
Int_t Decode(const THaEvData& evData);
virtual void SetSpectName( const char* name);
protected:
void Setup(const char* name, const char* description);
virtual Int_t ReadDatabase(const TDatime& date);
......@@ -62,6 +64,9 @@ class THcTrigDet : public THaDetector, public THcHitList {
Int_t fTdcMultiplicity[fMaxTdcChannels];
Int_t fAdcMultiplicity[fMaxAdcChannels];
TString fSpectName;
Bool_t* fPresentP;
private:
THcTrigDet();
ClassDef(THcTrigDet, 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