ATLAS Offline Software
PFSubtractionTool.cxx
Go to the documentation of this file.
2 
11 #include "eflowRec/PFTrackFiller.h"
12 
13 using namespace eflowSubtract;
14 
15 PFSubtractionTool::PFSubtractionTool(const std::string &type, const std::string &name, const IInterface *parent) : base_class(type, name, parent),
16  m_binnedParameters(std::make_unique<eflowEEtaBinnedParameters>())
17 {
18 }
19 
21 = default;
22 
24 {
25 
26  ATH_CHECK(m_theEOverPTool.retrieve());
27 
28  ATH_CHECK(m_theEOverPTool->fillBinnedParameters(m_binnedParameters.get()));
29 
31  if (!m_trkpos)
32  {
33  ATH_MSG_ERROR("Failed to get TrackPositionProvider for cluster preselection!");
34  return StatusCode::FAILURE;
35  }
36 
37  //Retrieve track-cluster matching tools
38  ATH_CHECK(m_theMatchingTool.retrieve());
41 
43 
44  //Set the level of the helpers to the same as the tool here
45  m_pfCalc.msg().setLevel(this->msg().level());
46  m_pfSubtractionStatusSetter.msg().setLevel(this->msg().level());
47  m_pfSubtractionEnergyRatioCalculator.msg().setLevel(this->msg().level());
48  m_subtractor.m_facilitator.msg().setLevel(this->msg().level());
49  return StatusCode::SUCCESS;
50 }
51 
52 void PFSubtractionTool::execute(eflowCaloObjectContainer *theEflowCaloObjectContainer, eflowRecTrackContainer *recTrackContainer, eflowRecClusterContainer *recClusterContainer) const
53 {
54 
55  ATH_MSG_DEBUG("Executing");
56 
57  PFData data;
58  data.caloObjects = theEflowCaloObjectContainer;
59  const PFTrackFiller pfTrackFiller;
62 
63  const PFClusterFiller pfClusterFiller;
66 
67  ATH_MSG_DEBUG("This event has " << data.tracks.size() << " tracks " << data.clusters.size() << " clusters ");
68 
69  unsigned int numMatches = matchAndCreateEflowCaloObj(data);
70 
71  if (msgLvl(MSG::DEBUG)) printAllClusters(*recClusterContainer);
72 
73  if (!m_calcEOverP){
75  else performSubtraction(numMatches,data);
76  }
77  else{
79  }
80 
81 }
82 
84 
85  //Counts up how many tracks found at least 1 calorimeter cluster matched to it.
86  unsigned int nMatches(0);
87 
88  /* Cache the original number of eflowCaloObjects, if there were any */
89  const unsigned int nCaloObj = data.caloObjects->size();
90  const EventContext &ctx = Gaudi::Hive::currentContext();
91 
92  /* loop tracks in data.tracks and do matching */
93  for (auto *thisEfRecTrack : data.tracks)
94  {
96  if (!thisEfRecTrack->hasBin()) {
97  std::unique_ptr<eflowCaloObject> thisEflowCaloObject = std::make_unique<eflowCaloObject>();
98  thisEflowCaloObject->addTrack(thisEfRecTrack);
99  data.caloObjects->push_back(std::move(thisEflowCaloObject));
100  continue;
101  }
102 
103  if (msgLvl(MSG::DEBUG))
104  {
105  const xAOD::TrackParticle *track = thisEfRecTrack->getTrack();
106  ATH_MSG_DEBUG("Matching track with e,pt, eta and phi " << track->e() << ", " << track->pt() << ", " << track->eta() << " and " << track->phi());
107  }
108 
109  std::vector<eflowTrackClusterLink*> bestClusters;
110  std::vector<float> deltaRPrime;
111 
112  if (!m_recoverSplitShowers){
117  std::vector<std::pair<eflowRecCluster *, float>> bestClusters_02 = m_theMatchingToolForPull_02->doMatches(thisEfRecTrack, data.clusters, -1);
118  for (auto &matchpair : bestClusters_02)
119  {
120  eflowRecCluster *theCluster = matchpair.first;
121  float distancesq = matchpair.second;
122  eflowTrackClusterLink *trackClusterLink = eflowTrackClusterLink::getInstance(thisEfRecTrack, theCluster, ctx);
123  if (distancesq < 0.15 * 0.15)
124  {
125  // Narrower cone is a subset of the selected clusters
126  // Distance returned is deltaR^2
127  thisEfRecTrack->addAlternativeClusterMatch(trackClusterLink, "cone_015");
128  }
129  thisEfRecTrack->addAlternativeClusterMatch(trackClusterLink, "cone_02");
130  }//loop over bestClusters_02
131 
132  //This matching scheme is used to match the calorimeter cluster(s) to be used in the charged showers subtraction for this track.
133  std::vector<std::pair<eflowRecCluster *, float>> matchedClusters = m_theMatchingTool->doMatches(thisEfRecTrack, data.clusters,m_nClusterMatchesToUse);
134  for (auto thePair : matchedClusters) {
135  bestClusters.push_back(eflowTrackClusterLink::getInstance(thisEfRecTrack, thePair.first, ctx));
136  if (m_addCPData) deltaRPrime.push_back(std::sqrt(thePair.second));
137  }
138  }
139  else {
140  const std::vector<eflowTrackClusterLink*>* matchedClusters_02 = thisEfRecTrack->getAlternativeClusterMatches("cone_02");
141  if (!matchedClusters_02) continue;
142  else bestClusters = *matchedClusters_02;
143  }
144 
145  if (bestClusters.empty()) continue;
146 
147  if (msgLvl(MSG::DEBUG))
148  {
149  for (auto *thisClusterLink : bestClusters ) {
150  xAOD::CaloCluster* thisCluster = thisClusterLink->getCluster()->getCluster();
151  ATH_MSG_DEBUG("Matched this track to cluster with e,pt, eta and phi " << thisCluster->e() << ", " << thisCluster->pt() << ", " << thisCluster->eta() << " and " << thisCluster->phi());
152  }
153  }
154 
155  nMatches++;
156 
157  //loop over the matched calorimeter clusters and associate tracks and clusters to each other as needed.
158  unsigned int linkIndex = 0;
159  for (auto *trkClusLink : bestClusters){
160 
161  eflowRecCluster *thisEFRecCluster = trkClusLink->getCluster();
162 
164  // Look up whether this cluster is intended for recovery
165  if (std::find(data.clusters.begin(), data.clusters.end(), trkClusLink->getCluster()) == data.clusters.end()) {
166  linkIndex++;
167  continue;
168  }
169  }
170 
171  eflowTrackClusterLink *trackClusterLink = eflowTrackClusterLink::getInstance(thisEfRecTrack, thisEFRecCluster, ctx);
172  thisEfRecTrack->addClusterMatch(trackClusterLink);
173  if (m_addCPData) thisEfRecTrack->addDeltaRPrime(deltaRPrime[linkIndex]);
174  thisEFRecCluster->addTrackMatch(trackClusterLink);
175  }
176  linkIndex++;
177  }
178 
179  /* Create 3 types eflowCaloObjects: track-only, cluster-only, track-cluster-link */
180  std::vector<eflowRecCluster *> clusters(data.clusters.begin(), data.clusters.end());
182  unsigned int nCaloObjects = eflowCaloObjectMaker::makeTrkCluCaloObjects(data.tracks, clusters, data.caloObjects);
183  ATH_MSG_DEBUG("Created " << nCaloObjects << " eflowCaloObjects.");
184  if (msgLvl(MSG::DEBUG)){
185  for (auto thisEFlowCaloObject : *(data.caloObjects)){
186  ATH_MSG_DEBUG("This eflowCaloObject has " << thisEFlowCaloObject->nTracks() << " tracks and " << thisEFlowCaloObject->nClusters() << " clusters ");
187  for (unsigned int count = 0; count < thisEFlowCaloObject->nTracks(); count++){
188  const xAOD::TrackParticle* thisTrack = thisEFlowCaloObject->efRecTrack(count)->getTrack();
189  ATH_MSG_DEBUG("Have track with e, pt, eta and phi of " << thisTrack->e() << ", " << thisTrack->pt() << ", " << thisTrack->eta() << " and " << thisTrack->phi());
190  }
191  for (unsigned int count = 0; count < thisEFlowCaloObject->nClusters(); count++){
192  const xAOD::CaloCluster* thisCluster = thisEFlowCaloObject->efRecCluster(count)->getCluster();
193  ATH_MSG_DEBUG("Have cluster with e, pt, eta and phi of " << thisCluster->e() << ", " << thisCluster->pt() << ", " << thisCluster->eta() << " and " << thisCluster->phi());
194  }
195  }
196  }
197 
198  const double gaussianRadius = 0.032;
199  const double gaussianRadiusError = 1.0e-3;
200  const double maximumRadiusSigma = 3.0;
201 
202  eflowLayerIntegrator integrator(gaussianRadius, gaussianRadiusError, maximumRadiusSigma, m_isHLLHC);
203 
205  if (!m_recoverSplitShowers && 0 != nCaloObj) ATH_MSG_WARNING("Not in Split Showers Mode and already have " << nCaloObj << " eflowCaloObjects");
206 
207  //For each eflowCaloObject we calculate the expected energy deposit in the calorimeter and cell ordering for subtraction.
208  for (unsigned int iCalo = nCaloObj; iCalo < data.caloObjects->size(); ++iCalo) {
209  eflowCaloObject* thisEflowCaloObject = data.caloObjects->at(iCalo);
210  thisEflowCaloObject->simulateShower(&integrator, m_binnedParameters.get(), true, m_useNNEnergy ? &(*m_NNEnergyPredictorTool) : nullptr, m_useLegacyEBinIndex);
211  }
212 
213  if (!m_recoverSplitShowers) return nMatches;
214  else return nCaloObj;
215 }
216 
217 void PFSubtractionTool::performSubtraction(const unsigned int& startingPoint,PFData &data) const{
218  unsigned int nEFCaloObs = data.caloObjects->size();
219  for (unsigned int iCalo = startingPoint; iCalo < nEFCaloObs; ++iCalo) {
220  eflowCaloObject* thisEflowCaloObject = data.caloObjects->at(iCalo);
221  this->performSubtraction(*thisEflowCaloObject);
222  }
223 }
224 
226 
227  ATH_MSG_DEBUG("In performSubtraction");
228 
229  unsigned int nClusters = thisEflowCaloObject.nClusters();
230  unsigned int nTrackMatches = thisEflowCaloObject.nTracks();
231 
232  ATH_MSG_DEBUG("Have got an eflowCaloObject with " << nClusters << " clusters and " << nTrackMatches << " track matches");
233 
234  if (msgLevel(MSG::DEBUG)){
235  for (unsigned int iTrack = 0; iTrack < nTrackMatches; ++iTrack){
236  eflowRecTrack* thisTrack = thisEflowCaloObject.efRecTrack(iTrack);
237  ATH_MSG_DEBUG("eflowCaloObject has track with E, pt and eta " << thisTrack->getTrack()->e() << ", " << thisTrack->getTrack()->pt() << " and " << thisTrack->getTrack()->eta());
238  }
239  }
240 
241  //To keep historical behaviour when in recover split showers mode allow tracks with no cluster matches to proceed.
242  if (!m_recoverSplitShowers && nClusters < 1) return;
243 
244  //Need at least one track in this eflowCaloObject to continue.
245  if (nTrackMatches < 1) return;
246 
247  double expectedEnergy = thisEflowCaloObject.getExpectedEnergy();
248  double clusterEnergy = thisEflowCaloObject.getClusterEnergy();
249  double expectedSigma = sqrt(thisEflowCaloObject.getExpectedVariance());
250 
251  /* Check e/p, if on first pass - return if e/p not consistent with expected e/p */
252  if (!m_recoverSplitShowers){
253  if (isEOverPFail(expectedEnergy, expectedSigma, clusterEnergy)) return;
254  }
255 
256  const std::vector<std::pair<eflowTrackClusterLink *, std::pair<float, float>>> &matchedTrackList = thisEflowCaloObject.efRecLink();
257 
258  ATH_MSG_DEBUG("Matched Track List has size " << matchedTrackList.size());
259 
260  if (msgLevel(MSG::DEBUG))
261  {
262  for (unsigned int iTrack = 0; iTrack < nTrackMatches; ++iTrack)
263  {
264  const xAOD::TrackParticle *thisTrack = thisEflowCaloObject.efRecTrack(iTrack)->getTrack();
265  ATH_MSG_DEBUG("eflowCaloObject has track match with E, pt and eta " << thisTrack->e() << ", " << thisTrack->pt() << " and " << thisTrack->eta());
266  }
267  }
268 
269  ATH_MSG_DEBUG("About to perform subtraction for this eflowCaloObject");
270 
271  bool wasAnnihilated = false;
272 
273  //First deal with non-split showers mode
274  if (!m_recoverSplitShowers){
275  /* Check if we can annihilate right away - true if matched cluster has only the expected energy deposit */
276  if (canAnnihilate(expectedEnergy, expectedSigma, clusterEnergy)){
277 
278  wasAnnihilated = true;
279 
280  std::vector<std::pair<xAOD::CaloCluster *, bool>> clusterList;
281  std::map<xAOD::CaloCluster *, double> clusterEnergyMap;
282  unsigned nCluster = thisEflowCaloObject.nClusters();
283  for (unsigned iCluster = 0; iCluster < nCluster; ++iCluster){
284  clusterList.emplace_back(thisEflowCaloObject.efRecCluster(iCluster)->getCluster(), false);
285  }
286 
287  ATH_MSG_DEBUG("We are going to annihilate. ExpectedEnergy, expectedSigma and clusterEnergy are " << expectedEnergy << ", " << expectedSigma << " and " << clusterEnergy);
288  if (msgLevel(MSG::DEBUG))
289  for (auto thisPair : clusterList)
290  ATH_MSG_DEBUG("Annihilating cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
291 
293  Subtractor::annihilateClusters(clusterList);
294 
295  if (msgLevel(MSG::DEBUG))
296  for (auto thisPair : clusterList)
297  ATH_MSG_DEBUG("Have Annihilated cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
298 
299  /* Flag all tracks in this system as subtracted */
300  for (unsigned iTrack = 0; iTrack < thisEflowCaloObject.nTracks(); ++iTrack){
301  eflowRecTrack *thisEfRecTrack = (matchedTrackList[iTrack].first)->getTrack();
302  if (!thisEfRecTrack->isSubtracted()) thisEfRecTrack->setSubtracted();
303  }
304 
305  }//if can annihilate this track-cluster systems matched cluster
306  }//split shower recovery mode or regular mode where above annihilation was not triggered
307  if (m_recoverSplitShowers || !wasAnnihilated){
308 
309  for (unsigned iTrack = 0; iTrack < thisEflowCaloObject.nTracks(); ++iTrack){
310 
311  eflowRecTrack *thisEfRecTrack = thisEflowCaloObject.efRecTrack(iTrack);
312 
313  ATH_MSG_DEBUG("About to subtract track with e, pt, eta and phi of " << thisEfRecTrack->getTrack()->e() << ", " << thisEfRecTrack->getTrack()->pt() << ", " << thisEfRecTrack->getTrack()->eta() << " and "
314  << thisEfRecTrack->getTrack()->eta());
315 
316  if (!thisEfRecTrack->hasBin()) continue;
317 
318  ATH_MSG_DEBUG("Have bin for this eflowCaloObject");
319 
320  if (thisEfRecTrack->isInDenseEnvironment() && !m_recoverSplitShowers) continue;
321 
322  ATH_MSG_DEBUG("Am not in dense environment for this eflowCaloObject");
323 
324  /* Get matched cluster via Links */
325  std::vector<eflowRecCluster *> matchedClusters;
326  std::vector<eflowTrackClusterLink *> links = thisEfRecTrack->getClusterMatches();
327  matchedClusters.reserve(links.size());
328  for (auto* thisEFlowTrackClusterLink : links)
329  matchedClusters.push_back(thisEFlowTrackClusterLink->getCluster());
331  std::sort(matchedClusters.begin(),
332  matchedClusters.end(),
334 
335  if (msgLvl(MSG::DEBUG)) {
336  for (auto* thisClus : matchedClusters)
338  "Haved matched cluster "
339  << thisClus->getCluster()->index() << " with e,pt, eta and phi of "
340  << thisClus->getCluster()->e() << ", "
341  << thisClus->getCluster()->pt() << ", "
342  << thisClus->getCluster()->eta() << " and "
343  << thisClus->getCluster()->phi() << " will be subtracted");
344  }
345 
346  /* Do subtraction */
347  std::vector<std::pair<xAOD::CaloCluster *, bool>> clusterSubtractionList;
348  clusterSubtractionList.reserve(matchedClusters.size());
349  std::map<xAOD::CaloCluster *, double> clusterEnergyMap;
350  for (auto *thisEFlowRecCluster : matchedClusters){
351  xAOD::CaloCluster *thisCluster = thisEFlowRecCluster->getCluster();
352  clusterSubtractionList.emplace_back(thisCluster, false);
353  clusterEnergyMap[thisCluster] = thisCluster->e();
354  }
355 
356  ATH_MSG_DEBUG("Have filled clusterSubtractionList for this eflowCaloObject");
357 
358  unsigned int trackIndex = thisEfRecTrack->getTrack()->index();
359 
360  //Previously we only checked this in recover split showers, but makes sense to check it in both passes.
361  auto sumClusEnergy = [](double accumulator, std::pair<xAOD::CaloCluster *, bool> thisPair){ return accumulator += thisPair.first->e();};
362  double totalClusterEnergy = std::accumulate(clusterSubtractionList.begin(),clusterSubtractionList.end(),0.0,sumClusEnergy);
363 
364  /* Check if we can annihilate right away - true if matched cluster has only the expected energy deposit */
365  if(canAnnihilate(thisEfRecTrack->getEExpect(),sqrt(thisEfRecTrack->getVarEExpect()),totalClusterEnergy)){
366 
367  if (msgLevel(MSG::DEBUG))
368  for (auto thisPair : clusterSubtractionList)
369  ATH_MSG_DEBUG("Annihilating cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
370 
371  Subtractor::annihilateClusters(clusterSubtractionList);
372  //Now we should mark all of these clusters as being subtracted
373  //Now need to mark which clusters were modified in the subtraction procedure
374  std::vector<std::pair<float, float>> clusterSubtractedEnergyRatios;
375  m_pfSubtractionEnergyRatioCalculator.calculateSubtractedEnergyRatiosForAnnih(clusterSubtractionList, clusterEnergyMap, clusterSubtractedEnergyRatios);
376  m_pfSubtractionStatusSetter.markSubtractionStatus(clusterSubtractionList, clusterSubtractedEnergyRatios, thisEflowCaloObject, trackIndex);
377  }
378  else
379  {
380 
381  /* Subtract the track from all matched clusters */
382  m_subtractor.subtractTracksFromClusters(thisEfRecTrack, clusterSubtractionList);
383 
384  //recalculate total cluster energy from the clusters afer subtraction
385  totalClusterEnergy = std::accumulate(clusterSubtractionList.begin(),clusterSubtractionList.end(),0.0,sumClusEnergy);
386 
387  /* Annihilate the cluster(s) if the remnant is small (i.e. below k*sigma) */
388  if (canAnnihilate(0.0,sqrt(thisEfRecTrack->getVarEExpect()), totalClusterEnergy)){
389 
390  if (msgLevel(MSG::DEBUG))
391  for (auto thisPair : clusterSubtractionList){
392  ATH_MSG_DEBUG("Annihilating remnant cluster with E and eta " << thisPair.first->e() << " and " << thisPair.first->eta());
393  }
394  eflowSubtract::Subtractor::annihilateClusters(clusterSubtractionList);
395  //Now we should mark all of these clusters as being subtracted
396  std::vector<std::pair<float, float>> clusterSubtractedEnergyRatios;
397  m_pfSubtractionEnergyRatioCalculator.calculateSubtractedEnergyRatiosForAnnih(clusterSubtractionList, clusterEnergyMap, clusterSubtractedEnergyRatios);
398  m_pfSubtractionStatusSetter.markSubtractionStatus(clusterSubtractionList, clusterSubtractedEnergyRatios, thisEflowCaloObject, trackIndex);
399  }//if remove the remnant after cell by cell subtraction
400  else
401  {
402  std::vector<std::pair<float, float>> clusterSubtractedEnergyRatios;
403  m_pfSubtractionEnergyRatioCalculator.calculateSubtractedEnergyRatios(clusterSubtractionList, clusterEnergyMap, clusterSubtractedEnergyRatios);
404  m_pfSubtractionStatusSetter.markSubtractionStatus(clusterSubtractionList, clusterSubtractedEnergyRatios, thisEflowCaloObject, trackIndex);
405  }//if don't remove the remnant after cell by cell subtraction
406 
407  }//if not annihilating, and instead subtracting cell by cell
408 
409  ATH_MSG_DEBUG("Have subtracted charged shower for this eflowRecTrack");
410 
411  /* Flag tracks as subtracted */
412  if (!thisEfRecTrack->isSubtracted()) thisEfRecTrack->setSubtracted();
413 
414  }//loop over tracks in eflowCaloObject
415  }//cell by cell subtraction
416 
417 }
418 
419 bool PFSubtractionTool::isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const
420 {
421  if ((expectedEnergy == 0) && (clusterEnergy > 0)) return false;
422  return clusterEnergy < expectedEnergy - m_consistencySigmaCut * sigma;
423 }
424 
425 bool PFSubtractionTool::canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const
426 {
427  return clusterEnergy - expectedEnergy < m_subtractionSigmaCut * sigma;
428 }
429 
431  std::stringstream result;
432  result << " track with E, eta and phi "<< track->e() << ", " << track->eta() << " and " << track->phi();
433  return result.str();
434 }
435 
437  std::stringstream result;
438  result << " cluster with E, eta and phi of " << cluster->e() << ", " << cluster->eta() << " and " << cluster->phi();
439  return result.str();
440 }
441 
442 void PFSubtractionTool::printAllClusters(const eflowRecClusterContainer& recClusterContainer) const {
443 
444  for ( const auto *thisEFRecCluster : recClusterContainer){
445  if (thisEFRecCluster->getTrackMatches().empty()) {
446  ATH_MSG_DEBUG("Isolated" << printCluster(thisEFRecCluster->getCluster()));
447  } else {
448  ATH_MSG_DEBUG("Matched" << printCluster(thisEFRecCluster->getCluster()));
449  std::vector<eflowTrackClusterLink*> theTrackLinks = thisEFRecCluster->getTrackMatches();
450  for ( auto *thisTrack : theTrackLinks){
451  ATH_MSG_DEBUG("Matched" << printTrack(thisTrack->getTrack()->getTrack()));
452  }
453  }
454  }
455 }
456 
457 
458 StatusCode PFSubtractionTool::finalize() { return StatusCode::SUCCESS; }
eflowRecCluster
This class extends the information about a xAOD::CaloCluster.
Definition: eflowRecCluster.h:40
xAOD::CaloCluster_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition: CaloCluster_v1.cxx:256
eflowRecCluster::SortDescendingPt
Definition: eflowRecCluster.h:124
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
eflowCaloObject::nClusters
unsigned nClusters() const
Definition: eflowCaloObject.h:59
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
eflowSubtract::Subtractor::subtractTracksFromClusters
void subtractTracksFromClusters(eflowRecTrack *efRecTrack, std::vector< std::pair< xAOD::CaloCluster *, bool >> &clusterSubtractionList) const
Definition: eflowSubtractor.cxx:27
eflowCaloObject::getExpectedEnergy
double getExpectedEnergy() const
Definition: eflowCaloObject.cxx:40
eflowEEtaBinnedParameters
Inherits from eflowEEtaBinBase.
Definition: eflowEEtaBinnedParameters.h:56
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
IEFlowCellEOverPTool.h
eflowLayerIntegrator
This class calculates the LHED (Layer of Highest Energy Density) in a cluster or group of clusters.
Definition: eflowLayerIntegrator.h:35
get_generator_info.result
result
Definition: get_generator_info.py:21
eflowCaloObject::efRecLink
const std::vector< std::pair< eflowTrackClusterLink *, std::pair< float, float > > > & efRecLink() const
Definition: eflowCaloObject.h:64
PFSubtractionTool::m_isHLLHC
Gaudi::Property< bool > m_isHLLHC
Toggle whether we have the HLLHC setup.
Definition: PFSubtractionTool.h:82
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
PFSubtractionTool::m_subtractor
eflowSubtract::Subtractor m_subtractor
Definition: PFSubtractionTool.h:100
eflowSubtract
Definition: eflowSubtractor.h:27
eflowRecTrack::isInDenseEnvironment
bool isInDenseEnvironment() const
Definition: eflowRecTrack.h:116
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
PFClusterFiller::fillClustersToRecover
static void fillClustersToRecover(PFData &data)
Definition: PFClusterFiller.cxx:5
eflowRecCluster::addTrackMatch
void addTrackMatch(eflowTrackClusterLink *trackMatch)
Definition: eflowRecCluster.h:69
PFSubtractionEnergyRatioCalculator::calculateSubtractedEnergyRatios
void calculateSubtractedEnergyRatios(const std::vector< std::pair< xAOD::CaloCluster *, bool >> &clusterSubtractionList, std::map< xAOD::CaloCluster *, double > &clusterEnergyMap, std::vector< std::pair< float, float >> &clusterSubtractedEnergyRatios) const
For each xAOD::CaloCluster in clusterSubtractionList we calculate the ratio of new to old energy afte...
Definition: PFSubtractionEnergyRatioCalculator.cxx:13
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
PFSubtractionTool::m_NNEnergyPredictorTool
ToolHandle< PFEnergyPredictorTool > m_NNEnergyPredictorTool
Tool for getting predictiing the energy using an ONNX model.
Definition: PFSubtractionTool.h:103
PFSubtractionStatusSetter::markAllTracksAnnihStatus
void markAllTracksAnnihStatus(eflowCaloObject &thisEflowCaloObject) const
Set the ratio of new to old cluster energy, to zero, for all cluster matched to all tracks attached t...
Definition: PFSubtractionStatusSetter.cxx:71
eflowRecClusterContainer
Definition: eflowRecCluster.h:275
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
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:88
eflowRecTrack::hasBin
bool hasBin() const
Definition: eflowRecTrack.h:73
PFSubtractionTool::m_trkpos
std::unique_ptr< PFMatch::TrackEtaPhiInFixedLayersProvider > m_trkpos
Track position provider to be used to preselect clusters.
Definition: PFSubtractionTool.h:66
PFSubtractionTool.h
PFSubtractionTool::matchAndCreateEflowCaloObj
unsigned int matchAndCreateEflowCaloObj(PFData &data) const
This matches ID tracks and CaloClusters, and then creates eflowCaloObjects.
Definition: PFSubtractionTool.cxx:83
eflowCaloObject
An internal EDM object which stores information about systems of associated tracks and calorimeter cl...
Definition: eflowCaloObject.h:33
eflowCaloObjectMaker.h
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
PFMatch::TrackPositionFactory::Get
static std::unique_ptr< IPositionProvider > Get(const std::string &positionType)
Definition: PFMatchPositions.h:95
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
eflowCaloObject::getExpectedVariance
double getExpectedVariance() const
Definition: eflowCaloObject.cxx:48
eflowCaloObject::addTrack
void addTrack(eflowRecTrack *track)
Definition: eflowCaloObject.h:39
eflowRecTrack
This class extends the information about a xAOD::Track.
Definition: eflowRecTrack.h:45
PFTrackFiller
Definition: PFTrackFiller.h:7
PFSubtractionTool::m_pfSubtractionStatusSetter
PFSubtractionStatusSetter m_pfSubtractionStatusSetter
Definition: PFSubtractionTool.h:98
eflowRecTrack::setSubtracted
void setSubtracted()
Definition: eflowRecTrack.h:81
eflowRecTrack::getClusterMatches
const std::vector< eflowTrackClusterLink * > & getClusterMatches() const
Definition: eflowRecTrack.h:66
PFSubtractionTool::m_theEOverPTool
ToolHandle< IEFlowCellEOverPTool > m_theEOverPTool
Tool for getting e/p values and hadronic shower cell ordering principle parameters.
Definition: PFSubtractionTool.h:61
eflowLayerIntegrator.h
eflowRecTrack.h
PFSubtractionTool::m_useNNEnergy
Gaudi::Property< bool > m_useNNEnergy
Toggle whether we use the neural net energy.
Definition: PFSubtractionTool.h:106
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
eflowCaloObject::efRecTrack
const eflowRecTrack * efRecTrack(int i) const
Definition: eflowCaloObject.h:51
PFSubtractionTool::execute
void execute(eflowCaloObjectContainer *theEflowCaloObjectContainer, eflowRecTrackContainer *recTrackContainer, eflowRecClusterContainer *recClusterContainer) const
Definition: PFSubtractionTool.cxx:52
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:79
PFSubtractionTool::printAllClusters
void printAllClusters(const eflowRecClusterContainer &recClusterContainer) const
Definition: PFSubtractionTool.cxx:442
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
PFSubtractionTool::isEOverPFail
bool isEOverPFail(double expectedEnergy, double sigma, double clusterEnergy) const
Definition: PFSubtractionTool.cxx:419
xAOD::CaloCluster_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition: CaloCluster_v1.cxx:251
PFSubtractionTool::m_pfCalc
PFCalcRadialEnergyProfiles m_pfCalc
Definition: PFSubtractionTool.h:97
PFSubtractionTool::performSubtraction
void performSubtraction(const unsigned int &startingPoint, PFData &data) const
Definition: PFSubtractionTool.cxx:217
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
eflowRecTrack::isSubtracted
bool isSubtracted() const
Definition: eflowRecTrack.h:79
DMTest::links
links
Definition: CLinks_v1.cxx:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PFSubtractionTool::initialize
StatusCode initialize()
Definition: PFSubtractionTool.cxx:23
PFSubtractionTool::PFSubtractionTool
PFSubtractionTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PFSubtractionTool.cxx:15
PFSubtractionTool::m_theMatchingToolForPull_02
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingToolForPull_02
Definition: PFSubtractionTool.h:73
PFClusterFiller
Definition: PFClusterFiller.h:7
PFCalcRadialEnergyProfiles::calculate
void calculate(const PFData &data) const
Definition: PFCalcRadialEnergyProfiles.cxx:11
PFSubtractionStatusSetter::markSubtractionStatus
void markSubtractionStatus(const std::vector< std::pair< xAOD::CaloCluster *, bool >> &clusterList, std::vector< std::pair< float, float >> &clusterSubtractedEnergyRatios, eflowCaloObject &thisEflowCaloObject, unsigned int trackIndex) const
Set the ratio of new to old cluster energy for each cluster matched to a track with trackIndex.
Definition: PFSubtractionStatusSetter.cxx:17
PFSubtractionEnergyRatioCalculator::calculateSubtractedEnergyRatiosForAnnih
void calculateSubtractedEnergyRatiosForAnnih(const std::vector< std::pair< xAOD::CaloCluster *, bool >> &clusterSubtractionList, std::map< xAOD::CaloCluster *, double > &clusterEnergyMap, std::vector< std::pair< float, float >> &clusterSubtractedEnergyRatios) const
If we have decided to annihiliate all clusters in clusterSubtractionList we use this function to set ...
Definition: PFSubtractionEnergyRatioCalculator.cxx:49
eflowRecTrack::getEExpect
double getEExpect() const
Definition: eflowRecTrack.h:97
asg::AsgMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessaging.cxx:49
PFSubtractionTool::m_calcEOverP
Gaudi::Property< bool > m_calcEOverP
Toggle EOverP algorithm mode, whereby no charged shower subtraction is performed.
Definition: PFSubtractionTool.h:85
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
eflowRecCluster::getCluster
xAOD::CaloCluster * getCluster()
Definition: eflowRecCluster.h:49
eflowCaloObject::nTracks
unsigned nTracks() const
Definition: eflowCaloObject.h:53
PFSubtractionTool::~PFSubtractionTool
~PFSubtractionTool()
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
eflowSubtract::Subtractor::m_facilitator
eflowCellSubtractionFacilitator m_facilitator
Definition: eflowSubtractor.h:56
PFData
Definition: PFData.h:11
PFSubtractionTool::m_pfSubtractionEnergyRatioCalculator
PFSubtractionEnergyRatioCalculator m_pfSubtractionEnergyRatioCalculator
Definition: PFSubtractionTool.h:99
PFSubtractionTool::m_recoverSplitShowers
Gaudi::Property< bool > m_recoverSplitShowers
Toggle whether we are recovering split showers or not.
Definition: PFSubtractionTool.h:76
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:113
PFSubtractionTool::printTrack
static std::string printTrack(const xAOD::TrackParticle *track)
Definition: PFSubtractionTool.cxx:430
xAOD::CaloCluster_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
Definition: CaloCluster_v1.cxx:247
eflowRecTrack::getTrack
const xAOD::TrackParticle * getTrack() const
Definition: eflowRecTrack.h:53
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
eflowCaloObject.h
eflowCaloObjectMaker::makeTrkCluCaloObjects
static unsigned int makeTrkCluCaloObjects(eflowRecTrackContainer *eflowTrackContainer, eflowRecClusterContainer *eflowClusterContainer, eflowCaloObjectContainer *caloObjectContainer)
Definition: eflowCaloObjectMaker.cxx:25
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:91
PFClusterFiller::fillClustersToConsider
static void fillClustersToConsider(PFData &data, eflowRecClusterContainer &recClusterContainer)
Definition: PFClusterFiller.cxx:25
xAOD::TrackParticle_v1::e
virtual double e() const override final
The total energy of the particle.
Definition: TrackParticle_v1.cxx:109
PFSubtractionTool::canAnnihilate
bool canAnnihilate(double expectedEnergy, double sigma, double clusterEnergy) const
Definition: PFSubtractionTool.cxx:425
eflowRecTrackContainer
Definition: eflowRecTrack.h:194
PFTrackFiller::fillTracksToConsider
static void fillTracksToConsider(PFData &data, eflowRecTrackContainer &recTrackContainer)
Definition: PFTrackFiller.cxx:57
eflowCaloObject::simulateShower
void simulateShower(eflowLayerIntegrator *integrator, const eflowEEtaBinnedParameters *binnedParameters, bool useUpdated2015ChargedShowerSubtraction, const PFEnergyPredictorTool *energyP, bool useLegacyEnergyBinIndexing)
Definition: eflowCaloObject.cxx:64
PFSubtractionTool::m_theMatchingTool
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingTool
Default track-cluster matching tool.
Definition: PFSubtractionTool.h:69
PFSubtractionTool::printCluster
static std::string printCluster(const xAOD::CaloCluster *cluster)
Definition: PFSubtractionTool.cxx:436
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
eflowCaloObject::efRecCluster
const eflowRecCluster * efRecCluster(int i) const
Definition: eflowCaloObject.h:57
eflowRecTrack::getVarEExpect
double getVarEExpect() const
Definition: eflowRecTrack.h:98
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
PFMatch::TrackEtaPhiInFixedLayersProvider
Definition: PFMatchPositions.h:76
PFSubtractionTool::m_binnedParameters
std::unique_ptr< eflowEEtaBinnedParameters > m_binnedParameters
Definition: PFSubtractionTool.h:63
PFSubtractionTool::m_theMatchingToolForPull_015
ToolHandle< PFTrackClusterMatchingTool > m_theMatchingToolForPull_015
Definition: PFSubtractionTool.h:72
PFSubtractionTool::finalize
StatusCode finalize()
Definition: PFSubtractionTool.cxx:458
eflowCaloObject::getClusterEnergy
double getClusterEnergy() const
Definition: eflowCaloObject.cxx:56
egammaParameters::linkIndex
@ linkIndex
link index for multiple track and vertex matches
Definition: egammaParamDefs.h:574
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
PFTrackFiller::fillTracksToRecover
static void fillTracksToRecover(PFData &data)
Definition: PFTrackFiller.cxx:5
PFClusterFiller.h
PFTrackFiller.h
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:94
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
xAOD::CaloCluster_v1::e
virtual double e() const
The total energy of the particle.
Definition: CaloCluster_v1.cxx:265
eflowEEtaBinnedParameters.h
xAOD::TrackParticle_v1::phi
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
eflowSubtract::Subtractor::annihilateClusters
static void annihilateClusters(std::vector< std::pair< xAOD::CaloCluster *, bool >> &clusters)
Definition: eflowSubtractor.cxx:78