Skip to content

Commit ae08646

Browse files
committed
fix compilation; fix geometry provider
1 parent 00b084a commit ae08646

5 files changed

Lines changed: 21 additions & 60 deletions

File tree

ALICE3/DataModel/OTFLUT.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define ALICE3_DATAMODEL_OTFLUT_H_
2121

2222
#include "Framework/AnalysisDataModel.h"
23+
#include <TClass.h>
24+
#include <TBufferFile.h>
2325

2426
namespace o2
2527
{
@@ -28,11 +30,11 @@ namespace aod
2830
namespace otf::lut
2931
{
3032

31-
DECLARE_SOA_CCDB_COLUMN(LutEl, lutEl, std::string_view, "Users/j/jekarlss/ccdbUploadTest3/luts/lutEl"); //!
32-
DECLARE_SOA_CCDB_COLUMN(LutMu, lutMu, std::string_view, "Users/j/jekarlss/ccdbUploadTest3/luts/lutMu"); //!
33-
DECLARE_SOA_CCDB_COLUMN(LutPi, lutPi, std::string_view, "Users/j/jekarlss/ccdbUploadTest3/luts/lutPi"); //!
34-
DECLARE_SOA_CCDB_COLUMN(LutKa, lutKa, std::string_view, "Users/j/jekarlss/ccdbUploadTest3/luts/lutKa"); //!
35-
DECLARE_SOA_CCDB_COLUMN(LutPr, lutPr, std::string_view, "Users/j/jekarlss/ccdbUploadTest3/luts/lutPr"); //!
33+
DECLARE_SOA_CCDB_COLUMN(LutEl, lutEl, std::span<std::byte>, "Users/j/jekarlss/ccdbUploadTest3/luts/lutEl"); //!
34+
DECLARE_SOA_CCDB_COLUMN(LutMu, lutMu, std::span<std::byte>, "Users/j/jekarlss/ccdbUploadTest3/luts/lutMu"); //!
35+
DECLARE_SOA_CCDB_COLUMN(LutPi, lutPi, std::span<std::byte>, "Users/j/jekarlss/ccdbUploadTest3/luts/lutPi"); //!
36+
DECLARE_SOA_CCDB_COLUMN(LutKa, lutKa, std::span<std::byte>, "Users/j/jekarlss/ccdbUploadTest3/luts/lutKa"); //!
37+
DECLARE_SOA_CCDB_COLUMN(LutPr, lutPr, std::span<std::byte>, "Users/j/jekarlss/ccdbUploadTest3/luts/lutPr"); //!
3638

3739
} // namespace otf::lut
3840

ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx

Lines changed: 9 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -28,61 +28,20 @@
2828
#include <string>
2929
#include <vector>
3030

31+
using namespace o2::framework;
32+
3133
struct OnTheFlyDetectorGeometryProvider {
32-
o2::framework::HistogramRegistry histos{"Histos", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject};
33-
o2::framework::Configurable<bool> cleanLutWhenLoaded{"cleanLutWhenLoaded", true, "clean LUTs after being loaded to save disk space"};
34-
o2::framework::Configurable<std::vector<std::string>> detectorConfiguration{"detectorConfiguration",
34+
HistogramRegistry histos{"Histos", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject};
35+
Configurable<bool> cleanLutWhenLoaded{"cleanLutWhenLoaded", true, "clean LUTs after being loaded to save disk space"};
36+
Configurable<std::vector<std::string>> detectorConfiguration{"detectorConfiguration",
3537
std::vector<std::string>{"$O2PHYSICS_ROOT/share/alice3/a3geometry_v3.ini"},
3638
"Paths of the detector geometry configuration files"};
37-
o2::framework::Produces<o2::aod::Timestamps> tableTimestamps;
38-
o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb;
39-
40-
bool ccdbIsInitialized = false;
41-
void init(o2::framework::InitContext&)
42-
{
43-
// o2::fastsim::GeometryContainer geometryContainer; // Checking that the geometry files can be accessed and loaded
44-
// geometryContainer.setCcdbManager(ccdb.operator->());
45-
// LOG(info) << "On-the-fly detector geometry provider running.";
46-
// if (detectorConfiguration.value.empty()) {
47-
// LOG(fatal) << "No detector configuration files provided.";
48-
// return;
49-
// }
50-
// int idx = 0;
51-
// for (std::string& configFile : detectorConfiguration.value) {
52-
// LOG(info) << "Loading detector geometry from configuration file: " << configFile;
53-
// histos.add<TH1>(Form("GeometryConfigFile_%d", idx++), configFile.c_str(), o2::framework::HistType::kTH1D, {{1, 0, 1}})->Fill(0.5);
54-
// geometryContainer.addEntry(configFile);
55-
// }
56-
57-
// // First we check that the magnetic field is consistent
58-
// const int nGeometries = geometryContainer.getNumberOfConfigurations();
59-
// const float mMagneticField = geometryContainer.getFloatValue(0, "global", "magneticfield");
60-
// for (int icfg = 0; icfg < nGeometries; ++icfg) {
61-
// const float cfgBfield = geometryContainer.getFloatValue(icfg, "global", "magneticfield");
62-
// if (std::abs(cfgBfield - mMagneticField) > 1e-3) {
63-
// LOG(fatal) << "Inconsistent magnetic field values between configurations 0 and " << icfg << ": " << mMagneticField << " vs " << cfgBfield;
64-
// }
65-
// }
66-
LOG(info) << "Initialization completed";
67-
}
39+
Produces<o2::aod::Timestamps> tableTimestamps;
40+
Service<o2::ccdb::BasicCCDBManager> ccdb;
6841

69-
void initCCDB()
42+
void process(o2::aod::McCollisions const&, o2::aod::McParticles const&)
7043
{
71-
if (!ccdbIsInitialized) {
72-
tableTimestamps(o2::upgrade::TimestampLUT); // c2b3d801393540b7bddb949d600b199f, ecacb915-3d70-11f0-ac6f-808de0f5250c
73-
ccdbIsInitialized = true;
74-
LOG(info) << "CCDB initialization completed";
75-
}
76-
}
77-
78-
void process(o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles)
79-
{
80-
initCCDB();
81-
for (const auto& mcCollision : mcCollisions) {
82-
LOG(debug)<< "On-the-fly detector geometry provider processing " << mcCollision.size() << " collisions and " << mcParticles.size() << " particles.";
83-
}
84-
85-
LOG(debug)<< "On-the-fly detector geometry provider processing " << mcCollisions.size() << " collisions and " << mcParticles.size() << " particles.";
44+
tableTimestamps(o2::upgrade::TimestampLUT); // needs to be done for each timeframe - no extra fetches will happen!
8645
}
8746
};
8847

ALICE3/TableProducer/OTF/testCcdbConsumer0.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ struct TestCcdbConsumer0 {
5252

5353
void process(o2::aod::McCollisions const& mcCollisions, o2::aod::McParticles const& mcParticles, o2::aod::A3LookUpTables const& luts)
5454
{
55-
for (const auto& mcCollision : mcCollisions) {
56-
o2::delphes::DelphesO2TrackSmearer smearer;
57-
const auto thisTable = luts.rawIteratorAt(0);
55+
for (const auto& _ : mcCollisions) {
56+
o2::delphes::TrackSmearer smearer;
57+
const auto thisTable = luts.begin();
5858
// smearer.viewTable(static_cast<int>(PDG_t::kElectron), thisTable.lutEl());
5959
// smearer.viewTable(static_cast<int>(PDG_t::kMuonMinus), thisTable.lutMu());
6060
// smearer.viewTable(static_cast<int>(PDG_t::kPiPlus), thisTable.lutPi());

ALICE3/TableProducer/OTF/testCcdbConsumer1.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct TestCcdbConsumer1 {
3737
o2::framework::HistogramRegistry histos{"Histos", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject};
3838
o2::framework::ConfigurableAxis axisDeltaPt{"axisDeltaPt", {200, -0.2f, +0.2f}, "#Delta p_{T}"};
3939

40-
o2::delphes::DelphesO2TrackSmearer smearer;
40+
o2::delphes::TrackSmearer smearer;
4141
o2::framework::Service<o2::framework::O2DatabasePDG> pdgDB;
4242
const std::unordered_set<int> pdgsToBeHandled = {PDG_t::kElectron, PDG_t::kMuonMinus, PDG_t::kPiPlus, PDG_t::kKPlus, PDG_t::kProton};
4343

ALICE3/TableProducer/OTF/testCcdbConsumer2.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct TestCcdbConsumer2 {
3636
o2::framework::HistogramRegistry histos{"Histos", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject};
3737
o2::framework::ConfigurableAxis axisDeltaPt{"axisDeltaPt", {200, -0.2f, +0.2f}, "#Delta p_{T}"};
3838

39-
o2::delphes::DelphesO2TrackSmearer smearer;
39+
o2::delphes::TrackSmearer smearer;
4040
o2::framework::Service<o2::framework::O2DatabasePDG> pdgDB;
4141
const std::unordered_set<int> pdgsToBeHandled = {PDG_t::kElectron, PDG_t::kMuonMinus, PDG_t::kPiPlus, PDG_t::kKPlus, PDG_t::kProton};
4242

0 commit comments

Comments
 (0)