76 fRunTime(
time(nullptr)),
79 fInstance{fgInstances.FirstNullBit()},
113 ::Error(
"THaEvData::init",
"Error initializing crate map. "
114 "Cannot continue. Fix database.");
118 *
fDebugFile << endl <<
" THaEvData:: Print of Crate Map" << endl;
123 if( ret !=
HED_OK )
return ret;
149#if __cplusplus >= 201402L
150 fBench = make_unique<THaBenchmark>();
208 cerr <<
"SetOrigPS::Warn: PS factors";
209 cerr <<
" originate only from evtype ";
221 answer +=
" Trig Sup evtype ";
224 answer +=
" PS evtype ";
234 const int NW = 16;
const char*
p = cbuff;
235 while(
p<cbuff+nlen ) {
236 cout << dec << setw(4) << setfill(
'0') << (size_t)(
p-cbuff) <<
" ";
238 for(
int i=0; i<NW; i++) {
239 UInt_t c = (i<nelem) ? *(
const unsigned char*)(
p+i) : 0;
240 cout <<
" " << hex << setfill(
'0') << setw(2) <<
c << dec;
241 } cout << setfill(
' ') <<
" ";
242 for(
int i=0; i<NW; i++) {
243 char c = (i<nelem) ? *(
p+i) : (char)0;
244 if(isgraph(
c)||
c==
' ') cout <<
c;
else cout <<
".";
261 ::Error(
"THaEvData::SetDefaultCrateMapName",
"Default crate map name "
262 "must not be empty" );
289#if __cplusplus >= 201402L
297 cout <<
"Initializing crate map " << endl;
310#if __cplusplus >= 201402L
325 if(
fMap->crateUsed(crate) &&
fMap->slotUsed(crate,slot)) {
327 ->define( crate, slot,
fMap->getNchan(crate,slot) );
334 if(
fMap->slotClear(crate,slot) &&
339 ostr <<
"Failed to initialize decoder for crate " << crate <<
" "
340 <<
"slot " << slot <<
". Fix database or call expert.";
341 throw runtime_error(ostr.str());
349 cout <<
"THaEvData::PrintOut() called" << endl;
358 cout <<
"THaEvData: Warning: Crate, slot combination";
359 cout <<
"\nexceeds limits. Cannot print"<<endl;
373 if( !
fMap->crateUsed(crate) || !
fMap->slotUsed(crate, slot) ||
374 !
fMap->slotClear(crate, slot) ) {
379 if( !
fMap->crateUsed(crate) || !
fMap->slotUsed(crate, slot) ) {
393 vector< pair<UInt_t,UInt_t> > to_unset;
394 for(
auto roc :
fMap->GetUsedCrates() ) {
395 for(
auto slot :
fMap->GetUsedSlots(roc) ) {
396 assert(
fMap->slotUsed(roc,slot) );
398 cout <<
"WARNING: No module defined for crate "<<roc<<
" slot "<<slot<<endl;
399 cout <<
"Check db_cratemap.dat for module that is undefined"<<endl;
400 cout <<
"This crate, slot will be ignored"<<endl;
404 to_unset.emplace_back(roc, slot);
408 for(
const auto& cs : to_unset )
409 fMap->setUnused(cs.first, cs.second);
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
static constexpr auto MAXROCSLOT
char * Form(const char *fmt,...)
void ResetBitNumber(UInt_t bitnumber)
void ResetAllBits(Bool_t value=kFALSE)
void SetBitNumber(UInt_t bitnumber, Bool_t value=kTRUE)
std::ofstream * fDebugFile
virtual Int_t init_slotdata()
void SetDebug(Int_t level)
std::vector< UShort_t > fSlotClear
void SetVerbose(Int_t level)
UInt_t idx(UInt_t crate, UInt_t slot) const
void EnableScalers(Bool_t enable=true)
std::vector< std::unique_ptr< Decoder::THaSlotData > > crateslot
virtual void PrintOut() const
std::unique_ptr< Decoder::THaCrateMap > fMap
virtual void FindUsedSlots()
std::unique_ptr< THaBenchmark > fBench
static void hexdump(const char *cbuff, size_t len)
virtual void SetRunTime(ULong64_t tloc)
void EnablePrescanMode(Bool_t enable=true)
void SetRunInfo(UInt_t num, UInt_t type, ULong64_t tloc)
std::vector< UShort_t > fSlotUsed
static const Double_t kBig
static void SetDefaultCrateMapName(const char *name)
virtual Int_t SetDataVersion(Int_t version)
void SetCrateMapName(const char *name)
virtual void PrintSlotData(UInt_t crate, UInt_t slot) const
void EnableHelicity(Bool_t enable=true)
void SetOrigPS(Int_t event_type)
void EnableBenchmarks(Bool_t enable=true)
virtual void makeidx(UInt_t crate, UInt_t slot)
static Bool_t fgAllowUnimpl
static TString fgDefaultCrateMapName
TString GetOrigPS() const
ULong64_t GetRunTime() const
virtual Decoder::Module * GetModule(UInt_t roc, UInt_t slot) const
virtual Int_t init_cmap()
Bool_t GoodIndex(UInt_t crate, UInt_t slot) const
const char * DevType(UInt_t crate, UInt_t slot) const
virtual void Error(const char *method, const char *msgfmt,...) const
TString & Append(char c, Ssiz_t rep=1)
unsigned long long ULong64_t
static const UInt_t PRESCALE_EVTYPE
static const UInt_t MAXSLOT
static const UInt_t EPICS_EVTYPE
static const UInt_t TS_PRESCALE_EVTYPE
static const UInt_t MAXROC
Double_t Min(Double_t a, Double_t b)