Skip to content

Commit 30d2516

Browse files
authored
Clang Tidy on tracking (#1821)
1 parent 9aa5700 commit 30d2516

Some content is hidden

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

64 files changed

+1691
-1677
lines changed

Ecal/src/Ecal/EcalHelper.cxx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ std::vector<float> trackProp(const ldmx::Tracks &tracks,
2020
ldmx::Track::TrackState &ecal_track_state = trk_ts.value();
2121

2222
// Check that the track state is filled
23-
if (ecal_track_state.params.size() < 5) continue;
23+
if (ecal_track_state.params_.size() < 5) continue;
2424

25-
float track_state_loc0 = static_cast<float>(ecal_track_state.params[0]);
26-
float track_state_loc1 = static_cast<float>(ecal_track_state.params[1]);
25+
float track_state_loc0 = static_cast<float>(ecal_track_state.params_[0]);
26+
float track_state_loc1 = static_cast<float>(ecal_track_state.params_[1]);
2727
// param 2 = phi (azimuthal), param 3 = theta (polar)
2828
// param 4 = QoP
2929
// ACTS (local) to LDMX (global) coordinates: (y_,z_,x_)-> (x_,y_,z_)
3030
// convert qop [1/GeV] to p [MeV]
31-
float p_track_state = (-1 / ecal_track_state.params[4]) * 1000;
31+
float p_track_state = (-1 / ecal_track_state.params_[4]) * 1000;
3232
// p * sin(theta) * sin(phi)
33-
float recoil_mom_x = p_track_state * sin(ecal_track_state.params[3]) *
34-
sin(ecal_track_state.params[2]);
33+
float recoil_mom_x = p_track_state * sin(ecal_track_state.params_[3]) *
34+
sin(ecal_track_state.params_[2]);
3535
// p * cos(theta)
36-
float recoil_mom_y = p_track_state * cos(ecal_track_state.params[3]);
36+
float recoil_mom_y = p_track_state * cos(ecal_track_state.params_[3]);
3737
// p * sin(theta) * cos(phi)
38-
float recoil_mom_z = p_track_state * sin(ecal_track_state.params[3]) *
39-
cos(ecal_track_state.params[2]);
38+
float recoil_mom_z = p_track_state * sin(ecal_track_state.params_[3]) *
39+
cos(ecal_track_state.params_[2]);
4040

4141
// Store the new track state variables
4242
new_track_states.push_back(track_state_loc0);
@@ -83,4 +83,4 @@ float distPtToLine(ROOT::Math::XYZVector h1, ROOT::Math::XYZVector p1,
8383
return ((h1 - p1).Cross(h1 - p2)).R() / (p1 - p2).R();
8484
}
8585

86-
} // namespace ecal
86+
} // namespace ecal

Hcal/src/Hcal/HcalVetoProcessor.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,24 +214,24 @@ std::vector<float> HcalVetoProcessor::trackProp(const ldmx::Tracks &tracks,
214214
ldmx::Track::TrackState &hcal_track_state = trk_ts.value();
215215

216216
// Check that the track state is filled
217-
if (hcal_track_state.params.size() < 5) continue;
217+
if (hcal_track_state.params_.size() < 5) continue;
218218

219-
float track_state_loc0 = static_cast<float>(hcal_track_state.params[0]);
220-
float track_state_loc1 = static_cast<float>(hcal_track_state.params[1]);
219+
float track_state_loc0 = static_cast<float>(hcal_track_state.params_[0]);
220+
float track_state_loc1 = static_cast<float>(hcal_track_state.params_[1]);
221221

222222
// param 2 = phi (azimuthal), param 3 = theta (polar)
223223
// param 4 = QoP
224224
// ACTS (local) to LDMX (global) coordinates: (y_,z_,x_)-> (x_,y_,z_)
225225
// convert qop [1/GeV] to p [MeV]
226-
double p_track_state = (-1 / hcal_track_state.params[4]) * 1000;
226+
double p_track_state = (-1 / hcal_track_state.params_[4]) * 1000;
227227
// p * sin(theta) * sin(phi)
228-
double recoil_mom_x = p_track_state * sin(hcal_track_state.params[3]) *
229-
sin(hcal_track_state.params[2]);
228+
double recoil_mom_x = p_track_state * sin(hcal_track_state.params_[3]) *
229+
sin(hcal_track_state.params_[2]);
230230
// p * cos(theta)
231-
double recoil_mom_y = p_track_state * cos(hcal_track_state.params[3]);
231+
double recoil_mom_y = p_track_state * cos(hcal_track_state.params_[3]);
232232
// p * sin(theta) * cos(phi)
233-
double recoil_mom_z = p_track_state * sin(hcal_track_state.params[3]) *
234-
cos(hcal_track_state.params[2]);
233+
double recoil_mom_z = p_track_state * sin(hcal_track_state.params_[3]) *
234+
cos(hcal_track_state.params_[2]);
235235

236236
// Store the new track state variables
237237
new_track_states.push_back(track_state_loc0);

Tracking/include/Tracking/Digitization/CDFSiSensorSim.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class CDFSiSensorSim {
3636
*/
3737

3838
private:
39-
std::map<ChargeCarrier, Acts::Vector3> _drift_direction;
40-
std::map<ChargeCarrier, SiElectrodeDataCollection> _sense_data;
41-
std::map<ChargeCarrier, SiElectrodeDataCollection> _readout_data;
39+
std::map<ChargeCarrier, Acts::Vector3> drift_direction_;
40+
std::map<ChargeCarrier, SiElectrodeDataCollection> sense_data_;
41+
std::map<ChargeCarrier, SiElectrodeDataCollection> readout_data_;
4242

4343
// Simple simulation of charge trapping, this is a temporary kludge.
4444
// Charge collection efficiency with linear drift distance dependence.

Tracking/include/Tracking/Digitization/ChargeCarrier.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class ChargeCarrier {
2222
mu_0_exponent_ = mu_0_exponent;
2323
mu_min_factor_ = mu_min_factor;
2424
mu_min_exponent_ = mu_min_exponent;
25-
N_ref_factor_ = N_ref_factor;
26-
N_ref_exponent_ = N_ref_exponent;
25+
n_ref_factor_ = N_ref_factor;
26+
n_ref_exponent_ = N_ref_exponent;
2727
alpha_factor_ = alpha_factor;
2828
alpha_exponent_ = alpha_exponent;
2929
}
@@ -41,22 +41,22 @@ class ChargeCarrier {
4141
double mu_0_exponent_;
4242
double mu_min_factor_;
4343
double mu_min_exponent_;
44-
double N_ref_factor_;
45-
double N_ref_exponent_;
44+
double n_ref_factor_;
45+
double n_ref_exponent_;
4646
double alpha_factor_;
4747
double alpha_exponent_;
4848
};
4949

50-
static const ChargeCarrier electron(-1, 1268.0, -2.33, 92.0, -0.57, 1.3E+17,
50+
static const ChargeCarrier ELECTRON(-1, 1268.0, -2.33, 92.0, -0.57, 1.3E+17,
5151
2.4, 0.91, -0.146);
52-
static const ChargeCarrier hole(1, 406.9, -2.23, 54.3, -0.57, 2.35E+17, 2.4,
52+
static const ChargeCarrier HOLE(1, 406.9, -2.23, 54.3, -0.57, 2.35E+17, 2.4,
5353
0.88, -0.146);
5454

5555
static ChargeCarrier getCarrier(int charge) {
5656
if (charge == -1)
57-
return electron;
57+
return ELECTRON;
5858
else if (charge == 1)
59-
return hole;
59+
return HOLE;
6060
else
6161
throw std::invalid_argument("No ChargeCarrier for charge specified");
6262
}

Tracking/include/Tracking/Digitization/SiElectrodeDataCollection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SiElectrodeDataCollection {
3434

3535
private:
3636
std::map<int, SiElectrodeData> collection_;
37-
std::string electrodePassName_;
37+
std::string electrode_pass_name_;
3838
};
3939

4040
} // namespace digitization

Tracking/include/Tracking/Event/Track.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ class Track {
5656
// will be accessible when reading back the rootfile using for example the
5757
// monitoring code.
5858
struct TrackState {
59-
double refX, refY, refZ;
60-
std::vector<double> params;
61-
std::vector<double> cov;
62-
TrackStateType ts_type;
59+
double ref_x_, ref_y_, ref_z_;
60+
std::vector<double> params_;
61+
std::vector<double> cov_;
62+
TrackStateType ts_type_;
6363
};
6464

6565
Track(){};
@@ -85,8 +85,8 @@ class Track {
8585
int getNhits() const { return n_hits_; }
8686

8787
std::optional<TrackState> getTrackState(TrackStateType tstype) const {
88-
for (auto ts : trackStates_)
89-
if (ts.ts_type == tstype) return std::optional<TrackState>(ts);
88+
for (auto ts : track_states_)
89+
if (ts.ts_type_ == tstype) return std::optional<TrackState>(ts);
9090

9191
return std::nullopt;
9292
}
@@ -109,11 +109,11 @@ class Track {
109109
void setTrackID(int trackid) { track_id_ = trackid; };
110110
int getTrackID() const { return track_id_; };
111111

112-
void setTruthProb(double truthProb) { truthProb_ = truthProb; };
113-
double getTruthProb() const { return truthProb_; };
112+
void setTruthProb(double truthProb) { truth_prob_ = truthProb; };
113+
double getTruthProb() const { return truth_prob_; };
114114

115-
void setPdgID(int pdgID) { pdgID_ = pdgID; };
116-
int getPdgID() const { return pdgID_; };
115+
void setPdgID(int pdgID) { pdg_id_ = pdgID; };
116+
int getPdgID() const { return pdg_id_; };
117117

118118
// in units of e
119119
int q() const { return perigee_pars_[4] > 0 ? 1 : -1; }
@@ -202,10 +202,10 @@ class Track {
202202
double getT() const { return perigee_pars_[5]; };
203203

204204
void addTrackState(const ldmx::Track::TrackState& ts) {
205-
trackStates_.push_back(ts);
205+
track_states_.push_back(ts);
206206
};
207207

208-
std::vector<TrackState> getTrackStates() const { return trackStates_; }
208+
std::vector<TrackState> getTrackStates() const { return track_states_; }
209209

210210
protected:
211211
int n_hits_{0};
@@ -261,13 +261,13 @@ class Track {
261261
int track_id_{-1};
262262

263263
// Truth probability
264-
double truthProb_{0.};
264+
double truth_prob_{0.};
265265

266266
// pdgID
267-
int pdgID_{0};
267+
int pdg_id_{0};
268268

269269
// Track States
270-
std::vector<TrackState> trackStates_;
270+
std::vector<TrackState> track_states_;
271271

272272
/// Class declaration needed by the ROOT dictionary.
273273
ClassDef(Track, 4);

Tracking/include/Tracking/Event/TruthTrack.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ class TruthTrack {
9292
void setTrackID(int trackid) { track_id_ = trackid; };
9393
int getTrackID() const { return track_id_; };
9494

95-
void setPdgID(int pdgID) { pdgID_ = pdgID; };
96-
int getPdgID() const { return pdgID_; };
95+
void setPdgID(int pdgID) { pdg_id_ = pdgID; };
96+
int getPdgID() const { return pdg_id_; };
9797

98-
void setNhits(int nHits) { nHits_ = nHits; };
99-
int getNhits() const { return nHits_; }
98+
void setNhits(int nHits) { n_hits_ = nHits; };
99+
int getNhits() const { return n_hits_; }
100100

101101
// in units of e
102102
int q() const { return perigee_pars_[4] > 0 ? 1 : -1; }
@@ -164,13 +164,13 @@ class TruthTrack {
164164
std::vector<double> position_{0., 0., 0.};
165165

166166
// N hits_
167-
int nHits_{0};
167+
int n_hits_{0};
168168

169169
// ID of the matched particle in the SimParticles map
170170
int track_id_{-1};
171171

172172
// pdgID
173-
int pdgID_{0};
173+
int pdg_id_{0};
174174

175175
/// Class declaration needed by the ROOT dictionary.
176176
ClassDef(TruthTrack, 3);

Tracking/include/Tracking/Reco/ActsUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace tracking {
1111
namespace reco {
1212
namespace utils {
1313

14-
Acts::Vector3 Ldmx2Acts(Acts::Vector3 ldmx_v);
14+
Acts::Vector3 ldmx2Acts(Acts::Vector3 ldmx_v);
1515

1616
}
1717
} // namespace reco

Tracking/include/Tracking/Reco/AlignmentTestProcessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AlignmentTestProcessor final : public TrackingGeometryUser {
3030
void produce(framework::Event& event) override;
3131

3232
private:
33-
std::unordered_map<unsigned int, Acts::Transform3> alignmentTransforms;
33+
std::unordered_map<unsigned int, Acts::Transform3> alignment_transforms_;
3434

3535
tracking::geo::GeometryContext test_gctx_;
3636
// The Trackers Tracking geometry

Tracking/include/Tracking/Reco/CKFProcessor.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class CKFProcessor final : public TrackingGeometryUser {
141141
auto makeGeoIdSourceLinkMap(const geo::TrackersTrackingGeometry &tg,
142142
const std::vector<ldmx::Measurement> &ldmxsps)
143143
-> std::unordered_multimap<Acts::GeometryIdentifier,
144-
ActsExamples::IndexSourceLink>;
144+
acts_examples::IndexSourceLink>;
145145

146146
template <typename geometry_t, typename source_link_hash_t,
147147
typename source_link_equality_t>
@@ -165,8 +165,8 @@ class CKFProcessor final : public TrackingGeometryUser {
165165

166166
bool debug_acts_{false};
167167

168-
std::shared_ptr<Acts::PlaneSurface> target_surface;
169-
Acts::RotationMatrix3 surf_rotation;
168+
std::shared_ptr<Acts::PlaneSurface> target_surface_;
169+
Acts::RotationMatrix3 surf_rotation_;
170170
// Constant BField
171171
double bfield_{0};
172172
// Use constant bfield
@@ -176,14 +176,14 @@ class CKFProcessor final : public TrackingGeometryUser {
176176
bool remove_stereo_{false};
177177

178178
// Use 2d measurements instead of 1D
179-
bool use1Dmeasurements_{true};
179+
bool use1_dmeasurements_{true};
180180

181181
// Minimum number of hits on tracks
182182
int min_hits_{7};
183183

184184
// Stepping size (in mm)
185185
double propagator_step_size_{200.};
186-
int propagator_maxSteps_{1000};
186+
int propagator_max_steps_{1000};
187187

188188
// The extrapolation surface
189189
bool use_extrapolate_location_{true};
@@ -193,7 +193,7 @@ class CKFProcessor final : public TrackingGeometryUser {
193193
// The measurement collection to use for track reconstruction
194194
std::string measurement_collection_{"TaggerMeasurements"};
195195

196-
std::string simParticles_passName_;
196+
std::string sim_particles_pass_name_;
197197
std::string sim_particles_event_passname_;
198198

199199
// Outlier removal pvalue
@@ -239,7 +239,7 @@ class CKFProcessor final : public TrackingGeometryUser {
239239
};
240240

241241
// Keep track on which system this processor is running on
242-
bool taggerTracking_{true};
242+
bool tagger_tracking_{true};
243243

244244
}; // CKFProcessor
245245

0 commit comments

Comments
 (0)