Skip to content

Commit 91c7686

Browse files
committed
ITS: Tracker add constexpr
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 3615d30 commit 91c7686

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Tracker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ float Tracker::evaluateTask(void (Tracker::*task)(T...), const char* taskName, s
122122
{
123123
float diff{0.f};
124124

125-
if (constants::DoTimeBenchmarks) {
125+
if constexpr (constants::DoTimeBenchmarks) {
126126
auto start = std::chrono::high_resolution_clock::now();
127127
(this->*task)(std::forward<T>(args)...);
128128
auto end = std::chrono::high_resolution_clock::now();

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Vertexer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ float Vertexer::evaluateTask(void (Vertexer::*task)(T...), const char* taskName,
176176
{
177177
float diff{0.f};
178178

179-
if (constants::DoTimeBenchmarks) {
179+
if constexpr (constants::DoTimeBenchmarks) {
180180
auto start = std::chrono::high_resolution_clock::now();
181181
(this->*task)(std::forward<T>(args)...);
182182
auto end = std::chrono::high_resolution_clock::now();

Detectors/ITSMFT/ITS/tracking/src/Tracker.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void Tracker::clustersToTracks(std::function<void(std::string s)> logger, std::f
120120
total += evaluateTask(&Tracker::findShortPrimaries, "Short primaries finding", logger);
121121

122122
std::stringstream sstream;
123-
if (constants::DoTimeBenchmarks) {
123+
if constexpr (constants::DoTimeBenchmarks) {
124124
sstream << std::setw(2) << " - "
125125
<< "Timeframe " << mTimeFrameCounter++ << " processing completed in: " << total << "ms using " << mTraits->getNThreads() << " threads.";
126126
}
@@ -200,7 +200,7 @@ void Tracker::clustersToTracksHybrid(std::function<void(std::string s)> logger,
200200
// total += evaluateTask(&Tracker::findShortPrimaries, "Hybrid short primaries finding", logger);
201201

202202
std::stringstream sstream;
203-
if (constants::DoTimeBenchmarks) {
203+
if constexpr (constants::DoTimeBenchmarks) {
204204
sstream << std::setw(2) << " - "
205205
<< "Timeframe " << mTimeFrameCounter++ << " processing completed in: " << total << "ms using " << mTraits->getNThreads() << " threads.";
206206
}

Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,8 @@ bool TrackerTraits::fitTrack(TrackITSExt& track, int start, int end, int step, f
830830
}
831831

832832
if (mCorrType == o2::base::PropagatorF::MatCorrType::USEMatCorrNONE) {
833-
float radl = 9.36f; // Radiation length of Si [cm]
834-
float rho = 2.33f; // Density of Si [g/cm^3]
833+
constexpr float radl = 9.36f; // Radiation length of Si [cm]
834+
constexpr float rho = 2.33f; // Density of Si [g/cm^3]
835835
if (!track.correctForMaterial(mTrkParams[0].LayerxX0[iLayer], mTrkParams[0].LayerxX0[iLayer] * radl * rho, true)) {
836836
continue;
837837
}

0 commit comments

Comments
 (0)