Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove try/catch clause in castor analyzer #43283

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions CalibCalorimetry/CastorCalib/src/CastorLedAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -527,19 +527,17 @@ void CastorLedAnalysis::processLedEvent(const CastorDigiCollection& castor, cons
evt_curr = m_nevtsample;

// HF/Castor
try {
if (castor.empty())
throw (int)castor.size();
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
const CastorDataFrame digi = (const CastorDataFrame)(*j);
_meol = castorHists.LEDTRENDS.find(digi.id());
if (_meol == castorHists.LEDTRENDS.end()) {
SetupLEDHists(2, digi.id(), castorHists.LEDTRENDS);
}
LedCastorHists(digi.id(), digi, castorHists.LEDTRENDS, cond);
if (castor.empty()) {
edm::LogError("CastorLedAnalysis") << "Event with " << (int)castor.size() << "Castor Digis passed." << std::endl;
return;
}
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
const CastorDataFrame digi = (const CastorDataFrame)(*j);
_meol = castorHists.LEDTRENDS.find(digi.id());
if (_meol == castorHists.LEDTRENDS.end()) {
SetupLEDHists(2, digi.id(), castorHists.LEDTRENDS);
}
} catch (int i) {
// m_logFile << "Event with " << i<<" Castor Digis passed." << std::endl;
LedCastorHists(digi.id(), digi, castorHists.LEDTRENDS, cond);
}

// Call the function every m_nevtsample events
Expand Down
45 changes: 22 additions & 23 deletions CalibCalorimetry/CastorCalib/src/CastorPedestalAnalysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,31 @@ void CastorPedestalAnalysis::processEvent(const CastorDigiCollection& castor, co

m_shape = cond.getCastorShape();
// HF
try {
if (castor.empty())
throw (int)castor.size();
for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
const CastorDataFrame digi = (const CastorDataFrame)(*j);
m_coder = cond.getCastorCoder(digi.id());
for (int i = m_startTS; i < digi.size() && i <= m_endTS; i++) {
for (int flag = 0; flag < 4; flag++) {
if (i + flag < digi.size() && i + flag <= m_endTS) {
per2CapsHists(flag, 2, digi.id(), digi.sample(i), digi.sample(i + flag), castorHists.PEDTRENDS, cond);
}
if (castor.empty()) {
edm::LogError("CastorLedAnalysis") << "Event with " << (int)castor.size() << "Castor Digis passed." << std::endl;
return;
}

for (CastorDigiCollection::const_iterator j = castor.begin(); j != castor.end(); ++j) {
const CastorDataFrame digi = (const CastorDataFrame)(*j);
m_coder = cond.getCastorCoder(digi.id());
for (int i = m_startTS; i < digi.size() && i <= m_endTS; i++) {
for (int flag = 0; flag < 4; flag++) {
if (i + flag < digi.size() && i + flag <= m_endTS) {
per2CapsHists(flag, 2, digi.id(), digi.sample(i), digi.sample(i + flag), castorHists.PEDTRENDS, cond);
}
}
if (m_startTS == 0 && m_endTS > 4) {
AllChanHists(digi.id(),
digi.sample(0),
digi.sample(1),
digi.sample(2),
digi.sample(3),
digi.sample(4),
digi.sample(5),
castorHists.PEDTRENDS);
}
}
} catch (int i) {
// m_logFile << "Event with " << i<<" Castor Digis passed." << std::endl;
if (m_startTS == 0 && m_endTS > 4) {
AllChanHists(digi.id(),
digi.sample(0),
digi.sample(1),
digi.sample(2),
digi.sample(3),
digi.sample(4),
digi.sample(5),
castorHists.PEDTRENDS);
}
}
// Call the function every m_nevtsample events
if (m_nevtsample > 0) {
Expand Down