5 ROOT.gSystem.Load(
"libFWCoreFWLite.so")
6 ROOT.gSystem.Load(
"libDataFormatsFWLite.so")
7 ROOT.FWLiteEnabler.enable()
10 import FWCore.ParameterSet.Config
as cms
13 from DataFormats.FWLite
import Handle, Events
23 def __init__(self, selector, collection_type, collection_name):
33 if not isinstance(files,list):
34 raise Exception(
'BadFileInput',
'You need to give "setSignalFiles" a list of strings')
38 if not isinstance(files,list):
39 raise Exception(
'BadFileInput',
'You need to give "setBackgroundFiles" a list of strings')
43 if not isinstance(files,list):
44 raise Exception(
'BadFileInput',
'You need to give "setMixFiles" a list of strings')
55 print 'running validation for: %s'%(select.name())
58 if not len(samples[
'signal'] + samples[
'background'] + samples[
'mix']):
59 raise Exception(
'NoInputFiles',
'There were no input files given, cannot validate!')
61 for key
in sorted(samples.keys()):
64 print 'input files checksum: %s'%(self.__hasher.hexdigest())
66 for key
in sorted(samples.keys()):
68 local_hash = md5.new()
70 self.__hasher.update(local_hash.hexdigest())
72 print 'event processing checksum: %s'%(self.__hasher.hexdigest())
74 self.__hasher.update(select.md5String())
76 print 'total checksum: %s'%(self.__hasher.hexdigest())
80 self.__hasher.update(item)
81 print 'Input %s file: %s'%(name,item)
88 events = Events(the_list)
94 if idstring ==
'':
continue 95 sub_cutnames.append(idstring.split()[2])
96 sub_hashes.append(md5.new(idstring))
99 event.getByLabel(productLabel,handle)
100 for i,obj
in enumerate(handle.product()):
107 if idstring ==
'':
continue 108 sub_hashes[icut].
update(idstring)
111 for sub_hash
in sub_hashes:
112 hasher.update(sub_hash.hexdigest())
114 hasher.update(
str(n_pass))
115 hasher.update(
str(n_fail))
116 print '%s sample pass : fail : hash -> %d : %d : %s'%(name,n_pass,n_fail,hasher.hexdigest())
117 print '%s sample cut breakdown:'%(name)
118 for i,sub_hash
in enumerate(sub_hashes):
119 print '\t%s hash -> %s'%(sub_cutnames[i],sub_hash.hexdigest())
def processInputList(self, the_list, name)
def __init__(self, selector, collection_type, collection_name)
def setBackgroundFiles(self, files)
def processEvents(self, the_list, name, hasher)
def setMixFiles(self, files)
def setSignalFiles(self, files)