6 from PhysicsTools.SelectorUtils.centralIDRegistry
import central_id_registry
7 from PhysicsTools.SelectorUtils.VIDCutFlowResult
import VIDCutFlowResult
8 import DataFormats.FWLite
11 ROOT.gSystem.Load(
"libFWCoreFWLite.so");
12 ROOT.gSystem.Load(
"libDataFormatsFWLite.so");
13 ROOT.FWLiteEnabler.enable()
16 import FWCore.ParameterSet.Config as cms 18 from PhysicsTools.SelectorUtils.centralIDRegistry import central_id_registry 26 """ turn a python cms.PSet into a VID ID """ 27 idname = pythonpset.idName.value().
replace(
'-',
'_') + suffix
28 escaped_pset = config_template%(idname, pythonpset)
30 return builder(escaped_pset,idname)
32 def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
33 return ''.
join(random.choice(chars)
for _
in range(size))
36 def __init__(self, vidSelectorBuilder, ptrMaker, printer, pythonpset = None):
43 if pythonpset
is not None:
44 if hasattr(pythonpset,
'isPOGApproved'):
45 approved = pythonpset.isPOGApproved.value()
47 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
48 sys.stderr.write(
'Please make sure to report your progress with this ID'\
49 ' at the next relevant POG meeting.\n')
50 del pythonpset.isPOGApproved
52 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
53 sys.stderr.write(
'Please make sure to report your progress with this ID'\
54 ' at the next relevant POG meeting.\n')
56 expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName)
58 sys.stderr.write(
"ID: %s\n"%self.
name())
59 sys.stderr.write(
"The expected md5: %s does not match the md5\n"%expectedmd5)
60 sys.stderr.write(
"calculated by the ID: %s please\n"%self.
md5String())
61 sys.stderr.write(
"update your python configuration or determine the source\n")
62 sys.stderr.write(
"of transcription error!\n")
70 if( len(args) == 2
and isinstance(args[1],DataFormats.FWLite.Events) ):
72 elif( len(args) == 2
and type(args[1])
is int ):
76 if( len(args) == 3
and type(args[1])
is int
and isinstance(args[2], DataFormats.FWLite.Events) ):
81 raise ValueError(
'VIDSelectorBase __call__ with args: "%s" is not a valid call pattern'%(
','.
join([repr(arg)
for arg
in args])))
86 print 'VID Selector is already initialized, doing nothing!' 88 del process.__instance
89 if hasattr(pythonpset,
'isPOGApproved'):
90 approved = pythonpset.isPOGApproved.value()
92 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
93 sys.stderr.write(
'Please make sure to report your progress with this ID'\
94 ' at the next relevant POG meeting.\n')
95 del pythonpset.isPOGApproved
97 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
98 sys.stderr.write(
'Please make sure to report your progress with this ID'\
99 ' at the next relevant POG meeting.\n')
101 expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName)
103 sys.stderr.write(
"ID: %s\n"%self.
name())
104 sys.stderr.write(
"The expected md5: %s does not match the md5\n"%expectedmd5)
105 sys.stderr.write(
"calculated by the ID: %s please\n"%self.
md5String())
106 sys.stderr.write(
"update your python configuration or determine the source\n")
107 sys.stderr.write(
"of transcription error!\n")
111 return self.__instance.cutFlowSize()
117 return self.__instance.howFarInCutFlow()
120 return self.__instance.name()
123 return self.__instance.bitMap()
126 return self.__instance.md5String()
129 return self.__instance.md55Raw()
def replace(string, replacements)
def process_pset(builder, pythonpset, suffix)
def initialize(self, pythonpset)
def id_generator(size=6, chars=string.ascii_uppercase+string.digits)
static std::string join(char **cmd)
def __init__(self, vidSelectorBuilder, ptrMaker, printer, pythonpset=None)
def howFarInCutFlow(self)