DAS  3.0
Das Analysis System
Ntupliser

#include <Ntupliser.h>

+ Inheritance diagram for Ntupliser:
+ Collaboration diagram for Ntupliser:

Public Types

typedef reco::Particle::LorentzVector LorentzVector
 

Public Member Functions

 Ntupliser (edm::ParameterSet const &cfg)
 
virtual void beginJob () override
 
virtual void analyze (edm::Event const &iEvent, edm::EventSetup const &iSetup) override
 
virtual void endJob () override
 
virtual void beginRun (edm::Run const &iRun, edm::EventSetup const &) override
 
virtual void endRun (edm::Run const &iRun, edm::EventSetup const &) override
 
virtual ~Ntupliser () override
 

Private Member Functions

void reset ()
 
void initialise (edm::Event const &iEvent)
 
bool trigger (edm::Event const &iEvent)
 
void fillMET (edm::Event const &iEvent)
 
void getHLTjets (edm::Event const &iEvent)
 
template<typename MyJetCollection >
void getGenJets (edm::Handle< MyJetCollection > &mygenjets)
 
void getRecJets ()
 
void getGenMuons ()
 
void getRecMuons ()
 
void getGenPhotons ()
 
void getRecPhotons ()
 
void getSecVertices ()
 
void getEventVariables (edm::Event const &iEvent)
 

Private Attributes

DAS::Parameters p
 
DAS::Helper h
 
edm::Handle< reco::GenJetCollection > genjets
 
edm::Handle< pat::JetCollection > recjets
 
edm::Handle< edm::View< reco::Candidate > > genLeptons
 
edm::Handle< pat::MuonCollection > recmuons
 
edm::Handle< pat::PhotonCollection > recphotons
 
edm::Handle< pat::METCollection > met
 
edm::Handle< double > rho
 
edm::Handle< reco::VertexCollection > recVtxs
 
edm::Handle< edm::TriggerResults > triggerResults
 
edm::Handle< edm::TriggerResults > metResults
 
edm::Handle< pat::PackedTriggerPrescales > triggerPrescales
 
edm::Handle< pat::PackedTriggerPrescales > triggerPrescalesl1min
 
edm::Handle< pat::PackedTriggerPrescales > triggerPrescalesl1max
 
edm::Handle< pat::TriggerObjectStandAloneCollection > triggerObjects
 
edm::Handle< GenEventInfoProduct > genEvtInfo
 
edm::Handle< reco::GenParticleCollection > genParticles
 
edm::Handle< reco::JetFlavourInfoMatchingCollection > theJetFlavourInfos
 
edm::Handle< std::vector< reco::VertexCompositePtrCandidate > > SVs
 
edm::Handle< std::vector< PileupSummaryInfo > > pileupInfo
 
edm::Handle< LHEEventProduct > lheEvent
 
edm::Service< TFileService > fs_
 
TTree * tree
 
Darwin::Tools::UserInfo metainfo
 
std::vector< DAS::RecJet > * recJets_
 
std::vector< DAS::FourVector > * HLTjets_
 
std::vector< DAS::GenJet > * genJets_
 
std::vector< DAS::RecMuon > * recMuons_
 
std::vector< DAS::GenMuon > * genMuons_
 
std::vector< DAS::RecPhoton > * recPhotons_
 
std::vector< DAS::GenPhoton > * genPhotons_
 
DAS::TriggerjetTrigger_
 
DAS::TriggermuonTrigger_
 
DAS::TriggerzbTrigger_
 
DAS::GenEventgenEvent_
 
DAS::RecEventrecEvent_
 
DAS::METmet_
 
DAS::PileUppileup_
 
DAS::PrimaryVertexprimaryvertex_
 
std::vector< DAS::PrimaryVertex > * recPVs_
 
std::vector< DAS::PrimaryVertex > * genPVs_
 
boost::property_tree::ptree pileup_json
 
std::vector< std::string > genweight_ids
 

Member Typedef Documentation

◆ LorentzVector

typedef reco::Particle::LorentzVector LorentzVector

Constructor & Destructor Documentation

◆ Ntupliser()

Ntupliser ( edm::ParameterSet const &  cfg)
explicit

Constructor, only initialising the members.

41  :
42  p(cfg, consumesCollector()), h(p),
43  tree(fs_->make<TTree>("events","events")),
45  // jets
46  recJets_(p.jets ? new vector<DAS::RecJet> : nullptr),
47  HLTjets_(p.jets && p.triggers ? new vector<DAS::FourVector> : nullptr),
48  genJets_(p.jets && p.isMC ? new vector<DAS::GenJet> : nullptr),
49  // muons
50  recMuons_( p.muons ? new vector<DAS::RecMuon> : nullptr),
51  genMuons_(p.isMC && p.muons ? new vector<DAS::GenMuon> : nullptr),
52  // photons
53  recPhotons_( p.photons ? new vector<DAS::RecPhoton> : nullptr),
54  genPhotons_(p.isMC && p.photons ? new vector<DAS::GenPhoton> : nullptr),
55  // event variables
56  jetTrigger_ (p.triggers ? new DAS::Trigger : nullptr),
57  muonTrigger_ (p.triggers ? new DAS::Trigger : nullptr),
58  zbTrigger_ (p.triggers ? new DAS::Trigger : nullptr),
59  genEvent_ (p.isMC ? new DAS::GenEvent : nullptr),
60  recEvent_ ( new DAS::RecEvent ),
61  met_ (new DAS::MET ),
62  pileup_ (new DAS::PileUp ),
64  recPVs_ (new vector<DAS::PrimaryVertex>),
65  genPVs_ (new vector<DAS::PrimaryVertex>)
66 {
67  cout << __FILE__ << ':' << __func__ << endl;
68 
69  using namespace DAS;
70 
71  if (p.photons) // photon variations
72  for (TString source: RecPhoton::uncs) {
73  metainfo.Set<TString>("variations", RecPhoton::ScaleVar, source + SysDown);
74  metainfo.Set<TString>("variations", RecPhoton::ScaleVar, source + SysUp);
75  }
76 }
77 catch (boost::exception& e) {
78  throw cms::Exception("Ntupliser") << boost::diagnostic_information(e);
79 }

◆ ~Ntupliser()

~Ntupliser ( )
overridevirtual
739 {
740  cout << __FILE__ << ':' << __func__ << endl;
741 }

Member Function Documentation

◆ analyze()

void analyze ( edm::Event const &  iEvent,
edm::EventSetup const &  iSetup 
)
overridevirtual
340 {
341  // reset and initialise member variables (filled to the tree)
342  reset();
343  initialise(iEvent);
344 
345  // check trigger
346  if (p.triggers) {
347  bool passTrigger = trigger(iEvent);
348  if (!p.isMC && !passTrigger) return;
349  if (p.jets)
350  getHLTjets(iEvent); //Fill High-Level-Trigger jets
351  }
352  fillMET(iEvent);
353 
354  // event variables
355  getEventVariables(iEvent);
356 
357  // jet variables
358  if (p.jets) {
359  getRecJets();
360  if (p.isMC) {
361  if (p.flavour)
363  else
365  }
366  }
367 
368  // muon variables
369  if (p.muons) {
370  getRecMuons();
371  if (p.isMC)
372  getGenMuons();
373  }
374 
375  // photon variables
376  if (p.photons) {
377  getRecPhotons();
378  if (p.isMC)
379  getGenPhotons();
380  }
381 
382  tree->Fill();
383 }

◆ beginJob()

void beginJob ( )
overridevirtual

Called before looping over the events.

Basically, it set up the branches.

235 {
236  cout << __FILE__ << ':' << __func__ << endl;
237 
238  if (!p.isMC) {
239  const auto luminosity = p.config.get_child_optional("luminosity");
240  if (luminosity && luminosity->count("pileup")) {
241  auto pileup = luminosity->get<fs::path>("pileup");
242  cout << "Extracting pileup normalisation from " << pileup << endl;
243  if (p.sandbox) pileup = pileup.filename();
244  if (!fs::exists(pileup))
245  throw cms::Exception("Ntupliser") << pileup << " could not be found";
246  pt::read_json(pileup.string(), pileup_json);
247  }
248  else cout << "\x1B[33mNo input pileup normalisation\x1B[0m" << endl;
249  }
250 
251  // event
252  if (p.isMC)
253  tree->Branch("genEvent",&genEvent_);
254  tree->Branch("recEvent",&recEvent_);
255  if (p.triggers) {
256  tree->Branch("jetTrigger",&jetTrigger_);
257  tree->Branch("muonTrigger",&muonTrigger_);
258  tree->Branch("zbTrigger",&zbTrigger_);
259  }
260 
261  tree->Branch("pileup",&pileup_);
262  tree->Branch("primaryvertex",&primaryvertex_);
263  tree->Branch("recPVs",&recPVs_);
264  tree->Branch("genPVs",&genPVs_);
265  tree->Branch("met",&met_);
266 
267  // jets
268  if (p.jets) {
269  tree->Branch("recJets",&recJets_);
270  if (p.triggers)
271  tree->Branch("hltJets", &HLTjets_);
272  if (p.isMC)
273  tree->Branch("genJets", &genJets_);
274  }
275 
276  // muons
277  if (p.muons) {
278  tree->Branch("recMuons",&recMuons_);
279  if (p.isMC)
280  tree->Branch("genMuons", &genMuons_);
281  }
282 
283  // photons
284  if (p.photons) {
285  tree->Branch("recPhotons", &recPhotons_);
286  if (p.isMC)
287  tree->Branch("genPhotons", &genPhotons_);
288  }
289 }

◆ beginRun()

void beginRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual
298 {
299  cout << __FILE__ << ':' << __func__ << endl;
300 
301  if (!p.genWgts)
302  return;
303 
304  // The usual way would be to use a token, but apparently,
305  // it does not work in `beginRun` (whereas it would in `endRun`).
306  //iRun.getByToken(p.lheRunInfoToken, lheRunInfo);
307  edm::Handle<LHERunInfoProduct> lheRunInfo;
308  iRun.getByLabel(p.lheLabel, lheRunInfo);
309 
310  // Extract the XML fragment starting at <weightgroup> from the LHE headers
311  string xmlText = h.BufferWeightGroupXML(*lheRunInfo);
312 
313  // If we never saw "<weightgroup", bail out
314  if (xmlText.empty())
315  throw cms::Exception("Ntupliser") << "<weightgroup> tag not found in headers";
316 
317  // Parse the buffered XML directly
318  tinyxml2::XMLDocument doc;
319  tinyxml2::XMLError err = doc.Parse(xmlText.c_str());
320  if (err != tinyxml2::XML_SUCCESS)
321  throw cms::Exception("Ntupliser") << "XML parse error: " << doc.ErrorStr();
322 
323  // Scan the XML document and fill scale_ids/pdf_ids based on scaleChoice and PDF group
325 
326  auto scale_variations = h.GetScaleVariations(doc, p.scale_choice_);
327  auto pdfCount = h.CountPDFWeights(doc, p.pdf_);
328  // Set metainfo for each variation
329  for (auto const& name : scale_variations)
330  metainfo.Set<int>("variations", DAS::GenEvent::WeightVar, name.c_str(), 1);
331  metainfo.Set<int>("variations", DAS::GenEvent::WeightVar, "NNPDF", pdfCount);
332 }

◆ endJob()

void endJob ( )
overridevirtual
292 {
293  cout << __FILE__ << ':' << __func__ << endl;
294  metainfo.Set<bool>("git", "complete", true);
295 }

◆ endRun()

void endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual
335 {
336  cout << __FILE__ << ':' << __func__ << endl;
337 }

◆ fillMET()

void fillMET ( edm::Event const &  iEvent)
private

Fill the MET flags to the array.

578 {
579  const edm::TriggerNames &namesMet = iEvent.triggerNames(*metResults);
580  for(unsigned int k=0; k < p.metNames_.size(); ++k) {
581  bool bit(false);
582  for(unsigned int itrig=0; itrig<metResults->size(); ++itrig) {
583  string met_name = string(namesMet.triggerName(itrig));
584  if (met_name == p.metNames_[k]) {
585  bit = metResults->accept(itrig);
586  break;
587  }
588  }
589  met_->Bit.push_back(bit);
590  }
591 }

◆ getEventVariables()

void getEventVariables ( edm::Event const &  iEvent)
private

Gets information about the event (run number, etc.), the pile-up, the MET and the primary vertex.

https://cmsdoxygen.web.cern.ch/cmsdoxygen/CMSSW_10_6_19/doc/html/d9/d53/classPileupSummaryInfo.html

Todo:
std::vector::emplace_back()
Todo:
check out-of-time pileup
Todo:
compare to (*met)[0].pt() to (*met)[0].uncorPt()
637 {
638  // event
639  recEvent_->runNo = iEvent.id().run(); // note: always 1 for MC
640  recEvent_->evtNo = iEvent.id().event();
641  recEvent_->lumi = iEvent.id().luminosityBlock();
642 
643  recEvent_->weights.resize(1);
644  recEvent_->weights.front() = 1;
645 
646  if (p.isMC) {
647  genEvent_->hard_scale = genEvtInfo->qScale();
648  if (p.genWgts) {
649 
650  // model variations
651  const auto& wgt_infos = lheEvent->weights();
652  for (const gen::WeightsInfo& wgt_info: wgt_infos) {
653  if (std::find(genweight_ids.begin(), genweight_ids.end(), wgt_info.id) != genweight_ids.end()) {
654  DAS::Weight weight{wgt_info.wgt, 0};
655  genEvent_->weights.push_back(weight);
657  }
658  }
659  // --- new check: make sure we found exactly the number we expected ---
660  const auto found = genEvent_->weights.size();
661  const auto expected = genweight_ids.size();
662  if (found != expected)
663  throw cms::Exception("Ntupliser")
664  << "Expected " << expected
665  << " generator weights, but found "
666  << found << ".";
667  }
668  else {
669  genEvent_->weights.resize(1);
670  genEvent_->weights.front() = genEvtInfo->weight();
671  }
672  }
673 
674  // pile-up
675  // https://cmsdoxygen.web.cern.ch/cmsdoxygen/CMSSW_12_4_0/doc/html/d9/d53/classPileupSummaryInfo.html
676  pileup_->rho = *rho;
677  pileup_->nVtx = recVtxs->size();
678  if (p.isMC)
679  for(auto PUI = pileupInfo->begin(); PUI != pileupInfo->end(); ++PUI) {
680  if (PUI->getBunchCrossing() != 0) continue;
681 
682  // for pile-up profile correction
683  // Adapted from [TWiki](https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupJSONFileforData):
684  // In order to do reasonable comparisons between data and MC, it is necessary to understand exactly what the histogram produced by pileupCalc.py means so that it can be compared with the correct quantity in MC.
685  // The way that pileup events are generated in MC, given an input pileup distribution, is as follows:
686  pileup_->trpu = PUI->getTrueNumInteractions(); // average pileup conditions under which the event is generated
687  pileup_->intpu = PUI->getPU_NumInteractions(); // the number of pileup events for the in-time bunch crossing is selected from a Poisson distribution with a mean equal to the "true" pileup
688 
689  // for pile-up staub cleaning
690  auto &ptHatVec = PUI->getPU_pT_hats();
691  pileup_->pthats = ptHatVec;
692 
693  const vector<edm::EventID>& evtIDs = PUI->getPU_EventID();
694  for (const auto& evtID: evtIDs)
695  pileup_->MBevents.push_back(evtID.event());
696  }
697  else if (pileup_json.size() > 0) {
698  auto runNo = to_string(iEvent.id().run());
699  auto run = pileup_json.get_child_optional(runNo);
700  if (!run)
701  throw cms::Exception("Ntupliser") << runNo << " could not be found in the pileup latest file";
702  for (auto& LS: *run) {
703  auto it = LS.second.begin(); // ["LS", "inst lumi", "xsec RMS", "av xsec"]
704  auto LSno = it->second.get_value<unsigned int>(); // LS
705  if (LSno != iEvent.id().luminosityBlock()) continue;
706  ++it; //auto instLumi = it->second.get_value<float>(); // inst lumi
707  ++it; //auto xsecRMS = it->second.get_value<float>(); // xsec RMS
708  ++it; auto avXsec = it->second.get_value<float>(); // av xsec
709  pileup_->trpu = avXsec * DAS::PileUp::MBxsec;
710  break;
711  }
712  }
713 
714  // primary vertex
715  const auto& PV = (*recVtxs)[0];
716  primaryvertex_->Rho = PV.position().Rho();
717  primaryvertex_->z = PV.z();
718  primaryvertex_->ndof = PV.ndof();
719  primaryvertex_->chi2 = PV.chi2();
720  primaryvertex_->fake = PV.isFake();
721  for (const auto& PV: *recVtxs){
722  recPVs_->emplace_back(PV.position().Rho(), PV.z(), PV.chi2(), PV.ndof(), PV.isFake());
723  }
724  if (p.isMC) {
725  const auto& gv = (*genParticles)[0].daughter(0)->vertex();
726  genPVs_->emplace_back(gv.Rho(), gv.z(), 0, 0, false);
727  }
728 
729  // MET
730  met_->Et = (*met)[0].et();
731  met_->SumEt = (*met)[0].sumEt();
732  met_->Pt = (*met)[0].pt();
733  met_->Phi = (*met)[0].phi();
734  // https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections#Type_I_Correction_Propagation_of
735  // https://twiki.cern.ch/twiki/bin/view/CMS/MissingETUncertaintyPrescription
736 }

◆ getGenJets()

void getGenJets ( edm::Handle< MyJetCollection > &  mygenjets)
private

Finds the reconstructed jets, and applies some hard cuts on the phase space.

MyJetCollection is expected to be either JetCollection or JetFlavourInfoMatchingCollection (according to the flavour flag)

Todo:
externalize option for phase space cut
Note
slimmedJets are only defined from 10 GeV
148 {
149  //for ((typename MyJetCollection)::const_iterator itJet = mygenjets->begin();
150  for (auto itJet = mygenjets->begin();
151  itJet != mygenjets->end(); ++itJet) {
152 
153  // we convert the complicated CMSSW object to our simple DAS object
154  DAS::GenJet genjet = h.GetGenJet(*itJet);
155 
156  // we keep only jet with pt > 20 GeV and in the tracker acceptance
157  //if (genjet.p4.Pt() < 10 /* GeV */ || abs(genjet.p4.Eta()) > 5.0) continue;
160 
161  genJets_->push_back(genjet);
162  }
163 
164  Sort<DAS::GenJet>(genJets_);
165 }

◆ getGenMuons()

void getGenMuons ( )
private

Finds the generated muons, and applies some hard cuts on the phase space.

84 {
85  for (const reco::Candidate &lepton: *genLeptons) {
86  if (abs(lepton.pdgId()) != 13) continue;
87 
88  // we convert the complicated CMSSW object to our simple DAS object
89  DAS::GenMuon genmu = h.GetGenMu(lepton);
90 
91  // we keep only get with pt > 15 GeV and |eta| < 3.0 (to have a margin
92  // w.r.t. tracker acceptance and treat migrations)
93  if (genmu.p4.Pt() < 10 /* GeV */ || abs(genmu.p4.Eta()) > 3.0) continue;
94 
95  genMuons_->push_back(genmu);
96  }
97 
98  Sort<DAS::GenMuon>(genMuons_);
99 }

◆ getGenPhotons()

void getGenPhotons ( )
private

Finds the generated photons and applies some hard cuts to the phase space.

111 {
112  // Collect charged leptons that would be dressed
113  vector<const reco::GenParticle *> charged_leptons;
114  for (const reco::GenParticle &gp: *genParticles) {
115  auto id = abs(gp.pdgId());
116  if (gp.status() == 1 && (id == 11 || id == 13))
117  charged_leptons.push_back(&gp);
118  }
119 
120  for (const reco::GenParticle &gp: *genParticles) {
121  // Consider stable (status 1) photons
122  if (gp.status() != 1 || gp.pdgId() != 22) continue;
123 
124  // Phase space cuts
125  const bool zAncestor = hasZAncestor(gp);
126  if (zAncestor && gp.pt() < 1) continue;
127  if (!zAncestor && (gp.pt() < 10 || abs(gp.eta()) > 3.0)) continue;
128 
129  // We store dressed leptons. Remove any photon falling within the
130  // dressing cones, since we'd have no way of removing them afterwards.
131  if (any_of(charged_leptons.begin(), charged_leptons.end(),
132  [gp](auto lep) { return reco::deltaR(lep->p4(), gp.p4()) < 0.1; }))
133  continue;
134 
135  genPhotons_->push_back(h.GetGenPhoton(gp, zAncestor));
136  }
137 
138  Sort<DAS::GenPhoton>(genPhotons_);
139 }

◆ getHLTjets()

void getHLTjets ( edm::Event const &  iEvent)
private

Finds HLT jets and simply stores them in a FourVector.

596 {
597  const auto &names = iEvent.triggerNames(*triggerResults);
598 
599  // loop over all possible triggers and only keep object from the PFJet
600  // triggers
601  for (pat::TriggerObjectStandAlone obj: *triggerObjects){
602  obj.unpackPathNames(names);
603  //vector<string> pathNamesAll = obj.pathNames(false);
604  vector<string> pathNamesLast = obj.pathNames(true);
605 
606  // first, look if the HLT object is a HLT jet
607  bool isHLTjet = false;
608  string sNow;
609  for (auto s: pathNamesLast) {
610  s = DelLastDigits(s); // remove the version of the trigger (i.e. HLT_PFJetXX_v*)
611  if (p.HLTjet_triggerNames.count(s) == 0) continue; // typically ignore mu triggers
612  isHLTjet = true;
613  sNow = s;
614  break;
615  }
616 
617  // then add it unless it has already been added
618  if(isHLTjet) {
619  DAS::FourVector P4(obj.pt(), obj.eta(), obj.phi(), obj.mass());
620  bool isIn = false;
621  for(const auto &v : *HLTjets_)
622  if(v == P4) {isIn = true; break;}
623  if(!isIn)
624  HLTjets_->push_back(P4);
625  }
626  }
627 
628  Sort<DAS::FourVector>(HLTjets_);
629 }

◆ getRecJets()

void getRecJets ( )
private

Finds the reconstructed jets, and applies some hard cuts on the phase space.

Todo:
externalize option for phase space cut
209 {
210  for(pat::JetCollection::const_iterator itJet = recjets->begin();
211  itJet != recjets->end(); ++itJet) {
212 
213  // we convert the complicated CMSSW object to our simple DAS object
214  DAS::RecJet recjet = h.GetRecJet(*itJet);
215 
216  // we keep all jets and give set the weight to 0 for jets not fullfiling the quality criterion
217  if (!h.JetID(*itJet)) recjet.weights.front() = 0.;
218 
219  // we keep only jet with pt > 20 GeV and in the tracker acceptance
220  //if (recjet.p4.Pt() < 10 /* GeV */ || abs(recjet.p4.Eta()) > 5.0) continue;
222  // (note: slimmedJets are only defined from 10 GeV)
223 
224  recJets_->push_back(recjet);
225  }
226 
227  Sort<DAS::RecJet>(recJets_);
228 }

◆ getRecMuons()

void getRecMuons ( )
private

Finds the reconstructed muons, and applies some hard cuts on the phase space.

170 {
171  for(pat::MuonCollection::const_iterator itMu = recmuons->begin();
172  itMu != recmuons->end(); ++itMu) {
173 
174  // we convert the complicated CMSSW object to our simple DAS object
175  DAS::RecMuon recmu = h.GetRecMu(*itMu);
176 
177  // we keep only muons with pt > 10 GeV and in the muon chamber acceptance
178  if (recmu.p4.Pt() < 10 /* GeV */ || abs(recmu.p4.Eta()) > 2.4) continue;
179 
180  recMuons_->push_back(recmu);
181  }
182 
183  Sort<DAS::RecMuon>(recMuons_);
184 }

◆ getRecPhotons()

void getRecPhotons ( )
private

Finds the reconstructed photons, and applies some hard cuts on the phase space.

189 {
190  for (pat::PhotonCollection::const_iterator it = recphotons->begin();
191  it != recphotons->end(); ++it) {
192 
193  // we convert the complicated CMSSW object to our simple DAS object
195 
196  // we keep only photons with pt > 5 GeV
197  if (recphoton.p4.Pt() < 5 /* GeV */) continue;
198 
199  recPhotons_->push_back(recphoton);
200  }
201 
202  Sort<DAS::RecPhoton>(recPhotons_);
203 }

◆ getSecVertices()

void getSecVertices ( )
private

◆ initialise()

void initialise ( edm::Event const &  iEvent)
private

Called at the beginning of each new event.

427 {
428  // jets
429  if (p.isMC) {
430  iEvent.getByToken(p.lheEventToken, lheEvent);
431  iEvent.getByToken(p.genEvtInfoToken, genEvtInfo);
432  if (p.jets) {
433  iEvent.getByToken(p.genjetsToken, genjets);
434  if (p.flavour)
435  iEvent.getByToken(p.jetFlavourInfosToken, theJetFlavourInfos );
436  }
437  iEvent.getByToken(p.genParticlesToken, genParticles);
438  }
439  if (p.jets)
440  iEvent.getByToken(p.recjetsToken, recjets);
441 
442  // muons
443  if (p.muons) {
444  if (p.isMC)
445  iEvent.getByToken(p.genLeptonsToken, genLeptons);
446  iEvent.getByToken(p.recmuonsToken, recmuons);
447  }
448 
449  // photons
450  if (p.photons)
451  iEvent.getByToken(p.recphotonsToken, recphotons);
452 
453  // pile-up
454  if (p.isMC)
455  iEvent.getByToken(p.pileupInfoToken, pileupInfo);
456  iEvent.getByToken(p.rhoToken,rho);
457 
458  // vertex
459  iEvent.getByToken(p.recVtxsToken,recVtxs);
460 
461  // trigger
462  if (p.triggers) {
463  iEvent.getByToken(p.triggerResultsToken, triggerResults);
464  iEvent.getByToken(p.triggerObjectsToken, triggerObjects);
465 
466  // HLT
467  iEvent.getByToken(p.triggerPrescalesToken,triggerPrescales);
468 
469  // L1
472  }
473 
474  // MET
475  iEvent.getByToken(p.metToken,met);
476  iEvent.getByToken(p.metResultsToken, metResults);
477 }

◆ reset()

void reset ( )
private

Just a common method to reset all branches at each new event.

388 {
389  if (p.isMC)
390  genEvent_->clear();
391  recEvent_->clear();
392 
393  if (p.triggers) {
394  jetTrigger_->clear();
395  muonTrigger_->clear();
396  }
397  pileup_->clear();
399  recPVs_->clear();
400  genPVs_->clear();
401  met_->clear();
402 
403  if (p.jets) {
404  if (p.isMC)
405  genJets_->clear();
406  if (p.triggers)
407  HLTjets_->clear();
408  recJets_->clear();
409  }
410 
411  if (p.muons) {
412  recMuons_->clear();
413  if (p.isMC)
414  genMuons_->clear();
415  }
416 
417  if (p.photons) {
418  recPhotons_->clear();
419  if (genPhotons_)
420  genPhotons_->clear();
421  }
422 }

◆ trigger()

bool trigger ( edm::Event const &  iEvent)
private

Finds the bits corresponding to the HLT jet pt triggers.

491 {
492  const auto &names = iEvent.triggerNames(*triggerResults);
493 
494  bool passTrigger(false);
495  for (unsigned int k = 0; k < p.triggerNames_.size(); ++k) {
496  bool bit(false);
497  int preHLT(1), preL1min(1), preL1max(1);
498  string name;
499 
500  for (unsigned int itrig = 0; itrig < triggerResults->size(); ++itrig) {
501  name = names.triggerName(itrig);
502 
503  //--- erase the the version number----
504  name = DelLastDigits(name);
505  if (name != p.triggerNames_[k]) continue;
506 
507  bit = triggerResults->accept(itrig);
508  // indirect way of testing the CMSSW version is to check the GCC version
509 #if __GNUC__ < 12 // Run 2 (CMSSW_12, GCC 10)
510  preHLT = triggerPrescales->getPrescaleForIndex(itrig);
511  preL1min = triggerPrescalesl1min->getPrescaleForIndex(itrig);
512  preL1max = triggerPrescalesl1max->getPrescaleForIndex(itrig);
513 #else // Run 3 (CMSSW_13, GCC 12)
514  preHLT = triggerPrescales->getPrescaleForIndex<double>(itrig);
515  preL1min = triggerPrescalesl1min->getPrescaleForIndex<double>(itrig);
516  preL1max = triggerPrescalesl1max->getPrescaleForIndex<double>(itrig);
517 #endif
518  break;
519  }
520  if (name == "HLTriggerFinalPath"){
521  string triggermenu;
522  for (unsigned int itrig = 0; itrig < triggerResults->size(); ++itrig) triggermenu += names.triggerName(itrig) + " ";
523  throw cms::Exception("Ntupliser") << p.triggerNames_[k] << " could not be found in the trigger menu:\n" << triggermenu;
524  }
525  //--- if at least one monitored trigger has fired passTrigger becomes true
526  passTrigger += bit;
527 
528  // Identify trigger collection
529  regex jetTriggerpattern("HLT_(AK4|AK8|HI|HIAK4|HIAK8|Di)?PFJet");
530  regex muonTriggerpattern("HLT_(Mu|IsoMu|TkMu)");
531  regex zbTriggerpattern("HLT_ZeroBias");
532  // example for Run18A (both low & high pt jets)
533  // HLT_PFJet40_v 153 153
534  // HLT_PFJet60_v 154 154
535  // HLT_PFJet80_v 155 155
536  // HLT_PFJet140_v 156 156
537  // HLT_PFJet200_v 157 157
538  // HLT_PFJet260_v 158 158
539  // HLT_PFJet320_v 159 159
540  // HLT_PFJet400_v 160 160
541  // HLT_PFJet450_v 161 161
542  // HLT_PFJet500_v 162 162
543  // HLT_PFJet550_v 163 163
544  if (regex_search(name, jetTriggerpattern)) {
545  jetTrigger_->Bit.push_back(bit);
546  jetTrigger_->PreHLT.push_back(preHLT);
547  jetTrigger_->PreL1min.push_back(preL1min);
548  jetTrigger_->PreL1max.push_back(preL1max);
549  }
550  // HLT_IsoMu24_eta2p1_v
551  // HLT_IsoMu24_v
552  // HLT_IsoMu27_v
553  // HLT_IsoMu30_v
554  // HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_DZ_v
555  // HLT_Mu17_TrkIsoVVL_Mu8_TrkIsoVVL_v
556  // HLT_Mu19_TrkIsoVVL_Mu9_TrkIsoVVL_DZ_v
557  // HLT_Mu19_TrkIsoVVL_Mu9_TrkIsoVVL_v
558  else if (regex_search(name, muonTriggerpattern)) {
559  muonTrigger_->Bit.push_back(bit);
560  muonTrigger_->PreHLT.push_back(preHLT);
561  muonTrigger_->PreL1min.push_back(preL1min);
562  muonTrigger_->PreL1max.push_back(preL1max);
563  }
564  else if (regex_search(name, zbTriggerpattern)) {
565  zbTrigger_->Bit.push_back(bit);
566  zbTrigger_->PreHLT.push_back(preHLT);
567  zbTrigger_->PreL1min.push_back(preL1min);
568  zbTrigger_->PreL1max.push_back(preL1max);
569  }
570  else throw cms::Exception("Ntupliser") << "No dedicated collection in the n-tupliser exists for " << name;
571  }
572  return passTrigger;
573 }

Member Data Documentation

◆ fs_

edm::Service<TFileService> fs_
private

◆ genEvent_

DAS::GenEvent* genEvent_
private

◆ genEvtInfo

edm::Handle<GenEventInfoProduct> genEvtInfo
private

◆ genjets

edm::Handle<reco::GenJetCollection> genjets
private

◆ genJets_

std::vector<DAS::GenJet>* genJets_
private

◆ genLeptons

edm::Handle<edm::View<reco::Candidate> > genLeptons
private

◆ genMuons_

std::vector<DAS::GenMuon>* genMuons_
private

◆ genParticles

edm::Handle<reco::GenParticleCollection> genParticles
private

◆ genPhotons_

std::vector<DAS::GenPhoton>* genPhotons_
private

◆ genPVs_

std::vector<DAS::PrimaryVertex>* genPVs_
private

◆ genweight_ids

std::vector<std::string> genweight_ids
private

◆ h

DAS::Helper h
private

◆ HLTjets_

std::vector<DAS::FourVector>* HLTjets_
private

◆ jetTrigger_

DAS::Trigger* jetTrigger_
private

◆ lheEvent

edm::Handle<LHEEventProduct> lheEvent
private

◆ met

edm::Handle<pat::METCollection> met
private

◆ met_

DAS::MET* met_
private

◆ metainfo

Darwin::Tools::UserInfo metainfo
private

◆ metResults

edm::Handle<edm::TriggerResults> metResults
private

◆ muonTrigger_

DAS::Trigger * muonTrigger_
private

◆ p

DAS::Parameters p
private

◆ pileup_

DAS::PileUp* pileup_
private

◆ pileup_json

boost::property_tree::ptree pileup_json
private

pileup "latest"

◆ pileupInfo

edm::Handle<std::vector<PileupSummaryInfo> > pileupInfo
private

◆ primaryvertex_

DAS::PrimaryVertex* primaryvertex_
private

◆ recEvent_

DAS::RecEvent* recEvent_
private

◆ recjets

edm::Handle<pat::JetCollection> recjets
private

◆ recJets_

std::vector<DAS::RecJet>* recJets_
private

◆ recmuons

edm::Handle<pat::MuonCollection> recmuons
private

◆ recMuons_

std::vector<DAS::RecMuon>* recMuons_
private

◆ recphotons

edm::Handle<pat::PhotonCollection> recphotons
private

◆ recPhotons_

std::vector<DAS::RecPhoton>* recPhotons_
private

◆ recPVs_

std::vector<DAS::PrimaryVertex>* recPVs_
private

◆ recVtxs

edm::Handle<reco::VertexCollection> recVtxs
private

◆ rho

edm::Handle<double> rho
private

◆ SVs

edm::Handle<std::vector<reco::VertexCompositePtrCandidate> > SVs
private

◆ theJetFlavourInfos

edm::Handle<reco::JetFlavourInfoMatchingCollection> theJetFlavourInfos
private

◆ tree

TTree* tree
private

◆ triggerObjects

edm::Handle<pat::TriggerObjectStandAloneCollection> triggerObjects
private

◆ triggerPrescales

edm::Handle<pat::PackedTriggerPrescales> triggerPrescales
private

◆ triggerPrescalesl1max

edm::Handle<pat::PackedTriggerPrescales> triggerPrescalesl1max
private

◆ triggerPrescalesl1min

edm::Handle<pat::PackedTriggerPrescales> triggerPrescalesl1min
private

◆ triggerResults

edm::Handle<edm::TriggerResults> triggerResults
private

◆ zbTrigger_

DAS::Trigger * zbTrigger_
private

The documentation for this class was generated from the following files:
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.name
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
Ntupliser::genjets
edm::Handle< reco::GenJetCollection > genjets
Definition: Ntupliser.h:64
DAS::Parameters::pileupInfoToken
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupInfoToken
Definition: Parameters.h:97
Ntupliser::zbTrigger_
DAS::Trigger * zbTrigger_
Definition: Ntupliser.h:95
DAS::Parameters::recjetsToken
edm::EDGetTokenT< pat::JetCollection > recjetsToken
Definition: Parameters.h:71
DAS
Definition: applyBTagSF.cc:31
DAS::Parameters::lheEventToken
edm::EDGetTokenT< LHEEventProduct > lheEventToken
Definition: Parameters.h:101
DAS::Parameters::triggerPrescalesl1maxToken
edm::EDGetTokenT< pat::PackedTriggerPrescales > triggerPrescalesl1maxToken
Definition: Parameters.h:90
DAS::Helper::GetGenJet
DAS::GenJet GetGenJet(const reco::JetFlavourInfoMatching &ijet)
Helper to get DAS::GenJet from MiniAOD with flavour.
Definition: helper.cc:30
Ntupliser::metResults
edm::Handle< edm::TriggerResults > metResults
Definition: Ntupliser.h:72
Ntupliser::genPhotons_
std::vector< DAS::GenPhoton > * genPhotons_
Definition: Ntupliser.h:94
Ntupliser::getRecPhotons
void getRecPhotons()
Finds the reconstructed photons, and applies some hard cuts on the phase space.
Definition: Ntupliser.cc:188
DAS::PhysicsObject::p4
FourVector p4
raw four-momentum directly after reconstruction
Definition: PhysicsObject.h:50
DAS::PileUp::trpu
float trpu
true pile-up
Definition: Event.h:104
DAS::Parameters::metToken
edm::EDGetTokenT< pat::METCollection > metToken
Definition: Parameters.h:87
DAS::Helper::GetGenMu
DAS::GenMuon GetGenMu(const reco::Candidate &mu)
Helper to get DAS::GenMuon from MiniAOD.
Definition: helper.cc:152
DAS::Parameters::genLeptonsToken
edm::EDGetTokenT< edm::View< reco::Candidate > > genLeptonsToken
Definition: Parameters.h:78
DAS::Parameters::scale_choice_
std::string scale_choice_
Scale variation substring to match (e.g. "HT/2")
Definition: Parameters.h:65
Ntupliser::recmuons
edm::Handle< pat::MuonCollection > recmuons
Definition: Ntupliser.h:67
DAS::SysUp
const std::string SysUp
Suffix used for "up" uncertainties. Follows the Combine convention.
Definition: Format.h:8
DAS::RecEvent::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:15
DAS::Helper::GetRecJet
DAS::RecJet GetRecJet(const pat::Jet &ijet)
Helper to get DAS::RecJet from MiniAOD.
Definition: helper.cc:52
DAS::PrimaryVertex::chi2
float chi2
figure of merit of the vertex fit
Definition: Event.h:122
DAS::Parameters::triggerPrescalesToken
edm::EDGetTokenT< pat::PackedTriggerPrescales > triggerPrescalesToken
Definition: Parameters.h:90
Ntupliser::recEvent_
DAS::RecEvent * recEvent_
Definition: Ntupliser.h:97
Ntupliser::recPhotons_
std::vector< DAS::RecPhoton > * recPhotons_
Definition: Ntupliser.h:93
Ntupliser::met_
DAS::MET * met_
Definition: Ntupliser.h:98
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.source
source
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:39
DAS::Parameters::metNames_
std::vector< std::string > metNames_
Definition: Parameters.h:91
DAS::Parameters::sandbox
const bool sandbox
flag for CRAB sandbox
Definition: Parameters.h:58
DAS::Parameters::genjetsToken
edm::EDGetTokenT< reco::GenJetCollection > genjetsToken
Definition: Parameters.h:70
DAS::Trigger
Definition: Event.h:71
DAS::Parameters::recphotonsToken
edm::EDGetTokenT< pat::PhotonCollection > recphotonsToken
Definition: Parameters.h:83
DAS::PileUp::nVtx
int nVtx
number of vertices in the event
Definition: Event.h:103
Ntupliser::genMuons_
std::vector< DAS::GenMuon > * genMuons_
Definition: Ntupliser.h:92
DAS::Trigger::Bit
std::vector< bool > Bit
indicates which trigger has fired
Definition: Event.h:72
Ntupliser::getRecMuons
void getRecMuons()
Finds the reconstructed muons, and applies some hard cuts on the phase space.
Definition: Ntupliser.cc:169
Ntupliser::genPVs_
std::vector< DAS::PrimaryVertex > * genPVs_
Definition: Ntupliser.h:102
DAS::Parameters::genParticlesToken
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken
Definition: Parameters.h:67
Ntupliser::pileup_
DAS::PileUp * pileup_
Definition: Ntupliser.h:99
DAS::RecEvent
Definition: Event.h:52
Ntupliser::recphotons
edm::Handle< pat::PhotonCollection > recphotons
Definition: Ntupliser.h:68
Ntupliser::pileup_json
boost::property_tree::ptree pileup_json
pileup "latest"
Definition: Ntupliser.h:104
Ntupliser::HLTjets_
std::vector< DAS::FourVector > * HLTjets_
Definition: Ntupliser.h:89
Ntupliser::getHLTjets
void getHLTjets(edm::Event const &iEvent)
Finds HLT jets and simply stores them in a FourVector.
Definition: Ntupliser.cc:595
DAS::RecJet
Definition: Jet.h:37
DAS::MET
Definition: Event.h:84
Ntupliser::primaryvertex_
DAS::PrimaryVertex * primaryvertex_
Definition: Ntupliser.h:100
Ntupliser::triggerPrescalesl1max
edm::Handle< pat::PackedTriggerPrescales > triggerPrescalesl1max
Definition: Ntupliser.h:73
DAS::AbstractEvent::weights
Weights weights
e.g. cross section normalisation
Definition: Event.h:23
DAS::Helper::GetScaleVariations
std::vector< std::string > GetScaleVariations(const tinyxml2::XMLDocument &doc, const std::string &scaleChoice) const
Extracts only the envelope scale variations (skipping nominal, off‐diagonals and placeholder scales) ...
Definition: helper.cc:381
DAS::PrimaryVertex::ndof
float ndof
number of degrees of freedom in vertex fit
Definition: Event.h:123
DAS::Parameters::muons
const bool muons
Definition: Parameters.h:77
DAS::MET::Et
float Et
transverse energy
Definition: Event.h:85
Ntupliser::getGenMuons
void getGenMuons()
Finds the generated muons, and applies some hard cuts on the phase space.
Definition: Ntupliser.cc:83
DAS::GenEvent::WeightVar
static const char *const WeightVar
Definition: Event.h:39
Ntupliser::fs_
edm::Service< TFileService > fs_
Definition: Ntupliser.h:83
DAS::Parameters::recmuonsToken
edm::EDGetTokenT< pat::MuonCollection > recmuonsToken
Definition: Parameters.h:79
Ntupliser::met
edm::Handle< pat::METCollection > met
Definition: Ntupliser.h:69
DAS::RecMuon
class RecMuon
Definition: Lepton.h:25
DAS::Parameters::lheLabel
edm::InputTag lheLabel
Definition: Parameters.h:100
DAS::RecEvent::runNo
int runNo
6-digit run number
Definition: Event.h:55
DAS::Parameters::genWgts
const bool genWgts
flag to store the gen-level event weight variations (e.g. alpha-s, PDF, PS)
Definition: Parameters.h:63
DAS::PrimaryVertex::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:82
Ntupliser::muonTrigger_
DAS::Trigger * muonTrigger_
Definition: Ntupliser.h:95
DAS::Helper::GetRecPhoton
DAS::RecPhoton GetRecPhoton(const pat::Photon &photon)
Helper to get DAS::RecLep from MiniAOD.
Definition: helper.cc:201
DAS::Trigger::PreL1max
std::vector< int > PreL1max
L1 max pre-scale.
Definition: Event.h:75
DAS::PileUp
Definition: Event.h:98
DAS::Parameters::rhoToken
edm::EDGetTokenT< double > rhoToken
Definition: Parameters.h:96
Ntupliser::metainfo
Darwin::Tools::UserInfo metainfo
Definition: Ntupliser.h:85
DAS::RecEvent::evtNo
unsigned long long evtNo
event number
Definition: Event.h:57
DAS::GenMuon
class GenMuon
Definition: Lepton.h:9
DAS::Parameters::config
boost::property_tree::ptree config
input JSON config
Definition: Parameters.h:60
DAS::GenJet
class GenJet
Definition: Jet.h:9
recjet
DAS::RecJet recjet
Definition: classes.h:15
weight
DAS::Weight weight
Definition: classes.h:11
Ntupliser::genLeptons
edm::Handle< edm::View< reco::Candidate > > genLeptons
Definition: Ntupliser.h:66
Ntupliser::getGenJets
void getGenJets(edm::Handle< MyJetCollection > &mygenjets)
Definition: Ntupliser.cc:147
Ntupliser::theJetFlavourInfos
edm::Handle< reco::JetFlavourInfoMatchingCollection > theJetFlavourInfos
Definition: Ntupliser.h:77
Ntupliser::h
DAS::Helper h
Definition: Ntupliser.h:61
DAS::PileUp::rho
float rho
soft activity (see formula 7.15 in Patrick's thesis)
Definition: Event.h:102
DAS::Parameters::triggerPrescalesl1minToken
edm::EDGetTokenT< pat::PackedTriggerPrescales > triggerPrescalesl1minToken
Definition: Parameters.h:90
DAS::Helper::GetGenPhoton
DAS::GenPhoton GetGenPhoton(const reco::GenParticle &photon, bool zAncestor)
Helper to get DAS::GenPhoton from MiniAOD.
Definition: helper.cc:187
DAS::Helper::GetRecMu
DAS::RecMuon GetRecMu(const pat::Muon &mu)
Helper to get DAS::RecMuon from MiniAOD.
Definition: helper.cc:166
Ntupliser::recMuons_
std::vector< DAS::RecMuon > * recMuons_
Definition: Ntupliser.h:91
Ntupliser::triggerResults
edm::Handle< edm::TriggerResults > triggerResults
Definition: Ntupliser.h:72
DAS::Helper::BufferWeightGroupXML
std::string BufferWeightGroupXML(const LHERunInfoProduct &runInfo) const
Extracts the XML fragment starting at <weightgroup> from LHE headers.
Definition: helper.cc:339
DAS::Parameters::triggerResultsToken
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
Definition: Parameters.h:88
Ntupliser::initialise
void initialise(edm::Event const &iEvent)
Called at the beginning of each new event.
Definition: Ntupliser.cc:426
DAS::Helper::CountPDFWeights
int CountPDFWeights(const tinyxml2::XMLDocument &doc, const std::string &pdfGroupName) const
Counts the number of weights in the specified PDF group.
Definition: helper.cc:465
Ntupliser::getGenPhotons
void getGenPhotons()
Finds the generated photons and applies some hard cuts to the phase space.
Definition: Ntupliser.cc:110
DAS::RecEvent::lumi
int lumi
lumi section
Definition: Event.h:56
Ntupliser::rho
edm::Handle< double > rho
Definition: Ntupliser.h:70
DAS::MET::Bit
std::vector< bool > Bit
flags for application of MET filters (see n-tupliser config file)
Definition: Event.h:89
Ntupliser::triggerPrescales
edm::Handle< pat::PackedTriggerPrescales > triggerPrescales
Definition: Ntupliser.h:73
DAS::Trigger::PreL1min
std::vector< int > PreL1min
L1 min pre-scale.
Definition: Event.h:74
DAS::Parameters::triggers
const bool triggers
Definition: Parameters.h:86
Ntupliser_cfg.run
int run
Definition: Ntupliser_cfg.py:82
Ntupliser::p
DAS::Parameters p
Definition: Ntupliser.h:60
DAS::PrimaryVertex::z
float z
position on beam axis
Definition: Event.h:121
Ntupliser::lheEvent
edm::Handle< LHEEventProduct > lheEvent
Definition: Ntupliser.h:80
DAS::Parameters::triggerNames_
std::vector< std::string > triggerNames_
Definition: Parameters.h:91
Ntupliser::triggerPrescalesl1min
edm::Handle< pat::PackedTriggerPrescales > triggerPrescalesl1min
Definition: Ntupliser.h:73
DAS::PrimaryVertex::Rho
float Rho
transverse distance to beam axis
Definition: Event.h:120
DAS::Parameters::pdf_
std::string pdf_
PDF weightgroup name to search (e.g. "NNPDF31_nlo_hessian_pdfas")
Definition: Parameters.h:64
DAS::Parameters::HLTjet_triggerNames
std::set< std::string > HLTjet_triggerNames
Definition: Parameters.h:93
Ntupliser::genEvtInfo
edm::Handle< GenEventInfoProduct > genEvtInfo
Definition: Ntupliser.h:75
DAS::Weight
Definition: Weight.h:16
recphoton
DAS::RecPhoton recphoton
Definition: classes.h:21
Darwin::Tools::UserInfo::Set
void Set(TList *mother, const char *key, T value) const
Definition: UserInfo.h:140
DAS::GenEvent::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:9
DAS::PrimaryVertex::fake
bool fake
flag for fake vertices
Definition: Event.h:124
pileup
DAS::PileUp pileup
Definition: classes.h:27
DAS::Parameters::recVtxsToken
edm::EDGetTokenT< reco::VertexCollection > recVtxsToken
Definition: Parameters.h:89
DAS::Parameters::flavour
const bool flavour
Definition: Parameters.h:72
DAS::SysDown
const std::string SysDown
Suffix used for "down" uncertainties. Follows the Combine convention.
Definition: Format.h:10
Ntupliser::fillMET
void fillMET(edm::Event const &iEvent)
Fill the MET flags to the array.
Definition: Ntupliser.cc:577
DAS::Helper::CollectWeightIds
std::vector< std::string > CollectWeightIds(const tinyxml2::XMLDocument &doc, const std::string &scaleChoice, const std::string &pdfGroupName) const
Extracts HT/2 variation and PDF variation IDs from an XML document, skipping any off‐diagonal static ...
Definition: helper.cc:269
DAS::Parameters::metResultsToken
edm::EDGetTokenT< edm::TriggerResults > metResultsToken
Definition: Parameters.h:88
Ntupliser::recJets_
std::vector< DAS::RecJet > * recJets_
Definition: Ntupliser.h:88
DAS::PhysicsObject::weights
Weights weights
object weights
Definition: PhysicsObject.h:52
genjet
DAS::GenJet genjet
Definition: classes.h:14
Ntupliser::genEvent_
DAS::GenEvent * genEvent_
Definition: Ntupliser.h:96
DAS::PileUp::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:74
DAS::PileUp::MBxsec
static float MBxsec
Definition: Event.h:100
DAS::PileUp::pthats
std::vector< float > pthats
all hard scales found in PU
Definition: Event.h:106
Ntupliser::pileupInfo
edm::Handle< std::vector< PileupSummaryInfo > > pileupInfo
Definition: Ntupliser.h:79
Ntupliser::triggerObjects
edm::Handle< pat::TriggerObjectStandAloneCollection > triggerObjects
Definition: Ntupliser.h:74
Ntupliser::getEventVariables
void getEventVariables(edm::Event const &iEvent)
Definition: Ntupliser.cc:636
DAS::Parameters::photons
const bool photons
Definition: Parameters.h:82
Ntupliser::recjets
edm::Handle< pat::JetCollection > recjets
Definition: Ntupliser.h:65
DAS::MET::Phi
float Phi
direction of the total transverse momentum
Definition: Event.h:88
DAS::Trigger::PreHLT
std::vector< int > PreHLT
HLT prescale.
Definition: Event.h:73
Ntupliser::jetTrigger_
DAS::Trigger * jetTrigger_
Definition: Ntupliser.h:95
DAS::FourVector
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< float > > FourVector
Definition: PhysicsObject.h:15
DAS::GenEvent::hard_scale
float hard_scale
hard scale, corresponding to pthat in Pythia 8
Definition: Event.h:41
Ntupliser::genParticles
edm::Handle< reco::GenParticleCollection > genParticles
Definition: Ntupliser.h:76
DAS::Parameters::genEvtInfoToken
edm::EDGetTokenT< GenEventInfoProduct > genEvtInfoToken
Definition: Parameters.h:66
DAS::PileUp::intpu
int intpu
in-time pile-up (i.e. from the same bunch crossing)
Definition: Event.h:105
DAS::MET::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:29
DAS::Trigger::clear
void clear()
to clear for each new event in n-tupliser
Definition: Event.cc:21
Ntupliser::recPVs_
std::vector< DAS::PrimaryVertex > * recPVs_
Definition: Ntupliser.h:101
DAS::Parameters::jetFlavourInfosToken
edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > jetFlavourInfosToken
Definition: Parameters.h:73
Ntupliser::tree
TTree * tree
Definition: Ntupliser.h:84
Ntupliser::genweight_ids
std::vector< std::string > genweight_ids
Definition: Ntupliser.h:107
DAS::MET::SumEt
float SumEt
sum of the transverse energies of all the components (jet, leptons, etc.) present in the event
Definition: Event.h:86
DAS::PileUp::MBevents
std::vector< unsigned long long > MBevents
event IDs in MB sample
Definition: Event.h:107
Ntupliser::reset
void reset()
Just a common method to reset all branches at each new event.
Definition: Ntupliser.cc:387
Ntupliser::genJets_
std::vector< DAS::GenJet > * genJets_
Definition: Ntupliser.h:90
DAS::RecPhoton
class RecPhoton
Definition: Photon.h:27
Ntupliser::recVtxs
edm::Handle< reco::VertexCollection > recVtxs
Definition: Ntupliser.h:71
DAS::Parameters::triggerObjectsToken
edm::EDGetTokenT< pat::TriggerObjectStandAloneCollection > triggerObjectsToken
Definition: Parameters.h:92
DAS::Parameters::isMC
const bool isMC
flag
Definition: Parameters.h:56
Ntupliser::trigger
bool trigger(edm::Event const &iEvent)
Finds the bits corresponding to the HLT jet pt triggers.
Definition: Ntupliser.cc:490
DAS::Parameters::jets
const bool jets
Definition: Parameters.h:72
DAS::Helper::JetID
bool JetID(const pat::Jet &jet)
Testing tight ID lepton veto definition for jets (official from JetMET)
Definition: helper.cc:99
DAS::MET::Pt
float Pt
exactly the same as Et
Definition: Event.h:87
DAS::PrimaryVertex
Definition: Event.h:119
DAS::GenEvent
Definition: Event.h:38
Ntupliser::getRecJets
void getRecJets()
Finds the reconstructed jets, and applies some hard cuts on the phase space.
Definition: Ntupliser.cc:208