Skip to content

Commit ce5ea89

Browse files
authored
A3RICH: inherit LUTs from OTF tracker
1 parent 3f1771a commit ce5ea89

File tree

1 file changed

+49
-34
lines changed

1 file changed

+49
-34
lines changed

ALICE3/TableProducer/OTF/onTheFlyRICHPID.cxx

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,27 @@
88
// In applying this license CERN does not waive the privileges and immunities
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
11-
12-
//
13-
// Task to add a table of track parameters propagated to the primary vertex
14-
//
11+
///
12+
/// \file onTheFlyRichPid.cxx
13+
///
14+
/// \brief This task goes straight from a combination of track table and mcParticles
15+
/// and a projective bRICH configuration to a table of TOF NSigmas for the particles
16+
/// being analysed. It currently contemplates 5 particle types:
17+
/// electrons, pions, kaons, protons and muons
18+
///
19+
/// More particles could be added but would have to be added to the LUT
20+
/// being used in the onTheFly tracker task.
21+
///
22+
/// \warning Geometry parameters are configurable, but resolution values should be adapted.
23+
/// Since angular resolution depends on the specific geometric details, it is better to
24+
/// calculate it from full simulation and add new input. Alternatively, an analytical
25+
/// expression can be provided as a function of the main parameters.
26+
/// Latest version: analytical parametrization of angular resolution !!!
27+
///
28+
/// \author David Dobrigkeit Chinellato, UNICAMP
29+
/// \author Nicola Nicassio, University and INFN Bari
30+
/// \since May 22, 2024
31+
///
1532

1633
#include <utility>
1734
#include <cmath>
@@ -42,28 +59,9 @@
4259
#include "TString.h"
4360
#include "ALICE3/DataModel/OTFRICH.h"
4461
#include "DetectorsVertexing/HelixHelper.h"
45-
4662
#include "TableHelper.h"
4763
#include "ALICE3/Core/DelphesO2TrackSmearer.h"
4864

49-
/// \file onTheFlyRichPid.cxx
50-
///
51-
/// \brief This task goes straight from a combination of track table and mcParticles
52-
/// and a projective bRICH configuration to a table of TOF NSigmas for the particles
53-
/// being analysed. It currently contemplates 5 particle types:
54-
/// electrons, pions, kaons, protons and muons.
55-
///
56-
/// More particles could be added but would have to be added to the LUT
57-
/// being used in the onTheFly tracker task.
58-
///
59-
/// \warning Geometry parameters are configurable, but resolution values should be adapted.
60-
/// Since angular resolution depends on the specific geometric details, it is better to
61-
/// calculate it from full simulation and add new input. Alternatively, an analytical
62-
/// expression can be provided as a function of the main parameters.
63-
/// Latest version: analytical parametrization of angular resolution !!!
64-
///
65-
/// \author David Dobrigkeit Chinellato, UNICAMP, Nicola Nicassio, University and INFN Bari
66-
6765
using namespace o2;
6866
using namespace o2::framework;
6967
using namespace o2::constants::math;
@@ -143,11 +141,13 @@ struct OnTheFlyRichPid {
143141
Configurable<float> bRICHPixelSize{"bRICHPixelSize", 0.1, "barrel RICH pixel size (cm)"};
144142
Configurable<float> bRichGapRefractiveIndex{"bRichGapRefractiveIndex", 1.000283, "barrel RICH gap refractive index"};
145143

146-
Configurable<std::string> lutEl{"lutEl", "lutCovm.el.dat", "LUT for electrons"};
147-
Configurable<std::string> lutMu{"lutMu", "lutCovm.mu.dat", "LUT for muons"};
148-
Configurable<std::string> lutPi{"lutPi", "lutCovm.pi.dat", "LUT for pions"};
149-
Configurable<std::string> lutKa{"lutKa", "lutCovm.ka.dat", "LUT for kaons"};
150-
Configurable<std::string> lutPr{"lutPr", "lutCovm.pr.dat", "LUT for protons"};
144+
struct : ConfigurableGroup {
145+
Configurable<std::string> lutEl{"lutEl", "inherit", "LUT for electrons (if inherit, inherits from otf tracker task)"};
146+
Configurable<std::string> lutMu{"lutMu", "inherit", "LUT for muons (if inherit, inherits from otf tracker task)"};
147+
Configurable<std::string> lutPi{"lutPi", "inherit", "LUT for pions (if inherit, inherits from otf tracker task)"};
148+
Configurable<std::string> lutKa{"lutKa", "inherit", "LUT for kaons (if inherit, inherits from otf tracker task)"};
149+
Configurable<std::string> lutPr{"lutPr", "inherit", "LUT for protons (if inherit, inherits from otf tracker task)"};
150+
} simConfig;
151151

152152
o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE;
153153

@@ -319,14 +319,29 @@ struct OnTheFlyRichPid {
319319
{
320320
pRandomNumberGenerator.SetSeed(0); // fully randomize
321321

322+
// Check if inheriting the LUT configuration
323+
auto configLutPath = [&](Configurable<std::string>& lut) {
324+
if (lut.value != "inherit") {
325+
return;
326+
}
327+
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", lut.name, lut.value, true)) {
328+
LOG(fatal) << "Could not get " << lut.name << " from on-the-fly-tracker task";
329+
}
330+
};
331+
configLutPath(simConfig.lutEl);
332+
configLutPath(simConfig.lutMu);
333+
configLutPath(simConfig.lutPi);
334+
configLutPath(simConfig.lutKa);
335+
configLutPath(simConfig.lutPr);
336+
322337
// Load LUT for pt and eta smearing
323338
if (flagIncludeTrackAngularRes && flagRICHLoadDelphesLUTs) {
324339
std::map<int, const char*> mapPdgLut;
325-
const char* lutElChar = lutEl->c_str();
326-
const char* lutMuChar = lutMu->c_str();
327-
const char* lutPiChar = lutPi->c_str();
328-
const char* lutKaChar = lutKa->c_str();
329-
const char* lutPrChar = lutPr->c_str();
340+
const char* lutElChar = simConfig.lutEl->c_str();
341+
const char* lutMuChar = simConfig.lutMu->c_str();
342+
const char* lutPiChar = simConfig.lutPi->c_str();
343+
const char* lutKaChar = simConfig.lutKa->c_str();
344+
const char* lutPrChar = simConfig.lutPr->c_str();
330345

331346
LOGF(info, "Will load electron lut file ..: %s for RICH PID", lutElChar);
332347
LOGF(info, "Will load muon lut file ......: %s for RICH PID", lutMuChar);
@@ -340,7 +355,7 @@ struct OnTheFlyRichPid {
340355
mapPdgLut.insert(std::make_pair(321, lutKaChar));
341356
mapPdgLut.insert(std::make_pair(2212, lutPrChar));
342357

343-
for (auto e : mapPdgLut) {
358+
for (const auto& e : mapPdgLut) {
344359
if (!mSmearer.loadTable(e.first, e.second)) {
345360
LOG(fatal) << "Having issue with loading the LUT " << e.first << " " << e.second;
346361
}

0 commit comments

Comments
 (0)