@@ -110,19 +110,6 @@ struct OnTheFlyTracker {
110110 Configurable<bool > doExtraQA{" doExtraQA" , false , " do extra 2D QA plots" };
111111 Configurable<bool > extraQAwithoutDecayDaughters{" extraQAwithoutDecayDaughters" , false , " remove decay daughters from qa plots (yes/no)" };
112112
113- struct : ConfigurableGroup {
114- std::string prefix = " lookUpTables" ; // JSON group name
115- Configurable<std::vector<std::string>> lutEl{" lutEl" , std::vector<std::string>{" lutCovm.el.dat " }, " LUT for electrons (if emtpy no LUT is taken)" };
116- Configurable<std::vector<std::string>> lutMu{" lutMu" , std::vector<std::string>{" lutCovm.mu.dat " }, " LUT for muons (if emtpy no LUT is taken)" };
117- Configurable<std::vector<std::string>> lutPi{" lutPi" , std::vector<std::string>{" lutCovm.pi.dat " }, " LUT for pions (if emtpy no LUT is taken)" };
118- Configurable<std::vector<std::string>> lutKa{" lutKa" , std::vector<std::string>{" lutCovm.ka.dat " }, " LUT for kaons (if emtpy no LUT is taken)" };
119- Configurable<std::vector<std::string>> lutPr{" lutPr" , std::vector<std::string>{" lutCovm.pr.dat " }, " LUT for protons (if emtpy no LUT is taken)" };
120- Configurable<std::vector<std::string>> lutDe{" lutDe" , std::vector<std::string>{" " }, " LUT for deuterons (if emtpy no LUT is taken)" };
121- Configurable<std::vector<std::string>> lutTr{" lutTr" , std::vector<std::string>{" " }, " LUT for tritons (if emtpy no LUT is taken)" };
122- Configurable<std::vector<std::string>> lutHe3{" lutHe3" , std::vector<std::string>{" " }, " LUT for Helium-3 (if emtpy no LUT is taken)" };
123- Configurable<std::vector<std::string>> lutAl{" lutAl" , std::vector<std::string>{" " }, " LUT for Alphas (if emtpy no LUT is taken)" };
124- } lookUpTables;
125-
126113 struct : ConfigurableGroup {
127114 ConfigurableAxis axisMomentum{" axisMomentum" , {VARIABLE_WIDTH, 0 .0f , 0 .1f , 0 .2f , 0 .3f , 0 .4f , 0 .5f , 0 .6f , 0 .7f , 0 .8f , 0 .9f , 1 .0f , 1 .1f , 1 .2f , 1 .3f , 1 .4f , 1 .5f , 1 .6f , 1 .7f , 1 .8f , 1 .9f , 2 .0f , 2 .2f , 2 .4f , 2 .6f , 2 .8f , 3 .0f , 3 .2f , 3 .4f , 3 .6f , 3 .8f , 4 .0f , 4 .4f , 4 .8f , 5 .2f , 5 .6f , 6 .0f , 6 .5f , 7 .0f , 7 .5f , 8 .0f , 9 .0f , 10 .0f , 11 .0f , 12 .0f , 13 .0f , 14 .0f , 15 .0f , 17 .0f , 19 .0f , 21 .0f , 23 .0f , 25 .0f , 30 .0f , 35 .0f , 40 .0f , 50 .0f }, " #it{p} (GeV/#it{c})" };
128115 ConfigurableAxis axisNVertices{" axisNVertices" , {20 , -0.5 , 19.5 }, " N_{vertices}" };
@@ -162,7 +149,6 @@ struct OnTheFlyTracker {
162149 std::string prefix = " fastPrimaryTrackerSettings" ;
163150 Configurable<bool > fastTrackPrimaries{" fastTrackPrimaries" , false , " Use fasttracker for primary tracks. Enable with care" };
164151 Configurable<int > minSiliconHits{" minSiliconHits" , 4 , " minimum number of silicon hits to accept track" };
165- Configurable<std::string> alice3geo{" alice3geo" , " 2" , " 0: ALICE 3 v1, 1: ALICE 3 v4, 2: ALICE 3 Sep 2025, or path to ccdb with a3 geo" };
166152 Configurable<bool > applyZacceptance{" applyZacceptance" , false , " apply z limits to detector layers or not" };
167153 Configurable<bool > applyMSCorrection{" applyMSCorrection" , true , " apply ms corrections for secondaries or not" };
168154 Configurable<bool > applyElossCorrection{" applyElossCorrection" , true , " apply eloss corrections for secondaries or not" };
@@ -309,68 +295,64 @@ struct OnTheFlyTracker {
309295 o2::fastsim::GeometryContainer geoContainer;
310296 geoContainer.init (initContext);
311297
312- auto loadLUT = [&](int icfg, int pdg, const std::vector<std::string>& tables) {
313- LOG (info) << " Loading LUT for pdg " << pdg << " for config " << icfg << " from provided tables with size " << tables.size ();
314- if (tables.empty ()) {
315- LOG (debug) << " No LUT file passed for pdg " << pdg << " , skipping." ;
316- return false ;
317- }
318- const bool foundNewCfg = static_cast <size_t >(icfg) < tables.size ();
319- std::string lutFile = foundNewCfg ? tables[icfg] : tables.front ();
320- LOG (info) << " Loading LUT for pdg " << pdg << " from file " << lutFile << " for config " << icfg;
321- // strip from leading/trailing spaces
322- lutFile.erase (0 , lutFile.find_first_not_of (" " ));
323- lutFile.erase (lutFile.find_last_not_of (" " ) + 1 );
324- if (lutFile.empty ()) {
325- LOG (info) << " Empty LUT file name for pdg " << pdg << " , skipping." ;
326- return false ;
327- }
328- bool success = mSmearer [icfg]->loadTable (pdg, lutFile.c_str ());
329- if (!success) {
330- LOG (fatal) << " Having issue with loading the LUT " << pdg << " " << lutFile;
331- }
332-
333- return foundNewCfg;
334- };
335- int nGeometries = static_cast <int >(fastTrackerSettings.alice3geo ->size ());
336- if (enablePrimarySmearing)
337- nGeometries = static_cast <int >(lookUpTables.lutPi ->size ());
338- if (enablePrimarySmearing && enableSecondarySmearing) {
339- if (static_cast <int >(lookUpTables.lutPi ->size ()) != static_cast <int >(fastTrackerSettings.alice3geo ->size ())) {
340- LOG (fatal) << " When enabling both primary and secondary smearing, the number of LUTs provided must match the number of geometries provided!" ;
341- }
342- }
343-
298+ const int nGeometries = static_cast <int >(fastTrackerSettings.alice3geo ->size ());
344299 for (int icfg = 0 ; icfg < nGeometries; ++icfg) {
345- std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
300+ const std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
346301 mSmearer .emplace_back (std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
347302 mSmearer [icfg]->setCcdbManager (ccdb.operator ->());
348303 if (enablePrimarySmearing) {
349- // check if more configs were provided, fall back to first entry
350- bool newLUTLoaded = false ;
351- newLUTLoaded |= loadLUT (icfg, kElectron , lookUpTables.lutEl .value );
352- newLUTLoaded |= loadLUT (icfg, kMuonMinus , lookUpTables.lutMu .value );
353- newLUTLoaded |= loadLUT (icfg, kPiPlus , lookUpTables.lutPi .value );
354- newLUTLoaded |= loadLUT (icfg, kKPlus , lookUpTables.lutKa .value );
355- newLUTLoaded |= loadLUT (icfg, kProton , lookUpTables.lutPr .value );
356- newLUTLoaded |= loadLUT (icfg, o2::constants::physics::kDeuteron , lookUpTables.lutDe .value );
357- newLUTLoaded |= loadLUT (icfg, o2::constants::physics::kTriton , lookUpTables.lutTr .value );
358- newLUTLoaded |= loadLUT (icfg, o2::constants::physics::kHelium3 , lookUpTables.lutHe3 .value );
359- newLUTLoaded |= loadLUT (icfg, o2::constants::physics::kAlpha , lookUpTables.lutAl .value );
360- bool smearerOK = true ;
361- if (!newLUTLoaded) {
362- mSmearer .pop_back ();
363- // break;
364- smearerOK = false ;
304+ std::map<std::string, std::string> geoEntry = geoContainer.getConfiguration (icfg, " global" );
305+ // load LUTs for primaries
306+ for (const auto & entry : geoEntry) {
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+ }
330+
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;
348+ }
365349 }
366350
367351 // interpolate efficiencies if requested to do so
368- if (smearerOK) {
369- mSmearer [icfg]->interpolateEfficiency (static_cast <bool >(interpolateLutEfficiencyVsNch));
352+ mSmearer [icfg]->interpolateEfficiency (interpolateLutEfficiencyVsNch.value );
370353
371- // smear un-reco'ed tracks if asked to do so
372- mSmearer [icfg]->skipUnreconstructed (static_cast <bool >(!processUnreconstructedTracks));
373- }
354+ // smear un-reco'ed tracks if asked to do so
355+ mSmearer [icfg]->skipUnreconstructed (!processUnreconstructedTracks.value );
374356
375357 histPointers.insert ({histPath + " hPtGenerated" , histos.add ((histPath + " hPtGenerated" ).c_str (), " hPtGenerated" , {kTH1D , {{axes.axisMomentum }}})});
376358 histPointers.insert ({histPath + " hPhiGenerated" , histos.add ((histPath + " hPhiGenerated" ).c_str (), " hPhiGenerated" , {kTH1D , {{100 , 0 .0f , 2 * M_PI, " #phi (rad)" }}})});
@@ -397,16 +379,7 @@ struct OnTheFlyTracker {
397379 fastTracker[icfg]->SetApplyZacceptance (fastTrackerSettings.applyZacceptance );
398380 fastTracker[icfg]->SetApplyMSCorrection (fastTrackerSettings.applyMSCorrection );
399381 fastTracker[icfg]->SetApplyElossCorrection (fastTrackerSettings.applyElossCorrection );
400- if (fastTrackerSettings.alice3geo .value [icfg] == " 0" ) {
401- fastTracker[icfg]->AddSiliconALICE3v2 (fastTrackerSettings.pixelRes );
402- } else if (fastTrackerSettings.alice3geo .value [icfg] == " 1" ) {
403- fastTracker[icfg]->AddSiliconALICE3v4 (fastTrackerSettings.pixelRes );
404- fastTracker[icfg]->AddTPC (0.1 , 0.1 );
405- } else if (fastTrackerSettings.alice3geo .value [icfg] == " 2" ) {
406- fastTracker[icfg]->AddSiliconALICE3 (fastTrackerSettings.scaleVD , fastTrackerSettings.pixelRes );
407- } else {
408- fastTracker[icfg]->AddGenericDetector (geoContainer.getEntry (icfg).getConfigurations (), ccdb.operator ->());
409- }
382+ fastTracker[icfg]->AddGenericDetector (geoContainer.getEntry (icfg), ccdb.operator ->());
410383 // print fastTracker settings
411384 fastTracker[icfg]->Print ();
412385 if (cascadeDecaySettings.doXiQA )
@@ -516,14 +489,9 @@ struct OnTheFlyTracker {
516489 histos.add (" V0Building_Configuration_0/K0/hFinalMass" , " hMass" , kTH1F , {axes.axisK0Mass });
517490 histos.add (" V0Building_Configuration_0/Lambda/hMass" , " hMass" , kTH2F , {axes.axisLambdaMass , axes.axisMomentum });
518491 histos.add (" V0Building_Configuration_0/AntiLambda/hMass" , " hMass" , kTH2F , {axes.axisLambdaMass , axes.axisMomentum });
519- if (static_cast <int >(fastTrackerSettings.alice3geo ->size ()) > 1 ) {
520- if (fastTrackerSettings.alice3geo ->size () > 4 ) {
521- LOG (warn) << " More than 4 FastTracker configurations found. Only first 4 will have V0 QA histograms filled." ;
522- }
523- for (int icfg = 1 ; icfg < static_cast <int >(fastTrackerSettings.alice3geo ->size ()); icfg++) {
524- std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
525- histos.addClone (" V0Building_Configuration_0/" , fmt::format (" V0Building_{}" , histPath).c_str ());
526- }
492+ for (int icfg = 1 ; icfg < nGeometries; icfg++) {
493+ std::string histPath = " Configuration_" + std::to_string (icfg) + " /" ;
494+ histos.addClone (" V0Building_Configuration_0/" , fmt::format (" V0Building_{}" , histPath).c_str ());
527495 }
528496 }
529497
@@ -578,17 +546,7 @@ struct OnTheFlyTracker {
578546 fastPrimaryTracker.SetApplyZacceptance (fastPrimaryTrackerSettings.applyZacceptance );
579547 fastPrimaryTracker.SetApplyMSCorrection (fastPrimaryTrackerSettings.applyMSCorrection );
580548 fastPrimaryTracker.SetApplyElossCorrection (fastPrimaryTrackerSettings.applyElossCorrection );
581-
582- if (fastPrimaryTrackerSettings.alice3geo .value == " 0" ) {
583- fastPrimaryTracker.AddSiliconALICE3v2 ({0.00025 , 0.00025 , 0.001 , 0.001 });
584- } else if (fastPrimaryTrackerSettings.alice3geo .value == " 1" ) {
585- fastPrimaryTracker.AddSiliconALICE3v4 ({0.00025 , 0.00025 , 0.001 , 0.001 });
586- fastPrimaryTracker.AddTPC (0.1 , 0.1 );
587- } else if (fastPrimaryTrackerSettings.alice3geo .value == " 2" ) {
588- fastPrimaryTracker.AddSiliconALICE3 (1 ., {0.00025 , 0.00025 , 0.001 , 0.001 });
589- } else {
590- fastPrimaryTracker->AddGenericDetector (geoContainer.getEntry (0 ).getConfigurations (), ccdb.operator ->());
591- }
549+ fastPrimaryTracker.AddGenericDetector (geoContainer.getEntry (0 ), ccdb.operator ->());
592550
593551 // print fastTracker settings
594552 fastPrimaryTracker.Print ();
0 commit comments