DAS  3.0
Das Analysis System
ZmmYFillerabstract

#include <ZmmY.h>

+ Inheritance diagram for ZmmYFiller:
+ Collaboration diagram for ZmmYFiller:

Public Member Functions

 ZmmYFiller (Darwin::Tools::Flow &flow, bool isMC)
 
template<typename MUON , typename PHOTON >
int GetBinNumber (const TUnfoldBinning *binning, const EventInfo< MUON, PHOTON > &event, const Uncertainties::Variation &v) const
 
template<typename MUON , typename PHOTON >
int GetBinNumber2D (const TUnfoldBinning *binning, const EventInfo< MUON, PHOTON > &event, const Uncertainties::Variation &v) const
 
virtual const ObservablegetObs () const =0
 
virtual int getObsDimension () const
 
std::list< int > fillRec (DistVariation &v) override
 
void match () override
 
void fillMC (DistVariation &v) override
 
- Public Member Functions inherited from Filler
virtual ~Filler ()=default
 

Public Attributes

EventInfo< RecMuon, RecPhotonrInfo
 
std::vector< GenMuon > * genMuons
 
std::vector< RecMuon > * recMuons
 
std::vector< GenPhoton > * genPhotons
 
std::vector< RecPhoton > * recPhotons
 
GenEventgEv
 
RecEventrEv
 

Protected Member Functions

virtual double computeObservableValue (const void *event, const Uncertainties::Variation &v, bool isGen) const
 
virtual std::vector< double > computeObservableValue2D (const void *event, const Uncertainties::Variation &v, bool isGen) const
 

Constructor & Destructor Documentation

◆ ZmmYFiller()

ZmmYFiller ( Darwin::Tools::Flow flow,
bool  isMC 
)
inline
30  : genMuons(isMC ? flow.GetBranchReadOnly<std::vector<GenMuon>>("genMuons") : nullptr)
31  , genPhotons(isMC ? flow.GetBranchReadOnly<std::vector<GenPhoton>>("genPhotons") : nullptr)
32  , recMuons(flow.GetBranchReadOnly<std::vector<RecMuon>>("recMuons"))
33  , recPhotons(flow.GetBranchReadOnly<std::vector<RecPhoton>>("recPhotons"))
34  , gEv(isMC ? flow.GetBranchReadOnly<GenEvent>("genEvent") : nullptr)
35  , rEv(flow.GetBranchReadOnly<RecEvent>("recEvent"))
36  {}

Member Function Documentation

◆ computeObservableValue()

virtual double computeObservableValue ( const void *  event,
const Uncertainties::Variation v,
bool  isGen 
) const
inlineprotectedvirtual

Reimplemented in MmmYFiller, MmmFiller, PtFiller, and DrFiller.

58  {
59  return 0.0;
60  }

◆ computeObservableValue2D()

virtual std::vector<double> computeObservableValue2D ( const void *  event,
const Uncertainties::Variation v,
bool  isGen 
) const
inlineprotectedvirtual

Reimplemented in DalitzFiller.

61  {
62  return {};
63  }

◆ fillMC()

void fillMC ( DistVariation )
overridevirtual

Fill RM, gen, miss, fake histograms for a given variation.

Reimplemented from Filler.

54 {
55  if (!getObs()->isMC)
56  BOOST_THROW_EXCEPTION( runtime_error(__func__ + " should only be called for MC"s) );
57  auto gInfo = EventInfo(gEv, nullptr, *genMuons, *genPhotons, v);
58  int genBin = 0, recBin = 0;
59  if (getObsDimension() == 1) {
60  genBin = GetBinNumber(getObs()->genBinning, gInfo, v);
61  recBin = GetBinNumber(getObs()->recBinning, rInfo, v);
62  } else if (getObsDimension() == 2) {
63  genBin = GetBinNumber2D(getObs()->genBinning, gInfo, v);
64  recBin = GetBinNumber2D(getObs()->recBinning, rInfo, v);
65  }
66 
67  if (genBin > 0) v.gen->Fill(genBin, gInfo.weight);
68 
69  if (genBin > 0 && recBin > 0) {
70  v.RM ->Fill(genBin, recBin, rInfo.weight);
71  v.missOut->Fill(genBin, gInfo.weight - rInfo.weight);
72  } else if (genBin > 0 && recBin <= 0)
73  v.missOut->Fill(genBin, gInfo.weight );
74  else if (genBin <= 0 && recBin >= 0)
75  v.fakeOut->Fill( recBin, rInfo.weight);
76 }

◆ fillRec()

std::list< int > fillRec ( DistVariation )
overridevirtual

For a given variation, fills the detector level distribution, as well as a temporary histogram (reset at each event) to calculate the covariance matrix later on. The bin IDs are returned to avoid looping over many empty bins.

Reimplemented from Filler.

39 {
41  int bin = 0;
42  if (getObsDimension() == 1) {
43  bin = GetBinNumber(getObs()->recBinning, rInfo, v);
44  } else if (getObsDimension() == 2) {
45  bin = GetBinNumber2D(getObs()->recBinning, rInfo, v);
46  }
47  if (bin <= 0) return {};
48  v.tmp->Fill(bin, rInfo.weight);
49  v.rec->Fill(bin, rInfo.weight);
50  return {bin};
51 }

◆ GetBinNumber()

int GetBinNumber ( const TUnfoldBinning *  binning,
const EventInfo< MUON, PHOTON > &  event,
const Uncertainties::Variation v 
) const
16  {
17  if (event.category != EventCategory::MuMuGamma) return 0;
18  const double value = computeObservableValue(static_cast<const void*>(&event), v, std::is_same<MUON, GenMuon>::value);
19  return binning->GetGlobalBinNumber(value);
20 }

◆ GetBinNumber2D()

int GetBinNumber2D ( const TUnfoldBinning *  binning,
const EventInfo< MUON, PHOTON > &  event,
const Uncertainties::Variation v 
) const
22  {
23  if (event.category != EventCategory::MuMuGamma) return 0;
24  const auto values = computeObservableValue2D(static_cast<const void*>(&event), v, std::is_same<MUON, GenMuon>::value);
25  if (values.size() != 2) return 0;
26  return binning->GetGlobalBinNumber(values[0], values[1]);
27 }

◆ getObs()

virtual const Observable* getObs ( ) const
pure virtual

◆ getObsDimension()

virtual int getObsDimension ( ) const
inlinevirtual

Reimplemented in DalitzFiller.

49 { return 1; }

◆ match()

void match ( )
inlineoverridevirtual

Implementation of matching algorithm.

Reimplemented from Filler.

53 {}

Member Data Documentation

◆ genMuons

std::vector<GenMuon>* genMuons

◆ genPhotons

std::vector<GenPhoton>* genPhotons

◆ gEv

GenEvent* gEv

◆ recMuons

std::vector<RecMuon>* recMuons

◆ recPhotons

std::vector<RecPhoton>* recPhotons

◆ rEv

RecEvent* rEv

◆ rInfo


The documentation for this struct was generated from the following files:
DAS::Unfolding::ZmmY::ZmmYFiller::rInfo
EventInfo< RecMuon, RecPhoton > rInfo
Definition: ZmmY.h:21
DAS::Unfolding::ZmmY::EventInfo::category
EventCategory category
The event category. This determines which other fields are valid.
Definition: ZmmYCommon.h:38
DAS::Unfolding::ZmmY::ZmmYFiller::rEv
RecEvent * rEv
Definition: ZmmY.h:27
DAS::Unfolding::ZmmY::ZmmYFiller::recMuons
std::vector< RecMuon > * recMuons
Definition: ZmmY.h:23
DAS::Unfolding::ZmmY::ZmmYFiller::getObsDimension
virtual int getObsDimension() const
Definition: ZmmY.h:49
DAS::Unfolding::ZmmY::ZmmYFiller::GetBinNumber2D
int GetBinNumber2D(const TUnfoldBinning *binning, const EventInfo< MUON, PHOTON > &event, const Uncertainties::Variation &v) const
Definition: ZmmY.cc:22
DAS::Unfolding::ZmmY::EventInfo
Definition: ZmmYCommon.h:28
DAS::Unfolding::ZmmY::EventCategory::MuMuGamma
@ MuMuGamma
decay candidates.
DAS::Unfolding::ZmmY::ZmmYFiller::GetBinNumber
int GetBinNumber(const TUnfoldBinning *binning, const EventInfo< MUON, PHOTON > &event, const Uncertainties::Variation &v) const
Definition: ZmmY.cc:16
DAS::Unfolding::ZmmY::ZmmYFiller::gEv
GenEvent * gEv
Definition: ZmmY.h:26
DAS::Unfolding::ZmmY::ZmmYFiller::genPhotons
std::vector< GenPhoton > * genPhotons
Definition: ZmmY.h:24
DAS::Unfolding::ZmmY::ZmmYFiller::getObs
virtual const Observable * getObs() const =0
DAS::Unfolding::ZmmY::ZmmYFiller::genMuons
std::vector< GenMuon > * genMuons
Definition: ZmmY.h:22
DAS::Unfolding::ZmmY::ZmmYFiller::computeObservableValue2D
virtual std::vector< double > computeObservableValue2D(const void *event, const Uncertainties::Variation &v, bool isGen) const
Definition: ZmmY.h:61
Ntupliser_cfg.isMC
dictionary isMC
Definition: Ntupliser_cfg.py:62
Darwin::Tools::Flow::GetBranchReadOnly
T * GetBranchReadOnly(const std::string &name, BranchMode mode=mandatory)
Wrapper to initialise read-only branches.
Definition: Flow.h:301
DAS::Unfolding::ZmmY::ZmmYFiller::recPhotons
std::vector< RecPhoton > * recPhotons
Definition: ZmmY.h:25
DAS::Unfolding::ZmmY::ZmmYFiller::computeObservableValue
virtual double computeObservableValue(const void *event, const Uncertainties::Variation &v, bool isGen) const
Definition: ZmmY.h:58