DAS  3.0
Das Analysis System
MjjYmaxFillerfinal

#include <MjjYmax.h>

+ Inheritance diagram for MjjYmaxFiller:
+ Collaboration diagram for MjjYmaxFiller:

Public Member Functions

 MjjYmaxFiller (const MjjYmax &, 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

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

Constructor & Destructor Documentation

◆ MjjYmaxFiller()

MjjYmaxFiller ( const MjjYmax 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.

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

◆ fillRec()

list< int > fillRec ( DistVariation v)
overridevirtual

See Observable::fillRec

Reimplemented from Filler.

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

◆ 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

MjjYmax 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
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::DijetMass::MjjYmaxFiller::matched
std::optional< bool > matched
Definition: MjjYmax.h:67
DAS::Unfolding::DijetMass::MjjYmaxFiller::rEv
RecEvent * rEv
Definition: MjjYmax.h:57
DAS::RecEvent
Definition: Event.h:52
DAS::JetEnergy::w
static const float w
Definition: common.h:51
DAS::Unfolding::DijetMass::MjjYmaxFiller::obs
MjjYmax obs
Backreference to the observable.
Definition: MjjYmax.h:52
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:125
DAS::Unfolding::DijetMass::MjjYmaxFiller::match
void match() override
Match the two pairs of leading jets (if any) and set matched member.
Definition: MjjYmax.cc:27
DAS::Unfolding::DijetMass::MjjYmaxFiller::genJets
std::vector< GenJet > * genJets
Definition: MjjYmax.h:54
DAS::Unfolding::DijetMass::MjjYmaxFiller::recJets
std::vector< RecJet > * recJets
Definition: MjjYmax.h:55
DAS::Unfolding::Observable::isMC
static bool isMC
Definition: Observable.h:119
DAS::Unfolding::DijetMass::MjjYmaxFiller::gEv
GenEvent * gEv
Definition: MjjYmax.h:56
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::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:256
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