@@ -129,7 +129,6 @@ struct OnTheFlyRichPid {
129129 Configurable<float > bRichRefractiveIndexSector20{" bRichRefractiveIndexSector20" , 1.03 , " barrel RICH refractive index central(s)-20 and central(s)+20" }; // central(s)-20 and central(s)+20
130130 Configurable<float > bRICHPixelSize{" bRICHPixelSize" , 0.1 , " barrel RICH pixel size (cm)" };
131131 Configurable<float > bRichGapRefractiveIndex{" bRichGapRefractiveIndex" , 1.000283 , " barrel RICH gap refractive index" };
132- Configurable<bool > cleanLutWhenLoaded{" cleanLutWhenLoaded" , true , " clean LUTs after being loaded to save disk space" };
133132
134133 o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
135134
@@ -292,59 +291,59 @@ struct OnTheFlyRichPid {
292291 mGeoContainer .init (initContext);
293292
294293 const int nGeometries = mGeoContainer .getNumberOfConfigurations ();
295- mMagneticField = mGeoContainer .getFloatValue (0 , " global" , " magneticfield" );
296-
297294 pRandomNumberGenerator.SetSeed (0 ); // fully randomize
295+ mMagneticField = mGeoContainer .getFloatValue (0 , " global" , " magneticfield" );
298296
299- for ( int icfg = 0 ; icfg < nGeometries; ++icfg ) {
300- const std::string histPath = " Configuration_ " + std::to_string ( icfg) + " / " ;
301- mSmearer .emplace_back (std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
302- mSmearer [icfg]->setCleanupDownloadedFile (cleanLutWhenLoaded. value );
303- mSmearer [icfg]->setCcdbManager (ccdb.operator ->());
304- mSmearer [icfg]->setDownloadPath (" ./.ALICE3/RICHPID/" );
305- std::map<std::string, std::string> globalConfiguration = mGeoContainer .getConfiguration (icfg, " global" );
306- for (const auto & entry : globalConfiguration) {
307- int pdg = 0 ;
308- if (entry.first .find (" lut" ) != 0 ) {
309- continue ;
310- }
311- if (entry.first .find (" lutEl" ) != std::string::npos) {
312- pdg = kElectron ;
313- } else if (entry.first .find (" lutMu" ) != std::string::npos) {
314- pdg = kMuonMinus ;
315- } else if (entry.first .find (" lutPi" ) != std::string::npos) {
316- pdg = kPiPlus ;
317- } else if (entry.first .find (" lutKa" ) != std::string::npos) {
318- pdg = kKPlus ;
319- } else if (entry.first .find (" lutPr" ) != std::string::npos) {
320- pdg = kProton ;
321- } else if (entry.first .find (" lutDe" ) != std::string::npos) {
322- pdg = o2::constants::physics::kDeuteron ;
323- } else if (entry.first .find (" lutTr" ) != std::string::npos) {
324- pdg = o2::constants::physics::kTriton ;
325- } else if (entry.first .find (" lutHe3" ) != std::string::npos) {
326- pdg = o2::constants::physics::kHelium3 ;
327- } else if (entry.first .find (" lutAl" ) != std::string::npos) {
328- pdg = o2::constants::physics::kAlpha ;
329- }
297+ if (flagRICHLoadDelphesLUTs ) {
298+ for ( int icfg = 0 ; icfg < nGeometries; ++icfg) {
299+ mSmearer .emplace_back (std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
300+ mSmearer [icfg]->setCleanupDownloadedFile (mGeoContainer . cleanLutWhenLoaded () );
301+ mSmearer [icfg]->setCcdbManager (ccdb.operator ->());
302+ mSmearer [icfg]->setDownloadPath (" ./.ALICE3/RICHPID/" );
303+ std::map<std::string, std::string> globalConfiguration = mGeoContainer .getConfiguration (icfg, " global" );
304+ for (const auto & entry : globalConfiguration) {
305+ int pdg = 0 ;
306+ if (entry.first .find (" lut" ) != 0 ) {
307+ continue ;
308+ }
309+ if (entry.first .find (" lutEl" ) != std::string::npos) {
310+ pdg = kElectron ;
311+ } else if (entry.first .find (" lutMu" ) != std::string::npos) {
312+ pdg = kMuonMinus ;
313+ } else if (entry.first .find (" lutPi" ) != std::string::npos) {
314+ pdg = kPiPlus ;
315+ } else if (entry.first .find (" lutKa" ) != std::string::npos) {
316+ pdg = kKPlus ;
317+ } else if (entry.first .find (" lutPr" ) != std::string::npos) {
318+ pdg = kProton ;
319+ } else if (entry.first .find (" lutDe" ) != std::string::npos) {
320+ pdg = o2::constants::physics::kDeuteron ;
321+ } else if (entry.first .find (" lutTr" ) != std::string::npos) {
322+ pdg = o2::constants::physics::kTriton ;
323+ } else if (entry.first .find (" lutHe3" ) != std::string::npos) {
324+ pdg = o2::constants::physics::kHelium3 ;
325+ } else if (entry.first .find (" lutAl" ) != std::string::npos) {
326+ pdg = o2::constants::physics::kAlpha ;
327+ }
330328
331- std::string filename = entry.second ;
332- if (pdg == 0 ) {
333- LOG (fatal) << " Unknown LUT entry " << entry.first << " for global configuration" ;
334- }
335- LOG (info) << " Loading LUT for pdg " << pdg << " for config " << icfg << " from provided file '" << filename << " '" ;
336- if (filename.empty ()) {
337- LOG (warning) << " No LUT file passed for pdg " << pdg << " , skipping." ;
338- }
339- // strip from leading/trailing spaces
340- filename.erase (0 , filename.find_first_not_of (" " ));
341- filename.erase (filename.find_last_not_of (" " ) + 1 );
342- if (filename.empty ()) {
343- LOG (warning) << " No LUT file passed for pdg " << pdg << " , skipping." ;
344- }
345- bool success = mSmearer [icfg]->loadTable (pdg, filename.c_str ());
346- if (!success) {
347- LOG (fatal) << " Having issue with loading the LUT " << pdg << " " << filename;
329+ std::string filename = entry.second ;
330+ if (pdg == 0 ) {
331+ LOG (fatal) << " Unknown LUT entry " << entry.first << " for global configuration" ;
332+ }
333+ LOG (info) << " Loading LUT for pdg " << pdg << " for config " << icfg << " from provided file '" << filename << " '" ;
334+ if (filename.empty ()) {
335+ LOG (warning) << " No LUT file passed for pdg " << pdg << " , skipping." ;
336+ }
337+ // strip from leading/trailing spaces
338+ filename.erase (0 , filename.find_first_not_of (" " ));
339+ filename.erase (filename.find_last_not_of (" " ) + 1 );
340+ if (filename.empty ()) {
341+ LOG (warning) << " No LUT file passed for pdg " << pdg << " , skipping." ;
342+ }
343+ bool success = mSmearer [icfg]->loadTable (pdg, filename.c_str ());
344+ if (!success) {
345+ LOG (fatal) << " Having issue with loading the LUT " << pdg << " " << filename;
346+ }
348347 }
349348 }
350349 }
0 commit comments