ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LhoodMMEvent Class Reference

#include <LhoodMMEvent.h>

Collaboration diagram for LhoodMMEvent:

Public Member Functions

 LhoodMMEvent (int nlep, const std::vector< FakeBkgTools::Efficiency > &realEff, const std::vector< FakeBkgTools::Efficiency > &fakeEff, const std::vector< bool > &isTight, const std::vector< int > &charge, double weight, double aux=0., double aux2=0.)
 
 LhoodMMEvent (int nlep, const std::vector< FakeBkgTools::Efficiency > &realEff, const std::vector< FakeBkgTools::Efficiency > &fakeEff, const std::vector< bool > &isTight, const std::vector< int > &charge, float weight, float aux=0., float aux2=0.)
 
 LhoodMMEvent (const LhoodMMEvent &mmevt)
 
unsigned nlep () const
 
float realEff (unsigned ilep, CP::BaseFakeBkgTool *tool=nullptr) const
 
float fakeEff (unsigned ilep, CP::BaseFakeBkgTool *tool=nullptr) const
 
const FakeBkgTools::EfficiencyrealEffObj (unsigned ilep) const
 
const FakeBkgTools::EfficiencyfakeEffObj (unsigned ilep) const
 
bool isTight (unsigned ilep) const
 
int charge (unsigned ilep) const
 
float weight () const
 
double aux () const
 
double aux2 () const
 

Private Member Functions

void Init (int nlep, const std::vector< FakeBkgTools::Efficiency > &realEff, const std::vector< FakeBkgTools::Efficiency > &fakeEff, const std::vector< bool > &isTight, const std::vector< int > &charge, float weight, double aux, double aux2)
 

Private Attributes

unsigned m_nlep
 
std::vector< FakeBkgTools::Efficiencym_realEff
 
std::vector< FakeBkgTools::Efficiencym_fakeEff
 
std::vector< int > m_charge
 
std::vector< bool > m_isTight
 
float m_weight
 
double m_aux
 
double m_aux2
 

Detailed Description

Definition at line 11 of file LhoodMMEvent.h.

Constructor & Destructor Documentation

◆ LhoodMMEvent() [1/3]

LhoodMMEvent::LhoodMMEvent ( int  nlep,
const std::vector< FakeBkgTools::Efficiency > &  realEff,
const std::vector< FakeBkgTools::Efficiency > &  fakeEff,
const std::vector< bool > &  isTight,
const std::vector< int > &  charge,
double  weight,
double  aux = 0.,
double  aux2 = 0. 
)

Definition at line 35 of file LhoodMMEvent.cxx.

35  {
36 
38 }

◆ LhoodMMEvent() [2/3]

LhoodMMEvent::LhoodMMEvent ( int  nlep,
const std::vector< FakeBkgTools::Efficiency > &  realEff,
const std::vector< FakeBkgTools::Efficiency > &  fakeEff,
const std::vector< bool > &  isTight,
const std::vector< int > &  charge,
float  weight,
float  aux = 0.,
float  aux2 = 0. 
)

Definition at line 40 of file LhoodMMEvent.cxx.

40  {
41 
42  double aux_d = aux;
43  double aux2_d = aux2;
44 
45  Init(nlep, realEff, fakeEff, isTight, charge, weight, aux_d, aux2_d);
46 
47 }

◆ LhoodMMEvent() [3/3]

LhoodMMEvent::LhoodMMEvent ( const LhoodMMEvent mmevt)

Definition at line 49 of file LhoodMMEvent.cxx.

49  {
50 
51  Init( mmevt.m_nlep, mmevt.m_realEff, mmevt.m_fakeEff, mmevt.m_isTight,
52  mmevt.m_charge, mmevt.m_weight, mmevt.m_aux, mmevt.m_aux2);
53 }

Member Function Documentation

◆ aux()

double LhoodMMEvent::aux ( ) const
inline

Definition at line 30 of file LhoodMMEvent.h.

30 {return m_aux;}

◆ aux2()

double LhoodMMEvent::aux2 ( ) const
inline

Definition at line 32 of file LhoodMMEvent.h.

32 {return m_aux2;}

◆ charge()

int LhoodMMEvent::charge ( unsigned  ilep) const

Definition at line 110 of file LhoodMMEvent.cxx.

110  {
111  if (ilep > m_nlep) {
112 
113  throw std::out_of_range(" LhoodMMEvent::charge: invalid lepton index " + std::to_string(ilep) + "; must be less than " + std::to_string(m_nlep));
114  }
115  // user may input an empty charge vector if the selection does not care about
116  // lepton charges. Just return 0 without an error in this case
117  if (unsigned(ilep) > m_charge.size() ) {
118  return 0;
119  } else {
120  return m_charge[ilep];
121  }
122 }

◆ fakeEff()

float LhoodMMEvent::fakeEff ( unsigned  ilep,
CP::BaseFakeBkgTool tool = nullptr 
) const

Definition at line 68 of file LhoodMMEvent.cxx.

68  {
69  if (ilep < m_nlep) {
70  if (tool == nullptr) {
71  return m_fakeEff[ilep].nominal;
72  } else {
73  return m_fakeEff[ilep].value(tool);
74  }
75  } else {
76 
77  throw std::out_of_range(" LhoodMMEvent::fakeEff: invalid lepton index " + std::to_string(ilep) + "; must be less than " + std::to_string(m_nlep));
78  }
79 
80 }

◆ fakeEffObj()

const Efficiency & LhoodMMEvent::fakeEffObj ( unsigned  ilep) const

Definition at line 91 of file LhoodMMEvent.cxx.

91  {
92  if (ilep <= m_nlep) {
93  return m_fakeEff[ilep];
94  } else {
95 
96  throw std::out_of_range(" LhoodMMEvent::fakeEff: invalid lepton index " + std::to_string(ilep) + "; must be less than " + std::to_string(m_nlep));
97  }
98 
99 }

◆ Init()

void LhoodMMEvent::Init ( int  nlep,
const std::vector< FakeBkgTools::Efficiency > &  realEff,
const std::vector< FakeBkgTools::Efficiency > &  fakeEff,
const std::vector< bool > &  isTight,
const std::vector< int > &  charge,
float  weight,
double  aux,
double  aux2 
)
private

Definition at line 15 of file LhoodMMEvent.cxx.

15  {
16 
17  m_nlep = nlep;
20 
21  if (m_realEff.size() < m_nlep) {
22  throw std::invalid_argument("LhoodMMEvent::Init: Expected " + std::to_string(m_nlep) + " real efficiency values, but only " + std::to_string(m_realEff.size()) + " provided in efficiency vector");
23  }
24  if (m_fakeEff.size() < m_nlep) {
25  throw std::invalid_argument("ERROR in LhoodMMEvent::Init: Expected " + std::to_string(m_nlep) + " fake efficiency values, but " + std::to_string(m_fakeEff.size()) + " provided in efficiency vector");
26  }
28  m_charge = charge;
29 
30  m_weight = weight;
31  m_aux = aux;
32  m_aux2 = aux2;
33 }

◆ isTight()

bool LhoodMMEvent::isTight ( unsigned  ilep) const

Definition at line 101 of file LhoodMMEvent.cxx.

101  {
102  if (ilep < m_nlep) {
103  return m_isTight[ilep];
104  } else {
105  throw std::out_of_range(" LhoodMMEvent::isTight: invalid lepton index " + std::to_string(ilep) + "; must be less than " + std::to_string(m_nlep));
106  }
107 
108 }

◆ nlep()

unsigned LhoodMMEvent::nlep ( ) const
inline

Definition at line 19 of file LhoodMMEvent.h.

19 {return m_nlep;}

◆ realEff()

float LhoodMMEvent::realEff ( unsigned  ilep,
CP::BaseFakeBkgTool tool = nullptr 
) const

Definition at line 55 of file LhoodMMEvent.cxx.

55  {
56  if (ilep < m_nlep) {
57  if (tool == nullptr) {
58  return m_realEff[ilep].nominal;
59  } else {
60  return m_realEff[ilep].value(tool);
61  }
62  } else {
63  throw std::out_of_range(" LhoodMMEvent::realEff: invalid lepton index " + std::to_string(ilep) + "; must be less than " + std::to_string(m_nlep));
64  }
65 
66 }

◆ realEffObj()

const Efficiency & LhoodMMEvent::realEffObj ( unsigned  ilep) const

Definition at line 82 of file LhoodMMEvent.cxx.

82  {
83  if (ilep <= m_nlep) {
84  return m_realEff[ilep];
85  } else {
86  throw std::out_of_range(" LhoodMMEvent::realEff: invalid lepton index " + std::to_string(ilep) + "; must be less than " + std::to_string(m_nlep));
87  }
88 
89 }

◆ weight()

float LhoodMMEvent::weight ( ) const
inline

Definition at line 28 of file LhoodMMEvent.h.

28 {return m_weight;}

Member Data Documentation

◆ m_aux

double LhoodMMEvent::m_aux
private

Definition at line 43 of file LhoodMMEvent.h.

◆ m_aux2

double LhoodMMEvent::m_aux2
private

Definition at line 43 of file LhoodMMEvent.h.

◆ m_charge

std::vector<int> LhoodMMEvent::m_charge
private

Definition at line 39 of file LhoodMMEvent.h.

◆ m_fakeEff

std::vector<FakeBkgTools::Efficiency> LhoodMMEvent::m_fakeEff
private

Definition at line 38 of file LhoodMMEvent.h.

◆ m_isTight

std::vector<bool> LhoodMMEvent::m_isTight
private

Definition at line 40 of file LhoodMMEvent.h.

◆ m_nlep

unsigned LhoodMMEvent::m_nlep
private

Definition at line 36 of file LhoodMMEvent.h.

◆ m_realEff

std::vector<FakeBkgTools::Efficiency> LhoodMMEvent::m_realEff
private

Definition at line 38 of file LhoodMMEvent.h.

◆ m_weight

float LhoodMMEvent::m_weight
private

Definition at line 42 of file LhoodMMEvent.h.


The documentation for this class was generated from the following files:
LhoodMMEvent::Init
void Init(int nlep, const std::vector< FakeBkgTools::Efficiency > &realEff, const std::vector< FakeBkgTools::Efficiency > &fakeEff, const std::vector< bool > &isTight, const std::vector< int > &charge, float weight, double aux, double aux2)
Definition: LhoodMMEvent.cxx:15
LhoodMMEvent::aux
double aux() const
Definition: LhoodMMEvent.h:30
LhoodMMEvent::isTight
bool isTight(unsigned ilep) const
Definition: LhoodMMEvent.cxx:101
LhoodMMEvent::aux2
double aux2() const
Definition: LhoodMMEvent.h:32
LhoodMMEvent::realEff
float realEff(unsigned ilep, CP::BaseFakeBkgTool *tool=nullptr) const
Definition: LhoodMMEvent.cxx:55
LhoodMMEvent::m_weight
float m_weight
Definition: LhoodMMEvent.h:42
LhoodMMEvent::m_fakeEff
std::vector< FakeBkgTools::Efficiency > m_fakeEff
Definition: LhoodMMEvent.h:38
LhoodMMEvent::charge
int charge(unsigned ilep) const
Definition: LhoodMMEvent.cxx:110
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
LhoodMMEvent::m_nlep
unsigned m_nlep
Definition: LhoodMMEvent.h:36
LhoodMMEvent::m_aux2
double m_aux2
Definition: LhoodMMEvent.h:43
LhoodMMEvent::m_realEff
std::vector< FakeBkgTools::Efficiency > m_realEff
Definition: LhoodMMEvent.h:38
LhoodMMEvent::m_charge
std::vector< int > m_charge
Definition: LhoodMMEvent.h:39
LhoodMMEvent::fakeEff
float fakeEff(unsigned ilep, CP::BaseFakeBkgTool *tool=nullptr) const
Definition: LhoodMMEvent.cxx:68
LhoodMMEvent::m_aux
double m_aux
Definition: LhoodMMEvent.h:43
LhoodMMEvent::weight
float weight() const
Definition: LhoodMMEvent.h:28
LhoodMMEvent::nlep
unsigned nlep() const
Definition: LhoodMMEvent.h:19
LhoodMMEvent::m_isTight
std::vector< bool > m_isTight
Definition: LhoodMMEvent.h:40