|
ATLAS Offline Software
|
Go to the documentation of this file.
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);
91 for (
unsigned int iJet = 0; iJet <
jets.size(); iJet++) {
118 .b = jetlabelpartsb.at(iJet),
119 .c = jetlabelpartsc.at(iJet),
120 .tau = jetlabelpartstau.at(iJet),
126 return StatusCode::SUCCESS;
130 vector<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++) {
167 double pt =
jet.pt();
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;
std::unique_ptr< ParticleJetTools::IParticleLinker > m_blinker
std::unique_ptr< ParticleJetTools::IParticleLinker > m_taulinker
Const iterator class for DataVector/DataList.
std::vector< std::vector< const xAOD::TruthParticle * > > match(const xAOD::TruthParticleContainer &parts, const xAOD::JetContainer &jets) const
Basic data class defines behavior for all Jet objects The Jet class is the principal data class for...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_bottomPartCollectionKey
StatusCode decorate(const xAOD::JetContainer &jets) const override
Decorate a jet collection without otherwise modifying it.
std::unique_ptr< ParticleJetTools::IParticleLinker > m_clinker
void declareProperties(T &tool, LabelNames *n)
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define ATH_MSG_VERBOSE(x)
std::string m_matchmode
Matching mode: can be MinDR or MaxPt.
std::string m_taulabelname
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_charmPartCollectionKey
ParticleJetTools::LabelNames m_labelnames
Name of jet label attributes.
::StatusCode StatusCode
StatusCode definition for legacy code.
ParticleJetDeltaRLabelTool(const std::string &name)
Constructor.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_tauPartCollectionKey
Read handles particle collections for labeling.
double m_drmax
Maximum dR for matching criterion.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode initialize() override
Dummy implementation of the initialisation function.
void childrenRemoved(const std::vector< const xAOD::TruthParticle * > &parents, std::vector< const xAOD::TruthParticle * > &children)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::unique_ptr< ParticleJetTools::LabelDecorators > m_labeldecs
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventsKey
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Amg::Vector3D signalProcessP3(const xAOD::TruthEventContainer &)
double m_jetptmin
Minimum pT for jet selection (in MeV)
void setJetLabels(const xAOD::Jet &jet, const Particles &particles, const LabelNames &names)
double m_partptmin
Minimum pT for particle selection (in MeV)
std::string m_bottomlabelname
std::string m_charmlabelname