Skip to content

Commit

Permalink
Merge pull request #49 from mbluj/91X_coneBasedTaus_addConfigurable
Browse files Browse the repository at this point in the history
 Add configurable to cone based tau builder (91X)
  • Loading branch information
mbluj authored Apr 27, 2017
2 parents c425d8e + 0777a8a commit 66dbf5c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
12 changes: 12 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,24 @@ def customiseFor17792(process):
producer.produceSeedStopReasons = cms.bool(False)
return process

# Add new parameters required by RecoTauBuilderConePlugin
def customiseFor18429(process):
for producer in producers_by_type(process, "RecoTauProducer"):
if hasattr(producer,'builders'):
for pset in producer.builders:
if not hasattr(pset,'minAbsPhotonSumPt_insideSignalCone'):
pset.minAbsPhotonSumPt_insideSignalCone = cms.double(2.5)
if not hasattr(pset,'minRelPhotonSumPt_insideSignalCone'):
pset.minRelPhotonSumPt_insideSignalCone = cms.double(0.10)
return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):
# add call to action function in proper order: newest last!
# process = customiseFor12718(process)
process = customiseFor17771(process)
process = customiseFor17792(process)
process = customiseFor17794(process)
process = customiseFor18429(process)

return process
18 changes: 12 additions & 6 deletions RecoTauTag/RecoTau/plugins/RecoTauBuilderConePlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class RecoTauBuilderConePlugin : public RecoTauBuilderPlugin {
JetFunc isoConeNeutralHadrons_;

int maxSignalConeChargedHadrons_;
double minAbsPhotonSumPt_insideSignalCone_;
double minRelPhotonSumPt_insideSignalCone_;

void setTauQuantities(reco::PFTau& aTau,
double minAbsPhotonSumPt_insideSignalCone = 2.5,
Expand Down Expand Up @@ -93,7 +95,12 @@ RecoTauBuilderConePlugin::RecoTauBuilderConePlugin(
isoConeNeutralHadrons_(
pset.getParameter<std::string>("isoConeNeutralHadrons")),
maxSignalConeChargedHadrons_(
pset.getParameter<int>("maxSignalConeChargedHadrons"))
pset.getParameter<int>("maxSignalConeChargedHadrons")),
minAbsPhotonSumPt_insideSignalCone_(
pset.getParameter<double>("minAbsPhotonSumPt_insideSignalCone")),
minRelPhotonSumPt_insideSignalCone_(
pset.getParameter<double>("minRelPhotonSumPt_insideSignalCone"))

{}

namespace xclean
Expand Down Expand Up @@ -192,11 +199,10 @@ RecoTauBuilderConePlugin::return_type RecoTauBuilderConePlugin::operator()(

// Our tau builder - the true indicates to automatically copy gamma candidates
// from the pizeros.
double minAbsPhotonPt_inSignalCone=2.5, minRelPhotonPt_inSignalCone=0.1;//MB: sensible defults to set a DM hypothesis
RecoTauConstructor tau(jet, getPFCands(), true,
&signalConeSizeToStore_,
minAbsPhotonPt_inSignalCone,
minRelPhotonPt_inSignalCone);
minAbsPhotonSumPt_insideSignalCone_,
minRelPhotonSumPt_insideSignalCone_);
// Setup our quality cuts to use the current vertex (supplied by base class)
qcuts_.setPV(primaryVertex(jet));

Expand Down Expand Up @@ -458,8 +464,8 @@ RecoTauBuilderConePlugin::return_type RecoTauBuilderConePlugin::operator()(

// Set missing tau quantities
setTauQuantities(*tauPtr,
minAbsPhotonPt_inSignalCone,
minRelPhotonPt_inSignalCone
minAbsPhotonSumPt_insideSignalCone_,
minRelPhotonSumPt_insideSignalCone_
);

output.push_back(tauPtr);
Expand Down
5 changes: 3 additions & 2 deletions RecoTauTag/RecoTau/python/RecoTauFixedConeProducer_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

_fixedConeRecoTausConfig = cms.PSet(
name = cms.string("fixedCone"),
useClosestPV = cms.bool(False),
qualityCuts = PFTauQualityCuts,
# If true, consider PFLeptons (e/mu) as charged hadrons.
usePFLeptons = cms.bool(True),
Expand All @@ -27,7 +26,9 @@
isoConePiZeros = cms.string('0.4'),
signalConeNeutralHadrons = cms.string('0.10'),
isoConeNeutralHadrons = cms.string('0.4'),
maxSignalConeChargedHadrons = cms.int32(-1) # CV: upper limit on number of signalConeChargedHadrons disabled per default
maxSignalConeChargedHadrons = cms.int32(-1), # CV: upper limit on number of signalConeChargedHadrons disabled per default
minAbsPhotonSumPt_insideSignalCone = cms.double(2.5),
minRelPhotonSumPt_insideSignalCone = cms.double(0.10)
)

fixedConeRecoTaus = shrinkingConeRecoTaus.clone(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
isoConePiZeros = cms.string('0.4'),
signalConeNeutralHadrons = cms.string('0.15'),
isoConeNeutralHadrons = cms.string('0.4'),
maxSignalConeChargedHadrons = cms.int32(-1) # CV: upper limit on number of signalConeChargedHadrons disabled per default
maxSignalConeChargedHadrons = cms.int32(-1), # CV: upper limit on number of signalConeChargedHadrons disabled per default
minAbsPhotonSumPt_insideSignalCone = cms.double(2.5),
minRelPhotonSumPt_insideSignalCone = cms.double(0.10)
)

shrinkingConeRecoTaus = combinatoricRecoTaus.clone(
Expand Down

0 comments on commit 66dbf5c

Please sign in to comment.