ATLAS Offline Software
Loading...
Searching...
No Matches
PFSubtractionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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"
24
30
31class PFSubtractionTool : public extends<AthAlgTool, IPFSubtractionTool>
32{
33
34public:
35 PFSubtractionTool(const std::string &type, const std::string &name, const IInterface *parent);
37
38 StatusCode initialize();
39 void execute(eflowCaloObjectContainer *theEflowCaloObjectContainer, eflowRecTrackContainer *recTrackContainer, eflowRecClusterContainer *recClusterContainer) const;
40 StatusCode finalize();
41
42private:
43
45 unsigned int matchAndCreateEflowCaloObj(PFData &data) const;
46
47 void performSubtraction(const unsigned int& startingPoint,PFData &data) const;
48 void performSubtraction(eflowCaloObject& thisEflowCaloObject) const;
50 void performTruthSubtraction(eflowCaloObject& thisEflowCaloObject) const;
51
52 bool isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const;
53
54 bool canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const;
55
56 static std::string printTrack(const xAOD::TrackParticle* track);
57 static std::string printCluster(const xAOD::CaloCluster* cluster);
58 void printAllClusters(const eflowRecClusterContainer& recClusterContainer) const;
59
60 void addSubtractedCells(eflowCaloObject& thisEflowCaloObject, const std::vector<std::pair<xAOD::CaloCluster *, bool> >& clusterList) const;
61
63 ToolHandle<IEFlowCellEOverPTool> m_theEOverPTool{this, "eflowCellEOverPTool", "eflowCellEOverPTool", "Energy Flow E/P Values and Shower Parameters Tool"};
64
65 std::unique_ptr<eflowEEtaBinnedParameters> m_binnedParameters;
66
68 std::unique_ptr<PFMatch::TrackEtaPhiInFixedLayersProvider> m_trkpos;
69
71 ToolHandle<PFTrackClusterMatchingTool> m_theMatchingTool{this, "PFTrackClusterMatchingTool", "PFTrackClusterMatchingTool/CalObjBldMatchingTool", "The track-cluster matching tool"};
72
73 /* Track-cluster matching tools for calculating the pull */
74 ToolHandle<PFTrackClusterMatchingTool> m_theMatchingToolForPull_015{this, "PFTrackClusterMatchingTool_015", "PFTrackClusterMatchingTool/PFPullMatchingTool_015", "The 0.15 track-cluster matching tool to calculate the pull"};
75 ToolHandle<PFTrackClusterMatchingTool> m_theMatchingToolForPull_02{this, "PFTrackClusterMatchingTool_02", "PFTrackClusterMatchingTool/PFPullMatchingTool_02", "The 0.2 track-cluster matching tool to calculate the pull"};
76
78 Gaudi::Property<bool> m_recoverSplitShowers{this,"RecoverSplitShowers",false,"Toggle whether we are recovering split showers or not"};
79
81 Gaudi::Property<int> m_nClusterMatchesToUse{this, "nClusterMatchesToUse", 1, "Number of clusters to match to each track"};
82
84 Gaudi::Property<bool> m_isHLLHC{this, "isHLLHC", false, "Toggle whether we have the HLLHC setup"};
85
87 Gaudi::Property<bool> m_calcEOverP{this, "CalcEOverP", false, "Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"};
88
90 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"};
91
93 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"};
94
96 Gaudi::Property<bool> m_addCPData{this,"addCPData",false,"Toggle whether to decorate FlowElements with addutional data for Combined Performance studies "};
97
98 //Helpers
102
104 ToolHandle<PFEnergyPredictorTool> m_NNEnergyPredictorTool{this, "NNEnergyPredictorTool", "","Tool for getting predictiing the energy using an ONNX model "};
105
107 Gaudi::Property<bool> m_useNNEnergy{this, "useNNEnergy", false, "Toggle whether we use the neural net energy"};
108
109 //Only turn this on for MC samples without pileup that have calibration hits avaialble
111 Gaudi::Property<bool> m_useTruthMatching{this, "useTrackClusterTruthMatching", false, "Toggle whether to cheat and use truth information for track-cluster matching"};
112
114 Gaudi::Property<bool> m_useTruthForChargedShowerSubtraction{this, "useTruthForChargedShowerSubtraction", false, "Toggle whether we use truth information for the charged shower subtraction or not"};
115
117 Gaudi::Property<bool> m_useFullCellTruthSubtraction{this,"useFullCellTruthSubtraction",true,"Toggle whether we fully remove a cell with a truth deposit or reweight it based on truth contribution"};
118
119 ToolHandle<PFSimulateTruthShowerTool> m_theTruthShowerSimulator{this, "PFSimulateTruthShowerTool", "", "The truth shower simulator"};
120
123
129 Gaudi::Property<bool> m_useLegacyEBinIndex{this, "useLegacyEBinIndex", true, "Toggle whether we use the legacy energy bin index"};
130
131};
132
133#endif
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Pure virtual base class, from which concrete classes inherit and define reference e/p mean and widths...
Class to calculate the ratio of new to old energies of CaloClusters after the particle flow charged s...
This class contains a few functions to set the amount of energy removed from a xAOD::CaloCluster by a...
std::unique_ptr< PFMatch::TrackEtaPhiInFixedLayersProvider > m_trkpos
Track position provider to be used to preselect clusters.
Gaudi::Property< bool > m_useNNEnergy
Toggle whether we use the neural net energy.
PFSubtractionEnergyRatioCalculator m_pfSubtractionEnergyRatioCalculator
ToolHandle< IEFlowCellEOverPTool > m_theEOverPTool
Tool for getting e/p values and hadronic shower cell ordering principle parameters.
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingTool
Default track-cluster matching tool.
void performTruthSubtraction(PFData &data) const
ToolHandle< PFEnergyPredictorTool > m_NNEnergyPredictorTool
Tool for getting predictiing the energy using an ONNX model.
Gaudi::Property< double > m_subtractionSigmaCut
Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system,...
Gaudi::Property< double > m_consistencySigmaCut
Parameter that controls whether a track, in a track-cluster system, will be processed by the split sh...
void printAllClusters(const eflowRecClusterContainer &recClusterContainer) const
Gaudi::Property< bool > m_useFullCellTruthSubtraction
Toggle whether we fully remove a cell with a truth deposit or reweight it based on truth contribution...
void addSubtractedCells(eflowCaloObject &thisEflowCaloObject, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusterList) const
eflowSubtract::Subtractor m_subtractor
SG::ReadDecorHandleKey< xAOD::CaloClusterContainer > m_caloClusterReadDecorHandleKeyNLeadingTruthParticles
Read handle key to decorate CaloCluster with threeN leading truth particle uniqueID and energy.
Gaudi::Property< int > m_nClusterMatchesToUse
Number of clusters to match to each track if not doing recover split shower subtraction.
PFSubtractionStatusSetter m_pfSubtractionStatusSetter
Gaudi::Property< bool > m_useTruthMatching
Toggle whether to cheat and use truth information for track-cluster matching - only for performance s...
bool canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const
Gaudi::Property< bool > m_addCPData
Toggle whether to decorate eflowRecTrack with addutional data for Combined Performance studies.
void performSubtraction(const unsigned int &startingPoint, PFData &data) const
ToolHandle< PFSimulateTruthShowerTool > m_theTruthShowerSimulator
unsigned int matchAndCreateEflowCaloObj(PFData &data) const
This matches ID tracks and CaloClusters, and then creates eflowCaloObjects.
std::unique_ptr< eflowEEtaBinnedParameters > m_binnedParameters
PFSubtractionTool(const std::string &type, const std::string &name, const IInterface *parent)
static std::string printCluster(const xAOD::CaloCluster *cluster)
Gaudi::Property< bool > m_calcEOverP
Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed.
Gaudi::Property< bool > m_useTruthForChargedShowerSubtraction
Toggle whether we use truth information for the charged shower subtraction or not.
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingToolForPull_02
Gaudi::Property< bool > m_useLegacyEBinIndex
Further discussion about why this flag exists can be found in https://its.cern.ch/jira/browse/ATLJETM...
Gaudi::Property< bool > m_recoverSplitShowers
Toggle whether we are recovering split showers or not.
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingToolForPull_015
static std::string printTrack(const xAOD::TrackParticle *track)
Gaudi::Property< bool > m_isHLLHC
Toggle whether we have the HLLHC setup.
void execute(eflowCaloObjectContainer *theEflowCaloObjectContainer, eflowRecTrackContainer *recTrackContainer, eflowRecClusterContainer *recClusterContainer) const
bool isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
An internal EDM object which stores information about systems of associated tracks and calorimeter cl...
Inherits from eflowEEtaBinBase.
Used in eflowCellLevelSubtractionTool and eflowRecoverSplitShowersTool to perform the removal of calo...
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
TrackParticle_v1 TrackParticle
Reference the current persistent version: