DAS  3.0
Das Analysis System
IDApplier

Description

Applies the photon ID selection and corrections (scale factors)

In addition, vetoes photons in the barrel-endcap transition region (1.44 < |scEta| < 1.57).

This class modifies the weights of the reconstructed photons to apply the efficiency correction. Scale factors are taken from a ROOT file in the format provided by Egamma for UL scale factors.

The scale factors are retrieved from a histogram called EGamma_SF2D assumed to contain the scale factors in bins of supercluster eta and pT.

+ Inheritance diagram for IDApplier:
+ Collaboration diagram for IDApplier:

Public Member Functions

 IDApplier (const fs::path &filePath, const string &ID, bool correction, bool uncertainties)
 
- Public Member Functions inherited from GenericSFApplier< DAS::RecPhoton >
 GenericSFApplier (const std::filesystem::path &filePath, bool correction, bool uncertainties)
 
virtual ~GenericSFApplier () noexcept=default
 
void operator() (DAS::RecPhoton &object, const Context &... ctx) const
 
void operator() (std::vector< DAS::RecPhoton > &objects, const Context &... ctx) const
 
std::vector< std::string > weightNames () const
 

Protected Member Functions

bool passes (const RecPhoton &photon) const override
 
int binIndex (const RecPhoton &photon, const std::unique_ptr< TH1 > &hist) const override
 
- Protected Member Functions inherited from GenericSFApplier< DAS::RecPhoton >
void loadNominal (const std::string &histPath)
 
void loadBinWiseUnc (const std::string &name, const std::string &histPath, Interpretation intp=UseBinContent)
 
void loadGlobalUnc (const std::string &name, const std::string &histPath, Interpretation intp=UseBinContent)
 
virtual bool passes (const DAS::RecPhoton &obj, const Context &... ctx) const=0
 
virtual int binIndex (const DAS::RecPhoton &obj, const Context &... ctx, const std::unique_ptr< TH1 > &hist) const=0
 

Static Private Member Functions

static RecPhoton::Identification getMask (const string &ID)
 

Private Attributes

unsigned m_mask
 

Additional Inherited Members

- Protected Types inherited from GenericSFApplier< DAS::RecPhoton >
enum  Interpretation
 

Constructor & Destructor Documentation

◆ IDApplier()

IDApplier ( const fs::path &  filePath,
const string &  ID,
bool  correction,
bool  uncertainties 
)
inline
63  : GenericSFApplier(filePath, correction, uncertainties)
64  , m_mask(getMask(ID))
65  {
66  loadNominal("EGamma_SF2D");
67  loadBinWiseUnc("ID_statData", "statData");
68  loadBinWiseUnc("ID_statMC", "statMC");
69  loadGlobalUnc("ID_altBkgModel", "altBkgModel");
70  loadGlobalUnc("ID_altSignalModel", "altSignalModel");
71  loadGlobalUnc("ID_altMCEff", "altMCEff");
72  loadGlobalUnc("ID_altTagSelection", "altTagSelection");
73 
74  cout << "Initialisation of " << __func__ << " done" << endl;
75  }

Member Function Documentation

◆ binIndex()

int binIndex ( const RecPhoton photon,
const std::unique_ptr< TH1 > &  hist 
) const
inlineoverrideprotected
87  {
88  // - 1 to ensure we fall within the bin
89  const float maxpt = hist->GetYaxis()->GetXmax() - 1;
90  return hist->FindBin(photon.scEta, min(photon.p4.Pt(), maxpt));
91  }

◆ getMask()

static RecPhoton::Identification getMask ( const string &  ID)
inlinestaticprivate

Gets the enum value for a photon ID name.

45  {
46  if (ID == "Loose")
48  else if (ID == "Medium")
50  else if (ID == "Tight")
52  else if (ID == "MVA80")
54  else if (ID == "MVA90")
56 
57  BOOST_THROW_EXCEPTION( invalid_argument(ID + " is not recognised.") );
58  }

◆ passes()

bool passes ( const RecPhoton photon) const
inlineoverrideprotected
79  {
80  const bool passesID = (m_mask & photon.selectors) == m_mask;
81  const auto absScEta = abs(photon.scEta);
82  return passesID && (absScEta < 1.44 || absScEta > 1.57);
83  }

Member Data Documentation

◆ m_mask

unsigned m_mask
private

Mask to apply to the photon's selectors.


The documentation for this class was generated from the following file:
DAS::Photon::IDApplier::getMask
static RecPhoton::Identification getMask(const string &ID)
Gets the enum value for a photon ID name.
Definition: applyPhotonID.cc:44
DAS::GenericSFApplier< DAS::RecPhoton >::GenericSFApplier
GenericSFApplier(const std::filesystem::path &filePath, bool correction, bool uncertainties)
Constructor.
Definition: GenericSFApplier.h:153
DAS::RecPhoton::CutBasedMedium
@ CutBasedMedium
Medium cut-based ID.
Definition: Photon.h:54
DAS::GenericSFApplier< DAS::RecPhoton >::loadNominal
void loadNominal(const std::string &histPath)
Loads the histogram with the nominal scale factor. Has no effect when not applying the correction.
Definition: GenericSFApplier.h:259
DAS::RecPhoton::CutBasedLoose
@ CutBasedLoose
Loose cut-based ID.
Definition: Photon.h:53
DAS::RecPhoton::MVAWorkingPoint80
@ MVAWorkingPoint80
80% efficiency working point of the MVA ID
Definition: Photon.h:56
DAS::GenericSFApplier< DAS::RecPhoton >::loadBinWiseUnc
void loadBinWiseUnc(const std::string &name, const std::string &histPath, Interpretation intp=UseBinContent)
Loads a systematic with bin-by-bin correlations.
Definition: GenericSFApplier.h:275
DAS::Photon::IDApplier::m_mask
unsigned m_mask
Mask to apply to the photon's selectors.
Definition: applyPhotonID.cc:41
DAS::MN::maxpt
static const double maxpt
Definition: getMNobservables.cc:42
DAS::RecPhoton::CutBasedTight
@ CutBasedTight
Tight cut-based ID.
Definition: Photon.h:55
DAS::GenericSFApplier< DAS::RecPhoton >::loadGlobalUnc
void loadGlobalUnc(const std::string &name, const std::string &histPath, Interpretation intp=UseBinContent)
Loads a fully correlated systematic.
Definition: GenericSFApplier.h:295
DAS::RecPhoton::MVAWorkingPoint90
@ MVAWorkingPoint90
90% efficiency working point of the MVA ID
Definition: Photon.h:57