Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gpietrzy/Rec
  • nbehling/Rec
  • rrabadan/Rec
  • hyeung/Rec
  • smokhnen/Rec
  • padeken/Rec
  • peilian/Rec
  • lambda-hse/Rec
  • mstahl/Rec
  • kklimasz/Rec
  • mimazure/Rec
  • aszabels/Rec
  • wkrzemie/Rec
  • aalvesju/Rec
  • fkeizer/Rec
  • valassi/Rec
  • raaij/Rec
  • sstahl/Rec
  • jonrob/Rec
  • dcampora/Rec
  • graven/Rec
  • lhcb/Rec
22 results
Show changes
Commits on Source (22)
Showing
with 91 additions and 102 deletions
......@@ -64,7 +64,7 @@ bool Track2Calo::match( const LHCb::Track* track, IGeometryInfo const& geometry,
m_state = caloState( geometry, plane, delta, pid );
m_cell = m_calo->Cell( m_state.position() );
m_valid = m_calo->valid( m_cell );
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " Track2Calo setting [" << *track << "," << det << "] status : " << m_status << endmsg;
return m_status;
}
......
......@@ -94,12 +94,12 @@ StatusCode CaloFutureClusterMonitor::initialize() {
// StatusCode CaloFutureClusterMonitor::execute(){
void CaloFutureClusterMonitor::operator()( const Input& clusters ) const {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " Producing histo " << produceHistos() << endmsg;
// produce histos ?
if ( !produceHistos() ) return;
if ( clusters.empty() ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Found empty cluster in " << inputLocation() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Found empty cluster in " << inputLocation() << endmsg;
return;
}
......
......@@ -103,14 +103,14 @@ StatusCode CaloFutureDigitMonitor::initialize() {
void CaloFutureDigitMonitor::operator()( const Input& digits ) const {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << name() << " execute " << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << name() << " execute " << endmsg;
// produce histos ?
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( !produceHistos() ) return; // StatusCode::SUCCESS;
if ( digits.empty() ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Found empty container in " << inputLocation() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Found empty container in " << inputLocation() << endmsg;
return;
}
......@@ -135,14 +135,14 @@ void CaloFutureDigitMonitor::operator()( const Input& digits ) const {
if ( detData() != "Spd" && doHisto( "9" ) ) fillCaloFuture2D( "9", id, e, detData() + " digits energy 2D view" );
if ( m_spectrum ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Filling cell by cell histograms" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Filling cell by cell histograms" << endmsg;
const int col = id.col();
const int row = id.row();
std::ostringstream tit;
tit << detData() << " channel : " << id;
const auto unit = detData() + "Cells/" + id.areaName() + "/" + Gaudi::Utils::toString( row ) + ";" +
Gaudi::Utils::toString( col );
if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " et " << et << " cell " << unit << endmsg;
if ( msgLevel( MSG::VERBOSE ) ) verbose() << " et " << et << " cell " << unit << endmsg;
if ( detData() == "Prs" )
plot1D( e, unit, tit.str(), m_energyMin, m_energyMax, m_energyBin );
else
......
......@@ -61,44 +61,40 @@ void CaloFutureEFlowAlg::operator()( const Input& digits, const LHCb::ODIN& evt
// In simulated sample, it bypasses this check
if ( !m_simulation ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "Event: " << evt.eventNumber() << " Run: " << evt.runNumber() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Event: " << evt.eventNumber() << " Run: " << evt.runNumber() << endmsg;
const LHCb::ODIN::BXTypes bxtype = evt.bunchCrossingType();
const unsigned int tae = evt.timeAlignmentEventWindow();
const unsigned int trigger = evt.triggerType();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " TAE " << tae << " BXType " << bxtype << " trigger type " << trigger << endmsg;
if ( tae != 0 && m_ignoreTAE ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << " TAE WINDOW SET TO " << tae << " WILL SKIP THE EVENT " << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " TAE WINDOW SET TO " << tae << " WILL SKIP THE EVENT " << endmsg;
return;
}
if ( bxtype != 3 && m_ignoreNonBeamCrossing ) {
// 3 = BeamCrossing
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << " BEAM CROSSING TYPE IS " << bxtype << " WILL SKIP THE EVENT " << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " BEAM CROSSING TYPE IS " << bxtype << " WILL SKIP THE EVENT " << endmsg;
return;
}
if ( trigger != 1 && m_ignoreNonPhysicsTrigger ) {
// 1 = PhysicsTrigger
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << " TRIGGER TYPE IS " << trigger << " WILL SKIP THE EVENT " << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " TRIGGER TYPE IS " << trigger << " WILL SKIP THE EVENT " << endmsg;
return;
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " TAE " << tae << " BXType " << bxtype << " trigger type " << trigger << endmsg;
}
// produce histos ?
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( !produceHistos() ) return;
// get input data
if ( digits.empty() ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Empty digit found at " << inputLocation() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Empty digit found at " << inputLocation() << endmsg;
return;
}
......
......@@ -22,7 +22,7 @@
//==============================================================================
StatusCode CaloFutureEFlowBase::initialize() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
StatusCode sc = CaloFutureMoniAlg::initialize();
if ( sc.isFailure() ) return sc;
......@@ -34,7 +34,7 @@ StatusCode CaloFutureEFlowBase::initialize() {
hBook1( "4", detData() + " : # of Digits", m_calo->numberOfCells(), 0, m_calo->numberOfCells() );
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " initialized" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " initialized" << endmsg;
return StatusCode::SUCCESS;
}
......@@ -55,10 +55,10 @@ void CaloFutureEFlowBase::process_digits( const Input& digits ) const {
const double e = digit.energy();
const double et = e * m_calo->cellSine( id );
if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) )
if ( msgLevel( MSG::VERBOSE ) )
verbose() << " before thresholds : cellID " << id.index() << " e " << e << " et " << et << endmsg;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "thresholds are EMin " << m_eFilterMin << " EMax " << m_eFilterMax << " EtMin " << m_etFilterMin
<< " EtMax " << m_etFilterMax << endmsg;
......@@ -74,8 +74,7 @@ void CaloFutureEFlowBase::process_digits( const Input& digits ) const {
if ( et < m_etFilterMin && m_etFilterMin != -999 ) continue;
if ( et > m_etFilterMax && m_etFilterMax != -999 ) continue;
if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) )
verbose() << " cellID " << id.index() << " e " << e << " et " << et << endmsg;
if ( msgLevel( MSG::VERBOSE ) ) verbose() << " cellID " << id.index() << " e " << e << " et " << et << endmsg;
count( id );
if ( doHisto( "1" ) ) fillCaloFuture2D( "1", id, 1., detData() + " digits position 2D view" );
......
......@@ -86,12 +86,12 @@ StatusCode CaloFutureEFlowMC::initialize() {
void CaloFutureEFlowMC::operator()( const Input& digits, const MCHits& hits ) const {
// produce histos ?
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " Producing histo " << produceHistos() << endmsg;
if ( !produceHistos() ) return;
// get input data
if ( digits.empty() ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Empty digit found at " << inputLocation() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Empty digit found at " << inputLocation() << endmsg;
return;
}
......@@ -101,21 +101,21 @@ void CaloFutureEFlowMC::operator()( const Input& digits, const MCHits& hits ) co
// Extra work for on MCTruth if requested
if ( !m_mctruth ) return;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "LOOKING FOR MCTRUTH" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "LOOKING FOR MCTRUTH" << endmsg;
// Loop over MC hits
for ( const auto& hit : hits ) {
if ( hit == nullptr ) continue;
const auto id = hit->cellID();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "hit " << hit << " id " << id << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "hit " << hit << " id " << id << endmsg;
if ( !( m_calo->valid( id ) && !m_calo->isPinId( id ) ) ) continue;
const double e = hit->activeE();
const int pid = hit->particle()->particleID().pid();
if ( UNLIKELY( msgLevel( MSG::VERBOSE ) ) ) verbose() << " cellID " << id.index() << " e " << e << endmsg;
if ( msgLevel( MSG::VERBOSE ) ) verbose() << " cellID " << id.index() << " e " << e << endmsg;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
debug() << " part " << hit->particle() << endmsg;
debug() << " partID " << pid << " origin vtx " << hit->particle()->originVertex()->position() << endmsg;
}
......
......@@ -106,7 +106,7 @@ void CaloFutureHypoMonitor::operator()( const Input& hypos, const LHCb::Event::C
// check data
if ( hypos.empty() ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Empty hypos found in" << inputLocation() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Empty hypos found in" << inputLocation() << endmsg;
return;
}
......
......@@ -39,7 +39,7 @@ CaloFutureMoniAlg::CaloFutureMoniAlg( const std::string& name, ISvcLocator* pSvc
StatusCode CaloFutureMoniAlg::initialize() {
StatusCode sc = CaloFuture2Dview::initialize();
if ( sc.isFailure() ) return sc;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
m_counterStat.retrieve().ignore();
if ( "" == histoTopDir() ) setHistoTopDir( "CaloFutureMoniDst/" );
......@@ -119,7 +119,7 @@ void CaloFutureMoniAlg::hBook1( const std::string hid, const std::string titl, c
if ( !doHisto( hid ) ) return;
if ( m_splitSides ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Booking histogram1D per calo side" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Booking histogram1D per calo side" << endmsg;
for ( unsigned int i = 0; i < 2; ++i ) {
std::string side = ( i == 0 ) ? "C-side" : "A-side";
GaudiAlg::HistoID id( side + "/" + hid );
......@@ -127,7 +127,7 @@ void CaloFutureMoniAlg::hBook1( const std::string hid, const std::string titl, c
m_h1[id] = book1D( id, tit, low, high, bins );
}
} else if ( m_split ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Booking histogram1D per calo area" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Booking histogram1D per calo area" << endmsg;
for ( unsigned int i = 0; i != m_nAreas; ++i ) {
// std::string area = CaloFutureCellCode::CaloFutureAreaFromNum( CaloFutureCellCode::CaloFutureNumFromName(
// m_detData ), i );
......@@ -138,7 +138,7 @@ void CaloFutureMoniAlg::hBook1( const std::string hid, const std::string titl, c
m_h1[id] = book1D( id, tit, low, high, bins );
}
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Booking histogram1D for whole calo" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Booking histogram1D for whole calo" << endmsg;
m_h1[hid] = book1D( hid, titl, low, high, bins );
}
......@@ -176,7 +176,7 @@ void CaloFutureMoniAlg::hBook2( const std::string hid, const std::string titl, c
const unsigned long binsy ) {
if ( !doHisto( hid ) ) return;
if ( m_splitSides ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Booking histogram2D per calo side" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Booking histogram2D per calo side" << endmsg;
for ( unsigned int i = 0; i < 2; ++i ) {
std::string side = ( i == 0 ) ? "C-side" : "A-side";
GaudiAlg::HistoID id( side + "/" + hid );
......@@ -184,7 +184,7 @@ void CaloFutureMoniAlg::hBook2( const std::string hid, const std::string titl, c
m_h2[id] = book2D( id, tit, lowx, highx, binsx, lowy, highy, binsy );
}
} else if ( m_split ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Booking histogram2D per calo region" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Booking histogram2D per calo region" << endmsg;
for ( unsigned int i = 0; i != m_nAreas; ++i ) {
std::string area = CaloCellCode::caloArea( CaloCellCode::caloNum( m_detData.value() ), i );
if ( !validArea( area ) ) continue;
......@@ -193,7 +193,7 @@ void CaloFutureMoniAlg::hBook2( const std::string hid, const std::string titl, c
m_h2[id] = book2D( id, tit, lowx, highx, binsx, lowy, highy, binsy );
}
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Booking histogram2D for whole calo" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Booking histogram2D for whole calo" << endmsg;
m_h2[hid] = book2D( hid, titl, lowx, highx, binsx, lowy, highy, binsy );
}
......@@ -262,9 +262,9 @@ void CaloFutureMoniAlg::hFill1( LHCb::CaloCellID cellID, std::string hid, double
fill( hh, value, w );
} else if ( m_split && !( cellID == LHCb::CaloCellID() ) ) {
std::string area = CaloCellCode::caloArea( CaloCellCode::caloNum( m_detData.value() ), cellID.area() );
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Filling histogram2D per calo region " << cellID << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Filling histogram2D per calo region " << cellID << endmsg;
if ( validArea( area ) ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "valid area " << area << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "valid area " << area << endmsg;
GaudiAlg::HistoID id( area + "/" + hid );
const auto hh = m_h1[id];
if ( !hh ) return;
......
......@@ -225,7 +225,7 @@ StatusCode CaloFuturePIDsChecker::divide( AIDA::IHistogram1D* hh1, AIDA::IHistog
const IAxis& axis2 = hh2->axis();
const IAxis& axis3 = hh3->axis();
const int nBins = axis3.bins();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "DIVIDE nbins " << nBins << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "DIVIDE nbins " << nBins << endmsg;
if ( ( axis1.bins() != nBins ) || ( axis2.bins() != nBins ) ) {
return Error( "Different histogram specifications" );
......
......@@ -230,8 +230,7 @@ StatusCode CaloFuturePhotonChecker::initialize() {
const auto spdFront = m_spd->plane( CaloPlane::Front );
const auto normal = spdFront.Normal();
m_zConv = -spdFront.HesseDistance() / normal.Z();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "z conversion definition is set to SPD front : " << m_zConv << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "z conversion definition is set to SPD front : " << m_zConv << endmsg;
//----- Tool recovery
......@@ -324,7 +323,7 @@ StatusCode CaloFuturePhotonChecker::initialize() {
StatusCode CaloFuturePhotonChecker::finalize() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Finalize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg;
info() << "************* Photon Monitoring *****************" << endmsg;
info() << "Number of Events Analyzed : " << m_nEvents << endmsg;
......@@ -391,8 +390,7 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
// increment number of events
m_nEvents++;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "MC Particles extracted from event : " << mcParts.size() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "MC Particles extracted from event : " << mcParts.size() << endmsg;
// Loop over each mc particle
for ( const auto& part : mcParts ) {
......@@ -411,7 +409,7 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
Line line( vertex->position(), part->momentum().Vect() );
const auto cross = intersection( line, m_ecalPlane );
const Gaudi::XYZPoint hit( cross );
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "MC part momentum " << part->momentum() << " crosses Ecal Plane at point " << cross
<< " -> cellID : " << m_ecal->Cell( hit ) << endmsg;
if ( !m_ecal->valid( m_ecal->Cell( hit ) ) ) continue; // Ecal acceptance.
......@@ -423,11 +421,11 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
if ( vertex->position().z() < decay.Z() ) decay = vertex->position();
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "MC gamma endVertex.z() " << decay.Z() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "MC gamma endVertex.z() " << decay.Z() << endmsg;
// belong to a merged pi0 ?
if ( isMergedPi0( part ) ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Merged Pi0 photons removed from Signal sample" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Merged Pi0 photons removed from Signal sample" << endmsg;
continue;
}
m_nMCPhotons++;
......@@ -440,15 +438,15 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
m_lh_mcg++;
if ( decay.Z() > m_zConv ) {
m_lh_mcg_noconv++;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " Not converted " << m_zConv << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " Not converted " << m_zConv << endmsg;
} else {
m_lh_mcg_conv++;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " converted " << m_zConv << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " converted " << m_zConv << endmsg;
}
}
} // end loop over mcp
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " MC part all/no-conv/conv" << m_lh_mcg << "/" << m_lh_mcg_noconv << "/" << m_lh_mcg_conv << endmsg;
// loop over hypos
......@@ -456,7 +454,7 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
// skip nulls
if ( hypo == nullptr ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "empty CaloHypo : skipping" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "empty CaloHypo : skipping" << endmsg;
continue;
}
......@@ -464,8 +462,7 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
m_nCandidates++;
// Transverse Momentum
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "==> Processing new CaloHypo : Et=" << momentum.momentum().pt() << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Processing new CaloHypo : Et=" << momentum.momentum().pt() << endmsg;
if ( momentum.momentum().pt() < m_etmin ) continue;
if ( hypo->clusters().size() != 1 ) {
warning() << "Photon Hypothesis : number of clusters!=1 ..." << endmsg;
......@@ -502,16 +499,16 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
// Energy
const double energy = momentum.momentum().e();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "- Energy [MeV]=" << energy << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "- Energy [MeV]=" << energy << endmsg;
// Chi2
const auto range = table.relations( cluster );
const double chi2 = range.empty() ? 1.e+6 : range.front().weight();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " - Chi2 =" << chi2 << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " - Chi2 =" << chi2 << endmsg;
// Cell seed
const double eSeed = energy > 0. ? ( seed->e() ) / energy : -1.;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " - Seed Energy =" << eSeed << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " - Seed Energy =" << eSeed << endmsg;
// Spd hit and Prs deposit
Line line( Gaudi::XYZPoint( 0., 0., 0. ), momentum.momentum().Vect() );
......@@ -528,14 +525,14 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
for ( const auto& digit : hypo->digits() ) {
if ( digit->cellID() == cellSpd ) { eSpd = digit->e(); }
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " - SPD " << cellSpd << " Energy =" << eSpd << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " - SPD " << cellSpd << " Energy =" << eSpd << endmsg;
}
if ( cellPrs ) {
for ( const auto& digit : hypo->digits() ) {
if ( digit->cellID() == cellPrs ) { ePrs = digit->e(); }
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << " - PRS " << cellPrs << " Energy =" << ePrs << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << " - PRS " << cellPrs << " Energy =" << ePrs << endmsg;
}
// // ***
......@@ -561,13 +558,13 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
for ( const auto& mc : gtable.relations( cluster ) ) {
const auto mcpart = mc.to();
if ( mcpart == 0 ) continue;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "mctruth : --> pid=" << mcpart->particleID().pid() << " weight=" << mc.weight() << endmsg;
if ( !( m_gammaID == mcpart->particleID() ) ) continue;
if ( mc.weight() < wmax ) continue;
wmax = mc.weight();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "A MC-gamma matches the hypo " << endmsg;
debug() << " Energy : " << mcpart->momentum().e() << endmsg;
}
......@@ -583,7 +580,7 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
dr = vertex->position().Rho();
dz = vertex->position().z();
de = fabs( energy - mcpart->momentum().e() ) / energy;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "Gamma parameters : dr=" << dr << " - dz=" << dz << " - de=" << de << endmsg;
for ( const auto& v : mcpart->endVertices() ) {
......@@ -599,9 +596,9 @@ void CaloFuturePhotonChecker::operator()( const Input& hypos, const MCPs& mcPart
!isMerged ) {
m_nPhotons++;
isSignal = true;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Candidate is Signal according to MC" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Candidate is Signal according to MC" << endmsg;
} else {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "Candidate is Background according to MC (photon, merged)" << isPhoton << " " << isMerged << endmsg;
}
......@@ -720,7 +717,7 @@ bool CaloFuturePhotonChecker::isMergedPi0( const LHCb::MCParticle* mcpart ) cons
2.;
if ( distance < param ) {
isMerged = true;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "Pi0->Merged Photon : distance=" << distance << " < Criteria=" << param << " mm" << endmsg;
}
}
......
......@@ -84,7 +84,7 @@ StatusCode CaloFutureProtoElectronMonitor::initialize() {
StatusCode sc = Consumer::initialize(); // must be executed first
if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
if ( !m_tracks.empty() )
info() << "Will only look at track type(s) = " << m_tracks.value() << endmsg;
......@@ -124,7 +124,7 @@ bool CaloFutureProtoElectronMonitor::valid_track( const LHCb::ProtoParticle* pro
void CaloFutureProtoElectronMonitor::operator()( const Input& protos ) const {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute" << endmsg;
if ( !produceHistos() ) return;
// Get the defaulf geometry FIXME, use functional algo
......
......@@ -84,7 +84,7 @@ StatusCode SpdMonitorFuture::initialize() {
//==============================================================================
StatusCode SpdMonitorFuture::finalize() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Finalize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg;
info() << "Number of Events Analyzed : " << m_nEvents << endmsg;
return Consumer::finalize();
}
......@@ -93,7 +93,7 @@ StatusCode SpdMonitorFuture::finalize() {
void SpdMonitorFuture::operator()( const Input& digitsSpd ) const {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Execute " << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Execute " << endmsg;
// Fill histos
for ( const auto& digit : digitsSpd ) {
......
......@@ -55,8 +55,7 @@ namespace LHCb::Calo {
// helper function, copied / adapted from DeRichBase.h
template <typename OUTTYPE, std::size_t N, typename INTYPE = OUTTYPE>
decltype( auto ) toarray( const std::vector<INTYPE>& v ) {
if ( UNLIKELY( v.size() != N ) )
throw GaudiException( "Vector to Array Size Error", __func__, StatusCode::FAILURE );
if ( v.size() != N ) throw GaudiException( "Vector to Array Size Error", __func__, StatusCode::FAILURE );
std::array<OUTTYPE, N> a;
std::copy( v.begin(), v.end(), a.begin() );
return a;
......
......@@ -161,9 +161,9 @@ StatusCode CaloFutureCorrectionBase::initialize() {
StatusCode sc = GaudiTool::initialize();
if ( sc.isFailure() ) return sc;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Initialize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Initialize" << endmsg;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Condition name : " << m_conditionName << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Condition name : " << m_conditionName << endmsg;
// locate and set and configure the Detector
m_det = getDet<DeCalorimeter>( m_detData );
if ( !m_det ) { return StatusCode::FAILURE; }
......@@ -172,7 +172,7 @@ StatusCode CaloFutureCorrectionBase::initialize() {
if ( m_hypos.empty() ) return Error( "Empty vector of allowed Calorimeter Hypotheses!" );
// debug printout of all allowed hypos
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
debug() << " List of allowed hypotheses : " << endmsg;
for ( const auto& h : m_hypos ) { debug() << " -->" << h << endmsg; }
for ( const auto& c : m_corrections ) { debug() << "Accepted corrections : '" << c << "'" << endmsg; }
......@@ -182,7 +182,7 @@ StatusCode CaloFutureCorrectionBase::initialize() {
}
StatusCode CaloFutureCorrectionBase::finalize() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "==> Finalize" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "==> Finalize" << endmsg;
if ( m_corrections.size() > 1 || *( m_corrections.begin() ) != "All" ) {
for ( const auto& c : m_corrections ) { info() << "Accepted corrections : '" << c << "'" << endmsg; }
......@@ -191,10 +191,10 @@ StatusCode CaloFutureCorrectionBase::finalize() {
if ( !m_cond )
warning() << " Applied corrections configured via options for " << name() << endmsg;
else if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
else if ( msgLevel( MSG::DEBUG ) )
debug() << " Applied corrections configured via condDB ('" << m_conditionName << "') for " << name() << endmsg;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
for ( auto itype = 0; itype < static_cast<int>( CaloFutureCorrection::nT ); ++itype ) {
for ( auto area = 0; area < 3; ++area ) {
debug() << " o '" << static_cast<CaloFutureCorrection::Type>( itype ) << "' correction as a '"
......@@ -210,14 +210,13 @@ StatusCode CaloFutureCorrectionBase::finalize() {
//=============================================================================
StatusCode CaloFutureCorrectionBase::setDBParams() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "Get params from CondDB condition = " << m_conditionName << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Get params from CondDB condition = " << m_conditionName << endmsg;
registerCondition( m_conditionName, m_cond, &CaloFutureCorrectionBase::updParams );
return runUpdate();
}
// ============================================================================
StatusCode CaloFutureCorrectionBase::setOptParams() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Get params from options " << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "Get params from options " << endmsg;
if ( m_optParams.empty() && m_conditionName != "none" ) {
info() << "No default options parameters defined" << endmsg;
return StatusCode::SUCCESS;
......@@ -230,7 +229,7 @@ StatusCode CaloFutureCorrectionBase::setOptParams() {
continue;
}
constructParams( m_params[*type], parVec );
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " o Will apply correction '" << *type << "' as a '" << correctionName( m_params[*type].front() )
<< "' function" << endmsg;
}
......@@ -238,7 +237,7 @@ StatusCode CaloFutureCorrectionBase::setOptParams() {
}
// ============================================================================
StatusCode CaloFutureCorrectionBase::updParams() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "updParams() called" << endmsg;
if ( msgLevel( MSG::DEBUG ) ) debug() << "updParams() called" << endmsg;
if ( !m_cond ) return Error( "Condition points to NULL", StatusCode::FAILURE );
for ( const auto& paramName : m_cond->paramNames() ) {
......@@ -250,7 +249,7 @@ StatusCode CaloFutureCorrectionBase::updParams() {
continue;
}
constructParams( m_params[*type], parVec );
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
debug() << " o Will apply correction '" << *type << "' as a '" << correctionName( m_params[*type].front() )
<< "' function" << endmsg;
}
......@@ -393,7 +392,7 @@ StatusCode CaloFutureCorrectionBase::setConditionParams( const std::string& cond
info() << "Condition '" << m_conditionName.value() << "' has not been found " << endmsg;
return StatusCode::SUCCESS;
} else {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " Condition '" << m_conditionName.value() << "' has not found -- try options parameters !" << endmsg;
return setOptParams();
}
......
......@@ -233,14 +233,14 @@ StatusCode CaloFutureECorrection::process( LHCb::Event::Calo::Hypotheses::Type
// protection against unphysical d(Ehypo)/d(Ecluster) == 0
if ( fabs( dEcor_dEcl ) < 1e-10 ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "unphysical d(Ehypo)/d(Ecluster) = " << dEcor_dEcl << " reset to 1 as if Ehypo = Ecluster" << endmsg;
++counterUnphysical;
dEcor_dEcl = 1.;
}
// debugging necessary in case if any new corrections are added or their sequence is changed!
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
if ( m_correctCovariance ) debugDerivativesCalculation( params, results );
}
......@@ -261,7 +261,7 @@ void CaloFutureECorrection::updateCovariance( float dEcor_dXcl, float dEcor_dYcl
auto counterUnphysicalVariance = m_counterUnphysicalVariance.buffer();
LHCb::CaloPosition::Covariance& covariance = cluster.covariance();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "before E-corr. cov.m. = \n" << covariance << endmsg; }
if ( msgLevel( MSG::DEBUG ) ) { debug() << "before E-corr. cov.m. = \n" << covariance << endmsg; }
// index numbering just follows ROOT::Math::SMatrix<double,3,3>::Array() for row/column indices (X:0, Y:1, E:2)
float c0[6], c1[6];
......@@ -301,7 +301,7 @@ void CaloFutureECorrection::updateCovariance( float dEcor_dXcl, float dEcor_dYcl
// additional protection against cov.m.(E,E) <= 0 due to numerical effects
if ( c1[5] < 1.e-10 ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "unphysical variance(Ehypo) = " << c1[5]
<< " reset cov.m.(Ehypo,*) = cov.m.(Ecluster,*) as if Ehypo = Ecluster" << endmsg;
++counterUnphysicalVariance;
......@@ -318,7 +318,7 @@ void CaloFutureECorrection::updateCovariance( float dEcor_dXcl, float dEcor_dYcl
covariance( LHCb::CaloPosition::Index::X, LHCb::CaloPosition::Index::E ) = c1[3]; // cov1(0,2);
covariance( LHCb::CaloPosition::Index::Y, LHCb::CaloPosition::Index::E ) = c1[4]; // cov1(1,2);
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) { debug() << "after E-corr. cov.m. = \n" << covariance << endmsg; }
if ( msgLevel( MSG::DEBUG ) ) { debug() << "after E-corr. cov.m. = \n" << covariance << endmsg; }
}
CaloFutureECorrection::ECorrOutputParams
......@@ -450,7 +450,7 @@ CaloFutureECorrection::calcECorrection( const ECorrInputParams& _params ) const
results.alpha = alpha;
// intermediate variables calculated by calcECorrection() needed for debug printout inside process()
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
results.Asx = Asx; // Asx1
results.Asy = Asy; // Asy1
results.aG = aG;
......
......@@ -105,7 +105,7 @@ namespace LHCb::Calo {
dYhy_dYcl = 1.;
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) && m_correctCovariance ) debugDerivativesCalculation( params, results );
if ( msgLevel( MSG::DEBUG ) && m_correctCovariance ) debugDerivativesCalculation( params, results );
return {xCor, yCor, dXhy_dXcl, dYhy_dYcl};
}
......@@ -268,7 +268,7 @@ namespace LHCb::Calo {
// calculation of the analytic derivatives:
// NB: printouts comparing analytic calculations with numeric derivatives which are commented-out below
// are useful for debugging in case of changes in the correction function code
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "---------- analytic derivatives of individual S-correction functions ---------------" << endmsg;
float tx = xs / z;
......
......@@ -226,7 +226,7 @@ namespace LHCb::Calo::Algorithm {
apply( LHCb::Event::Calo::Hypotheses::Type::Photon, m_correc_photon, photons.clusters(), *lhcb.geometry() );
bool corr_electrons_ok = apply( LHCb::Event::Calo::Hypotheses::Type::EmCharged, m_correc_electr,
electrons.clusters(), *lhcb.geometry(), &table );
if ( UNLIKELY( !corr_photons_ok ) || UNLIKELY( !corr_electrons_ok ) ) ++m_errApply;
if ( !corr_photons_ok || !corr_electrons_ok ) ++m_errApply;
m_photon_counters.increment( photons, photons_start_vector );
m_electron_counters.increment( electrons, electrons_start_vector );
......
......@@ -437,7 +437,7 @@ namespace LHCb::Calo {
// Test if cells are tagged in this pass
if ( itTagLastClustered == itTagFirst && releaseBool ) {
const long number = taggedCellsSeq.end() - itTagLastClustered;
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << " TAGGING NOT FULL - Remain " << number << " not clustered cells" << endmsg;
itTagLastClustered = taggedCellsSeq.end();
}
......@@ -488,7 +488,7 @@ namespace LHCb::Calo {
m_passes += nPass;
m_clusters += clusters.size();
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "Built " << clusters.size() << " cellular automaton clusters with " << nPass << " iterations"
<< endmsg;
debug() << " ----------------------- Cluster List : " << endmsg;
......
......@@ -226,8 +226,7 @@ namespace {
[[nodiscard]] bool empty() const { return m_present.none(); }
[[nodiscard]] bool contains( Parameter p ) const { return m_present.test( p ); }
[[nodiscard]] const std::vector<double>& at( Parameter p ) const {
if ( UNLIKELY( !contains( p ) ) )
throw std::out_of_range{fmt::format( "Parameter '{}' not present", Parameters::name( p ) )};
if ( !contains( p ) ) throw std::out_of_range{fmt::format( "Parameter '{}' not present", Parameters::name( p ) )};
return m_params[p];
}
[[nodiscard]] std::vector<double>& operator[]( Parameter p ) {
......@@ -447,7 +446,7 @@ namespace LHCb::Calo {
parameters[index].push_back( params[index] );
m_source_is_db.set( index );
} else {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
if ( msgLevel( MSG::DEBUG ) )
debug() << "Parameter '" << Parameters::name( index ) << "' not found in DB - use default options value"
<< endmsg;
if ( !m_parameters.value().contains( index ) )
......
......@@ -104,7 +104,7 @@ namespace LHCb::Calo {
*/
// ============================================================================
StatusCode ClusterSpreadTool::finalize() {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) {
if ( msgLevel( MSG::DEBUG ) ) {
debug() << " Corrected Clusters, Ratio : " << m_ratio << endmsg;
debug() << " Corrected Clusters, Et : " << m_energy << endmsg;
debug() << " Corrected Clusters, Cells : " << m_cells << endmsg;
......