47 auto configBuff = pc.
inputs().
get<gsl::span<char>>(
"inputConfig");
48 auto configFileName = pc.
inputs().
get<std::string>(
"inputConfigFileName");
49 auto timer = std::chrono::duration_cast<std::chrono::milliseconds>(HighResClock::now().time_since_epoch()).count();
50 LOG(info) <<
"got input file " << configFileName <<
" of size " << configBuff.size();
52 std::vector<std::pair<long, std::vector<int32_t>>> beamEnergy;
53 std::vector<std::pair<long, std::vector<std::string>>> injScheme;
54 std::vector<std::pair<long, std::vector<std::string>>> fillNb;
55 std::vector<std::pair<long, std::vector<int32_t>>> atomicNbB1;
56 std::vector<std::pair<long, std::vector<int32_t>>> atomicNbB2;
57 std::vector<std::pair<long, std::vector<o2::units::AngleRad_t>>> crossAngle;
58 std::vector<std::pair<long, std::vector<int32_t>>> bunchConfigB1;
59 std::vector<std::pair<long, std::vector<int32_t>>> bunchConfigB2;
68 mReader.
readValue<int32_t>(
"BEAM_ENERGY",
type, nEle, nMeas, beamEnergy);
70 LOG(warn) <<
"Beam energy not present/empty";
72 if (nEle > 1 || nMeas > 1) {
73 LOGP(warn,
"More than one value/measurement {}/{} found for Beam Energy, keeping the last one", nEle, nMeas);
75 if (!beamEnergy.empty()) {
79 mReader.
readValue<std::string>(
"INJECTION_SCHEME",
type, nEle, nMeas, injScheme);
81 LOG(warn) <<
"Injection scheme not present/empty";
83 if (nEle > 1 || nMeas > 1) {
84 LOGP(warn,
"More than one value/measurement {}/{} found for Injection Scheme, keeping the last one", nEle, nMeas);
86 if (!injScheme.empty()) {
91 mReader.
readValue<std::string>(
"FILL_NUMBER",
type, nEle, nMeas, fillNb);
93 LOG(warn) <<
"Fill Number not present/empty";
95 if (nEle > 1 || nMeas > 1) {
96 LOG(warn) <<
"More than one value/measurement found for Fill Number, keeping the last one";
98 if (!fillNb.empty()) {
103 mReader.
readValue<int32_t>(
"ATOMIC_NUMBER_B1",
type, nEle, nMeas, atomicNbB1);
105 LOG(warn) <<
"Atomic Number Beam 1 (clockwise) not present/empty";
107 if (nEle > 1 || nMeas > 1) {
108 LOGP(warn,
"More than one value/measurement {}/{} found for Atomic Number Beam 1 (clockwise), keeping the last one", nEle, nMeas);
110 if (!atomicNbB1.empty()) {
115 mReader.
readValue<int32_t>(
"ATOMIC_NUMBER_B2",
type, nEle, nMeas, atomicNbB2);
117 LOG(warn) <<
"Atomic Number Beam 2 (anticlockwise) not present/empty";
119 if (nEle > 1 || nMeas > 1) {
120 LOGP(warn,
"More than one value/measurement {}/{} found for Atomic Number Beam 2 (anticlockwise), keeping the last one", nEle, nMeas);
122 if (!atomicNbB2.empty()) {
127 mReader.
readValue<
float>(
"IP2_XING_V_MURAD",
type, nEle, nMeas, crossAngle);
129 LOG(warn) <<
"Crossing Angle not present/empty";
131 if (nEle > 1 || nMeas > 1) {
132 LOGP(warn,
"More than one value/measurement {}/{} found for Crossing Angle, keeping the last one", nEle, nMeas);
134 if (!crossAngle.empty()) {
139 mReader.
readValue<
int>(
"CIRCULATING_BUNCH_CONFIG_BEAM1",
type, nEle, nMeas, bunchConfigB1);
141 LOG(warn) <<
"Bunch Config Beam 1 not present/empty";
144 LOGP(warn,
"More than one measurement {} found for Bunch Config Beam 1, keeping the last one", nMeas);
148 mReader.
readValue<
int>(
"CIRCULATING_BUNCH_CONFIG_BEAM2",
type, nEle, nMeas, bunchConfigB2);
150 LOG(warn) <<
"Bunch Config Beam 2 not present/empty";
153 LOGP(warn,
"More than one measurement {} found for Bunch Config Beam 2, keeping the last one", nMeas);
157 if (!bunchConfigB1.empty() && !bunchConfigB2.empty()) {
162 lhcifdata.
setBunchFillingWithTime((bunchConfigB1.back().first + bunchConfigB2.back().first) / 2, bunchFilling);
168 LOG(info) <<
" **** Beam Energy ****";
169 for (
auto& el : beamEnergy) {
170 for (
auto elVect : el.second) {
171 std::cout << el.first <<
" --> " << elVect << std::endl;
174 LOG(info) <<
" **** Injection Scheme ****";
175 for (
auto& el : injScheme) {
176 for (
auto elVect : el.second) {
177 std::cout << el.first <<
" --> " << elVect << std::endl;
180 LOG(info) <<
" **** Fill Number ****";
181 for (
auto& el : fillNb) {
182 for (
auto elVect : el.second) {
183 std::cout << el.first <<
" --> " << elVect << std::endl;
186 LOG(info) <<
" **** Atomic Number Beam 1 (clockwise) ****";
187 for (
auto& el : atomicNbB1) {
188 for (
auto elVect : el.second) {
189 std::cout << el.first <<
" --> " << elVect << std::endl;
192 LOG(info) <<
" **** Atomic Number B2 (anticlockwise) ****";
193 for (
auto& el : atomicNbB2) {
194 for (
auto elVect : el.second) {
195 std::cout << el.first <<
" --> " << elVect << std::endl;
198 LOG(info) <<
" **** Crossing Angle ****";
199 for (
auto& el : crossAngle) {
200 for (
auto elVect : el.second) {
201 std::cout << el.first <<
" --> " << elVect << std::endl;
206 sendOutput(pc.
outputs(), timer, lhcifdata);
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.