Skip to content

Commit 905f02a

Browse files
amaringarciaAna MarinAna Marin
authored
[Common] Use NN including Hadronic Rate in the training, mitigation of run by run variations (AliceO2Group#12573)
Co-authored-by: Ana Marin <[email protected]> Co-authored-by: Ana Marin <[email protected]>
1 parent 38bd655 commit 905f02a

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Common/TableProducer/PID/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ o2physics_add_dpl_workflow(pid-tpc-base
5555

5656
o2physics_add_dpl_workflow(pid-tpc
5757
SOURCES pidTPC.cxx
58-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore
58+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsBase O2Physics::AnalysisCCDB O2Physics::MLCore
5959
COMPONENT_NAME Analysis)
6060

6161
# HMPID

Common/TableProducer/PID/pidTPC.cxx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "TableHelper.h"
3434
#include "pidTPCBase.h"
3535

36+
#include "Common/CCDB/ctpRateFetcher.h"
3637
#include "Common/Core/PID/TPCPIDResponse.h"
3738
#include "Common/DataModel/EventSelection.h"
3839
#include "Common/DataModel/Multiplicity.h"
@@ -151,7 +152,8 @@ struct tpcPid {
151152
Configurable<int> useNetworkAl{"useNetworkAl", 1, {"Switch for applying neural network on the alpha mass hypothesis (if network enabled) (set to 0 to disable)"}};
152153
Configurable<float> networkBetaGammaCutoff{"networkBetaGammaCutoff", 0.45, {"Lower value of beta-gamma to override the NN application"}};
153154
Configurable<float> networkInputBatchedMode{"networkInputBatchedMode", -1, {"-1: Takes all tracks, >0: Takes networkInputBatchedMode number of tracks at once"}};
154-
155+
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
156+
ctpRateFetcher mRateFetcher;
155157
// Parametrization configuration
156158
bool useCCDBParam = false;
157159
std::vector<float> track_properties;
@@ -400,6 +402,16 @@ struct tpcPid {
400402
if (input_dimensions == 7 && networkVersion == "2") {
401403
track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.;
402404
}
405+
if (input_dimensions == 8 && networkVersion == "3") {
406+
if (trk.has_collision()) {
407+
auto trk_bc = (collisions.iteratorAt(trk.collisionId())).template bc_as<B>();
408+
float hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), irSource) * 1.e-3;
409+
track_properties[counter_track_props + 7] = hadronicRate / 50.;
410+
} else {
411+
track_properties[counter_track_props + 7] = 1;
412+
}
413+
}
414+
403415
counter_track_props += input_dimensions;
404416
in_batch_counter++;
405417
total_input_count++;

0 commit comments

Comments
 (0)