ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
top::Sonnenschein Class Reference

An AnalysisTop friendly wrapper for the Sonnenschein reconstruction that is implemented in SonnenscheinEngine. More...

#include <Sonnenschein.h>

Inheritance diagram for top::Sonnenschein:
Collaboration diagram for top::Sonnenschein:

Public Member Functions

 Sonnenschein ()
 
virtual ~Sonnenschein ()
 
virtual bool apply (const top::Event &) const override
 This does stuff based on the information in an event. More...
 
std::string name () const override
 A human readable name. More...
 
virtual bool applyParticleLevel (const top::ParticleLevelEvent &) const
 This does stuff based on the information in a particle level event. More...
 

Private Member Functions

bool tWb (const top::Event &event, int start, TLorentzVector &t, TLorentzVector &W, TLorentzVector &b, TLorentzVector &l, TLorentzVector &nu) const
 

Private Attributes

top::SonnenscheinEngine m_sonn
 

Detailed Description

An AnalysisTop friendly wrapper for the Sonnenschein reconstruction that is implemented in SonnenscheinEngine.

Definition at line 20 of file Sonnenschein.h.

Constructor & Destructor Documentation

◆ Sonnenschein()

top::Sonnenschein::Sonnenschein ( )

Definition at line 14 of file Sonnenschein.cxx.

14  {
15  }

◆ ~Sonnenschein()

top::Sonnenschein::~Sonnenschein ( )
virtual

Definition at line 17 of file Sonnenschein.cxx.

17  {
18  }

Member Function Documentation

◆ apply()

bool top::Sonnenschein::apply ( const top::Event ) const
overridevirtual

This does stuff based on the information in an event.

The idea is that you implement this to return either true or false based on the information held within top::Event. If this returns true then the event is kept. If it returns false then the event is removed.

Parameters
top::EventThe current event.
Returns
true if the event should be kept, false otherwise.

Implements top::EventSelectorBase.

Definition at line 71 of file Sonnenschein.cxx.

71  {
72  TLorentzVector t;
73  TLorentzVector Wp;
74  TLorentzVector b;
75  TLorentzVector lp;
76  TLorentzVector nu;
77  bool cando1 = tWb(event, 6, t, Wp, b, lp, nu);
78 
79  TLorentzVector tbar;
80  TLorentzVector Wm;
81  TLorentzVector bbar;
82  TLorentzVector lm;
83  TLorentzVector nubar;
84  bool cando2 = tWb(event, -6, tbar, Wm, bbar, lm, nubar);
85 
86  //isn't dilepton at truth level, so return
87  if (!cando1 || !cando2) return true;
88 
89  const double met_ex = nu.Px() + nubar.Px();
90  const double met_ey = nu.Py() + nubar.Py();
91 
92  //solve
93  std::vector<std::pair<TLorentzVector, TLorentzVector> > allSolutions = m_sonn.solve(lp, b, t.M(),
94  Wp.M(), lm, bbar,
95  tbar.M(), Wm.M(), met_ex,
96  met_ey);
97 
98  std::cout << "EVENT" << std::endl;
99  unsigned int counter = 0;
100  for (const auto& possible : allSolutions) {
101  std::cout << "Possible solution number " << counter << "\n";
102  std::cout << " first neutrino : " << possible.first << "\n";
103  std::cout << " second neutrino: " << possible.second << "\n";
104  ++counter;
105  }
106 
107  return true;
108  }

◆ applyParticleLevel()

virtual bool top::EventSelectorBase::applyParticleLevel ( const top::ParticleLevelEvent ) const
inlinevirtualinherited

This does stuff based on the information in a particle level event.

The idea is that you implement this to return either true or false, based on the information held within the top::ParticleLevelEvent. If this function returns true, then the event is kept, otherwise it is removed. The function has a default implementation (which returns true) because it is expected that many EventSelector objects do not operate on ParticleLevelEvent objects.

Parameters
top::ParticleLevelEventthe current particle level event.
trueif the event should be kept (i.e. it passed the selector criteria), false otherwise.

Reimplemented in top::JetNGhostSelector, top::PrintEventSelector, top::PseudoTopRecoRun, top::NElectronNMuonTightSelector, top::NElectronNMuonSelector, top::NFwdElectronSelector, top::HTSelector, top::OSLeptonTightSelector, top::MLLSelector, top::MWTSelector, top::NElectronTightSelector, top::NFwdElectronTightSelector, top::NMuonTightSelector, top::OSLeptonSelector, top::METMWTSelector, top::METSelector, top::MLLWindow, top::NElectronSelector, top::NJetSelector, top::NMuonSelector, top::NPhotonSelector, top::NSoftMuonSelector, top::NTauSelector, top::SSLeptonTightSelector, top::SSLeptonSelector, top::ParticleLevelSelector, top::RecoLevelSelector, top::NVarRCJetSelector, top::NLargeJetSelector, and top::NRCJetSelector.

Definition at line 73 of file EventSelectorBase.h.

73 {return true;}

◆ name()

std::string top::Sonnenschein::name ( ) const
inlineoverridevirtual

A human readable name.

Mostly used for printing the cut and value to the screen. Must be implemented for each tool.

Implements top::EventSelectorBase.

Definition at line 27 of file Sonnenschein.h.

27 {return "RECO:SONNENSCHEIN";}

◆ tWb()

bool top::Sonnenschein::tWb ( const top::Event event,
int  start,
TLorentzVector &  t,
TLorentzVector &  W,
TLorentzVector &  b,
TLorentzVector &  l,
TLorentzVector &  nu 
) const
private

Definition at line 20 of file Sonnenschein.cxx.

21  {
22  bool hasT = false;
23  bool hasB = false;
24  bool hasL = false;
25  bool hasNu = false;
26 
27  for (const xAOD::TruthParticle* particle : *event.m_truth) {
28  if (particle->pdgId() == start) {
29  //std::cout << *particle << std::endl;
30  t = particle->p4();
31  hasT = true;
32 
33  if (particle->hasDecayVtx()) {
34  const xAOD::TruthVertex* vtx = particle->decayVtx();
35  for (size_t i = 0; i < vtx->nOutgoingParticles(); ++i) {
36  const xAOD::TruthParticle* tDecayProduct = vtx->outgoingParticle(i);
37  //std::cout << " " << *tDecayProduct << std::endl;
38 
39  if (abs(tDecayProduct->pdgId()) == 24 && tDecayProduct->hasDecayVtx()) {
40  W = tDecayProduct->p4();
41 
42  const xAOD::TruthVertex* wDecayVtx = tDecayProduct->decayVtx();
43  for (size_t j = 0; j < wDecayVtx->nOutgoingParticles(); ++j) {
44  const xAOD::TruthParticle* wDecayProduct = wDecayVtx->outgoingParticle(j);
45  //std::cout << " " << *wDecayProduct << std::endl;
46 
47  if (abs(wDecayProduct->pdgId()) == 11 || abs(wDecayProduct->pdgId()) == 13 ||
48  abs(wDecayProduct->pdgId()) == 15) {
49  l = wDecayProduct->p4();
50  hasL = true;
51  }
52 
53  if (abs(wDecayProduct->pdgId()) == 12 || abs(wDecayProduct->pdgId()) == 14 ||
54  abs(wDecayProduct->pdgId()) == 16) {
55  nu = wDecayProduct->p4();
56  hasNu = true;
57  }
58  }
59  } else if (abs(tDecayProduct->pdgId()) == 5) {
60  b = tDecayProduct->p4();
61  hasB = true;
62  }
63  }
64  }
65  }
66  }
67 
68  return hasT && hasB && hasL && hasNu;
69  }

Member Data Documentation

◆ m_sonn

top::SonnenscheinEngine top::Sonnenschein::m_sonn
private

Definition at line 32 of file Sonnenschein.h.


The documentation for this class was generated from the following files:
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
JetTiledMap::W
@ W
Definition: TiledEtaPhiMap.h:44
top::SonnenscheinEngine::solve
std::vector< std::pair< TLorentzVector, TLorentzVector > > solve(const TLorentzVector &me_t_lp, const TLorentzVector &me_t_b, double mass_t, double mass_wp, const TLorentzVector &me_tbar_lm, const TLorentzVector &me_tbar_bbar, double mass_tbar, double mass_wm, double me_mex, double me_mey) const
Does the real work.
Definition: SonnenscheinEngine.cxx:20
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::Sonnenschein::m_sonn
top::SonnenscheinEngine m_sonn
Definition: Sonnenschein.h:32
lumiFormat.i
int i
Definition: lumiFormat.py:92
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
top::Sonnenschein::tWb
bool tWb(const top::Event &event, int start, TLorentzVector &t, TLorentzVector &W, TLorentzVector &b, TLorentzVector &l, TLorentzVector &nu) const
Definition: Sonnenschein.cxx:20
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
xAOD::TruthParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TruthParticle_v1.cxx:196
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
test_pyathena.counter
counter
Definition: test_pyathena.py:15
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:121