Inherits FWCore::GuiBrowsers::ConfigToolBase::ConfigToolBase.
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' |
add userIsolation to patMuon
Definition at line 4 of file muonTools.py.
def muonTools::AddMuonUserIsolation::__init__ | ( | self | ) |
Definition at line 11 of file muonTools.py.
00012 : 00013 ConfigToolBase.__init__(self) 00014 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']) 00015 self._parameters=copy.deepcopy(self._defaultParameters) 00016 self._comment = ''
def muonTools::AddMuonUserIsolation::__call__ | ( | self, | |
process, | |||
isolationTypes = None |
|||
) |
Definition at line 20 of file muonTools.py.
def muonTools::AddMuonUserIsolation::getDefaultParameters | ( | self | ) |
Definition at line 17 of file muonTools.py.
def muonTools::AddMuonUserIsolation::toolCode | ( | self, | |
process | |||
) |
Definition at line 26 of file muonTools.py.
00026 : 00027 isolationTypes=self._parameters['isolationTypes'].value 00028 00029 # key to define the parameter sets 00030 isolationKey=0 00031 # add pre-requisits to the muon 00032 for obj in range(len(isolationTypes)): 00033 if ( isolationTypes[obj] == 'Tracker' or isolationTypes[obj] == 'All'): 00034 print "adding predefined userIsolation to pat::Muon for Tracker" 00035 print " -> to access this information call pat::Muon::userIsolation(pat::TrackIso) in your analysis code <-" 00036 isolationKey=isolationKey+1 00037 00038 if ( isolationTypes[obj] == 'Ecal' or isolationTypes[obj] == 'All'): 00039 print "adding predefined userIsolation to pat::Muon for Ecal" 00040 print " -> to access this information call pat::Muon::userIsolation(pat::EcalIso ) in your analysis code <-" 00041 isolationKey=isolationKey+10 00042 00043 if ( isolationTypes[obj] == 'Hcal' or isolationTypes[obj] == 'All'): 00044 print "adding predefined userIsolation to pat::Muon for Hcal" 00045 print " -> to access this information call pat::Muon::userIsolation(pat::HcalIso ) in your analysis code <-" 00046 isolationKey=isolationKey+100 00047 00048 # do the corresponding replacements in the pat muon 00049 if ( isolationKey == 1 ): 00050 # tracker 00051 process.patMuons.isoDeposits = cms.PSet( 00052 tracker = cms.InputTag("muIsoDepositTk"), 00053 ) 00054 process.patMuons.userIsolation = cms.PSet( 00055 tracker = cms.PSet( 00056 src = cms.InputTag("muIsoDepositTk"), 00057 deltaR = cms.double(0.3) 00058 ), 00059 ) 00060 if ( isolationKey == 10 ): 00061 # ecal 00062 process.patMuons.isoDeposits = cms.PSet( 00063 ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00064 ) 00065 process.patMuons.userIsolation = cms.PSet( 00066 ecal = cms.PSet( 00067 src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00068 deltaR = cms.double(0.3) 00069 ), 00070 ) 00071 if ( isolationKey == 100 ): 00072 # hcal 00073 process.patMuons.isoDeposits = cms.PSet( 00074 hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00075 ) 00076 process.patMuons.userIsolation = cms.PSet( 00077 hcal = cms.PSet( 00078 src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00079 deltaR = cms.double(0.3) 00080 ), 00081 ) 00082 if ( isolationKey == 11 ): 00083 # ecal + tracker 00084 process.patMuons.isoDeposits = cms.PSet( 00085 tracker = cms.InputTag("muIsoDepositTk"), 00086 ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00087 ) 00088 process.patMuons.userIsolation = cms.PSet( 00089 tracker = cms.PSet( 00090 src = cms.InputTag("muIsoDepositTk"), 00091 deltaR = cms.double(0.3) 00092 ), 00093 ecal = cms.PSet( 00094 src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00095 deltaR = cms.double(0.3) 00096 ), 00097 ) 00098 if ( isolationKey == 101 ): 00099 # hcal + tracker 00100 process.patMuons.isoDeposits = cms.PSet( 00101 tracker = cms.InputTag("muIsoDepositTk"), 00102 hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00103 ) 00104 process.patMuons.userIsolation = cms.PSet( 00105 tracker = cms.PSet( 00106 src = cms.InputTag("muIsoDepositTk"), 00107 deltaR = cms.double(0.3) 00108 ), 00109 hcal = cms.PSet( 00110 src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00111 deltaR = cms.double(0.3) 00112 ), 00113 ) 00114 if ( isolationKey == 110 ): 00115 # hcal + ecal 00116 process.patMuons.isoDeposits = cms.PSet( 00117 ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00118 hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00119 ) 00120 process.patMuons.userIsolation = cms.PSet( 00121 ecal = cms.PSet( 00122 src = cms.InputTag("gamIsoFromDepsEcalFromHits"), 00123 ), 00124 hcal = cms.PSet( 00125 src = cms.InputTag("gamIsoFromDepsHcalFromTowers"), 00126 ), 00127 ) 00128 if ( isolationKey == 111 ): 00129 # hcal + ecal + tracker 00130 process.patMuons.isoDeposits = cms.PSet( 00131 tracker = cms.InputTag("muIsoDepositTk"), 00132 ecal = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00133 hcal = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00134 ) 00135 process.patMuons.userIsolation = cms.PSet( 00136 tracker = cms.PSet( 00137 src = cms.InputTag("muIsoDepositTk"), 00138 deltaR = cms.double(0.3) 00139 ), 00140 ecal = cms.PSet( 00141 src = cms.InputTag("muIsoDepositCalByAssociatorTowers","ecal"), 00142 deltaR = cms.double(0.3) 00143 ), 00144 hcal = cms.PSet( 00145 src = cms.InputTag("muIsoDepositCalByAssociatorTowers","hcal"), 00146 deltaR = cms.double(0.3) 00147 ), 00148 ) 00149 00150 00151 addMuonUserIsolation=AddMuonUserIsolation() 00152
Definition at line 11 of file muonTools.py.
tuple muonTools::AddMuonUserIsolation::_defaultParameters = dicttypes.SortedKeysDict() [static, private] |
Definition at line 9 of file muonTools.py.
string muonTools::AddMuonUserIsolation::_label = 'addMuonUserIsolation' [static, private] |
Definition at line 8 of file muonTools.py.
Definition at line 11 of file muonTools.py.