Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use isolated particle level photons #28371

Merged
merged 3 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 40 additions & 10 deletions GeneratorInterface/RivetInterface/interface/RivetAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace Rivet {
double _jetConeSize, _jetMinPt, _jetMaxEta;
double _fatJetConeSize, _fatJetMinPt, _fatJetMaxEta;

double _phoMinPt, _phoMaxEta, _phoIsoConeSize, _phoMaxRelIso;

Particles _leptons, _photons, _neutrinos;
Jets _jets, _fatjets;
Vector3 _met;
Expand All @@ -63,7 +65,12 @@ namespace Rivet {

_fatJetConeSize(pset.getParameter<double>("fatJetConeSize")),
_fatJetMinPt(pset.getParameter<double>("fatJetMinPt")),
_fatJetMaxEta(pset.getParameter<double>("fatJetMaxEta")) {}
_fatJetMaxEta(pset.getParameter<double>("fatJetMaxEta")),

_phoMinPt(pset.getParameter<double>("phoMinPt")),
_phoMaxEta(pset.getParameter<double>("phoMaxEta")),
_phoIsoConeSize(pset.getParameter<double>("phoIsoConeSize")),
_phoMaxRelIso(pset.getParameter<double>("phoMaxRelIso")) {}

// Initialize Rivet projections
void init() override {
Expand All @@ -74,6 +81,8 @@ namespace Rivet {
// Generic final state
FinalState fs(particle_cut);

declare(fs, "FS");

// Dressed leptons
ChargedLeptons charged_leptons(fs);
IdentifiedFinalState photons(fs);
Expand All @@ -97,14 +106,7 @@ namespace Rivet {
dressed_leptons = DressedLeptons(photons, charged_leptons, _lepConeSize, lepton_cut, /*useDecayPhotons*/ true);
declare(dressed_leptons, "DressedLeptons");

// Photons
if (_usePromptFinalStates) {
// We remove the photons used up for lepton dressing in this case
VetoedFinalState vetoed_prompt_photons(prompt_photons);
vetoed_prompt_photons.addVetoOnThisFinalState(dressed_leptons);
declare(vetoed_prompt_photons, "Photons");
} else
declare(photons, "Photons");
declare(photons, "Photons");

// Jets
VetoedFinalState fsForJets(fs);
Expand Down Expand Up @@ -146,6 +148,7 @@ namespace Rivet {
Cut fatjet_cut = (Cuts::abseta < _fatJetMaxEta) and (Cuts::pT > _fatJetMinPt * GeV);

_leptons = apply<DressedLeptons>(event, "DressedLeptons").particlesByPt();

// search tau ancestors
Particles promptleptons = apply<PromptFinalState>(event, "PromptLeptons").particles();
for (auto& lepton : _leptons) {
Expand All @@ -163,9 +166,36 @@ namespace Rivet {
}
}

// Photons
Particles fsparticles = apply<FinalState>(event, "FS").particles();

for (auto& photon : apply<FinalState>(event, "Photons").particlesByPt()) {
if (photon.pt() < _phoMinPt)
continue;

if (abs(photon.eta()) > _phoMaxEta)
continue;

double photonptsum = 0;

for (auto& fsparticle : fsparticles) {
if (deltaR(fsparticle, photon) == 0)
continue;

if (deltaR(fsparticle, photon) > _phoIsoConeSize)
continue;

photonptsum += fsparticle.pt();
}

if (photonptsum / photon.pt() > _phoMaxRelIso)
continue;

_photons.push_back(photon);
}

_jets = apply<FastJets>(event, "Jets").jetsByPt(jet_cut);
_fatjets = apply<FastJets>(event, "FatJets").jetsByPt(fatjet_cut);
_photons = apply<FinalState>(event, "Photons").particlesByPt();
_neutrinos = apply<FinalState>(event, "Neutrinos").particlesByPt();
_met = apply<MissingMomentum>(event, "MET").missingMomentum().p3();
};
Expand Down
5 changes: 5 additions & 0 deletions GeneratorInterface/RivetInterface/python/particleLevel_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@
fatJetConeSize = cms.double(0.8),
fatJetMinPt = cms.double(200.),
fatJetMaxEta = cms.double(2.4),

phoIsoConeSize = cms.double(0.4),
phoMaxRelIso = cms.double(0.5),
phoMinPt = cms.double(10),
phoMaxEta = cms.double(2.5),
)
5 changes: 5 additions & 0 deletions PhysicsTools/NanoAOD/python/particlelevel_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@
fatJetConeSize = cms.double(0.8),
fatJetMinPt = cms.double(170.),
fatJetMaxEta = cms.double(999.),

phoIsoConeSize = cms.double(0.4),
phoMaxRelIso = cms.double(0.5),
phoMinPt = cms.double(10),
phoMaxEta = cms.double(2.5),
)

rivetProducerHTXS = cms.EDProducer('HTXSRivetProducer',
Expand Down