DAS  3.0
Das Analysis System
EventInfo< Muon, Photon >

Description

template<class Muon, class Photon>
struct DAS::Unfolding::ZmmY::EventInfo< Muon, Photon >

Implements the event selection and categorization common to all ZmmY observables, and saves some relevant intermediate calculations.

Template Parameters
MuonOnly prepared to handle muons (gen or rec)
PhotonGen or rec photons

#include <ZmmYCommon.h>

+ Collaboration diagram for EventInfo< Muon, Photon >:

Public Member Functions

 EventInfo ()
 
 EventInfo (const GenEvent *gEv, const RecEvent *rEv, const std::vector< Muon > &muons, const std::vector< Photon > &photons, const Uncertainties::Variation &v)
 

Public Attributes

EventCategory category
 
Di< const Muon, const Muon > dimuon
 
float mMuMu
 
std::vector< Photon > selectedPhotons
 
float mMuMuGamma
 
float weight
 

Static Public Attributes

constexpr static double minMuon0Pt = 20
 
constexpr static double minMuon1Pt = 15
 
constexpr static double maxMuonEta = 2.4
 
constexpr static double minPhotonPt = 20
 
constexpr static double maxPhotonEta = 2.4
 
constexpr static double minZMass = 76
 
constexpr static double maxZMass = 106
 
constexpr static double minMuMuMass = 40
 

Private Member Functions

bool IsMassOnZPeak (float mass) const
 
DAS::Di< const Muon, const Muon > SelectMuons (const std::vector< Muon > &muons, const Uncertainties::Variation &v) const
 
bool IsGoodPhoton (const RecPhoton &photon, const Uncertainties::Variation &v) const
 
bool IsGoodPhoton (const GenPhoton &photon, const Uncertainties::Variation &v) const
 

Constructor & Destructor Documentation

◆ EventInfo() [1/2]

EventInfo ( )
inline

Default constructor to enable use as a variable in fillers.

65  , selectedPhotons{}
66  , mMuMu(-1)
67  , mMuMuGamma(-1)
68  , weight(0)
69  {
70  }

◆ EventInfo() [2/2]

EventInfo ( const GenEvent gEv,
const RecEvent rEv,
const std::vector< Muon > &  muons,
const std::vector< Photon > &  photons,
const Uncertainties::Variation v 
)

Main constructor.

Todo:
We may need to reorder photons after the variation.
Todo:
We only consider the leading photon for now.
Parameters
gEvNull for data.
rEvNull for gen-level.
143  : EventInfo()
144 {
145  weight = 1;
146  if (rEv) weight *= rEv->Weight(v);
147  if (gEv) weight *= gEv->Weight(v);
148 
149  // Start by looking at muons.
150  dimuon = SelectMuons(muons, v);
151  if (!dimuon) return;
152 
153  mMuMu = dimuon.CorrP4(v).M();
154 
155  // The dimuon system is on the Z peak. Don't consider photons.
156  if (IsMassOnZPeak(mMuMu)) {
158  weight *= dimuon.Weight(v);
159  return;
160  }
161 
162  // Do not consider muon pairs below minMuMuMass. This reduces
163  // backgrounds (e.g. vector meson + gamma).
164  // We also remove here events with mMuMu above the Z peak, as there is
165  // no way adding photons can bring them back to the peak.
166  if (mMuMu < minMuMuMass || mMuMu > minZMass)
167  return;
168 
169  // Now get photons. We must copy them because the photons collection could
170  // be reused with another variation.
171  std::copy_if(photons.begin(), photons.end(),
172  std::back_inserter(selectedPhotons),
173  [&] (auto photon) { return IsGoodPhoton(photon, v); });
174 
175  if (selectedPhotons.empty()) return;
176 
179  mMuMuGamma = (dimuon.CorrP4(v) + selectedPhotons[0].CorrP4(v)).M();
180  if (IsMassOnZPeak(mMuMuGamma)) {
182  weight *= dimuon.Weight(v) * selectedPhotons[0].Weight(v);
183  }
184 }

Member Function Documentation

◆ IsGoodPhoton() [1/2]

bool IsGoodPhoton ( const GenPhoton photon,
const Uncertainties::Variation v 
) const
inlineprivate

Checks if a generated photon passes the selection criteria.

129  {
130  auto p4 = photon.CorrP4(v);
131  return photon.Weight(v) != 0
132  && photon.zAncestor
133  && p4.Pt() > minPhotonPt && std::abs(p4.Eta()) < maxPhotonEta;
134  }

◆ IsGoodPhoton() [2/2]

bool IsGoodPhoton ( const RecPhoton photon,
const Uncertainties::Variation v 
) const
inlineprivate

Checks if a reconstructed photon passes the selection criteria.

Todo:
Use a \( \Delta R \) cut w.r.t. muons?
119  {
120  auto p4 = photon.CorrP4(v);
121  return photon.Weight(v) != 0
122  && p4.Pt() > minPhotonPt && std::abs(p4.Eta()) < maxPhotonEta;
123  }

◆ IsMassOnZPeak()

bool IsMassOnZPeak ( float  mass) const
inlineprivate

Checks if a mass should be considered close to the Z peak.

84  {
85  return mass > minZMass && mass < maxZMass;
86  }

◆ SelectMuons()

DAS::Di<const Muon, const Muon> SelectMuons ( const std::vector< Muon > &  muons,
const Uncertainties::Variation v 
) const
inlineprivate

Selects a pair of muons, if any. Returns a null Di if no suitable pair is found.

Todo:
The variation could change which muons are leading.
93  {
94  if (muons.size() < 2) return {};
95 
97  const auto& m0 = muons[0],
98  & m1 = muons[1];
99 
100  const auto p0 = m0.CorrP4(v),
101  p1 = m1.CorrP4(v);
102 
103  if (m0.Q * m1.Q != -1 // opposite charges
104  || p0.Pt() < minMuon0Pt
105  || p1.Pt() < minMuon1Pt
106  || abs(p0.Eta()) >= maxMuonEta
107  || abs(p1.Eta()) >= maxMuonEta)
108  return {};
109 
110  return m0 + m1;
111  }

Member Data Documentation

◆ category

EventCategory category

The event category. This determines which other fields are valid.

◆ dimuon

Di<const Muon, const Muon> dimuon

The dimuon system. Invalid for NotSelected events.

◆ maxMuonEta

constexpr static double maxMuonEta = 2.4
static

Muon chamber acceptance.

◆ maxPhotonEta

constexpr static double maxPhotonEta = 2.4
static

Muon chamber acceptance.

◆ maxZMass

constexpr static double maxZMass = 106
static

mZ + 15 GeV

◆ minMuMuMass

constexpr static double minMuMuMass = 40
static

Trigger efficiency.

◆ minMuon0Pt

constexpr static double minMuon0Pt = 20
staticconstexpr

Scale factors start at 15 GeV.

◆ minMuon1Pt

constexpr static double minMuon1Pt = 15
static

Dimuon trigger.

◆ minPhotonPt

constexpr static double minPhotonPt = 20
static

Scale factors start at 20 GeV.

◆ minZMass

constexpr static double minZMass = 76
static

mZ - 15 GeV

◆ mMuMu

float mMuMu

The invariant mass of the dimuon system. Invalid for NotSelected events.

◆ mMuMuGamma

float mMuMuGamma

Mass of the dimuon + photon system. Only valid for MuMuGamma events.

◆ selectedPhotons

std::vector<Photon> selectedPhotons

Considered photons. Only valid for MuMuGamma events.

◆ weight

float weight

Event weight. Always valid; for NotSelected events, this does not include the muons nor the photon weights.

Todo:
Correlation bit.

The documentation for this struct was generated from the following file:
DAS::Unfolding::ZmmY::EventInfo::minZMass
constexpr static double minZMass
mZ - 15 GeV
Definition: ZmmYCommon.h:35
DAS::Di::Weight
double Weight(const Uncertainties::Variation &v=Uncertainties::nominal) const override
Definition: Di.h:73
DAS::Unfolding::ZmmY::EventInfo::category
EventCategory category
The event category. This determines which other fields are valid.
Definition: ZmmYCommon.h:38
Ntupliser_cfg.muons
string muons
Definition: Ntupliser_cfg.py:43
DAS::Unfolding::ZmmY::EventInfo::weight
float weight
Definition: ZmmYCommon.h:59
DAS::Unfolding::ZmmY::EventInfo::mMuMu
float mMuMu
The invariant mass of the dimuon system. Invalid for NotSelected events.
Definition: ZmmYCommon.h:48
DAS::Unfolding::ZmmY::EventCategory::MuMuGamma
@ MuMuGamma
decay candidates.
DAS::Unfolding::ZmmY::EventInfo::maxMuonEta
constexpr static double maxMuonEta
Muon chamber acceptance.
Definition: ZmmYCommon.h:32
DAS::Unfolding::ZmmY::EventInfo::minMuon0Pt
constexpr static double minMuon0Pt
Scale factors start at 15 GeV.
Definition: ZmmYCommon.h:30
DAS::Unfolding::ZmmY::EventInfo::mMuMuGamma
float mMuMuGamma
Mass of the dimuon + photon system. Only valid for MuMuGamma events.
Definition: ZmmYCommon.h:54
DAS::Unfolding::ZmmY::EventInfo::EventInfo
EventInfo()
Default constructor to enable use as a variable in fillers.
Definition: ZmmYCommon.h:63
DAS::Unfolding::ZmmY::EventCategory::MuMu
@ MuMu
Dimuon candidates close to the Z peak.
DAS::Unfolding::ZmmY::EventInfo::minMuon1Pt
constexpr static double minMuon1Pt
Dimuon trigger.
Definition: ZmmYCommon.h:31
DAS::Unfolding::ZmmY::EventInfo::selectedPhotons
std::vector< Photon > selectedPhotons
Considered photons. Only valid for MuMuGamma events.
Definition: ZmmYCommon.h:51
DAS::Unfolding::ZmmY::EventInfo::SelectMuons
DAS::Di< const Muon, const Muon > SelectMuons(const std::vector< Muon > &muons, const Uncertainties::Variation &v) const
Definition: ZmmYCommon.h:91
DAS::Unfolding::ZmmY::EventInfo::maxPhotonEta
constexpr static double maxPhotonEta
Muon chamber acceptance.
Definition: ZmmYCommon.h:34
DAS::Unfolding::ZmmY::EventInfo::maxZMass
constexpr static double maxZMass
mZ + 15 GeV
Definition: ZmmYCommon.h:36
DAS::Unfolding::ZmmY::EventInfo::dimuon
Di< const Muon, const Muon > dimuon
The dimuon system. Invalid for NotSelected events.
Definition: ZmmYCommon.h:45
Ntupliser_cfg.photons
string photons
Definition: Ntupliser_cfg.py:44
DAS::Di::CorrP4
FourVector CorrP4(const Uncertainties::Variation &v=Uncertainties::nominal) const override
Definition: Di.h:46
DAS::Unfolding::ZmmY::EventCategory::NotSelected
@ NotSelected
The event fails some selection.
DAS::Unfolding::ZmmY::EventInfo::minPhotonPt
constexpr static double minPhotonPt
Scale factors start at 20 GeV.
Definition: ZmmYCommon.h:33
DAS::Unfolding::ZmmY::EventInfo::IsMassOnZPeak
bool IsMassOnZPeak(float mass) const
Checks if a mass should be considered close to the Z peak.
Definition: ZmmYCommon.h:83