![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
23 #define GeVtoMeV 1000.0
44 return StatusCode::SUCCESS;
55 if (!truthEventContainerReadHandle.
isValid()){
56 ATH_MSG_DEBUG(
" Invalid ReadHandle for xAOD::TruthEventContainer with key: " << truthEventContainerReadHandle.
key());
69 TLorentzVector jet_hlv = myJet.
p4();
71 ATH_MSG_DEBUG(
"Truth matching for jet " << myJet.
pt() <<
" " << myJet.
eta() <<
" " << myJet.
phi() <<
" using pile-up event selection " <<
m_inTime);
75 int NEventInCollection = truthEventContainer->
size();
77 info->NEventInCollection =NEventInCollection;
82 double deltaRC = 999.;
83 double deltaRB = 999.;
84 double deltaRT = 999.;
88 unsigned int nLab = 0;
94 for (; itEvt != itEvtE; ++itEvt) {
96 std::vector<ElementLink<xAOD::TruthParticleContainer> >::const_iterator ELpitr = GenEvent->
truthParticleLinks().begin();
97 std::vector<ElementLink<xAOD::TruthParticleContainer> >::const_iterator pitrE = GenEvent->
truthParticleLinks().end();
98 for (; ELpitr != pitrE; ++ELpitr) {
100 if(!pitr.
isValid() || !(*pitr)) {
105 int pdg = (*pitr)->pdgId();
108 TLorentzVector part_momentum_lv = (*pitr)->p4();
111 if (std::abs(pdg) == 5 || std::abs(pdg) == 4) {
112 double pt = part_momentum_lv.Pt();
117 <<
" pT= " <<part_momentum_lv.Pt()
118 <<
" eta= " <<part_momentum_lv.Eta()
119 <<
" phi= " <<part_momentum_lv.Phi()
120 <<
" dR= " <<part_momentum_lv.DeltaR(jet_hlv));
122 bool afterFSR =
true;
123 if ((*pitr)->hasDecayVtx()) {
124 std::vector<ElementLink<xAOD::TruthParticleContainer> >::const_iterator firstChild = (*pitr)->decayVtx()->outgoingParticleLinks().begin();
125 std::vector<ElementLink<xAOD::TruthParticleContainer> >::const_iterator endChild = (*pitr)->decayVtx()->outgoingParticleLinks().begin();
126 std::vector<ElementLink<xAOD::TruthParticleContainer> >::const_iterator thisChild = firstChild;
127 for(; thisChild != endChild; ++thisChild){
128 if(!thisChild->isValid() || !(**thisChild)) {
133 if ((**thisChild)->pdgId() == pdg) afterFSR =
false;
142 deltaR=part_momentum_lv.DeltaR(jet_hlv);
148 if (std::abs(pdg) == 15) {
149 double pt = part_momentum_lv.Pt();
152 <<
" pT= " <<part_momentum_lv.Pt()
153 <<
" eta= " <<part_momentum_lv.Eta()
154 <<
" phi= " <<part_momentum_lv.Phi()
155 <<
" dR= " <<part_momentum_lv.DeltaR(jet_hlv) );
156 deltaR=part_momentum_lv.DeltaR(jet_hlv);
163 ATH_MSG_DEBUG(
"Number of events in the EventCollection : " << NEventInCollection <<
" and used for labelling " << nLab);
166 info->distanceToQuarks.insert(std::make_pair(
"B",deltaRB));
167 info->distanceToQuarks.insert(std::make_pair(
"C",deltaRC));
168 info->distanceToQuarks.insert(std::make_pair(
"T",deltaRT));
170 ATH_MSG_VERBOSE(
"DeltaR " << deltaRB <<
" " << deltaRC <<
" " << deltaRT);
174 info->barcode = barcb;
177 ATH_MSG_VERBOSE(
"Jet matched with a b "<<barcb<<
" after FSR, dR: " << deltaRB);
180 if (LabellingParticle == 0) {
181 ATH_MSG_WARNING(
"A b labelled jet without a labelling particle ? Should not exist");
188 info->barcode = barcc;
191 ATH_MSG_VERBOSE(
"Jet matched with a c "<<barcc<<
" after FSR, dR: " << deltaRC);
Const iterator class for DataVector/DataList.
double m_deltaRCut
deltaR cut value of the cone matching (max distance between Jet axis and momentum of truth particel)
const_pointer_type cptr()
Dereference the pointer.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool testJet(const xAOD::Jet &, const xAOD::TruthEventContainer *, MatchInfo *info) const
virtual double phi() const
The azimuthal angle ( ) of the particle.
#define ATH_MSG_VERBOSE(x)
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
bool isValid() const
Test to see if the link can be dereferenced.
constexpr int SPECIALSTATUS
Constant that the meaning of which is currently lost, to be recovered...
JetQuarkLabel(const std::string &name)
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
SG::ReadHandleKey< xAOD::TruthEventContainer > m_truthEventContainerKey
Class describing a signal truth event in the MC record.
virtual bool matchJet(const xAOD::Jet &myJet, MatchInfo *info=nullptr) const override
AlgTool interface methods.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual double eta() const
The pseudorapidity ( ) of the particle.
constexpr int UNDEFINED_ID
ElementLink implementation for ROOT usage.
The namespace of all packages in PhysicsAnalysis/JetTagging.
#define GeVtoMeV
Purpose: label jets with b or c quarks.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
#define ATH_MSG_WARNING(x)
double m_ptCut
pT cut for partons
const TruthParticleLinks_t & truthParticleLinks() const
Get all the truth particles.
virtual double pt() const
The transverse momentum ( ) of the particle.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual void printParameterSettings() const override
print parameter settings of the truth match tool
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.