10 #include "Database/cxx/include/Table.h" 24 fInitializedData(false), fInitializedMC(false)
42 auto it = recs.find(diblock);
43 if(
it == recs.end())
return -1;
79 const char* ups_path =
getenv(
"CALIBCSVS_CSV_PATH");
82 const char* mcStr = isData ?
"data" :
"mc";
87 detStr, mcStr,
fTag.c_str()).Data();
95 ups_path,
fTag.c_str(), detStr,
101 ups_path,
fTag.c_str(),
102 detStr, mcStr,
fTag.c_str()).Data();
105 ups_path,
fTag.c_str(), detStr, mcStr,
111 mf::LogInfo(
"AbsCache") <<
"Loading absolute cache from " 116 ok = ok && tblConsts.
Load();
121 mf::LogError(
"AbsCache") <<
"Unable to load absolute tables. Aborting" 124 std::cerr <<
"Unable to load absolute tables. Aborting" 130 const int meuErrCol = tblConsts.
GetColIndex(
"meu_err");
131 const int meuGeVCol = tblConsts.
GetColIndex(
"meu_gev");
133 const int Nconsts = tblConsts.
NRow();
134 for(
int nconsts = 0; nconsts < Nconsts; ++nconsts){
141 ok = ok && row->
Col(meuCol).
Get(rec.
meu);
void SetTag(std::string s)
static std::string GetName(int id)
void GetEpochFromDB(int idet, bool isData)
int LoadFromCSV(std::string fname, int offset=0, int limit=-1)
diblock
print "ROW IS " print row
Column & Col(int i)
Find index of column with name. Suitable for passing to Col.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
caf::StandardRecord * rec
void LoadFromVldDatabase(novadaq::cnv::DetId det, bool isData)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
std::string getCSVFilenameByParsingDirectory(int fCurrentRun, std::string prePattern, std::string postPattern)
int GetColIndex(std::string cname)
void SetDataTypeMask(int mask)
void SetMinTSVld(time_t t)
std::string getenv(std::string const &name)
bool SetDetector(std::string det)
double GetPECorrToGeVScale(novadaq::cnv::DetId det, int diblock, bool isData)
std::map< int, Record > fRecordsData
Map is from diblock number.
const char * getDetString(novadaq::cnv::DetId det)
Utility function to get detector name as a string for file manipulations.
void SetMaxTSVld(time_t t)
unsigned long long Channel()
assert(nhit_max >=nhit_nbins)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
std::map< int, Record > fRecordsMC
Map is from diblock number.
bool fInitializedData
Whether we have (attempted to) read from db or csv yet.