|
24 | 24 | #include "Common/CCDB/ctpRateFetcher.h" |
25 | 25 | #include "Common/Core/PID/TPCPIDResponse.h" |
26 | 26 | #include "Common/Core/TableHelper.h" |
| 27 | +#include "Common/Core/CollisionTypeHelper.h" |
27 | 28 | #include "Common/DataModel/PIDResponseTPC.h" |
28 | 29 | #include "Common/TableProducer/PID/pidTPCBase.h" |
29 | 30 | #include "Tools/ML/model.h" |
30 | 31 |
|
| 32 | +#include <DataFormatsParameters/GRPLHCIFData.h> |
31 | 33 | #include <Framework/AnalysisDataModel.h> |
32 | 34 | #include <Framework/AnalysisHelpers.h> |
33 | 35 | #include <Framework/Configurable.h> |
|
47 | 49 | #include <ratio> |
48 | 50 | #include <string> |
49 | 51 | #include <vector> |
| 52 | +std::string irSource = "-1"; |
| 53 | +int collsys = -1; |
50 | 54 |
|
51 | 55 | namespace o2::aod |
52 | 56 | { |
@@ -127,8 +131,8 @@ struct pidTPCConfigurables : o2::framework::ConfigurableGroup { |
127 | 131 | o2::framework::Configurable<int> useNetworkHe{"useNetworkHe", 1, {"Switch for applying neural network on the helium3 mass hypothesis (if network enabled) (set to 0 to disable)"}}; |
128 | 132 | o2::framework::Configurable<int> useNetworkAl{"useNetworkAl", 1, {"Switch for applying neural network on the alpha mass hypothesis (if network enabled) (set to 0 to disable)"}}; |
129 | 133 | o2::framework::Configurable<float> networkBetaGammaCutoff{"networkBetaGammaCutoff", 0.45, {"Lower value of beta-gamma to override the NN application"}}; |
130 | | - o2::framework::Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; |
131 | | -}; |
| 134 | + o2::framework::Configurable<std::string> cfgPathGrpLhcIf{"ccdb-path-grplhcif", "GLO/Config/GRPLHCIF", "Path on the CCDB for the GRPLHCIF object"}; |
| 135 | + }; |
132 | 136 |
|
133 | 137 | // helper getter - FIXME should be separate |
134 | 138 | int getPIDIndex(const int pdgCode) // Get O2 PID index corresponding to MC PDG code |
@@ -323,6 +327,14 @@ class pidTPCModule |
323 | 327 | } |
324 | 328 | LOG(info) << "Successfully retrieved TPC PID object from CCDB for timestamp " << time << ", period " << headers["LPMProductionTag"] << ", recoPass " << headers["RecoPassName"]; |
325 | 329 | metadata["RecoPassName"] = headers["RecoPassName"]; // Force pass number for NN request to match retrieved BB |
| 330 | + o2::parameters::GRPLHCIFData* grpo = ccdb->template getForTimeStamp<o2::parameters::GRPLHCIFData>(pidTPCopts.cfgPathGrpLhcIf.value, time); |
| 331 | + LOG(info) << " collision type::" << CollisionSystemType::getCollisionTypeFromGrp(grpo); |
| 332 | + collsys = CollisionSystemType::getCollisionTypeFromGrp(grpo); |
| 333 | + if ( collsys == CollisionSystemType::kCollSyspp ) { |
| 334 | + irSource = "T0VTX"; |
| 335 | + } else { |
| 336 | + irSource = "ZNC hadronic"; |
| 337 | + } |
326 | 338 | response->PrintAll(); |
327 | 339 | } |
328 | 340 | } |
@@ -397,6 +409,14 @@ class pidTPCModule |
397 | 409 | } |
398 | 410 | LOG(info) << "Successfully retrieved TPC PID object from CCDB for timestamp " << bc.timestamp() << ", period " << headers["LPMProductionTag"] << ", recoPass " << headers["RecoPassName"]; |
399 | 411 | metadata["RecoPassName"] = headers["RecoPassName"]; // Force pass number for NN request to match retrieved BB |
| 412 | + o2::parameters::GRPLHCIFData* grpo = ccdb->template getForTimeStamp<o2::parameters::GRPLHCIFData>(pidTPCopts.cfgPathGrpLhcIf.value, bc.timestamp()); |
| 413 | + LOG(info) << "Collision type::" << CollisionSystemType::getCollisionTypeFromGrp(grpo); |
| 414 | + int collsys = CollisionSystemType::getCollisionTypeFromGrp(grpo); |
| 415 | + if (collsys == CollisionSystemType::kCollSyspp ) { |
| 416 | + irSource = "T0VTX"; |
| 417 | + } else { |
| 418 | + irSource = "ZNC hadronic"; |
| 419 | + } |
400 | 420 | response->PrintAll(); |
401 | 421 | } |
402 | 422 |
|
@@ -458,10 +478,14 @@ class pidTPCModule |
458 | 478 | if (trk.has_collision()) { |
459 | 479 | auto trk_bc = (collisions.iteratorAt(trk.collisionId())).template bc_as<B>(); |
460 | 480 | if (trk_bc.timestamp() != timeStamp_bcOld) { |
461 | | - hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), pidTPCopts.irSource.value) * 1.e-3; |
| 481 | + hadronicRate = mRateFetcher.fetch(ccdb.service, trk_bc.timestamp(), trk_bc.runNumber(), irSource) * 1.e-3; |
462 | 482 | } |
463 | 483 | timeStamp_bcOld = trk_bc.timestamp(); |
464 | | - track_properties[counter_track_props + 7] = hadronicRate / 50.; |
| 484 | + if( collsys == CollisionSystemType::kCollSyspp ) { |
| 485 | + track_properties[counter_track_props + 7] = hadronicRate / 1500.; |
| 486 | + }else{ |
| 487 | + track_properties[counter_track_props + 7] = hadronicRate / 50.; |
| 488 | + } |
465 | 489 | } else { |
466 | 490 | track_properties[counter_track_props + 7] = 1; |
467 | 491 | } |
@@ -738,6 +762,14 @@ class pidTPCModule |
738 | 762 | } |
739 | 763 | } |
740 | 764 | LOG(info) << "Successfully retrieved TPC PID object from CCDB for timestamp " << bc.timestamp() << ", period " << headers["LPMProductionTag"] << ", recoPass " << headers["RecoPassName"]; |
| 765 | + o2::parameters::GRPLHCIFData* grpo = ccdb->template getForTimeStamp<o2::parameters::GRPLHCIFData>(pidTPCopts.cfgPathGrpLhcIf.value,bc.timestamp()); |
| 766 | + LOG(info) << "Collisions type::" << CollisionSystemType::getCollisionTypeFromGrp(grpo); |
| 767 | + int collsys = CollisionSystemType::getCollisionTypeFromGrp(grpo); |
| 768 | + if (collsys == CollisionSystemType::kCollSyspp ) { |
| 769 | + irSource = "T0VTX"; |
| 770 | + } else { |
| 771 | + irSource = "ZNC hadronic"; |
| 772 | + } |
741 | 773 | response->PrintAll(); |
742 | 774 | } |
743 | 775 |
|
|
0 commit comments