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
muonTools.AddMuonUserIsolation Class Reference
Inheritance diagram for muonTools.AddMuonUserIsolation:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

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

Detailed Description

add userIsolation to patMuon

Definition at line 4 of file muonTools.py.

Constructor & Destructor Documentation

def muonTools.AddMuonUserIsolation.__init__ (   self)

Definition at line 11 of file muonTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, python.editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, jetTools.RunBTagging._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, python.editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), PythonParameterSet.addParameter(), LutXml.addParameter(), python.ConfigToolBase.ConfigToolBase.addParameter(), and edm::ParameterSet.addParameter().

11 
12  def __init__(self):
13  ConfigToolBase.__init__(self)
14  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'])
15  self._parameters=copy.deepcopy(self._defaultParameters)
16  self._comment = ''

Member Function Documentation

def muonTools.AddMuonUserIsolation.__call__ (   self,
  process,
  isolationTypes = None 
)

Definition at line 20 of file muonTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, python.editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, jetTools.RunBTagging._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, python.editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, SignedImpactParameter3D.apply(), SignedTransverseImpactParameter.apply(), SignedDecayLength3D.apply(), SurveyParameters.apply(), gen::PhotosInterface.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().

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

Definition at line 17 of file muonTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, python.editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, jetTools.RunBTagging._defaultParameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, python.editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, cmsswVersionTools.RunBTagging35X._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, jetTools.AddJetCollection._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, cmsswVersionTools.AddJetCollection35X._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, cmsswVersionTools.SwitchJetCollection35X._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, and cmsswVersionTools.PickRelValInputFiles._defaultParameters.

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

17 
18  def getDefaultParameters(self):
19  return self._defaultParameters
def muonTools.AddMuonUserIsolation.toolCode (   self,
  process 
)

Definition at line 26 of file muonTools.py.

References python.editorTools.UserCodeTool._parameters, electronTools.AddElectronUserIsolation._parameters, heavyIonTools.ConfigureHeavyIons._parameters, metTools.AddTcMET._parameters, muonTools.AddMuonUserIsolation._parameters, coreTools.RestrictInputToAOD._parameters, python.Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, jetTools.RunBTagging._parameters, python.Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, heavyIonTools.ProductionDefaults._parameters, python.ConfigToolBase.ConfigToolBase._parameters, python.editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, metTools.AddPfMET._parameters, TAbsFitParticle._parameters, coreTools.RunOnData._parameters, coreTools.RemoveMCMatching._parameters, cmsswVersionTools.RunBTagging35X._parameters, heavyIonTools.SelectionDefaults._parameters, heavyIonTools.DisbaleMonteCarloDeps._parameters, jetTools.AddJetCollection._parameters, coreTools.RemoveAllPATObjectsBut._parameters, coreTools.RemoveSpecificPATObjects._parameters, cmsswVersionTools.AddJetCollection35X._parameters, coreTools.RemoveCleaning._parameters, coreTools.AddCleaning._parameters, jetTools.SwitchJetCollection._parameters, cmsswVersionTools.SwitchJetCollection35X._parameters, jetTools.AddJetID._parameters, jetTools.SetTagInfos._parameters, and cmsswVersionTools.PickRelValInputFiles._parameters.

26 
27  def toolCode(self, process):
28  isolationTypes=self._parameters['isolationTypes'].value
29 
30  # key to define the parameter sets
31  isolationKey=0
32  # add pre-requisits to the muon
33  for obj in range(len(isolationTypes)):
34  if ( isolationTypes[obj] == 'Tracker' or isolationTypes[obj] == 'All'):
35  print "adding predefined userIsolation to pat::Muon for Tracker"
36  print " -> to access this information call pat::Muon::userIsolation(pat::TrackIso) in your analysis code <-"
37  isolationKey=isolationKey+1
38 
39  if ( isolationTypes[obj] == 'Ecal' or isolationTypes[obj] == 'All'):
40  print "adding predefined userIsolation to pat::Muon for Ecal"
41  print " -> to access this information call pat::Muon::userIsolation(pat::EcalIso ) in your analysis code <-"
42  isolationKey=isolationKey+10
43 
44  if ( isolationTypes[obj] == 'Hcal' or isolationTypes[obj] == 'All'):
45  print "adding predefined userIsolation to pat::Muon for Hcal"
46  print " -> to access this information call pat::Muon::userIsolation(pat::HcalIso ) in your analysis code <-"
47  isolationKey=isolationKey+100
48 
49  # do the corresponding replacements in the pat muon
50  if ( isolationKey == 1 ):
51  # tracker
52  process.patMuons.isoDeposits = cms.PSet(
53  tracker = cms.InputTag("muIsoDepositTk"),
54  )
55  process.patMuons.userIsolation = cms.PSet(
56  tracker = cms.PSet(
57  src = cms.InputTag("muIsoDepositTk"),
58  deltaR = cms.double(0.3)
59  ),
60  )
61  if ( isolationKey == 10 ):
62  # ecal
63  process.patMuons.isoDeposits = cms.PSet(
64  ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
65  )
66  process.patMuons.userIsolation = cms.PSet(
67  ecal = cms.PSet(
68  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
69  deltaR = cms.double(0.3)
70  ),
71  )
72  if ( isolationKey == 100 ):
73  # hcal
74  process.patMuons.isoDeposits = cms.PSet(
75  hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
76  )
77  process.patMuons.userIsolation = cms.PSet(
78  hcal = cms.PSet(
79  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
80  deltaR = cms.double(0.3)
81  ),
82  )
83  if ( isolationKey == 11 ):
84  # ecal + tracker
85  process.patMuons.isoDeposits = cms.PSet(
86  tracker = cms.InputTag("muIsoDepositTk"),
87  ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
88  )
89  process.patMuons.userIsolation = cms.PSet(
90  tracker = cms.PSet(
91  src = cms.InputTag("muIsoDepositTk"),
92  deltaR = cms.double(0.3)
93  ),
94  ecal = cms.PSet(
95  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
96  deltaR = cms.double(0.3)
97  ),
98  )
99  if ( isolationKey == 101 ):
100  # hcal + tracker
101  process.patMuons.isoDeposits = cms.PSet(
102  tracker = cms.InputTag("muIsoDepositTk"),
103  hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
104  )
105  process.patMuons.userIsolation = cms.PSet(
106  tracker = cms.PSet(
107  src = cms.InputTag("muIsoDepositTk"),
108  deltaR = cms.double(0.3)
109  ),
110  hcal = cms.PSet(
111  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
112  deltaR = cms.double(0.3)
113  ),
114  )
115  if ( isolationKey == 110 ):
116  # hcal + ecal
117  process.patMuons.isoDeposits = cms.PSet(
118  ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
119  hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
120  )
121  process.patMuons.userIsolation = cms.PSet(
122  ecal = cms.PSet(
123  src = cms.InputTag("gamIsoFromDepsEcalFromHits"),
124  ),
125  hcal = cms.PSet(
126  src = cms.InputTag("gamIsoFromDepsHcalFromTowers"),
127  ),
128  )
129  if ( isolationKey == 111 ):
130  # hcal + ecal + tracker
131  process.patMuons.isoDeposits = cms.PSet(
132  tracker = cms.InputTag("muIsoDepositTk"),
133  ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
134  hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
135  )
136  process.patMuons.userIsolation = cms.PSet(
137  tracker = cms.PSet(
138  src = cms.InputTag("muIsoDepositTk"),
139  deltaR = cms.double(0.3)
140  ),
141  ecal = cms.PSet(
142  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"),
143  deltaR = cms.double(0.3)
144  ),
145  hcal = cms.PSet(
146  src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"),
147  deltaR = cms.double(0.3)
148  ),
149  )
150 
151 
152 addMuonUserIsolation=AddMuonUserIsolation()

Member Data Documentation

muonTools.AddMuonUserIsolation._comment
private

Definition at line 15 of file muonTools.py.

tuple muonTools.AddMuonUserIsolation._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 9 of file muonTools.py.

Referenced by photonTools.AddPhotonUserIsolation.__call__(), muonTools.AddMuonUserIsolation.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), trackTools.MakeAODTrackCandidates.__call__(), HiCoreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), trigTools.RemoveCleaningFromTriggerMatching.__call__(), photonTools.AddPhotonUserIsolation.__init__(), trackTools.MakeAODTrackCandidates.__init__(), muonTools.AddMuonUserIsolation.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), HiCoreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), trigTools.RemoveCleaningFromTriggerMatching.__init__(), python.ConfigToolBase.ConfigToolBase.getAllowedValues(), photonTools.AddPhotonUserIsolation.getDefaultParameters(), muonTools.AddMuonUserIsolation.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), trigTools.RemoveCleaningFromTriggerMatching.getDefaultParameters(), python.ConfigToolBase.ConfigToolBase.reset(), and python.ConfigToolBase.ConfigToolBase.setParameter().

string muonTools.AddMuonUserIsolation._label = 'addMuonUserIsolation'
staticprivate

Definition at line 8 of file muonTools.py.

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

muonTools.AddMuonUserIsolation._parameters
private

Definition at line 14 of file muonTools.py.

Referenced by photonTools.AddPhotonUserIsolation.toolCode(), muonTools.AddMuonUserIsolation.toolCode(), HiCoreTools.RestrictInputToAOD.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTrigger.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trackTools.MakeTrackCandidates.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), and trigTools.RemoveCleaningFromTriggerMatching.toolCode().