Skip to content

Commit

Permalink
Merge pull request #28411 from AndrewLevin/106X_isolated_particle_lev…
Browse files Browse the repository at this point in the history
…el_photons

 106X backport of isolated particle level photon
  • Loading branch information
cmsbuild committed Dec 6, 2019
2 parents 6c542cb + 296b32b commit f344b2d
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 11 deletions.
53 changes: 42 additions & 11 deletions GeneratorInterface/RivetInterface/interface/RivetAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ namespace Rivet {
double _lepConeSize, _lepMinPt, _lepMaxEta;
double _jetConeSize, _jetMinPt, _jetMaxEta;
double _fatJetConeSize, _fatJetMinPt, _fatJetMaxEta;


double _phoMinPt, _phoMaxEta ,_phoIsoConeSize, _phoMaxRelIso;

ParticleVector _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"))
{
}

Expand All @@ -76,6 +83,8 @@ namespace Rivet {
// Generic final state
FinalState fs(particle_cut);

addProjection(fs, "FS");

// Dressed leptons
ChargedLeptons charged_leptons(fs);
IdentifiedFinalState photons(fs);
Expand All @@ -101,14 +110,7 @@ namespace Rivet {
addProjection(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);
addProjection(vetoed_prompt_photons, "Photons");
}
else
addProjection(photons, "Photons");
addProjection(photons, "Photons");

// Jets
VetoedFinalState fsForJets(fs);
Expand Down Expand Up @@ -169,9 +171,38 @@ namespace Rivet {
}
}

Particles fsparticles = applyProjection<FinalState>(event,"FS").particles();

for ( auto & photon : applyProjection<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 = applyProjection<FastJets>(event, "Jets").jetsByPt(jet_cut);
_fatjets = applyProjection<FastJets>(event, "FatJets").jetsByPt(fatjet_cut);
_photons = applyProjection<FinalState>(event, "Photons").particlesByPt();
_neutrinos = applyProjection<FinalState>(event, "Neutrinos").particlesByPt();
_met = applyProjection<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

0 comments on commit f344b2d

Please sign in to comment.