Skip to content

Commit 46108aa

Browse files
author
Ana Marin
committed
DPG: to use NN including Hadronic Rate in the training, mitigation of run by run variations
1 parent bb21c5a commit 46108aa

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-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: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "Common/DataModel/EventSelection.h"
3838
#include "Common/DataModel/Multiplicity.h"
3939
#include "Common/DataModel/PIDResponseTPC.h"
40+
#include "Common/CCDB/ctpRateFetcher.h"
4041
#include "Tools/ML/model.h"
4142

4243
#include "CCDB/BasicCCDBManager.h"
@@ -151,7 +152,9 @@ 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;
157+
155158
// Parametrization configuration
156159
bool useCCDBParam = false;
157160
std::vector<float> track_properties;
@@ -400,6 +403,16 @@ struct tpcPid {
400403
if (input_dimensions == 7 && networkVersion == "2") {
401404
track_properties[counter_track_props + 6] = trk.has_collision() ? collisions.iteratorAt(trk.collisionId()).ft0cOccupancyInTimeRange() / 60000. : 1.;
402405
}
406+
if (input_dimensions == 8 && networkVersion == "3") {
407+
if(trk.has_collision()){
408+
auto trk_bc = (collisions.iteratorAt(trk.collisionId())).template bc_as<B>();
409+
float hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), irSource) * 1.e-3;
410+
track_properties[counter_track_props + 7] = hadronicRate/50.;
411+
}else{
412+
track_properties[counter_track_props + 7] =1;
413+
}
414+
}
415+
403416
counter_track_props += input_dimensions;
404417
in_batch_counter++;
405418
total_input_count++;

0 commit comments

Comments
 (0)