DAS  3.0
Das Analysis System
DEtaDPhiFillerfinal

#include <MNjets.h>

+ Inheritance diagram for DEtaDPhiFiller:
+ Collaboration diagram for DEtaDPhiFiller:

Public Member Functions

 DEtaDPhiFiller (const DEtaDPhi &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

DEtaDPhi obs
 
std::optional< TTreeReaderArray< GenJet > > genJets
 
TTreeReaderArray< RecJetrecJets
 
std::optional< TTreeReaderValue< GenEvent > > gEv
 
TTreeReaderValue< RecEventrEv
 
Di< const GenJet, const GenJetgenMNjets
 
Di< const RecJet, const RecJetrecMNjets
 
std::optional< bool > matched
 

Constructor & Destructor Documentation

◆ DEtaDPhiFiller()

DEtaDPhiFiller ( const DEtaDPhi obs,
TTreeReader &  reader 
)

Constructor.

13  : obs(obs)
14  , genJets(initOptionalBranch<decltype(genJets)>(reader, "genJets"))
15  , recJets(reader, "recJets")
16  , gEv(initOptionalBranch<decltype(gEv)>(reader, "genEvent"))
17  , rEv(reader, "recEvent")
18 {
19 }

Member Function Documentation

◆ fillMC()

void fillMC ( DistVariation v)
overridevirtual

See Filler::fillMC

Reimplemented from Filler.

92 {
93  if (!obs.isMC)
94  BOOST_THROW_EXCEPTION( runtime_error(__func__ + " should only be called for MC"s) );
95 
96  auto irec = getBinNumber(recMNjets, v, obs.recBinning);
97  double recW = rEv->Weight(v);
98  if (irec > 0) recW *= recMNjets.Weight(v);
99 
100  auto igen = getBinNumber(genMNjets, v, obs.genBinning);
101  double genW = (*gEv)->Weight(v);
102  if (igen > 0) genW *= genMNjets.Weight(v);
103 
104  if (igen > 0) v.gen->Fill(igen, genW);
105 
106  if (*matched) {
107  if (irec > 0 && igen > 0) { v.RM->Fill(igen, irec, genW * recW );
108  v.missNoMatch->Fill(igen, genW * (1-recW)); }
109  else if (irec == 0 && igen > 0) v.missOut->Fill(igen, genW );
110  else if (irec > 0 && igen == 0) v.fakeOut->Fill( irec, genW * recW );
111  }
112  else {
113  if (igen > 0) v.missNoMatch->Fill(igen, genW );
114  if (irec > 0) v.fakeNoMatch->Fill(irec, genW * recW);
115  }
116 }

◆ fillRec()

list< int > fillRec ( DistVariation v)
overridevirtual

See Filler::fillRec

Reimplemented from Filler.

60 {
62  if (!recMNjets) return {};
63 
64  int i = getBinNumber(recMNjets, v, obs.recBinning);
65  if (i == 0) return {};
66 
67  double w = rEv->Weight(v);
68  if (obs.isMC) w *= (*gEv)->Weight(v);
69  w *= recMNjets.Weight(v);
70 
71  v.tmp->Fill(i, w);
72  v.rec->Fill(i, w);
73 
74  return list<int>{i};
75 }

◆ match()

void match ( )
overridevirtual

Check if the MN jets can be matched at both levels.

Todo:
is optional necessary? (taken from MjjYmax...)

Reimplemented from Filler.

78 {
79  matched.reset();
80 
81  using ROOT::Math::VectorUtil::DeltaR;
82 
84 
85  // matching (swapping leading and subleading is allowed)
87  && DeltaR(genMNjets.first ->p4, recMNjets.first ->p4) < obs.maxDR
88  && DeltaR(genMNjets.second->p4, recMNjets.second->p4) < obs.maxDR;
89 }

Member Data Documentation

◆ genJets

std::optional<TTreeReaderArray<GenJet> > genJets

◆ genMNjets

Di<const GenJet, const GenJet> genMNjets

◆ gEv

std::optional<TTreeReaderValue<GenEvent> > gEv

◆ matched

std::optional<bool> matched

◆ obs

DEtaDPhi obs

Backreference to the observable.

◆ recJets

TTreeReaderArray<RecJet> recJets

◆ recMNjets

Di<const RecJet, const RecJet> recMNjets

◆ 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
selection
Di< const Jet, const Jet > selection(const TTreeReaderArray< Jet > &jets, const Uncertainties::Variation &v=Uncertainties::nominal)
Mueller-Navelet jet selection.
Definition: MNjets.cc:24
DAS::Unfolding::MNjets::DEtaDPhiFiller::genMNjets
Di< const GenJet, const GenJet > genMNjets
Definition: MNjets.h:59
DAS::Unfolding::MNjets::DEtaDPhiFiller::obs
DEtaDPhi obs
Backreference to the observable.
Definition: MNjets.h:44
DAS::Unfolding::MNjets::DEtaDPhiFiller::recMNjets
Di< const RecJet, const RecJet > recMNjets
Definition: MNjets.h:60
DAS::JetEnergy::w
static const float w
Definition: common.h:51
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:150
DAS::Unfolding::MNjets::DEtaDPhiFiller::rEv
TTreeReaderValue< RecEvent > rEv
Definition: MNjets.h:49
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::MNjets::DEtaDPhiFiller::gEv
std::optional< TTreeReaderValue< GenEvent > > gEv
Definition: MNjets.h:48
DAS::Unfolding::MNjets::DEtaDPhiFiller::genJets
std::optional< TTreeReaderArray< GenJet > > genJets
Definition: MNjets.h:46
DAS::Unfolding::MNjets::DEtaDPhiFiller::recJets
TTreeReaderArray< RecJet > recJets
Definition: MNjets.h:47
DAS::Unfolding::MNjets::DEtaDPhiFiller::matched
std::optional< bool > matched
Definition: MNjets.h:61
DAS::Unfolding::Observable::recBinning
TUnfoldBinning * recBinning
detector-level binning
Definition: Observable.h:149
DAS::Unfolding::Observable::maxDR
static double maxDR
max Delta R
Definition: Observable.h:146