Skip to content

Commit e017266

Browse files
committed
[EMCAL-1152] EMCAL: Fix cpplint errors
This commit includes changes to: - DataFormats/Detectors/EMCA - Detectors/EMCAL/base
1 parent 762cef7 commit e017266

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1231
-999
lines changed

DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/AnalysisCluster.h

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef ALICEO2_EMCAL_ANALYSISCLUSTER_H_
13-
#define ALICEO2_EMCAL_ANALYSISCLUSTER_H_
12+
/// \file AnalysisCluster.h
13+
/// \class AnalysisCluster
14+
/// \brief Cluster class for kinematic cluster parameters
15+
/// \ingroup EMCALDataFormat
16+
/// ported from AliVCluster in AliRoot
17+
/// \author Hadi Hassan <hadi.hassan@cern.ch>, Oak Ridge National Laboratory
18+
/// \since March 05, 2020
19+
20+
#ifndef DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_ANALYSISCLUSTER_H_
21+
#define DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_ANALYSISCLUSTER_H_
1422

1523
#include <fairlogger/Logger.h>
1624
#include <gsl/span>
1725
#include <array>
26+
#include <string>
27+
#include <vector>
1828
#include "Rtypes.h"
1929
#include "MathUtils/Cartesian.h"
20-
#include "TLorentzVector.h"
30+
#include "Math/Vector4D.h"
2131

2232
namespace o2
2333
{
24-
2534
namespace emcal
2635
{
27-
28-
/// \class AnalysisCluster
29-
/// \brief Cluster class for kinematic cluster parameters
30-
/// \ingroup EMCALDataFormat
31-
/// ported from AliVCluster in AliRoot
32-
/// \author Hadi Hassan <hadi.hassan@cern.ch>, Oak Ridge National Laboratory
33-
/// \since March 05, 2020
34-
///
35-
3636
class AnalysisCluster
3737
{
3838

@@ -45,9 +45,9 @@ class AnalysisCluster
4545
public:
4646
/// \brief Constructor, setting cell wrong cell index raising the exception
4747
/// \param cellIndex Cell index raising the exception
48-
CellOutOfRangeException(Int_t cellIndex) : std::exception(),
49-
mCellIndex(cellIndex),
50-
mMessage("Cell index " + std::to_string(mCellIndex) + " out of range.")
48+
CellOutOfRangeException(int cellIndex) : std::exception(),
49+
mCellIndex(cellIndex),
50+
mMessage("Cell index " + std::to_string(mCellIndex) + " out of range.")
5151
{
5252
}
5353

@@ -56,14 +56,14 @@ class AnalysisCluster
5656

5757
/// \brief Access to cell ID raising the exception
5858
/// \return Cell ID
59-
Int_t getCellIndex() const noexcept { return mCellIndex; }
59+
int getCellIndex() const noexcept { return mCellIndex; }
6060

6161
/// \brief Access to error message of the exception
6262
/// \return Error message
6363
const char* what() const noexcept final { return mMessage.data(); }
6464

6565
private:
66-
Int_t mCellIndex; ///< Cell index raising the exception
66+
int mCellIndex; ///< Cell index raising the exception
6767
std::string mMessage; ///< error Message
6868
};
6969

@@ -128,12 +128,12 @@ class AnalysisCluster
128128

129129
///
130130
/// Set the array of cell indices.
131-
void setCellsIndices(const std::vector<unsigned short>& array)
131+
void setCellsIndices(const std::vector<uint16_t>& array)
132132
{
133133
mCellsIndices = array;
134134
}
135135

136-
const std::vector<unsigned short>& getCellsIndices() const { return mCellsIndices; }
136+
const std::vector<uint16_t>& getCellsIndices() const { return mCellsIndices; }
137137

138138
///
139139
/// Set the array of cell amplitude fractions.
@@ -186,10 +186,10 @@ class AnalysisCluster
186186
void setFCross(float fCross) { mFCross = fCross; }
187187

188188
///
189-
/// Returns TLorentzVector with momentum of the cluster. Only valid for clusters
189+
/// Returns ROOT::Math::PxPyPzEVector with momentum of the cluster. Only valid for clusters
190190
/// identified as photons or pi0 (overlapped gamma) produced on the vertex
191191
/// Vertex can be recovered with esd pointer doing:
192-
TLorentzVector getMomentum(std::array<const float, 3> vertexPosition) const;
192+
ROOT::Math::PxPyPzEVector getMomentum(std::array<const float, 3> vertexPosition) const;
193193

194194
protected:
195195
/// TODO to replace later by o2::MCLabel when implementing the MC handling
@@ -198,7 +198,7 @@ class AnalysisCluster
198198
int mNCells = 0; ///< Number of cells in cluster.
199199

200200
/// Array of cell indices contributing to this cluster.
201-
std::vector<unsigned short> mCellsIndices; //[mNCells]
201+
std::vector<uint16_t> mCellsIndices; //[mNCells]
202202

203203
/// Array with cell amplitudes fraction. Only usable for unfolded clusters, where cell can be shared.
204204
/// here we store what fraction of the cell energy is assigned to a given cluster.
@@ -235,4 +235,4 @@ class AnalysisCluster
235235

236236
} // namespace emcal
237237
} // namespace o2
238-
#endif // ANALYSISCLUSTER_H
238+
#endif // DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_ANALYSISCLUSTER_H_

DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/Cell.h

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,7 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef ALICEO2_EMCAL_CELL_H_
13-
#define ALICEO2_EMCAL_CELL_H_
14-
15-
#include <bitset>
16-
#include <cfloat>
17-
#include <climits>
18-
#include "DataFormatsEMCAL/Constants.h"
19-
20-
namespace o2
21-
{
22-
namespace emcal
23-
{
24-
12+
/// \file Cell.h
2513
/// \class Cell
2614
/// \brief EMCAL compressed cell information
2715
/// \author Anders Knospe, University of Houston
@@ -55,6 +43,19 @@ namespace emcal
5543
/// | Cell type | 2 | - | 0=LG, 1=HG, 2=LEMon, 4=TRU |
5644
///
5745
/// The remaining bits are 0
46+
47+
#ifndef DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CELL_H_
48+
#define DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CELL_H_
49+
50+
#include <bitset>
51+
#include <cfloat>
52+
#include <climits>
53+
#include "DataFormatsEMCAL/Constants.h"
54+
55+
namespace o2
56+
{
57+
namespace emcal
58+
{
5859
class Cell
5960
{
6061
public:
@@ -71,7 +72,7 @@ class Cell
7172
/// \param energy Energy
7273
/// \param timestamp Cell time
7374
/// \param ctype Channel type
74-
Cell(short tower, float energy, float timestamp, ChannelType_t ctype = ChannelType_t::LOW_GAIN);
75+
Cell(int16_t tower, float energy, float timestamp, ChannelType_t ctype = ChannelType_t::LOW_GAIN);
7576

7677
/// \brief Constructor, from encoded bit representation
7778
/// \param tower Tower bitsets
@@ -86,11 +87,11 @@ class Cell
8687

8788
/// \brief Set the tower ID
8889
/// \param tower Tower ID
89-
void setTower(short tower) { mTowerID = tower; }
90+
void setTower(int16_t tower) { mTowerID = tower; }
9091

9192
/// \brief Get the tower ID
9293
/// \return Tower ID
93-
short getTower() const { return mTowerID; }
94+
int16_t getTower() const { return mTowerID; }
9495

9596
/// \brief Set the time stamp
9697
/// \param timestamp Time in ns
@@ -134,28 +135,28 @@ class Cell
134135

135136
/// \brief Check whether the cell is a low gain cell
136137
/// \return True if the cell type is low gain, false otherwise
137-
Bool_t getLowGain() const { return isChannelType(ChannelType_t::LOW_GAIN); }
138+
bool getLowGain() const { return isChannelType(ChannelType_t::LOW_GAIN); }
138139

139140
/// \brief Mark cell as high gain cell
140141
void setHighGain() { setType(ChannelType_t::HIGH_GAIN); }
141142

142143
/// \brief Check whether the cell is a high gain cell
143144
/// \return True if the cell type is high gain, false otherwise
144-
Bool_t getHighGain() const { return isChannelType(ChannelType_t::HIGH_GAIN); };
145+
bool getHighGain() const { return isChannelType(ChannelType_t::HIGH_GAIN); }
145146

146147
/// \brief Mark cell as LED monitor cell
147148
void setLEDMon() { setType(ChannelType_t::LEDMON); }
148149

149150
/// \brief Check whether the cell is a LED monitor cell
150151
/// \return True if the cell type is LED monitor, false otherwise
151-
Bool_t getLEDMon() const { return isChannelType(ChannelType_t::LEDMON); }
152+
bool getLEDMon() const { return isChannelType(ChannelType_t::LEDMON); }
152153

153154
/// \brief Mark cell as TRU cell
154155
void setTRU() { setType(ChannelType_t::TRU); }
155156

156157
/// \brief Check whether the cell is a TRU cell
157158
/// \return True if the cell type is TRU, false otherwise
158-
Bool_t getTRU() const { return isChannelType(ChannelType_t::TRU); }
159+
bool getTRU() const { return isChannelType(ChannelType_t::TRU); }
159160

160161
/// \brief Apply compression as done during writing to / reading from CTF
161162
/// \param version Encoder version
@@ -214,7 +215,7 @@ class Cell
214215
static float getEnergyFromPackedBitfieldV0(const char* bitfield);
215216
static float getTimeFromPackedBitfieldV0(const char* bitfield);
216217
static ChannelType_t getCellTypeFromPackedBitfieldV0(const char* bitfield);
217-
static short getTowerFromPackedBitfieldV0(const char* bitfield);
218+
static int16_t getTowerFromPackedBitfieldV0(const char* bitfield);
218219

219220
static uint16_t encodeTime(float timestamp);
220221
static uint16_t encodeEnergyV0(float energy);
@@ -248,7 +249,7 @@ class Cell
248249

249250
float mEnergy = FLT_MIN; ///< Energy
250251
float mTimestamp = FLT_MIN; ///< Timestamp
251-
short mTowerID = SHRT_MAX; ///< Tower ID
252+
int16_t mTowerID = SHRT_MAX; ///< Tower ID
252253
ChannelType_t mChannelType = ChannelType_t::HIGH_GAIN; ///< Cell type
253254

254255
ClassDefNV(Cell, 3);
@@ -262,4 +263,4 @@ std::ostream& operator<<(std::ostream& stream, const Cell& cell);
262263
} // namespace emcal
263264
} // namespace o2
264265

265-
#endif
266+
#endif // DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CELL_H_

DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/CellLabel.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
// granted to it by virtue of its status as an Intergovernmental Organization
1010
// or submit itself to any jurisdiction.
1111

12-
#ifndef ALICEO2_EMCAL_CELLLABEL_H_
13-
#define ALICEO2_EMCAL_CELLLABEL_H_
12+
/// \file CellLabel.h
13+
/// \class CellLabel
14+
/// \brief cell class for MC particle IDs and their respective amplitude fraction
15+
/// \ingroup EMCALDataFormat
16+
/// \author Marvin Hemmer <marvin.hemmer@cern.ch>, Goethe university Frankfurt
17+
/// \since December 13, 2023
18+
///
19+
20+
#ifndef DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CELLLABEL_H_
21+
#define DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CELLLABEL_H_
1422

1523
#include <fairlogger/Logger.h>
1624
#include <gsl/span>
@@ -22,14 +30,6 @@ namespace o2
2230

2331
namespace emcal
2432
{
25-
26-
/// \class CellLabel
27-
/// \brief cell class for MC particle IDs and their respective amplitude fraction
28-
/// \ingroup EMCALDataFormat
29-
/// \author Marvin Hemmer <marvin.hemmer@cern.ch>, Goethe university Frankfurt
30-
/// \since December 13, 2023
31-
///
32-
3333
class CellLabel
3434
{
3535
public:
@@ -46,15 +46,15 @@ class CellLabel
4646

4747
/// \brief Getter of label size
4848
/// \param index index which label to get
49-
size_t GetLabelSize(void) const { return mLabels.size(); }
49+
size_t getLabelSize(void) const { return mLabels.size(); }
5050

5151
/// \brief Getter for label
5252
/// \param index index which label to get
53-
int32_t GetLabel(size_t index) const { return mLabels[index]; }
53+
int32_t getLabel(size_t index) const { return mLabels[index]; }
5454

5555
/// \brief Getter for amplitude fraction
5656
/// \param index index which amplitude fraction to get
57-
float GetAmplitudeFraction(size_t index) const { return mAmplitudeFraction[index]; }
57+
float getAmplitudeFraction(size_t index) const { return mAmplitudeFraction[index]; }
5858

5959
protected:
6060
gsl::span<const int32_t> mLabels; ///< List of MC particles that generated the cluster, ordered in deposited energy.
@@ -63,4 +63,4 @@ class CellLabel
6363

6464
} // namespace emcal
6565
} // namespace o2
66-
#endif // ALICEO2_EMCAL_CELLLABEL_H_
66+
#endif // DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CELLLABEL_H_

DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/Cluster.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
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-
#ifndef ALICEO2_EMCAL_CLUSTER_H_
12-
#define ALICEO2_EMCAL_CLUSTER_H_
11+
12+
/// \file Cluster.h
13+
/// \class Cluster
14+
/// \brief EMCAL Cluster
15+
/// \ingroup EMCALDataFormat
16+
/// \author Markus Fasel <markus.fasel@cern.ch>, Oak Ridge National Laboratory
17+
///
18+
19+
#ifndef DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CLUSTER_H_
20+
#define DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CLUSTER_H_
1321

1422
#include <array>
1523
#include <iosfwd>
@@ -20,25 +28,19 @@
2028

2129
namespace o2
2230
{
23-
2431
namespace emcal
2532
{
26-
27-
/// \class Cluster
28-
/// \brief EMCAL Cluster
29-
/// \ingroup EMCALDataFormat
30-
///
3133
class Cluster : public o2::dataformats::TimeStamp<Float16_t>
3234
{
3335
using CellIndexRange = o2::dataformats::RangeRefComp<8>;
3436

3537
public:
3638
Cluster() = default;
37-
Cluster(Float_t time, int firstcell, int ncells);
39+
Cluster(float time, int firstcell, int ncells);
3840
~Cluster() noexcept = default;
3941

40-
Int_t getNCells() const { return mCellIndices.getEntries(); }
41-
Int_t getCellIndexFirst() const { return mCellIndices.getFirstEntry(); }
42+
int getNCells() const { return mCellIndices.getEntries(); }
43+
int getCellIndexFirst() const { return mCellIndices.getFirstEntry(); }
4244
CellIndexRange getCellIndexRange() const { return mCellIndices; }
4345

4446
void setCellIndices(int firstcell, int ncells)
@@ -62,4 +64,4 @@ std::ostream& operator<<(std::ostream& stream, const o2::emcal::Cluster& cluster
6264

6365
} // namespace o2
6466

65-
#endif
67+
#endif // DATAFORMATS_DETECTORS_EMCAL_INCLUDE_DATAFORMATSEMCAL_CLUSTER_H_

0 commit comments

Comments
 (0)