ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::BoostedTTbarSkimmingToolAlg Class Reference

Skimming tool that requires exactly one lepton and truth-level m_ttbar > cut. More...

#include <BoostedTTbarSkimmingToolAlg.h>

Inheritance diagram for DerivationFramework::BoostedTTbarSkimmingToolAlg:
Collaboration diagram for DerivationFramework::BoostedTTbarSkimmingToolAlg:

Public Member Functions

 BoostedTTbarSkimmingToolAlg (const std::string &t, const std::string &n, const IInterface *p)
virtual ~BoostedTTbarSkimmingToolAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual bool eventPassesFilter (const EventContext &ctx) const override
 Returns true if event passes the filter.

Public Attributes

Gaudi::Property< double > m_ttbarCut {this, "ttbarCut", 0.0, "ttbar mass cut"}
 Property: m_ttbar cut in MeV.

Private Attributes

std::atomic< unsigned int > m_ntot {0}
std::atomic< unsigned int > m_npass {0}

Detailed Description

Skimming tool that requires exactly one lepton and truth-level m_ttbar > cut.

Definition at line 18 of file BoostedTTbarSkimmingToolAlg.h.

Constructor & Destructor Documentation

◆ BoostedTTbarSkimmingToolAlg()

DerivationFramework::BoostedTTbarSkimmingToolAlg::BoostedTTbarSkimmingToolAlg ( const std::string & t,
const std::string & n,
const IInterface * p )

Definition at line 11 of file BoostedTTbarSkimmingToolAlg.cxx.

15 : base_class(t, n, p)
16{
17}

◆ ~BoostedTTbarSkimmingToolAlg()

virtual DerivationFramework::BoostedTTbarSkimmingToolAlg::~BoostedTTbarSkimmingToolAlg ( )
virtualdefault

Member Function Documentation

◆ eventPassesFilter()

bool DerivationFramework::BoostedTTbarSkimmingToolAlg::eventPassesFilter ( const EventContext & ctx) const
overridevirtual

Returns true if event passes the filter.

Definition at line 25 of file BoostedTTbarSkimmingToolAlg.cxx.

26{
27 ++m_ntot;
28
29
30 const xAOD::TruthParticleContainer* truth = nullptr;
31 if (evtStore()->retrieve(truth, "TruthParticles").isFailure()) {
32 ATH_MSG_ERROR("Failed to retrieve TruthParticles");
33 return false;
34 }
35
36 TLorentzVector top, antitop;
37
38 for (const auto* p : *truth) {
39 if (std::abs(p->pdgId()) != 6) continue;
40
41 bool hasW = false;
42 bool hasB = false;
43 for (unsigned int ic = 0; ic < p->nChildren(); ++ic) {
44 const xAOD::TruthParticle* child = p->child(ic);
45 if (!child) continue;
46 if (std::abs(child->pdgId()) == 24) hasW = true;
47 if (std::abs(child->pdgId()) == 5) hasB = true;
48 }
49 if (!hasW || !hasB) continue;
50
51 TLorentzVector vec;
52 vec.SetPtEtaPhiM(p->pt(), p->eta(), p->phi(), p->m());
53 if (p->pdgId() > 0) top = vec;
54 else antitop = vec;
55 }
56
57 double mass_ttbar = -1.;
58 if (top.Pt() > 0 && antitop.Pt() > 0) mass_ttbar = (top + antitop).M();
59
60 if (mass_ttbar <= m_ttbarCut) return false;
61
62 ++m_npass;
63 return true;
64}
#define ATH_MSG_ERROR(x)
std::vector< size_t > vec
Gaudi::Property< double > m_ttbarCut
Property: m_ttbar cut in MeV.
int pdgId() const
PDG ID code.
int ic
Definition grepfile.py:33
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.

◆ finalize()

StatusCode DerivationFramework::BoostedTTbarSkimmingToolAlg::finalize ( )
overridevirtual

Definition at line 19 of file BoostedTTbarSkimmingToolAlg.cxx.

20{
21 ATH_MSG_INFO("Processed "<< m_ntot <<" events, "<< m_npass<<" events passed filter ");
22 return StatusCode::SUCCESS;
23}
#define ATH_MSG_INFO(x)

◆ initialize()

virtual StatusCode DerivationFramework::BoostedTTbarSkimmingToolAlg::initialize ( )
inlineoverridevirtual

Definition at line 24 of file BoostedTTbarSkimmingToolAlg.h.

24{ return StatusCode::SUCCESS; }

Member Data Documentation

◆ m_npass

std::atomic<unsigned int> DerivationFramework::BoostedTTbarSkimmingToolAlg::m_npass {0}
mutableprivate

Definition at line 35 of file BoostedTTbarSkimmingToolAlg.h.

35{0};

◆ m_ntot

std::atomic<unsigned int> DerivationFramework::BoostedTTbarSkimmingToolAlg::m_ntot {0}
mutableprivate

Definition at line 34 of file BoostedTTbarSkimmingToolAlg.h.

34{0};

◆ m_ttbarCut

Gaudi::Property<double> DerivationFramework::BoostedTTbarSkimmingToolAlg::m_ttbarCut {this, "ttbarCut", 0.0, "ttbar mass cut"}

Property: m_ttbar cut in MeV.

Definition at line 31 of file BoostedTTbarSkimmingToolAlg.h.

31{this, "ttbarCut", 0.0, "ttbar mass cut"};

The documentation for this class was generated from the following files: