CMS 3D CMS Logo

gsfElectrons_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
4 
5 from RecoEgamma.EgammaIsolationAlgos.electronTrackIsolations_cfi import trkIsol03CfgV1,trkIsol04CfgV1,trkIsol03CfgV2,trkIsol04CfgV2
6 
7 #==============================================================================
8 # Producer of transient ecal driven gsf electrons
9 #==============================================================================
10 
11 ecalDrivenGsfElectrons = cms.EDProducer("GsfElectronBaseProducer",
12 
13  # input collections
14  previousGsfElectronsTag = cms.InputTag(""),
15  pflowGsfElectronsTag = cms.InputTag(""),
16  gsfElectronCoresTag = cms.InputTag("ecalDrivenGsfElectronCores"),
17  pfMvaTag = cms.InputTag(""),
18 
19  gedElectronMode = cms.bool(False),
20 
21  # steering
22  applyPreselection = cms.bool(False),
23  ecalDrivenEcalEnergyFromClassBasedParameterization = cms.bool(True),
24  ecalDrivenEcalErrorFromClassBasedParameterization = cms.bool(True),
25  applyAmbResolution = cms.bool(False),
26  useEcalRegression = cms.bool(False),
27  useCombinationRegression = cms.bool(False),
28 
29  # preselection parameters (ecal driven electrons)
30  preselection = cms.PSet(
31  minSCEtBarrel = cms.double(4.0),
32  minSCEtEndcaps = cms.double(4.0),
33  maxDeltaEtaBarrel = cms.double(0.02),
34  maxDeltaEtaEndcaps = cms.double(0.02),
35  maxDeltaPhiBarrel = cms.double(0.15),
36  maxDeltaPhiEndcaps = cms.double(0.15),
37  maxHOverEBarrelCone = cms.double(0.15),
38  maxHOverEEndcapsCone = cms.double(0.15),
39  maxHOverEBarrelTower = cms.double(0.15),
40  maxHOverEEndcapsTower = cms.double(0.15),
41  ),
42 
43  # Ecal rec hits configuration
44  recHitFlagsToBeExcludedBarrel = cleanedHybridSuperClusters.RecHitFlagToBeExcluded,
45  recHitFlagsToBeExcludedEndcaps = multi5x5BasicClustersCleaned.RecHitFlagToBeExcluded,
46  recHitSeverityToBeExcludedBarrel = cleanedHybridSuperClusters.RecHitSeverityToBeExcluded,
47  recHitSeverityToBeExcludedEndcaps = cleanedHybridSuperClusters.RecHitSeverityToBeExcluded,
48 
49  # Isolation algos configuration
50  trkIsol03Cfg = trkIsol03CfgV1,
51  trkIsol04Cfg = trkIsol04CfgV1,
52  trkIsolHEEP03Cfg = trkIsol03CfgV2,
53  trkIsolHEEP04Cfg = trkIsol04CfgV2,
54 
55  # Iso values
56  useIsolationValues = cms.bool(False),
57 
58  SoftElecMVAFilesString = cms.vstring("RecoEgamma/ElectronIdentification/data/TMVA_BDTSoftElectrons_9Dec2013.weights.xml"),
59 )
60 
61 from Configuration.Eras.Modifier_pp_on_AA_2018_cff import pp_on_AA_2018
62 pp_on_AA_2018.toModify(ecalDrivenGsfElectrons.preselection, minSCEtBarrel = 15.0)
63 pp_on_AA_2018.toModify(ecalDrivenGsfElectrons.preselection, minSCEtEndcaps = 15.0)
64 
65 #==============================================================================
66 # Final producer of persistent gsf electrons
67 #==============================================================================
68 
69 gsfElectrons = cms.EDProducer("GsfElectronProducer",
70 
71  # input collections
72  previousGsfElectronsTag = cms.InputTag("ecalDrivenGsfElectrons"),
73  pflowGsfElectronsTag = cms.InputTag("pfElectronTranslator","pf"),
74  gsfElectronCoresTag = cms.InputTag("gedGsfElectronCores"),
75  pfMvaTag = cms.InputTag("pfElectronTranslator","pf"),
76 
77  gedElectronMode = cms.bool(False),
78 
79  # steering
80  applyPreselection = cms.bool(True),
81  ecalDrivenEcalEnergyFromClassBasedParameterization = cms.bool(True),
82  ecalDrivenEcalErrorFromClassBasedParameterization = cms.bool(True),
83  applyAmbResolution = cms.bool(True),
84  useEcalRegression = cms.bool(False),
85  useCombinationRegression = cms.bool(False),
86 
87  # preselection parameters (ecal driven electrons)
88  preselection = cms.PSet(
89  minSCEtBarrel = cms.double(4.0),
90  minSCEtEndcaps = cms.double(4.0),
91  maxDeltaEtaBarrel = cms.double(0.02),
92  maxDeltaEtaEndcaps = cms.double(0.02),
93  maxDeltaPhiBarrel = cms.double(0.15),
94  maxDeltaPhiEndcaps = cms.double(0.15),
95  maxHOverEBarrel = cms.double(0.15),
96  maxHOverEEndcaps = cms.double(0.15),
97  minMVA = cms.double(-0.1),
98  minMvaByPassForIsolated = cms.double(-0.1),
99  ),
100 
101  # preselection parameters (tracker driven only electrons)
102  preselectionPflow = cms.PSet(
103  minMVAPflow = cms.double(-0.1),
104  minMvaByPassForIsolatedPflow = cms.double(-0.1),
105  ),
106 
107  # Ecal rec hits configuration
108  recHitFlagsToBeExcludedBarrel = cleanedHybridSuperClusters.RecHitFlagToBeExcluded,
109  recHitFlagsToBeExcludedEndcaps = multi5x5BasicClustersCleaned.RecHitFlagToBeExcluded,
110  recHitSeverityToBeExcludedBarrel = cleanedHybridSuperClusters.RecHitSeverityToBeExcluded,
111  recHitSeverityToBeExcludedEndcaps = cleanedHybridSuperClusters.RecHitSeverityToBeExcluded,
112 
113  # Iso values
114  useIsolationValues = cms.bool(True),
115 )
116 
117 ecalDrivenGsfElectronsFromMultiCl = ecalDrivenGsfElectrons.clone(
118  gsfElectronCoresTag = "ecalDrivenGsfElectronCoresFromMultiCl",
119 )
120 
121 from Configuration.ProcessModifiers.egamma_lowPt_exclusive_cff import egamma_lowPt_exclusive
122 egamma_lowPt_exclusive.toModify(gsfElectrons.preselection,
123  minSCEtBarrel = 1.0,
124  minSCEtEndcaps = 1.0)
125 
126 egamma_lowPt_exclusive.toModify(gsfElectrons,
127  applyPreselection = False)