Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 18 additions & 75 deletions ALICE3/Core/FastTracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -314,88 +314,31 @@
}
}

std::map<std::string, std::map<std::string, std::string>> FastTracker::parseTEnvConfiguration(std::string filename)
void FastTracker::AddGenericDetector(GeometryContainer::GeometryEntry configMap, o2::ccdb::BasicCCDBManager* ccdbManager)
{
std::map<std::string, std::map<std::string, std::string>> configMap;

TEnv env(filename.c_str());
THashList* table = env.GetTable();
std::vector<std::string> layers;
for (int i = 0; i < table->GetEntries(); ++i) {
const std::string key = table->At(i)->GetName();
// key should contain exactly one dot
if (key.find('.') == std::string::npos || key.find('.') != key.rfind('.')) {
LOG(fatal) << "Key " << key << " does not contain exactly one dot";
// Layers
for (const auto& layer : configMap.getLayerNames()) {
if (layer.find("global") != std::string::npos) { // Layers with global tag are skipped
LOG(info) << " Skipping global configuration entry " << layer;
continue;
}
const std::string firstPart = key.substr(0, key.find('.'));
if (std::find(layers.begin(), layers.end(), firstPart) == layers.end()) {
layers.push_back(firstPart);
}
}
env.Print();

// Layers
for (const auto& layer : layers) {
LOG(info) << " Reading layer " << layer;
for (int i = 0; i < table->GetEntries(); ++i) {
const std::string key = table->At(i)->GetName();
if (key.find(layer + ".") == 0) {
const std::string paramName = key.substr(key.find('.') + 1);
const std::string value = env.GetValue(key.c_str(), "");
configMap[layer][paramName] = value;
}
}
}
return configMap;
}

void FastTracker::AddGenericDetector(std::string filename, o2::ccdb::BasicCCDBManager* ccdbManager)
{
LOG(info) << " Adding generic detector from file " << filename;
// If the filename starts with ccdb: then take the file from the ccdb
if (filename.rfind("ccdb:", 0) == 0) {
std::string ccdbPath = filename.substr(5); // remove "ccdb:" prefix
if (ccdbManager == nullptr) {
LOG(fatal) << "CCDB manager is null, cannot retrieve file " << ccdbPath;
return;
}
const std::string outPath = "/tmp/DetGeo/";
filename = Form("%s/%s/snapshot.root", outPath.c_str(), ccdbPath.c_str());
std::ifstream checkFile(filename); // Check if file already exists
if (!checkFile.is_open()) { // File does not exist, retrieve from CCDB
LOG(info) << " --- CCDB source detected for detector geometry " << filename;
std::map<std::string, std::string> metadata;
ccdbManager->getCCDBAccessor().retrieveBlob(ccdbPath, outPath, metadata, 1);
// Add CCDB handling logic here if needed
LOG(info) << " --- Now retrieving geometry configuration from CCDB to: " << filename;
} else { // File exists, proceed to load
LOG(info) << " --- Geometry configuration file already exists: " << filename << ". Skipping download.";
checkFile.close();
}
AddGenericDetector(filename, nullptr);
return;
}

std::map<std::string, std::map<std::string, std::string>> configMap = parseTEnvConfiguration(filename);
// Layers
for (const auto& layer : configMap) {
LOG(info) << " Reading layer " << layer.first;
const float r = std::stof(layer.second.at("r"));
LOG(info) << " Layer " << layer.first << " has radius " << r;
const float z = std::stof(layer.second.at("z"));
const float x0 = std::stof(layer.second.at("x0"));
const float xrho = std::stof(layer.second.at("xrho"));
const float resRPhi = std::stof(layer.second.at("resRPhi"));
const float resZ = std::stof(layer.second.at("resZ"));
const float eff = std::stof(layer.second.at("eff"));
const int type = std::stoi(layer.second.at("type"));
const std::string deadPhiRegions = layer.second.at("deadPhiRegions");
const float r = configMap.getFloatValue(layer, "r");
LOG(info) << " Layer " << layer << " has radius " << r;
const float z = configMap.getFloatValue(layer, "z");
const float x0 = configMap.getFloatValue(layer, "x0");
const float xrho = configMap.getFloatValue(layer, "xrho");
const float resRPhi = configMap.getFloatValue(layer, "resRPhi");
const float resZ = configMap.getFloatValue(layer, "resZ");
const float eff = configMap.getFloatValue(layer, "eff");
const int type = configMap.getIntValue(layer, "type");
const std::string deadPhiRegions = configMap.getValue(layer, "deadPhiRegions", false);

// void AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi = 0.0f, float resZ = 0.0f, float eff = 0.0f, int type = 0);
LOG(info) << " Adding layer " << layer.first << " r=" << r << " z=" << z << " x0=" << x0 << " xrho=" << xrho << " resRPhi=" << resRPhi << " resZ=" << resZ << " eff=" << eff << " type=" << type << " deadPhiRegions=" << deadPhiRegions;
LOG(info) << " Adding layer " << layer << " r=" << r << " z=" << z << " x0=" << x0 << " xrho=" << xrho << " resRPhi=" << resRPhi << " resZ=" << resZ << " eff=" << eff << " type=" << type << " deadPhiRegions=" << deadPhiRegions;

DetLayer* addedLayer = AddLayer(layer.first.c_str(), r, z, x0, xrho, resRPhi, resZ, eff, type);
DetLayer* addedLayer = AddLayer(layer.c_str(), r, z, x0, xrho, resRPhi, resZ, eff, type);
if (!deadPhiRegions.empty()) { // Taking it as ccdb path or local file
// Check if it begins with ccdb:
if (std::string(deadPhiRegions).rfind("ccdb:", 0) == 0) {
Expand All @@ -418,7 +361,7 @@
addedLayer->setDeadPhiRegions(g);
}
} else {
LOG(debug) << " No dead phi regions for layer " << layer.first;
LOG(debug) << " No dead phi regions for layer " << layer;
}
}
}
Expand All @@ -438,7 +381,7 @@
index = 1;
z0 = -4 * sigmaD + i * dz0;
dist += index * (dz0 / 3.) * (1 / o2::math_utils::sqrt(o2::constants::math::TwoPI) / sigmaD) * std::exp(-z0 * z0 / 2. / sigmaD / sigmaD) * (1 / o2::math_utils::sqrt((z - z0) * (z - z0) + r * r));
if (index != 4)

Check failure on line 384 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
index = 4;
else
index = 2;
Expand Down Expand Up @@ -568,7 +511,7 @@
// check if layer is reached
float targetX = 1e+3;
inputTrack.getXatLabR(layers[il].getRadius(), targetX, magneticField);
if (targetX > 999.f) {

Check failure on line 514 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOGF(debug, "Failed to find intercept for layer %d at radius %.2f cm", il, layers[il].getRadius());
break; // failed to find intercept
}
Expand Down Expand Up @@ -650,7 +593,7 @@

float targetX = 1e+3;
inputTrack.getXatLabR(layers[il].getRadius(), targetX, magneticField);
if (targetX > 999)

Check failure on line 596 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
continue; // failed to find intercept

if (!inputTrack.propagateTo(targetX, magneticField)) {
Expand Down Expand Up @@ -722,7 +665,7 @@
// backpropagate to original radius
float finalX = 1e+3;
bool inPropStatus = inwardTrack.getXatLabR(initialRadius, finalX, magneticField);
if (finalX > 999) {

Check failure on line 668 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
LOG(debug) << "Failed to find intercept for initial radius " << initialRadius << " cm, x = " << finalX << " and status " << inPropStatus << " and sn = " << inwardTrack.getSnp() << " r = " << inwardTrack.getY() * inwardTrack.getY();
return -3; // failed to find intercept
}
Expand All @@ -732,7 +675,7 @@
}

// only attempt to continue if intercepts are at least four
if (nIntercepts < 4)

Check failure on line 678 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
return nIntercepts;

// generate efficiency
Expand All @@ -759,7 +702,7 @@
TMatrixDSym m(5);
double fcovm[5][5]; // double precision is needed for regularisation

for (int ii = 0, k = 0; ii < 5; ++ii) {

Check failure on line 705 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (int j = 0; j < ii + 1; ++j, ++k) {
fcovm[ii][j] = covMat[k];
fcovm[j][ii] = covMat[k];
Expand All @@ -767,7 +710,7 @@
}

// evaluate ruben's conditional, regularise
const bool makePositiveDefinite = (covMatFactor > -1e-5); // apply fix

Check failure on line 713 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
bool rubenConditional = false;
for (int ii = 0; ii < 5; ii++) {
for (int jj = 0; jj < 5; jj++) {
Expand All @@ -776,7 +719,7 @@
if (fcovm[ii][jj] * fcovm[ii][jj] > std::abs(fcovm[ii][ii] * fcovm[jj][jj])) {
rubenConditional = true;
if (makePositiveDefinite) {
fcovm[ii][jj] = TMath::Sign(1, fcovm[ii][jj]) * covMatFactor * sqrt(std::abs(fcovm[ii][ii] * fcovm[jj][jj]));

Check failure on line 722 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}
}
}
Expand Down Expand Up @@ -814,7 +757,7 @@
for (int j = 0; j < 5; ++j)
val += eigVec[j][ii] * outputTrack.getParam(j);
// smear parameters according to eigenvalues
params_[ii] = gRandom->Gaus(val, sqrt(eigVal[ii]));

Check failure on line 760 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
}

// invert eigenvector matrix
Expand All @@ -827,7 +770,7 @@
outputTrack.setParam(val, ii);
}
// should make a sanity check that par[2] sin(phi) is in [-1, 1]
if (fabs(outputTrack.getParam(2)) > 1.) {

Check failure on line 773 in ALICE3/Core/FastTracker.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[std-prefix]

Use std:: prefix for names from the std namespace.
LOG(info) << " --- smearTrack failed sin(phi) sanity check: " << outputTrack.getParam(2);
return -2;
}
Expand Down
12 changes: 2 additions & 10 deletions ALICE3/Core/FastTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,24 +127,16 @@ class FastTracker
void AddSiliconALICE3(float scaleX0VD, std::vector<float> pixelResolution);
void AddTPC(float phiResMean, float zResMean);

/**
* @brief Parses a TEnv configuration file and returns the key-value pairs split per entry
* @param filename Path to the TEnv configuration file
* @return A map where each key is a layer name and the value is another map of key-value pairs for that layer
*/
std::map<std::string, std::map<std::string, std::string>> parseTEnvConfiguration(std::string filename);

/**
* @brief Adds a generic detector configuration from the specified file.
*
* This function loads and integrates a detector configuration into the tracker
* using the provided filename. The file should contain the necessary parameters
* and settings for the detector to be added.
*
* @param filename Path to the configuration file describing the detector.
* @param ccdbManager Pointer to a BasicCCDBManager instance for database access (if needed).
* @param configMap Configuration map describing the detector.
*/
void AddGenericDetector(std::string filename, o2::ccdb::BasicCCDBManager* ccdbManager = nullptr);
void AddGenericDetector(GeometryContainer::GeometryEntry configMap, o2::ccdb::BasicCCDBManager* ccdbManager = nullptr);

void Print();

Expand Down
8 changes: 4 additions & 4 deletions ALICE3/TableProducer/OTF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@

o2physics_add_dpl_workflow(onthefly-tracker
SOURCES onTheFlyTracker.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2::DetectorsVertexing O2::DCAFitter O2Physics::ALICE3Core O2Physics::FastTracker
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2::DetectorsVertexing O2::DCAFitter O2Physics::ALICE3Core O2Physics::FastTracker
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(onthefly-tofpid
SOURCES onTheFlyTofPid.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core O2Physics::FastTracker
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(onthefly-richpid
SOURCES onTheFlyRichPid.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core O2Physics::FastTracker
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(on-the-fly-tracker-pid
SOURCES onTheFlyTrackerPid.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::ReconstructionDataFormats O2::DetectorsCommonDataFormats O2Physics::ALICE3Core O2Physics::FastTracker
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(on-the-fly-detector-geometry-provider
Expand Down
11 changes: 11 additions & 0 deletions ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ struct OnTheFlyDetectorGeometryProvider {
geometryContainer.addEntry(configFile);
idx++;
}

// First we check that the magnetic field is consistent
const int nGeometries = geometryContainer.getNumberOfConfigurations();
const float mMagneticField = geometryContainer.getFloatValue(0, "global", "magneticfield");
for (int icfg = 0; icfg < nGeometries; ++icfg) {
const float cfgBfield = geometryContainer.getFloatValue(icfg, "global", "magneticfield");
if (std::abs(cfgBfield - mMagneticField) > 1e-3) {
LOG(fatal) << "Inconsistent magnetic field values between configurations 0 and " << icfg << ": " << mMagneticField << " vs " << cfgBfield;
}
}

pc.services().get<o2::framework::ControlService>().endOfStream();
pc.services().get<o2::framework::ControlService>().readyToQuit(o2::framework::QuitRequest::Me);
}
Expand Down
108 changes: 67 additions & 41 deletions ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
/// \since May 22, 2024
///

#include "TableHelper.h"

#include "ALICE3/Core/DelphesO2TrackSmearer.h"
#include "ALICE3/Core/FastTracker.h"
#include "ALICE3/Core/TrackUtilities.h"
#include "ALICE3/DataModel/OTFRICH.h"
#include "ALICE3/DataModel/OTFTracks.h"
#include "Common/Core/trackUtilities.h"
#include "Common/DataModel/TrackSelectionTables.h"

Expand Down Expand Up @@ -83,9 +83,6 @@ struct OnTheFlyRichPid {
// Necessary for LUTs
Service<o2::ccdb::BasicCCDBManager> ccdb;

// master setting: magnetic field
Configurable<float> magneticField{"magneticField", 0, "magnetic field (kilogauss) if 0, taken from the tracker task"};

// add rich-specific configurables here
Configurable<int> bRichNumberOfSectors{"bRichNumberOfSectors", 21, "barrel RICH number of sectors"};
Configurable<float> bRichPhotodetectorCentralModuleHalfLength{"bRichPhotodetectorCentralModuleHalfLength", 18.4 / 2.0, "barrel RICH photodetector central module half length (cm)"};
Expand Down Expand Up @@ -132,11 +129,12 @@ struct OnTheFlyRichPid {
Configurable<float> bRichRefractiveIndexSector20{"bRichRefractiveIndexSector20", 1.03, "barrel RICH refractive index central(s)-20 and central(s)+20"}; // central(s)-20 and central(s)+20
Configurable<float> bRICHPixelSize{"bRICHPixelSize", 0.1, "barrel RICH pixel size (cm)"};
Configurable<float> bRichGapRefractiveIndex{"bRichGapRefractiveIndex", 1.000283, "barrel RICH gap refractive index"};
Configurable<bool> cleanLutWhenLoaded{"cleanLutWhenLoaded", true, "clean LUTs after being loaded to save disk space"};

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

// Track smearer (here used to get relative pt and eta uncertainties)
o2::delphes::DelphesO2TrackSmearer mSmearer;
// Track smearer array, one per geometry
std::vector<std::unique_ptr<o2::delphes::DelphesO2TrackSmearer>> mSmearer;

// needed: random number generator for smearing
TRandom3 pRandomNumberGenerator;
Expand Down Expand Up @@ -286,40 +284,68 @@ struct OnTheFlyRichPid {
// std::cout << std::endl << std::endl;
}

// Configuration defined at init time
o2::fastsim::GeometryContainer mGeoContainer;
float mMagneticField = 0.0f;
void init(o2::framework::InitContext& initContext)
{
mGeoContainer.init(initContext);

const int nGeometries = mGeoContainer.getNumberOfConfigurations();
mMagneticField = mGeoContainer.getFloatValue(0, "global", "magneticfield");

pRandomNumberGenerator.SetSeed(0); // fully randomize

if (magneticField.value < o2::constants::math::Epsilon) {
LOG(info) << "Getting the magnetic field from the on-the-fly tracker task";
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", magneticField, false)) {
LOG(fatal) << "Could not get Bz from on-the-fly-tracker task";
}
LOG(info) << "Bz = " << magneticField.value << " T";
}
for (int icfg = 0; icfg < nGeometries; ++icfg) {
const std::string histPath = "Configuration_" + std::to_string(icfg) + "/";
mSmearer.emplace_back(std::make_unique<o2::delphes::DelphesO2TrackSmearer>());
mSmearer[icfg]->setCleanupDownloadedFile(cleanLutWhenLoaded.value);
mSmearer[icfg]->setCcdbManager(ccdb.operator->());
std::map<std::string, std::string> globalConfiguration = mGeoContainer.getConfiguration(icfg, "global");
for (const auto& entry : globalConfiguration) {
int pdg = 0;
if (entry.first.find("lut") != 0) {
continue;
}
if (entry.first.find("lutEl") != std::string::npos) {
pdg = kElectron;
} else if (entry.first.find("lutMu") != std::string::npos) {
pdg = kMuonMinus;
} else if (entry.first.find("lutPi") != std::string::npos) {
pdg = kPiPlus;
} else if (entry.first.find("lutKa") != std::string::npos) {
pdg = kKPlus;
} else if (entry.first.find("lutPr") != std::string::npos) {
pdg = kProton;
} else if (entry.first.find("lutDe") != std::string::npos) {
pdg = o2::constants::physics::kDeuteron;
} else if (entry.first.find("lutTr") != std::string::npos) {
pdg = o2::constants::physics::kTriton;
} else if (entry.first.find("lutHe3") != std::string::npos) {
pdg = o2::constants::physics::kHelium3;
} else if (entry.first.find("lutAl") != std::string::npos) {
pdg = o2::constants::physics::kAlpha;
}

// Load LUT for pt and eta smearing
if (flagIncludeTrackAngularRes && flagRICHLoadDelphesLUTs) {
mSmearer.setCcdbManager(ccdb.operator->());
auto loadLUT = [&](int pdg, const std::string& cfgNameToInherit) {
std::string lut = "none";
if (!getTaskOptionValue(initContext, "on-the-fly-tracker", cfgNameToInherit, lut, false)) {
LOG(fatal) << "Could not get " << cfgNameToInherit << " from on-the-fly-tracker task";
std::string filename = entry.second;
if (pdg == 0) {
LOG(fatal) << "Unknown LUT entry " << entry.first << " for global configuration";
}
bool success = mSmearer.loadTable(pdg, lut.c_str());
if (!success && !lut.empty()) {
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << lut;
LOG(info) << "Loading LUT for pdg " << pdg << " for config " << icfg << " from provided file '" << filename << "'";
if (filename.empty()) {
LOG(warning) << "No LUT file passed for pdg " << pdg << ", skipping.";
}
};
loadLUT(11, "lutEl");
loadLUT(13, "lutMu");
loadLUT(211, "lutPi");
loadLUT(321, "lutKa");
loadLUT(2212, "lutPr");
loadLUT(1000010020, "lutDe");
loadLUT(1000010030, "lutTr");
loadLUT(1000020030, "lutHe3");
loadLUT(1000020040, "lutAl");
// strip from leading/trailing spaces
filename.erase(0, filename.find_first_not_of(" "));
filename.erase(filename.find_last_not_of(" ") + 1);
if (filename.empty()) {
LOG(warning) << "No LUT file passed for pdg " << pdg << ", skipping.";
}
bool success = mSmearer[icfg]->loadTable(pdg, filename.c_str());
if (!success) {
LOG(fatal) << "Having issue with loading the LUT " << pdg << " " << filename;
}
}
}

if (doQAplots) {
Expand Down Expand Up @@ -691,7 +717,7 @@ struct OnTheFlyRichPid {
return trackAngularResolution;
}

void process(soa::Join<aod::Collisions, aod::McCollisionLabels>::iterator const& collision,
void process(soa::Join<aod::Collisions, aod::McCollisionLabels, aod::OTFLUTConfigId>::iterator const& collision,
soa::Join<aod::Tracks, aod::TracksCov, aod::McTrackLabels> const& tracks,
aod::McParticles const&,
aod::McCollisions const&)
Expand Down Expand Up @@ -751,7 +777,7 @@ struct OnTheFlyRichPid {
o2::track::TrackParCov o2track = o2::upgrade::convertMCParticleToO2Track(mcParticle, pdg);

// float xPv = kErrorValue;
if (o2track.propagateToDCA(mcPvVtx, magneticField)) {
if (o2track.propagateToDCA(mcPvVtx, mMagneticField)) {
// xPv = o2track.getX();
}

Expand Down Expand Up @@ -781,7 +807,7 @@ struct OnTheFlyRichPid {
const float projectiveRadiatorRadius = radiusRipple(o2track.getEta(), iSecor);
bool flagReachesRadiator = false;
if (projectiveRadiatorRadius > kErrorValue + 1.) {
flagReachesRadiator = checkMagfieldLimit(o2track, projectiveRadiatorRadius, magneticField);
flagReachesRadiator = checkMagfieldLimit(o2track, projectiveRadiatorRadius, mMagneticField);
}
/// DISCLAIMER: Exact extrapolation of angular resolution would require track propagation
/// to the RICH radiator (accounting sector inclination) in terms of (R,z).
Expand All @@ -794,7 +820,7 @@ struct OnTheFlyRichPid {
// Now we calculate the expected Cherenkov angle following certain mass hypotheses
// and the (imperfect!) reconstructed track parametrizations
auto recoTrack = getTrackParCov(track);
if (recoTrack.propagateToDCA(pvVtx, magneticField)) {
if (recoTrack.propagateToDCA(pvVtx, mMagneticField)) {
// xPv = recoTrack.getX();
}

Expand Down Expand Up @@ -844,9 +870,9 @@ struct OnTheFlyRichPid {
double ptResolution = transverseMomentum * transverseMomentum * std::sqrt(recoTrack.getSigma1Pt2());
double etaResolution = std::fabs(std::sin(2.0 * std::atan(std::exp(-recoTrack.getEta())))) * std::sqrt(recoTrack.getSigmaTgl2());
if (flagRICHLoadDelphesLUTs) {
if (mSmearer.hasTable(kParticlePdgs[ii])) {
ptResolution = mSmearer.getAbsPtRes(kParticlePdgs[ii], dNdEta, recoTrack.getEta(), transverseMomentum);
etaResolution = mSmearer.getAbsEtaRes(kParticlePdgs[ii], dNdEta, recoTrack.getEta(), transverseMomentum);
if (mSmearer[collision.lutConfigId()]->hasTable(kParticlePdgs[ii])) {
ptResolution = mSmearer[collision.lutConfigId()]->getAbsPtRes(kParticlePdgs[ii], dNdEta, recoTrack.getEta(), transverseMomentum);
etaResolution = mSmearer[collision.lutConfigId()]->getAbsEtaRes(kParticlePdgs[ii], dNdEta, recoTrack.getEta(), transverseMomentum);
}
}
// cout << endl << "Pt resolution: " << ptResolution << ", Eta resolution: " << etaResolution << endl << endl;
Expand Down
Loading
Loading