|
20 | 20 | #include "DataFormatsCTP/Scalers.h" |
21 | 21 | #include "DataFormatsCTP/Configuration.h" |
22 | 22 | #include "DataFormatsParameters/GRPMagField.h" |
| 23 | +#include "DataFormatsParameters/GRPECSObject.h" |
23 | 24 | #include "CommonTypes/Units.h" |
24 | 25 | #include <boost/program_options.hpp> |
25 | 26 |
|
@@ -64,6 +65,17 @@ void writeBFieldToFile(float b) |
64 | 65 | fclose(fptr); |
65 | 66 | } |
66 | 67 |
|
| 68 | +void writeDetListToFile(std::string detList) |
| 69 | +{ |
| 70 | + FILE* fptr = fopen("DetList.txt", "w"); |
| 71 | + if (fptr == nullptr) { |
| 72 | + LOGP(fatal, "ERROR: Could not open file to write detector list!"); |
| 73 | + return; |
| 74 | + } |
| 75 | + fprintf(fptr, "%s", detList.c_str()); |
| 76 | + fclose(fptr); |
| 77 | +} |
| 78 | + |
67 | 79 | bool initOptionsAndParse(bpo::options_description& options, int argc, char* argv[], bpo::variables_map& vm) |
68 | 80 | { |
69 | 81 | options.add_options()( |
@@ -123,6 +135,20 @@ int main(int argc, char* argv[]) |
123 | 135 | LOGP(info, "run {}: B field = {}", run, magFieldL3Curr); |
124 | 136 | writeBFieldToFile((float)magFieldL3Curr); |
125 | 137 |
|
| 138 | + // getting the detector list |
| 139 | + LOGP(info, "Getting detector participating in the run"); |
| 140 | + std::map<std::string, std::string> metadataRun; |
| 141 | + metadataRun["runNumber"] = std::to_string(run); |
| 142 | + o2::parameters::GRPECSObject* ecsObj = ccdb_inst.getSpecific<o2::parameters::GRPECSObject>("GLO/Config/GRPECS", tsSOR, metadataRun); |
| 143 | + std::string dets = ""; |
| 144 | + for (int i = o2::detectors::DetID::First; i < o2::detectors::DetID::nDetectors; ++i) { |
| 145 | + if (ecsObj->isDetReadOut(i)) { |
| 146 | + dets = dets + o2::detectors::DetID::getName(i) + " "; |
| 147 | + } |
| 148 | + } |
| 149 | + LOGP(info, "run {}: detectors in readout = {}", run, dets); |
| 150 | + writeDetListToFile(dets); |
| 151 | + |
126 | 152 | LOGP(info, "Checking IR and duration"); |
127 | 153 | if (run < 519041) { |
128 | 154 | // LHC22c, d |
|
0 commit comments