Skip to content

Commit 492a434

Browse files
author
Yuan CHAO
committed
remove try/catch clause in castor analyzer
1 parent 7d99d30 commit 492a434

File tree

2 files changed

+32
-35
lines changed

2 files changed

+32
-35
lines changed

CalibCalorimetry/CastorCalib/src/CastorLedAnalysis.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -527,19 +527,17 @@ void CastorLedAnalysis::processLedEvent(const CastorDigiCollection& castor, cons
527527
evt_curr = m_nevtsample;
528528

529529
// HF/Castor
530-
try {
531-
if (castor.empty())
532-
throw (int)castor.size();
533-
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
534-
const CastorDataFrame digi = (const CastorDataFrame)(*j);
535-
_meol = castorHists.LEDTRENDS.find(digi.id());
536-
if (_meol == castorHists.LEDTRENDS.end()) {
537-
SetupLEDHists(2, digi.id(), castorHists.LEDTRENDS);
538-
}
539-
LedCastorHists(digi.id(), digi, castorHists.LEDTRENDS, cond);
530+
if (castor.empty()) {
531+
edm::LogError("CastorLedAnalysis") << "Event with " << (int)castor.size() << "Castor Digis passed." << std::endl;
532+
return;
533+
}
534+
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
535+
const CastorDataFrame digi = (const CastorDataFrame)(*j);
536+
_meol = castorHists.LEDTRENDS.find(digi.id());
537+
if (_meol == castorHists.LEDTRENDS.end()) {
538+
SetupLEDHists(2, digi.id(), castorHists.LEDTRENDS);
540539
}
541-
} catch (int i) {
542-
// m_logFile << "Event with " << i<<" Castor Digis passed." << std::endl;
540+
LedCastorHists(digi.id(), digi, castorHists.LEDTRENDS, cond);
543541
}
544542

545543
// Call the function every m_nevtsample events

CalibCalorimetry/CastorCalib/src/CastorPedestalAnalysis.cc

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,32 +105,31 @@ void CastorPedestalAnalysis::processEvent(const CastorDigiCollection& castor, co
105105

106106
m_shape = cond.getCastorShape();
107107
// HF
108-
try {
109-
if (castor.empty())
110-
throw (int)castor.size();
111-
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
112-
const CastorDataFrame digi = (const CastorDataFrame)(*j);
113-
m_coder = cond.getCastorCoder(digi.id());
114-
for (int i = m_startTS; i < digi.size() && i <= m_endTS; i++) {
115-
for (int flag = 0; flag < 4; flag++) {
116-
if (i + flag < digi.size() && i + flag <= m_endTS) {
117-
per2CapsHists(flag, 2, digi.id(), digi.sample(i), digi.sample(i + flag), castorHists.PEDTRENDS, cond);
118-
}
108+
if (castor.empty()) {
109+
edm::LogError("CastorLedAnalysis") << "Event with " << (int)castor.size() << "Castor Digis passed." << std::endl;
110+
return;
111+
}
112+
113+
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
114+
const CastorDataFrame digi = (const CastorDataFrame)(*j);
115+
m_coder = cond.getCastorCoder(digi.id());
116+
for (int i = m_startTS; i < digi.size() && i <= m_endTS; i++) {
117+
for (int flag = 0; flag < 4; flag++) {
118+
if (i + flag < digi.size() && i + flag <= m_endTS) {
119+
per2CapsHists(flag, 2, digi.id(), digi.sample(i), digi.sample(i + flag), castorHists.PEDTRENDS, cond);
119120
}
120121
}
121-
if (m_startTS == 0 && m_endTS > 4) {
122-
AllChanHists(digi.id(),
123-
digi.sample(0),
124-
digi.sample(1),
125-
digi.sample(2),
126-
digi.sample(3),
127-
digi.sample(4),
128-
digi.sample(5),
129-
castorHists.PEDTRENDS);
130-
}
131122
}
132-
} catch (int i) {
133-
// m_logFile << "Event with " << i<<" Castor Digis passed." << std::endl;
123+
if (m_startTS == 0 && m_endTS > 4) {
124+
AllChanHists(digi.id(),
125+
digi.sample(0),
126+
digi.sample(1),
127+
digi.sample(2),
128+
digi.sample(3),
129+
digi.sample(4),
130+
digi.sample(5),
131+
castorHists.PEDTRENDS);
132+
}
134133
}
135134
// Call the function every m_nevtsample events
136135
if (m_nevtsample > 0) {

0 commit comments

Comments
 (0)