|
|
|
def | addVIDSelectionToPATProducer (patProducer, idProducer, idName, addUserData=True) |
|
def | setupAllVIDIdsInModule (process, id_module_name, setupFunction, patProducer=None, addUserData=True, task=None) |
|
def | setupVIDElectronSelection (process, cutflow, patProducer=None, addUserData=True, task=None) |
|
def | setupVIDMuonSelection (process, cutflow, patProducer=None) |
|
def | setupVIDPhotonSelection (process, cutflow, patProducer=None, addUserData=True, task=None) |
|
def | setupVIDSelection (vidproducer, cutflow) |
|
def | switchOnVIDElectronIdProducer (process, dataFormat, task=None) |
| Electrons. More...
|
|
def | switchOnVIDMuonIdProducer (process, dataFormat, task=None) |
| Muons. More...
|
|
def | switchOnVIDPhotonIdProducer (process, dataFormat, task=None) |
| Photons. More...
|
|
◆ addVIDSelectionToPATProducer()
def vid_id_tools.addVIDSelectionToPATProducer |
( |
|
patProducer, |
|
|
|
idProducer, |
|
|
|
idName, |
|
|
|
addUserData = True |
|
) |
| |
Definition at line 27 of file vid_id_tools.py.
30 for key
in patProducer.__dict__.keys():
31 if 'IDSources' in key:
32 patProducerIDs = getattr(patProducer,key)
34 userDatas = getattr(patProducer,key)
35 if patProducerIDs
is None:
36 raise Exception(
'StrangePatModule',
'%s does not have ID sources!'%patProducer.label())
38 raise Exception(
'StrangePatModule',
'%s does not have UserData sources!'%patProducer.label())
39 setattr(patProducerIDs,idName,cms.InputTag(
'%s:%s'%(idProducer,idName)))
41 if( len(userDatas.userClasses.src) == 1
and
42 isinstance(userDatas.userClasses.src[0], str)
and
43 userDatas.userClasses.src[0] ==
'' ):
44 userDatas.userClasses.src = cms.VInputTag(cms.InputTag(
'%s:%s'%(idProducer,idName)))
46 userDatas.userClasses.src.append(cms.InputTag(
'%s:%s'%(idProducer,idName)))
47 sys.stderr.write(
'\t--- %s:%s added to %s\n'%(idProducer,idName,patProducer.label()))
Referenced by setupVIDElectronSelection(), and setupVIDPhotonSelection().
◆ setupAllVIDIdsInModule()
def vid_id_tools.setupAllVIDIdsInModule |
( |
|
process, |
|
|
|
id_module_name, |
|
|
|
setupFunction, |
|
|
|
patProducer = None , |
|
|
|
addUserData = True , |
|
|
|
task = None |
|
) |
| |
Definition at line 49 of file vid_id_tools.py.
49 def setupAllVIDIdsInModule(process,id_module_name,setupFunction,patProducer=None,addUserData=True,task=None):
51 idmod= __import__(id_module_name, globals(), locals(), [
'idName',
'cutFlow'])
52 for name
in dir(idmod):
53 item = getattr(idmod,name)
54 if hasattr(item,
'idName')
and hasattr(item,
'cutFlow'):
55 setupFunction(process,item,patProducer,addUserData,task)
References DeadROC_duringRun.dir.
Referenced by miniAOD_tools.miniAOD_customizeCommon(), nano_cff.nanoAOD_activateVID(), PhotonPuppi_cff.setupPuppiPhoton(), and PhotonPuppi_cff.setupPuppiPhotonMiniAOD().
◆ setupVIDElectronSelection()
def vid_id_tools.setupVIDElectronSelection |
( |
|
process, |
|
|
|
cutflow, |
|
|
|
patProducer = None , |
|
|
|
addUserData = True , |
|
|
|
task = None |
|
) |
| |
Definition at line 87 of file vid_id_tools.py.
88 if not hasattr(process,
'egmGsfElectronIDs'):
89 raise Exception(
'VIDProducerNotAvailable',
'egmGsfElectronIDs producer not available in process!')
92 if hasattr(process,
'patElectrons')
or patProducer
is not None:
93 if patProducer
is None:
94 patProducer = process.patElectrons
95 idName = cutflow.idName.value()
101 if (cutflow.idName.value().
find(
"HEEP")!=-1
and
102 cutflow.idName.value()!=
"heepElectronID-HEEPV60"):
105 useMiniAOD = process.egmGsfElectronIDs.physicsObjectSrc == cms.InputTag(
'slimmedElectrons')
109 useMiniAOD=useMiniAOD,task=task)
References heepElectronID_tools.addHEEPProducersToSeq(), addVIDSelectionToPATProducer(), spr.find(), and setupVIDSelection().
◆ setupVIDMuonSelection()
def vid_id_tools.setupVIDMuonSelection |
( |
|
process, |
|
|
|
cutflow, |
|
|
|
patProducer = None |
|
) |
| |
Definition at line 138 of file vid_id_tools.py.
139 moduleName =
"muoMuonIDs"
140 if not hasattr(process, moduleName):
141 raise Exception(
"VIDProducerNotAvailable",
"%s producer not available in process!" % moduleName)
142 module = getattr(process, moduleName)
References setupVIDSelection().
◆ setupVIDPhotonSelection()
def vid_id_tools.setupVIDPhotonSelection |
( |
|
process, |
|
|
|
cutflow, |
|
|
|
patProducer = None , |
|
|
|
addUserData = True , |
|
|
|
task = None |
|
) |
| |
Definition at line 181 of file vid_id_tools.py.
182 if not hasattr(process,
'egmPhotonIDs'):
183 raise Exception(
'VIDProducerNotAvailable',
'egmPhotonIDs producer not available in process!\n')
186 if hasattr(process,
'patPhotons')
or patProducer
is not None:
187 if patProducer
is None:
188 patProducer = process.patPhotons
189 idName = cutflow.idName.value()
References addVIDSelectionToPATProducer(), and setupVIDSelection().
◆ setupVIDSelection()
def vid_id_tools.setupVIDSelection |
( |
|
vidproducer, |
|
|
|
cutflow |
|
) |
| |
Definition at line 11 of file vid_id_tools.py.
12 if not hasattr(cutflow,
'idName'):
13 raise Exception(
'InvalidVIDCutFlow',
'The cutflow configuation provided is malformed and does not have a specified name!')
14 if not hasattr(cutflow,
'cutFlow'):
15 raise Exception(
'InvalidVIDCutFlow',
'The cutflow configuration provided is malformed and does not have a specific cutflow!')
16 cutflow_md5 = central_id_registry.getMD5FromName(cutflow.idName)
18 if hasattr(cutflow,
'isPOGApproved'):
19 isPOGApproved = cutflow.isPOGApproved.value()
20 vidproducer.physicsObjectIDs.append(
21 cms.PSet( idDefinition = cutflow,
22 isPOGApproved = cms.untracked.bool(isPOGApproved),
23 idMD5 = cms.string(cutflow_md5) )
Referenced by setupVIDElectronSelection(), setupVIDMuonSelection(), and setupVIDPhotonSelection().
◆ switchOnVIDElectronIdProducer()
def vid_id_tools.switchOnVIDElectronIdProducer |
( |
|
process, |
|
|
|
dataFormat, |
|
|
|
task = None |
|
) |
| |
Electrons.
Definition at line 66 of file vid_id_tools.py.
67 process.load(
'RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cff')
69 task.add(process.egmGsfElectronIDTask)
71 if( len(process.egmGsfElectronIDs.physicsObjectIDs) > 0 ):
72 process.egmGsfElectronIDs.physicsObjectIDs = cms.VPSet()
73 dataFormatString =
"Undefined"
74 if dataFormat == DataFormat.AOD:
76 dataFormatString =
"AOD"
77 elif dataFormat == DataFormat.MiniAOD:
80 process.egmGsfElectronIDs.physicsObjectSrc = cms.InputTag(
'slimmedElectrons')
81 dataFormatString =
"MiniAOD"
83 raise Exception(
'InvalidVIDDataFormat',
'The requested data format is different from AOD or MiniAOD')
Referenced by miniAOD_tools.miniAOD_customizeCommon(), and nano_cff.nanoAOD_activateVID().
◆ switchOnVIDMuonIdProducer()
def vid_id_tools.switchOnVIDMuonIdProducer |
( |
|
process, |
|
|
|
dataFormat, |
|
|
|
task = None |
|
) |
| |
Muons.
Definition at line 117 of file vid_id_tools.py.
118 process.load(
'RecoMuon.MuonIdentification.muoMuonIDs_cff')
120 task.add(process.muoMuonIDTask)
122 if( len(process.muoMuonIDs.physicsObjectIDs) > 0 ):
123 process.muoMuonIDs.physicsObjectIDs = cms.VPSet()
124 dataFormatString =
"Undefined"
125 if dataFormat == DataFormat.AOD:
127 dataFormatString =
"AOD"
128 elif dataFormat == DataFormat.MiniAOD:
131 process.muoMuonIDs.physicsObjectSrc = cms.InputTag(
'slimmedMuons')
132 dataFormatString =
"MiniAOD"
134 raise Exception(
'InvalidVIDDataFormat',
'The requested data format is different from AOD or MiniAOD')
◆ switchOnVIDPhotonIdProducer()
def vid_id_tools.switchOnVIDPhotonIdProducer |
( |
|
process, |
|
|
|
dataFormat, |
|
|
|
task = None |
|
) |
| |
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
def loadEgmIdSequence(process, dataFormat)