25 "In the case that a particle matches two jets, the closest (MatchMode=MinDR) or highest-pT (MatchMode=MaxPt) jet will be labeled");
49 return StatusCode::SUCCESS;
65 if (!truthtausReadHandle.
isValid()){
66 ATH_MSG_ERROR(
" Invalid ReadHandle for xAOD::ParticleContainer with key: " << truthtausReadHandle.
key());
67 return StatusCode::FAILURE;
70 if (!truthbsReadHandle.
isValid()){
71 ATH_MSG_ERROR(
" Invalid ReadHandle for xAOD::ParticleContainer with key: " << truthbsReadHandle.
key());
72 return StatusCode::FAILURE;
75 if (!truthcsReadHandle.
isValid()){
76 ATH_MSG_ERROR(
" Invalid ReadHandle for xAOD::ParticleContainer with key: " << truthcsReadHandle.
key());
77 return StatusCode::FAILURE;
80 if (!truthEventsHandle.
isValid()){
81 ATH_MSG_ERROR(
" Invalid ReadHandle for TruthEvents with key: " << truthEventsHandle.
key());
82 return StatusCode::FAILURE;
85 vector<vector<const TruthParticle*> > jetlabelpartsb =
match(*truthbsReadHandle, jets);
86 vector<vector<const TruthParticle*> > jetlabelpartsc =
match(*truthcsReadHandle, jets);
87 vector<vector<const TruthParticle*> > jetlabelpartstau =
match(*truthtausReadHandle, jets);
89 Amg::Vector3D origin = pjt::signalProcessP3(*truthEventsHandle);
91 for (
unsigned int iJet = 0; iJet < jets.size(); iJet++) {
97 childrenRemoved(jetlabelpartsb[iJet], jetlabelpartsb[iJet]);
98 childrenRemoved(jetlabelpartsb[iJet], jetlabelpartsc[iJet]);
99 childrenRemoved(jetlabelpartsc[iJet], jetlabelpartsc[iJet]);
102 const Jet&
jet = *jets.at(iJet);
118 .b = jetlabelpartsb.at(iJet),
119 .c = jetlabelpartsc.at(iJet),
120 .tau = jetlabelpartstau.at(iJet),
126 return StatusCode::SUCCESS;
130vector<vector<const TruthParticle*> >
137 vector<vector<const TruthParticle*> > jetlabelparts(jets.size(), vector<const TruthParticle*>());
147 return jetlabelparts;
152 part_itr != parts.end(); ++part_itr) {
159 double mindr = DBL_MAX;
161 int mindrjetidx = -1;
162 int maxptjetidx = -1;
163 for (
unsigned int iJet = 0; iJet < jets.size(); iJet++) {
165 const Jet&
jet = *jets.at(iJet);
167 double pt =
jet.pt();
171 double dr =
jet.p4().DeltaR(part->p4());
189 if (mindrmatch && mindrjetidx >= 0)
190 jetlabelparts.at(mindrjetidx).push_back(part);
191 else if (maxptjetidx >= 0)
192 jetlabelparts.at(maxptjetidx).push_back(part);
195 return jetlabelparts;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
DataModel_detail::const_iterator< DataVector > const_iterator
std::vector< std::vector< const xAOD::TruthParticle * > > match(const xAOD::TruthParticleContainer &parts, const xAOD::JetContainer &jets) const
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_charmPartCollectionKey
ParticleJetDeltaRLabelTool(const std::string &name)
Constructor.
std::string m_taulabelname
std::unique_ptr< ParticleJetTools::IParticleLinker > m_blinker
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventsKey
ParticleJetTools::LabelNames m_labelnames
Name of jet label attributes.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_bottomPartCollectionKey
double m_jetptmin
Minimum pT for jet selection (in MeV)
std::string m_charmlabelname
std::string m_bottomlabelname
StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
double m_drmax
Maximum dR for matching criterion.
std::unique_ptr< ParticleJetTools::IParticleLinker > m_clinker
std::string m_matchmode
Matching mode: can be MinDR or MaxPt.
std::unique_ptr< ParticleJetTools::LabelDecorators > m_labeldecs
double m_partptmin
Minimum pT for particle selection (in MeV)
StatusCode initialize() override
Dummy implementation of the initialisation function.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_tauPartCollectionKey
Read handles particle collections for labeling.
std::unique_ptr< ParticleJetTools::IParticleLinker > m_taulinker
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
(HepMC) Monte Carlo particle.
Eigen::Matrix< double, 3, 1 > Vector3D
void setJetLabels(const xAOD::Jet &jet, const Particles &particles, const LabelNames &names)
void childrenRemoved(const std::vector< const xAOD::TruthParticle * > &parents, std::vector< const xAOD::TruthParticle * > &children)
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
JetContainer_v1 JetContainer
Definition of the current "jet container version".