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

Allow ECAL pfrechit thresholds eta dependent in all regions, disregarding if ZS of FR (10-1-X) #22265

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
95 changes: 94 additions & 1 deletion HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Expand Up @@ -68,12 +68,105 @@ def customiseFor2017DtUnpacking(process):

return process



# particleFlowRechitECAL new default value "false" flag to be added
def customiseForEcalTestPR22254Default(process):
from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the era imports appear to be unnecessary


for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
if hasattr(process,hltParticleFlowRecHitECAL):
module = getattr(process,hltParticleFlowRecHitECAL)

for producer in module.producers:
if hasattr(producer,'srFlags'):
producer.srFlags = cms.InputTag("")
if hasattr(producer,'qualityTests'):
for qualityTest in producer.qualityTests:
if hasattr(qualityTest,'thresholds'):
qualityTest.applySelectionsToAllCrystals = cms.bool(True)

return process



# Test thresholds for particleFlowRechitECAL ~ 0.5 sigma
def customiseForEcalTestPR22254thresholdA(process):
from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
from RecoParticleFlow.PFClusterProducer.particleFlowZeroSuppressionECAL_cff import _particle_flow_zero_suppression_ECAL_2018_A

for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
if hasattr(process,hltParticleFlowRecHitECAL):
module = getattr(process,hltParticleFlowRecHitECAL)

for producer in module.producers:
if hasattr(producer,'srFlags'):
producer.srFlags = cms.InputTag("")
if hasattr(producer,'qualityTests'):
for qualityTest in producer.qualityTests:
if hasattr(qualityTest,'thresholds'):
qualityTest.thresholds = _particle_flow_zero_suppression_ECAL_2018_A.thresholds
qualityTest.applySelectionsToAllCrystals = cms.bool(True)

return process





# Test thresholds for particleFlowRechitECAL ~ 1 sigma
def customiseForEcalTestPR22254thresholdB(process):
from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
from RecoParticleFlow.PFClusterProducer.particleFlowZeroSuppressionECAL_cff import _particle_flow_zero_suppression_ECAL_2018_B

for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
if hasattr(process,hltParticleFlowRecHitECAL):
module = getattr(process,hltParticleFlowRecHitECAL)

for producer in module.producers:
if hasattr(producer,'srFlags'):
producer.srFlags = cms.InputTag("")
if hasattr(producer,'qualityTests'):
for qualityTest in producer.qualityTests:
if hasattr(qualityTest,'thresholds'):
qualityTest.thresholds = _particle_flow_zero_suppression_ECAL_2018_B.thresholds
qualityTest.applySelectionsToAllCrystals = cms.bool(True)

return process




# Test thresholds for particleFlowRechitECAL ~ 2 sigma
def customiseForEcalTestPR22254thresholdC(process):
from Configuration.Eras.Modifier_run2_ECAL_2017_cff import run2_ECAL_2017
from RecoParticleFlow.PFClusterProducer.particleFlowZeroSuppressionECAL_cff import _particle_flow_zero_suppression_ECAL_2018_C

for hltParticleFlowRecHitECAL in ['hltParticleFlowRecHitECALUnseeded', 'hltParticleFlowRecHitECALL1Seeded', 'hltParticleFlowRecHitECALForMuonsMF', 'hltParticleFlowRecHitECALForTkMuonsMF']:
if hasattr(process,hltParticleFlowRecHitECAL):
module = getattr(process,hltParticleFlowRecHitECAL)

for producer in module.producers:
if hasattr(producer,'srFlags'):
producer.srFlags = cms.InputTag("")
if hasattr(producer,'qualityTests'):
for qualityTest in producer.qualityTests:
if hasattr(qualityTest,'thresholds'):
qualityTest.thresholds = _particle_flow_zero_suppression_ECAL_2018_C.thresholds
qualityTest.applySelectionsToAllCrystals = cms.bool(True)

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 = customiseForEcalTestPR22254Default(process)
process = customiseFor21821(process)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the calls in order: most recent last!

return process
14 changes: 10 additions & 4 deletions RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h
Expand Up @@ -391,11 +391,12 @@ class PFRecHitQTestECALMultiThreshold : public PFRecHitQTestBase {

PFRecHitQTestECALMultiThreshold(const edm::ParameterSet& iConfig):
PFRecHitQTestBase(iConfig),
thresholds_(iConfig.getParameter<std::vector<double> >("thresholds"))
{
thresholds_(iConfig.getParameter<std::vector<double> >("thresholds")),
applySelectionsToAllCrystals_(iConfig.getParameter<bool>("applySelectionsToAllCrystals"))
{
if (thresholds_.size() != EcalRingCalibrationTools::N_RING_TOTAL)
throw edm::Exception(edm::errors::Configuration, "ValueError")
<< "thresholds is expected to have " << EcalRingCalibrationTools::N_RING_TOTAL << " elements but has " << thresholds_.size();
<< "thresholds is expected to have " << EcalRingCalibrationTools::N_RING_TOTAL << " elements but has " << thresholds_.size();
}

void beginEvent(const edm::Event& event, const edm::EventSetup& iSetup) override {
Expand All @@ -410,7 +411,8 @@ class PFRecHitQTestECALMultiThreshold : public PFRecHitQTestBase {
}

bool test(reco::PFRecHit& hit, const EcalRecHit& rh, bool& clean, bool fullReadOut) override{
return fullReadOut or pass(hit);
if (applySelectionsToAllCrystals_) return pass(hit);
else return fullReadOut or pass(hit);
}
bool test(reco::PFRecHit& hit, const HBHERecHit& rh, bool& clean) override{
return true;
Expand All @@ -435,6 +437,10 @@ class PFRecHitQTestECALMultiThreshold : public PFRecHitQTestBase {
const std::vector<double> thresholds_;
bool endcapGeometrySet_;

// apply selections to all crystals
bool applySelectionsToAllCrystals_;


bool pass(const reco::PFRecHit& hit){

DetId detId(hit.detId());
Expand Down
Expand Up @@ -20,7 +20,8 @@
qualityTests = cms.VPSet(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with applySelectionsToAllCrystals = True, I think that we can go back to setting of srFlags to be non-empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the flag applySelectionsToAllCrystals set to true, setting the srFlags will not have any effect.
Maybe we gain time leaving it false, so that the collection is not even retrieved.

cms.PSet(
name = cms.string("PFRecHitQTestECALMultiThreshold"),
thresholds = particle_flow_zero_suppression_ECAL.thresholds
thresholds = particle_flow_zero_suppression_ECAL.thresholds,
applySelectionsToAllCrystals = cms.bool(False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be changed to "True" (same for EE)

),
cms.PSet(
name = cms.string("PFRecHitQTestECAL"),
Expand All @@ -38,7 +39,8 @@
qualityTests = cms.VPSet(
cms.PSet(
name = cms.string("PFRecHitQTestECALMultiThreshold"),
thresholds = particle_flow_zero_suppression_ECAL.thresholds
thresholds = particle_flow_zero_suppression_ECAL.thresholds,
applySelectionsToAllCrystals = cms.bool(False)
),
cms.PSet(
name = cms.string("PFRecHitQTestECAL"),
Expand Down
Expand Up @@ -11,6 +11,38 @@
_pfZeroSuppressionThresholds_EEminus_2017 = pfZeroSuppressionThresholds_EEminus
_pfZeroSuppressionThresholds_EEplus_2017 = _pfZeroSuppressionThresholds_EEminus_2017

# A
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add some comments to describe the purpose of these 3 alternative parameters.
IIUC, none of these will make it to the standard reco until the studies are complete.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that comments were added to describe A,B,C in HLTrigger/Configuration/python/customizeHLTforCMSSW.py.
For completeness, please add something similar here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.
For sake of completeness and future references, I add here a link to a presentation with the details:

For additional information: https://indico.cern.ch/event/704940/contributions/2892425/attachments/1602745/2541631/2018EcalChanges_jetMet.pdf

_pfZeroSuppressionThresholds_EB_2018_A = [0.180]*170
_pfZeroSuppressionThresholds_EEminus_2018_A = [0.22, 0.22, 0.24, 0.26, 0.28, 0.3, 0.32, 0.34, 0.34, 0.36, 0.36, 0.38, 0.38, 0.4, 0.44, 0.46, 0.5, 0.54, 0.58, 0.62, 0.68, 0.72, 0.78, 0.84, 0.9, 1.0, 1.14, 1.36, 1.68, 2.14, 2.8, 3.76, 5.1, 6.94, 9.46, 12.84, 17.3, 23.2, 30.8]
_pfZeroSuppressionThresholds_EEplus_2018_A = _pfZeroSuppressionThresholds_EEminus_2018_A

_particle_flow_zero_suppression_ECAL_2018_A = cms.PSet(
thresholds = cms.vdouble(_pfZeroSuppressionThresholds_EB_2018_A + _pfZeroSuppressionThresholds_EEminus_2018_A + _pfZeroSuppressionThresholds_EEplus_2018_A
)
)

# B
_pfZeroSuppressionThresholds_EB_2018_B = [0.140]*170
_pfZeroSuppressionThresholds_EEminus_2018_B = [0.11, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.17, 0.18, 0.18, 0.19, 0.19, 0.20, 0.22, 0.23, 0.25, 0.27, 0.29, 0.31, 0.34, 0.36, 0.39, 0.42, 0.45, 0.50, 0.57, 0.68, 0.84, 1.07, 1.40, 1.88, 2.55, 3.47, 4.73, 6.42, 8.65, 11.6, 15.4]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit surprised that EE thresholds are lower than EB.
Is it correct?
Do we really need to go to thresholds lower than the "2016 /Run1 style" which has 0.3 GeV in EE?

May I suggest to eventually adjust all thresholds to be at the minimium the values of 0.08 in EB and 0.3 in EE.
I don't think we can claim a better performance is still possible by going below the 2016/Run1 state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, comments have been fixed. Thanks for spotting this.

_pfZeroSuppressionThresholds_EEplus_2018_B = _pfZeroSuppressionThresholds_EEminus_2018_B


_particle_flow_zero_suppression_ECAL_2018_B = cms.PSet(
thresholds = cms.vdouble(_pfZeroSuppressionThresholds_EB_2018_B + _pfZeroSuppressionThresholds_EEminus_2018_B + _pfZeroSuppressionThresholds_EEplus_2018_B
)
)

# C
_pfZeroSuppressionThresholds_EB_2018_C = [0.100]*170
_pfZeroSuppressionThresholds_EEminus_2018_C = [0.055, 0.055, 0.06, 0.065, 0.07, 0.075, 0.08, 0.085, 0.085, 0.09, 0.09, 0.095, 0.095, 0.1, 0.11, 0.115, 0.125, 0.135, 0.145, 0.155, 0.17, 0.18, 0.195, 0.21, 0.225, 0.25, 0.285, 0.34, 0.42, 0.535, 0.7, 0.94, 1.275, 1.735, 2.365, 3.21, 4.325, 5.8, 7.7 ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly to the comment on _B: please harmonize this with what we had in 2016.
Perhaps EB can be 0.08 instead of 0.1 and the lower value of EE to be 0.3

_pfZeroSuppressionThresholds_EEplus_2018_C = _pfZeroSuppressionThresholds_EEminus_2018_C


_particle_flow_zero_suppression_ECAL_2018_C = cms.PSet(
thresholds = cms.vdouble(_pfZeroSuppressionThresholds_EB_2018_C + _pfZeroSuppressionThresholds_EEminus_2018_C + _pfZeroSuppressionThresholds_EEplus_2018_C
)
)



particle_flow_zero_suppression_ECAL = cms.PSet(
Expand Down