Skip to content

Commit

Permalink
Merge pull request #22536 from gartung/EventFilter-SiStripRawToDigi-c…
Browse files Browse the repository at this point in the history
…leanup-clang-warn

EventFilter/SiStripRawToDigi: clean up clang warnings:
  • Loading branch information
cmsbuild committed Mar 19, 2018
2 parents 595607b + 4a3fa68 commit b6bf8eb
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
Expand Up @@ -73,7 +73,7 @@ bool LaserAlignmentEventFilter::filter(edm::StreamID sid, edm::Event& iEvent, co

// construct FEDBuffer
sistrip::FEDBuffer buffer(input.data(), input.size());
if (not buffer.doChecks()) {
if (not buffer.doChecks(true)) {
edm::LogWarning("LaserAlignmentEventFilter") << "FED Buffer check fails for FED ID " << *ifed << ".";
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions DQM/SiStripMonitorHardware/src/FEDErrors.cc
Expand Up @@ -322,7 +322,7 @@ float FEDErrors::fillNonFatalFEDErrors(const sistrip::FEDBuffer* aBuffer,

if (!lIsConnected) continue;
lTotChans++;
if (!aBuffer->channelGood(iCh)) lBadChans++;
if (!aBuffer->channelGood(iCh, true)) lBadChans++;
}

return static_cast<float>(lBadChans*1.0/lTotChans);
Expand Down Expand Up @@ -589,7 +589,7 @@ bool FEDErrors::fillChannelErrors(const sistrip::FEDBuffer* aBuffer,

for (unsigned int iCh = 0; iCh < sistrip::FEDCH_PER_FED; iCh++) {//loop on channels

bool lFailUnpackerChannelCheck = (!aBuffer->channelGood(iCh) && connected_[iCh]) || failUnpackerFEDCheck_;
bool lFailUnpackerChannelCheck = (!aBuffer->channelGood(iCh, true) && connected_[iCh]) || failUnpackerFEDCheck_;
bool lFailMonitoringChannelCheck = !lPassedMonitoringFEDcheck && connected_[iCh];


Expand Down
2 changes: 1 addition & 1 deletion DQM/SiStripMonitorHardware/src/SiStripCMMonitor.cc
Expand Up @@ -279,7 +279,7 @@ SiStripCMMonitorPlugin::analyze(const edm::Event& iEvent,

if (!lDetId || lDetId == sistrip::invalid32_) continue;

bool lFailUnpackerChannelCheck = !buffer->channelGood(iCh) && connected;
bool lFailUnpackerChannelCheck = !buffer->channelGood(iCh, true) && connected;

if (lFailUnpackerChannelCheck) {
continue;
Expand Down
Expand Up @@ -123,7 +123,7 @@ namespace sistrip {
LogDebug(messageLabel_) << "Failed to build FED buffer for FED ID " << *iFedId << ". Exception was " << e.what();
continue;
}
if (!buffer->doChecks()) {
if (!buffer->doChecks(true)) {
LogDebug(messageLabel_) << "Buffer check failed for FED ID " << *iFedId;
continue;
}
Expand All @@ -141,7 +141,7 @@ namespace sistrip {
if (!iConn->isConnected()) {
continue;
}
if ( !buffer->channelGood(iConn->fedCh()) ) {
if ( !buffer->channelGood(iConn->fedCh(), true) ) {
continue;
} else {
apvAddress = header->feUnitMajorityAddress(iConn->fedCh()/FEDCH_PER_FEUNIT);
Expand Down
2 changes: 2 additions & 0 deletions EventFilter/SiStripRawToDigi/interface/SiStripFEDBuffer.h
Expand Up @@ -36,11 +36,13 @@ namespace sistrip {
//The FE length from the full debug header is used in full debug mode.
bool fePresent(uint8_t internalFEUnitNum) const;
//check that a channel is present in data, found, on a good FE unit and has no errors flagged in status bits
using sistrip::FEDBufferBase::channelGood;
virtual bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck=true) const;
void setLegacyMode(bool legacy) { legacyUnpacker_ = legacy;}

//functions to check buffer. All return true if there is no problem.
//minimum checks to do before using buffer
using sistrip::FEDBufferBase::doChecks;
virtual bool doChecks(bool doCRC=true) const;

//additional checks to check for corrupt buffers
Expand Down
Expand Up @@ -181,7 +181,7 @@ namespace sistrip {
try {
buffer.reset(new sistrip::FEDBuffer(input.data(),input.size()));
buffer->setLegacyMode(legacy_);
if (!buffer->doChecks()) {
if (!buffer->doChecks(true)) {
if (!unpackBadChannels_ || !buffer->checkNoFEOverflows() )
throw cms::Exception("FEDBuffer") << "FED Buffer check fails for FED ID " << *ifed << ".";
}
Expand Down Expand Up @@ -1246,7 +1246,7 @@ namespace sistrip {
std::stringstream ss;
ss << "[sistrip::RawToDigiUnpacker::" << __func__ << "]"
<< " Caught std::exception!" << std::endl;
if ( extra_info != "" ) {
if ( !extra_info.empty() ) {
ss << " Information: " << extra_info << std::endl;
}
ss << " Caught std::exception in ["
Expand All @@ -1261,7 +1261,7 @@ namespace sistrip {
std::stringstream ss;
ss << "[sistrip::RawToDigiUnpacker::" << __func__ << "]"
<< " Caught unknown exception!" << std::endl;
if ( extra_info != "" ) {
if ( !extra_info.empty() ) {
ss << " Information: " << extra_info << std::endl;
}
ss << "Caught unknown exception in ["
Expand Down
2 changes: 1 addition & 1 deletion EventFilter/SiStripRawToDigi/src/SiStripFEDBuffer.cc
Expand Up @@ -244,7 +244,7 @@ namespace sistrip {
continue;
}
//only check enabled, working channels
if (channelGood(iCh)) {
if (FEDBuffer::channelGood(iCh, true)) {
//if a channel is bad then return false
if (channels_[iCh].packetCode() != correctPacketCode) return false;
}
Expand Down
Expand Up @@ -216,7 +216,7 @@ void SiStripFEDRawDataAnalyzer::analyze( const edm::Event& event, const edm::Eve

// check if channel is good

if (!buffer->channelGood(ichan)) {channel_construct[ifed].push_back(ichan);continue;}
if (!buffer->channelGood(ichan, true)) {channel_construct[ifed].push_back(ichan);continue;}

// find channel data

Expand Down
Expand Up @@ -20,6 +20,7 @@ class MuonTransientTrackingRecHitBuilder: public TransientTrackingRecHitBuilder

~MuonTransientTrackingRecHitBuilder() override {} ;

using TransientTrackingRecHitBuilder::build;
/// Call the MuonTransientTrackingRecHit::specificBuild
RecHitPointer build(const TrackingRecHit *p,
edm::ESHandle<GlobalTrackingGeometry> trackingGeometry) const ;
Expand Down

0 comments on commit b6bf8eb

Please sign in to comment.