From 0161d72e8059d99b67ac32453438c55609d36bc0 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 26 Sep 2025 11:14:07 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../include/DataFormatsECal/Cluster.h | 32 +-- .../include/DataFormatsECal/Digit.h | 4 +- .../ECal/DataFormatsECal/src/Cluster.cxx | 20 +- .../ALICE3/ECal/base/src/Geometry.cxx | 2 +- .../include/ECalReconstruction/Clusterizer.h | 15 +- .../ECal/reconstruction/src/Clusterizer.cxx | 193 ++++++++++-------- 6 files changed, 145 insertions(+), 121 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Cluster.h b/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Cluster.h index 7985343d0c39d..4a34ef1679f26 100644 --- a/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Cluster.h +++ b/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Cluster.h @@ -31,7 +31,7 @@ class Cluster Cluster() = default; Cluster(const Cluster& clu) = default; ~Cluster() = default; - + // setters void addDigit(int digitIndex, int towerId, double energy); void setNLM(int nMax) { mNLM = nMax; } @@ -42,7 +42,7 @@ class Cluster void setChi2(float chi2) { mChi2 = chi2; } void setEdgeFlag(bool isEdge) { mEdge = isEdge; } void addMcTrackID(int mcTrackID, float energy) { mMcTrackEnergy[mcTrackID] += energy; } - + // getters const std::map& getMcTrackEnergy() { return mMcTrackEnergy; } int getMultiplicity() const { return mDigitIndex.size(); } @@ -55,9 +55,9 @@ class Cluster float getX() const { return mX; } float getY() const { return mY; } float getZ() const { return mZ; } - float getR() const { return std::sqrt(mX*mX + mY*mY); } + float getR() const { return std::sqrt(mX * mX + mY * mY); } float getTheta() const { return std::atan2(getR(), mZ); } - float getEta() const { return -std::log(std::tan(getTheta()/2.)); } + float getEta() const { return -std::log(std::tan(getTheta() / 2.)); } float getPhi() const { return std::atan2(mY, mX); } float getChi2() const { return mChi2; } bool isAtTheEdge() const { return mEdge; } @@ -65,18 +65,18 @@ class Cluster TLorentzVector getMomentum() const; private: - std::vector mDigitIndex; // vector of digit indices in digits vector - std::vector mDigitTowerId; // vector of corresponding digit tower Ids - std::vector mDigitEnergy; // vector of corresponding digit energies - std::map mMcTrackEnergy; // MC track indices and corresponding energies - int mNLM = 0; // number of local maxima in the initial cluster - float mTime = 0; // cluster time - float mE = 0; // cluster energy - float mX = 0; // estimated x-coordinate - float mY = 0; // estimated y-ccordinate - float mZ = 0; // estimated z-ccordinate - float mChi2 = 0; // chi2 wrt EM shape - bool mEdge = 0; // set to true if one of cluster digits is at the chamber edge + std::vector mDigitIndex; // vector of digit indices in digits vector + std::vector mDigitTowerId; // vector of corresponding digit tower Ids + std::vector mDigitEnergy; // vector of corresponding digit energies + std::map mMcTrackEnergy; // MC track indices and corresponding energies + int mNLM = 0; // number of local maxima in the initial cluster + float mTime = 0; // cluster time + float mE = 0; // cluster energy + float mX = 0; // estimated x-coordinate + float mY = 0; // estimated y-ccordinate + float mZ = 0; // estimated z-ccordinate + float mChi2 = 0; // chi2 wrt EM shape + bool mEdge = 0; // set to true if one of cluster digits is at the chamber edge ClassDefNV(Cluster, 1); }; } // namespace ecal diff --git a/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Digit.h b/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Digit.h index 2cdd0e79837a3..cc46a64e2cac0 100644 --- a/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Digit.h +++ b/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Digit.h @@ -30,7 +30,7 @@ class Digit : public o2::dataformats::TimeStamp Digit() = default; Digit(int tower, double amplitudeGeV, double time); ~Digit() = default; - + // setters void setTower(int tower) { mTower = tower; } void setAmplitude(double amplitude) { mAmplitudeGeV = amplitude; } @@ -42,7 +42,7 @@ class Digit : public o2::dataformats::TimeStamp double getAmplitude() const { return mAmplitudeGeV; } double getEnergy() const { return mAmplitudeGeV; } int getLabel() const { return mLabel; } - + private: double mAmplitudeGeV = 0.; ///< Amplitude (GeV) int32_t mTower = -1; ///< Tower index (absolute cell ID) diff --git a/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/src/Cluster.cxx b/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/src/Cluster.cxx index 9f7e42b6c7b96..77f7d9219ef6b 100644 --- a/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/src/Cluster.cxx +++ b/Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/src/Cluster.cxx @@ -14,7 +14,6 @@ /// /// \author Evgeny Kryshen - #include #include #include @@ -25,7 +24,8 @@ using namespace o2::ecal; ClassImp(Cluster); //============================================================================== -void Cluster::addDigit(int digitIndex, int towerId, double energy){ +void Cluster::addDigit(int digitIndex, int towerId, double energy) +{ mE += energy; mDigitIndex.push_back(digitIndex); mDigitTowerId.push_back(towerId); @@ -33,10 +33,11 @@ void Cluster::addDigit(int digitIndex, int towerId, double energy){ } //============================================================================== -int Cluster::getMcTrackID() const { +int Cluster::getMcTrackID() const +{ float maxEnergy = 0; int maxID = 0; - for (const auto& [mcTrackID, energy] : mMcTrackEnergy){ + for (const auto& [mcTrackID, energy] : mMcTrackEnergy) { if (energy > maxEnergy) { maxEnergy = energy; maxID = mcTrackID; @@ -46,9 +47,10 @@ int Cluster::getMcTrackID() const { } //============================================================================== -TLorentzVector Cluster::getMomentum() const { - double r = std::sqrt(mX*mX + mY*mY + mZ*mZ); - if (r==0) return TLorentzVector(); - return TLorentzVector(mE*mX/r, mE*mY/r, mE*mZ/r, mE); +TLorentzVector Cluster::getMomentum() const +{ + double r = std::sqrt(mX * mX + mY * mY + mZ * mZ); + if (r == 0) + return TLorentzVector(); + return TLorentzVector(mE * mX / r, mE * mY / r, mE * mZ / r, mE); } - diff --git a/Detectors/Upgrades/ALICE3/ECal/base/src/Geometry.cxx b/Detectors/Upgrades/ALICE3/ECal/base/src/Geometry.cxx index f232da27361da..9483b83f19f49 100644 --- a/Detectors/Upgrades/ALICE3/ECal/base/src/Geometry.cxx +++ b/Detectors/Upgrades/ALICE3/ECal/base/src/Geometry.cxx @@ -21,8 +21,8 @@ #include #include "CommonConstants/MathConstants.h" using namespace o2::ecal; -using o2::constants::math::TwoPI; using o2::constants::math::PIHalf; +using o2::constants::math::TwoPI; //============================================================================== Geometry::Geometry() diff --git a/Detectors/Upgrades/ALICE3/ECal/reconstruction/include/ECalReconstruction/Clusterizer.h b/Detectors/Upgrades/ALICE3/ECal/reconstruction/include/ECalReconstruction/Clusterizer.h index e8361faa385dc..3bb7cab4b11e3 100644 --- a/Detectors/Upgrades/ALICE3/ECal/reconstruction/include/ECalReconstruction/Clusterizer.h +++ b/Detectors/Upgrades/ALICE3/ECal/reconstruction/include/ECalReconstruction/Clusterizer.h @@ -22,8 +22,8 @@ #include #include -using o2::ecal::Digit; using o2::ecal::Cluster; +using o2::ecal::Digit; class TF1; namespace o2 @@ -32,29 +32,30 @@ namespace ecal { class Clusterizer { -public: + public: Clusterizer(bool applyCorrectionZ = 1, bool applyCorrectionE = 1); ~Clusterizer() = default; - void initialize(){}; + void initialize() {}; void addDigitToCluster(Cluster& cluster, int row, int col, const gsl::span& digits); void findClusters(const gsl::span& digits, std::vector& foundClusters, std::vector& unfoldedClusters); void makeClusters(const gsl::span& digits, std::vector& clusters); void makeUnfoldings(std::vector& foundClusters, std::vector& unfoldedClusters); - void unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, float *maxAtEnergy, std::vector& unfoldedClusters); + void unfoldOneCluster(Cluster* iniClu, int nMax, int* digitId, float* maxAtEnergy, std::vector& unfoldedClusters); void evalClusters(std::vector& clusters); - int getNumberOfLocalMax(Cluster& clu, int *maxAt, float *maxAtEnergy); + int getNumberOfLocalMax(Cluster& clu, int* maxAt, float* maxAtEnergy); double showerShape(double dx, double dz, bool isCrystal); void setLogWeight(double logWeight) { mLogWeight = logWeight; } void setClusteringThreshold(double threshold) { mClusteringThreshold = threshold; } void setCrystalDigitThreshold(double threshold) { mCrystalDigitThreshold = threshold; } void setSamplingDigitThreshold(double threshold) { mSamplingDigitThreshold = threshold; } -private: + + private: std::vector> mDigitIndices; // 2D map of digit indices used for recursive cluster finding bool mUnfoldClusters = true; // to perform cluster unfolding double mCrystalDigitThreshold = 0.040; // minimal energy of crystal digit double mSamplingDigitThreshold = 0.100; // minimal energy of sampling digit double mClusteringThreshold = 0.050; // minimal energy of digit to start clustering (GeV) - double mClusteringTimeGate = 1e9; // maximal time difference between digits to be accepted to clusters (in ns) + double mClusteringTimeGate = 1e9; // maximal time difference between digits to be accepted to clusters (in ns) int mNLMMax = 30; // maximal number of local maxima in unfolding double mLogWeight = 4.; // cutoff used in log. weight calculation double mUnfogingEAccuracy = 1.e-4; // accuracy of energy calculation in unfoding prosedure (GeV) diff --git a/Detectors/Upgrades/ALICE3/ECal/reconstruction/src/Clusterizer.cxx b/Detectors/Upgrades/ALICE3/ECal/reconstruction/src/Clusterizer.cxx index 92c3a573a0b97..c84f62b60ec38 100644 --- a/Detectors/Upgrades/ALICE3/ECal/reconstruction/src/Clusterizer.cxx +++ b/Detectors/Upgrades/ALICE3/ECal/reconstruction/src/Clusterizer.cxx @@ -25,56 +25,57 @@ using namespace o2::ecal; //============================================================================== -Clusterizer::Clusterizer(bool applyCorrectionZ, bool applyCorrectionE){ +Clusterizer::Clusterizer(bool applyCorrectionZ, bool applyCorrectionE) +{ auto& geo = Geometry::instance(); mDigitIndices.resize(geo.getNrows(), std::vector(geo.getNcols(), -1)); mApplyCorrectionZ = applyCorrectionZ; mApplyCorrectionE = applyCorrectionE; - fCrystalShowerShape = new TF1("fCrystal","x<[1] ? [0]*exp([3]*x+[4]*x*x+[5]*x*x*x) : (x<[2] ? [0]*[6]*exp([7]*x+[8]*x*x) : [0]*[9]*exp([10]*x+[11]*x*x))",0,15); + fCrystalShowerShape = new TF1("fCrystal", "x<[1] ? [0]*exp([3]*x+[4]*x*x+[5]*x*x*x) : (x<[2] ? [0]*[6]*exp([7]*x+[8]*x*x) : [0]*[9]*exp([10]*x+[11]*x*x))", 0, 15); double pc[12]; - pc[0] = 1./13.15; - pc[1] = 2.2; - pc[2] = 5; - pc[3] = 4.38969; - pc[4] = -5.15975; - pc[5] = 1.18978; - pc[6] = 1.48726; - pc[7] = -1.54621; - pc[8] = 0.0814617; - pc[9] = 0.0369055; - pc[10] = -0.174372; - pc[11] = -0.0455978; + pc[0] = 1. / 13.15; + pc[1] = 2.2; + pc[2] = 5; + pc[3] = 4.38969; + pc[4] = -5.15975; + pc[5] = 1.18978; + pc[6] = 1.48726; + pc[7] = -1.54621; + pc[8] = 0.0814617; + pc[9] = 0.0369055; + pc[10] = -0.174372; + pc[11] = -0.0455978; fCrystalShowerShape->SetParameters(pc); - fSamplingShowerShape = new TF1("fSampling","x<[1] ? [0]*exp([3]*x+[4]*x*x+[5]*x*x*x) : (x<[2] ? [0]*[6]*exp([7]*x+[8]*x*x) : [0]*[9]*exp([10]*x+[11]*x*x))",0,15); + fSamplingShowerShape = new TF1("fSampling", "x<[1] ? [0]*exp([3]*x+[4]*x*x+[5]*x*x*x) : (x<[2] ? [0]*[6]*exp([7]*x+[8]*x*x) : [0]*[9]*exp([10]*x+[11]*x*x))", 0, 15); double ps[12]; - ps[0] = 1/35.6; - ps[1] = 3.2; - ps[2] = 6; - ps[3] = 3.06543; - ps[4] = -2.23235; - ps[5] = 0.325344; - ps[6] = 6.0733; - ps[7] = -1.62713; - ps[8] = 0.0965569; - ps[9] = 0.0765706; - ps[10] = -0.217398; - ps[11] = -0.0204646; + ps[0] = 1 / 35.6; + ps[1] = 3.2; + ps[2] = 6; + ps[3] = 3.06543; + ps[4] = -2.23235; + ps[5] = 0.325344; + ps[6] = 6.0733; + ps[7] = -1.62713; + ps[8] = 0.0965569; + ps[9] = 0.0765706; + ps[10] = -0.217398; + ps[11] = -0.0204646; fSamplingShowerShape->SetParameters(ps); - fCrystalRMS = new TF1("fCrystalRMS","[0]*x*exp([1]*x+[2]*x*x+[3]*x*x*x)",0,2.2); + fCrystalRMS = new TF1("fCrystalRMS", "[0]*x*exp([1]*x+[2]*x*x+[3]*x*x*x)", 0, 2.2); double p[4]; - p[0] = 1.39814; + p[0] = 1.39814; p[1] = -6.05426; - p[2] = 6.26678; + p[2] = 6.26678; p[3] = -1.97092; fCrystalRMS->SetParameters(p); - } //============================================================================== -void Clusterizer::findClusters(const gsl::span& digits, std::vector& foundClusters, std::vector& unfoldedClusters){ +void Clusterizer::findClusters(const gsl::span& digits, std::vector& foundClusters, std::vector& unfoldedClusters) +{ foundClusters.clear(); unfoldedClusters.clear(); @@ -83,28 +84,32 @@ void Clusterizer::findClusters(const gsl::span& digits, std::vector // Split clusters with several local maxima if necessary makeUnfoldings(foundClusters, unfoldedClusters); - + // Evaluate cluster position, dispersion etc. evalClusters(foundClusters); evalClusters(unfoldedClusters); } //============================================================================== -void Clusterizer::addDigitToCluster(Cluster& cluster, int row, int col, const gsl::span& digits){ +void Clusterizer::addDigitToCluster(Cluster& cluster, int row, int col, const gsl::span& digits) +{ auto& geo = Geometry::instance(); - if (row<0 || row>=geo.getNrows() || col<0 || col>=geo.getNcols()) return; + if (row < 0 || row >= geo.getNrows() || col < 0 || col >= geo.getNcols()) + return; int digitIndex = mDigitIndices[row][col]; LOGP(debug, " checking row={} and col={} digitIndex={}", row, col, digitIndex); - if (digitIndex < 0) return; - + if (digitIndex < 0) + return; + const Digit& digit = digits[digitIndex]; - if (cluster.getMultiplicity()>0) { + if (cluster.getMultiplicity() > 0) { // check if new digit is in the same chamber and sector const Digit& digit2 = digits[cluster.getDigitIndex(0)]; auto [sector1, ch1] = geo.getSectorChamber(digit.getTower()); auto [sector2, ch2] = geo.getSectorChamber(digit2.getTower()); LOGP(debug, " checking if sector and chamber are the same: ({},{}) ({},{})", sector1, ch1, sector2, ch2); - if (sector1 != sector2 || ch1 != ch2) return; + if (sector1 != sector2 || ch1 != ch2) + return; } mDigitIndices[row][col] = -1; @@ -117,11 +122,12 @@ void Clusterizer::addDigitToCluster(Cluster& cluster, int row, int col, const gs } //============================================================================== -void Clusterizer::makeClusters(const gsl::span& digits, std::vector& clusters){ - // Combine digits into cluster - +void Clusterizer::makeClusters(const gsl::span& digits, std::vector& clusters) +{ + // Combine digits into cluster + int nDigits = digits.size(); - + // reset mDigitIndices for (auto& rows : mDigitIndices) { rows.assign(rows.size(), -1); @@ -134,9 +140,11 @@ void Clusterizer::makeClusters(const gsl::span& digits, std::vector auto [row, col] = geo.globalRowColFromIndex(digit.getTower()); bool isCrystal = geo.isCrystal(digit.getTower()); if (isCrystal) { - if (digit.getEnergy()& digits, std::vector for (int i = 0; i < nDigits; i++) { const Digit& digitSeed = digits[i]; auto [row, col] = geo.globalRowColFromIndex(digitSeed.getTower()); - if (mDigitIndices[row][col] < 0) continue; // digit was already added in one of the clusters - if (digitSeed.getEnergy() < mClusteringThreshold) continue; + if (mDigitIndices[row][col] < 0) + continue; // digit was already added in one of the clusters + if (digitSeed.getEnergy() < mClusteringThreshold) + continue; LOGP(debug, " starting new cluster at row={} and col={}", row, col); auto& cluster = clusters.emplace_back(); addDigitToCluster(cluster, row, col, digits); @@ -156,14 +166,15 @@ void Clusterizer::makeClusters(const gsl::span& digits, std::vector } //============================================================================== -void Clusterizer::makeUnfoldings(std::vector& foundClusters, std::vector& unfoldedClusters){ +void Clusterizer::makeUnfoldings(std::vector& foundClusters, std::vector& unfoldedClusters) +{ // Split cluster if several local maxima are found if (!mUnfoldClusters) { return; } - - int *maxAt = new int[mNLMMax]; - float *maxAtEnergy = new float[mNLMMax]; + + int* maxAt = new int[mNLMMax]; + float* maxAtEnergy = new float[mNLMMax]; for (auto& clu : foundClusters) { int nMax = getNumberOfLocalMax(clu, maxAt, maxAtEnergy); @@ -179,7 +190,8 @@ void Clusterizer::makeUnfoldings(std::vector& foundClusters, std::vecto } //============================================================================== -void Clusterizer::unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, float *maxAtEnergy, std::vector& unfoldedClusters){ +void Clusterizer::unfoldOneCluster(Cluster* iniClu, int nMax, int* digitId, float* maxAtEnergy, std::vector& unfoldedClusters) +{ // Based on MpdEmcClusterizerKI::UnfoldOneCluster by D. Peresunko // Performs the unfolding of a cluster with nMax overlapping showers // Parameters: iniClu cluster to be unfolded @@ -220,7 +232,7 @@ void Clusterizer::unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, floa std::vector prop(nMax); // proportion of clusters in the current digit // Try to decompose cluster to contributions - int nIterations = 0; + int nIterations = 0; bool insuficientAccuracy = true; while (insuficientAccuracy && nIterations < mNMaxIterations) { @@ -231,7 +243,7 @@ void Clusterizer::unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, floa for (int iclu = 0; iclu < nMax; iclu++) { prop[iclu] = eMax[iclu] * showerShape(std::sqrt((x[idig] - xMax[iclu]) * (x[idig] - xMax[iclu]) + (y[idig] - yMax[iclu]) * (y[idig] - yMax[iclu])), - z[idig] - zMax[iclu], isCrystal); + z[idig] - zMax[iclu], isCrystal); eEstimated += prop[iclu]; } if (eEstimated == 0.) { // numerical accuracy @@ -254,9 +266,9 @@ void Clusterizer::unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, floa for (int idig = 0; idig < mult; idig++) { eMax[iclu] += eInClusters[idig][iclu]; } - xMax[iclu] = 0; - yMax[iclu] = 0; - zMax[iclu] = 0; + xMax[iclu] = 0; + yMax[iclu] = 0; + zMax[iclu] = 0; double wtot = 0.; for (int idig = 0; idig < mult; idig++) { double w = std::max(std::log(eInClusters[idig][iclu] / eMax[iclu]) + mLogWeight, 0.); @@ -292,7 +304,8 @@ void Clusterizer::unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, floa } //============================================================================== -void Clusterizer::evalClusters(std::vector& clusters){ +void Clusterizer::evalClusters(std::vector& clusters) +{ auto& geo = Geometry::instance(); for (auto& cluster : clusters) { double x = 0; @@ -300,7 +313,7 @@ void Clusterizer::evalClusters(std::vector& clusters){ double z = 0; double wtot = 0; double etot = cluster.getE(); - for (size_t i = 0; i& clusters){ wtot += w; } if (wtot != 0) { - x/=wtot; - y/=wtot; - z/=wtot; + x /= wtot; + y /= wtot; + z /= wtot; } cluster.setX(x); cluster.setY(y); cluster.setZ(z); - + // cluster shape float chi2 = 0; int ndf = 0; float ee = cluster.getE(); - for (size_t i = 0; i2.2) continue; + double r = std::sqrt((x - xi) * (x - xi) + (y - yi) * (y - yi) + (z - zi) * (z - zi)); + if (r > 2.2) + continue; double frac = fCrystalShowerShape->Eval(r); double rms = fCrystalRMS->Eval(r); - chi2+=std::pow((energy/ee-frac)/rms,2.); + chi2 += std::pow((energy / ee - frac) / rms, 2.); ndf++; } - cluster.setChi2(chi2/ndf); + cluster.setChi2(chi2 / ndf); // correct cluster energy and z position float eta = std::abs(cluster.getEta()); float eCor = 1; float zCor = 0; bool isCrystal = geo.isCrystal(cluster.getDigitTowerId(0)); - if (isCrystal){ - eCor = 0.00444*std::pow(ee, -1.322) + (1.021+0.0018*eta); - if (mApplyCorrectionE) ee *= eCor; - if (mApplyCorrectionZ) zCor = (-0.00518682+0.730052*eta-0.73817*eta*eta); + if (isCrystal) { + eCor = 0.00444 * std::pow(ee, -1.322) + (1.021 + 0.0018 * eta); + if (mApplyCorrectionE) + ee *= eCor; + if (mApplyCorrectionZ) + zCor = (-0.00518682 + 0.730052 * eta - 0.73817 * eta * eta); } else { - eCor = 0.0033*std::pow(ee,-2.09)+(1.007+0.0667*eta-0.108*eta*eta+0.0566*eta*eta*eta); - if (mApplyCorrectionE) ee *= eCor; - if (mApplyCorrectionZ) zCor = (-2.13679+6.40009*eta-3.34233*eta*eta)+(-0.136425+0.401887*eta-0.196851*eta*eta)*ee+(0.00822276-0.0242512*eta+0.0118986*eta*eta)*ee*ee; + eCor = 0.0033 * std::pow(ee, -2.09) + (1.007 + 0.0667 * eta - 0.108 * eta * eta + 0.0566 * eta * eta * eta); + if (mApplyCorrectionE) + ee *= eCor; + if (mApplyCorrectionZ) + zCor = (-2.13679 + 6.40009 * eta - 3.34233 * eta * eta) + (-0.136425 + 0.401887 * eta - 0.196851 * eta * eta) * ee + (0.00822276 - 0.0242512 * eta + 0.0118986 * eta * eta) * ee * ee; } cluster.setE(ee); - cluster.setZ(cluster.getZ()-zCor); + cluster.setZ(cluster.getZ() - zCor); // check if cluster is at the edge of detector module - bool isEdge = 0; - for (size_t i = 0; i mClusteringThreshold) isLocalMax[i] = true; + if (en1 > mClusteringThreshold) + isLocalMax[i] = true; } for (int i = 0; i < n; i++) { @@ -421,14 +442,14 @@ int Clusterizer::getNumberOfLocalMax(Cluster& clu, int *maxAt, float *maxAtEnerg return 0; } } - } + } delete[] isLocalMax; return iDigitN; } //============================================================================== -double Clusterizer::showerShape(double dx, double dz, bool isCrystal){ +double Clusterizer::showerShape(double dx, double dz, bool isCrystal) +{ double x = std::sqrt(dx * dx + dz * dz); return isCrystal ? fCrystalShowerShape->Eval(x) : fSamplingShowerShape->Eval(x); } -