DAS  3.0
Das Analysis System
MjjYbYsFillerfinal

#include <MjjYbYs.h>

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

Public Member Functions

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

MjjYbYs obs
 
std::optional< TTreeReaderArray< GenJet > > genJets
 
TTreeReaderArray< RecJetrecJets
 
std::optional< TTreeReaderValue< GenEvent > > gEv
 
TTreeReaderValue< RecEventrEv
 
std::optional< bool > matched
 

Constructor & Destructor Documentation

◆ MjjYbYsFiller()

MjjYbYsFiller ( const MjjYbYs obs,
TTreeReader &  reader 
)

Constructor.

19  : obs(obs)
20  , genJets(initOptionalBranch<decltype(genJets)>(reader, "genJets"))
21  , recJets(reader, "recJets")
22  , gEv(initOptionalBranch<decltype(gEv)>(reader, "genEvent"))
23  , rEv(reader, "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->GetSize() > 1 && recJets.GetSize() > 1
42  && ( (match(0,0) && match(1,1))
43  || (match(0,1) && match(1,0)) );
44 }

Member Data Documentation

◆ genJets

std::optional<TTreeReaderArray<GenJet> > genJets

◆ gEv

std::optional<TTreeReaderValue<GenEvent> > gEv

◆ matched

std::optional<bool> matched

◆ obs

MjjYbYs obs

Backreference to the observable.

◆ recJets

TTreeReaderArray<RecJet> recJets

◆ 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::DijetMass3D::MjjYbYsFiller::obs
MjjYbYs obs
Backreference to the observable.
Definition: MjjYbYs.h:53
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::Di::Weight
double Weight(const Uncertainties::Variation &v=Uncertainties::nominal) const override
Definition: Di.h:73
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::gEv
std::optional< TTreeReaderValue< GenEvent > > gEv
Definition: MjjYbYs.h:57
DAS::Unfolding::DistVariation::rec
std::unique_ptr< TH1 > rec
reconstructed-level distribution
Definition: DistVariation.h:32
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::matched
std::optional< bool > matched
Definition: MjjYbYs.h:68
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::JetEnergy::w
static const float w
Definition: common.h:47
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:150
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
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
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::rEv
TTreeReaderValue< RecEvent > rEv
Definition: MjjYbYs.h:58
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::genJets
std::optional< TTreeReaderArray< GenJet > > genJets
Definition: MjjYbYs.h:55
DAS::Unfolding::DistVariation::missNoMatch
std::unique_ptr< TH1 > missNoMatch
losses (unmatched entries)
Definition: DistVariation.h:35
DAS::Unfolding::DijetMass3D::MjjYbYsFiller::recJets
TTreeReaderArray< RecJet > recJets
Definition: MjjYbYs.h:56
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:149
DAS::Unfolding::DistVariation::fakeOut
std::unique_ptr< TH1 > fakeOut
background (migration out of phase space)
Definition: DistVariation.h:38
gendijet
DAS::GenDijet gendijet
Definition: classes.h:31
DAS::Unfolding::Observable::maxDR
static double maxDR
max Delta R
Definition: Observable.h:146