Skip to content

Commit

Permalink
Merge pull request #18585 from afiqaize/egmFiltFor91X
Browse files Browse the repository at this point in the history
Add rhoCorr and energy-binned cuts (91X)
  • Loading branch information
cmsbuild committed May 12, 2017
2 parents e318360 + 20055d4 commit de37182
Show file tree
Hide file tree
Showing 7 changed files with 472 additions and 131 deletions.
80 changes: 79 additions & 1 deletion HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Expand Up @@ -17,6 +17,84 @@
# pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone'))
# return process

# EG filter enhancements PR #18559
def customiseFor18559(process):
for filt in filters_by_type(process, "HLTEgammaGenericFilter", "HLTMuonGenericFilter", "HLTEgammaGenericQuadraticFilter", "HLTEgammaGenericQuadraticEtaFilter"):
if not hasattr(filt, "doRhoCorrection"):
filt.doRhoCorrection = cms.bool( False )
filt.rhoTag = cms.InputTag( "" )
filt.effectiveAreas = cms.vdouble( 0.0 )
filt.absEtaLowEdges = cms.vdouble( 0.0 )
filt.rhoMax = cms.double( 9.9999999E7 )
filt.rhoScale = cms.double( 1.0 )

for filt in filters_by_type(process, "HLTEgammaGenericFilter", "HLTMuonGenericFilter", "HLTEgammaGenericQuadraticFilter"):
if not hasattr(filt, "energyLowEdges"):
cutRegularEB = filt.thrRegularEB.value()
cutRegularEE = filt.thrRegularEE.value()
cutOverEEB = filt.thrOverEEB.value()
cutOverEEE = filt.thrOverEEE.value()
cutOverE2EB = filt.thrOverE2EB.value()
cutOverE2EE = filt.thrOverE2EE.value()

del filt.thrRegularEB
del filt.thrRegularEE
del filt.thrOverEEB
del filt.thrOverEEE
del filt.thrOverE2EB
del filt.thrOverE2EE

filt.energyLowEdges = cms.vdouble( 0.0 )
filt.thrRegularEB = cms.vdouble( cutRegularEB )
filt.thrRegularEE = cms.vdouble( cutRegularEE )
filt.thrOverEEB = cms.vdouble( cutOverEEB )
filt.thrOverEEE = cms.vdouble( cutOverEEE )
filt.thrOverE2EB = cms.vdouble( cutOverE2EB )
filt.thrOverE2EE = cms.vdouble( cutOverE2EE )

for filt in filters_by_type(process, "HLTEgammaGenericQuadraticEtaFilter"):
if not hasattr(filt, "energyLowEdges"):
cutRegularEB1 = filt.thrRegularEB1.value()
cutRegularEE1 = filt.thrRegularEE1.value()
cutOverEEB1 = filt.thrOverEEB1.value()
cutOverEEE1 = filt.thrOverEEE1.value()
cutOverE2EB1 = filt.thrOverE2EB1.value()
cutOverE2EE1 = filt.thrOverE2EE1.value()
cutRegularEB2 = filt.thrRegularEB2.value()
cutRegularEE2 = filt.thrRegularEE2.value()
cutOverEEB2 = filt.thrOverEEB2.value()
cutOverEEE2 = filt.thrOverEEE2.value()
cutOverE2EB2 = filt.thrOverE2EB2.value()
cutOverE2EE2 = filt.thrOverE2EE2.value()

del filt.thrRegularEB1
del filt.thrRegularEE1
del filt.thrOverEEB1
del filt.thrOverEEE1
del filt.thrOverE2EB1
del filt.thrOverE2EE1
del filt.thrRegularEB2
del filt.thrRegularEE2
del filt.thrOverEEB2
del filt.thrOverEEE2
del filt.thrOverE2EB2
del filt.thrOverE2EE2

filt.energyLowEdges = cms.vdouble( 0.0 )
filt.thrRegularEB1 = cms.vdouble( cutRegularEB1 )
filt.thrRegularEE1 = cms.vdouble( cutRegularEE1 )
filt.thrOverEEB1 = cms.vdouble( cutOverEEB1 )
filt.thrOverEEE1 = cms.vdouble( cutOverEEE1 )
filt.thrOverE2EB1 = cms.vdouble( cutOverE2EB1 )
filt.thrOverE2EE1 = cms.vdouble( cutOverE2EE1 )
filt.thrRegularEB2 = cms.vdouble( cutRegularEB2 )
filt.thrRegularEE2 = cms.vdouble( cutRegularEE2 )
filt.thrOverEEB2 = cms.vdouble( cutOverEEB2 )
filt.thrOverEEE2 = cms.vdouble( cutOverEEE2 )
filt.thrOverE2EB2 = cms.vdouble( cutOverE2EB2 )
filt.thrOverE2EE2 = cms.vdouble( cutOverE2EE2 )
return process

# Matching ECAL selective readout in particle flow, need a new input with online Selective Readout Flags
def customiseFor17794(process):
for edproducer in producers_by_type(process, "PFRecHitProducer"):
Expand Down Expand Up @@ -73,7 +151,6 @@ def customiseFor18330(process):
pset.chi2cutoff = cms.double(3.0)
return process


# Add new parameters required by RecoTauBuilderConePlugin
def customiseFor18429(process):
for producer in producers_by_type(process, "RecoTauProducer"):
Expand All @@ -95,5 +172,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"):
process = customiseFor17794(process)
process = customiseFor18330(process)
process = customiseFor18429(process)
process = customiseFor18559(process)

return process
38 changes: 24 additions & 14 deletions HLTrigger/Egamma/interface/HLTEgammaGenericQuadraticEtaFilter.h
Expand Up @@ -35,29 +35,39 @@ class HLTEgammaGenericQuadraticEtaFilter : public HLTFilter {
edm::EDGetTokenT<reco::RecoEcalCandidateIsolationMap> varToken_;
bool lessThan_; // the cut is "<" or ">" ?
bool useEt_; // use E or Et in relative isolation cuts
/* Barrel quadratic threshold function:
/* Barrel quadratic threshold function:
vali (<= or >=) thrRegularEB_ + (E or Et)*thrOverEEB_ + (E or Et)*(E or Et)*thrOverE2EB_
Endcap quadratic threshold function:
vali (<= or >=) thrRegularEE_ + (E or Et)*thrOverEEE_ + (E or Et)*(E or Et)*thrOverE2EE_
*/
*/

std::vector<double> energyLowEdges_; // lower bin edges for energy-dependent cuts
double etaBoundaryEB12_; //eta Boundary between Regions 1 and 2 - ECAL barrel
double etaBoundaryEE12_; //eta Boundary between Regions 1 and 2 - ECAL endcap
double thrRegularEB1_; // threshold value for zeroth order term - ECAL barrel region 1
double thrRegularEE1_; // threshold value for zeroth order term - ECAL endcap region 1
double thrOverEEB1_; // coefficient for first order term - ECAL barrel region 1
double thrOverEEE1_; // coefficient for first order term - ECAL endcap region 1
double thrOverE2EB1_; // coefficient for second order term - ECAL barrel region 1
double thrOverE2EE1_; // coefficient for second order term - ECAL endcap region 1
double thrRegularEB2_; // threshold value for zeroth order term - ECAL barrel region 2
double thrRegularEE2_; // threshold value for zeroth order term - ECAL endcap region 2
double thrOverEEB2_; // coefficient for first order term - ECAL barrel region 2
double thrOverEEE2_; // coefficient for first order term - ECAL endcap region 2
double thrOverE2EB2_; // coefficient for second order term - ECAL barrel region 2
double thrOverE2EE2_; // coefficient for second order term - ECAL endcap region 2
std::vector<double> thrRegularEB1_; // threshold value for zeroth order term - ECAL barrel region 1
std::vector<double> thrRegularEE1_; // threshold value for zeroth order term - ECAL endcap region 1
std::vector<double> thrOverEEB1_; // coefficient for first order term - ECAL barrel region 1
std::vector<double> thrOverEEE1_; // coefficient for first order term - ECAL endcap region 1
std::vector<double> thrOverE2EB1_; // coefficient for second order term - ECAL barrel region 1
std::vector<double> thrOverE2EE1_; // coefficient for second order term - ECAL endcap region 1
std::vector<double> thrRegularEB2_; // threshold value for zeroth order term - ECAL barrel region 2
std::vector<double> thrRegularEE2_; // threshold value for zeroth order term - ECAL endcap region 2
std::vector<double> thrOverEEB2_; // coefficient for first order term - ECAL barrel region 2
std::vector<double> thrOverEEE2_; // coefficient for first order term - ECAL endcap region 2
std::vector<double> thrOverE2EB2_; // coefficient for second order term - ECAL barrel region 2
std::vector<double> thrOverE2EE2_; // coefficient for second order term - ECAL endcap region 2
int ncandcut_; // number of candidates required

bool store_;
edm::InputTag l1EGTag_;

edm::InputTag rhoTag_; // input tag identifying rho producer
edm::EDGetTokenT<double> rhoToken_;
bool doRhoCorrection_;
double rhoMax_;
double rhoScale_;
std::vector<double> effectiveAreas_;
std::vector<double> absEtaLowEdges_;
};

#endif //HLTEgammaGenericQuadraticEtaFilter_h
Expand Down
25 changes: 17 additions & 8 deletions HLTrigger/Egamma/interface/HLTEgammaGenericQuadraticFilter.h
Expand Up @@ -36,20 +36,29 @@ class HLTEgammaGenericQuadraticFilter : public HLTFilter {

bool lessThan_; // the cut is "<" or ">" ?
bool useEt_; // use E or Et in relative isolation cuts
/* Barrel quadratic threshold function:
/* Barrel quadratic threshold function:
vali (<= or >=) thrRegularEB_ + (E or Et)*thrOverEEB_ + (E or Et)*(E or Et)*thrOverE2EB_
Endcap quadratic threshold function:
vali (<= or >=) thrRegularEE_ + (E or Et)*thrOverEEE_ + (E or Et)*(E or Et)*thrOverE2EE_
*/
double thrRegularEB_; // threshold value for zeroth order term - ECAL barrel
double thrRegularEE_; // threshold value for zeroth order term - ECAL endcap
double thrOverEEB_; // coefficient for first order term - ECAL barrel
double thrOverEEE_; // coefficient for first order term - ECAL endcap
double thrOverE2EB_; // coefficient for second order term - ECAL barrel
double thrOverE2EE_; // coefficient for second order term - ECAL endcap
*/
std::vector<double> energyLowEdges_; // lower bin edges for energy-dependent cuts
std::vector<double> thrRegularEB_; // threshold value for zeroth order term - ECAL barrel
std::vector<double> thrRegularEE_; // threshold value for zeroth order term - ECAL endcap
std::vector<double> thrOverEEB_; // coefficient for first order term - ECAL barrel
std::vector<double> thrOverEEE_; // coefficient for first order term - ECAL endcap
std::vector<double> thrOverE2EB_; // coefficient for second order term - ECAL barrel
std::vector<double> thrOverE2EE_; // coefficient for second order term - ECAL endcap
int ncandcut_; // number of candidates required

edm::InputTag l1EGTag_;

edm::InputTag rhoTag_; // input tag identifying rho producer
edm::EDGetTokenT<double> rhoToken_;
bool doRhoCorrection_;
double rhoMax_;
double rhoScale_;
std::vector<double> effectiveAreas_;
std::vector<double> absEtaLowEdges_;
};

#endif //HLTEgammaGenericQuadraticFilter_h
Expand Down
28 changes: 19 additions & 9 deletions HLTrigger/Egamma/interface/HLTGenericFilter.h
Expand Up @@ -53,17 +53,27 @@ class HLTGenericFilter : public HLTFilter {
edm::InputTag varTag_; // input tag identifying product that contains variable map
edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> candToken_;
edm::EDGetTokenT<T1IsolationMap> varToken_;
bool lessThan_; // the cut is "<" or ">" ?
bool useEt_; // use E or Et in relative isolation cuts
double thrRegularEB_; // threshold for regular cut (x < thr) - ECAL barrel
double thrRegularEE_; // threshold for regular cut (x < thr) - ECAL endcap
double thrOverEEB_; // threshold for x/E < thr cut (isolations) - ECAL barrel
double thrOverEEE_; // threshold for x/E < thr cut (isolations) - ECAL endcap
double thrOverE2EB_; // threshold for x/E^2 < thr cut (isolations) - ECAL barrel
double thrOverE2EE_; // threshold for x/E^2 < thr cut (isolations) - ECAL endcap
int ncandcut_; // number of candidates required

std::vector<double> energyLowEdges_; // lower bin edges for energy-dependent cuts
bool lessThan_; // the cut is "<" or ">" ?
bool useEt_; // use E or Et in relative isolation cuts
std::vector<double> thrRegularEB_; // threshold for regular cut (x < thr) - ECAL barrel
std::vector<double> thrRegularEE_; // threshold for regular cut (x < thr) - ECAL endcap
std::vector<double> thrOverEEB_; // threshold for x/E < thr cut (isolations) - ECAL barrel
std::vector<double> thrOverEEE_; // threshold for x/E < thr cut (isolations) - ECAL endcap
std::vector<double> thrOverE2EB_; // threshold for x/E^2 < thr cut (isolations) - ECAL barrel
std::vector<double> thrOverE2EE_; // threshold for x/E^2 < thr cut (isolations) - ECAL endcap
int ncandcut_; // number of candidates required

edm::InputTag l1EGTag_;

edm::InputTag rhoTag_; // input tag identifying rho producer
edm::EDGetTokenT<double> rhoToken_;
bool doRhoCorrection_;
double rhoMax_;
double rhoScale_;
std::vector<double> effectiveAreas_;
std::vector<double> absEtaLowEdges_;
};

#endif //HLTGenericFilter_h
Expand Down

0 comments on commit de37182

Please sign in to comment.