Skip to content

Commit 25bc54c

Browse files
authored
Refactor magneticField to use Configurable type
1 parent e8ef485 commit 25bc54c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct OnTheFlyRichPid {
8484
Service<o2::ccdb::BasicCCDBManager> ccdb;
8585

8686
// master setting: magnetic field
87-
float magneticField = 0; // Always taken from the tracker task
87+
Configurable<float> magneticField{"magneticField", 0, "magnetic field (kilogauss) if 0, taken from the tracker task"};
8888

8989
// add rich-specific configurables here
9090
Configurable<int> bRichNumberOfSectors{"bRichNumberOfSectors", 21, "barrel RICH number of sectors"};
@@ -290,8 +290,12 @@ struct OnTheFlyRichPid {
290290
{
291291
pRandomNumberGenerator.SetSeed(0); // fully randomize
292292

293-
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", "magneticField", magneticField, false)) {
294-
LOG(fatal) << "Could not get Bz from on-the-fly-tracker task";
293+
if (magneticField.value < o2::constants::math::Epsilon) {
294+
LOG(info) << "Getting the magnetic field from the on-the-fly tracker task";
295+
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", magneticField, false)) {
296+
LOG(fatal) << "Could not get Bz from on-the-fly-tracker task";
297+
}
298+
LOG(info) << "Bz = " << magneticField.value << " T";
295299
}
296300

297301
// Load LUT for pt and eta smearing

0 commit comments

Comments
 (0)