diff --git a/ALICE3/Core/DelphesO2LutWriter.cxx b/ALICE3/Core/DelphesO2LutWriter.cxx index 6f079c7ece1..65608d592e9 100644 --- a/ALICE3/Core/DelphesO2LutWriter.cxx +++ b/ALICE3/Core/DelphesO2LutWriter.cxx @@ -26,6 +26,7 @@ #include "iostream" #include "TMatrixD.h" #include "TVectorD.h" +#include "TAxis.h" #include "TMatrixDSymEigen.h" #include "TDatabasePDG.h" #include "TLorentzVector.h" @@ -55,7 +56,8 @@ bool DelphesO2LutWriter::fatSolve(lutEntry_t& lutEntry, const float mass, int itof, int otof, - int q) + int q, + const float nch) { lutEntry.valid = false; @@ -63,9 +65,9 @@ bool DelphesO2LutWriter::fatSolve(lutEntry_t& lutEntry, tlv.SetPtEtaPhiM(pt, eta, 0., mass); o2::track::TrackParCov trkIn; o2::upgrade::convertTLorentzVectorToO2Track(q, tlv, {0., 0., 0.}, trkIn); - o2::track::TrackParCov trkOut; - if (fat.FastTrack(trkIn, trkOut, 1) < 0) { + const int status = fat.FastTrack(trkIn, trkOut, nch); + if (status <= 0) { Printf(" --- fatSolve: FastTrack failed --- \n"); tlv.Print(); return false; @@ -234,6 +236,9 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in lutEntry_t lutEntry; // write entries + int nCalls = 0; + int successfullCalls = 0; + int failedCalls = 0; for (int inch = 0; inch < nnch; ++inch) { Printf(" --- writing nch = %d/%d", inch, nnch); auto nch = lutHeader.nchmap.eval(inch); @@ -242,6 +247,7 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in for (int irad = 0; irad < nrad; ++irad) { Printf(" --- writing irad = %d/%d", irad, nrad); for (int ieta = 0; ieta < neta; ++ieta) { + nCalls++; Printf(" --- writing ieta = %d/%d", ieta, neta); auto eta = lutHeader.etamap.eval(ieta); lutEntry.eta = lutHeader.etamap.eval(ieta); @@ -252,6 +258,7 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in if (std::fabs(eta) <= etaMaxBarrel) { // full lever arm ends at etaMaxBarrel Printf("Solving in the barrel"); // printf(" --- fatSolve: pt = %f, eta = %f, mass = %f, field=%f \n", lutEntry.pt, lutEntry.eta, lutHeader.mass, lutHeader.field); + successfullCalls++; if (!fatSolve(lutEntry, lutEntry.pt, lutEntry.eta, lutHeader.mass, itof, otof, q)) { // printf(" --- fatSolve: error \n"); lutEntry.valid = false; @@ -260,6 +267,8 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in for (int i = 0; i < 15; ++i) { lutEntry.covm[i] = 0.; } + successfullCalls--; + failedCalls++; } } else { Printf("Solving outside the barrel"); @@ -267,6 +276,7 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in lutEntry.eff = 1.; lutEntry.eff2 = 1.; bool retval = true; + successfullCalls++; if (useFlatDipole) { // Using the parametrization at the border of the barrel retval = fatSolve(lutEntry, lutEntry.pt, etaMaxBarrel, lutHeader.mass, itof, otof, q); } else if (usePara) { @@ -288,6 +298,8 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in for (int i = 0; i < 15; ++i) { lutEntry.covm[i] = 0.; } + successfullCalls--; + failedCalls++; } } Printf("Diagonalizing"); @@ -298,6 +310,8 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, in } } } + Printf(" --- finished writing LUT file %s", filename); + Printf(" --- successfull calls: %d/%d, failed calls: %d/%d", successfullCalls, nCalls, failedCalls, nCalls); lutFile.close(); } @@ -331,10 +345,13 @@ void DelphesO2LutWriter::diagonalise(lutEntry_t& lutEntry) TGraph* DelphesO2LutWriter::lutRead(const char* filename, int pdg, int what, int vs, float nch, float radius, float eta, float pt) { + Printf(" --- reading LUT file %s", filename); + // vs static const int kNch = 0; static const int kEta = 1; static const int kPt = 2; + // what static const int kEfficiency = 0; static const int kEfficiency2 = 1; static const int kEfficiencyInnerTOF = 2; @@ -360,6 +377,58 @@ TGraph* DelphesO2LutWriter::lutRead(const char* filename, int pdg, int what, int } auto nbins = lutMap.nbins; auto g = new TGraph(); + g->SetName(Form("lut_%s_%d_vs_%d_what_%d", filename, pdg, vs, what)); + g->SetTitle(Form("LUT for %s, pdg %d, vs %d, what %d", filename, pdg, vs, what)); + switch (vs) { + case kNch: + Printf(" --- vs = kNch"); + g->GetXaxis()->SetTitle("Nch"); + break; + case kEta: + Printf(" --- vs = kEta"); + g->GetXaxis()->SetTitle("#eta"); + break; + case kPt: + Printf(" --- vs = kPt"); + g->GetXaxis()->SetTitle("p_{T} (GeV/c)"); + break; + default: + Printf(" --- error: unknown vs %d", vs); + return nullptr; + } + switch (what) { + case kEfficiency: + Printf(" --- what = kEfficiency"); + g->GetYaxis()->SetTitle("Efficiency (%)"); + break; + case kEfficiency2: + Printf(" --- what = kEfficiency2"); + g->GetYaxis()->SetTitle("Efficiency2 (%)"); + break; + case kEfficiencyInnerTOF: + Printf(" --- what = kEfficiencyInnerTOF"); + g->GetYaxis()->SetTitle("Inner TOF Efficiency (%)"); + break; + case kEfficiencyOuterTOF: + Printf(" --- what = kEfficiencyOuterTOF"); + g->GetYaxis()->SetTitle("Outer TOF Efficiency (%)"); + break; + case kPtResolution: + Printf(" --- what = kPtResolution"); + g->GetYaxis()->SetTitle("p_{T} Resolution (%)"); + break; + case kRPhiResolution: + Printf(" --- what = kRPhiResolution"); + g->GetYaxis()->SetTitle("R#phi Resolution (#mum)"); + break; + case kZResolution: + Printf(" --- what = kZResolution"); + g->GetYaxis()->SetTitle("Z Resolution (#mum)"); + break; + default: + Printf(" --- error: unknown what %d", what); + return nullptr; + } bool canBeInvalid = true; for (int i = 0; i < nbins; ++i) { diff --git a/ALICE3/Core/DelphesO2LutWriter.h b/ALICE3/Core/DelphesO2LutWriter.h index e4b979a46cd..25faf7f382c 100644 --- a/ALICE3/Core/DelphesO2LutWriter.h +++ b/ALICE3/Core/DelphesO2LutWriter.h @@ -55,7 +55,8 @@ class DelphesO2LutWriter const float mass = 0.13957000, int itof = 0, int otof = 0, - int q = 1); + int q = 1, + const float nch = 1); bool fwdSolve(float* covm, float pt = 0.1, float eta = 0.0, float mass = 0.13957000); bool fwdPara(lutEntry_t& lutEntry, float pt = 0.1, float eta = 0.0, float mass = 0.13957000, float Bfield = 0.5); void lutWrite(const char* filename = "lutCovm.dat", int pdg = 211, float field = 0.2, int itof = 0, int otof = 0); diff --git a/ALICE3/Core/DetLayer.cxx b/ALICE3/Core/DetLayer.cxx index 392356b1e5a..25e61e6e6d5 100644 --- a/ALICE3/Core/DetLayer.cxx +++ b/ALICE3/Core/DetLayer.cxx @@ -16,4 +16,76 @@ /// \brief Basic struct to hold information regarding a detector layer to be used in fast simulation /// +#include +#include + #include "DetLayer.h" + +namespace o2::fastsim +{ + +// Parametric constructor +DetLayer::DetLayer(const TString& name_, + float r_, + float z_, + float x0_, + float xrho_, + float resRPhi_, + float resZ_, + float eff_, + int type_) + : name(name_), + r(r_), + z(z_), + x0(x0_), + xrho(xrho_), + resRPhi(resRPhi_), + resZ(resZ_), + eff(eff_), + type(type_) +{ +} + +DetLayer::DetLayer(const DetLayer& other) + : name(other.name), r(other.r), z(other.z), x0(other.x0), xrho(other.xrho), resRPhi(other.resRPhi), resZ(other.resZ), eff(other.eff), type(other.type) +{ +} + +std::string DetLayer::toString() const +{ + std::string out = ""; + out.append("DetLayer: "); + out.append(name.Data()); + out.append(" | r: "); + out.append(std::to_string(r)); + out.append(" cm | z: "); + out.append(std::to_string(z)); + out.append(" cm | x0: "); + out.append(std::to_string(x0)); + out.append(" cm | xrho: "); + out.append(std::to_string(xrho)); + out.append(" g/cm^3 | resRPhi: "); + out.append(std::to_string(resRPhi)); + out.append(" cm | resZ: "); + out.append(std::to_string(resZ)); + out.append(" cm | eff: "); + out.append(std::to_string(eff)); + out.append(" | type: "); + switch (type) { + case layerInert: + out.append("Inert"); + break; + case layerSilicon: + out.append("Silicon"); + break; + case layerGas: + out.append("Gas/TPC"); + break; + default: + out.append("Unknown"); + break; + } + return out; +} + +} // namespace o2::fastsim diff --git a/ALICE3/Core/DetLayer.h b/ALICE3/Core/DetLayer.h index 6b9fea14c06..2577c73e42d 100644 --- a/ALICE3/Core/DetLayer.h +++ b/ALICE3/Core/DetLayer.h @@ -19,12 +19,59 @@ #ifndef ALICE3_CORE_DETLAYER_H_ #define ALICE3_CORE_DETLAYER_H_ +#include + #include "TString.h" namespace o2::fastsim { struct DetLayer { + public: + // Default constructor + DetLayer() = default; + // Parametric constructor + DetLayer(const TString& name_, float r_, float z_, float x0_, float xrho_, + float resRPhi_ = 0.0f, float resZ_ = 0.0f, float eff_ = 0.0f, int type_ = layerInert); + // Copy constructor + DetLayer(const DetLayer& other); + + // Setters + void setName(const TString& name_) { name = name_; } + void setRadius(float r_) { r = r_; } + void setZ(float z_) { z = z_; } + void setRadiationLength(float x0_) { x0 = x0_; } + void setDensity(float xrho_) { xrho = xrho_; } + void setResolutionRPhi(float resRPhi_) { resRPhi = resRPhi_; } + void setResolutionZ(float resZ_) { resZ = resZ_; } + void setEfficiency(float eff_) { eff = eff_; } + void setType(int type_) { type = type_; } + + // Getters + float getRadius() const { return r; } + float getZ() const { return z; } + float getRadiationLength() const { return x0; } + float getDensity() const { return xrho; } + float getResolutionRPhi() const { return resRPhi; } + float getResolutionZ() const { return resZ; } + float getEfficiency() const { return eff; } + int getType() const { return type; } + const TString& getName() const { return name; } + + // Check layer type + bool isInert() const { return type == layerInert; } + bool isSilicon() const { return type == layerSilicon; } + bool isGas() const { return type == layerGas; } + + // Utilities + std::string toString() const; + friend std::ostream& operator<<(std::ostream& os, const DetLayer& layer) + { + os << layer.toString(); + return os; + } + + private: // TString for holding name TString name; @@ -44,7 +91,10 @@ struct DetLayer { float eff; // detection efficiency // layer type - int type; // 0: undefined/inert, 1: silicon, 2: gas/tpc + int type; // 0: undefined/inert, 1: silicon, 2: gas/tpc + static constexpr int layerInert = 0; // inert/undefined layer + static constexpr int layerSilicon = 1; // silicon layer + static constexpr int layerGas = 2; // gas/tpc layer }; } // namespace o2::fastsim diff --git a/ALICE3/Core/FastTracker.cxx b/ALICE3/Core/FastTracker.cxx index 6b22461c187..1d06958504b 100644 --- a/ALICE3/Core/FastTracker.cxx +++ b/ALICE3/Core/FastTracker.cxx @@ -30,7 +30,6 @@ FastTracker::FastTracker() magneticField = 20; // in kiloGauss applyZacceptance = false; applyMSCorrection = true; - applyMSCorrection = true; applyElossCorrection = true; applyEffCorrection = true; covMatFactor = 0.99f; @@ -57,7 +56,11 @@ FastTracker::FastTracker() void FastTracker::AddLayer(TString name, float r, float z, float x0, float xrho, float resRPhi, float resZ, float eff, int type) { - DetLayer newLayer{name.Data(), r, z, x0, xrho, resRPhi, resZ, eff, type}; + DetLayer newLayer(name, r, z, x0, xrho, resRPhi, resZ, eff, type); + // Check that efficient layers are not inert layers + if (newLayer.getEfficiency() > 0.0f && newLayer.isInert()) { + LOG(error) << "Layer " << name << " with efficiency > 0.0 should not be inert"; + } layers.push_back(newLayer); } @@ -66,7 +69,7 @@ DetLayer FastTracker::GetLayer(int layer, bool ignoreBarrelLayers) const int layerIdx = layer; if (ignoreBarrelLayers) { for (int il = 0, trackingLayerIdx = 0; trackingLayerIdx <= layer; il++) { - if (layers[il].type == 0) + if (layers[il].isInert()) continue; trackingLayerIdx++; layerIdx = il; @@ -79,11 +82,12 @@ int FastTracker::GetLayerIndex(std::string name) const { int i = 0; for (const auto& layer : layers) { - if (layer.name == name) { + if (layer.getName() == name) { return i; } i++; } + LOG(error) << "Layer with name " << name << " not found in FastTracker layers"; return -1; } @@ -93,8 +97,7 @@ void FastTracker::Print() LOG(info) << "+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+"; LOG(info) << " Printing detector layout with " << layers.size() << " effective elements: "; for (uint32_t il = 0; il < layers.size(); il++) { - LOG(info) << " Layer #" << il << "\t" << layers[il].name.Data() << "\tr = " << Form("%.2f", layers[il].r) << "cm\tz = " << layers[il].z << "\t" - << "x0 = " << layers[il].x0 << "\txrho = " << layers[il].xrho << "\tresRPhi = " << layers[il].resRPhi << "\tresZ = " << layers[il].resZ << "\teff = " << layers[il].eff; + LOG(info) << " Layer #" << il << "\t" << layers[il]; } LOG(info) << "+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+-~-<*>-~-+"; } @@ -310,6 +313,7 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa const int xrhosteps = 100; const bool applyAngularCorrection = true; + goodHitProbability.clear(); for (int i = 0; i < kMaxNumberOfDetectors; ++i) goodHitProbability.push_back(-1.); goodHitProbability[0] = 1.; @@ -321,32 +325,35 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa new (&outputTrack)(o2::track::TrackParCov)(inputTrack); for (uint32_t il = 0; il < layers.size(); il++) { // check if layer is doable - if (layers[il].r < initialRadius) + if (layers[il].getRadius() < initialRadius) continue; // this layer should not be attempted, but go ahead // check if layer is reached float targetX = 1e+3; bool ok = true; - inputTrack.getXatLabR(layers[il].r, targetX, magneticField); - if (targetX > 999) + inputTrack.getXatLabR(layers[il].getRadius(), targetX, magneticField); + if (targetX > 999.f) { + LOGF(debug, "Failed to find intercept for layer %d at radius %.2f cm", il, layers[il].getRadius()); break; // failed to find intercept + } ok = inputTrack.propagateTo(targetX, magneticField); - if (ok && applyMSCorrection && layers[il].x0 > 0) { - ok = inputTrack.correctForMaterial(layers[il].x0, 0, applyAngularCorrection); + if (ok && applyMSCorrection && layers[il].getRadiationLength() > 0) { + ok = inputTrack.correctForMaterial(layers[il].getRadiationLength(), 0, applyAngularCorrection); } - if (ok && applyElossCorrection && layers[il].xrho > 0) { // correct in small steps + if (ok && applyElossCorrection && layers[il].getDensity() > 0) { // correct in small steps for (int ise = xrhosteps; ise--;) { - ok = inputTrack.correctForMaterial(0, -layers[il].xrho / xrhosteps, applyAngularCorrection); + ok = inputTrack.correctForMaterial(0, -layers[il].getDensity() / xrhosteps, applyAngularCorrection); if (!ok) break; } } + LOGF(debug, "Propagation was %s up to layer %d", ok ? "successful" : "unsuccessful", il); // was there a problem on this layer? if (!ok && il > 0) { // may fail to reach target layer due to the eloss float rad2 = inputTrack.getX() * inputTrack.getX() + inputTrack.getY() * inputTrack.getY(); - float maxR = layers[il - 1].r + kTrackingMargin * 2; + float maxR = layers[il - 1].getRadius() + kTrackingMargin * 2; float minRad = (fMinRadTrack > 0 && fMinRadTrack < maxR) ? fMinRadTrack : maxR; if (rad2 - minRad * minRad < kTrackingMargin * kTrackingMargin) { // check previously reached layer return -5; // did not reach min requested layer @@ -354,16 +361,20 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa break; } } - if (std::abs(inputTrack.getZ()) > layers[il].z && applyZacceptance) { + if (std::abs(inputTrack.getZ()) > layers[il].getZ() && applyZacceptance) { break; // out of acceptance bounds } - if (layers[il].type == 0) + if (layers[il].isInert()) { + LOG(info) << "Skipping inert layer: " << layers[il].getName() << " at radius " << layers[il].getRadius() << " cm"; continue; // inert layer, skip + } // layer is reached - if (firstLayerReached < 0) + if (firstLayerReached < 0) { + LOGF(debug, "First layer reached: %d", il); firstLayerReached = il; + } lastLayerReached = il; nIntercepts++; } @@ -415,7 +426,7 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa for (int il = lastLayerReached; il >= firstLayerReached; il--) { float targetX = 1e+3; - inputTrack.getXatLabR(layers[il].r, targetX, magneticField); + inputTrack.getXatLabR(layers[il].getRadius(), targetX, magneticField); if (targetX > 999) continue; // failed to find intercept @@ -423,7 +434,7 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa continue; // failed to propagate } - if (std::abs(inputTrack.getZ()) > layers[il].z && applyZacceptance) { + if (std::abs(inputTrack.getZ()) > layers[il].getZ() && applyZacceptance) { continue; // out of acceptance bounds but continue inwards } @@ -441,46 +452,46 @@ int FastTracker::FastTrack(o2::track::TrackParCov inputTrack, o2::track::TrackPa if (!inwardTrack.propagateTo(xyz1[0], magneticField)) continue; - if (layers[il].type != 0) { // only update covm for tracker hits + if (!layers[il].isInert()) { // only update covm for tracker hits const o2::track::TrackParametrization::dim2_t hitpoint = { static_cast(xyz1[1]), static_cast(xyz1[2])}; - const o2::track::TrackParametrization::dim3_t hitpointcov = {layers[il].resRPhi * layers[il].resRPhi, 0.f, layers[il].resZ * layers[il].resZ}; + const o2::track::TrackParametrization::dim3_t hitpointcov = {layers[il].getResolutionRPhi() * layers[il].getResolutionRPhi(), 0.f, layers[il].getResolutionZ() * layers[il].getResolutionZ()}; inwardTrack.update(hitpoint, hitpointcov); inwardTrack.checkCovariance(); } - if (applyMSCorrection && layers[il].x0 > 0) { - if (!inputTrack.correctForMaterial(layers[il].x0, 0, applyAngularCorrection)) { + if (applyMSCorrection && layers[il].getRadiationLength() > 0) { + if (!inputTrack.correctForMaterial(layers[il].getRadiationLength(), 0, applyAngularCorrection)) { return -6; } - if (!inwardTrack.correctForMaterial(layers[il].x0, 0, applyAngularCorrection)) { + if (!inwardTrack.correctForMaterial(layers[il].getRadiationLength(), 0, applyAngularCorrection)) { return -6; } } - if (applyElossCorrection && layers[il].xrho > 0) { + if (applyElossCorrection && layers[il].getDensity() > 0) { for (int ise = xrhosteps; ise--;) { // correct in small steps - if (!inputTrack.correctForMaterial(0, layers[il].xrho / xrhosteps, applyAngularCorrection)) { + if (!inputTrack.correctForMaterial(0, layers[il].getDensity() / xrhosteps, applyAngularCorrection)) { return -7; } - if (!inwardTrack.correctForMaterial(0, layers[il].xrho / xrhosteps, applyAngularCorrection)) { + if (!inwardTrack.correctForMaterial(0, layers[il].getDensity() / xrhosteps, applyAngularCorrection)) { return -7; } } } - if (layers[il].type == 1) + if (layers[il].isSilicon()) nSiliconPoints++; // count silicon hits - if (layers[il].type == 2) + if (layers[il].isGas()) nGasPoints++; // count TPC/gas hits hits.push_back(thisHit); - if (applyEffCorrection && layers[il].type != 0) { // good hit probability calculation - double sigYCmb = o2::math_utils::sqrt(inwardTrack.getSigmaY2() + layers[il].resRPhi * layers[il].resRPhi); - double sigZCmb = o2::math_utils::sqrt(inwardTrack.getSigmaZ2() + layers[il].resZ * layers[il].resZ); - goodHitProbability[il] = ProbGoodChiSqHit(layers[il].r * 100, sigYCmb * 100, sigZCmb * 100); + if (applyEffCorrection && !layers[il].isInert()) { // good hit probability calculation + double sigYCmb = o2::math_utils::sqrt(inwardTrack.getSigmaY2() + layers[il].getResolutionRPhi() * layers[il].getResolutionRPhi()); + double sigZCmb = o2::math_utils::sqrt(inwardTrack.getSigmaZ2() + layers[il].getResolutionZ() * layers[il].getResolutionZ()); + goodHitProbability[il] = ProbGoodChiSqHit(layers[il].getRadius() * 100, sigYCmb * 100, sigZCmb * 100); goodHitProbability[0] *= goodHitProbability[il]; } } diff --git a/ALICE3/Core/FastTracker.h b/ALICE3/Core/FastTracker.h index f88b6c5ae85..702caa9e84b 100644 --- a/ALICE3/Core/FastTracker.h +++ b/ALICE3/Core/FastTracker.h @@ -39,10 +39,10 @@ class FastTracker 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); DetLayer GetLayer(const int layer, bool ignoreBarrelLayers = true) const; int GetLayerIndex(const std::string name) const; - void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].x0 = x0; } - void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].r = r; } - void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].resRPhi = resRPhi; } - void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].resZ = resZ; } + void SetRadiationLength(const std::string layerName, float x0) { layers[GetLayerIndex(layerName)].setRadiationLength(x0); } + void SetRadius(const std::string layerName, float r) { layers[GetLayerIndex(layerName)].setRadius(r); } + void SetResolutionRPhi(const std::string layerName, float resRPhi) { layers[GetLayerIndex(layerName)].setResolutionRPhi(resRPhi); } + void SetResolutionZ(const std::string layerName, float resZ) { layers[GetLayerIndex(layerName)].setResolutionZ(resZ); } void SetResolution(const std::string layerName, float resRPhi, float resZ) { SetResolutionRPhi(layerName, resRPhi); diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index 989295f8c54..ff804b8485a 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -811,11 +811,11 @@ struct OnTheFlyTracker { float phi{std::atan2(-posClusterCandidate[1], -posClusterCandidate[0]) + o2::its::constants::math::Pi}; o2::fastsim::DetLayer currentTrackingLayer = fastTracker.GetLayer(i); - if (currentTrackingLayer.resRPhi > 1e-8 && currentTrackingLayer.resZ > 1e-8) { // catch zero (though should not really happen...) - phi = gRandom->Gaus(phi, std::asin(currentTrackingLayer.resRPhi / r)); + if (currentTrackingLayer.getResolutionRPhi() > 1e-8 && currentTrackingLayer.getResolutionZ() > 1e-8) { // catch zero (though should not really happen...) + phi = gRandom->Gaus(phi, std::asin(currentTrackingLayer.getResolutionRPhi() / r)); posClusterCandidate[0] = r * std::cos(phi); posClusterCandidate[1] = r * std::sin(phi); - posClusterCandidate[2] = gRandom->Gaus(posClusterCandidate[2], currentTrackingLayer.resZ); + posClusterCandidate[2] = gRandom->Gaus(posClusterCandidate[2], currentTrackingLayer.getResolutionZ()); } if (std::isnan(phi)) @@ -833,7 +833,7 @@ struct OnTheFlyTracker { const o2::track::TrackParametrization::dim2_t hitpoint = { static_cast(xyz1[1]), static_cast(xyz1[2])}; - const o2::track::TrackParametrization::dim3_t hitpointcov = {currentTrackingLayer.resRPhi * currentTrackingLayer.resRPhi, 0.f, currentTrackingLayer.resZ * currentTrackingLayer.resZ}; + const o2::track::TrackParametrization::dim3_t hitpointcov = {currentTrackingLayer.getResolutionRPhi() * currentTrackingLayer.getResolutionRPhi(), 0.f, currentTrackingLayer.getResolutionZ() * currentTrackingLayer.getResolutionZ()}; cascadeTrack.update(hitpoint, hitpointcov); thisCascade.foundClusters++; // add to findable }