DAS  3.0
Das Analysis System
MjjYmaxFillerfinal

#include <MjjYmax.h>

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

Public Member Functions

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

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

Constructor & Destructor Documentation

◆ MjjYmaxFiller()

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

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->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

MjjYmax 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
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::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:70
DAS::Unfolding::DijetMass::MjjYmaxFiller::gEv
std::optional< TTreeReaderValue< GenEvent > > gEv
Definition: MjjYmax.h:59
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:55
DAS::Unfolding::Observable::genBinning
TUnfoldBinning * genBinning
particle-level binning
Definition: Observable.h:150
DAS::Unfolding::DijetMass::MjjYmaxFiller::recJets
TTreeReaderArray< RecJet > recJets
Definition: MjjYmax.h:58
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::Observable::isMC
static bool isMC
Definition: Observable.h:144
DAS::Unfolding::DijetMass::MjjYmaxFiller::rEv
TTreeReaderValue< RecEvent > rEv
Definition: MjjYmax.h:60
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::DistVariation::missNoMatch
std::unique_ptr< TH1 > missNoMatch
losses (unmatched entries)
Definition: DistVariation.h:35
DAS::Unfolding::DijetMass::MjjYmaxFiller::genJets
std::optional< TTreeReaderArray< GenJet > > genJets
Definition: MjjYmax.h:57
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