Skip to content

Commit 613f933

Browse files
authored
Merge pull request #3 from alibuild/alibot-cleanup-14697
Please consider the following formatting changes to #14697
2 parents 08d68bd + 0161d72 commit 613f933

File tree

6 files changed

+145
-121
lines changed

6 files changed

+145
-121
lines changed

Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Cluster.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Cluster
3131
Cluster() = default;
3232
Cluster(const Cluster& clu) = default;
3333
~Cluster() = default;
34-
34+
3535
// setters
3636
void addDigit(int digitIndex, int towerId, double energy);
3737
void setNLM(int nMax) { mNLM = nMax; }
@@ -42,7 +42,7 @@ class Cluster
4242
void setChi2(float chi2) { mChi2 = chi2; }
4343
void setEdgeFlag(bool isEdge) { mEdge = isEdge; }
4444
void addMcTrackID(int mcTrackID, float energy) { mMcTrackEnergy[mcTrackID] += energy; }
45-
45+
4646
// getters
4747
const std::map<int, float>& getMcTrackEnergy() { return mMcTrackEnergy; }
4848
int getMultiplicity() const { return mDigitIndex.size(); }
@@ -55,28 +55,28 @@ class Cluster
5555
float getX() const { return mX; }
5656
float getY() const { return mY; }
5757
float getZ() const { return mZ; }
58-
float getR() const { return std::sqrt(mX*mX + mY*mY); }
58+
float getR() const { return std::sqrt(mX * mX + mY * mY); }
5959
float getTheta() const { return std::atan2(getR(), mZ); }
60-
float getEta() const { return -std::log(std::tan(getTheta()/2.)); }
60+
float getEta() const { return -std::log(std::tan(getTheta() / 2.)); }
6161
float getPhi() const { return std::atan2(mY, mX); }
6262
float getChi2() const { return mChi2; }
6363
bool isAtTheEdge() const { return mEdge; }
6464
int getMcTrackID() const;
6565
TLorentzVector getMomentum() const;
6666

6767
private:
68-
std::vector<int> mDigitIndex; // vector of digit indices in digits vector
69-
std::vector<int> mDigitTowerId; // vector of corresponding digit tower Ids
70-
std::vector<float> mDigitEnergy; // vector of corresponding digit energies
71-
std::map<int, float> mMcTrackEnergy; // MC track indices and corresponding energies
72-
int mNLM = 0; // number of local maxima in the initial cluster
73-
float mTime = 0; // cluster time
74-
float mE = 0; // cluster energy
75-
float mX = 0; // estimated x-coordinate
76-
float mY = 0; // estimated y-ccordinate
77-
float mZ = 0; // estimated z-ccordinate
78-
float mChi2 = 0; // chi2 wrt EM shape
79-
bool mEdge = 0; // set to true if one of cluster digits is at the chamber edge
68+
std::vector<int> mDigitIndex; // vector of digit indices in digits vector
69+
std::vector<int> mDigitTowerId; // vector of corresponding digit tower Ids
70+
std::vector<float> mDigitEnergy; // vector of corresponding digit energies
71+
std::map<int, float> mMcTrackEnergy; // MC track indices and corresponding energies
72+
int mNLM = 0; // number of local maxima in the initial cluster
73+
float mTime = 0; // cluster time
74+
float mE = 0; // cluster energy
75+
float mX = 0; // estimated x-coordinate
76+
float mY = 0; // estimated y-ccordinate
77+
float mZ = 0; // estimated z-ccordinate
78+
float mChi2 = 0; // chi2 wrt EM shape
79+
bool mEdge = 0; // set to true if one of cluster digits is at the chamber edge
8080
ClassDefNV(Cluster, 1);
8181
};
8282
} // namespace ecal

Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/include/DataFormatsECal/Digit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Digit : public o2::dataformats::TimeStamp<double>
3030
Digit() = default;
3131
Digit(int tower, double amplitudeGeV, double time);
3232
~Digit() = default;
33-
33+
3434
// setters
3535
void setTower(int tower) { mTower = tower; }
3636
void setAmplitude(double amplitude) { mAmplitudeGeV = amplitude; }
@@ -42,7 +42,7 @@ class Digit : public o2::dataformats::TimeStamp<double>
4242
double getAmplitude() const { return mAmplitudeGeV; }
4343
double getEnergy() const { return mAmplitudeGeV; }
4444
int getLabel() const { return mLabel; }
45-
45+
4646
private:
4747
double mAmplitudeGeV = 0.; ///< Amplitude (GeV)
4848
int32_t mTower = -1; ///< Tower index (absolute cell ID)

Detectors/Upgrades/ALICE3/ECal/DataFormatsECal/src/Cluster.cxx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
///
1515
/// \author Evgeny Kryshen <evgeny.kryshen@cern.ch>
1616

17-
1817
#include <map>
1918
#include <vector>
2019
#include <DataFormatsECal/Cluster.h>
@@ -25,18 +24,20 @@ using namespace o2::ecal;
2524
ClassImp(Cluster);
2625

2726
//==============================================================================
28-
void Cluster::addDigit(int digitIndex, int towerId, double energy){
27+
void Cluster::addDigit(int digitIndex, int towerId, double energy)
28+
{
2929
mE += energy;
3030
mDigitIndex.push_back(digitIndex);
3131
mDigitTowerId.push_back(towerId);
3232
mDigitEnergy.push_back(energy);
3333
}
3434

3535
//==============================================================================
36-
int Cluster::getMcTrackID() const {
36+
int Cluster::getMcTrackID() const
37+
{
3738
float maxEnergy = 0;
3839
int maxID = 0;
39-
for (const auto& [mcTrackID, energy] : mMcTrackEnergy){
40+
for (const auto& [mcTrackID, energy] : mMcTrackEnergy) {
4041
if (energy > maxEnergy) {
4142
maxEnergy = energy;
4243
maxID = mcTrackID;
@@ -46,9 +47,10 @@ int Cluster::getMcTrackID() const {
4647
}
4748

4849
//==============================================================================
49-
TLorentzVector Cluster::getMomentum() const {
50-
double r = std::sqrt(mX*mX + mY*mY + mZ*mZ);
51-
if (r==0) return TLorentzVector();
52-
return TLorentzVector(mE*mX/r, mE*mY/r, mE*mZ/r, mE);
50+
TLorentzVector Cluster::getMomentum() const
51+
{
52+
double r = std::sqrt(mX * mX + mY * mY + mZ * mZ);
53+
if (r == 0)
54+
return TLorentzVector();
55+
return TLorentzVector(mE * mX / r, mE * mY / r, mE * mZ / r, mE);
5356
}
54-

Detectors/Upgrades/ALICE3/ECal/base/src/Geometry.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <ECalBase/ECalBaseParam.h>
2222
#include "CommonConstants/MathConstants.h"
2323
using namespace o2::ecal;
24-
using o2::constants::math::TwoPI;
2524
using o2::constants::math::PIHalf;
25+
using o2::constants::math::TwoPI;
2626

2727
//==============================================================================
2828
Geometry::Geometry()

Detectors/Upgrades/ALICE3/ECal/reconstruction/include/ECalReconstruction/Clusterizer.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include <DataFormatsECal/Digit.h>
2323
#include <DataFormatsECal/Cluster.h>
2424

25-
using o2::ecal::Digit;
2625
using o2::ecal::Cluster;
26+
using o2::ecal::Digit;
2727
class TF1;
2828

2929
namespace o2
@@ -32,29 +32,30 @@ namespace ecal
3232
{
3333
class Clusterizer
3434
{
35-
public:
35+
public:
3636
Clusterizer(bool applyCorrectionZ = 1, bool applyCorrectionE = 1);
3737
~Clusterizer() = default;
38-
void initialize(){};
38+
void initialize() {};
3939
void addDigitToCluster(Cluster& cluster, int row, int col, const gsl::span<const Digit>& digits);
4040
void findClusters(const gsl::span<const Digit>& digits, std::vector<Cluster>& foundClusters, std::vector<Cluster>& unfoldedClusters);
4141
void makeClusters(const gsl::span<const Digit>& digits, std::vector<Cluster>& clusters);
4242
void makeUnfoldings(std::vector<Cluster>& foundClusters, std::vector<Cluster>& unfoldedClusters);
43-
void unfoldOneCluster(Cluster *iniClu, int nMax, int *digitId, float *maxAtEnergy, std::vector<Cluster>& unfoldedClusters);
43+
void unfoldOneCluster(Cluster* iniClu, int nMax, int* digitId, float* maxAtEnergy, std::vector<Cluster>& unfoldedClusters);
4444
void evalClusters(std::vector<Cluster>& clusters);
45-
int getNumberOfLocalMax(Cluster& clu, int *maxAt, float *maxAtEnergy);
45+
int getNumberOfLocalMax(Cluster& clu, int* maxAt, float* maxAtEnergy);
4646
double showerShape(double dx, double dz, bool isCrystal);
4747
void setLogWeight(double logWeight) { mLogWeight = logWeight; }
4848
void setClusteringThreshold(double threshold) { mClusteringThreshold = threshold; }
4949
void setCrystalDigitThreshold(double threshold) { mCrystalDigitThreshold = threshold; }
5050
void setSamplingDigitThreshold(double threshold) { mSamplingDigitThreshold = threshold; }
51-
private:
51+
52+
private:
5253
std::vector<std::vector<int>> mDigitIndices; // 2D map of digit indices used for recursive cluster finding
5354
bool mUnfoldClusters = true; // to perform cluster unfolding
5455
double mCrystalDigitThreshold = 0.040; // minimal energy of crystal digit
5556
double mSamplingDigitThreshold = 0.100; // minimal energy of sampling digit
5657
double mClusteringThreshold = 0.050; // minimal energy of digit to start clustering (GeV)
57-
double mClusteringTimeGate = 1e9; // maximal time difference between digits to be accepted to clusters (in ns)
58+
double mClusteringTimeGate = 1e9; // maximal time difference between digits to be accepted to clusters (in ns)
5859
int mNLMMax = 30; // maximal number of local maxima in unfolding
5960
double mLogWeight = 4.; // cutoff used in log. weight calculation
6061
double mUnfogingEAccuracy = 1.e-4; // accuracy of energy calculation in unfoding prosedure (GeV)

0 commit comments

Comments
 (0)