BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
selecting_records.C
Go to the documentation of this file.
1// macro for ELOG record selection by specified conditions
3{
4 TObjArray arrayConditions;
5 ElogSearchCondition* searchCondition =
7 arrayConditions.Add((TObject*)searchCondition);
10 arrayConditions.Add((TObject*)searchCondition);
11 searchCondition =
13 arrayConditions.Add((TObject*)searchCondition);
14 searchCondition =
16 arrayConditions.Add((TObject*)searchCondition);
17
18 TObjArray* pRecordArray = ElogRecord::Search(arrayConditions);
19
20 // clean memory for conditions after search
21 arrayConditions.Delete();
22
23 // print run numbers and file path with raw data
24 for (int i = 0; i < pRecordArray->GetEntriesFast(); i++) {
25 ElogRecord* pRecord = (ElogRecord*)pRecordArray->At(i);
26 cout << "Record: time - " << pRecord->GetRecordDate().AsSQLString() << ", period - "
27 << (pRecord->GetPeriodNumber() == nullptr ? -1 : *pRecord->GetPeriodNumber()) << ", run - "
28 << (pRecord->GetRunNumber() == nullptr ? -1 : *pRecord->GetRunNumber()) << ", SP-41 field - "
29 << (pRecord->GetSp41() == nullptr ? -1 : *pRecord->GetSp41()) << "A" << endl;
30 }
31
32 // clean memory after work - deleting the array of runs
33 delete pRecordArray;
34
35 cout << "\nMacro finished successfully" << endl;
36}
int i
Definition P4_F32vec4.h:22
ElogRecord.h Class for the table: record_.
Definition ElogRecord.h:20
TDatime GetRecordDate()
get record date of the current record
Definition ElogRecord.h:117
int * GetSp41()
get sp 41 of the current record
Definition ElogRecord.h:161
int * GetRunNumber()
get run number of the current record
Definition ElogRecord.h:137
static TObjArray * Search(const ElogSearchCondition &search_condition)
get ELOG records corresponding to the specified single condition
int * GetPeriodNumber()
get period number of the current record
Definition ElogRecord.h:129
const char * AsSQLString() const
Int_t GetEntriesFast() const
void Delete(Option_t *option="") override
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
void selecting_records()