@@ -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}
571593void 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
600624void 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}
0 commit comments