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" 50 : Analysis(
"RivetAnalysis"),
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")) {}
78 Cut particle_cut = (Cuts::abseta < _particleMaxEta) and (Cuts::pT > _particleMinPt *
GeV);
79 Cut lepton_cut = (Cuts::abseta < _lepMaxEta) and (Cuts::pT > _lepMinPt *
GeV);
82 FinalState fs(particle_cut);
87 ChargedLeptons charged_leptons(fs);
88 IdentifiedFinalState
photons(fs);
91 PromptFinalState prompt_leptons(charged_leptons);
92 prompt_leptons.acceptMuonDecays(
true);
93 prompt_leptons.acceptTauDecays(
true);
94 declare(prompt_leptons,
"PromptLeptons");
96 PromptFinalState prompt_photons(photons);
97 prompt_photons.acceptMuonDecays(
true);
98 prompt_photons.acceptTauDecays(
true);
103 DressedLeptons dressed_leptons(
104 prompt_photons, prompt_leptons, _lepConeSize, lepton_cut,
true);
105 if (not _usePromptFinalStates)
106 dressed_leptons = DressedLeptons(photons, charged_leptons, _lepConeSize, lepton_cut,
true);
107 declare(dressed_leptons,
"DressedLeptons");
109 declare(photons,
"Photons");
112 VetoedFinalState fsForJets(fs);
113 if (_usePromptFinalStates and _excludePromptLeptonsFromJetClustering)
114 fsForJets.addVetoOnThisFinalState(dressed_leptons);
115 JetAlg::Invisibles invisiblesStrategy = JetAlg::Invisibles::DECAY;
116 if (_excludeNeutrinosFromJetClustering)
118 declare(FastJets(fsForJets, FastJets::ANTIKT, _jetConeSize,
JetAlg::Muons::ALL, invisiblesStrategy),
"Jets");
121 declare(FastJets(fsForJets, FastJets::ANTIKT, _fatJetConeSize),
"FatJets");
125 neutrinos.acceptNeutrinos();
126 if (_usePromptFinalStates) {
127 PromptFinalState prompt_neutrinos(neutrinos);
128 prompt_neutrinos.acceptMuonDecays(
true);
129 prompt_neutrinos.acceptTauDecays(
true);
130 declare(prompt_neutrinos,
"Neutrinos");
132 declare(neutrinos,
"Neutrinos");
135 declare(MissingMomentum(fs),
"MET");
147 Cut jet_cut = (Cuts::abseta < _jetMaxEta) and (Cuts::pT > _jetMinPt *
GeV);
148 Cut fatjet_cut = (Cuts::abseta < _fatJetMaxEta) and (Cuts::pT > _fatJetMinPt *
GeV);
150 _leptons = apply<DressedLeptons>(
event,
"DressedLeptons").particlesByPt();
153 Particles promptleptons = apply<PromptFinalState>(
event,
"PromptLeptons").
particles();
154 for (
auto& lepton : _leptons) {
155 const auto&
cl = lepton.constituents().front();
156 for (
auto const& pl : promptleptons) {
157 if (
cl.momentum() == pl.momentum()) {
158 for (
auto&
p : pl.ancestors()) {
159 if (
p.abspid() == 15) {
160 p.setMomentum(
p.momentum() * 10
e-20);
161 lepton.addConstituent(
p,
false);
170 Particles fsparticles = apply<FinalState>(
event,
"FS").
particles();
172 for (
auto&
photon : apply<FinalState>(event,
"Photons").particlesByPt()) {
179 double photonptsum = 0;
181 for (
auto& fsparticle : fsparticles) {
188 photonptsum += fsparticle.pt();
194 _photons.push_back(
photon);
197 _jets = apply<FastJets>(
event,
"Jets").jetsByPt(jet_cut);
198 _fatjets = apply<FastJets>(
event,
"FatJets").jetsByPt(fatjet_cut);
199 _neutrinos = apply<FinalState>(
event,
"Neutrinos").particlesByPt();
200 _met = apply<MissingMomentum>(
event,
"MET").missingMomentum().p3();
Particles leptons() const
def ALL(dt, wheel, station, sector)
RivetAnalysis(const edm::ParameterSet &pset)
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
Particles photons() const
Particles neutrinos() const