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 (309)
Showing
with 637 additions and 95 deletions
......@@ -11,7 +11,7 @@
cmake_minimum_required(VERSION 3.15)
project(Rec VERSION 35.18
project(Rec VERSION 35.21
LANGUAGES CXX)
# Enable testing with CTest/CDash
......@@ -43,10 +43,6 @@ lhcb_add_subdirectories(
CaloFuture/CaloFutureTools
FT/FTMonitors
MicroDST/MicroDSTAlgorithm
MicroDST/MicroDSTBase
MicroDST/MicroDSTConf
MicroDST/MicroDSTInterfaces
MicroDST/MicroDSTTools
Muon/MuonInterfaces
Muon/MuonTrackRec
Muon/MuonID
......@@ -75,24 +71,23 @@ lhcb_add_subdirectories(
Phys/DaVinciNeutralTools
Phys/DaVinciOverlapsAndClones
Phys/DaVinciPVTools
Phys/DaVinciMCTools
Phys/DaVinciTools
Phys/DaVinciTransporter
Phys/DaVinciTypes
Phys/DecayTreeFitter
Phys/ExtraInfoTools
Phys/FlavourTagging
Phys/FunctionalFlavourTagging
Phys/GenericVertexFinder
Phys/JetAccessories
Phys/KalmanFilter
Phys/keras
Phys/LoKi
Phys/LoKiAlgo
Phys/LoKiArrayFunctors
Phys/LoKiFitters
Phys/LoKiPhys
Phys/LoKiPhysMC
Phys/LoKiUtils
Phys/Luminosity
Phys/lwtnnParser
Phys/MCAssociation
Phys/ParticleCombiners
......@@ -104,6 +99,7 @@ lhcb_add_subdirectories(
Phys/TisTosTobbing
Phys/VertexFit
Pr/PrAlgorithms
Pr/PrFilters
Pr/PrConverters
Pr/PrFitParams
Pr/PrMCTools
......@@ -139,6 +135,7 @@ lhcb_add_subdirectories(
Plume/PlumeReco
Rich/RichRecTests
Phys/FunctorCache
Utils/CatboostStandaloneEvaluator
Vis/PhoenixAlgs
)
......
......@@ -17,6 +17,7 @@ gaudi_add_module(CaloFutureMoniDst
SOURCES
src/CaloFutureClusterMonitor.cpp
src/CaloFutureDigitMonitor.cpp
src/CaloFutureLEDMonitor.cpp
src/CaloFutureMoniAlg.cpp
src/CaloFutureTimeAlignment.cpp
src/CaloTAEData.cpp
......
This diff is collapsed.
......@@ -195,7 +195,7 @@ void CaloFutureMoniAlg::hFill1( std::string hid, double value, double w ) const
if ( !doHisto( hid ) ) return;
const auto h = m_h1[hid];
if ( h == nullptr ) return;
double bins = (double)h->axis().bins();
auto bins = h->axis().bins();
double step = h->axis().upperEdge() - h->axis().lowerEdge();
step = ( bins == 0 ) ? 0 : step / bins / 2.;
if ( m_sat ) {
......@@ -209,10 +209,10 @@ void CaloFutureMoniAlg::hFill2( std::string hid, double x, double y, double w )
if ( !doHisto( hid ) ) return;
const auto h = m_h2[hid];
if ( h == nullptr ) return;
double xbins = (double)h->xAxis().bins();
auto xbins = h->xAxis().bins();
double xstep = h->xAxis().upperEdge() - h->xAxis().lowerEdge();
xstep = ( xbins == 0 ) ? 0 : xstep / xbins / 2.;
double ybins = (double)h->yAxis().bins();
auto ybins = h->yAxis().bins();
double ystep = h->yAxis().upperEdge() - h->yAxis().lowerEdge();
ystep = ( ybins == 0 ) ? 0 : ystep / ybins / 2.;
......@@ -229,7 +229,7 @@ void CaloFutureMoniAlg::hFill1( LHCb::Detector::Calo::CellID cellID, std::string
if ( !doHisto( hid ) ) return;
const auto h = m_h1[hid];
if ( !h ) return;
double bins = (double)h->axis().bins();
auto bins = h->axis().bins();
double step = h->axis().upperEdge() - h->axis().lowerEdge();
step = ( bins == 0 ) ? 0 : step / bins / 2.;
if ( m_sat ) {
......@@ -270,10 +270,10 @@ void CaloFutureMoniAlg::hFill2( LHCb::Detector::Calo::CellID cellID, std::string
if ( !doHisto( hid ) ) return;
const auto h = m_h2[hid];
if ( h == nullptr ) return;
double xbins = (double)h->xAxis().bins();
auto xbins = h->xAxis().bins();
double xstep = h->xAxis().upperEdge() - h->xAxis().lowerEdge();
xstep = ( xbins == 0 ) ? 0 : xstep / xbins / 2.;
double ybins = (double)h->yAxis().bins();
auto ybins = h->yAxis().bins();
double ystep = h->yAxis().upperEdge() - h->yAxis().lowerEdge();
ystep = ( ybins == 0 ) ? 0 : ystep / ybins / 2.;
if ( m_sat2D ) {
......
......@@ -11,6 +11,7 @@
#include "CaloDet/DeCalorimeter.h"
#include "CaloFutureMoniAlg.h"
#include "Core/FloatComparison.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "Event/CaloDigits_v2.h"
#include "Event/ODIN.h"
......@@ -114,7 +115,7 @@ StatusCode LHCb::CaloFuturePedestal::finalize() {
Int_t n = prof->GetNcells();
if ( msgLevel( MSG::DEBUG ) ) debug() << "Bins in profile of sub-channel " << nsubch << " : " << n << endmsg;
for ( Int_t i = 1; i < n; i++ ) {
if ( prof->GetBinError( i ) != 0. ) {
if ( !essentiallyZero( prof->GetBinError( i ) ) ) {
h->SetBinContent( i, prof->GetBinError( i ) * sqrt( prof->GetBinEntries( i ) ) );
// it would only be GetBinError(i) if option 's' could be set to the profile but AIDA 2D profile
// doesn't support it AFAIU
......
......@@ -15,26 +15,26 @@ CaloFuture/CaloFutureReco
gaudi_add_module(CaloFutureReco
SOURCES
src/CaloFutureClusterCovarianceAlg.cpp
src/CaloFutureCorrectionBase.cpp
src/CaloFutureECorrection.cpp
src/CaloFutureLCorrection.cpp
src/CaloFutureMergedPi0.cpp
src/CaloFutureSCorrection.cpp
src/CaloFutureShowerOverlap.cpp
src/CaloFutureShowerOverlapTool.cpp
src/CaloClusterCovarianceAlg.cpp
src/CaloCorrectionBase.cpp
src/CaloECorrection.cpp
src/CaloLCorrection.cpp
src/CaloMergedPi0.cpp
src/CaloSCorrection.cpp
src/CaloShowerOverlap.cpp
src/CaloShowerOverlapTool.cpp
src/CellMatrix2x2.cpp
src/CellMatrix3x3.cpp
src/CellSwissCross.cpp
src/ClassifyPhotonElectronAlg.cpp
src/Converters.cpp
src/FutureCellularAutomatonAlg.cpp
src/FutureClusterCovarianceMatrixTool.cpp
src/FutureClusterSpreadTool.cpp
src/FutureSubClusterSelector2x2.cpp
src/FutureSubClusterSelector3x3.cpp
src/FutureSubClusterSelectorSwissCross.cpp
src/FutureSubClusterSelectorTool.cpp
src/CellularAutomatonAlg.cpp
src/ClusterCovarianceMatrixTool.cpp
src/ClusterSpreadTool.cpp
src/SubClusterSelector2x2.cpp
src/SubClusterSelector3x3.cpp
src/SubClusterSelectorSwissCross.cpp
src/SubClusterSelectorTool.cpp
src/GraphClustering.cpp
LINK
Boost::container
......
......@@ -10,12 +10,12 @@
\*****************************************************************************/
#include "CaloDet/DeCalorimeter.h"
#include "CaloFutureUtils/CaloFutureAlgUtils.h"
#include "ClusterCovarianceMatrixTool.h"
#include "ClusterSpreadTool.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "FutureClusterCovarianceMatrixTool.h"
#include "FutureClusterSpreadTool.h"
#include "FutureSubClusterSelectorTool.h"
#include "Gaudi/Accumulators.h"
#include "LHCbAlgs/Transformer.h"
#include "SubClusterSelectorTool.h"
/** @class CaloFutureClusterCovarianceAlg CaloFutureClusterCovarianceAlg.h
*
......
......@@ -8,7 +8,9 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "CaloFutureCorrectionBase.h"
#include "CaloCorrectionBase.h"
#include "Core/FloatComparison.h"
#include "Event/ProtoParticle.h"
#include <yaml-cpp/yaml.h>
......@@ -52,20 +54,20 @@ namespace LHCb::Calo::Correction {
}
Result InversePolynomial::correction( float var ) const {
auto cor = Polynomial::correction( var );
if ( cor.value != 0 ) cor.value = 1. / cor.value;
if ( !essentiallyZero( cor.value ) ) cor.value = 1. / cor.value;
cor.derivative *= -cor.value * cor.value;
return cor;
}
Result ExpPolynomial::correction( float var ) const {
auto cor = Polynomial::correction( var );
if ( cor.value != 0 ) { cor.value = ( var == 0. ? cached : vapprox_exp( cor.value ) ); }
if ( !essentiallyZero( cor.value ) ) { cor.value = ( essentiallyZero( var ) ? cached : vapprox_exp( cor.value ) ); }
cor.derivative *= cor.value;
return cor;
}
Result ReciprocalPolynomial::correction( float var ) const {
if ( var == 0 ) return {pars[0], 0.}; // CHECKME
if ( essentiallyZero( var ) ) return {pars[0], 0.}; // CHECKME
auto cor = Polynomial::correction( 1.0 / var );
cor.derivative *= -1.0 / ( var * var );
return cor;
......
......@@ -14,6 +14,7 @@
#include "CaloFutureUtils/CaloFutureAlgUtils.h"
#include "CaloFutureUtils/CaloMomentum.h"
#include "CaloFutureUtils/ClusterFunctors.h"
#include "Core/FloatComparison.h"
#include "DetDesc/Condition.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "Detector/Calo/CaloCellID.h"
......@@ -114,7 +115,7 @@ namespace LHCb::Calo::Correction {
constexpr static float delta = 0.5;
float b;
float cache;
Sshape( float b, bool modified = false ) : b{b}, cache{( b != 0 ) ? mysinh( delta / b ) : INFINITY} {
Sshape( float b, bool modified = false ) : b{b}, cache{!essentiallyZero( b ) ? mysinh( delta / b ) : INFINITY} {
if ( !modified ) cache = LHCb::Math::Approx::approx_sqrt( 1.f + cache * cache );
}
Result correction( float var ) const;
......
......@@ -8,17 +8,20 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "CaloFutureCorrectionBase.h"
#include "CaloCorrectionBase.h"
#include "CaloFutureInterfaces/ICaloFutureElectron.h"
#include "Core/FloatComparison.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "Event/PrimaryVertices.h"
#include "Gaudi/Accumulators.h"
#include "GaudiKernel/IFileAccess.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "ICaloFutureHypoTool.h"
#include "ICaloHypoTool.h"
#include "Kernel/CaloCellIDParser.h"
#include <GaudiKernel/GaudiException.h>
#include <cmath>
#include <map>
#include <string>
......@@ -63,7 +66,7 @@ public:
float at( LHCb::Detector::Calo::CellID id ) const {
int cellID = id.index();
if ( m_constants[cellID] == std::numeric_limits<float>::quiet_NaN() ) {
if ( std::isnan( m_constants[cellID] ) ) {
throw std::runtime_error{"Requested pileup correction for cellID that was not specified in the file"};
}
return m_constants[cellID];
......@@ -182,7 +185,7 @@ namespace LHCb::Calo {
}
Gaudi::Property<std::string> m_pileupMapName{this, "PileupMapFileName", "paramfile://data/PileUpOffset.json",
[=]( auto& ) {
[this]( auto& ) {
if ( m_pileupMap ) read_pileup_map();
}};
};
......@@ -547,16 +550,19 @@ namespace LHCb::Calo {
ECorrection::ECorrOutputParams results;
if ( m_correctCovariance ) {
float d_alpha_dE =
( aE != 0 ) ? DaE * alpha / aE : DaE * aG * aB * aX * aY; // though in principle, aE should never be 0
float d_alpha_dE = ( !LHCb::essentiallyZero( aE ) )
? DaE * alpha / aE
: DaE * aG * aB * aX * aY; // though in principle, aE should never be 0
results.dEcor_dEcl = gT * ( alpha + d_alpha_dE * eEcal );
results.dEcor_dXcl = gT * eEcal * aG * aE * aY *
( ( bDist == 0 ? 0. : DaB * 2. * Asx0 / bDist * aX ) + signX * aB * DaX ) / CellSize;
results.dEcor_dXcl =
gT * eEcal * aG * aE * aY *
( ( LHCb::essentiallyZero( bDist ) ? 0. : DaB * 2. * Asx0 / bDist * aX ) + signX * aB * DaX ) / CellSize;
results.dEcor_dYcl = gT * eEcal * aG * aE * aX *
( ( bDist == 0 ? 0. : DaB * 2. * Asy0 / bDist * aY ) + signY * aB * DaY ) / CellSize;
results.dEcor_dYcl =
gT * eEcal * aG * aE * aX *
( ( LHCb::essentiallyZero( bDist ) ? 0. : DaB * 2. * Asy0 / bDist * aY ) + signY * aB * DaY ) / CellSize;
}
results.alpha = alpha;
......
......@@ -8,11 +8,11 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "CaloCorrectionBase.h"
#include "CaloDet/DeCalorimeter.h"
#include "CaloFutureCorrectionBase.h"
#include "Gaudi/Accumulators.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "ICaloFutureHypoTool.h"
#include "ICaloHypoTool.h"
#include <cmath>
#include <string>
......
......@@ -11,6 +11,8 @@
#include "CaloDet/DeCalorimeter.h"
#include "CaloFutureUtils/CaloFutureAlgUtils.h"
#include "CaloFutureUtils/CaloMomentum.h"
#include "ClusterCovarianceMatrixTool.h"
#include "ClusterSpreadTool.h"
#include "DetDesc/DetectorElement.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "Detector/Calo/CaloCellID.h"
......@@ -19,13 +21,11 @@
#include "Event/CaloHypos_v2.h"
#include "Event/CellID.h"
#include "Event/PrimaryVertices.h"
#include "FutureClusterCovarianceMatrixTool.h"
#include "FutureClusterSpreadTool.h"
#include "FutureSubClusterSelectorTool.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "ICaloFutureHypoTool.h"
#include "ICaloFutureShowerOverlapTool.h"
#include "ICaloHypoTool.h"
#include "ICaloShowerOverlapTool.h"
#include "LHCbAlgs/Transformer.h"
#include "SubClusterSelectorTool.h"
#include <algorithm>
#include <cmath>
#include <numeric>
......@@ -128,9 +128,9 @@ namespace LHCb::Calo::Algorithm {
ToolHandleArray<Interfaces::IProcessHypos> m_gTools{this, "PhotonTools", {}};
ToolHandle<Interfaces::IShowerOverlap> m_oTool{this, "SplitPhotonShowerOverlap",
ToolHandle<Interfaces::IShowerOverlap> m_oTool{this, "SplitPhotonShowerOverlap",
"CaloFutureShowerOverlapTool/SplitPhotonShowerOverlap"};
ToolHandle<SubClusterSelectorTool> m_tagger{this, "EcalClusterTag", "FutureSubClusterSelectorTool/EcalClusterTag"};
ToolHandle<SubClusterSelectorTool> m_tagger{this, "EcalClusterTag", "SubClusterSelectorTool/EcalClusterTag"};
ToolHandle<LHCb::Calo::ClusterSpreadTool> m_spread{this, "EcalSpread", "FutureClusterSpreadTool/EcalSpread"};
ToolHandle<LHCb::Calo::ClusterCovarianceMatrixTool> m_cov{this, "EcalCovariance",
"FutureClusterCovarianceMatrixTool/EcalCovariance"};
......@@ -275,10 +275,10 @@ namespace LHCb::Calo::Algorithm {
cntFailsToTagECluster2 += m_tagger->tagEnergy( tags, det, cl2.cellID(), cl2.entries() ).isFailure();
//-- apply cluster covariance and spread tools...
m_cntFailsToSetCovariance += ( *m_cov ).compute( params, det, cl1 ).isFailure();
m_cntFailsToSetSpread += ( *m_spread ).compute( det, cl1 ).isFailure();
m_cntFailsToSetCovariance += ( *m_cov ).compute( params, det, cl2 ).isFailure();
m_cntFailsToSetSpread += ( *m_spread ).compute( det, cl2 ).isFailure();
m_cntFailsToSetCovariance += m_cov->compute( params, det, cl1 ).isFailure();
m_cntFailsToSetSpread += m_spread->compute( det, cl1 ).isFailure();
m_cntFailsToSetCovariance += m_cov->compute( params, det, cl2 ).isFailure();
m_cntFailsToSetSpread += m_spread->compute( det, cl2 ).isFailure();
}
//-- make a snapshot of the clusters prior to E/S/L corrections so the converters can use them to
......
......@@ -8,10 +8,12 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "CaloFutureCorrectionBase.h"
#include "CaloCorrectionBase.h"
#include "Core/FloatComparison.h"
#include "Gaudi/Accumulators.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "ICaloFutureHypoTool.h"
#include "ICaloHypoTool.h"
#include <string>
/** @class CaloFutureSCorrection CaloFutureSCorrection.h
......@@ -244,7 +246,7 @@ namespace LHCb::Calo {
auto dcXCorDer = getCorrectionAndDerivative( baseParams, Correction::Type::residual, cellID, Asx )
.value_or( Correction::Result{0., 0.} );
auto dcX = dcXCorDer.value;
if ( dcX == 0. ) {
if ( essentiallyZero( dcX ) ) {
// check X-specific correction
dcXCorDer = getCorrectionAndDerivative( baseParams, Correction::Type::residualX, cellID, Asx )
.value_or( Correction::Result{0., 0.} );
......@@ -254,7 +256,7 @@ namespace LHCb::Calo {
auto dcYCorDer = getCorrectionAndDerivative( baseParams, Correction::Type::residual, cellID, Asy )
.value_or( Correction::Result{0., 0.} );
auto dcY = dcYCorDer.value;
if ( dcY == 0. ) {
if ( essentiallyZero( dcY ) ) {
// check Y-specific correction
dcYCorDer = getCorrectionAndDerivative( baseParams, Correction::Type::residualY, cellID, Asy )
.value_or( Correction::Result{0., 0.} );
......
......@@ -15,9 +15,9 @@
#include "Event/CaloClusters_v2.h"
#include "Event/CaloDataFunctor.h"
#include "Event/CellID.h"
#include "FutureSubClusterSelectorTool.h"
#include "ICaloFutureShowerOverlapTool.h"
#include "ICaloShowerOverlapTool.h"
#include "LHCbAlgs/Transformer.h"
#include "SubClusterSelectorTool.h"
#include <vector>
/** @class CaloFutureShowerOverlap CaloFutureShowerOverlap.h
......
......@@ -8,18 +8,18 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
// Include files
// from Gaudi
#include "CaloCorrectionBase.h"
#include "CaloDet/DeCalorimeter.h"
#include "CaloFutureCorrectionBase.h"
#include "CaloFutureUtils/CaloFutureAlgUtils.h"
#include "Core/FloatComparison.h"
#include "Event/CaloClusters_v2.h"
#include "Event/CaloDataFunctor.h"
#include "Event/CaloHypos_v2.h"
#include "Gaudi/Accumulators.h"
#include "GaudiAlg/GaudiTool.h"
#include "ICaloFutureHypoTool.h"
#include "ICaloFutureShowerOverlapTool.h" // Interface
#include "ICaloHypoTool.h"
#include "ICaloShowerOverlapTool.h" // Interface
#include "boost/container/flat_map.hpp"
#include <functional>
#include <utility>
......@@ -179,9 +179,9 @@ namespace LHCb::Calo::Tools {
auto f2 = i2.fraction();
auto sum = f1 + f2;
if ( std::abs( sum - initialWeight ) > eps ) {
if ( sum < initialWeight && f2 == 0 ) {
if ( sum < initialWeight && essentiallyZero( f2 ) ) {
i2.setFraction( initialWeight - f1 );
} else if ( sum < initialWeight && f1 == 0 ) {
} else if ( sum < initialWeight && essentiallyZero( f1 ) ) {
i1.setFraction( initialWeight - f2 );
} else {
i1.setFraction( initialWeight * f1 / ( f1 + f2 ) );
......
......@@ -31,7 +31,7 @@
#include "Event/PrimaryVertices.h"
#include "Event/RelationTable.h"
#include "Gaudi/Accumulators.h"
#include "ICaloFutureHypoTool.h"
#include "ICaloHypoTool.h"
#include "LHCbAlgs/Transformer.h"
#include "Relations/RelationWeighted2D.h"
#include <string>
......
......@@ -8,8 +8,7 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "FutureClusterCovarianceMatrixTool.h"
#include "ClusterCovarianceMatrixTool.h"
#include <yaml-cpp/yaml.h>
......
......@@ -8,9 +8,10 @@
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "CaloFutureCorrectionBase.h"
#pragma once
#include "CaloCorrectionBase.h"
#include "CaloFutureUtils/CaloFutureAlgUtils.h"
#include "Core/FloatComparison.h"
#include "DetDesc/GenericConditionAccessorHolder.h"
#include "Detector/Calo/CaloCellID.h"
#include "Event/CaloClusters_v2.h"
......@@ -18,20 +19,20 @@
#include "Gaudi/Accumulators.h"
#include "Gaudi/Parsers/CommonParsers.h"
#include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/IAlgTool.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/Point3DTypes.h"
#include "GaudiKernel/StatusCode.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "GaudiKernel/ToStream.h"
#include "ICaloFutureClusterTool.h"
#include "boost/container/small_vector.hpp"
#include "fmt/format.h"
#include <functional>
#include <iostream>
#include <vector>
/** @class FutureClusterCovarianceMatrixTool
* FutureClusterCovarianceMatrixTool.h
/** @class ClusterCovarianceMatrixTool
* ClusterCovarianceMatrixTool.h
*
* Concrete tool for calculation of covariance matrix
* for the whole cluster object
......@@ -262,19 +263,11 @@ namespace LHCb::Calo::CovarianceMatrixTool::detail {
} // namespace LHCb::Calo::CovarianceMatrixTool::detail
namespace LHCb::Calo {
class ClusterCovarianceMatrixTool
: public LHCb::DetDesc::ConditionAccessorHolder<extends<GaudiTool, Interfaces::IClusterTool>> {
class ClusterCovarianceMatrixTool : public LHCb::DetDesc::ConditionAccessorHolder<extends<GaudiTool, IAlgTool>> {
public:
using ConditionAccessorHolder::ConditionAccessorHolder;
StatusCode initialize() override;
StatusCode
operator()( const DeCalorimeter&,
LHCb::Event::Calo::Clusters::reference<SIMDWrapper::Scalar, LHCb::Pr::ProxyBehaviour::Contiguous> )
const override {
return StatusCode::FAILURE;
}
CovarianceMatrixTool::detail::ParameterMap const& getParameters() const { return m_parameters.get(); }
template <typename ClusterType>
......@@ -342,11 +335,11 @@ namespace LHCb::Calo {
// intrinsic resolution
auto s2 = std::abs( energy ) * a2GeV( params, id );
// gain fluctuation
if ( auto s2g = s2gain( params, id ); s2g != 0 ) s2 += energy * energy * s2g;
if ( auto s2g = s2gain( params, id ); !essentiallyZero( s2g ) ) s2 += energy * energy * s2g;
// noise (both coherent and incoherent)
double g = 0;
if ( auto noise = s2noise( params, id ); noise != 0 ) {
if ( auto noise = s2noise( params, id ); !essentiallyZero( noise ) ) {
g = calo.cellGain( id );
s2 += noise * g * g;
}
......@@ -381,7 +374,7 @@ namespace LHCb::Calo {
}
// second loop if there exist correlations
if ( 0 == s2coherent( params, id ) ) { continue; } ///< CONTINUE
if ( essentiallyZero( s2coherent( params, id ) ) ) { continue; } ///< CONTINUE
x[i] = x_i;
y[i] = y_i;
gain[i] = g;
......
......@@ -9,7 +9,7 @@
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include "FutureClusterSpreadTool.h"
#include "ClusterSpreadTool.h"
namespace LHCb::Calo {
/** @file FutureClusterSpreadTool.cpp
......