1 #ifndef GeneratorInterface_RivetInterface_RivetAnalysis_H 2 #define GeneratorInterface_RivetInterface_RivetAnalysis_H 6 #include "Rivet/Analysis.hh" 7 #include "Rivet/Projections/FinalState.hh" 8 #include "Rivet/Particle.hh" 9 #include "Rivet/Particle.fhh" 10 #include "Rivet/Event.hh" 11 #include "Rivet/Projections/FastJets.hh" 12 #include "Rivet/Projections/JetAlg.hh" 13 #include "Rivet/Projections/ChargedLeptons.hh" 14 #include "Rivet/Projections/PromptFinalState.hh" 15 #include "Rivet/Projections/DressedLeptons.hh" 16 #include "Rivet/Projections/VetoedFinalState.hh" 17 #include "Rivet/Projections/IdentifiedFinalState.hh" 18 #include "Rivet/Projections/MissingMomentum.hh" 19 #include "Rivet/Tools/RivetHepMC.hh" 52 _usePromptFinalStates(pset.getParameter<
bool>(
"usePromptFinalStates")),
53 _excludePromptLeptonsFromJetClustering(pset.getParameter<
bool>(
"excludePromptLeptonsFromJetClustering")),
54 _excludeNeutrinosFromJetClustering(pset.getParameter<
bool>(
"excludeNeutrinosFromJetClustering")),
56 _particleMinPt (pset.getParameter<double>(
"particleMinPt")),
57 _particleMaxEta (pset.getParameter<double>(
"particleMaxEta")),
59 _lepConeSize (pset.getParameter<double>(
"lepConeSize")),
60 _lepMinPt (pset.getParameter<double>(
"lepMinPt")),
61 _lepMaxEta (pset.getParameter<double>(
"lepMaxEta")),
63 _jetConeSize (pset.getParameter<double>(
"jetConeSize")),
64 _jetMinPt (pset.getParameter<double>(
"jetMinPt")),
65 _jetMaxEta (pset.getParameter<double>(
"jetMaxEta")),
67 _fatJetConeSize (pset.getParameter<double>(
"fatJetConeSize")),
68 _fatJetMinPt (pset.getParameter<double>(
"fatJetMinPt")),
69 _fatJetMaxEta (pset.getParameter<double>(
"fatJetMaxEta")),
71 _phoMinPt (pset.getParameter<double>(
"phoMinPt")),
72 _phoMaxEta (pset.getParameter<double>(
"phoMaxEta")),
73 _phoIsoConeSize (pset.getParameter<double>(
"phoIsoConeSize")),
74 _phoMaxRelIso (pset.getParameter<double>(
"phoMaxRelIso"))
81 Cut particle_cut = (Cuts::abseta < _particleMaxEta) and (Cuts::pT > _particleMinPt*
GeV);
82 Cut lepton_cut = (Cuts::abseta < _lepMaxEta) and (Cuts::pT > _lepMinPt*
GeV);
85 FinalState fs(particle_cut);
87 addProjection(fs,
"FS");
90 ChargedLeptons charged_leptons(fs);
91 IdentifiedFinalState
photons(fs);
94 PromptFinalState prompt_leptons(charged_leptons);
95 prompt_leptons.acceptMuonDecays(
true);
96 prompt_leptons.acceptTauDecays(
true);
98 PromptFinalState prompt_photons(photons);
99 prompt_photons.acceptMuonDecays(
true);
100 prompt_photons.acceptTauDecays(
true);
105 DressedLeptons dressed_leptons(prompt_photons, prompt_leptons, _lepConeSize,
106 lepton_cut,
true,
true);
107 if (not _usePromptFinalStates)
108 dressed_leptons = DressedLeptons(photons, charged_leptons, _lepConeSize,
109 lepton_cut,
true,
true);
110 addProjection(dressed_leptons,
"DressedLeptons");
113 addProjection(photons,
"Photons");
116 VetoedFinalState fsForJets(fs);
117 if (_usePromptFinalStates and _excludePromptLeptonsFromJetClustering)
118 fsForJets.addVetoOnThisFinalState(dressed_leptons);
119 JetAlg::InvisiblesStrategy invisiblesStrategy = JetAlg::DECAY_INVISIBLES;
120 if (_excludeNeutrinosFromJetClustering)
121 invisiblesStrategy = JetAlg::NO_INVISIBLES;
122 addProjection(FastJets(fsForJets, FastJets::ANTIKT, _jetConeSize,
123 JetAlg::ALL_MUONS, invisiblesStrategy),
"Jets");
126 addProjection(FastJets(fsForJets, FastJets::ANTIKT, _fatJetConeSize),
"FatJets");
130 neutrinos.acceptNeutrinos();
131 if (_usePromptFinalStates) {
132 PromptFinalState prompt_neutrinos(neutrinos);
133 prompt_neutrinos.acceptMuonDecays(
true);
134 prompt_neutrinos.acceptTauDecays(
true);
135 addProjection(prompt_neutrinos,
"Neutrinos");
138 addProjection(neutrinos,
"Neutrinos");
141 addProjection(MissingMomentum(fs),
"MET");
153 Cut jet_cut = (Cuts::abseta < _jetMaxEta) and (Cuts::pT > _jetMinPt*
GeV);
154 Cut fatjet_cut = (Cuts::abseta < _fatJetMaxEta) and (Cuts::pT > _fatJetMinPt*
GeV);
156 _leptons = applyProjection<DressedLeptons>(
event,
"DressedLeptons").dressedLeptons();
158 for (
auto & lepton : _leptons ) {
159 const auto &
cl = lepton.constituentLepton();
160 for (
auto &
p :
cl.ancestors()) {
161 if (
p.abspid() == 15) {
162 p.setMomentum(
p.momentum()*10
e-20);
163 lepton.addPhoton(
p,
false);
168 Particles fsparticles = applyProjection<FinalState>(
event,
"FS").
particles();
170 for (
auto &
photon : applyProjection<FinalState>(event,
"Photons").particlesByPt() ) {
178 double photonptsum = 0;
180 for (
auto &fsparticle : fsparticles) {
188 photonptsum += fsparticle.pt();
194 _photons.push_back(
photon);
198 _jets = applyProjection<FastJets>(
event,
"Jets").jetsByPt(jet_cut);
199 _fatjets = applyProjection<FastJets>(
event,
"FatJets").jetsByPt(fatjet_cut);
200 _neutrinos = applyProjection<FinalState>(
event,
"Neutrinos").particlesByPt();
201 _met = applyProjection<MissingMomentum>(
event,
"MET").missingMomentum().p3();
std::vector< DressedLepton > _leptons
ParticleVector neutrinos() const
RivetAnalysis(const edm::ParameterSet &pset)
ParticleVector photons() const
bool _excludeNeutrinosFromJetClustering
Abs< T >::type abs(const T &t)
std::vector< DressedLepton > leptons() const
void analyze(const Event &event) override
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
double deltaR(double eta1, double eta2, double phi1, double phi2)
bool _excludePromptLeptonsFromJetClustering
bool _usePromptFinalStates
ParticleVector _neutrinos