Skip to content

Commit a705631

Browse files
anerokhisawenzel
authored andcommitted
Detectors/TOF: make readability-braces-around-statements happy
1 parent 0355306 commit a705631

35 files changed

Lines changed: 593 additions & 322 deletions

Detectors/TOF/base/src/Digit.cxx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,17 @@ void Digit::getPhiAndEtaIndex(int& phi, int& eta) const
6868
chan = getChannel(); // note that inside the strip the digits are ordered per channel number
6969
Geo::getVolumeIndices(chan, detId); // Get volume index from channel index
7070
eta = detId[2] /*strip*/ * 2 + detId[3] /*pad Z*/;
71-
if (detId[1] /*module*/ == 0)
71+
if (detId[1] /*module*/ == 0) {
7272
eta += 0;
73-
else if (detId[1] == 1)
73+
} else if (detId[1] == 1) {
7474
eta += 38;
75-
else if (detId[1] == 2)
75+
} else if (detId[1] == 2) {
7676
eta += 76;
77-
else if (detId[1] == 3)
77+
} else if (detId[1] == 3) {
7878
eta += 106;
79-
else if (detId[1] == 4)
79+
} else if (detId[1] == 4) {
8080
eta += 144;
81+
}
8182
phi = detId[0] /*phi sector*/ * 48 + detId[4] /*pad x*/;
8283

8384
return;

Detectors/TOF/base/src/Geo.cxx

Lines changed: 73 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ void Geo::Init()
4545
for (Int_t iplate = 0; iplate < NPLATES; iplate++) {
4646
det[1] = iplate;
4747

48-
if (iplate == 2 && (isector == 13 || isector == 14 || isector == 15))
48+
if (iplate == 2 && (isector == 13 || isector == 14 || isector == 15)) {
4949
continue; // PHOS HOLES
50+
}
5051

5152
for (Int_t istrip = 0; istrip < NSTRIPC; istrip++) { // maximum number of strip is 19 for plate B and C
5253
det[2] = istrip;
@@ -72,8 +73,9 @@ void Geo::Init()
7273

7374
Double_t rotationAngles[6] =
7475
{90., 90. /*+ (isector + 0.5) * PHISEC*/, 0., 0., 90., 0 /* + (isector + 0.5) * PHISEC*/};
75-
for (Int_t ii = 0; ii < 6; ii++)
76+
for (Int_t ii = 0; ii < 6; ii++) {
7677
rotationAngles[ii] *= TMath::DegToRad();
78+
}
7779

7880
for (Int_t isector = 0; isector < NSECTORS; isector++) {
7981
rotationAngles[5] = ((isector + 0.5) * PHISEC) * TMath::DegToRad();
@@ -162,23 +164,30 @@ void Geo::getVolumePath(const Int_t* ind, Char_t* path)
162164

163165
Int_t iplate = ind[1];
164166
Int_t istrip = ind[2];
165-
if (iplate == 0)
167+
if (iplate == 0) {
166168
icopy = istrip;
167-
if (iplate == 1)
169+
}
170+
if (iplate == 1) {
168171
icopy = istrip + NSTRIPC;
169-
if (iplate == 2)
172+
}
173+
if (iplate == 2) {
170174
icopy = istrip + NSTRIPC + NSTRIPB;
171-
if (iplate == 3)
175+
}
176+
if (iplate == 3) {
172177
icopy = istrip + NSTRIPC + NSTRIPB + NSTRIPA;
173-
if (iplate == 4)
178+
}
179+
if (iplate == 4) {
174180
icopy = istrip + NSTRIPC + 2 * NSTRIPB + NSTRIPA;
181+
}
175182
icopy++;
176183
snprintf(string2, kSize, "FTOA_0/FLTA_0/FSTR_%i", icopy);
177184
if (fgHoles && (sector == 13 || sector == 14 || sector == 15)) {
178-
if (iplate < 2)
185+
if (iplate < 2) {
179186
snprintf(string2, kSize, "FTOB_0/FLTB_0/FSTR_%i", icopy);
180-
if (iplate > 2)
187+
}
188+
if (iplate > 2) {
181189
snprintf(string2, kSize, "FTOC_0/FLTC_0/FSTR_%i", icopy);
190+
}
182191
}
183192

184193
Int_t padz = ind[3] + 1;
@@ -193,8 +202,9 @@ void Geo::getPos(Int_t* det, Float_t* pos)
193202
// Returns space point coor (x,y,z) (cm) for Detector
194203
// Indices (iSect,iPlate,iStrip,iPadZ,iPadX)
195204
//
196-
if (mToBeIntit)
205+
if (mToBeIntit) {
197206
Init();
207+
}
198208

199209
// printf("TOFDBG: %d, %d, %d, %d, %d -> %f %f %f\n", det[0], det[1], det[2], det[3], det[4], mPadPosition[det[0]][det[1]][det[2]][det[3]][det[4]][0], mPadPosition[det[0]][det[1]][det[2]][det[3]][det[4]][1], mPadPosition[det[0]][det[1]][det[2]][det[3]][det[4]][2]);
200210
pos[0] = mPadPosition[det[0]][det[1]][det[2]][det[3]][det[4]][0];
@@ -208,12 +218,14 @@ void Geo::getDetID(Float_t* pos, Int_t* det)
208218
// Returns Detector Indices (iSect,iPlate,iStrip,iPadZ,iPadX)
209219
// space point coor (x,y,z) (cm)
210220

211-
if (mToBeIntit)
221+
if (mToBeIntit) {
212222
Init();
223+
}
213224

214225
Float_t posLocal[3];
215-
for (Int_t ii = 0; ii < 3; ii++)
226+
for (Int_t ii = 0; ii < 3; ii++) {
216227
posLocal[ii] = pos[ii];
228+
}
217229

218230
det[0] = getSector(posLocal);
219231

@@ -402,8 +414,9 @@ Int_t Geo::fromPlateToStrip(Float_t* pos, Int_t iplate)
402414
step[2] = -0.5 * NPADZ * ZPAD;
403415
translate(posLoc2, step);
404416

405-
for (Int_t jj = 0; jj < 3; jj++)
417+
for (Int_t jj = 0; jj < 3; jj++) {
406418
pos[jj] = posLoc2[jj];
419+
}
407420

408421
return istrip;
409422
}
@@ -442,11 +455,13 @@ void Geo::getPadDxDyDz(const Float_t* pos, Int_t* det, Float_t* DeltaPos)
442455
//
443456
// Returns the x coordinate in the Pad reference frame
444457
//
445-
if (mToBeIntit)
458+
if (mToBeIntit) {
446459
Init();
460+
}
447461

448-
for (Int_t ii = 0; ii < 3; ii++)
462+
for (Int_t ii = 0; ii < 3; ii++) {
449463
DeltaPos[ii] = pos[ii];
464+
}
450465

451466
det[0] = getSector(DeltaPos);
452467
fromGlobalToSector(DeltaPos, det[0]);
@@ -488,41 +503,45 @@ Int_t Geo::getPlate(const Float_t* pos)
488503
deltaRHOmax = (RMAX - RMIN) * 0.5 - MODULEWALLTHICKNESS - 2. * LENGTHEXINMODBORDER; // old 5.35, new 4.8
489504

490505
if (deltaRhoLoc > deltaZetaLoc * deltaRHOmax / (INTERCENTRMODBORDER2 - INTERCENTRMODBORDER1)) {
491-
if (zLocal < 0)
506+
if (zLocal < 0) {
492507
iPlate = 0;
493-
else
508+
} else {
494509
iPlate = 4;
510+
}
495511
} else {
496-
if (zLocal < 0)
512+
if (zLocal < 0) {
497513
iPlate = 1;
498-
else
514+
} else {
499515
iPlate = 3;
516+
}
500517
}
501518
} else if (TMath::Abs(zLocal) >= INTERCENTRMODBORDER1 && TMath::Abs(zLocal) <= INTERCENTRMODBORDER2) {
502519
deltaRhoLoc -= LENGTHINCEMODBORDERD;
503520
deltaZetaLoc = deltaZetaLoc - INTERCENTRMODBORDER1;
504521
deltaRHOmax = (RMAX - RMIN) * 0.5 - MODULEWALLTHICKNESS - 2. * LENGTHINCEMODBORDERD; // old 0.39, new 0.2
505522

506-
if (deltaRhoLoc > deltaZetaLoc * deltaRHOmax / (INTERCENTRMODBORDER2 - INTERCENTRMODBORDER1))
523+
if (deltaRhoLoc > deltaZetaLoc * deltaRHOmax / (INTERCENTRMODBORDER2 - INTERCENTRMODBORDER1)) {
507524
iPlate = 2;
508-
else {
509-
if (zLocal < 0)
525+
} else {
526+
if (zLocal < 0) {
510527
iPlate = 1;
511-
else
528+
} else {
512529
iPlate = 3;
530+
}
513531
}
514532
}
515533

516-
if (zLocal > -ZLENA * 0.5 && zLocal < -EXTERINTERMODBORDER2)
534+
if (zLocal > -ZLENA * 0.5 && zLocal < -EXTERINTERMODBORDER2) {
517535
iPlate = 0;
518-
else if (zLocal > -EXTERINTERMODBORDER1 && zLocal < -INTERCENTRMODBORDER2)
536+
} else if (zLocal > -EXTERINTERMODBORDER1 && zLocal < -INTERCENTRMODBORDER2) {
519537
iPlate = 1;
520-
else if (zLocal > -INTERCENTRMODBORDER1 && zLocal < INTERCENTRMODBORDER1)
538+
} else if (zLocal > -INTERCENTRMODBORDER1 && zLocal < INTERCENTRMODBORDER1) {
521539
iPlate = 2;
522-
else if (zLocal > INTERCENTRMODBORDER2 && zLocal < EXTERINTERMODBORDER1)
540+
} else if (zLocal > INTERCENTRMODBORDER2 && zLocal < EXTERINTERMODBORDER1) {
523541
iPlate = 3;
524-
else if (zLocal > EXTERINTERMODBORDER2 && zLocal < ZLENA * 0.5)
542+
} else if (zLocal > EXTERINTERMODBORDER2 && zLocal < ZLENA * 0.5) {
525543
iPlate = 4;
544+
}
526545

527546
return iPlate;
528547
}
@@ -534,10 +553,11 @@ Int_t Geo::getPadZ(const Float_t* pos)
534553
//
535554

536555
Int_t iPadZ = (Int_t)(pos[2] / ZPAD);
537-
if (iPadZ == NPADZ)
556+
if (iPadZ == NPADZ) {
538557
iPadZ--;
539-
else if (iPadZ > NPADZ)
558+
} else if (iPadZ > NPADZ) {
540559
iPadZ = -1;
560+
}
541561

542562
return iPadZ;
543563
}
@@ -549,10 +569,11 @@ Int_t Geo::getPadX(const Float_t* pos)
549569
//
550570

551571
Int_t iPadX = (Int_t)(pos[0] / XPAD);
552-
if (iPadX == NPADX)
572+
if (iPadX == NPADX) {
553573
iPadX--;
554-
else if (iPadX > NPADX)
574+
} else if (iPadX > NPADX) {
555575
iPadX = -1;
576+
}
556577

557578
return iPadX;
558579
}
@@ -563,15 +584,17 @@ void Geo::translate(Float_t* xyz, Float_t translationVector[3])
563584
// Return the vector xyz translated by translationVector vector
564585
//
565586

566-
for (Int_t ii = 0; ii < 3; ii++)
587+
for (Int_t ii = 0; ii < 3; ii++) {
567588
xyz[ii] -= translationVector[ii];
589+
}
568590

569591
return;
570592
}
571593
void Geo::antiRotateToSector(Float_t* xyz, Int_t isector)
572594
{
573-
if (mToBeIntit)
595+
if (mToBeIntit) {
574596
Init();
597+
}
575598

576599
Float_t xyzDummy[3] = {0., 0., 0.};
577600

@@ -591,16 +614,18 @@ void Geo::antiRotateToSector(Float_t* xyz, Int_t isector)
591614
xyz[2] * matAR[ii][2];
592615
}
593616

594-
for (Int_t ii = 0; ii < 3; ii++)
617+
for (Int_t ii = 0; ii < 3; ii++) {
595618
xyz[ii] = xyzDummy[ii];
619+
}
596620

597621
return;
598622
}
599623

600624
void Geo::rotateToSector(Float_t* xyz, Int_t isector)
601625
{
602-
if (mToBeIntit)
626+
if (mToBeIntit) {
603627
Init();
628+
}
604629

605630
Float_t xyzDummy[3] = {0., 0., 0.};
606631

@@ -609,8 +634,9 @@ void Geo::rotateToSector(Float_t* xyz, Int_t isector)
609634
xyz[2] * mRotationMatrixSector[isector][ii][2];
610635
}
611636

612-
for (Int_t ii = 0; ii < 3; ii++)
637+
for (Int_t ii = 0; ii < 3; ii++) {
613638
xyz[ii] = xyzDummy[ii];
639+
}
614640

615641
return;
616642
}
@@ -625,8 +651,9 @@ void Geo::rotateToStrip(Float_t* xyz, Int_t iplate, Int_t istrip)
625651
xyz[2] * mRotationMatrixPlateStrip[iplate][istrip][ii][2];
626652
}
627653

628-
for (Int_t ii = 0; ii < 3; ii++)
654+
for (Int_t ii = 0; ii < 3; ii++) {
629655
xyz[ii] = xyzDummy[ii];
656+
}
630657

631658
return;
632659
}
@@ -643,8 +670,9 @@ void Geo::rotate(Float_t* xyz, Double_t rotationAngles[6])
643670
angles[4], angles[5]);
644671
*/
645672

646-
for (Int_t ii = 0; ii < 6; ii++)
673+
for (Int_t ii = 0; ii < 6; ii++) {
647674
rotationAngles[ii] *= TMath::DegToRad();
675+
}
648676

649677
Float_t xyzDummy[3] = {0., 0., 0.};
650678

@@ -654,8 +682,9 @@ void Geo::rotate(Float_t* xyz, Double_t rotationAngles[6])
654682
xyz[2] * TMath::Cos(rotationAngles[2 * ii]);
655683
}
656684

657-
for (Int_t ii = 0; ii < 3; ii++)
685+
for (Int_t ii = 0; ii < 3; ii++) {
658686
xyz[ii] = xyzDummy[ii];
687+
}
659688

660689
return;
661690
}
@@ -666,8 +695,9 @@ void Geo::antiRotate(Float_t* xyz, Double_t rotationAngles[6])
666695
// Rotates the vector xyz acordint to the rotationAngles
667696
//
668697

669-
for (Int_t ii = 0; ii < 6; ii++)
698+
for (Int_t ii = 0; ii < 6; ii++) {
670699
rotationAngles[ii] *= TMath::DegToRad();
700+
}
671701

672702
Float_t xyzDummy[3] = {0., 0., 0.};
673703

@@ -682,8 +712,9 @@ void Geo::antiRotate(Float_t* xyz, Double_t rotationAngles[6])
682712
xyzDummy[2] = xyz[0] * TMath::Cos(rotationAngles[0]) + xyz[1] * TMath::Cos(rotationAngles[2]) +
683713
xyz[2] * TMath::Cos(rotationAngles[4]);
684714

685-
for (Int_t ii = 0; ii < 3; ii++)
715+
for (Int_t ii = 0; ii < 3; ii++) {
686716
xyz[ii] = xyzDummy[ii];
717+
}
687718

688719
return;
689720
}

Detectors/TOF/base/src/Strip.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ void Strip::fillOutputContainer(std::vector<Digit>& digits)
5959
// we assume that the Strip has stored inside only digits from one readout
6060
// window --> we flush them all
6161

62-
if (mDigits.empty())
62+
if (mDigits.empty()) {
6363
return;
64+
}
6465
auto itBeg = mDigits.begin();
6566
auto iter = itBeg;
6667
for (; iter != mDigits.end(); ++iter) {

0 commit comments

Comments
 (0)