DAS  3.0
Das Analysis System
ZPtYFillerfinal

#include <ZPtY.h>

+ Inheritance diagram for ZPtYFiller:
+ Collaboration diagram for ZPtYFiller:

Public Member Functions

 ZPtYFiller (const ZPtY &obs, TTreeReader &reader)
 
std::list< int > fillRec (DistVariation &) override
 
void match () override
 
void fillMC (DistVariation &) override
 
- Public Member Functions inherited from Filler
virtual ~Filler ()=default
 

Public Attributes

ZPtY obs
 
std::optional< TTreeReaderArray< GenMuon > > genMuons
 
TTreeReaderArray< RecMuonrecMuons
 
std::optional< TTreeReaderValue< GenEvent > > gEv
 
TTreeReaderValue< RecEventrEv
 

Constructor & Destructor Documentation

◆ ZPtYFiller()

ZPtYFiller ( const ZPtY obs,
TTreeReader &  reader 
)

Constructor.

62  : obs(obs)
63  , genMuons(initOptionalBranch<decltype(genMuons)>(reader, "genMuons"))
64  , recMuons(reader, "recMuons")
65  , gEv(initOptionalBranch<decltype(gEv)>(reader, "genEvent"))
66  , rEv(reader, "recEvent")
67 {}

Member Function Documentation

◆ fillMC()

void fillMC ( DistVariation v)
overridevirtual

See Filler::fillMC

Reimplemented from Filler.

85 {
86  if (!obs.isMC)
87  BOOST_THROW_EXCEPTION( runtime_error(__func__ + " should only be called for MC"s) );
88 
89  auto rEvW = rEv->Weight(v),
90  gEvW = (*gEv)->Weight(v);
91 
92  const auto genBin = getBinNumber(obs.genBinning, *genMuons, v);
93  const auto recBin = getBinNumber(obs.recBinning, recMuons, v);
94 
95  const double genMuW = genBin > 0 ? getWeight(*genMuons, v) : 0;
96  const double recMuW = recBin > 0 ? getWeight( recMuons, v) : 0;
97 
98  if (genBin > 0) v.gen->Fill(genBin, gEvW * genMuW);
99 
100  if (genBin > 0 && recBin > 0) {
101  // Good events
102  v.RM ->Fill(genBin, recBin, gEvW * genMuW * rEvW * recMuW);
103  v.missOut->Fill(genBin, gEvW * genMuW * (1 - rEvW * recMuW));
104  } else if (genBin > 0 && recBin <= 0)
105  // Miss
106  v.missOut->Fill(genBin, gEvW * genMuW );
107  else if (genBin <= 0 && recBin >= 0)
108  // Fake
109  v.fakeOut->Fill( recBin, gEvW * rEvW * recMuW);
110 }

◆ fillRec()

list< int > fillRec ( DistVariation v)
overridevirtual

See Filler::fillRec

Reimplemented from Filler.

70 {
71  double evW = rEv->Weight(v);
72  if (obs.isMC) evW *= (*gEv)->Weight(v);
73 
74  const int bin = getBinNumber(obs.recBinning, recMuons, v);
75  if (bin <= 0) return {};
76 
77  const double muW = getWeight(recMuons, v);
78  v.tmp->Fill(bin, evW * muW);
79  v.rec->Fill(bin, evW * muW);
80 
81  return {bin};
82 }

◆ match()

void match ( )
inlineoverridevirtual

Matching is not needed.

Reimplemented from Filler.

75 {}

Member Data Documentation

◆ genMuons

std::optional<TTreeReaderArray<GenMuon> > genMuons

◆ gEv

std::optional<TTreeReaderValue<GenEvent> > gEv

◆ obs

ZPtY obs

Backreference to the observable.

◆ recMuons

TTreeReaderArray<RecMuon> recMuons

◆ rEv

TTreeReaderValue<RecEvent> rEv

The documentation for this struct was generated from the following files:
getBinNumber
double getBinNumber(const Di< Jet, Jet > &MNjets, const Uncertainties::Variation &v, TUnfoldBinning *bng)
Definition: MNjets.cc:47
DAS::Unfolding::DrellYan::ZPtYFiller::recMuons
TTreeReaderArray< RecMuon > recMuons
Definition: ZPtY.h:61
DAS::Unfolding::DistVariation::rec
std::unique_ptr< TH1 > rec
reconstructed-level distribution
Definition: DistVariation.h:32
DAS::Unfolding::DrellYan::ZPtYFiller::rEv
TTreeReaderValue< RecEvent > rEv
Definition: ZPtY.h:63
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:150
DAS::Unfolding::DrellYan::ZPtYFiller::obs
ZPtY obs
Backreference to the observable.
Definition: ZPtY.h:58
DAS::Unfolding::DrellYan::ZPtYFiller::gEv
std::optional< TTreeReaderValue< GenEvent > > gEv
Definition: ZPtY.h:62
DAS::Unfolding::DrellYan::ZPtYFiller::genMuons
std::optional< TTreeReaderArray< GenMuon > > genMuons
Definition: ZPtY.h:60
DAS::Unfolding::Observable::isMC
static bool isMC
Definition: Observable.h:144
DAS::Unfolding::initOptionalBranch
auto initOptionalBranch(TTreeReader &reader, const char *name)
Definition: Observable.h:39
DAS::Unfolding::DistVariation::gen
std::unique_ptr< TH1 > gen
generated-level distribution
Definition: DistVariation.h:34
DAS::Unfolding::DistVariation::tmp
std::unique_ptr< TH1 > tmp
temporary histogram help fill the covariance matrix
Definition: DistVariation.h:33
DAS::Unfolding::DistVariation::RM
std::unique_ptr< TH2 > RM
response matrix
Definition: DistVariation.h:42
DAS::Unfolding::DistVariation::missOut
std::unique_ptr< TH1 > missOut
losses (migration out of phase space)
Definition: DistVariation.h:36
DAS::Unfolding::Observable::recBinning
TUnfoldBinning * recBinning
detector-level binning
Definition: Observable.h:149
DAS::Unfolding::DistVariation::fakeOut
std::unique_ptr< TH1 > fakeOut
background (migration out of phase space)
Definition: DistVariation.h:38