diff --git a/Common/Tools/PID/pidTPCModule.h b/Common/Tools/PID/pidTPCModule.h index 36b3c54df00..3c7e555c940 100644 --- a/Common/Tools/PID/pidTPCModule.h +++ b/Common/Tools/PID/pidTPCModule.h @@ -127,6 +127,7 @@ struct pidTPCConfigurables : o2::framework::ConfigurableGroup { o2::framework::Configurable useNetworkHe{"useNetworkHe", 1, {"Switch for applying neural network on the helium3 mass hypothesis (if network enabled) (set to 0 to disable)"}}; o2::framework::Configurable useNetworkAl{"useNetworkAl", 1, {"Switch for applying neural network on the alpha mass hypothesis (if network enabled) (set to 0 to disable)"}}; o2::framework::Configurable networkBetaGammaCutoff{"networkBetaGammaCutoff", 0.45, {"Lower value of beta-gamma to override the NN application"}}; + o2::framework::Configurable irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; }; // helper getter - FIXME should be separate @@ -432,6 +433,8 @@ class pidTPCModule // Filling a std::vector to be evaluated by the network // Evaluation on single tracks brings huge overhead: Thus evaluation is done on one large vector for (int i = 0; i < 9; i++) { // Loop over particle number for which network correction is used + float hadronicRate = 0.; + uint64_t timeStamp_bcOld = 0; for (auto const& trk : tracks) { if (!trk.hasTPC()) { continue; @@ -450,6 +453,19 @@ class pidTPCModule if (input_dimensions == 7 && networkVersion == "2") { track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.; } + if (input_dimensions == 8 && networkVersion == "3") { + track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.; + if (trk.has_collision()) { + auto trk_bc = (collisions.iteratorAt(trk.collisionId())).template bc_as(); + if (trk_bc.timestamp() != timeStamp_bcOld) { + hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), pidTPCopts.irSource.value) * 1.e-3; + } + timeStamp_bcOld = trk_bc.timestamp(); + track_properties[counter_track_props + 7] = hadronicRate / 50.; + } else { + track_properties[counter_track_props + 7] = 1; + } + } counter_track_props += input_dimensions; }