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)
 
void getGenEventWeights ()
 

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
769 {
770  cout << __FILE__ << ':' << __func__ << endl;
771 }

Member Function Documentation

◆ analyze()

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

◆ 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  // Scale variations (skip if empty)
327  if (!p.scale_choice_.empty()) {
328  const auto scale_variations = h.GetScaleVariations(doc, p.scale_choice_);
329  for (const auto& name : scale_variations) {
330  metainfo.Set<int>("variations", DAS::GenEvent::WeightVar, name.c_str(), 1);
331  }
332  }
333 
334  // PDF variations (skip if empty)
335  if (!p.pdf_.empty()) {
336  const auto pdfCount = h.CountPDFWeights(doc, p.pdf_);
337  metainfo.Set<int>("variations", DAS::GenEvent::WeightVar, p.pdf_.c_str(), pdfCount);
338  }
339 }

◆ 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
342 {
343  cout << __FILE__ << ':' << __func__ << endl;
344 }

◆ fillMET()

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

Fill the MET flags to the array.

588 {
589  const edm::TriggerNames &namesMet = iEvent.triggerNames(*metResults);
590  for(unsigned int k=0; k < p.metNames_.size(); ++k) {
591  bool bit(false);
592  for(unsigned int itrig=0; itrig<metResults->size(); ++itrig) {
593  string met_name = string(namesMet.triggerName(itrig));
594  if (met_name == p.metNames_[k]) {
595  bit = metResults->accept(itrig);
596  break;
597  }
598  }
599  met_->Bit.push_back(bit);
600  }
601 }

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

Todo:
check out-of-time pileup
Todo:
compare to (*met)[0].pt() to (*met)[0].uncorPt()
645 {
646  // event
647  recEvent_->runNo = iEvent.id().run(); // note: always 1 for MC
648  recEvent_->evtNo = iEvent.id().event();
649  recEvent_->lumi = iEvent.id().luminosityBlock();
650 
651  recEvent_->weights.resize(1);
652  recEvent_->weights.front() = 1;
653 
654  // pile-up
655  // https://cmsdoxygen.web.cern.ch/cmsdoxygen/CMSSW_12_4_0/doc/html/d9/d53/classPileupSummaryInfo.html
656  pileup_->rho = *rho;
657  pileup_->nVtx = recVtxs->size();
658  if (p.isMC)
659  for(const auto& PUI: *pileupInfo) {
660  if (PUI.getBunchCrossing() != 0) continue;
661 
662  // for pile-up profile correction
663  // Adapted from [TWiki](https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupJSONFileforData):
664  // 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.
665  // The way that pileup events are generated in MC, given an input pileup distribution, is as follows:
666  pileup_->trpu = PUI.getTrueNumInteractions(); // average pileup conditions under which the event is generated
667  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
668 
669  // for pile-up staub cleaning
670  pileup_->pthats = PUI.getPU_pT_hats();
671 
672  const vector<edm::EventID>& evtIDs = PUI.getPU_EventID();
673  for (const auto& evtID: evtIDs)
674  pileup_->MBevents.push_back(evtID.event());
675  }
676  else if (pileup_json.size() > 0) {
677  auto runNo = to_string(iEvent.id().run());
678  auto run = pileup_json.get_child_optional(runNo);
679  if (!run)
680  throw cms::Exception("Ntupliser") << runNo << " could not be found in the pileup latest file";
681  for (auto& LS: *run) {
682  auto it = LS.second.begin(); // ["LS", "inst lumi", "xsec RMS", "av xsec"]
683  auto LSno = it->second.get_value<unsigned int>(); // LS
684  if (LSno != iEvent.id().luminosityBlock()) continue;
685  ++it; //auto instLumi = it->second.get_value<float>(); // inst lumi
686  ++it; //auto xsecRMS = it->second.get_value<float>(); // xsec RMS
687  ++it; auto avXsec = it->second.get_value<float>(); // av xsec
688  pileup_->trpu = avXsec * DAS::PileUp::MBxsec;
689  break;
690  }
691  }
692 
693  // primary vertex
694  const auto& PV = (*recVtxs)[0];
695  primaryvertex_->Rho = PV.position().Rho();
696  primaryvertex_->z = PV.z();
697  primaryvertex_->ndof = PV.ndof();
698  primaryvertex_->chi2 = PV.chi2();
699  primaryvertex_->fake = PV.isFake();
700  for (const auto& PV: *recVtxs){
701  recPVs_->emplace_back(PV.position().Rho(), PV.z(), PV.chi2(), PV.ndof(), PV.isFake());
702  }
703  if (p.isMC) {
704  const auto& gv = (*genParticles)[0].daughter(0)->vertex();
705  genPVs_->emplace_back(gv.Rho(), gv.z(), 0, 0, false);
706  }
707 
708  // MET
709  met_->Et = (*met)[0].et();
710  met_->SumEt = (*met)[0].sumEt();
711  met_->Pt = (*met)[0].pt();
712  met_->Phi = (*met)[0].phi();
713  // https://twiki.cern.ch/twiki/bin/viewauth/CMS/MissingETRun2Corrections#Type_I_Correction_Propagation_of
714  // https://twiki.cern.ch/twiki/bin/view/CMS/MissingETUncertaintyPrescription
715 }

◆ getGenEventWeights()

void getGenEventWeights ( )
private

Get gen-level event weights.

720 {
721  genEvent_->hard_scale = genEvtInfo->qScale();
722 
723  // Always store the dataset nominal weight first
724  const double w0 = genEvtInfo->weight();
725  genEvent_->weights.clear();
726  genEvent_->weights.emplace_back(DAS::Weight{w0, 0});
727 
728  // Only proceed if LHE/gen weights are requested
729  if (!p.genWgts)
730  return;
731 
732  // LHE model variations
733  const auto& wgt_infos = lheEvent->weights();
734  const auto& nominal_id = genweight_ids.front(); // assumed nominal
735 
736  // Find nominal LHE weight; throw if not found
737  const auto itNom = find_if(
738  wgt_infos.begin(), wgt_infos.end(),
739  [&](const gen::WeightsInfo& wi){ return wi.id == nominal_id; }
740  );
741 
742  if (itNom == wgt_infos.end())
743  throw cms::Exception("Ntupliser") << "Nominal LHE weight id '" << nominal_id << "' not found in LHE weights.";
744 
745  const double wN = itNom->wgt;
746  // Keep your is-normal check semantics
747  if (!isnormal(wN))
748  throw cms::Exception("Ntupliser") << "Nominal LHE weight is zero or non-finite (wN=" << wN << ").";
749 
750  // Ratio of dataset nominal to LHE nominal (kept as you wrote)
751  const double relNomWgt = w0 / wN;
752 
753  // Push each selected LHE variation, but NEVER push the LHE nominal
754  for (const auto& wi : wgt_infos) {
755  // hard guard: skip LHE nominal unconditionally
756  if (wi.id == nominal_id)
757  continue;
758 
759  // keep only ids we care about
760  if (find(genweight_ids.begin(), genweight_ids.end(), wi.id) == genweight_ids.end())
761  continue;
762 
763  const double abs_weight = wi.wgt * relNomWgt;
764  genEvent_->weights.emplace_back(DAS::Weight{abs_weight, 0});
765  }
766 }

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

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

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

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

◆ reset()

void reset ( )
private

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

397 {
398  if (p.isMC)
399  genEvent_->clear();
400  recEvent_->clear();
401 
402  if (p.triggers) {
403  jetTrigger_->clear();
404  muonTrigger_->clear();
405  zbTrigger_->clear();
406  }
407  pileup_->clear();
409  recPVs_->clear();
410  genPVs_->clear();
411  met_->clear();
412 
413  if (p.jets) {
414  if (p.isMC)
415  genJets_->clear();
416  if (p.triggers)
417  HLTjets_->clear();
418  recJets_->clear();
419  }
420 
421  if (p.muons) {
422  recMuons_->clear();
423  if (p.isMC)
424  genMuons_->clear();
425  }
426 
427  if (p.photons) {
428  recPhotons_->clear();
429  if (genPhotons_)
430  genPhotons_->clear();
431  }
432 }

◆ trigger()

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

Finds the bits corresponding to the HLT jet pt triggers.

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

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:65
DAS::Parameters::pileupInfoToken
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupInfoToken
Definition: Parameters.h:97
Ntupliser::zbTrigger_
DAS::Trigger * zbTrigger_
Definition: Ntupliser.h:96
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:73
Ntupliser::genPhotons_
std::vector< DAS::GenPhoton > * genPhotons_
Definition: Ntupliser.h:95
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:68
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:98
Ntupliser::recPhotons_
std::vector< DAS::RecPhoton > * recPhotons_
Definition: Ntupliser.h:94
Ntupliser::met_
DAS::MET * met_
Definition: Ntupliser.h:99
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:93
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:103
DAS::Parameters::genParticlesToken
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken
Definition: Parameters.h:67
Ntupliser::pileup_
DAS::PileUp * pileup_
Definition: Ntupliser.h:100
DAS::RecEvent
Definition: Event.h:52
Ntupliser::recphotons
edm::Handle< pat::PhotonCollection > recphotons
Definition: Ntupliser.h:69
Ntupliser::pileup_json
boost::property_tree::ptree pileup_json
pileup "latest"
Definition: Ntupliser.h:105
Ntupliser::HLTjets_
std::vector< DAS::FourVector > * HLTjets_
Definition: Ntupliser.h:90
Ntupliser::getHLTjets
void getHLTjets(edm::Event const &iEvent)
Finds HLT jets and simply stores them in a FourVector.
Definition: Ntupliser.cc:605
DAS::RecJet
Definition: Jet.h:37
DAS::MET
Definition: Event.h:84
Ntupliser::primaryvertex_
DAS::PrimaryVertex * primaryvertex_
Definition: Ntupliser.h:101
Ntupliser::triggerPrescalesl1max
edm::Handle< pat::PackedTriggerPrescales > triggerPrescalesl1max
Definition: Ntupliser.h:74
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:414
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:84
DAS::Parameters::recmuonsToken
edm::EDGetTokenT< pat::MuonCollection > recmuonsToken
Definition: Parameters.h:79
Ntupliser::met
edm::Handle< pat::METCollection > met
Definition: Ntupliser.h:70
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:96
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:86
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
Ntupliser::genLeptons
edm::Handle< edm::View< reco::Candidate > > genLeptons
Definition: Ntupliser.h:67
Ntupliser::getGenJets
void getGenJets(edm::Handle< MyJetCollection > &mygenjets)
Definition: Ntupliser.cc:147
Ntupliser::theJetFlavourInfos
edm::Handle< reco::JetFlavourInfoMatchingCollection > theJetFlavourInfos
Definition: Ntupliser.h:78
Ntupliser::h
DAS::Helper h
Definition: Ntupliser.h:62
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:92
Ntupliser::triggerResults
edm::Handle< edm::TriggerResults > triggerResults
Definition: Ntupliser.h:73
DAS::Helper::BufferWeightGroupXML
std::string BufferWeightGroupXML(const LHERunInfoProduct &runInfo) const
Extracts the XML fragment starting at <weightgroup> from LHE headers.
Definition: helper.cc:372
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:436
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:498
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:71
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:74
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:61
DAS::PrimaryVertex::z
float z
position on beam axis
Definition: Event.h:121
Ntupliser::lheEvent
edm::Handle< LHEEventProduct > lheEvent
Definition: Ntupliser.h:81
DAS::Parameters::triggerNames_
std::vector< std::string > triggerNames_
Definition: Parameters.h:91
Ntupliser::triggerPrescalesl1min
edm::Handle< pat::PackedTriggerPrescales > triggerPrescalesl1min
Definition: Ntupliser.h:74
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:76
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:587
DAS::Helper::CollectWeightIds
std::vector< std::string > CollectWeightIds(const tinyxml2::XMLDocument &doc, const std::string &scaleChoice, const std::string &pdfGroupName) const
Extracts HT/2 (dynamic) scale-variation and PDF-variation IDs from an XML document,...
Definition: helper.cc:267
DAS::Parameters::metResultsToken
edm::EDGetTokenT< edm::TriggerResults > metResultsToken
Definition: Parameters.h:88
Ntupliser::recJets_
std::vector< DAS::RecJet > * recJets_
Definition: Ntupliser.h:89
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:97
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:80
Ntupliser::triggerObjects
edm::Handle< pat::TriggerObjectStandAloneCollection > triggerObjects
Definition: Ntupliser.h:75
Ntupliser::getEventVariables
void getEventVariables(edm::Event const &iEvent)
Definition: Ntupliser.cc:644
DAS::Parameters::photons
const bool photons
Definition: Parameters.h:82
Ntupliser::recjets
edm::Handle< pat::JetCollection > recjets
Definition: Ntupliser.h:66
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:96
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:77
DAS::Parameters::genEvtInfoToken
edm::EDGetTokenT< GenEventInfoProduct > genEvtInfoToken
Definition: Parameters.h:66
Ntupliser::getGenEventWeights
void getGenEventWeights()
Get gen-level event weights.
Definition: Ntupliser.cc:719
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:102
DAS::Parameters::jetFlavourInfosToken
edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > jetFlavourInfosToken
Definition: Parameters.h:73
Ntupliser::tree
TTree * tree
Definition: Ntupliser.h:85
Ntupliser::genweight_ids
std::vector< std::string > genweight_ids
Definition: Ntupliser.h:108
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:396
Ntupliser::genJets_
std::vector< DAS::GenJet > * genJets_
Definition: Ntupliser.h:91
DAS::RecPhoton
class RecPhoton
Definition: Photon.h:27
Ntupliser::recVtxs
edm::Handle< reco::VertexCollection > recVtxs
Definition: Ntupliser.h:72
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:500
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