ATLAS Offline Software
Loading...
Searching...
No Matches
PFUnifiedSubtractionOnlyTool Class Reference

#include <PFUnifiedSubtractionOnlyTool.h>

Inheritance diagram for PFUnifiedSubtractionOnlyTool:
Collaboration diagram for PFUnifiedSubtractionOnlyTool:

Public Member Functions

 PFUnifiedSubtractionOnlyTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~PFUnifiedSubtractionOnlyTool ()
virtual StatusCode initialize () override
virtual StatusCode processPFlowData (const EventContext &ctx, PFData &thePFData) const override

Protected Member Functions

unsigned int matchAndCreateEflowCaloObj (PFData &data) const
 This matches ID tracks and CaloClusters, and then creates eflowCaloObjects.
virtual void performSubtraction (const EventContext &ctx, const unsigned int &startingPoint, const unsigned int &nCaloObj, PFData &data) const
virtual void performSubtraction (eflowCaloObject &thisEflowCaloObject) const
void simulateShowers (const EventContext &ctx, eflowCaloObjectContainer &eflowCaloObjects, const unsigned int &nCaloObj) const
bool isEOverPFail (double expectedEnergy, double sigma, double clusterEnergy) const
bool canAnnihilate (double expectedEnergy, double sigma, double clusterEnergy) const
void addSubtractedCells (eflowCaloObject &thisEflowCaloObject, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusterList) const

Protected Attributes

ToolHandle< IEFlowCellEOverPToolm_theEOverPTool {this, "eflowCellEOverPTool", "eflowCellEOverPTool", "Energy Flow E/P Values and Shower Parameters Tool"}
 Tool for getting e/p values and hadronic shower cell ordering principle parameters.
std::unique_ptr< eflowEEtaBinnedParametersm_binnedParameters
std::unique_ptr< PFMatch::TrackEtaPhiInFixedLayersProviderm_trkpos
 Track position provider to be used to preselect clusters.
Gaudi::Property< bool > m_recoverSplitShowers {this,"RecoverSplitShowers",false,"Toggle whether we are recovering split showers or not"}
 Toggle whether we are recovering split showers or not.
Gaudi::Property< bool > m_calcEOverP {this, "CalcEOverP", false, "Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"}
 Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed.
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"}
 Parameter that controls whether a track, in a track-cluster system, will be processed by the split shower recovery algorithm.
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"}
 Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system, after charged shower subtraction.
Gaudi::Property< bool > m_isHLLHC {this, "isHLLHC", false, "Toggle whether we have the HLLHC setup"}
 Toggle whether we have the HLLHC setup.
Gaudi::Property< bool > m_addCPData {this,"addCPData",false,"Toggle whether to decorate FlowElements with additional data for Combined Performance studies "}
 Toggle whether to decorate eflowRecTrack with additional data for Combined Performance studies.
PFSubtractionStatusSetter m_pfSubtractionStatusSetter {}
PFSubtractionEnergyRatioCalculator m_pfSubtractionEnergyRatioCalculator {}
eflowSubtract::Subtractor m_subtractor {}
ToolHandle< PFEnergyPredictorToolm_NNEnergyPredictorTool {this, "NNEnergyPredictorTool", "","Tool for getting predictiing the energy using an ONNX model "}
 Tool for getting predictiing the energy using an ONNX model.
Gaudi::Property< bool > m_useNNEnergy {this, "useNNEnergy", false, "Toggle whether we use the neural net energy"}
 Toggle whether we use the neural net energy.
Gaudi::Property< bool > m_useLegacyEBinIndex {this, "useLegacyEBinIndex", true, "Toggle whether we use the legacy energy bin index"}
 Further discussion about why this flag exists can be found in https://its.cern.ch/jira/browse/ATLJETMET-1692 and https://indico.cern.ch/event/1388633/contributions/5837876/attachments/2809591/4903439/PFlow_EOverP_Feb2024.pdf The Jira report discusses assorted problems with the treatment of energy bin indexes for the lookup of e/p values.

Detailed Description

Definition at line 27 of file PFUnifiedSubtractionOnlyTool.h.

Constructor & Destructor Documentation

◆ PFUnifiedSubtractionOnlyTool()

PFUnifiedSubtractionOnlyTool::PFUnifiedSubtractionOnlyTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 24 of file PFUnifiedSubtractionOnlyTool.cxx.

24 : base_class(type, name, parent),
25 m_binnedParameters(std::make_unique<eflowEEtaBinnedParameters>())
26{
27}
std::unique_ptr< eflowEEtaBinnedParameters > m_binnedParameters

◆ ~PFUnifiedSubtractionOnlyTool()

PFUnifiedSubtractionOnlyTool::~PFUnifiedSubtractionOnlyTool ( )
default

Member Function Documentation

◆ addSubtractedCells()

void PFUnifiedSubtractionOnlyTool::addSubtractedCells ( eflowCaloObject & thisEflowCaloObject,
const std::vector< std::pair< xAOD::CaloCluster *, bool > > & clusterList ) const
protected

Definition at line 334 of file PFUnifiedSubtractionOnlyTool.cxx.

334 {
335
336 unsigned int numTracks = thisEflowCaloObject.nTracks();
337
338 for (unsigned int iTrack = 0; iTrack < numTracks; ++iTrack){
339 eflowRecTrack* thisTrack = thisEflowCaloObject.efRecTrack(iTrack);
340 for (const auto& thisPair : clusterList){
341 xAOD::CaloCluster* thisCluster = thisPair.first;
342 const CaloClusterCellLink* theCellLink = thisCluster->getCellLinks();
343 CaloClusterCellLink::const_iterator theCell = theCellLink->begin();
344 CaloClusterCellLink::const_iterator lastCell = theCellLink->end();
345 for (; theCell != lastCell; ++theCell) thisTrack->addSubtractedCaloCell(ElementLink<CaloCellContainer>("AllCalo",theCell.index()),theCell.weight()/numTracks);
346 }
347 }
348}
const eflowRecTrack * efRecTrack(int i) const
unsigned nTracks() const
void addSubtractedCaloCell(ElementLink< CaloCellContainer > theCellLink, const double &weight)
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version).
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.

◆ canAnnihilate()

bool PFUnifiedSubtractionOnlyTool::canAnnihilate ( double expectedEnergy,
double sigma,
double clusterEnergy ) const
protected

Definition at line 329 of file PFUnifiedSubtractionOnlyTool.cxx.

330{
331 return clusterEnergy - expectedEnergy < m_subtractionSigmaCut * sigma;
332}
Gaudi::Property< double > m_subtractionSigmaCut
Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system,...

◆ initialize()

StatusCode PFUnifiedSubtractionOnlyTool::initialize ( )
overridevirtual

Definition at line 32 of file PFUnifiedSubtractionOnlyTool.cxx.

33{
34
35 ATH_CHECK(m_theEOverPTool.retrieve());
36
37 ATH_CHECK(m_theEOverPTool->fillBinnedParameters(m_binnedParameters.get()));
38
39 m_trkpos.reset(dynamic_cast<PFMatch::TrackEtaPhiInFixedLayersProvider *>(PFMatch::TrackPositionFactory::Get("EM2EtaPhi").release()));
40 if (!m_trkpos)
41 {
42 ATH_MSG_ERROR("Failed to get TrackPositionProvider for cluster preselection!");
43 return StatusCode::FAILURE;
44 }
45
47
48
49 //Set the level of the helpers to the same as the tool here
50 m_pfSubtractionStatusSetter.msg().setLevel(this->msg().level());
51 m_pfSubtractionEnergyRatioCalculator.msg().setLevel(this->msg().level());
52 m_subtractor.m_facilitator.msg().setLevel(this->msg().level());
53
54
55 return StatusCode::SUCCESS;
56
57}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
static std::unique_ptr< IPositionProvider > Get(const std::string &positionType)
ToolHandle< IEFlowCellEOverPTool > m_theEOverPTool
Tool for getting e/p values and hadronic shower cell ordering principle parameters.
PFSubtractionStatusSetter m_pfSubtractionStatusSetter
ToolHandle< PFEnergyPredictorTool > m_NNEnergyPredictorTool
Tool for getting predictiing the energy using an ONNX model.
std::unique_ptr< PFMatch::TrackEtaPhiInFixedLayersProvider > m_trkpos
Track position provider to be used to preselect clusters.
PFSubtractionEnergyRatioCalculator m_pfSubtractionEnergyRatioCalculator
static std::string release
Definition computils.h:50
MsgStream & msg
Definition testRead.cxx:32

◆ isEOverPFail()

bool PFUnifiedSubtractionOnlyTool::isEOverPFail ( double expectedEnergy,
double sigma,
double clusterEnergy ) const
protected

Definition at line 323 of file PFUnifiedSubtractionOnlyTool.cxx.

324{
325 if ((expectedEnergy == 0) && (clusterEnergy > 0)) return false;
326 return clusterEnergy < expectedEnergy - m_consistencySigmaCut * sigma;
327}
Gaudi::Property< double > m_consistencySigmaCut
Parameter that controls whether a track, in a track-cluster system, will be processed by the split sh...

◆ matchAndCreateEflowCaloObj()

unsigned int PFUnifiedSubtractionOnlyTool::matchAndCreateEflowCaloObj ( PFData & data) const
protected

This matches ID tracks and CaloClusters, and then creates eflowCaloObjects.

◆ performSubtraction() [1/2]

void PFUnifiedSubtractionOnlyTool::performSubtraction ( const EventContext & ctx,
const unsigned int & startingPoint,
const unsigned int & nCaloObj,
PFData & data ) const
protectedvirtual

Start loop from nCaloObj, which should be zero on a first pass

Definition at line 108 of file PFUnifiedSubtractionOnlyTool.cxx.

108 {
109
111 if (!m_recoverSplitShowers && 0 != nCaloObj) ATH_MSG_WARNING("Not in Split Showers Mode and already have " << nCaloObj << " eflowCaloObjects");
112
113 simulateShowers(ctx, *(data.caloObjects), nCaloObj);
114
115 unsigned int nEFCaloObs = data.caloObjects->size();
116 for (unsigned int iCalo = startingPoint; iCalo < nEFCaloObs; ++iCalo) {
117 eflowCaloObject* thisEflowCaloObject = data.caloObjects->at(iCalo);
118 this->performSubtraction(*thisEflowCaloObject);
119 }
120}
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
Gaudi::Property< bool > m_recoverSplitShowers
Toggle whether we are recovering split showers or not.
virtual void performSubtraction(const EventContext &ctx, const unsigned int &startingPoint, const unsigned int &nCaloObj, PFData &data) const
void simulateShowers(const EventContext &ctx, eflowCaloObjectContainer &eflowCaloObjects, const unsigned int &nCaloObj) const

◆ performSubtraction() [2/2]

void PFUnifiedSubtractionOnlyTool::performSubtraction ( eflowCaloObject & thisEflowCaloObject) const
protectedvirtual

Definition at line 122 of file PFUnifiedSubtractionOnlyTool.cxx.

122 {
123
124 ATH_MSG_DEBUG("In performSubtraction");
125
126 unsigned int nClusters = thisEflowCaloObject.nClusters();
127 unsigned int nTrackMatches = thisEflowCaloObject.nTracks();
128
129 ATH_MSG_DEBUG("Have got an eflowCaloObject with " << nClusters << " clusters and " << nTrackMatches << " track matches");
130
131 if (msgLevel(MSG::DEBUG)){
132 for (unsigned int iTrack = 0; iTrack < nTrackMatches; ++iTrack){
133 eflowRecTrack* thisTrack = thisEflowCaloObject.efRecTrack(iTrack);
134 ATH_MSG_DEBUG("eflowCaloObject has track with E, pt and eta " << thisTrack->getTrack()->e() << ", " << thisTrack->getTrack()->pt() << " and " << thisTrack->getTrack()->eta());
135 }
136 }
137
138 //To keep historical behaviour when in recover split showers mode allow tracks with no cluster matches to proceed.
139 if (!m_recoverSplitShowers && nClusters < 1) return;
140
141 //Need at least one track in this eflowCaloObject to continue.
142 if (nTrackMatches < 1) return;
143
144 double expectedEnergy = thisEflowCaloObject.getExpectedEnergy();
145 double clusterEnergy = thisEflowCaloObject.getClusterEnergy();
146 double expectedSigma = sqrt(thisEflowCaloObject.getExpectedVariance());
147
148 /* Check e/p, if on first pass - return if e/p not consistent with expected e/p */
150 if (isEOverPFail(expectedEnergy, expectedSigma, clusterEnergy)) return;
151 }
152
153 const std::vector<std::pair<eflowTrackClusterLink *, std::pair<float, float>>> &matchedTrackList = thisEflowCaloObject.efRecLink();
154
155 ATH_MSG_DEBUG("Matched Track List has size " << matchedTrackList.size());
156
157 if (msgLevel(MSG::DEBUG))
158 {
159 for (unsigned int iTrack = 0; iTrack < nTrackMatches; ++iTrack)
160 {
161 const xAOD::TrackParticle *thisTrack = thisEflowCaloObject.efRecTrack(iTrack)->getTrack();
162 ATH_MSG_DEBUG("eflowCaloObject has track match with E, pt and eta " << thisTrack->e() << ", " << thisTrack->pt() << " and " << thisTrack->eta());
163 }
164 }
165
166 ATH_MSG_DEBUG("About to perform subtraction for this eflowCaloObject");
167
168 bool wasAnnihilated = false;
169
170 //First deal with non-split showers mode
172 /* Check if we can annihilate right away - true if matched cluster has only the expected energy deposit */
173 if (canAnnihilate(expectedEnergy, expectedSigma, clusterEnergy)){
174
175 wasAnnihilated = true;
176
177 std::vector<std::pair<xAOD::CaloCluster *, bool>> clusterList;
178 std::map<xAOD::CaloCluster *, double> clusterEnergyMap;
179 unsigned nCluster = thisEflowCaloObject.nClusters();
180 for (unsigned iCluster = 0; iCluster < nCluster; ++iCluster){
181 clusterList.emplace_back(thisEflowCaloObject.efRecCluster(iCluster)->getCluster(), false);
182 }
183
184 ATH_MSG_DEBUG("We are going to annihilate. ExpectedEnergy, expectedSigma and clusterEnergy are " << expectedEnergy << ", " << expectedSigma << " and " << clusterEnergy);
185 if (msgLevel(MSG::DEBUG))
186 for (auto thisPair : clusterList)
187 ATH_MSG_DEBUG("Annihilating cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
188
189 m_pfSubtractionStatusSetter.markAllTracksAnnihStatus(thisEflowCaloObject);
190
191 //before we remove all the cells, we create a list of the removed cells if in doCPData mode
192 if (m_addCPData) this->addSubtractedCells(thisEflowCaloObject, clusterList);
193
195
196 if (msgLevel(MSG::DEBUG))
197 for (auto thisPair : clusterList)
198 ATH_MSG_DEBUG("Have Annihilated cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
199
200 /* Flag all tracks in this system as subtracted */
201 for (unsigned iTrack = 0; iTrack < thisEflowCaloObject.nTracks(); ++iTrack){
202 eflowRecTrack *thisEfRecTrack = (matchedTrackList[iTrack].first)->getTrack();
203 if (!thisEfRecTrack->isSubtracted()) thisEfRecTrack->setSubtracted();
204 }
205
206 }//if can annihilate this track-cluster systems matched cluster
207 }//split shower recovery mode or regular mode where above annihilation was not triggered
208 if (m_recoverSplitShowers || !wasAnnihilated){
209
210 for (unsigned iTrack = 0; iTrack < thisEflowCaloObject.nTracks(); ++iTrack){
211
212 eflowRecTrack *thisEfRecTrack = thisEflowCaloObject.efRecTrack(iTrack);
213
214 ATH_MSG_DEBUG("About to subtract track with e, pt, eta and phi of " << thisEfRecTrack->getTrack()->e() << ", " << thisEfRecTrack->getTrack()->pt() << ", " << thisEfRecTrack->getTrack()->eta() << " and "
215 << thisEfRecTrack->getTrack()->eta());
216
217 if (!thisEfRecTrack->hasBin()) continue;
218
219 ATH_MSG_DEBUG("Have bin for this eflowCaloObject");
220
221 if (thisEfRecTrack->isInDenseEnvironment() && !m_recoverSplitShowers) continue;
222
223 ATH_MSG_DEBUG("Am not in dense environment for this eflowCaloObject");
224
225 /* Get matched cluster via Links */
226 std::vector<eflowRecCluster *> matchedClusters;
227 const std::vector<eflowTrackClusterLink *>& links = thisEfRecTrack->getClusterMatches();
228 matchedClusters.reserve(links.size());
229 for (auto* thisEFlowTrackClusterLink : links)
230 matchedClusters.push_back(thisEFlowTrackClusterLink->getCluster());
232 std::sort(matchedClusters.begin(),
233 matchedClusters.end(),
234 eflowRecCluster::SortDescendingPt());
235
236 if (msgLvl(MSG::DEBUG)) {
237 for (auto* thisClus : matchedClusters)
239 "Haved matched cluster "
240 << thisClus->getCluster()->index() << " with e,pt, eta and phi of "
241 << thisClus->getCluster()->e() << ", "
242 << thisClus->getCluster()->pt() << ", "
243 << thisClus->getCluster()->eta() << " and "
244 << thisClus->getCluster()->phi() << " will be subtracted");
245 }
246
247 /* Do subtraction */
248 std::vector<std::pair<xAOD::CaloCluster *, bool>> clusterSubtractionList;
249 clusterSubtractionList.reserve(matchedClusters.size());
250 std::map<xAOD::CaloCluster *, double> clusterEnergyMap;
251 for (auto *thisEFlowRecCluster : matchedClusters){
252 xAOD::CaloCluster *thisCluster = thisEFlowRecCluster->getCluster();
253 clusterSubtractionList.emplace_back(thisCluster, false);
254 clusterEnergyMap[thisCluster] = thisCluster->e();
255 }
256
257 ATH_MSG_DEBUG("Have filled clusterSubtractionList for this eflowCaloObject");
258
259 unsigned int trackIndex = thisEfRecTrack->getTrack()->index();
260
261 //Previously we only checked this in recover split showers, but makes sense to check it in both passes.
262 auto sumClusEnergy = [](double accumulator, std::pair<xAOD::CaloCluster *, bool> thisPair){ return accumulator += thisPair.first->e();};
263 double totalClusterEnergy = std::accumulate(clusterSubtractionList.begin(),clusterSubtractionList.end(),0.0,sumClusEnergy);
264
265 /* Check if we can annihilate right away - true if matched cluster has only the expected energy deposit */
266 if(canAnnihilate(thisEfRecTrack->getEExpect(),sqrt(thisEfRecTrack->getVarEExpect()),totalClusterEnergy)){
267
268 if (msgLevel(MSG::DEBUG))
269 for (auto thisPair : clusterSubtractionList)
270 ATH_MSG_DEBUG("Annihilating cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
271
272 //before we remove all the cells, we create a list of the removed cells if in doCPData mode
273 if (m_addCPData) this->addSubtractedCells(thisEflowCaloObject, clusterSubtractionList);
274
275 Subtractor::annihilateClusters(clusterSubtractionList);
276 //Now we should mark all of these clusters as being subtracted
277 //Now need to mark which clusters were modified in the subtraction procedure
278 std::vector<std::pair<float, float>> clusterSubtractedEnergyRatios;
279 m_pfSubtractionEnergyRatioCalculator.calculateSubtractedEnergyRatiosForAnnih(clusterSubtractionList, clusterEnergyMap, clusterSubtractedEnergyRatios);
280 m_pfSubtractionStatusSetter.markSubtractionStatus(clusterSubtractionList, clusterSubtractedEnergyRatios, thisEflowCaloObject, trackIndex);
281 }
282 else
283 {
284
285 /* Subtract the track from all matched clusters */
286 m_subtractor.subtractTracksFromClusters(thisEfRecTrack, clusterSubtractionList, m_addCPData);
287
288 //recalculate total cluster energy from the clusters afer subtraction
289 totalClusterEnergy = std::accumulate(clusterSubtractionList.begin(),clusterSubtractionList.end(),0.0,sumClusEnergy);
290
291 /* Annihilate the cluster(s) if the remnant is small (i.e. below k*sigma) */
292 if (canAnnihilate(0.0,sqrt(thisEfRecTrack->getVarEExpect()), totalClusterEnergy)){
293
294 if (msgLevel(MSG::DEBUG))
295 for (auto thisPair : clusterSubtractionList){
296 ATH_MSG_DEBUG("Annihilating remnant cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
297 }
298 eflowSubtract::Subtractor::annihilateClusters(clusterSubtractionList);
299 //Now we should mark all of these clusters as being subtracted
300 std::vector<std::pair<float, float>> clusterSubtractedEnergyRatios;
301 m_pfSubtractionEnergyRatioCalculator.calculateSubtractedEnergyRatiosForAnnih(clusterSubtractionList, clusterEnergyMap, clusterSubtractedEnergyRatios);
302 m_pfSubtractionStatusSetter.markSubtractionStatus(clusterSubtractionList, clusterSubtractedEnergyRatios, thisEflowCaloObject, trackIndex);
303 }//if remove the remnant after cell by cell subtraction
304 else
305 {
306 std::vector<std::pair<float, float>> clusterSubtractedEnergyRatios;
307 m_pfSubtractionEnergyRatioCalculator.calculateSubtractedEnergyRatios(clusterSubtractionList, clusterEnergyMap, clusterSubtractedEnergyRatios);
308 m_pfSubtractionStatusSetter.markSubtractionStatus(clusterSubtractionList, clusterSubtractedEnergyRatios, thisEflowCaloObject, trackIndex);
309 }//if don't remove the remnant after cell by cell subtraction
310
311 }//if not annihilating, and instead subtracting cell by cell
312
313 ATH_MSG_DEBUG("Have subtracted charged shower for this eflowRecTrack");
314
315 /* Flag tracks as subtracted */
316 if (!thisEfRecTrack->isSubtracted()) thisEfRecTrack->setSubtracted();
317
318 }//loop over tracks in eflowCaloObject
319 }//cell by cell subtraction
320
321}
#define ATH_MSG_DEBUG(x)
bool isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const
Gaudi::Property< bool > m_addCPData
Toggle whether to decorate eflowRecTrack with additional data for Combined Performance studies.
bool canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const
void addSubtractedCells(eflowCaloObject &thisEflowCaloObject, const std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusterList) const
double getExpectedVariance() const
double getClusterEnergy() const
unsigned nClusters() const
const std::vector< std::pair< eflowTrackClusterLink *, std::pair< float, float > > > & efRecLink() const
double getExpectedEnergy() const
const eflowRecCluster * efRecCluster(int i) const
xAOD::CaloCluster * getCluster()
double getEExpect() const
const std::vector< eflowTrackClusterLink * > & getClusterMatches() const
bool isSubtracted() const
const xAOD::TrackParticle * getTrack() const
bool hasBin() const
bool isInDenseEnvironment() const
double getVarEExpect() const
static void annihilateClusters(std::vector< std::pair< xAOD::CaloCluster *, bool > > &clusters)
virtual double e() const
The total energy of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double e() const override final
The total energy of the particle.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
TrackParticle_v1 TrackParticle
Reference the current persistent version:

◆ processPFlowData()

StatusCode PFUnifiedSubtractionOnlyTool::processPFlowData ( const EventContext & ctx,
PFData & thePFData ) const
overridevirtual

Definition at line 59 of file PFUnifiedSubtractionOnlyTool.cxx.

63{
64
65 if (!data.caloObjects) {
66 ATH_MSG_ERROR("PFData::caloObjects is null; caller must set it before invoking the subtraction tool");
67 return StatusCode::FAILURE;
68 }
69
70 unsigned int numMatches;
71 unsigned int nCaloObj;
72
74 numMatches = data.nOrigCaloObj;
75 nCaloObj = data.nOrigCaloObj;
76 }
77 else{
78 numMatches = data.nMatches;
79 nCaloObj = 0;
80 }
81
82 if (!m_calcEOverP){
83 if (!m_recoverSplitShowers) performSubtraction(ctx, 0, nCaloObj, data);
84 else performSubtraction(ctx, numMatches, nCaloObj, data);
85 }
86 //in e/p mode we want to simulate showers for all eflowCaloObjects and then decorate the eflowTrack with the relevant e/p information, but not perform any subtraction.
87 //in particular simulateShowers calculates the LHED which is used for the binning of e/p when we measure it.
88 else simulateShowers(ctx, *(data.caloObjects), nCaloObj);
89
90 return StatusCode::SUCCESS;
91}
Gaudi::Property< bool > m_calcEOverP
Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed.

◆ simulateShowers()

void PFUnifiedSubtractionOnlyTool::simulateShowers ( const EventContext & ctx,
eflowCaloObjectContainer & eflowCaloObjects,
const unsigned int & nCaloObj ) const
protected

Definition at line 93 of file PFUnifiedSubtractionOnlyTool.cxx.

93 {
94
95 const double gaussianRadius = 0.032;
96 const double gaussianRadiusError = 1.0e-3;
97 const double maximumRadiusSigma = 3.0;
98
99 eflowLayerIntegrator integrator(gaussianRadius, gaussianRadiusError, maximumRadiusSigma, m_isHLLHC);
100
101 //For each eflowCaloObject we calculate the expected energy deposit in the calorimeter and cell ordering for subtraction.
102 for (unsigned int iCalo = nCaloObj; iCalo < eflowCaloObjects.size(); ++iCalo) {
103 eflowCaloObject* thisEflowCaloObject = eflowCaloObjects.at(iCalo);
104 thisEflowCaloObject->simulateShower(ctx, &integrator, m_binnedParameters.get(), m_useNNEnergy ? &(*m_NNEnergyPredictorTool) : nullptr, m_useLegacyEBinIndex);
105 }
106}
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Property< bool > m_isHLLHC
Toggle whether we have the HLLHC setup.
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_useNNEnergy
Toggle whether we use the neural net energy.
void simulateShower(const EventContext &ctx, eflowLayerIntegrator *integrator, const eflowEEtaBinnedParameters *binnedParameters, const PFEnergyPredictorTool *energyP, bool useLegacyEnergyBinIndexing)

Member Data Documentation

◆ m_addCPData

Gaudi::Property<bool> PFUnifiedSubtractionOnlyTool::m_addCPData {this,"addCPData",false,"Toggle whether to decorate FlowElements with additional data for Combined Performance studies "}
protected

Toggle whether to decorate eflowRecTrack with additional data for Combined Performance studies.

Definition at line 79 of file PFUnifiedSubtractionOnlyTool.h.

79{this,"addCPData",false,"Toggle whether to decorate FlowElements with additional data for Combined Performance studies "};

◆ m_binnedParameters

std::unique_ptr<eflowEEtaBinnedParameters> PFUnifiedSubtractionOnlyTool::m_binnedParameters
protected

Definition at line 58 of file PFUnifiedSubtractionOnlyTool.h.

◆ m_calcEOverP

Gaudi::Property<bool> PFUnifiedSubtractionOnlyTool::m_calcEOverP {this, "CalcEOverP", false, "Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"}
protected

Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed.

Definition at line 67 of file PFUnifiedSubtractionOnlyTool.h.

67{this, "CalcEOverP", false, "Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed"};

◆ m_consistencySigmaCut

Gaudi::Property<double> PFUnifiedSubtractionOnlyTool::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"}
protected

Parameter that controls whether a track, in a track-cluster system, will be processed by the split shower recovery algorithm.

Definition at line 70 of file PFUnifiedSubtractionOnlyTool.h.

70{this, "ConsistencySigmaCut", 1.0, "Parameter that controls whether a track, in a track-cluster system, will be processed by the split shower recovery algorithm"};

◆ m_isHLLHC

Gaudi::Property<bool> PFUnifiedSubtractionOnlyTool::m_isHLLHC {this, "isHLLHC", false, "Toggle whether we have the HLLHC setup"}
protected

Toggle whether we have the HLLHC setup.

Definition at line 76 of file PFUnifiedSubtractionOnlyTool.h.

76{this, "isHLLHC", false, "Toggle whether we have the HLLHC setup"};

◆ m_NNEnergyPredictorTool

ToolHandle<PFEnergyPredictorTool> PFUnifiedSubtractionOnlyTool::m_NNEnergyPredictorTool {this, "NNEnergyPredictorTool", "","Tool for getting predictiing the energy using an ONNX model "}
protected

Tool for getting predictiing the energy using an ONNX model.

Definition at line 87 of file PFUnifiedSubtractionOnlyTool.h.

87{this, "NNEnergyPredictorTool", "","Tool for getting predictiing the energy using an ONNX model "};

◆ m_pfSubtractionEnergyRatioCalculator

PFSubtractionEnergyRatioCalculator PFUnifiedSubtractionOnlyTool::m_pfSubtractionEnergyRatioCalculator {}
protected

Definition at line 83 of file PFUnifiedSubtractionOnlyTool.h.

83{};

◆ m_pfSubtractionStatusSetter

PFSubtractionStatusSetter PFUnifiedSubtractionOnlyTool::m_pfSubtractionStatusSetter {}
protected

Definition at line 82 of file PFUnifiedSubtractionOnlyTool.h.

82{};

◆ m_recoverSplitShowers

Gaudi::Property<bool> PFUnifiedSubtractionOnlyTool::m_recoverSplitShowers {this,"RecoverSplitShowers",false,"Toggle whether we are recovering split showers or not"}
protected

Toggle whether we are recovering split showers or not.

Definition at line 64 of file PFUnifiedSubtractionOnlyTool.h.

64{this,"RecoverSplitShowers",false,"Toggle whether we are recovering split showers or not"};

◆ m_subtractionSigmaCut

Gaudi::Property<double> PFUnifiedSubtractionOnlyTool::m_subtractionSigmaCut {this, "SubtractionSigmaCut", 1.5, "Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system, after charged shower subtraction"}
protected

Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system, after charged shower subtraction.

Definition at line 73 of file PFUnifiedSubtractionOnlyTool.h.

73{this, "SubtractionSigmaCut", 1.5, "Parameter that controls whether to use retain remaining calorimeter energy in track-cluster system, after charged shower subtraction"};

◆ m_subtractor

eflowSubtract::Subtractor PFUnifiedSubtractionOnlyTool::m_subtractor {}
protected

Definition at line 84 of file PFUnifiedSubtractionOnlyTool.h.

84{};

◆ m_theEOverPTool

ToolHandle<IEFlowCellEOverPTool> PFUnifiedSubtractionOnlyTool::m_theEOverPTool {this, "eflowCellEOverPTool", "eflowCellEOverPTool", "Energy Flow E/P Values and Shower Parameters Tool"}
protected

Tool for getting e/p values and hadronic shower cell ordering principle parameters.

Definition at line 56 of file PFUnifiedSubtractionOnlyTool.h.

56{this, "eflowCellEOverPTool", "eflowCellEOverPTool", "Energy Flow E/P Values and Shower Parameters Tool"};

◆ m_trkpos

std::unique_ptr<PFMatch::TrackEtaPhiInFixedLayersProvider> PFUnifiedSubtractionOnlyTool::m_trkpos
protected

Track position provider to be used to preselect clusters.

Definition at line 61 of file PFUnifiedSubtractionOnlyTool.h.

◆ m_useLegacyEBinIndex

Gaudi::Property<bool> PFUnifiedSubtractionOnlyTool::m_useLegacyEBinIndex {this, "useLegacyEBinIndex", true, "Toggle whether we use the legacy energy bin index"}
protected

Further discussion about why this flag exists can be found in https://its.cern.ch/jira/browse/ATLJETMET-1692 and https://indico.cern.ch/event/1388633/contributions/5837876/attachments/2809591/4903439/PFlow_EOverP_Feb2024.pdf The Jira report discusses assorted problems with the treatment of energy bin indexes for the lookup of e/p values.

In order to not change the behaviour of produciton code a legacy option is introduced to allow us to fix the problem in future iterations of e/p derivations.s

Definition at line 97 of file PFUnifiedSubtractionOnlyTool.h.

97{this, "useLegacyEBinIndex", true, "Toggle whether we use the legacy energy bin index"};

◆ m_useNNEnergy

Gaudi::Property<bool> PFUnifiedSubtractionOnlyTool::m_useNNEnergy {this, "useNNEnergy", false, "Toggle whether we use the neural net energy"}
protected

Toggle whether we use the neural net energy.

Definition at line 90 of file PFUnifiedSubtractionOnlyTool.h.

90{this, "useNNEnergy", false, "Toggle whether we use the neural net energy"};

The documentation for this class was generated from the following files: