Skip to content

Commit ee540cd

Browse files
committed
[ALCA] apply code-format
1 parent 57a5208 commit ee540cd

File tree

8 files changed

+53
-66
lines changed

8 files changed

+53
-66
lines changed

Alignment/CommonAlignment/src/AlignableObjectId.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,9 @@ namespace {
225225
}
226226

227227
constexpr enum align::StructureType stringToObjectId(char const *name, AlignableObjectId::entry const *entries) {
228-
return !entries->name ? align::invalid
229-
: same(entries->name, name) ? entries->type : stringToObjectId(name, entries + 1);
228+
return !entries->name ? align::invalid
229+
: same(entries->name, name) ? entries->type
230+
: stringToObjectId(name, entries + 1);
230231
}
231232
} // namespace
232233

CalibCalorimetry/CastorCalib/src/CastorDbASCIIIO.cc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ namespace CastorDbASCIIIO {
2424
if (first.isHcalDetId()) {
2525
HcalDetId f1(first);
2626
HcalDetId s1(second);
27-
return f1.zside() != s1.zside()
28-
? f1.zside() < s1.zside()
29-
: f1.iphi() != s1.iphi()
30-
? f1.iphi() < s1.iphi()
31-
: f1.ietaAbs() != s1.ietaAbs() ? f1.ietaAbs() < s1.ietaAbs() : f1.depth() < s1.depth();
27+
return f1.zside() != s1.zside() ? f1.zside() < s1.zside()
28+
: f1.iphi() != s1.iphi() ? f1.iphi() < s1.iphi()
29+
: f1.ietaAbs() != s1.ietaAbs() ? f1.ietaAbs() < s1.ietaAbs()
30+
: f1.depth() < s1.depth();
3231
} else {
3332
return first.rawId() < second.rawId();
3433
}
@@ -39,12 +38,10 @@ namespace CastorDbASCIIIO {
3938
bool operator()(CastorElectronicsId first, CastorElectronicsId second) const {
4039
return first.readoutVMECrateId() != second.readoutVMECrateId()
4140
? first.readoutVMECrateId() < second.readoutVMECrateId()
42-
: first.htrSlot() != second.htrSlot()
43-
? first.htrSlot() < second.htrSlot()
44-
: first.htrTopBottom() != second.htrTopBottom()
45-
? first.htrTopBottom() < second.htrTopBottom()
46-
: first.fiberIndex() != second.fiberIndex() ? first.fiberIndex() < second.fiberIndex()
47-
: first.fiberChanId() < second.fiberChanId();
41+
: first.htrSlot() != second.htrSlot() ? first.htrSlot() < second.htrSlot()
42+
: first.htrTopBottom() != second.htrTopBottom() ? first.htrTopBottom() < second.htrTopBottom()
43+
: first.fiberIndex() != second.fiberIndex() ? first.fiberIndex() < second.fiberIndex()
44+
: first.fiberChanId() < second.fiberChanId();
4845
}
4946
};
5047

CalibCalorimetry/HcalAlgos/src/HcalDbASCIIIO.cc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ namespace {
2828
if (first.isHcalDetId()) {
2929
HcalDetId f1(first);
3030
HcalDetId s1(second);
31-
return f1.zside() != s1.zside()
32-
? f1.zside() < s1.zside()
33-
: f1.iphi() != s1.iphi()
34-
? f1.iphi() < s1.iphi()
35-
: f1.ietaAbs() != s1.ietaAbs() ? f1.ietaAbs() < s1.ietaAbs() : f1.depth() < s1.depth();
31+
return f1.zside() != s1.zside() ? f1.zside() < s1.zside()
32+
: f1.iphi() != s1.iphi() ? f1.iphi() < s1.iphi()
33+
: f1.ietaAbs() != s1.ietaAbs() ? f1.ietaAbs() < s1.ietaAbs()
34+
: f1.depth() < s1.depth();
3635
} else {
3736
return first.rawId() < second.rawId();
3837
}
@@ -43,12 +42,10 @@ namespace {
4342
bool operator()(HcalElectronicsId first, HcalElectronicsId second) const {
4443
return first.readoutVMECrateId() != second.readoutVMECrateId()
4544
? first.readoutVMECrateId() < second.readoutVMECrateId()
46-
: first.htrSlot() != second.htrSlot()
47-
? first.htrSlot() < second.htrSlot()
48-
: first.htrTopBottom() != second.htrTopBottom()
49-
? first.htrTopBottom() < second.htrTopBottom()
50-
: first.fiberIndex() != second.fiberIndex() ? first.fiberIndex() < second.fiberIndex()
51-
: first.fiberChanId() < second.fiberChanId();
45+
: first.htrSlot() != second.htrSlot() ? first.htrSlot() < second.htrSlot()
46+
: first.htrTopBottom() != second.htrTopBottom() ? first.htrTopBottom() < second.htrTopBottom()
47+
: first.fiberIndex() != second.fiberIndex() ? first.fiberIndex() < second.fiberIndex()
48+
: first.fiberChanId() < second.fiberChanId();
5249
}
5350
};
5451
} // namespace

CalibCalorimetry/HcalAlgos/src/HcalLedAnalysis.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,13 +1003,11 @@ void HcalLedAnalysis::ProcessCalibEvent(int fiberChan, HcalCalibDetId calibId, c
10031003
char name[1024];
10041004
std::string prefix;
10051005
if (calibId.calibFlavor() == HcalCalibDetId::CalibrationBox) {
1006-
std::string sector = (calibId.hcalSubdet() == HcalBarrel)
1007-
? ("HB")
1008-
: (calibId.hcalSubdet() == HcalEndcap)
1009-
? ("HE")
1010-
: (calibId.hcalSubdet() == HcalOuter)
1011-
? ("HO")
1012-
: (calibId.hcalSubdet() == HcalForward) ? ("HF") : "";
1006+
std::string sector = (calibId.hcalSubdet() == HcalBarrel) ? ("HB")
1007+
: (calibId.hcalSubdet() == HcalEndcap) ? ("HE")
1008+
: (calibId.hcalSubdet() == HcalOuter) ? ("HO")
1009+
: (calibId.hcalSubdet() == HcalForward) ? ("HF")
1010+
: "";
10131011
snprintf(name,
10141012
sizeof name,
10151013
"%s %+d iphi=%d %s",

CalibFormats/CastorObjects/src/CastorText2DetIdConverter.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ bool CastorText2DetIdConverter::init(const std::string& fFlavor,
8585
field2 = strip(fField2);
8686
field3 = strip(fField3);
8787
if (flavorName.find("CASTOR_") == 0) {
88-
HcalCastorDetId::Section section =
89-
flavorName == "CASTOR_EM" ? HcalCastorDetId::EM
90-
: flavorName == "CASTOR_HAD" ? HcalCastorDetId::HAD : HcalCastorDetId::Unknown;
88+
HcalCastorDetId::Section section = flavorName == "CASTOR_EM" ? HcalCastorDetId::EM
89+
: flavorName == "CASTOR_HAD" ? HcalCastorDetId::HAD
90+
: HcalCastorDetId::Unknown;
9191
mId = HcalCastorDetId(section, getField(1) > 0, getField(2), getField(3));
9292
}
9393

CalibFormats/HcalObjects/src/HcalText2DetIdConverter.cc

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,14 @@ namespace {
2626
}
2727

2828
int calibChannel(const std::string& fName) {
29-
return fName == "Mixer-High"
30-
? 1
31-
: fName == "Mixer-Low"
32-
? 2
33-
: fName == "Megatile"
34-
? 3
35-
: fName == "Mixer-Scintillator"
36-
? 4
37-
: fName == "RadDam1"
38-
? 5
39-
: fName == "RadDam2" ? 6 : fName == "RadDam3" ? 7 : atoi(fName.c_str());
29+
return fName == "Mixer-High" ? 1
30+
: fName == "Mixer-Low" ? 2
31+
: fName == "Megatile" ? 3
32+
: fName == "Mixer-Scintillator" ? 4
33+
: fName == "RadDam1" ? 5
34+
: fName == "RadDam2" ? 6
35+
: fName == "RadDam3" ? 7
36+
: atoi(fName.c_str());
4037
// 0;
4138
}
4239
} // namespace
@@ -73,13 +70,11 @@ bool HcalText2DetIdConverter::init(DetId fId) {
7370
flavorName = "NA";
7471
} else if (genId.isHcalDetId()) {
7572
HcalDetId hcalId(mId);
76-
flavorName = genId.genericSubdet() == HcalGenericDetId::HcalGenBarrel
77-
? "HB"
78-
: genId.genericSubdet() == HcalGenericDetId::HcalGenEndcap
79-
? "HE"
80-
: genId.genericSubdet() == HcalGenericDetId::HcalGenOuter
81-
? "HO"
82-
: genId.genericSubdet() == HcalGenericDetId::HcalGenForward ? "HF" : "H_UNKNOWN";
73+
flavorName = genId.genericSubdet() == HcalGenericDetId::HcalGenBarrel ? "HB"
74+
: genId.genericSubdet() == HcalGenericDetId::HcalGenEndcap ? "HE"
75+
: genId.genericSubdet() == HcalGenericDetId::HcalGenOuter ? "HO"
76+
: genId.genericSubdet() == HcalGenericDetId::HcalGenForward ? "HF"
77+
: "H_UNKNOWN";
8378
setField(1, hcalId.ieta());
8479
setField(2, hcalId.iphi());
8580
setField(3, hcalId.depth());
@@ -199,9 +194,10 @@ bool HcalText2DetIdConverter::init(const std::string& fFlavor,
199194
field2 = strip(fField2);
200195
field3 = strip(fField3);
201196
if (flavorName == "HB" || flavorName == "HE" || flavorName == "HF" || flavorName == "HO") {
202-
HcalSubdetector sub = flavorName == "HB"
203-
? HcalBarrel
204-
: flavorName == "HE" ? HcalEndcap : flavorName == "HO" ? HcalOuter : HcalForward;
197+
HcalSubdetector sub = flavorName == "HB" ? HcalBarrel
198+
: flavorName == "HE" ? HcalEndcap
199+
: flavorName == "HO" ? HcalOuter
200+
: HcalForward;
205201
mId = HcalDetId(sub, getField(1), getField(2), getField(3));
206202
} else if (flavorName == "HT") {
207203
// We use the depth to signal the "version" being used (RCT or 1x1 HF). RCT

CalibTracker/SiStripLorentzAngle/src/LA_Results.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ LA_Filler_Fitter::Result LA_Filler_Fitter::result(Method m, const std::string na
4444
p.measured = std::make_pair<float, float>(p.reco.first + f->GetParameter(0), f->GetParameter(1));
4545
p.chi2 = f->GetParameter(2);
4646
p.ndof = (unsigned)(f->GetParameter(3));
47-
p.entries = (m & PROB1)
48-
? (unsigned)book[base + "_w1"]->GetEntries()
49-
: (m & (AVGV2 | RMSV2))
50-
? (unsigned)book[base + method(AVGV2, false)]->GetEntries()
51-
: (m & (AVGV3 | RMSV3)) ? (unsigned)book[base + method(AVGV3, false)]->GetEntries() : 0;
47+
p.entries = (m & PROB1) ? (unsigned)book[base + "_w1"]->GetEntries()
48+
: (m & (AVGV2 | RMSV2)) ? (unsigned)book[base + method(AVGV2, false)]->GetEntries()
49+
: (m & (AVGV3 | RMSV3)) ? (unsigned)book[base + method(AVGV3, false)]->GetEntries()
50+
: 0;
5251
break;
5352
}
5453
default:

Calibration/HcalCalibAlgos/plugins/RecAnalyzerMinbias.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,11 @@ RecAnalyzerMinbias::RecAnalyzerMinbias(const edm::ParameterSet& iConfig) : init_
195195
edm::LogVerbatim("RecAnalyzer") << "Thresholds for HB " << eLowHB_ << ":" << eHighHB_ << " for HE " << eLowHE_ << ":"
196196
<< eHighHE_ << " for HF " << eLowHF_ << ":" << eHighHF_;
197197
for (unsigned int k = 0; k < ieta.size(); ++k) {
198-
HcalSubdetector subd =
199-
((std::abs(ieta[k]) > 29) ? HcalForward
200-
: (std::abs(ieta[k]) > 16) ? HcalEndcap
201-
: ((std::abs(ieta[k]) == 16) && (depth[k] == 3))
202-
? HcalEndcap
203-
: (depth[k] == 4) ? HcalOuter : HcalBarrel);
198+
HcalSubdetector subd = ((std::abs(ieta[k]) > 29) ? HcalForward
199+
: (std::abs(ieta[k]) > 16) ? HcalEndcap
200+
: ((std::abs(ieta[k]) == 16) && (depth[k] == 3)) ? HcalEndcap
201+
: (depth[k] == 4) ? HcalOuter
202+
: HcalBarrel);
204203
unsigned int id = (HcalDetId(subd, ieta[k], iphi[k], depth[k])).rawId();
205204
hcalID_.push_back(id);
206205
edm::LogVerbatim("RecAnalyzer") << "DetId[" << k << "] " << HcalDetId(id);

0 commit comments

Comments
 (0)