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

#include <egPID.h>

Collaboration diagram for egPID:

Public Member Functions

 egPID ()=default
 Default constructor. More...
 
 ~egPID ()=default
 Destructor. More...
 
 egPID (const egPID &original)=default
 constructor More...
 
egPIDoperator= (const egPID &original)
 Assignment. More...
 
unsigned int isEM (const unsigned int mask=egammaPIDObs::ALL, egammaPIDObs::PID=egammaPIDObs::IsEM, bool *found=nullptr) const
 Metod to define isEM variable. More...
 
unsigned int isEMsofte (const unsigned int mask=egammaPIDObs::ALL, bool *found=nullptr) const
 Method to define isEMse variable. More...
 
unsigned int IsGoodOQ (const unsigned int mask=egammaPIDObs::ALLOQ, bool *found=nullptr) const
 Method to define Object quality variable. More...
 
double egammaID (egammaPIDObs::PID, bool *found=nullptr) const
 retrieve egamma ID, as double to work for IsEM and all possible weights as likelihood; found, if not NULL, is set to true if found More...
 
bool set_egammaID (egammaPIDObs::PID, double)
 set egamma ID, as double to work double values and all possible weights as likelihood More...
 
bool set_egammaIDint (egammaPIDObs::PID, unsigned int)
 set egamma ID, for unsigned int values More...
 

Private Member Functions

unsigned int egammaIDint (egammaPIDObs::PID, bool *found) const
 retrieve unsinged int value More...
 

Private Attributes

std::vector< std::pair< egammaPIDObs::PID, unsigned int > > m_egammaIDint
 
std::vector< std::pair< egammaPIDObs::PID, double > > m_egammaID
 

Detailed Description

Class to hold PID vars egamma information

Author
K. Cranmer, S. Rajagopalan, D. Rousseau, D. Zerwas

Definition at line 30 of file egPID.h.

Constructor & Destructor Documentation

◆ egPID() [1/2]

egPID::egPID ( )
default

Default constructor.

◆ ~egPID()

egPID::~egPID ( )
default

Destructor.

◆ egPID() [2/2]

egPID::egPID ( const egPID original)
default

constructor

Member Function Documentation

◆ egammaID()

double egPID::egammaID ( egammaPIDObs::PID  key,
bool *  found = nullptr 
) const

retrieve egamma ID, as double to work for IsEM and all possible weights as likelihood; found, if not NULL, is set to true if found

Definition at line 39 of file egPID.cxx.

40 {
41  //
42  // interface method to retrieve value of pid IsEM or weight
43  //
44 
45  // retrieve key for cut-based identification for non-isolated objects
46  switch(key) {
47 
49  case egammaPIDObs::IsEM:
54  return (double)egammaIDint(key, found);
55  default:
56  using elParams = std::pair<egammaPIDObs::PID, double>;
57 
58  std::vector<elParams>::const_iterator p = m_egammaID.begin();
59 
60  for (;p !=m_egammaID.end(); ++p) {
61  if ( (*p).first == key ){
62  if (found != nullptr) {
63  *found = true;
64  }
65  return (*p).second;
66  break;
67  }
68  }
69 
70  if (found != nullptr) {
71  *found = false;
72  }
74  }
75 }

◆ egammaIDint()

unsigned int egPID::egammaIDint ( egammaPIDObs::PID  key,
bool *  found 
) const
private

retrieve unsinged int value

Definition at line 172 of file egPID.cxx.

173 {
174  //
175  // method to retrieve value
176  //
177 
178  using elParams = std::pair<egammaPIDObs::PID, unsigned int>;
179 
180  std::vector<elParams>::const_iterator p = m_egammaIDint.begin();
181 
182  for (;p !=m_egammaIDint.end(); ++p) {
183  if ( (*p).first == key ){
184  if (found != nullptr) {
185  *found = true;
186  }
187  return (*p).second;
188  }
189  }
190 
191  if (found != nullptr) {
192  *found = false;
193  }
195 }

◆ isEM()

unsigned int egPID::isEM ( const unsigned int  mask = egammaPIDObs::ALL,
egammaPIDObs::PID  pid = egammaPIDObs::IsEM,
bool *  found = nullptr 
) const

Metod to define isEM variable.

Definition at line 139 of file egPID.cxx.

142 {
143  //
144  // apply mask to the IsEM value
145  //
146 
147  return (egammaIDint(pid, found) & mask);
148 }

◆ isEMsofte()

unsigned int egPID::isEMsofte ( const unsigned int  mask = egammaPIDObs::ALL,
bool *  found = nullptr 
) const

Method to define isEMse variable.

Definition at line 151 of file egPID.cxx.

152 {
153  //
154  // apply mask to the SofteIsEM value
155  //
156 
158 }

◆ IsGoodOQ()

unsigned int egPID::IsGoodOQ ( const unsigned int  mask = egammaPIDObs::ALLOQ,
bool *  found = nullptr 
) const

Method to define Object quality variable.

Definition at line 161 of file egPID.cxx.

162 {
163  //
164  // apply mask to the IsGoodOQ value
165  //
166 
168 }

◆ operator=()

egPID & egPID::operator= ( const egPID original)

Assignment.

Definition at line 27 of file egPID.cxx.

28 {
29  if (this != &original) {
30  // value as unsigned integer
31  m_egammaIDint = original.m_egammaIDint;
32  // value as double
33  m_egammaID = original.m_egammaID;
34  }
35  return *this;
36 }

◆ set_egammaID()

bool egPID::set_egammaID ( egammaPIDObs::PID  key,
double  value 
)

set egamma ID, as double to work double values and all possible weights as likelihood

Definition at line 78 of file egPID.cxx.

79 {
80  //
81  // set value of PID for IsEM or weight
82  //
83  switch(key) {
85  case egammaPIDObs::IsEM:
90  // Need to convert to an int first, then to unsigned int.
91  // Converting directly from a negative float to an unsigned is undefined.
92  return set_egammaIDint( key, static_cast<long int>(value));
93  default:
94  using elParams = std::pair<egammaPIDObs::PID, double>;
95 
97 
98  for (;p !=m_egammaID.end(); ++p) {
99  if ( (*p).first == key ) break;
100  }
101 
102  if ( p == m_egammaID.end() ) {
103  m_egammaID.emplace_back(key,value );
104  }
105  else {
106  (*p).second = value;
107  }
108 
109  return true;
110  }
111 }

◆ set_egammaIDint()

bool egPID::set_egammaIDint ( egammaPIDObs::PID  key,
unsigned int  value 
)

set egamma ID, for unsigned int values

Definition at line 114 of file egPID.cxx.

115 {
116  //
117  // method to set value
118  //
119 
120  using elParams = std::pair<egammaPIDObs::PID, unsigned int>;
121 
123 
124  for (;p !=m_egammaIDint.end(); ++p) {
125  if ( (*p).first == key ) break;
126  }
127 
128  if ( p == m_egammaIDint.end() ) {
129  m_egammaIDint.emplace_back(key,value );
130  }
131  else {
132  (*p).second = value;
133  }
134  return true;
135 }

Member Data Documentation

◆ m_egammaID

std::vector< std::pair<egammaPIDObs::PID,double> > egPID::m_egammaID
private

Definition at line 78 of file egPID.h.

◆ m_egammaIDint

std::vector< std::pair<egammaPIDObs::PID, unsigned int> > egPID::m_egammaIDint
private

Definition at line 76 of file egPID.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
egammaPIDObs::IsEM
@ IsEM
cut-based identification for egamma objects (cluster and track-based)
Definition: egammaPIDdefsObs.h:55
egammaPIDObs::IsEMLoose
@ IsEMLoose
cut-based identification for egamma objects (Loose)
Definition: egammaPIDdefsObs.h:84
egPID::m_egammaID
std::vector< std::pair< egammaPIDObs::PID, double > > m_egammaID
Definition: egPID.h:78
egammaPIDObs::EgPidUndefined
const unsigned int EgPidUndefined
Definition: egammaPIDdefsObs.h:127
athena.value
value
Definition: athena.py:124
egPID::egammaIDint
unsigned int egammaIDint(egammaPIDObs::PID, bool *found) const
retrieve unsinged int value
Definition: egPID.cxx:172
egPID::set_egammaIDint
bool set_egammaIDint(egammaPIDObs::PID, unsigned int)
set egamma ID, for unsigned int values
Definition: egPID.cxx:114
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
egammaPIDObs::IsEMTight
@ IsEMTight
cut-based identification for egamma objects (Tight)
Definition: egammaPIDdefsObs.h:88
egammaPIDObs::IsGoodOQ
@ IsGoodOQ
Object Quality variable.
Definition: egammaPIDdefsObs.h:82
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ParticleGun_EoverP_Config.pid
pid
Definition: ParticleGun_EoverP_Config.py:62
egammaPIDObs::SofteIsEM
@ SofteIsEM
cut-based identification for softe electrons in jets (for btag)
Definition: egammaPIDdefsObs.h:64
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
egammaPIDObs::IsEMMedium
@ IsEMMedium
cut-based identification for egamma objects (Medium)
Definition: egammaPIDdefsObs.h:86
egPID::m_egammaIDint
std::vector< std::pair< egammaPIDObs::PID, unsigned int > > m_egammaIDint
Definition: egPID.h:76
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37