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
photonTools.AddPhotonUserIsolation Class Reference
Inheritance diagram for photonTools.AddPhotonUserIsolation:

Public Member Functions

def __call__
 
def __init__
 
def getDefaultParameters
 
def toolCode
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

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

Detailed Description

add userIsolation to patPhoton

Definition at line 3 of file photonTools.py.

Constructor & Destructor Documentation

def photonTools.AddPhotonUserIsolation.__init__ (   self)

Definition at line 10 of file photonTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, photonTools.AddPhotonUserIsolation._defaultParameters, editorTools.UserCodeTool._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, metTools.AddTcMET._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, jetTools.RunBTagging._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, jetTools.SwitchJetCorrLevels._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 photonTools.AddPhotonUserIsolation.__call__ (   self,
  process,
  isolationTypes = None 
)

Definition at line 19 of file photonTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, photonTools.AddPhotonUserIsolation._defaultParameters, editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, jetTools.RunBTagging._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, jetTools.SwitchJetCorrLevels._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 photonTools.AddPhotonUserIsolation.getDefaultParameters (   self)

Definition at line 16 of file photonTools.py.

References electronTools.AddElectronUserIsolation._defaultParameters, photonTools.AddPhotonUserIsolation._defaultParameters, muonTools.AddMuonUserIsolation._defaultParameters, editorTools.UserCodeTool._defaultParameters, metTools.AddTcMET._defaultParameters, heavyIonTools.ConfigureHeavyIons._defaultParameters, coreTools.RestrictInputToAOD._defaultParameters, cmsswVersionTools.Run52xOn51xTrigger._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, heavyIonTools.ProductionDefaults._defaultParameters, editorTools.ChangeSource._defaultParameters, metTools.AddPfMET._defaultParameters, coreTools.RunOnData._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, coreTools.RemoveMCMatching._defaultParameters, heavyIonTools.SelectionDefaults._defaultParameters, jetTools.RunBTagging._defaultParameters, heavyIonTools.DisbaleMonteCarloDeps._defaultParameters, coreTools.RemoveAllPATObjectsBut._defaultParameters, coreTools.RemoveSpecificPATObjects._defaultParameters, coreTools.RemoveCleaning._defaultParameters, coreTools.AddCleaning._defaultParameters, jetTools.AddJetCollection._defaultParameters, jetTools.SwitchJetCollection._defaultParameters, jetTools.AddJetID._defaultParameters, jetTools.SetTagInfos._defaultParameters, and jetTools.SwitchJetCorrLevels._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 photonTools.AddPhotonUserIsolation.toolCode (   self,
  process 
)

Definition at line 25 of file photonTools.py.

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

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

Member Data Documentation

photonTools.AddPhotonUserIsolation._comment
private

Definition at line 14 of file photonTools.py.

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

tuple photonTools.AddPhotonUserIsolation._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 8 of file photonTools.py.

Referenced by photonTools.AddPhotonUserIsolation.__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__(), HiCoreTools.RemoveCleaning.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.AddCleaning.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), trigTools.RemoveCleaningFromTriggerMatching.__call__(), metUncertaintyTools.RunMEtUncertainties.__call__(), photonTools.AddPhotonUserIsolation.__init__(), trackTools.MakeAODTrackCandidates.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), metUncertaintyTools.RunMEtUncertainties.__init__(), HiCoreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__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__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), trigTools.RemoveCleaningFromTriggerMatching.__init__(), metUncertaintyTools.RunMEtUncertainties._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), photonTools.AddPhotonUserIsolation.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), metUncertaintyTools.RunMEtUncertainties.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.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(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), trigTools.RemoveCleaningFromTriggerMatching.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string photonTools.AddPhotonUserIsolation._label = 'addPhotonUserIsolation'
staticprivate

Definition at line 7 of file photonTools.py.

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

photonTools.AddPhotonUserIsolation._parameters
private

Definition at line 13 of file photonTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__(), jetTools.SwitchJetCollection.__init__(), photonTools.AddPhotonUserIsolation.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(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), tauTools.AddTauCollection.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), trigTools.RemoveCleaningFromTriggerMatching.toolCode(), jetTools.SwitchJetCollection.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().