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, editorTools.UserCodeTool._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, editorTools.ChangeSource._defaultParameters, coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._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(), 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, editorTools.UserCodeTool._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, editorTools.ChangeSource._defaultParameters, coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, SignedImpactParameter3D.apply(), gen::PhotosInterfaceBase.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), gen::PhotosInterface.apply(), gen::PhotosInterface53XLegacy.apply(), cmsswVersionTools.Run52xOn51xTrigger.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), BeamSpotAlignmentParameters.apply(), RigidBodyAlignmentParameters.apply(), ConfigToolBase.ConfigToolBase.apply(), AlignmentParameters.apply(), BowedSurfaceAlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), TwoBowedSurfacesAlignmentParameters.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), reco::modules::TrackerTrackHitFilter::Rule.apply(), 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(), reco::Or< bool >.apply(), reco::Less< T >.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), reco::LessEqual< T >.apply(), reco::More< T >.apply(), reco::MoreEqual< T >.apply(), reco::Equal< T >.apply(), jetTools.RunBTagging.apply(), ora::OraMainTable.setParameter(), ora::IMainTable.setParameter(), PedeReader.setParameter(), ora::PoolMainTable.setParameter(), fit::RootMinuit< Function >.setParameter(), and 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, editorTools.UserCodeTool._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, editorTools.ChangeSource._defaultParameters, coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, coreTools.RemoveCleaning._defaultParameters, and coreTools.AddCleaning._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 editorTools.UserCodeTool._parameters, electronTools.AddElectronUserIsolation._parameters, coreTools.RestrictInputToAOD._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, cmsswVersionTools.Run52xOn51xTrigger._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, coreTools.RunOnData._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, coreTools.RemoveMCMatching._parameters, coreTools.RemoveAllPATObjectsBut._parameters, coreTools.RemoveSpecificPATObjects._parameters, coreTools.RemoveCleaning._parameters, and coreTools.AddCleaning._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.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__(), and jetTools.SwitchJetCollection.__init__().

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__(), metTools.AddPfMET.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), jetTools.RunBTagging.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), HiCoreTools.RemoveCleaning.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.AddCleaning.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), jetTools.AddJetCollection.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), trigTools.RemoveCleaningFromTriggerMatching.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), jetTools.SwitchJetCorrLevels.__call__(), metUncertaintyTools.RunMEtUncertainties.__call__(), photonTools.AddPhotonUserIsolation.__init__(), electronTools.AddElectronUserIsolation.__init__(), muonTools.AddMuonUserIsolation.__init__(), trackTools.MakeAODTrackCandidates.__init__(), metTools.AddTcMET.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), metUncertaintyTools.RunMEtUncertainties.__init__(), metTools.AddPfMET.__init__(), HiCoreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), jetTools.RunBTagging.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), HiCoreTools.RemoveCleaning.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.AddCleaning.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), jetTools.AddJetCollection.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), trigTools.RemoveCleaningFromTriggerMatching.__init__(), jetTools.SwitchJetCollection.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), jetTools.SwitchJetCorrLevels.__init__(), metUncertaintyTools.RunMEtUncertainties._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), photonTools.AddPhotonUserIsolation.getDefaultParameters(), electronTools.AddElectronUserIsolation.getDefaultParameters(), heavyIonTools.ConfigureHeavyIons.getDefaultParameters(), muonTools.AddMuonUserIsolation.getDefaultParameters(), metTools.AddTcMET.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), heavyIonTools.ProductionDefaults.getDefaultParameters(), metTools.AddPfMET.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), metUncertaintyTools.RunMEtUncertainties.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), heavyIonTools.SelectionDefaults.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), heavyIonTools.DisbaleMonteCarloDeps.getDefaultParameters(), jetTools.RunBTagging.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), trigTools.RemoveCleaningFromTriggerMatching.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), jetTools.SwitchJetCorrLevels.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and 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 metUncertaintyTools.RunMEtUncertainties.__init__(), jetTools.SwitchJetCollection.__init__(), jetTools.RunBTagging.apply(), electronTools.AddElectronUserIsolation.toolCode(), photonTools.AddPhotonUserIsolation.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(), trackTools.MakeTrackCandidates.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), tauTools.AddTauCollection.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), jetTools.AddJetCollection.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), trigTools.RemoveCleaningFromTriggerMatching.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), jetTools.SwitchJetCorrLevels.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().