Skip to content

Commit 9cbe9f3

Browse files
[PWGHF] Add the event QA plots for instantaneous interaction rate into the HF framework (#13900)
1 parent cb4c31d commit 9cbe9f3

File tree

8 files changed

+103
-47
lines changed

8 files changed

+103
-47
lines changed

PWGHF/TableProducer/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ o2physics_add_dpl_workflow(mc-pid-tof
3737

3838
o2physics_add_dpl_workflow(candidate-creator-2prong
3939
SOURCES candidateCreator2Prong.cxx
40-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::SGCutParHolder
40+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::SGCutParHolder O2Physics::AnalysisCCDB
4141
COMPONENT_NAME Analysis)
4242

4343
o2physics_add_dpl_workflow(candidate-creator-3prong
4444
SOURCES candidateCreator3Prong.cxx
45-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::SGCutParHolder
45+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::SGCutParHolder O2Physics::AnalysisCCDB
4646
COMPONENT_NAME Analysis)
4747

4848
o2physics_add_dpl_workflow(candidate-creator-b0
@@ -62,12 +62,12 @@ o2physics_add_dpl_workflow(candidate-creator-bs
6262

6363
o2physics_add_dpl_workflow(candidate-creator-cascade
6464
SOURCES candidateCreatorCascade.cxx
65-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter
65+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter O2Physics::AnalysisCCDB
6666
COMPONENT_NAME Analysis)
6767

6868
o2physics_add_dpl_workflow(candidate-creator-dstar
6969
SOURCES candidateCreatorDstar.cxx
70-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
70+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB
7171
COMPONENT_NAME Analysis)
7272

7373
o2physics_add_dpl_workflow(candidate-creator-lb
@@ -87,12 +87,12 @@ o2physics_add_dpl_workflow(candidate-creator-sigmac0plusplus-cascade
8787

8888
o2physics_add_dpl_workflow(candidate-creator-xic0-omegac0
8989
SOURCES candidateCreatorXic0Omegac0.cxx
90-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle
90+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::AnalysisCCDB
9191
COMPONENT_NAME Analysis)
9292

9393
o2physics_add_dpl_workflow(candidate-creator-xic-to-xi-pi-pi
9494
SOURCES candidateCreatorXicToXiPiPi.cxx
95-
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle
95+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::AnalysisCCDB
9696
COMPONENT_NAME Analysis)
9797

9898
o2physics_add_dpl_workflow(candidate-creator-xicc

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "PWGHF/Utils/utilsTrkCandHf.h"
3434
#include "PWGLF/DataModel/mcCentrality.h"
3535

36+
#include "Common/CCDB/ctpRateFetcher.h"
3637
#include "Common/Core/RecoDecay.h"
3738
#include "Common/Core/trackUtilities.h"
3839
#include "Common/DataModel/Centrality.h"
@@ -112,10 +113,12 @@ struct HfCandidateCreator2Prong {
112113
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
113114
Configurable<std::string> ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"};
114115
Configurable<std::string> ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"};
116+
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
115117

116118
HfEventSelection hfEvSel; // event selection and monitoring
117119
o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter
118120
Service<o2::ccdb::BasicCCDBManager> ccdb;
121+
ctpRateFetcher mRateFetcher;
119122

120123
int runNumber{0};
121124
double bz{0.};
@@ -742,9 +745,10 @@ struct HfCandidateCreator2Prong {
742745
float centrality{-1.f};
743746
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
744747
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
745-
748+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
749+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
746750
/// monitor the satisfied event selections
747-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
751+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
748752

749753
} /// end loop over collisions
750754
}
@@ -760,9 +764,10 @@ struct HfCandidateCreator2Prong {
760764
float centrality{-1.f};
761765
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
762766
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
763-
767+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
768+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
764769
/// monitor the satisfied event selections
765-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
770+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
766771

767772
} /// end loop over collisions
768773
}
@@ -778,9 +783,10 @@ struct HfCandidateCreator2Prong {
778783
float centrality{-1.f};
779784
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
780785
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
781-
786+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
787+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
782788
/// monitor the satisfied event selections
783-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
789+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
784790

785791
} /// end loop over collisions
786792
}
@@ -801,9 +807,10 @@ struct HfCandidateCreator2Prong {
801807
float centrality{-1.f};
802808
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
803809
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc<true, CentralityEstimator::None, aod::BcFullInfos>(collision, centrality, ccdb, registry, bcs);
804-
810+
const auto bc = collision.template foundBC_as<aod::BcFullInfos>();
811+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
805812
/// monitor the satisfied event selections
806-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
813+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
807814

808815
} /// end loop over collisions
809816
}

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "PWGHF/Utils/utilsTrkCandHf.h"
3333
#include "PWGLF/DataModel/mcCentrality.h"
3434

35+
#include "Common/CCDB/ctpRateFetcher.h"
3536
#include "Common/Core/RecoDecay.h"
3637
#include "Common/Core/trackUtilities.h"
3738
#include "Common/DataModel/Centrality.h"
@@ -120,6 +121,7 @@ struct HfCandidateCreator3Prong {
120121
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
121122
Configurable<std::string> ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"};
122123
Configurable<std::string> ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"};
124+
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
123125
// flags to enable creation for different particle species separately
124126
Configurable<bool> createDplus{"createDplus", false, "enable D+/- candidate creation"};
125127
Configurable<bool> createDs{"createDs", false, "enable Ds+/- candidate creation"};
@@ -133,6 +135,7 @@ struct HfCandidateCreator3Prong {
133135
HfEventSelection hfEvSel; // event selection and monitoring
134136
o2::vertexing::DCAFitterN<3> df; // 3-prong vertex fitter
135137
Service<o2::ccdb::BasicCCDBManager> ccdb;
138+
ctpRateFetcher mRateFetcher;
136139

137140
int runNumber{0};
138141
double bz{0.};
@@ -899,9 +902,10 @@ struct HfCandidateCreator3Prong {
899902
float centrality{-1.f};
900903
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
901904
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
902-
905+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
906+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
903907
/// monitor the satisfied event selections
904-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
908+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
905909

906910
} /// end loop over collisions
907911
}
@@ -917,9 +921,10 @@ struct HfCandidateCreator3Prong {
917921
float centrality{-1.f};
918922
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
919923
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
920-
924+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
925+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
921926
/// monitor the satisfied event selections
922-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
927+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
923928

924929
} /// end loop over collisions
925930
}
@@ -935,9 +940,10 @@ struct HfCandidateCreator3Prong {
935940
float centrality{-1.f};
936941
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
937942
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
938-
943+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
944+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
939945
/// monitor the satisfied event selections
940-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
946+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
941947

942948
} /// end loop over collisions
943949
}
@@ -958,9 +964,10 @@ struct HfCandidateCreator3Prong {
958964
float centrality{-1.f};
959965
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
960966
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc<true, CentralityEstimator::None, aod::BcFullInfos>(collision, centrality, ccdb, registry, bcs);
961-
967+
const auto bc = collision.template foundBC_as<aod::BcFullInfos>();
968+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
962969
/// monitor the satisfied event selections
963-
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy);
970+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
964971

965972
} /// end loop over collisions
966973
}

PWGHF/TableProducer/candidateCreatorCascade.cxx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "PWGLF/DataModel/LFStrangenessTables.h"
2626
#include "PWGLF/DataModel/mcCentrality.h"
2727

28+
#include "Common/CCDB/ctpRateFetcher.h"
2829
#include "Common/Core/RecoDecay.h"
2930
#include "Common/Core/trackUtilities.h"
3031
#include "Common/DataModel/Centrality.h"
@@ -88,12 +89,14 @@ struct HfCandidateCreatorCascade {
8889
Configurable<std::string> ccdbPathLut{"ccdbPathLut", "GLO/Param/MatLUT", "Path for LUT parametrization"};
8990
Configurable<std::string> ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"};
9091
Configurable<std::string> ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"};
92+
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
9193

9294
HfEventSelection hfEvSel; // event selection and monitoring
9395
o2::vertexing::DCAFitterN<2> df; // 2-prong vertex fitter
9496
Service<o2::ccdb::BasicCCDBManager> ccdb;
9597
o2::base::MatLayerCylSet* lut{};
9698
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrLUT;
99+
ctpRateFetcher mRateFetcher;
97100

98101
int runNumber{0};
99102
double massP{0.};
@@ -378,10 +381,12 @@ struct HfCandidateCreatorCascade {
378381

379382
/// bitmask with event. selection info
380383
float centrality{-1.f};
384+
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
381385
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
382-
386+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
387+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
383388
/// monitor the satisfied event selections
384-
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
389+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
385390

386391
} /// end loop over collisions
387392
}
@@ -395,10 +400,12 @@ struct HfCandidateCreatorCascade {
395400

396401
/// bitmask with event. selection info
397402
float centrality{-1.f};
403+
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
398404
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
399-
405+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
406+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
400407
/// monitor the satisfied event selections
401-
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
408+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
402409

403410
} /// end loop over collisions
404411
}
@@ -412,10 +419,12 @@ struct HfCandidateCreatorCascade {
412419

413420
/// bitmask with event. selection info
414421
float centrality{-1.f};
422+
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
415423
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
416-
424+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
425+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
417426
/// monitor the satisfied event selections
418-
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
427+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
419428

420429
} /// end loop over collisions
421430
}

PWGHF/TableProducer/candidateCreatorDstar.cxx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "PWGHF/Utils/utilsTrkCandHf.h"
2727
#include "PWGLF/DataModel/mcCentrality.h"
2828

29+
#include "Common/CCDB/ctpRateFetcher.h"
2930
#include "Common/Core/RecoDecay.h"
3031
#include "Common/Core/trackUtilities.h"
3132
#include "Common/DataModel/Centrality.h"
@@ -94,6 +95,7 @@ struct HfCandidateCreatorDstar {
9495
Configurable<bool> isRun2{"isRun2", false, "enable Run 2 or Run 3 GRP objects for magnetic field"};
9596
Configurable<std::string> ccdbPathGrp{"ccdbPathGrp", "GLO/GRP/GRP", "Path of the grp file (Run 2)"};
9697
Configurable<std::string> ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"};
98+
Configurable<std::string> irSource{"irSource", "ZNC hadronic", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"};
9799

98100
// vertexing
99101
Configurable<bool> propagateToPCA{"propagateToPCA", true, "create tracks version propagated to PCA"};
@@ -107,6 +109,7 @@ struct HfCandidateCreatorDstar {
107109
HfEventSelection hfEvSel; // event selection and monitoring
108110
Service<o2::ccdb::BasicCCDBManager> ccdb; // From utilsBfieldCCDB.h
109111
o2::base::Propagator::MatCorrType noMatCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
112+
ctpRateFetcher mRateFetcher;
110113
// D0-prong vertex fitter
111114
o2::vertexing::DCAFitterN<2> df;
112115
int runNumber{};
@@ -498,10 +501,12 @@ struct HfCandidateCreatorDstar {
498501

499502
/// bitmask with event. selection info
500503
float centrality{-1.f};
504+
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
501505
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::None, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
502-
506+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
507+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
503508
/// monitor the satisfied event selections
504-
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
509+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
505510

506511
} /// end loop over collisions
507512
}
@@ -515,10 +520,12 @@ struct HfCandidateCreatorDstar {
515520

516521
/// bitmask with event. selection info
517522
float centrality{-1.f};
523+
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
518524
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0C, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
519-
525+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
526+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
520527
/// monitor the satisfied event selections
521-
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
528+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
522529

523530
} /// end loop over collisions
524531
}
@@ -532,10 +539,12 @@ struct HfCandidateCreatorDstar {
532539

533540
/// bitmask with event. selection info
534541
float centrality{-1.f};
542+
const auto occupancy = o2::hf_occupancy::getOccupancyColl(collision, hfEvSel.occEstimator);
535543
const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask<true, CentralityEstimator::FT0M, aod::BCsWithTimestamps>(collision, centrality, ccdb, registry);
536-
544+
const auto bc = collision.template foundBC_as<aod::BCsWithTimestamps>();
545+
const auto ir = mRateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource, true); // Hz
537546
/// monitor the satisfied event selections
538-
hfEvSel.fillHistograms(collision, rejectionMask, centrality);
547+
hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy, ir);
539548

540549
} /// end loop over collisions
541550
}

0 commit comments

Comments
 (0)