25static const char*
NOTINIT =
"uninitialized run";
43 , fDataRequired(kDate)
59 , fNumber(rhs.fNumber)
62 , fEvtRange{rhs.fEvtRange[0], rhs.fEvtRange[1]}
63 , fNumAnalyzed(rhs.fNumAnalyzed)
64 , fDBRead(rhs.fDBRead)
65 , fIsInit(rhs.fIsInit)
67 , fAssumeDate(rhs.fAssumeDate)
68 , fDataSet(rhs.fDataSet)
69 , fDataRead(rhs.fDataRead)
70 , fDataRequired(rhs.fDataRequired)
72 , fRunParamClass(rhs.fRunParamClass)
73 , fDataVersion(rhs.fDataVersion)
135 static const char*
const here =
"THaRunBase::Update";
156 for(
int i=0; i<
fParam->GetPrescales().GetSize(); i++) {
159 Error(
here,
"Failed to decode prescale factor for trigger %d. "
160 "Check raw data file for format errors.", i );
163 fParam->Prescales()[i] = psfact;
168#define CFGEVT1 Decoder::DAQCONFIG_FILE1
169#define CFGEVT2 Decoder::DAQCONFIG_FILE2
174 Warning(
here,
"Failed to decode DAQ config info from event type %u",
232 bool doing_init = (sopt.
Contains(
"INIT"));
280 if (
this == obj)
return 0;
281 const auto *rhs =
dynamic_cast<const THaRunBase*
>(obj);
282 if( !rhs )
return -1;
283 if ( fNumber < rhs->
fNumber )
return -1;
284 else if (
fNumber > rhs->fNumber )
return 1;
311 static const char*
const here =
"THaRunBase::Init";
316 TClass* cl = TClass::GetClass(s);
318 Error(
here,
"Run parameter class \"%s\" not "
319 "available. Load library or fix configuration.", s?s:
"" );
323 Error(
here,
"Class \"%s\" is not a run parameter class.", s );
330 Error(
here,
"Unexpected error creating run parameter object "
331 "\"%s\". Call expert.", s );
355 vector<TString> errmsg = {
"run date",
"run number",
"run type",
356 "prescale factors",
"DAQ info" };
357 TString errtxt(
"Missing run parameters: ");
359 for(
auto& msg : errmsg ) {
368 errtxt +=
". Run not initialized.";
397 cout <<
"\"" <<
GetName() <<
"\"";
399 cout <<
" \"" <<
GetTitle() <<
"\"";
405 cout <<
" \"" <<
GetTitle() <<
"\"";
407 cout <<
"Run number: " <<
fNumber << endl;
410 cout <<
"Requested event range: ";
422 cout <<
"Database read: " <<
fDBRead << endl;
423 cout <<
"Initialized: " <<
fIsInit << endl;
424 cout <<
"Opened: " <<
fOpened << endl;
425 cout <<
"Date set/read/req: "
428 cout <<
"Run num set/read/req: "
431 cout <<
"Run type set/read/req: "
434 cout <<
"Prescales set/rd/req: "
437 cout <<
"DAQInfo set/rd/req: "
454 static const char*
const here =
"ReadDatabase";
457 Error(
here,
"No run parameter object defined!?! "
458 "Something is very wrong." );
462 if(
fDate == undef ) {
463 Error(
here,
"Run date undefined. Cannot read database without a date." );
469 Error(
here,
"Failed to read run database, error = %d. "
470 "Cannot continue. Check for typos and ill-formed lines.", st);
489 Error(
"ReadInitInfo",
"Run date not set." );
499 if(
fDate != date ) {
536 Warning(
"THaRunBase::SetDataRequired",
"Illegal bit(s) 0x%x in bitmask "
537 "argument ignored. See EInfoType.", (
mask & ~all_info) );
609 return ifo->strings.size();
615 static const string nullstr;
617 if( !ifo || i >= ifo->strings.size() )
619 return ifo->strings[i];
625 static const string nullstr;
629 const auto&
keyval = ifo->keyval;
630 auto it =
keyval.find(key);
std::map< std::string, std::string > keyval
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 mask
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 const char * NOTINIT
static const int UNDEFDATE
static const char * DEFRUNPARAM
static constexpr UInt_t DEFEVTRANGE[2]
static const char *const here
char * Form(const char *fmt,...)
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Bool_t InheritsFrom(const char *cl) const override
const char * AsString() const
Bool_t IsPrescaleEvent() const
virtual UInt_t GetPrescaleFactor(UInt_t) const
Bool_t IsPrestartEvent() const
TObject * GetExtra() const
ULong64_t GetRunTime() const
UInt_t GetRunType() const
Bool_t Contains(const std::string &token) const
virtual Int_t Update(const THaEvData *evdata)
THaRunBase(const char *description="")
virtual Int_t ReadInitInfo(Int_t level=0)
virtual Int_t ReadDatabase()
const std::string & GetDAQConfig(size_t i) const
void SetDataRequired(UInt_t mask)
virtual Bool_t HasInfoRead(UInt_t bits) const
virtual bool operator>(const THaRunBase &) const
virtual void SetType(UInt_t type)
size_t GetNConfig() const
virtual void Print(Option_t *opt="") const
virtual bool operator!=(const THaRunBase &) const
virtual bool operator==(const THaRunBase &) const
virtual void SetNumber(UInt_t number)
std::unique_ptr< THaRunParameters > fParam
void SetLastEvent(UInt_t n)
void SetRunParamClass(const char *classname)
virtual bool operator<(const THaRunBase &) const
virtual Bool_t IsOpen() const
void SetFirstEvent(UInt_t n)
const std::string & GetDAQInfo(const std::string &key) const
virtual THaRunBase & operator=(const THaRunBase &rhs)
virtual Int_t SetDataVersion(Int_t version)
void SetEventRange(UInt_t first, UInt_t last)
virtual void Clear(Option_t *opt="")
virtual Int_t Compare(const TObject *obj) const
virtual bool operator<=(const THaRunBase &) const
virtual bool operator>=(const THaRunBase &) const
virtual void SetDate(const TDatime &date)
virtual Bool_t HasInfo(UInt_t bits) const
const char * GetName() const override
const char * GetTitle() const override
virtual void SetName(const char *name)
TClass * IsA() const override
TNamed & operator=(const TNamed &rhs)
virtual TObject * Clone(const char *newname="") const
virtual void Warning(const char *method, const char *msgfmt,...) const
virtual void Error(const char *method, const char *msgfmt,...) const
const char * Data() const