def initialize(self, pythonpset): if self.__initialized: print "VID Selector is already initialized, doing nothing!" return del process.__instance if hasattr(pythonpset, "isPOGApproved"): approved = pythonpset.isPOGApproved.value() if not approved: sys.stderr.write("This ID is not POG approved and likely under development!!!!\n") sys.stderr.write( "Please make sure to report your progress with this ID" " at the next relevant POG meeting.\n" ) del pythonpset.isPOGApproved else: sys.stderr.write("This ID is not POG approved and likely under development!!!!\n") sys.stderr.write( "Please make sure to report your progress with this ID" " at the next relevant POG meeting.\n" ) self.__instance = process_pset(self.__selectorBuilder, pythonpset, self.__suffix) expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName) if expectedmd5 != self.md5String(): sys.stderr.write("ID: %s\n" % self.name()) sys.stderr.write("The expected md5: %s does not match the md5\n" % expectedmd5) sys.stderr.write("calculated by the ID: %s please\n" % self.md5String()) sys.stderr.write("update your python configuration or determine the source\n") sys.stderr.write("of transcription error!\n") self.__initialized = True
def initialize(self, pythonpset): if (self.__initialized): print 'VID Selector is already initialized, doing nothing!' return del process.__instance if hasattr(pythonpset, 'isPOGApproved'): approved = pythonpset.isPOGApproved.value() if not approved: sys.stderr.write( 'This ID is not POG approved and likely under development!!!!\n' ) sys.stderr.write('Please make sure to report your progress with this ID'\ ' at the next relevant POG meeting.\n') del pythonpset.isPOGApproved else: sys.stderr.write( 'This ID is not POG approved and likely under development!!!!\n' ) sys.stderr.write('Please make sure to report your progress with this ID'\ ' at the next relevant POG meeting.\n') self.__instance = process_pset(self.__selectorBuilder, pythonpset) expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName) if expectedmd5 != self.md5String(): sys.stderr.write("ID: %s\n" % self.name()) sys.stderr.write("The expected md5: %s does not match the md5\n" % expectedmd5) sys.stderr.write("calculated by the ID: %s please\n" % self.md5String()) sys.stderr.write( "update your python configuration or determine the source\n") sys.stderr.write("of transcription error!\n") self.__initialized = True
def __init__(self, vidSelectorBuilder, ptrMaker, printer, pythonpset=None): self.__initialized = False self.__suffix = id_generator(12) self.__printer = printer() self.__ptrMaker = ptrMaker() self.__selectorBuilder = vidSelectorBuilder() self.__instance = None if pythonpset is not None: if hasattr(pythonpset, "isPOGApproved"): approved = pythonpset.isPOGApproved.value() if not approved: sys.stderr.write("This ID is not POG approved and likely under development!!!!\n") sys.stderr.write( "Please make sure to report your progress with this ID" " at the next relevant POG meeting.\n" ) del pythonpset.isPOGApproved else: sys.stderr.write("This ID is not POG approved and likely under development!!!!\n") sys.stderr.write( "Please make sure to report your progress with this ID" " at the next relevant POG meeting.\n" ) self.__instance = process_pset(self.__selectorBuilder, pythonpset, self.__suffix) expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName) if expectedmd5 != self.md5String(): sys.stderr.write("ID: %s\n" % self.name()) sys.stderr.write("The expected md5: %s does not match the md5\n" % expectedmd5) sys.stderr.write("calculated by the ID: %s please\n" % self.md5String()) sys.stderr.write("update your python configuration or determine the source\n") sys.stderr.write("of transcription error!\n") self.__initialized = True else: self.__instance = self.__selectorBuilder()
def __init__(self, vidSelectorBuilder, ptrMaker, pythonpset = None): self.__initialized = False self.__suffix = id_generator(12) self.__ptrMaker = ptrMaker self.__selectorBuilder = vidSelectorBuilder() self.__instance = None if pythonpset is not None: if hasattr(pythonpset,'isPOGApproved'): approved = pythonpset.isPOGApproved.value() if not approved: sys.stderr.write('This ID is not POG approved and likely under development!!!!\n') sys.stderr.write('Please make sure to report your progress with this ID'\ ' at the next relevant POG meeting.\n') del pythonpset.isPOGApproved else: sys.stderr.write('This ID is not POG approved and likely under development!!!!\n') sys.stderr.write('Please make sure to report your progress with this ID'\ ' at the next relevant POG meeting.\n') self.__instance = process_pset( self.__selectorBuilder, pythonpset, self.__suffix ) expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName) if expectedmd5 != self.md5String(): sys.stderr.write("ID: %s\n"%self.name()) sys.stderr.write("The expected md5: %s does not match the md5\n"%expectedmd5) sys.stderr.write("calculated by the ID: %s please\n"%self.md5String()) sys.stderr.write("update your python configuration or determine the source\n") sys.stderr.write("of transcription error!\n") self.__initialized = True else: self.__instance = self.__selectorBuilder()
def setupVIDSelection(vidproducer,cutflow): if not hasattr(cutflow,'idName'): raise Exception('InvalidVIDCutFlow', 'The cutflow configuation provided is malformed and does not have a specified name!') if not hasattr(cutflow,'cutFlow'): raise Exception('InvalidVIDCutFlow', 'The cutflow configuration provided is malformed and does not have a specific cutflow!') cutflow_md5 = central_id_registry.getMD5FromName(cutflow.idName) vidproducer.physicsObjectIDs.append( cms.PSet( idDefinition = cutflow, idMD5 = cms.string(cutflow_md5) ) ) print 'Added ID \'%s\' to %s'%(cutflow.idName.value(),vidproducer.label())
def setupVIDSelection(vidproducer,cutflow): if not hasattr(cutflow,'idName'): raise Exception('InvalidVIDCutFlow', 'The cutflow configuation provided is malformed and does not have a specified name!') if not hasattr(cutflow,'cutFlow'): raise Exception('InvalidVIDCutFlow', 'The cutflow configuration provided is malformed and does not have a specific cutflow!') cutflow_md5 = central_id_registry.getMD5FromName(cutflow.idName) isPOGApproved = False if hasattr(cutflow,'isPOGApproved'): isPOGApproved = cutflow.isPOGApproved.value() vidproducer.physicsObjectIDs.append( cms.PSet( idDefinition = cutflow, isPOGApproved = cms.untracked.bool(isPOGApproved), idMD5 = cms.string(cutflow_md5) ) )
def setupVIDSelection(vidproducer,cutflow): if not hasattr(cutflow,'idName'): raise Exception('InvalidVIDCutFlow', 'The cutflow configuation provided is malformed and does not have a specified name!') if not hasattr(cutflow,'cutFlow'): raise Exception('InvalidVIDCutFlow', 'The cutflow configuration provided is malformed and does not have a specific cutflow!') cutflow_md5 = central_id_registry.getMD5FromName(cutflow.idName) isPOGApproved = False if hasattr(cutflow,'isPOGApproved'): isPOGApproved = cutflow.isPOGApproved.value() vidproducer.physicsObjectIDs.append( cms.PSet( idDefinition = cutflow, isPOGApproved = cms.untracked.bool(isPOGApproved), idMD5 = cms.string(cutflow_md5) ) )
def setupVIDSelection(vidproducer, cutflow): if not hasattr(cutflow, 'idName'): raise Exception( 'InvalidVIDCutFlow', 'The cutflow configuation provided is malformed and does not have a specified name!' ) if not hasattr(cutflow, 'cutFlow'): raise Exception( 'InvalidVIDCutFlow', 'The cutflow configuration provided is malformed and does not have a specific cutflow!' ) cutflow_md5 = central_id_registry.getMD5FromName(cutflow.idName) vidproducer.physicsObjectIDs.append( cms.PSet(idDefinition=cutflow, idMD5=cms.string(cutflow_md5))) print 'Added ID \'%s\' to %s' % (cutflow.idName.value(), vidproducer.label())
# Misc loads for VID framework from RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cfi import * from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry # Load the producer module to build full 5x5 cluster shapes and whatever # else is needed for IDs from RecoEgamma.ElectronIdentification.ElectronIDValueMapProducer_cfi import * from RecoEgamma.ElectronIdentification.Identification.cutBasedElectronTrigID_CSA14_V0_cff \ import cutBasedElectronTrigIDCSA14V0 csa142012likeTrigeringSelectionv0 = central_id_registry.getMD5FromName( cutBasedElectronTrigIDCSA14V0.idName) egmGsfElectronIDs.physicsObjectIDs.append( cms.PSet(idDefinition=cutBasedElectronTrigIDCSA14V0, idMD5=cms.string(csa142012likeTrigeringSelectionv0))) egmGsfElectronIDSequence = cms.Sequence(electronIDValueMapProducer * egmGsfElectronIDs)
import FWCore.ParameterSet.Config as cms from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry from PhysicsTools.SelectorUtils.trivialCutFlow_cff import * trivialCutFlowMD5 = central_id_registry.getMD5FromName(trivialCutFlow.idName) egmGsfElectronIDs = cms.EDProducer( "VersionedElectronIdProducer", electronsArePAT=cms.bool(False), electronIDs=cms.VPSet( cms.PSet(idName=trivialCutFlow.idName, idDefinition=trivialCutFlow, idMD5=cms.string(trivialCutFlowMD5))))
import FWCore.ParameterSet.Config as cms from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry from PhysicsTools.SelectorUtils.trivialCutFlow_cff import * trivialCutFlowMD5 = central_id_registry.getMD5FromName(trivialCutFlow.idName) egmGsfElectronIDs = cms.EDProducer( "VersionedElectronIdProducer", electronsArePAT = cms.bool(False), electronIDs = cms.VPSet( cms.PSet( idName = trivialCutFlow.idName, idDefinition = trivialCutFlow, idMD5 = cms.string(trivialCutFlowMD5) ) ) )
# Misc loads for VID framework from RecoEgamma.ElectronIdentification.egmGsfElectronIDs_cfi import * from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry # Load the producer module to build full 5x5 cluster shapes and whatever # else is needed for IDs from RecoEgamma.ElectronIdentification.ElectronIDValueMapProducer_cfi import * from RecoEgamma.ElectronIdentification.Identification.cutBasedElectronTrigID_CSA14_V0_cff \ import cutBasedElectronTrigIDCSA14V0 csa142012likeTrigeringSelectionv0 = central_id_registry.getMD5FromName(cutBasedElectronTrigIDCSA14V0.idName) egmGsfElectronIDs.physicsObjectIDs.append( cms.PSet( idDefinition = cutBasedElectronTrigIDCSA14V0, idMD5 = cms.string(csa142012likeTrigeringSelectionv0) ) ) egmGsfElectronIDSequence = cms.Sequence(electronIDValueMapProducer * egmGsfElectronIDs)