DAS  3.0
Das Analysis System
BFFillerfinal

#include <BF.h>

+ Inheritance diagram for BFFiller:
+ Collaboration diagram for BFFiller:

Public Member Functions

 BFFiller (const BF &, Darwin::Tools::Flow &)
 
std::list< int > fillRec (DistVariation &) override
 
void match () override
 
void fillMC (DistVariation &) override
 
- Public Member Functions inherited from Filler
virtual ~Filler ()=default
 

Public Attributes

BF obs
 
std::vector< GenMuon > * genMuons
 
std::vector< RecMuon > * recMuons
 
std::vector< GenPhoton > * genPhotons
 
std::vector< RecPhoton > * recPhotons
 
GenEventgEv
 
RecEventrEv
 

Private Attributes

EventInfo< RecMuon, RecPhotonrInfo
 
std::optional< int > irecbin
 

Constructor & Destructor Documentation

◆ BFFiller()

BFFiller ( const BF obs,
Darwin::Tools::Flow flow 
)

Constructor.

15  : obs(obs)
16  , genMuons(obs.isMC ? flow.GetBranchReadOnly<vector<GenMuon>>("genMuons") : nullptr)
17  , recMuons(flow.GetBranchReadOnly<vector<RecMuon>>("recMuons"))
18  , genPhotons(obs.isMC ? flow.GetBranchReadOnly<vector<GenPhoton>>("genPhotons") : nullptr)
19  , recPhotons(flow.GetBranchReadOnly<vector<RecPhoton>>("recPhotons"))
20  , gEv(obs.isMC ? flow.GetBranchReadOnly<GenEvent>("genEvent") : nullptr)
21  , rEv(flow.GetBranchReadOnly<RecEvent>("recEvent"))
22 {
23 }

Member Function Documentation

◆ fillMC()

void fillMC ( DistVariation v)
overridevirtual

See Filler::fillMC

Reimplemented from Filler.

53 {
54  if (!obs.isMC)
55  BOOST_THROW_EXCEPTION( runtime_error(__func__ + " should only be called for MC"s) );
56 
57  EventInfo gInfo(gEv, nullptr, *genMuons, *genPhotons, v);
58  optional<int> igenbin;
59 
60  switch (gInfo.category) {
62  break;
63 
65  igenbin = obs.genBinning->GetGlobalBinNumber(*obs.process, 1.);
66  if (*igenbin == 0) cerr << red << gInfo.mMuMu << '\n' << def;
67  break;
68 
70  igenbin = obs.genBinning->GetGlobalBinNumber(*obs.process, 2.);
71  if (*igenbin == 0) cerr << red << gInfo.mMuMuGamma << '\n' << def;
72  break;
73  }
74 
75  if (igenbin) v.gen->Fill(*igenbin, gInfo.weight);
76 
77  if (igenbin && irecbin) {
78  // Good events
79  v.RM ->Fill(*igenbin, *irecbin, rInfo.weight);
80  v.missOut->Fill(*igenbin, gInfo.weight - rInfo.weight);
81  } else if (igenbin && !irecbin)
82  // Miss
83  v.missOut->Fill(*igenbin, gInfo.weight );
84  else if (!igenbin && irecbin)
85  // Fake
86  v.fakeOut->Fill( *irecbin, rInfo.weight);
87 }

◆ fillRec()

list< int > fillRec ( DistVariation v)
overridevirtual

See Filler::fillRec

Reimplemented from Filler.

26 {
27  irecbin.reset();
29 
30  switch (rInfo.category) {
32  break;
33 
35  irecbin = obs.recBinning->GetGlobalBinNumber(rInfo.mMuMu, 1.);
36  if (*irecbin == 0) cerr << red << rInfo.mMuMu << '\n' << def;
37  v.tmp->Fill(*irecbin, rInfo.weight);
38  v.rec->Fill(*irecbin, rInfo.weight);
39  return {*irecbin};
40 
42  irecbin = obs.recBinning->GetGlobalBinNumber(rInfo.mMuMuGamma, 2.);
43  if (*irecbin == 0) cerr << red << rInfo.mMuMuGamma << '\n' << def;
44  v.tmp->Fill(*irecbin, rInfo.weight);
45  v.rec->Fill(*irecbin, rInfo.weight);
46  return {*irecbin};
47  }
48 
49  return {};
50 }

◆ match()

void match ( )
inlineoverridevirtual
Todo:
Needed?

Reimplemented from Filler.

67 {}

Member Data Documentation

◆ genMuons

std::vector<GenMuon>* genMuons

◆ genPhotons

std::vector<GenPhoton>* genPhotons

◆ gEv

GenEvent* gEv

◆ irecbin

std::optional<int> irecbin
private

◆ obs

BF obs

Backreference to the observable.

◆ recMuons

std::vector<RecMuon>* recMuons

◆ recPhotons

std::vector<RecPhoton>* recPhotons

◆ rEv

RecEvent* rEv

◆ rInfo

EventInfo<RecMuon, RecPhoton> rInfo
private

The documentation for this struct was generated from the following files:
Ntupliser_cfg.cerr
cerr
Definition: Ntupliser_cfg.py:98
Step::def
static const char * def
Definition: Step.h:36
DAS::Unfolding::ZmmY::BFFiller::recMuons
std::vector< RecMuon > * recMuons
Definition: BF.h:51
DAS::Unfolding::ZmmY::BFFiller::irecbin
std::optional< int > irecbin
Definition: BF.h:75
DAS::RecEvent
Definition: Event.h:52
DAS::Unfolding::ZmmY::EventInfo
Definition: ZmmYCommon.h:28
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:125
DAS::Unfolding::ZmmY::BFFiller::genPhotons
std::vector< GenPhoton > * genPhotons
Definition: BF.h:52
DAS::Unfolding::ZmmY::BFFiller::rEv
RecEvent * rEv
Definition: BF.h:55
DAS::Unfolding::ZmmY::EventCategory::MuMuGamma
@ MuMuGamma
decay candidates.
DAS::Unfolding::ZmmY::BFFiller::genMuons
std::vector< GenMuon > * genMuons
Definition: BF.h:50
Step::red
static const char * red
Definition: Step.h:34
DAS::Unfolding::ZmmY::BFFiller::obs
BF obs
Backreference to the observable.
Definition: BF.h:48
DAS::Unfolding::ZmmY::BFFiller::rInfo
EventInfo< RecMuon, RecPhoton > rInfo
Definition: BF.h:74
DAS::Unfolding::Observable::isMC
static bool isMC
Definition: Observable.h:119
DAS::Unfolding::ZmmY::BF::process
std::optional< int > process
Definition: BF.h:30
DAS::Unfolding::ZmmY::EventCategory::MuMu
@ MuMu
Dimuon candidates close to the Z peak.
DAS::Unfolding::ZmmY::BFFiller::gEv
GenEvent * gEv
Definition: BF.h:54
Darwin::Tools::Flow::GetBranchReadOnly
T * GetBranchReadOnly(const std::string &name, BranchMode mode=mandatory)
Wrapper to initialise read-only branches.
Definition: Flow.h:257
DAS::Unfolding::Observable::recBinning
TUnfoldBinning * recBinning
detector-level binning
Definition: Observable.h:124
DAS::Unfolding::ZmmY::EventCategory::NotSelected
@ NotSelected
The event fails some selection.
DAS::GenEvent
Definition: Event.h:38
DAS::Unfolding::ZmmY::BFFiller::recPhotons
std::vector< RecPhoton > * recPhotons
Definition: BF.h:53