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.AutoLibraryLoader.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 escaped_pset = config_template%(pythonpset)
29 idname = pythonpset.idName.value().
replace(
'-',
'_')
31 return builder(escaped_pset,idname)
33 def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
34 return ''.
join(random.choice(chars)
for _
in range(size))
37 def __init__(self, vidSelectorBuilder, ptrMaker, printer, pythonpset = None):
44 if pythonpset
is not None:
45 if hasattr(pythonpset,
'isPOGApproved'):
46 approved = pythonpset.isPOGApproved.value()
48 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
49 sys.stderr.write(
'Please make sure to report your progress with this ID'\
50 ' at the next relevant POG meeting.\n')
51 del pythonpset.isPOGApproved
53 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
54 sys.stderr.write(
'Please make sure to report your progress with this ID'\
55 ' at the next relevant POG meeting.\n')
57 expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName)
59 sys.stderr.write(
"ID: %s\n"%self.
name())
60 sys.stderr.write(
"The expected md5: %s does not match the md5\n"%expectedmd5)
61 sys.stderr.write(
"calculated by the ID: %s please\n"%self.
md5String())
62 sys.stderr.write(
"update your python configuration or determine the source\n")
63 sys.stderr.write(
"of transcription error!\n")
71 if( len(args) == 2
and isinstance(args[1],DataFormats.FWLite.Events) ):
73 elif( len(args) == 2
and type(args[1])
is int ):
85 print 'VID Selector is already initialized, doing nothing!'
87 del process.__instance
88 if hasattr(pythonpset,
'isPOGApproved'):
89 approved = pythonpset.isPOGApproved.value()
91 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
92 sys.stderr.write(
'Please make sure to report your progress with this ID'\
93 ' at the next relevant POG meeting.\n')
94 del pythonpset.isPOGApproved
96 sys.stderr.write(
'This ID is not POG approved and likely under development!!!!\n')
97 sys.stderr.write(
'Please make sure to report your progress with this ID'\
98 ' at the next relevant POG meeting.\n')
100 expectedmd5 = central_id_registry.getMD5FromName(pythonpset.idName)
102 sys.stderr.write(
"ID: %s\n"%self.
name())
103 sys.stderr.write(
"The expected md5: %s does not match the md5\n"%expectedmd5)
104 sys.stderr.write(
"calculated by the ID: %s please\n"%self.
md5String())
105 sys.stderr.write(
"update your python configuration or determine the source\n")
106 sys.stderr.write(
"of transcription error!\n")
110 return self.__instance.cutFlowSize()
116 return self.__instance.howFarInCutFlow()
119 return self.__instance.name()
122 return self.__instance.bitMap()
125 return self.__instance.md5String()
128 return self.__instance.md55Raw()
static std::string join(char **cmd)
if(conf.exists("allCellsPositionCalc"))