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

[Puppi] Hadronic tau recovery with protection for fromPV==2 charged particles #44050

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CommonTools/PileupAlgos/plugins/PuppiProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class PuppiProducer : public edm::stream::EDProducer<> {
bool fPuppiDiagnostics;
bool fPuppiNoLep;
bool fUseFromPVLooseTight;
bool fUseFromPV2Recovery;
bool fUseDZ;
bool fUseDZforPileup;
double fDZCut;
Expand All @@ -77,6 +78,7 @@ class PuppiProducer : public edm::stream::EDProducer<> {
double fEtaMaxCharged;
double fPtMaxPhotons;
double fEtaMaxPhotons;
double fPtMinForFromPV2Recovery;
uint fNumOfPUVtxsForCharged;
double fDZCutForChargedFromPUVtxs;
bool fUseExistingWeights;
Expand All @@ -94,6 +96,7 @@ PuppiProducer::PuppiProducer(const edm::ParameterSet& iConfig) {
fPuppiDiagnostics = iConfig.getParameter<bool>("puppiDiagnostics");
fPuppiNoLep = iConfig.getParameter<bool>("puppiNoLep");
fUseFromPVLooseTight = iConfig.getParameter<bool>("UseFromPVLooseTight");
fUseFromPV2Recovery = iConfig.getParameter<bool>("UseFromPV2Recovery");
fUseDZ = iConfig.getParameter<bool>("UseDeltaZCut");
fUseDZforPileup = iConfig.getParameter<bool>("UseDeltaZCutForPileup");
fDZCut = iConfig.getParameter<double>("DeltaZCut");
Expand All @@ -102,6 +105,7 @@ PuppiProducer::PuppiProducer(const edm::ParameterSet& iConfig) {
fEtaMaxCharged = iConfig.getParameter<double>("EtaMaxCharged");
fPtMaxPhotons = iConfig.getParameter<double>("PtMaxPhotons");
fEtaMaxPhotons = iConfig.getParameter<double>("EtaMaxPhotons");
fPtMinForFromPV2Recovery = iConfig.getParameter<double>("PtMinForFromPV2Recovery");
fNumOfPUVtxsForCharged = iConfig.getParameter<uint>("NumOfPUVtxsForCharged");
fDZCutForChargedFromPUVtxs = iConfig.getParameter<double>("DeltaZCutForChargedFromPUVtxs");
fUseExistingWeights = iConfig.getParameter<bool>("useExistingWeights");
Expand Down Expand Up @@ -285,6 +289,8 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
pReco.id = 1;
else if ((fUseDZ) && (std::abs(pReco.eta) >= fEtaMinUseDZ) && (std::abs(pDZ) < fDZCut))
pReco.id = 1;
else if (fUseFromPV2Recovery && tmpFromPV == 2 && (pReco.pt > fPtMinForFromPV2Recovery))
pReco.id = 1;
else if ((fUseDZforPileup) && (std::abs(pReco.eta) >= fEtaMinUseDZ) && (std::abs(pDZ) >= fDZCut))
pReco.id = 2;
else if (fUseFromPVLooseTight && tmpFromPV == 1)
Expand Down Expand Up @@ -328,6 +334,9 @@ void PuppiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
pReco.id = 1;
else if ((fUseDZ) && (std::abs(pReco.eta) >= fEtaMinUseDZ) && (std::abs(pDZ) < fDZCut))
pReco.id = 1;
else if (fUseFromPV2Recovery && lPack->fromPV() == (pat::PackedCandidate::PVTight) &&
(pReco.pt > fPtMinForFromPV2Recovery))
pReco.id = 1;
else if ((fUseDZforPileup) && (std::abs(pReco.eta) >= fEtaMinUseDZ) && (std::abs(pDZ) >= fDZCut))
pReco.id = 2;
else if (fUseFromPVLooseTight && lPack->fromPV() == (pat::PackedCandidate::PVLoose))
Expand Down Expand Up @@ -498,6 +507,7 @@ void PuppiProducer::fillDescriptions(edm::ConfigurationDescriptions& description
desc.add<bool>("puppiDiagnostics", false);
desc.add<bool>("puppiNoLep", false);
desc.add<bool>("UseFromPVLooseTight", false);
desc.add<bool>("UseFromPV2Recovery", false);
desc.add<bool>("UseDeltaZCut", true);
desc.add<bool>("UseDeltaZCutForPileup", true);
desc.add<double>("DeltaZCut", 0.3);
Expand All @@ -508,6 +518,7 @@ void PuppiProducer::fillDescriptions(edm::ConfigurationDescriptions& description
desc.add<double>("EtaMaxPhotons", 2.5);
desc.add<double>("PtMaxNeutrals", 200.);
desc.add<double>("PtMaxNeutralsStartSlope", 0.);
desc.add<double>("PtMinForFromPV2Recovery", 0.);
desc.add<uint>("NumOfPUVtxsForCharged", 0);
desc.add<double>("DeltaZCutForChargedFromPUVtxs", 0.2);
desc.add<bool>("useExistingWeights", false);
Expand Down
2 changes: 2 additions & 0 deletions CommonTools/PileupAlgos/python/Puppi_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
DeltaZCutForChargedFromPUVtxs = primaryVertexAssociationJME.assignment.DzCutForChargedFromPUVtxs,
PtMaxNeutralsStartSlope = 20.,
PtMaxPhotons = 20.,
UseFromPV2Recovery = True,
PtMinForFromPV2Recovery = 4.,
clonePackedCands = False, # should only be set to True for MiniAOD
algos = {
0: dict(
Expand Down