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" 51 _usePromptFinalStates(pset.getParameter<
bool>(
"usePromptFinalStates")),
52 _excludePromptLeptonsFromJetClustering(pset.getParameter<
bool>(
"excludePromptLeptonsFromJetClustering")),
53 _excludeNeutrinosFromJetClustering(pset.getParameter<
bool>(
"excludeNeutrinosFromJetClustering")),
55 _particleMinPt (pset.getParameter<double>(
"particleMinPt")),
56 _particleMaxEta (pset.getParameter<double>(
"particleMaxEta")),
58 _lepConeSize (pset.getParameter<double>(
"lepConeSize")),
59 _lepMinPt (pset.getParameter<double>(
"lepMinPt")),
60 _lepMaxEta (pset.getParameter<double>(
"lepMaxEta")),
62 _jetConeSize (pset.getParameter<double>(
"jetConeSize")),
63 _jetMinPt (pset.getParameter<double>(
"jetMinPt")),
64 _jetMaxEta (pset.getParameter<double>(
"jetMaxEta")),
66 _fatJetConeSize (pset.getParameter<double>(
"fatJetConeSize")),
67 _fatJetMinPt (pset.getParameter<double>(
"fatJetMinPt")),
68 _fatJetMaxEta (pset.getParameter<double>(
"fatJetMaxEta")),
70 _phoMinPt (pset.getParameter<double>(
"phoMinPt")),
71 _phoMaxEta (pset.getParameter<double>(
"phoMaxEta")),
72 _phoIsoConeSize (pset.getParameter<double>(
"phoIsoConeSize")),
73 _phoMaxRelIso (pset.getParameter<double>(
"phoMaxRelIso"))
80 Cut particle_cut = (Cuts::abseta < _particleMaxEta) and (Cuts::pT > _particleMinPt*
GeV);
81 Cut lepton_cut = (Cuts::abseta < _lepMaxEta) and (Cuts::pT > _lepMinPt*
GeV);
84 FinalState fs(particle_cut);
86 addProjection(fs,
"FS");
89 ChargedLeptons charged_leptons(fs);
90 IdentifiedFinalState
photons(fs);
93 PromptFinalState prompt_leptons(charged_leptons);
94 prompt_leptons.acceptMuonDecays(
true);
95 prompt_leptons.acceptTauDecays(
true);
96 addProjection(prompt_leptons,
"PromptLeptons");
98 PromptFinalState prompt_photons(photons);
99 prompt_photons.acceptMuonDecays(
true);
100 prompt_photons.acceptTauDecays(
true);
105 DressedLeptons dressed_leptons(prompt_photons, prompt_leptons, _lepConeSize,
107 if (not _usePromptFinalStates)
108 dressed_leptons = DressedLeptons(photons, charged_leptons, _lepConeSize,
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").particlesByPt();
158 Particles promptleptons = applyProjection<PromptFinalState>(
event,
"PromptLeptons").
particles();
159 for (
auto & lepton : _leptons ) {
160 const auto &
cl = lepton.constituents().front();
161 for (
auto const & pl : promptleptons ) {
162 if (
cl.momentum() == pl.momentum()) {
163 for (
auto &
p : pl.ancestors()) {
164 if (
p.abspid() == 15) {
165 p.setMomentum(
p.momentum()*10
e-20);
166 lepton.addConstituent(
p,
false);
174 Particles fsparticles = applyProjection<FinalState>(
event,
"FS").
particles();
176 for (
auto &
photon : applyProjection<FinalState>(event,
"Photons").particlesByPt() ) {
184 double photonptsum = 0;
186 for (
auto &fsparticle : fsparticles) {
194 photonptsum += fsparticle.pt();
200 _photons.push_back(
photon);
204 _jets = applyProjection<FastJets>(
event,
"Jets").jetsByPt(jet_cut);
205 _fatjets = applyProjection<FastJets>(
event,
"FatJets").jetsByPt(fatjet_cut);
206 _neutrinos = applyProjection<FinalState>(
event,
"Neutrinos").particlesByPt();
207 _met = applyProjection<MissingMomentum>(
event,
"MET").missingMomentum().p3();
ParticleVector neutrinos() const
RivetAnalysis(const edm::ParameterSet &pset)
ParticleVector photons() const
bool _excludeNeutrinosFromJetClustering
Abs< T >::type abs(const T &t)
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
std::string status() const override
bool _excludePromptLeptonsFromJetClustering
bool _usePromptFinalStates
ParticleVector _neutrinos
ParticleVector leptons() const