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

Photon selection for top analyses. More...

#include <Photon.h>

Inheritance diagram for top::Photon:
Collaboration diagram for top::Photon:

Public Member Functions

 Photon (double ptcut, double etamax, IsolationBase *isolation)
 Class to help select good photons. More...
 
 Photon (double ptcut, double etamax, const std::string &tightID, const std::string &looseID, IsolationBase *isolation)
 Class to help select good photons. More...
 
bool passSelection (const xAOD::Photon &ph) const override
 The cuts to select good photons for your analysis should be implemented in here. More...
 
bool passSelectionLoose (const xAOD::Photon &ph) const override
 The loose selection. More...
 
void print (std::ostream &) const override
 Print some useful information about the photon selection. More...
 

Private Member Functions

bool passSelectionNoIsolation (const xAOD::Photon &ph, const std::string &photon_selection) const
 Do all the cuts except for the isolation. More...
 
std::string getConfigFile (int operatingPoint)
 

Private Attributes

double m_ptcut
 
double m_etamax
 
std::string m_photon_selection
 
std::string m_loose_photon_selection
 
std::unique_ptr< top::IsolationBasem_isolation
 
asg::AnaToolHandle< IAsgDeadHVCellRemovalToolm_deadHVTool
 

Detailed Description

Photon selection for top analyses.

For Release 21 specific cleaning

Definition at line 23 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h.

Constructor & Destructor Documentation

◆ Photon() [1/2]

Photon::Photon ( double  ptcut,
double  etamax,
IsolationBase isolation 
)

Class to help select good photons.

Parameters
ptcutThe minimum pT cut to apply to the photons.
etamaxThe maximum eta cut
isolationnullptr for un-isolated, or a new "isolation object" to apply isolation cuts

Definition at line 17 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx.

17  :
18  m_ptcut(ptcut),
19  m_etamax(etamax),
20  m_photon_selection("DFCommonPhotonsIsEMTight"),
21  m_loose_photon_selection("DFCommonPhotonsIsEMLoose"),
22  m_isolation(isolation) {
23  }

◆ Photon() [2/2]

Photon::Photon ( double  ptcut,
double  etamax,
const std::string &  tightID,
const std::string &  looseID,
IsolationBase isolation 
)

Class to help select good photons.

Parameters
ptcutThe minimum pT cut to apply to the photons.
etamaxThe maximum eta cut
tightIDThe ID level used to select tight photons.
looseIDThe ID level used to select loose photons.
isolationnullptr for un-isolated, or a new "isolation object" to apply isolation cuts

Definition at line 25 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx.

28  :
29  m_ptcut(ptcut),
30  m_etamax(etamax),
31  m_photon_selection(tightID),
32  m_loose_photon_selection(looseID),
33  m_isolation(isolation) {
34  // Make a map of shortcuts e.g "Tight = DFCommonPhotonsIsEMTight"
35  std::map<std::string, std::string> id_map;
36  id_map["Tight"] = "DFCommonPhotonsIsEMTight";
37  id_map["Loose"] = "DFCommonPhotonsIsEMLoose";
38  id_map["None"] = "None";
39  // If ID in map then set it to full name, else keep as is.
40  if (id_map.find(tightID) != id_map.end()) m_photon_selection = id_map[tightID];
41  if (id_map.find(looseID) != id_map.end()) m_loose_photon_selection = id_map[looseID];
42 
43  m_deadHVTool.setTypeAndName("AsgDeadHVCellRemovalTool/deadHVTool");
44  top::check(m_deadHVTool.retrieve(), "Failed to setup Egamma DeadHVCellRemovalTool");
45  }

Member Function Documentation

◆ getConfigFile()

std::string top::Photon::getConfigFile ( int  operatingPoint)
private

◆ passSelection()

bool Photon::passSelection ( const xAOD::Photon ph) const
overridevirtual

The cuts to select good photons for your analysis should be implemented in here.

Parameters
phThe photon to cut on (all photons in the event are passed to the tool)
Returns
True if this is a good photon, false otherwise.

Implements top::PhotonSelectionBase.

Definition at line 47 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx.

47  {
48  if (!passSelectionNoIsolation(ph, m_photon_selection)) return false;
49 
50  if (m_isolation && !m_isolation->passSelection(ph)) return false;
51 
52  return true;
53  }

◆ passSelectionLoose()

bool Photon::passSelectionLoose ( const xAOD::Photon ph) const
overridevirtual

The loose selection.

Parameters
ph
Returns

Implements top::PhotonSelectionBase.

Definition at line 55 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx.

55  {
56  if (!passSelectionNoIsolation(ph, m_loose_photon_selection)) return false;
57 
58  if (m_isolation && !m_isolation->passSelectionLoose(ph)) return false;
59 
60  return true;
61  }

◆ passSelectionNoIsolation()

bool Photon::passSelectionNoIsolation ( const xAOD::Photon ph,
const std::string &  photon_selection 
) const
private

Do all the cuts except for the isolation.

Parameters
phThe photon in question
Returns
True if the photon passes

Definition at line 63 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx.

64  {
65  // Photon author : AuthorPhoton/AuthorAmbiguous.
66  // Also, for special-case recovery of soft photons:
67  // xAOD::EgammaParameters::AuthorCaloTopo35.
69  && ph.author() != xAOD::EgammaParameters::AuthorAmbiguous) return false;
70 
71  if (ph.pt() < m_ptcut) return false;
72 
73  // removing bad photon cluser [http://cern.ch/go/kp8F]
74  if (!ph.isGoodOQ(xAOD::EgammaParameters::BADCLUSPHOTON)) return false;
75 
76  // Photon selection using derivation decorations
77  if (photon_selection != "None")
78  if (!ph.auxdataConst<char>(photon_selection)) return false;
79 
80  if (!ph.caloCluster()) return false;
81 
82  float abs_eta = std::abs(ph.caloCluster()->etaBE(2));
83  if (abs_eta > m_etamax) return false;
84 
85  // Remove crack region
86  if (abs_eta > 1.37 && abs_eta < 1.52) return false;
87 
88  // Photon cleaning
89  static const SG::AuxElement::ConstAccessor<char> accDFCommonPhotonsCleaning("DFCommonPhotonsCleaning");
90  static const SG::AuxElement::ConstAccessor<char> accDFCommonPhotonsCleaningNoTime("DFCommonPhotonsCleaningNoTime");
91 
92  if (!accDFCommonPhotonsCleaning(ph)) return false;
93  if (!accDFCommonPhotonsCleaningNoTime(ph)) return false;
94 
95  // removing photon cluster in EMEC bad HV regions
96  // https://twiki.cern.ch/twiki/bin/view/AtlasProtected/EGammaIdentificationRun2#Removal_of_Electron_Photon_clust
97  if (!m_deadHVTool->accept(ph)) return false;
98 
99 
100  return true;
101  }

◆ print()

void Photon::print ( std::ostream &  os) const
overridevirtual

Print some useful information about the photon selection.

Usually this goes to the log file, so you know what you ran with.

Parameters
Wherethe print-out should go, e.g. msg stream.

Implements top::PhotonSelectionBase.

Definition at line 103 of file PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx.

103  {
104  os << "Photon\n";
105  os << " * pT > " << m_ptcut << "\n";
106  os << " * |eta| < " << m_etamax << "\n";
107  os << " * Photon PID: " << m_photon_selection << "\n";
108  os << " * Loose Photon PID: " << m_loose_photon_selection << "\n";
109  if (!m_isolation) os << " * No isolation requirement\n";
110  else m_isolation->print(os);
111  }

Member Data Documentation

◆ m_deadHVTool

asg::AnaToolHandle<IAsgDeadHVCellRemovalTool> top::Photon::m_deadHVTool
private

◆ m_etamax

double top::Photon::m_etamax
private

◆ m_isolation

std::unique_ptr<top::IsolationBase> top::Photon::m_isolation
private

◆ m_loose_photon_selection

std::string top::Photon::m_loose_photon_selection
private

◆ m_photon_selection

std::string top::Photon::m_photon_selection
private

◆ m_ptcut

double top::Photon::m_ptcut
private

The documentation for this class was generated from the following files:
top::Photon::m_isolation
std::unique_ptr< top::IsolationBase > m_isolation
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h:103
top::Photon::m_etamax
double m_etamax
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h:92
top::Photon::m_photon_selection
std::string m_photon_selection
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h:94
IAsgDeadHVCellRemovalTool::accept
virtual bool accept(const xAOD::Egamma *part) const =0
asg::AnaToolHandle::retrieve
StatusCode retrieve()
initialize the tool
asg::AnaToolHandle::setTypeAndName
void setTypeAndName(const std::string &val_typeAndName)
set the value of type and name
xAOD::Egamma_v1::author
uint16_t author(uint16_t bitmask=EgammaParameters::AuthorALL) const
Get author.
Definition: Egamma_v1.cxx:166
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:54
Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.ptcut
float ptcut
Definition: Pythia8_A14_NNPDF23LO_forMGHT_EvtGen.py:9
SG::AuxElement::auxdataConst
Accessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name) const
Fetch an aux data variable, as a const reference.
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition: CaloCluster_v1.cxx:644
xAOD::EgammaParameters::AuthorAmbiguous
const uint16_t AuthorAmbiguous
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:32
xAOD::Egamma_v1::caloCluster
const xAOD::CaloCluster * caloCluster(size_t index=0) const
Pointer to the xAOD::CaloCluster/s that define the electron candidate.
Definition: Egamma_v1.cxx:388
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
top::Photon::m_deadHVTool
asg::AnaToolHandle< IAsgDeadHVCellRemovalTool > m_deadHVTool
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h:107
xAOD::EgammaParameters::BADCLUSPHOTON
const uint32_t BADCLUSPHOTON
Definition: EgammaDefs.h:124
top::Photon::m_ptcut
double m_ptcut
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h:89
top::Photon::passSelectionNoIsolation
bool passSelectionNoIsolation(const xAOD::Photon &ph, const std::string &photon_selection) const
Do all the cuts except for the isolation.
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/Root/Photon.cxx:63
xAOD::EgammaParameters::AuthorPhoton
const uint16_t AuthorPhoton
Object Reconstructed by standard cluster-based algorithm.
Definition: EgammaDefs.h:28
xAOD::Egamma_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: Egamma_v1.cxx:65
top::Photon::m_loose_photon_selection
std::string m_loose_photon_selection
Definition: PhysicsAnalysis/TopPhys/xAOD/TopObjectSelectionTools/TopObjectSelectionTools/Photon.h:95
xAOD::Egamma_v1::isGoodOQ
bool isGoodOQ(uint32_t mask) const
Check object quality. Return True is it is Good Object Quality.
Definition: Egamma_v1.cxx:236