ATLAS Offline Software
PFSubtractionTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef PFSUBTRACTIONTOOL_H
6 #define PFSUBTRACTIONTOOL_H
7 
9 #include "GaudiKernel/ToolHandle.h"
10 
12 #include "eflowRec/EtaPhiLUT.h"
14 #include "eflowRec/PFData.h"
25 
26 
27 
33 
34 class PFSubtractionTool : public extends<AthAlgTool, IPFSubtractionTool>
35 {
36 
37 public:
38  PFSubtractionTool(const std::string &type, const std::string &name, const IInterface *parent);
40 
42  void execute(eflowCaloObjectContainer *theEflowCaloObjectContainer, eflowRecTrackContainer *recTrackContainer, eflowRecClusterContainer *recClusterContainer) const;
44 
45 private:
46 
48  unsigned int matchAndCreateEflowCaloObj(PFData &data) const;
49 
50  void performSubtraction(const unsigned int& startingPoint,PFData &data) const;
51  void performSubtraction(eflowCaloObject& thisEflowCaloObject) const;
52  void performTruthSubtraction(PFData &data) const;
53  void performTruthSubtraction(eflowCaloObject& thisEflowCaloObject) const;
54 
55  bool isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const;
56 
57  bool canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const;
58 
59  static std::string printTrack(const xAOD::TrackParticle* track);
60  static std::string printCluster(const xAOD::CaloCluster* cluster);
61  void printAllClusters(const eflowRecClusterContainer& recClusterContainer) const;
62 
63  void addSubtractedCells(eflowCaloObject& thisEflowCaloObject, const std::vector<std::pair<xAOD::CaloCluster *, bool> >& clusterList) const;
64 
66  ToolHandle<IEFlowCellEOverPTool> m_theEOverPTool{this, "eflowCellEOverPTool", "eflowCellEOverPTool", "Energy Flow E/P Values and Shower Parameters Tool"};
67 
68  std::unique_ptr<eflowEEtaBinnedParameters> m_binnedParameters;
69 
71  std::unique_ptr<PFMatch::TrackEtaPhiInFixedLayersProvider> m_trkpos;
72 
74  ToolHandle<PFTrackClusterMatchingTool> m_theMatchingTool{this, "PFTrackClusterMatchingTool", "PFTrackClusterMatchingTool/CalObjBldMatchingTool", "The track-cluster matching tool"};
75 
76  /* Track-cluster matching tools for calculating the pull */
77  ToolHandle<PFTrackClusterMatchingTool> m_theMatchingToolForPull_015{this, "PFTrackClusterMatchingTool_015", "PFTrackClusterMatchingTool/PFPullMatchingTool_015", "The 0.15 track-cluster matching tool to calculate the pull"};
78  ToolHandle<PFTrackClusterMatchingTool> m_theMatchingToolForPull_02{this, "PFTrackClusterMatchingTool_02", "PFTrackClusterMatchingTool/PFPullMatchingTool_02", "The 0.2 track-cluster matching tool to calculate the pull"};
79 
81  Gaudi::Property<bool> m_recoverSplitShowers{this,"RecoverSplitShowers",false,"Toggle whether we are recovering split showers or not"};
82 
84  Gaudi::Property<int> m_nClusterMatchesToUse{this, "nClusterMatchesToUse", 1, "Number of clusters to match to each track"};
85 
87  Gaudi::Property<bool> m_isHLLHC{this, "isHLLHC", false, "Toggle whether we have the HLLHC setup"};
88 
90  Gaudi::Property<bool> m_calcEOverP{this, "CalcEOverP", false, "Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"};
91 
93  Gaudi::Property<double> m_consistencySigmaCut{this, "ConsistencySigmaCut", 1.0, "Parameter that controls whether a track, in a track-cluster system, will be processed by the split shower recovery algorithm"};
94 
96  Gaudi::Property<double> m_subtractionSigmaCut{this, "SubtractionSigmaCut", 1.5, "Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system, after charged shower subtraction"};
97 
99  Gaudi::Property<bool> m_addCPData{this,"addCPData",false,"Toggle whether to decorate FlowElements with addutional data for Combined Performance studies "};
100 
101  //Helpers
106 
108  ToolHandle<PFEnergyPredictorTool> m_NNEnergyPredictorTool{this, "NNEnergyPredictorTool", "","Tool for getting predictiing the energy using an ONNX model "};
109 
111  Gaudi::Property<bool> m_useNNEnergy{this, "useNNEnergy", false, "Toggle whether we use the neural net energy"};
112 
113  //Only turn this on for MC samples without pileup that have calibration hits avaialble
115  Gaudi::Property<bool> m_useTruthMatching{this, "useTrackClusterTruthMatching", false, "Toggle whether to cheat and use truth information for track-cluster matching"};
116 
118  Gaudi::Property<bool> m_useTruthForChargedShowerSubtraction{this, "useTruthForChargedShowerSubtraction", false, "Toggle whether we use truth information for the charged shower subtraction or not"};
119 
121  Gaudi::Property<bool> m_useFullCellTruthSubtraction{this,"useFullCellTruthSubtraction",false,"Toggle whether we fully remove a cell with a truth deposit or reweight it based on truth contribution"};
122 
123  ToolHandle<PFSimulateTruthShowerTool> m_theTruthShowerSimulator{this, "PFSimulateTruthShowerTool", "", "The truth shower simulator"};
124 
127 
133  Gaudi::Property<bool> m_useLegacyEBinIndex{this, "useLegacyEBinIndex", true, "Toggle whether we use the legacy energy bin index"};
134 
135 };
136 
137 #endif
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
PFSubtractionTool::performTruthSubtraction
void performTruthSubtraction(PFData &data) const
Definition: PFSubtractionTool.cxx:488
eflowEEtaBinnedParameters
Inherits from eflowEEtaBinBase.
Definition: eflowEEtaBinnedParameters.h:56
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
IPFSubtractionTool.h
PFSubtractionTool::m_isHLLHC
Gaudi::Property< bool > m_isHLLHC
Toggle whether we have the HLLHC setup.
Definition: PFSubtractionTool.h:87
PFSubtractionTool::m_useTruthMatching
Gaudi::Property< bool > m_useTruthMatching
Toggle whether to cheat and use truth information for track-cluster matching - only for performance s...
Definition: PFSubtractionTool.h:115
PFSubtractionTool::m_subtractor
eflowSubtract::Subtractor m_subtractor
Definition: PFSubtractionTool.h:105
PFData.h
PFSubtractionTool::m_NNEnergyPredictorTool
ToolHandle< PFEnergyPredictorTool > m_NNEnergyPredictorTool
Tool for getting predictiing the energy using an ONNX model.
Definition: PFSubtractionTool.h:108
IEFlowCellEOverPTool
Pure virtual base class, from which concrete classes inherit and define reference e/p mean and widths...
Definition: IEFlowCellEOverPTool.h:30
eflowRecClusterContainer
Definition: eflowRecCluster.h:275
eflowSubtractor.h
PFCalcRadialEnergyProfiles
Definition: PFCalcRadialEnergyProfiles.h:13
PFSubtractionTool::m_consistencySigmaCut
Gaudi::Property< double > m_consistencySigmaCut
Parameter that controls whether a track, in a track-cluster system, will be processed by the split sh...
Definition: PFSubtractionTool.h:93
PFSubtractionTool::m_useTruthForChargedShowerSubtraction
Gaudi::Property< bool > m_useTruthForChargedShowerSubtraction
Toggle whether we use truth information for the charged shower subtraction or not.
Definition: PFSubtractionTool.h:118
PFSubtractionTool::m_trkpos
std::unique_ptr< PFMatch::TrackEtaPhiInFixedLayersProvider > m_trkpos
Track position provider to be used to preselect clusters.
Definition: PFSubtractionTool.h:71
PFSubtractionTool::matchAndCreateEflowCaloObj
unsigned int matchAndCreateEflowCaloObj(PFData &data) const
This matches ID tracks and CaloClusters, and then creates eflowCaloObjects.
Definition: PFSubtractionTool.cxx:97
eflowCaloObject
An internal EDM object which stores information about systems of associated tracks and calorimeter cl...
Definition: eflowCaloObject.h:33
PFCalcRadialEnergyProfiles.h
PFSubtractionStatusSetter
This class contains a few functions to set the amount of energy removed from a xAOD::CaloCluster by a...
Definition: PFSubtractionStatusSetter.h:20
PFSubtractionTool::m_pfSubtractionStatusSetter
PFSubtractionStatusSetter m_pfSubtractionStatusSetter
Definition: PFSubtractionTool.h:103
PFSubtractionTool::m_theEOverPTool
ToolHandle< IEFlowCellEOverPTool > m_theEOverPTool
Tool for getting e/p values and hadronic shower cell ordering principle parameters.
Definition: PFSubtractionTool.h:66
PFSubtractionTool::m_useNNEnergy
Gaudi::Property< bool > m_useNNEnergy
Toggle whether we use the neural net energy.
Definition: PFSubtractionTool.h:111
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
PFSubtractionTool::execute
void execute(eflowCaloObjectContainer *theEflowCaloObjectContainer, eflowRecTrackContainer *recTrackContainer, eflowRecClusterContainer *recClusterContainer) const
Definition: PFSubtractionTool.cxx:63
PFSubtractionTool::m_nClusterMatchesToUse
Gaudi::Property< int > m_nClusterMatchesToUse
Number of clusters to match to each track if not doing recover split shower subtraction.
Definition: PFSubtractionTool.h:84
PFSubtractionTool::printAllClusters
void printAllClusters(const eflowRecClusterContainer &recClusterContainer) const
Definition: PFSubtractionTool.cxx:577
PFSubtractionTool::isEOverPFail
bool isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const
Definition: PFSubtractionTool.cxx:554
PFSubtractionTool::m_pfCalc
PFCalcRadialEnergyProfiles m_pfCalc
Definition: PFSubtractionTool.h:102
CaloCluster.h
PFSubtractionTool::performSubtraction
void performSubtraction(const unsigned int &startingPoint, PFData &data) const
Definition: PFSubtractionTool.cxx:279
PFSubtractionStatusSetter.h
eflowSubtract::Subtractor
Used in eflowCellLevelSubtractionTool and eflowRecoverSplitShowersTool to perform the removal of calo...
Definition: eflowSubtractor.h:35
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PFSubtractionTool::initialize
StatusCode initialize()
Definition: PFSubtractionTool.cxx:27
PFSubtractionTool::PFSubtractionTool
PFSubtractionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PFSubtractionTool.cxx:19
PFSubtractionTool::m_theMatchingToolForPull_02
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingToolForPull_02
Definition: PFSubtractionTool.h:78
PFTrackClusterMatchingTool.h
AthAlgTool.h
PFSubtractionTool::m_calcEOverP
Gaudi::Property< bool > m_calcEOverP
Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed.
Definition: PFSubtractionTool.h:90
test_pyathena.parent
parent
Definition: test_pyathena.py:15
PFSubtractionTool::~PFSubtractionTool
~PFSubtractionTool()
PFEnergyPredictorTool.h
PFData
Definition: PFData.h:11
PFSubtractionTool
Definition: PFSubtractionTool.h:35
PFSubtractionTool::m_pfSubtractionEnergyRatioCalculator
PFSubtractionEnergyRatioCalculator m_pfSubtractionEnergyRatioCalculator
Definition: PFSubtractionTool.h:104
PFSubtractionTool::m_recoverSplitShowers
Gaudi::Property< bool > m_recoverSplitShowers
Toggle whether we are recovering split showers or not.
Definition: PFSubtractionTool.h:81
PFSubtractionTool::m_useLegacyEBinIndex
Gaudi::Property< bool > m_useLegacyEBinIndex
Further discussion about why this flag exists can be found in https://its.cern.ch/jira/browse/ATLJETM...
Definition: PFSubtractionTool.h:133
PFSubtractionTool::printTrack
static std::string printTrack(const xAOD::TrackParticle *track)
Definition: PFSubtractionTool.cxx:565
EtaPhiLUT.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
PFSubtractionTool::m_caloClusterReadDecorHandleKeyNLeadingTruthParticles
SG::ReadDecorHandleKey< xAOD::CaloClusterContainer > m_caloClusterReadDecorHandleKeyNLeadingTruthParticles
Read handle key to decorate CaloCluster with threeN leading truth particle barcode and energy.
Definition: PFSubtractionTool.h:126
eflowCaloObject.h
PFSubtractionTool::addSubtractedCells
void addSubtractedCells(eflowCaloObject &thisEflowCaloObject, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusterList) const
Definition: PFSubtractionTool.cxx:592
PFSubtractionTool::m_subtractionSigmaCut
Gaudi::Property< double > m_subtractionSigmaCut
Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system,...
Definition: PFSubtractionTool.h:96
PFSubtractionTool::canAnnihilate
bool canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const
Definition: PFSubtractionTool.cxx:560
PFSubtractionTool::m_useFullCellTruthSubtraction
Gaudi::Property< bool > m_useFullCellTruthSubtraction
Toggle whether we fully remove a cell with a truth deposit or reweight it based on truth contribution...
Definition: PFSubtractionTool.h:121
eflowRecTrackContainer
Definition: eflowRecTrack.h:191
TrackParticle.h
PFSubtractionTool::m_theMatchingTool
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingTool
Default track-cluster matching tool.
Definition: PFSubtractionTool.h:74
PFSubtractionTool::printCluster
static std::string printCluster(const xAOD::CaloCluster *cluster)
Definition: PFSubtractionTool.cxx:571
PFSubtractionEnergyRatioCalculator
Class to calculate the ratio of new to old energies of CaloClusters after the particle flow charged s...
Definition: PFSubtractionEnergyRatioCalculator.h:20
PFSubtractionTool::m_theTruthShowerSimulator
ToolHandle< PFSimulateTruthShowerTool > m_theTruthShowerSimulator
Definition: PFSubtractionTool.h:123
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PFMatchPositions.h
PFSubtractionEnergyRatioCalculator.h
PFSubtractionTool::m_binnedParameters
std::unique_ptr< eflowEEtaBinnedParameters > m_binnedParameters
Definition: PFSubtractionTool.h:68
PFSubtractionTool::m_theMatchingToolForPull_015
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingToolForPull_015
Definition: PFSubtractionTool.h:77
PFSubtractionTool::finalize
StatusCode finalize()
Definition: PFSubtractionTool.cxx:608
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
eflowCaloObjectContainer
Definition: eflowCaloObject.h:100
PFSubtractionTool::m_addCPData
Gaudi::Property< bool > m_addCPData
Toggle whether to decorate eflowRecTrack with addutional data for Combined Performance studies.
Definition: PFSubtractionTool.h:99
PFSimulateTruthShowerTool.h