DAS  3.0
Das Analysis System
MjjYbYsFillerfinal

#include <MjjYbYs.h>

+ Inheritance diagram for MjjYbYsFiller:
+ Collaboration diagram for MjjYbYsFiller:

Public Member Functions

 MjjYbYsFiller (const MjjYbYs &, 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

MjjYbYs obs
 
std::vector< GenJet > * genJets
 
std::vector< RecJet > * recJets
 
GenEventgEv
 
RecEventrEv
 
std::optional< bool > matched
 

Constructor & Destructor Documentation

◆ MjjYbYsFiller()

MjjYbYsFiller ( const MjjYbYs obs,
Darwin::Tools::Flow flow 
)

Constructor.

19  : obs(obs)
20  , genJets(obs.isMC ? flow.GetBranchReadOnly<vector<GenJet>>("genJets") : nullptr)
21  , recJets(flow.GetBranchReadOnly<vector<RecJet>>("recJets"))
22  , gEv(obs.isMC ? flow.GetBranchReadOnly<GenEvent>("genEvent") : nullptr)
23  , rEv(flow.GetBranchReadOnly<RecEvent>("recEvent"))
24 {
25 }

Member Function Documentation

◆ fillMC()

void fillMC ( DistVariation v)
overridevirtual

See Observable::fillMC

Reimplemented from Filler.

105 {
106  if (!obs.isMC)
107  BOOST_THROW_EXCEPTION( runtime_error(__func__ + " should only be called for MC"s) );
108 
109  auto recdijet = selection(*recJets, v);
110  auto irec = getBinNumber(recdijet, v, obs.recBinning);
111  double recW = rEv->Weight(v);
112  if (irec > 0) recW *= recdijet.Weight(v);
113 
114  auto gendijet = selection(*genJets, v);
115  auto igen = getBinNumber(gendijet, v, obs.genBinning);
116  double genW = gEv->Weight(v);
117  if (igen > 0) genW *= gendijet.Weight(v);
118 
119  if (igen > 0) v.gen->Fill(igen, genW);
120 
121  if (*matched) {
122  if (irec > 0 && igen > 0) { v.RM->Fill(igen, irec, genW * recW );
123  v.missNoMatch->Fill(igen, genW * (1-recW)); }
124  else if (irec == 0 && igen > 0) v.missOut->Fill(igen, genW );
125  else if (irec > 0 && igen == 0) v.fakeOut->Fill( irec, genW * recW );
126  }
127  else {
128  if (igen > 0) v.missNoMatch->Fill(igen, genW );
129  if (irec > 0) v.fakeNoMatch->Fill(irec, genW * recW);
130  }
131 }

◆ fillRec()

list< int > fillRec ( DistVariation v)
overridevirtual

See Observable::fillRec

Reimplemented from Filler.

87 {
88  auto dijet = selection(*recJets, v);
89  if (!dijet) return {};
90 
91  int i = getBinNumber(dijet, v, obs.recBinning);
92  if (i == 0) return {};
93 
94  double w = rEv->Weight(v);
95  if (obs.isMC) w *= gEv->Weight(v);
96  w *= dijet.Weight(v);
97 
98  v.tmp->Fill(i, w);
99  v.rec->Fill(i, w);
100 
101  return list<int>{i};
102 }

◆ match()

void match ( )
overridevirtual

Match the two pairs of leading jets (if any) and set matched member.

Reimplemented from Filler.

28 {
29  matched.reset();
30 
31  auto match = [this](size_t i, size_t j) {
32  const FourVector& g = genJets->at(i).p4,
33  r = recJets->at(j).p4;
34  using ROOT::Math::VectorUtil::DeltaR;
35  auto DR = DeltaR(g, r);
36  //cout << g << '\t' << r << '\t' << DR << '\t' << result << '\n';
37  return DR < obs.maxDR;
38  };
39 
40  // matching (swapping leading and subleading is allowed)
41  matched = genJets->size() > 1 && recJets->size() > 1
42  && ( (match(0,0) && match(1,1))
43  || (match(0,1) && match(1,0)) );
44 }

Member Data Documentation

◆ genJets

std::vector<GenJet>* genJets

◆ gEv

GenEvent* gEv

◆ matched

std::optional<bool> matched

◆ obs

MjjYbYs obs

Backreference to the observable.

◆ recJets

std::vector<RecJet>* recJets

◆ rEv

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::DijetMass3D::MjjYbYsFiller::obs
MjjYbYs obs
Backreference to the observable.
Definition: MjjYbYs.h:52
selection
Di< const Jet, const Jet > selection(const vector< Jet > &jets, const Uncertainties::Variation &v=Uncertainties::nominal)
Mueller-Navelet jet selection.
Definition: MNjets.cc:24
DAS::Di::Weight
double Weight(const Uncertainties::Variation &v=Uncertainties::nominal) const override
Definition: Di.h:73
DAS::Unfolding::DistVariation::rec
std::unique_ptr< TH1 > rec
reconstructed-level distribution
Definition: DistVariation.h:32
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::gEv
GenEvent * gEv
Definition: MjjYbYs.h:56
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::matched
std::optional< bool > matched
Definition: MjjYbYs.h:67
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::match
void match() override
Match the two pairs of leading jets (if any) and set matched member.
Definition: MjjYbYs.cc:27
DAS::RecEvent
Definition: Event.h:52
DAS::JetEnergy::w
static const float w
Definition: common.h:51
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:125
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::rEv
RecEvent * rEv
Definition: MjjYbYs.h:57
DAS::Unfolding::Observable::isMC
static bool isMC
Definition: Observable.h:119
DAS::AbstractEvent::Weight
double Weight(const Uncertainties::Variation &v) const
< weight
Definition: Event.h:25
recdijet
DAS::RecDijet recdijet
Definition: classes.h:34
DAS::Unfolding::DistVariation::gen
std::unique_ptr< TH1 > gen
generated-level distribution
Definition: DistVariation.h:34
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::recJets
std::vector< RecJet > * recJets
Definition: MjjYbYs.h:55
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::genJets
std::vector< GenJet > * genJets
Definition: MjjYbYs.h:54
DAS::Unfolding::DistVariation::tmp
std::unique_ptr< TH1 > tmp
temporary histogram help fill the covariance matrix
Definition: DistVariation.h:33
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::DistVariation::missNoMatch
std::unique_ptr< TH1 > missNoMatch
losses (unmatched entries)
Definition: DistVariation.h:35
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::DistVariation::fakeNoMatch
std::unique_ptr< TH1 > fakeNoMatch
background (unmatched entries)
Definition: DistVariation.h:37
DAS::FourVector
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< float > > FourVector
Definition: PhysicsObject.h:15
DAS::Unfolding::Observable::recBinning
TUnfoldBinning * recBinning
detector-level binning
Definition: Observable.h:124
DAS::Unfolding::DistVariation::fakeOut
std::unique_ptr< TH1 > fakeOut
Definition: DistVariation.h:38
gendijet
DAS::GenDijet gendijet
Definition: classes.h:31
DAS::GenEvent
Definition: Event.h:38
DAS::Unfolding::Observable::maxDR
static double maxDR
max Delta R
Definition: Observable.h:121