2#include "macro/run/run_raw_bmn.C"
20 Bool_t isRewriteMeta =
false,
24 gSystem->ExpandPathName(input_raw_file);
26 if (error_log_file !=
"") {
28 gSystem->ExpandPathName(error_log_file);
32 if (
gSystem->AccessPathName(input_raw_file.
Data()) ==
true) {
34 cout << endl << message << endl;
39 Long_t raw_id, raw_flags, raw_modtime;
41 gSystem->GetPathInfo(input_raw_file.
Data(), &raw_id, &raw_file_size, &raw_flags, &raw_modtime);
42 if (raw_file_size <= 0) {
44 cout << endl << message << endl;
62 run_raw_bmn(input_raw_file,
"", 0, period, 2,
kTRUE);
67 TString raw_root_file = gRawRootFilePath;
68 if (gRawRootFilePath ==
"") {
70 TString::Format(
"ERROR: decoder failed while creating a RAW ROOT file for: %s", input_raw_file.
Data());
71 cout << endl << message << endl;
78 Long_t root_id, root_flags, root_modtime;
80 gSystem->GetPathInfo(raw_root_file.
Data(), &root_id, &root_file_size, &root_flags, &root_modtime);
81 if (root_file_size <= 0) {
83 cout << endl << message << endl;
91 tree->
Add(raw_root_file);
99 if (event_count < 1) {
100 cout << endl <<
"ERROR: File '" << raw_root_file <<
"' has no events" << endl;
107 Int_t run_number = fEventHeader->GetRunId();
117 cout <<
"Event number interval: " << start_event <<
" - " << end_event << endl;
118 cout <<
"Event time interval: " << startTime.
AsString() <<
" - " << endTime.
AsString() << endl;
119 cout <<
"Event count: " << event_count << endl;
124 if (arrRawFiles ==
nullptr) {
125 cout << endl <<
"ERROR: no raw files found to rewrite the file metadata" << endl;
129 cout << endl <<
"ERROR: more than one raw files found to rewrite the file metadata" << endl;
136 bool isErrors =
false;
155 if (strFileHash !=
"") {
159 cout <<
"WARNING: a problem occured while file checksum calculation: " << raw_root_file << endl;
164 cout <<
"The errors occured during raw file " << run_number <<
":" << run_number <<
" " << start_event
165 <<
"-" << end_event <<
" info update" << endl;
167 cout <<
"Info for raw file " << run_number <<
":" << run_number <<
" " << start_event <<
"-"
168 << end_event <<
" updated" << endl;
183 logFile.open(log_name, ofstream::out | ofstream::app);
184 if (!logFile.is_open()) {
185 cout <<
"ERROR: log file could not be opened: " << log_name << endl;
189 logFile << message << endl;
#define R__ADD_INCLUDE_PATH(PATH)
R__EXTERN TSystem * gSystem
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
Long64_t GetEntries() const override
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
Int_t GetEntries() const override
TObject * At(Int_t idx) const override
const char * Data() const
static TString Format(const char *fmt,...)
UInt_t GetTime(Bool_t inUTC=kTRUE, Int_t secOffset=0, UInt_t *hour=nullptr, UInt_t *min=nullptr, UInt_t *sec=nullptr) const
const char * AsString(const Option_t *option="") const
UInt_t GetDate(Bool_t inUTC=kTRUE, Int_t secOffset=0, UInt_t *year=nullptr, UInt_t *month=nullptr, UInt_t *day=nullptr) const
/home/soul/bmnroot/database/uni_db1/UniRawFile.h Class for the table: raw_file
int SetFileSize(int64_t file_size)
set file size of the current raw file
int SetEndDatetime(TDatime end_datetime)
set end datetime of the current raw file
int SetFileHash(TString *file_hash)
set file hash of the current raw file
int SetEventCount(int event_count)
set event count of the current raw file
int SetStartDatetime(TDatime start_datetime)
set start datetime of the current raw file
int SetStartEvent(int start_event)
set start event of the current raw file
int SetEndEvent(int end_event)
set end event of the current raw file
int SetFilePath(TString file_path)
set file path of the current raw file
static TObjArray * GetRawFiles(int period_number, int run_number)
get array of raw files (UniRawFile*) corresponding to the period:run number ordered by start_event as...
static TString CalculateFileHash(TString file_path)
calculate and return (in hex string format) cheŃksum for a given file use Adler32 algorithm if zlib l...
void write_raw_info(TString input_raw_file, UInt_t period=9, Bool_t isRewriteMeta=false, TString error_log_file="")
int append_log(TString log_name, TString message)
Appends a message to a log file.