Skip to content

Commit 50f0282

Browse files
authored
[ALICE3] Add histogram registry and update process method to geo provider (#14465)
1 parent 6ec95e2 commit 50f0282

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020

2121
#include <CCDB/BasicCCDBManager.h>
2222
#include <Framework/AnalysisTask.h>
23+
#include <Framework/HistogramRegistry.h>
2324
#include <Framework/runDataProcessing.h>
2425

2526
#include <map>
2627
#include <string>
2728
#include <vector>
2829

2930
struct OnTheFlyDetectorGeometryProvider {
30-
31+
o2::framework::HistogramRegistry histos{"Histos", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject};
3132
o2::framework::Configurable<std::vector<std::string>> detectorConfiguration{"detectorConfiguration",
3233
std::vector<std::string>{"$O2PHYSICS_ROOT/share/alice3/a3geometry_v3.ini"},
3334
"Paths of the detector geometry configuration files"};
@@ -45,6 +46,7 @@ struct OnTheFlyDetectorGeometryProvider {
4546
int idx = 0;
4647
for (auto& configFile : detectorConfiguration.value) {
4748
LOG(info) << "Loading detector geometry from configuration file: " << configFile;
49+
histos.add<TH1>(Form("GeometryConfigFile_%d", idx), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5);
4850
// If the filename starts with ccdb: then take the file from the ccdb
4951
if (configFile.rfind("ccdb:", 0) == 0) {
5052
std::string ccdbPath = configFile.substr(5); // remove "ccdb:" prefix
@@ -75,10 +77,12 @@ struct OnTheFlyDetectorGeometryProvider {
7577
LOG(fatal) << "Inconsistent magnetic field values between configurations 0 and " << icfg << ": " << mMagneticField << " vs " << cfgBfield;
7678
}
7779
}
80+
LOG(info) << "Initialization completed";
7881
}
7982

80-
void process(o2::aod::McCollisions const&)
83+
void process(o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles)
8184
{
85+
LOG(info) << "On-the-fly detector geometry provider processing " << mcCollisions.size() << " collisions and " << mcParticles.size() << " particles.";
8286
}
8387
};
8488

0 commit comments

Comments
 (0)