Skip to content

Commit 2cffd92

Browse files
anerokhisawenzel
authored andcommitted
Residuals: make readability-braces-around-statements happy
1 parent 658cd1e commit 2cffd92

54 files changed

Lines changed: 379 additions & 200 deletions

File tree

Some content is hidden

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

Analysis/Tasks/PWGCF/correlationsFiltered.cxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ struct CorrelationTask {
174174
}
175175

176176
float deltaPhi = track1.phi() - track2.phi();
177-
if (deltaPhi > 1.5 * TMath::Pi())
177+
if (deltaPhi > 1.5 * TMath::Pi()) {
178178
deltaPhi -= TMath::TwoPi();
179-
if (deltaPhi < -0.5 * TMath::Pi())
179+
}
180+
if (deltaPhi < -0.5 * TMath::Pi()) {
180181
deltaPhi += TMath::TwoPi();
182+
}
181183

182184
same->getPairHist()->Fill(CorrelationContainer::kCFStepReconstructed,
183185
track1.eta() - track2.eta(), track2.pt(), track1.pt(), centrality, deltaPhi, collision.posZ());

DataFormats/Calibration/include/DataFormatsCalibration/MeanVertexObject.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ class MeanVertexObject
5050
void setZ(float val) { mPos[2] = val; }
5151
void setPos(std::array<float, 3> val)
5252
{
53-
for (int i = 0; i < 3; i++)
53+
for (int i = 0; i < 3; i++) {
5454
mPos[i] = val[i];
55+
}
5556
}
5657

5758
float getX() const { return mPos[0]; }
@@ -64,8 +65,9 @@ class MeanVertexObject
6465
void setSigmaZ(float val) { mSigma[2] = val; }
6566
void setSigma(std::array<float, 3> val)
6667
{
67-
for (int i = 0; i < 3; i++)
68+
for (int i = 0; i < 3; i++) {
6869
mSigma[i] = val[i];
70+
}
6971
}
7072

7173
float getSigmaX() const { return mSigma[0]; }

DataFormats/Detectors/EMCAL/src/Cell.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ void Cell::setTimeStamp(float timestamp)
4040
// truncate:
4141
const float TIME_MIN = -1. * TIME_SHIFT,
4242
TIME_MAX = TIME_RANGE - TIME_SHIFT;
43-
if (timestamp < TIME_MIN)
43+
if (timestamp < TIME_MIN) {
4444
timestamp = TIME_MIN;
45-
else if (timestamp > TIME_MAX)
45+
} else if (timestamp > TIME_MAX) {
4646
timestamp = TIME_MAX;
47+
}
4748
getDataRepresentation()->mTime = static_cast<uint16_t>((timestamp + TIME_SHIFT) / TIME_RESOLUTION);
4849
}
4950

DataFormats/Detectors/EMCAL/test/testCell.cxx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,17 @@ BOOST_AUTO_TEST_CASE(Cell_test)
5454

5555
for (auto e : energies) {
5656
c.setEnergy(e);
57-
if (e > 16)
57+
if (e > 16) {
5858
c.setLowGain();
59+
}
5960
BOOST_CHECK_EQUAL(c.getTower(), 0);
6061
BOOST_CHECK_SMALL(double(c.getTimeStamp()), 0.73);
6162
BOOST_CHECK_SMALL(e - c.getEnergy(), 0.02); // Require 20 MeV resolution
62-
if (e > 16)
63+
if (e > 16) {
6364
BOOST_CHECK_EQUAL(c.getLowGain(), true);
64-
else
65+
} else {
6566
BOOST_CHECK_EQUAL(c.getHighGain(), true);
67+
}
6668
}
6769

6870
c.setEnergy(0);

Detectors/DCS/src/DCSProcessor.cxx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,22 +230,30 @@ int DCSProcessor::processMap(const std::unordered_map<DPID, DPVAL>& map, bool is
230230
mDpsbinariesmap);
231231

232232
if (!isDelta) {
233-
if (foundChars != mPidschars.size())
233+
if (foundChars != mPidschars.size()) {
234234
LOG(INFO) << "Not all expected char-typed DPs found!";
235-
if (foundInts != mPidsints.size())
235+
}
236+
if (foundInts != mPidsints.size()) {
236237
LOG(INFO) << "Not all expected int-typed DPs found!";
237-
if (foundDoubles != mPidsdoubles.size())
238+
}
239+
if (foundDoubles != mPidsdoubles.size()) {
238240
LOG(INFO) << "Not all expected double-typed DPs found!";
239-
if (foundUInts != mPidsUints.size())
241+
}
242+
if (foundUInts != mPidsUints.size()) {
240243
LOG(INFO) << "Not all expected uint-typed DPs found!";
241-
if (foundBools != mPidsbools.size())
244+
}
245+
if (foundBools != mPidsbools.size()) {
242246
LOG(INFO) << "Not all expected bool-typed DPs found!";
243-
if (foundStrings != mPidsstrings.size())
247+
}
248+
if (foundStrings != mPidsstrings.size()) {
244249
LOG(INFO) << "Not all expected string-typed DPs found!";
245-
if (foundTimes != mPidstimes.size())
250+
}
251+
if (foundTimes != mPidstimes.size()) {
246252
LOG(INFO) << "Not all expected time-typed DPs found!";
247-
if (foundBinaries != mPidsbinaries.size())
253+
}
254+
if (foundBinaries != mPidsbinaries.size()) {
248255
LOG(INFO) << "Not all expected binary-typed DPs found!";
256+
}
249257
}
250258

251259
// filling CCDB info to be sent in output

Detectors/FIT/FDD/reconstruction/src/ReadRaw.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ void ReadRaw::readRawData(const LookUpTable& lut)
122122
//_____________________________________________________________________________________
123123
void ReadRaw::close()
124124
{
125-
if (mRawFileIn.is_open())
125+
if (mRawFileIn.is_open()) {
126126
mRawFileIn.close();
127+
}
127128
}
128129
//_____________________________________________________________________________________
129130
void ReadRaw::writeDigits(const std::string& outputDigitsFilePath)

Detectors/MUON/MCH/Simulation/src/Digitizer.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ void Digitizer::process(const std::vector<Hit> hits, std::vector<Digit>& digits,
103103
} //loop over hits
104104

105105
//generate noise-only digits
106-
if (mNoise)
106+
if (mNoise) {
107107
generateNoiseDigits();
108+
}
108109

109110
fillOutputContainer(digits);
110111
provideMC(mcContainer);

Detectors/PHOS/simulation/include/PHOSSimulation/GeometryParams.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ class GeometryParams final : public TNamed
3333
/// get singleton (create if necessary)
3434
static GeometryParams* GetInstance(const std::string_view name = "Run2")
3535
{
36-
if (!sGeomParam)
36+
if (!sGeomParam) {
3737
sGeomParam = new GeometryParams(name);
38+
}
3839
return sGeomParam;
3940
}
4041

@@ -54,14 +55,17 @@ class GeometryParams final : public TNamed
5455

5556
void getModuleCenter(int module, float* pos) const
5657
{
57-
for (int i = 0; i < 3; i++)
58+
for (int i = 0; i < 3; i++) {
5859
pos[i] = mModuleCenter[module][i];
60+
}
5961
}
6062
void getModuleAngle(int module, float angle[3][2]) const
6163
{
62-
for (int i = 0; i < 3; i++)
63-
for (int ian = 0; ian < 2; ian++)
64+
for (int i = 0; i < 3; i++) {
65+
for (int ian = 0; ian < 2; ian++) {
6466
angle[i][ian] = mModuleAngle[module][i][ian];
67+
}
68+
}
6569
}
6670
// Return PHOS support geometry parameters
6771
float getRailOuterSize(int index) const { return mRailOuterSize[index]; }

Detectors/Raw/include/DetectorsRaw/RawFileReader.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ class RawFileReader
126126
LinkBlock(int fid, size_t offs) : offset(offs), fileID(fid) {}
127127
void setFlag(uint8_t fl, bool v = true)
128128
{
129-
if (v)
129+
if (v) {
130130
flags |= fl;
131-
else
131+
} else {
132132
flags &= ~fl;
133+
}
133134
}
134135
bool testFlag(uint8_t fl) const { return (flags & fl) == fl; }
135136
void print(const std::string& pref = "") const;

Detectors/TOF/base/src/WindowFiller.cxx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,17 @@ void WindowFiller::fillDigitsInStrip(std::vector<Strip>* strips, int channel, in
111111
//______________________________________________________________________
112112
void WindowFiller::addCrateHeaderData(unsigned long orbit, int crate, int32_t bc, uint32_t eventCounter)
113113
{
114-
if (orbit < mFirstIR.orbit)
114+
if (orbit < mFirstIR.orbit) {
115115
return;
116+
}
116117
orbit -= mFirstIR.orbit;
117118

118119
orbit *= Geo::NWINDOW_IN_ORBIT; // move from orbit to N readout window
119120
orbit += (bc + 100) / Geo::BC_IN_WINDOW; // select readout window in the orbit according to the BC (100 shift to avoid border effects)
120121

121-
if (mCrateHeaderData.size() < orbit + 1)
122+
if (mCrateHeaderData.size() < orbit + 1) {
122123
mCrateHeaderData.resize(orbit + 1);
124+
}
123125

124126
mCrateHeaderData[orbit].bc[crate] = bc;
125127
mCrateHeaderData[orbit].eventCounter[crate] = eventCounter;
@@ -159,22 +161,27 @@ void WindowFiller::fillOutputContainer(std::vector<Digit>& digits)
159161
if (mCrateHeaderData[irow].bc[icrate] == -1) { // crate not read
160162
info.setEmptyCrate(icrate);
161163
continue;
162-
} else
164+
} else {
163165
mDigitHeader.crateSeen(icrate);
166+
}
164167
ncratesSeen++;
165168

166-
if (bc_shift == -1 || mCrateHeaderData[irow].bc[icrate] < bc_shift)
169+
if (bc_shift == -1 || mCrateHeaderData[irow].bc[icrate] < bc_shift) {
167170
bc_shift = mCrateHeaderData[irow].bc[icrate];
168-
if (eventcounter == -1 || mCrateHeaderData[irow].eventCounter[icrate] < eventcounter)
171+
}
172+
if (eventcounter == -1 || mCrateHeaderData[irow].eventCounter[icrate] < eventcounter) {
169173
eventcounter = mCrateHeaderData[irow].eventCounter[icrate];
174+
}
170175
}
171176

172177
mDigitHeader.numCratesSeen(ncratesSeen);
173178

174-
if (bc_shift == -1)
179+
if (bc_shift == -1) {
175180
bc_shift = (mReadoutWindowData.size() % Geo::NWINDOW_IN_ORBIT) * Geo::BC_IN_WINDOW; // insert default value
176-
if (eventcounter == -1)
181+
}
182+
if (eventcounter == -1) {
177183
eventcounter = mReadoutWindowData.size() % 4096; // insert default value
184+
}
178185
}
179186

180187
info.setBCData(mFirstIR.orbit + orbit_shift, mFirstIR.bc + bc_shift);

0 commit comments

Comments
 (0)