@@ -34,7 +34,7 @@ struct OnTheFlyDetectorGeometryProvider {
3434 o2::framework::Configurable<std::vector<std::string>> detectorConfiguration{" detectorConfiguration" ,
3535 std::vector<std::string>{" $O2PHYSICS_ROOT/share/alice3/a3geometry_v3.ini" },
3636 " Paths of the detector geometry configuration files" };
37- o2::framework::Produces<o2::aod::TOFCalibrationObjects> tofCalibObjects ;
37+ o2::framework::Produces<o2::aod::LUTs> lutTable ;
3838 o2::framework::Service<o2::ccdb::BasicCCDBManager> ccdb;
3939 void init (o2::framework::InitContext&)
4040 {
@@ -66,9 +66,41 @@ struct OnTheFlyDetectorGeometryProvider {
6666 LOG (info) << " Initialization completed" ;
6767 }
6868
69+ lutHeader_t* mLUTHeader [10 ] = {nullptr };
6970 void process (o2::aod::McCollisions const & mcCollisions, o2::aod::McParticles const & mcParticles)
7071 {
71- LOG (debug) << " On-the-fly detector geometry provider processing " << mcCollisions.size () << " collisions and " << mcParticles.size () << " particles." ;
72+ const int ipdg = 0 ;
73+ mLUTHeader [ipdg] = new lutHeader_t;
74+
75+ const std::string filename = " ccdb:/Users/j/jekarlss/LookUpTables/NoEloss/el" ;
76+ const std::string localFilename = o2::fastsim::GeometryEntry::accessFile (filename, " ./.ALICE3/LUTs/" , ccdb.operator ->(), 10 );
77+
78+ std::ifstream lutFile (localFilename, std::ifstream::binary);
79+ if (!lutFile.is_open ()) {
80+ LOG (info) << " --- cannot open covariance matrix file for PDG " << pdg << " : " << localFilename << std::endl;
81+ delete mLUTHeader [ipdg];
82+ mLUTHeader [ipdg] = nullptr ;
83+ return false ;
84+ }
85+ lutFile.read (reinterpret_cast <char *>(mLUTHeader [ipdg]), sizeof (lutHeader_t));
86+ if (lutFile.gcount () != sizeof (lutHeader_t)) {
87+ LOG (info) << " --- troubles reading covariance matrix header for PDG " << pdg << " : " << filename << std::endl;
88+ LOG (info) << " --- expected/detected " << sizeof (lutHeader_t) << " /" << lutFile.gcount () << std::endl;
89+ delete mLUTHeader [ipdg];
90+ mLUTHeader [ipdg] = nullptr ;
91+ return false ;
92+ }
93+ if (mLUTHeader [ipdg]->version != LUTCOVM_VERSION) {
94+ LOG (info) << " --- LUT header version mismatch: expected/detected = " << LUTCOVM_VERSION << " /" << mLUTHeader [ipdg]->version << std::endl;
95+ delete mLUTHeader [ipdg];
96+ mLUTHeader [ipdg] = nullptr ;
97+ return false ;
98+ }
99+
100+ lutTable
101+
102+ LOG (debug)
103+ << " On-the-fly detector geometry provider processing " << mcCollisions.size () << " collisions and " << mcParticles.size () << " particles." ;
72104 }
73105};
74106
0 commit comments