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

Not complete. More...

#include <PTMaxReco.h>

Inheritance diagram for top::PTMaxReco:
Collaboration diagram for top::PTMaxReco:

Public Member Functions

 PTMaxReco ()
 
virtual ~PTMaxReco ()
 
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

TLorentzVector neutrinoCandidate (const TLorentzVector &lep, const xAOD::MissingET &met, bool dealWithNegative_nu) const
 

Private Attributes

double m_wmass
 
double m_topmass
 

Detailed Description

Not complete.

Work in progress

Definition at line 18 of file PTMaxReco.h.

Constructor & Destructor Documentation

◆ PTMaxReco()

top::PTMaxReco::PTMaxReco ( )

Definition at line 10 of file PTMaxReco.cxx.

10  : m_wmass(80400.), m_topmass(172500.) {
11  }

◆ ~PTMaxReco()

top::PTMaxReco::~PTMaxReco ( )
virtual

Definition at line 13 of file PTMaxReco.cxx.

13  {
14  }

Member Function Documentation

◆ apply()

bool top::PTMaxReco::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 16 of file PTMaxReco.cxx.

16  {
17  //get the hadronic top
18 
19  //jets that make-up the hadronic top quark
20  const xAOD::Jet* jet1 = nullptr;
21  const xAOD::Jet* jet2 = nullptr;
22  const xAOD::Jet* jet3 = nullptr;
23 
24  double maxptsq = 0.;
25 
26  for (xAOD::JetContainer::const_iterator j1 = event.m_jets.begin(); j1 != event.m_jets.end(); ++j1) {
27  for (xAOD::JetContainer::const_iterator j2 = j1 + 1; j2 != event.m_jets.end(); ++j2) {
28  for (xAOD::JetContainer::const_iterator j3 = j2 + 1; j3 != event.m_jets.end(); ++j3) {
29  const double px = (*j1)->px() + (*j2)->px() + (*j3)->px();
30  const double py = (*j1)->py() + (*j2)->py() + (*j3)->py();
31 
32  //pt2 to avoid the slow sqrt
33  const double ptsq = px * px + py * py;
34 
35  if (ptsq > maxptsq) {
36  jet1 = (*j1);
37  jet2 = (*j2);
38  jet3 = (*j3);
39  }
40  }
41  }
42  }
43 
44  //get the leptonic top
45 
46  //e+jets
47  TLorentzVector lepton;
48  if (event.m_electrons.size() == 1) lepton = event.m_electrons.at(0)->p4();
49 
50  //mu+jets
51  if (event.m_muons.size() == 1) lepton = event.m_muons.at(0)->p4();
52 
53  TLorentzVector nu = neutrinoCandidate(lepton, *event.m_met, true);
54 
55  const xAOD::Jet* lepb = nullptr;
56  double topdiff = 1000000.;
57  for (xAOD::JetContainer::const_iterator j1 = event.m_jets.begin(); j1 != event.m_jets.end(); ++j1) {
58  //ignore the three jets that make-up the hadronic top quark
59  if (*j1 == jet1 || *j1 == jet2 || *j1 == jet3) continue;
60 
61  //pick the jet which makes a leptonic top closest to the true top mass
62  const double tempdiff = fabs((lepton + nu + (*j1)->p4()).M());
63 
64  if ((tempdiff - m_topmass) < topdiff) {
65  lepb = *j1;
66  topdiff = tempdiff;
67  }
68  }
69 
70  if (lepb) std::cout << lepb->pt() << std::endl;
71 
72  return true;
73  }

◆ 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::PTMaxReco::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 25 of file PTMaxReco.h.

25 {return "RECO:PTMAX";}

◆ neutrinoCandidate()

TLorentzVector top::PTMaxReco::neutrinoCandidate ( const TLorentzVector &  lep,
const xAOD::MissingET met,
bool  dealWithNegative_nu 
) const
private

Definition at line 75 of file PTMaxReco.cxx.

76  {
77  const double px = met.mpx();
78  const double py = met.mpy();
79 
80  // solve quadratic to find neutrino four vector
81  double alpha = pow(m_wmass, 2) + pow((px + lep.Px()), 2) + pow((py + lep.Py()), 2) - pow(lep.E(), 2);
82  double beta = 0.5 * (alpha - pow(met.met(), 2) + pow(lep.Pz(), 2));
83  double gamma = -(beta * beta - (pow(lep.E(), 2) * pow(met.met(), 2))) / (pow(lep.E(), 2) - pow(lep.Pz(), 2));
84  double lambda = 2. * beta * lep.Pz() / (pow(lep.E(), 2) - pow(lep.Pz(), 2));
85  double delta = pow(lambda, 2) - 4 * gamma;
86 
87  if (delta < 0) { // ignore non real solutions
88  if (dealWithNegative_nu) delta = 0;
89  else return TLorentzVector();
90  }
91 
92  delta = sqrt(delta);
93 
94  double pz_pos = (lambda + delta) / 2.;
95  double pz_neg = (lambda - delta) / 2.;
96 
97  double pz = 0.0;
98 
99  if (fabs(pz_pos) > fabs(pz_neg)) pz = pz_neg;
100  else pz = pz_pos;
101 
102  double e = sqrt(px * px + py * py + pz * pz);
103 
104  TLorentzVector neutrino;
105  neutrino.SetPxPyPzE(px, py, pz, e);
106  return neutrino;
107  }

Member Data Documentation

◆ m_topmass

double top::PTMaxReco::m_topmass
private

Definition at line 31 of file PTMaxReco.h.

◆ m_wmass

double top::PTMaxReco::m_wmass
private

Definition at line 30 of file PTMaxReco.h.


The documentation for this class was generated from the following files:
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
test_pyathena.px
px
Definition: test_pyathena.py:18
top::PTMaxReco::neutrinoCandidate
TLorentzVector neutrinoCandidate(const TLorentzVector &lep, const xAOD::MissingET &met, bool dealWithNegative_nu) const
Definition: PTMaxReco.cxx:75
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
top::PTMaxReco::m_topmass
double m_topmass
Definition: PTMaxReco.h:31
met
Definition: IMETSignificance.h:24
doubleTestComp.j1
j1
Definition: doubleTestComp.py:21
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
TrigVtx::gamma
@ gamma
Definition: TrigParticleTable.h:26
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
top::PTMaxReco::m_wmass
double m_wmass
Definition: PTMaxReco.h:30
Amg::py
@ py
Definition: GeoPrimitives.h:39
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
xAOD::Jet_v1::p4
virtual FourMom_t p4() const
The full 4-momentum of the particle.
Definition: Jet_v1.cxx:71
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
xAOD::Jet_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
Definition: Jet_v1.cxx:44
doubleTestComp.j2
j2
Definition: doubleTestComp.py:22