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

THcHitlist finds THcConfigEvtHandler (Event 125) by type instead of name.

  The Event handler can now be given any name.
    (Only one THcConfigEvtHandler should be instatiated.)
  Also:
     THcConfigEventHandler clears CrateInfoMap on Init.
     THcHitList caches FADC config on first event
parent af83fe85
No related branches found
No related tags found
No related merge requests found
...@@ -354,6 +354,8 @@ THaAnalysisObject::EStatus THcConfigEvtHandler::Init(const TDatime& date) ...@@ -354,6 +354,8 @@ THaAnalysisObject::EStatus THcConfigEvtHandler::Init(const TDatime& date)
eventtypes.push_back(125); // what events to look for eventtypes.push_back(125); // what events to look for
} }
CrateInfoMap.clear();
fStatus = kOK; fStatus = kOK;
return kOK; return kOK;
} }
......
...@@ -118,10 +118,21 @@ void THcHitList::InitHitList(THaDetMap* detmap, ...@@ -118,10 +118,21 @@ void THcHitList::InitHitList(THaDetMap* detmap,
} }
} }
fPSE125 = static_cast<THcConfigEvtHandler*>(gHaEvtHandlers->FindObject("HC")); // Find the Event 125 handler
if (!fPSE125) { TObjLink *lnk = gHaEvtHandlers->FirstLink();
while (lnk) {
if(strcmp(lnk->GetObject()->ClassName(),"THcConfigEvtHandler")==0) {
break;
}
lnk = lnk->Next();
}
if(lnk) {
fPSE125 = static_cast<THcConfigEvtHandler*>(lnk->GetObject());
} else {
cout << "THcHitList::InitHitList : Prestart event 125 not found." << endl; cout << "THcHitList::InitHitList : Prestart event 125 not found." << endl;
fPSE125 = 0;
} }
fHaveFADCInfo = kFALSE;
} }
/** /**
...@@ -259,12 +270,15 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni ...@@ -259,12 +270,15 @@ Int_t THcHitList::DecodeToHitList( const THaEvData& evdata, Bool_t suppresswarni
} }
} else { // This is a Flash ADC } else { // This is a Flash ADC
if (fPSE125) { // Set F250 parameters. if (fPSE125) {
rawhit->SetF250Params( if(!fHaveFADCInfo) {
fPSE125->GetNSA(d->crate), fNSA = fPSE125->GetNSA(d->crate);
fPSE125->GetNSB(d->crate), fNSB = fPSE125->GetNSB(d->crate);
fPSE125->GetNPED(d->crate) fNPED = fPSE125->GetNPED(d->crate);
); fHaveFADCInfo = kTRUE;
}
// Set F250 parameters.
rawhit->SetF250Params(fNSA, fNSB, fNPED);
} }
// Copy the samples // Copy the samples
......
...@@ -60,6 +60,10 @@ protected: ...@@ -60,6 +60,10 @@ protected:
THcRawHit::ESignalType *fSignalTypes; THcRawHit::ESignalType *fSignalTypes;
THcConfigEvtHandler* fPSE125; THcConfigEvtHandler* fPSE125;
Bool_t fHaveFADCInfo;
Int_t fNSA;
Int_t fNSB;
Int_t fNPED;
ClassDef(THcHitList,0); // List of raw hits sorted by plane, counter ClassDef(THcHitList,0); // List of raw hits sorted by plane, counter
}; };
......
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