@@ -168,6 +168,29 @@ o2::framework::ServiceSpec CommonServices::datatakingContextSpec()
168168 if (extRunNumber != " unspecified" || context.runNumber == " 0" ) {
169169 context.runNumber = extRunNumber;
170170 }
171+ auto extLHCPeriod = services.get <RawDeviceService>().device ()->fConfig ->GetProperty <std::string>(" lhc_period" , " unspecified" );
172+ if (extLHCPeriod != " unspecified" ) {
173+ context.lhcPeriod = extLHCPeriod;
174+ } else {
175+ static const char * months[12 ] = {" JAN" , " FEB" , " MAR" , " APR" , " MAY" , " JUN" , " JUL" , " AUG" , " SEP" , " OCT" , " NOV" , " DEC" };
176+ time_t now = time (nullptr );
177+ auto ltm = gmtime (&now);
178+ context.lhcPeriod = months[ltm->tm_mon ];
179+ LOG (warning) << " LHCPeriod is not available, using current month " << context.lhcPeriod ;
180+ }
181+
182+ auto extRunType = services.get <RawDeviceService>().device ()->fConfig ->GetProperty <std::string>(" run_type" , " unspecified" );
183+ if (extRunType != " unspecified" ) {
184+ context.runType = extRunType;
185+ }
186+ auto extEnvId = services.get <RawDeviceService>().device ()->fConfig ->GetProperty <std::string>(" environment_id" , " unspecified" );
187+ if (extEnvId != " unspecified" ) {
188+ context.runType = extEnvId;
189+ }
190+ auto extDetectors = services.get <RawDeviceService>().device ()->fConfig ->GetProperty <std::string>(" detectors" , " unspecified" );
191+ if (extDetectors != " unspecified" ) {
192+ context.detectors = extDetectors;
193+ }
171194 // FIXME: we actually need to get the orbit, not only to know where it is
172195 std::string orbitResetTimeUrl = services.get <RawDeviceService>().device ()->fConfig ->GetProperty <std::string>(" orbit-reset-time" , " ccdb://CTP/Calib/OrbitResetTime" );
173196 auto is_number = [](const std::string& s) -> bool {
0 commit comments