CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
electronTools.AddElectronUserIsolation Class Reference
Inheritance diagram for electronTools.AddElectronUserIsolation:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

tuple _defaultParameters = dicttypes.SortedKeysDict()
 
string _label = 'addElectronUserIsolation'
 

Detailed Description

add userIsolation to patElectron

Definition at line 3 of file electronTools.py.

Constructor & Destructor Documentation

def electronTools.AddElectronUserIsolation.__init__ (   self)

Definition at line 10 of file electronTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, python.editorTools.UserCodeTool._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, python.editorTools.ChangeSource._defaultParameters, coreTools.RunOnData._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), PythonParameterSet.addParameter(), LutXml.addParameter(), python.ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

10 
11  def __init__(self):
12  ConfigToolBase.__init__(self)
13  self.addParameter(self._defaultParameters,'isolationTypes',['All'],'List of predefined userIsolation types to be added; possible values are [\'Tracker\',\'Ecal\',\'Hcal\'] or just [\'All\']', allowedValues=['Tracker','Ecal','Hcal','All'])
14  self._parameters=copy.deepcopy(self._defaultParameters)
15  self._comment = ''

Member Function Documentation

def electronTools.AddElectronUserIsolation.__call__ (   self,
  process,
  isolationTypes = None 
)

Definition at line 19 of file electronTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, python.editorTools.UserCodeTool._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, python.editorTools.ChangeSource._defaultParameters, coreTools.RunOnData._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, SignedImpactParameter3D.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), gen::PhotosInterface.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), FWGUIEventFilter.apply(), jetTools.RunBTagging.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), python.ConfigToolBase.ConfigToolBase.apply(), AlignmentParameters.apply(), BowedSurfaceAlignmentParameters.apply(), python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), TwoBowedSurfacesAlignmentParameters.apply(), python.Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), python.Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), reco::Add< T >.apply(), reco::Sub< T >.apply(), reco::Mul< T >.apply(), reco::Div< T >.apply(), reco::And< bool >.apply(), cmsswVersionTools.RunBTagging35X.apply(), reco::Or< bool >.apply(), reco::Less< T >.apply(), reco::LessEqual< T >.apply(), reco::More< T >.apply(), reco::MoreEqual< T >.apply(), reco::Equal< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), PedeReader.setParameter(), fit::RootMinuit< Function >.setParameter(), and python.ConfigToolBase.ConfigToolBase.setParameter().

19 
20  def __call__(self,process,isolationTypes=None) :
21  if isolationTypes is None:
22  isolationTypes=self._defaultParameters['isolationTypes'].value
23  self.setParameter('isolationTypes',isolationTypes)
24  self.apply(process)
def electronTools.AddElectronUserIsolation.getDefaultParameters (   self)

Definition at line 16 of file electronTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, python.editorTools.UserCodeTool._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, python.editorTools.ChangeSource._defaultParameters, coreTools.RunOnData._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, and cmsswVersionTools.PickRelValInputFiles._defaultParameters.

Referenced by trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), and trigTools.SwitchOnTriggerMatchingStandAlone.toolCode().

16 
17  def getDefaultParameters(self):
18  return self._defaultParameters
def electronTools.AddElectronUserIsolation.toolCode (   self,
  process 
)

Definition at line 25 of file electronTools.py.

References python.editorTools.UserCodeTool._parameters, electronTools.AddElectronUserIsolation._parameters, coreTools.RestrictInputToAOD._parameters, python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, python.ConfigToolBase.ConfigToolBase._parameters, python.editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, coreTools.RunOnData._parameters, coreTools.RemoveMCMatching._parameters, cmsswVersionTools.RunBTagging35X._parameters, coreTools.RemoveAllPATObjectsBut._parameters, coreTools.RemoveSpecificPATObjects._parameters, cmsswVersionTools.AddJetCollection35X._parameters, coreTools.RemoveCleaning._parameters, coreTools.AddCleaning._parameters, cmsswVersionTools.SwitchJetCollection35X._parameters, and cmsswVersionTools.PickRelValInputFiles._parameters.

25 
26  def toolCode(self, process):
27  isolationTypes=self._parameters['isolationTypes'].value
28 
29  # includes to fix fastsim problems
30  from RecoEgamma.EgammaIsolationAlgos.eleIsoDeposits_cff import eleIsoDepositTk, eleIsoDepositEcalFromHits, eleIsoDepositHcalFromTowers
31  from RecoEgamma.EgammaIsolationAlgos.eleIsoFromDeposits_cff import eleIsoFromDepsTk, eleIsoFromDepsEcalFromHitsByCrystal, eleIsoFromDepsHcalFromTowers
32 
33  eleIsoDepositEcalFromHits.ExtractorPSet.barrelEcalHits = cms.InputTag("reducedEcalRecHitsEB")
34  eleIsoDepositEcalFromHits.ExtractorPSet.endcapEcalHits = cms.InputTag("reducedEcalRecHitsEE")
35 
36  # key to define the parameter sets
37  isolationKey=0
38  # add pre-requisits to the electron
39  for obj in range(len(isolationTypes)):
40  if ( isolationTypes[obj] == 'Tracker' or isolationTypes[obj] == 'All'):
41  print "adding predefined userIsolation to pat::Electron for Tracker"
42  print " -> to access this information call pat::Electron::userIsolation(pat::TrackIso) in your analysis code <-"
43  isolationKey=isolationKey+1
44  from PhysicsTools.PatAlgos.recoLayer0.electronIsolation_cff import patElectronTrackIsolation
45  process.patElectronTrackIsolation
46  process.patDefaultSequence.replace( process.patElectrons, process.patElectronTrackIsolation*process.patElectrons )
47 
48  if ( isolationTypes[obj] == 'Ecal' or isolationTypes[obj] == 'All'):
49  print "adding predefined userIsolation to pat::Electron for Ecal"
50  print " -> to access this information call pat::Electron::userIsolation(pat::EcalIso ) in your analysis code <-"
51  isolationKey=isolationKey+10
52  from PhysicsTools.PatAlgos.recoLayer0.electronIsolation_cff import patElectronEcalIsolation
53  process.patElectronEcalIsolation
54  process.patDefaultSequence.replace( process.patElectrons, process.patElectronEcalIsolation*process.patElectrons )
55 
56  if ( isolationTypes[obj] == 'Hcal' or isolationTypes[obj] == 'All'):
57  print "adding predefined userIsolation to pat::Electron for Hcal"
58  print " -> to access this information call pat::Electron::userIsolation(pat::HcalIso ) in your analysis code <-"
59  isolationKey=isolationKey+100
60  from PhysicsTools.PatAlgos.recoLayer0.electronIsolation_cff import patElectronHcalIsolation
61  process.patElectronHcalIsolation = patElectronHcalIsolation
62  process.patDefaultSequence.replace( process.patElectrons, process.patElectronHcalIsolation*process.patElectrons )
63 
64  # do the corresponding replacements in the pat electron
65  if ( isolationKey == 1 ):
66  # tracker
67  process.patElectrons.isoDeposits = cms.PSet(
68  tracker = cms.InputTag("eleIsoDepositTk"),
69  )
70  process.patElectrons.userIsolation = cms.PSet(
71  tracker = cms.PSet(
72  src = cms.InputTag("eleIsoFromDepsTk"),
73  ),
74  )
75  if ( isolationKey == 10 ):
76  # ecal
77  process.patElectrons.isoDeposits = cms.PSet(
78  ecal = cms.InputTag("eleIsoDepositEcalFromHits"),
79  )
80  process.patElectrons.userIsolation = cms.PSet(
81  ecal = cms.PSet(
82  src = cms.InputTag("eleIsoFromDepsEcalFromHitsByCrystal"),
83  ),
84  )
85  if ( isolationKey == 100 ):
86  # hcal
87  process.patElectrons.isoDeposits = cms.PSet(
88  hcal = cms.InputTag("eleIsoDepositHcalFromTowers"),
89  )
90  process.patElectrons.userIsolation = cms.PSet(
91  hcal = cms.PSet(
92  src = cms.InputTag("eleIsoFromDepsHcalFromTowers"),
93  ),
94  )
95  if ( isolationKey == 11 ):
96  # ecal + tracker
97  process.patElectrons.isoDeposits = cms.PSet(
98  tracker = cms.InputTag("eleIsoDepositTk"),
99  ecal = cms.InputTag("eleIsoDepositEcalFromHits"),
100  )
101  process.patElectrons.userIsolation = cms.PSet(
102  tracker = cms.PSet(
103  src = cms.InputTag("eleIsoFromDepsTk"),
104  ),
105  ecal = cms.PSet(
106  src = cms.InputTag("eleIsoFromDepsEcalFromHitsByCrystal"),
107  ),
108  )
109  if ( isolationKey == 101 ):
110  # hcal + tracker
111  process.patElectrons.isoDeposits = cms.PSet(
112  tracker = cms.InputTag("eleIsoDepositTk"),
113  hcal = cms.InputTag("eleIsoDepositHcalFromTowers"),
114  )
115  process.patElectrons.userIsolation = cms.PSet(
116  tracker = cms.PSet(
117  src = cms.InputTag("eleIsoFromDepsTk"),
118  ),
119  hcal = cms.PSet(
120  src = cms.InputTag("eleIsoFromDepsHcalFromTowers"),
121  ),
122  )
123  if ( isolationKey == 110 ):
124  # hcal + ecal
125  process.patElectrons.isoDeposits = cms.PSet(
126  ecal = cms.InputTag("eleIsoDepositEcalFromHits"),
127  hcal = cms.InputTag("eleIsoDepositHcalFromTowers"),
128  )
129  process.patElectrons.userIsolation = cms.PSet(
130  ecal = cms.PSet(
131  src = cms.InputTag("eleIsoFromDepsEcalFromHitsByCrystal"),
132  ),
133  hcal = cms.PSet(
134  src = cms.InputTag("eleIsoFromDepsHcalFromTowers"),
135  ),
136  )
137  if ( isolationKey == 111 ):
138  # hcal + ecal + tracker
139  process.patElectrons.isoDeposits = cms.PSet(
140  tracker = cms.InputTag("eleIsoDepositTk"),
141  ecal = cms.InputTag("eleIsoDepositEcalFromHits"),
142  hcal = cms.InputTag("eleIsoDepositHcalFromTowers"),
143  )
144  process.patElectrons.userIsolation = cms.PSet(
145  tracker = cms.PSet(
146  src = cms.InputTag("eleIsoFromDepsTk"),
147  ),
148  ecal = cms.PSet(
149  src = cms.InputTag("eleIsoFromDepsEcalFromHitsByCrystal"),
150  ),
151  hcal = cms.PSet(
152  src = cms.InputTag("eleIsoFromDepsHcalFromTowers"),
153  ),
154  )
155 
156 
157 addElectronUserIsolation=AddElectronUserIsolation()

Member Data Documentation

electronTools.AddElectronUserIsolation._comment
private

Definition at line 14 of file electronTools.py.

tuple electronTools.AddElectronUserIsolation._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 8 of file electronTools.py.

Referenced by electronTools.AddElectronUserIsolation.__call__(), photonTools.AddPhotonUserIsolation.__call__(), muonTools.AddMuonUserIsolation.__call__(), metTools.AddTcMET.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), trackTools.MakeAODTrackCandidates.__call__(), jetTools.RunBTagging.__call__(), metTools.AddPfMET.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), jetTools.AddJetCollection.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), HiCoreTools.RemoveCleaning.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.AddCleaning.__call__(), jetTools.SwitchJetCollection.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), trigTools.RemoveCleaningFromTriggerMatching.__call__(), jetTools.SwitchJetCorrLevels.__call__(), photonTools.AddPhotonUserIsolation.__init__(), electronTools.AddElectronUserIsolation.__init__(), muonTools.AddMuonUserIsolation.__init__(), trackTools.MakeAODTrackCandidates.__init__(), metTools.AddTcMET.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), jetTools.RunBTagging.__init__(), metTools.AddPfMET.__init__(), HiCoreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), jetTools.AddJetCollection.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), HiCoreTools.RemoveCleaning.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.AddCleaning.__init__(), jetTools.SwitchJetCollection.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), trigTools.RemoveCleaningFromTriggerMatching.__init__(), jetTools.SwitchJetCorrLevels.__init__(), python.ConfigToolBase.ConfigToolBase.getAllowedValues(), photonTools.AddPhotonUserIsolation.getDefaultParameters(), electronTools.AddElectronUserIsolation.getDefaultParameters(), muonTools.AddMuonUserIsolation.getDefaultParameters(), heavyIonTools.ConfigureHeavyIons.getDefaultParameters(), metTools.AddTcMET.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), jetTools.RunBTagging.getDefaultParameters(), heavyIonTools.ProductionDefaults.getDefaultParameters(), metTools.AddPfMET.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), heavyIonTools.SelectionDefaults.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), heavyIonTools.DisbaleMonteCarloDeps.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), trigTools.RemoveCleaningFromTriggerMatching.getDefaultParameters(), jetTools.SwitchJetCorrLevels.getDefaultParameters(), python.ConfigToolBase.ConfigToolBase.reset(), and python.ConfigToolBase.ConfigToolBase.setParameter().

string electronTools.AddElectronUserIsolation._label = 'addElectronUserIsolation'
staticprivate

Definition at line 7 of file electronTools.py.

Referenced by trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and trigTools.RemoveCleaningFromTriggerMatching.toolCode().

electronTools.AddElectronUserIsolation._parameters
private

Definition at line 13 of file electronTools.py.

Referenced by jetTools.RunBTagging.apply(), photonTools.AddPhotonUserIsolation.toolCode(), electronTools.AddElectronUserIsolation.toolCode(), metTools.AddTcMET.toolCode(), muonTools.AddMuonUserIsolation.toolCode(), HiCoreTools.RestrictInputToAOD.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddPfMET.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTrigger.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), jetTools.AddJetCollection.toolCode(), trackTools.MakeTrackCandidates.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), tauTools.AddTauCollection.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), jetTools.SwitchJetCollection.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), trigTools.RemoveCleaningFromTriggerMatching.toolCode(), and jetTools.SwitchJetCorrLevels.toolCode().