ATLAS Offline Software
JetParticleShrinkingConeAssociation.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // author: cpollard@cern.ch
6 
8 #include "AsgMessaging/Check.h"
9 
10 using namespace std;
11 using namespace xAOD;
12 
15 
16  declareProperty("coneSizeFitPar1", m_coneSizeFitPar1=0);
17  declareProperty("coneSizeFitPar2", m_coneSizeFitPar2=0);
18  declareProperty("coneSizeFitPar3", m_coneSizeFitPar3=0);
19 
20  return;
21  }
22 
23 
24 const vector<vector<ElementLink<IParticleContainer> > >*
26 
27  vector<vector<ElementLink<IParticleContainer> > >* matchedparts =
28  new vector<vector<ElementLink<IParticleContainer> > >(jets.size());
29 
30 
31  for (xAOD::IParticleContainer::const_iterator part_itr = parts.begin();
32  part_itr != parts.end(); ++part_itr) {
33 
34  const xAOD::IParticle& part = **part_itr;
35 
36  double drmin = -1;
37  int matchjetidx = -1;
38  for (unsigned int iJet = 0; iJet < jets.size(); iJet++) {
39  const xAOD::Jet& jet = *jets[iJet];
40 
41  double match_dr = coneSize(jet.pt());
42  double dr = jet.p4().DeltaR(part.p4());
43 
44  if (dr > match_dr)
45  continue;
46 
47  // if there is more than one matching jet, take the
48  // closest
49  if (drmin < 0 || dr < drmin) {
50  drmin = dr;
51  matchjetidx = iJet;
52  }
53  }
54 
55 
56  if (matchjetidx >= 0) {
58  EL.toContainedElement(parts, *part_itr);
59  (*matchedparts)[matchjetidx].push_back(EL);
60  }
61  }
62 
63 
64  return matchedparts;
65 }
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
DMTest::EL
ElementLink< CVec > EL
Definition: xAODTestWriteCLinks.cxx:22
JetParticleShrinkingConeAssociation::m_coneSizeFitPar1
double m_coneSizeFitPar1
Definition: JetParticleShrinkingConeAssociation.h:30
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Check.h
JetParticleAssociation
Definition: JetParticleAssociation.h:22
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
JetParticleShrinkingConeAssociation::JetParticleShrinkingConeAssociation
JetParticleShrinkingConeAssociation(const std::string &name)
Definition: JetParticleShrinkingConeAssociation.cxx:13
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
JetParticleShrinkingConeAssociation.h
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
JetParticleShrinkingConeAssociation::match
virtual const std::vector< std::vector< ElementLink< xAOD::IParticleContainer > > > * match(const xAOD::JetContainer &, const xAOD::IParticleContainer &) const override
Definition: JetParticleShrinkingConeAssociation.cxx:25
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
JetParticleShrinkingConeAssociation::coneSize
double coneSize(double pt) const
Definition: JetParticleShrinkingConeAssociation.h:24
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetParticleShrinkingConeAssociation::m_coneSizeFitPar2
double m_coneSizeFitPar2
Definition: JetParticleShrinkingConeAssociation.h:31
doL1CaloHVCorrections.parts
parts
Definition: doL1CaloHVCorrections.py:334
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
JetParticleShrinkingConeAssociation::m_coneSizeFitPar3
double m_coneSizeFitPar3
Definition: JetParticleShrinkingConeAssociation.h:32