Exemplo n.º 1
0
def getSampleDirectories(analysis, sampleList):
    source = getNtupleDirectory(analysis)
    directories = []
    for s in sampleList:
        for d in glob.glob(os.path.join(source, s)):
            directories += [d]
    return directories
Exemplo n.º 2
0
def getSampleDirectories(analysis,sampleList):
    source = getNtupleDirectory(analysis)
    directories = []
    for s in sampleList:
        for d in glob.glob(os.path.join(source,s)):
            directories += [d]
    return directories
Exemplo n.º 3
0
 def __init__(self,analysis,sample,**kwargs):
     # default to access via sample/analysis
     self.analysis = analysis
     self.sample = sample
     self.shift = kwargs.pop('shift','')
     self.skipHists = kwargs.pop('skipHists',False)
     self.isData = isData(self.sample)
     self.intLumi = kwargs.get('intLumi',float(getLumi()))
     logging.debug('Initializing {0} {1} {2}'.format(self.analysis,self.sample,self.shift))
     # backup passing custom parameters
     self.ntupleDirectory = kwargs.pop('ntupleDirectory','{0}/{1}'.format(getNtupleDirectory(self.analysis,shift=self.shift),self.sample))
     self.inputFileList = kwargs.pop('inputFileList','')
     self.outputFile = kwargs.pop('outputFile',getNewFlatHistograms(self.analysis,self.sample,shift=self.shift))
     if os.path.dirname(self.outputFile): python_mkdir(os.path.dirname(self.outputFile))
     self.treeName = kwargs.pop('treeName',getTreeName(self.analysis))
     if hasProgress:
         self.pbar = kwargs.pop('progressbar',ProgressBar(widgets=['{0}: '.format(sample),' ',SimpleProgress(),' ',Percentage(),' ',Bar(),' ',ETA()]))
     else:
         self.pbar = None
     # get stuff needed to flatten
     self.infile = 0
     self.tchain = 0
     self.initialized = False
     self.hists = {}
     self.datasets = {}
Exemplo n.º 4
0
 def __init__(self, analysis, sample, **kwargs):
     # default to access via sample/analysis
     self.analysis = analysis
     self.sample = sample
     self.shift = kwargs.pop('shift', '')
     logging.debug('Initializing {0} {1} {2}'.format(
         self.analysis, self.sample, self.shift))
     # backup passing custom parameters
     self.ntupleDirectory = kwargs.pop(
         'ntupleDirectory', '{0}/{1}'.format(
             getNtupleDirectory(self.analysis, shift=self.shift),
             self.sample))
     self.inputFileList = kwargs.pop('inputFileList', '')
     self.outputFile = kwargs.pop('outputFile', '')
     self.json = kwargs.pop('json', getSkimJson(self.analysis, self.sample))
     self.pickle = kwargs.pop('pickle',
                              getSkimPickle(self.analysis, self.sample))
     self.treeName = kwargs.pop('treeName', getTreeName(self.analysis))
     if hasProgress:
         self.pbar = kwargs.pop(
             'progressbar',
             ProgressBar(widgets=[
                 '{0}: '.format(sample), ' ',
                 SimpleProgress(), ' events ',
                 Percentage(), ' ',
                 Bar(), ' ',
                 ETA()
             ]))
     else:
         self.pbar = None
     # get stuff needed to flatten
     self.infile = 0
     self.tchain = 0
     self.initialized = False
     self.counts = {}
Exemplo n.º 5
0
 def __init__(self,analysis,sample,**kwargs):
     # default to access via sample/analysis
     self.analysis = analysis
     self.sample = sample
     self.shift = kwargs.pop('shift','')
     self.intLumi = kwargs.get('intLumi',float(getLumi()))
     logging.debug('Initializing {0} {1} {2}'.format(self.analysis,self.sample,self.shift))
     # backup passing custom parameters
     self.ntupleDirectory = kwargs.pop('ntupleDirectory','{0}/{1}'.format(getNtupleDirectory(self.analysis,shift=self.shift),self.sample))
     self.inputFileList = kwargs.pop('inputFileList','')
     self.outputFile = kwargs.pop('outputFile','')
     self.json = kwargs.pop('json',getSkimJson(self.analysis,self.sample))
     self.pickle = kwargs.pop('pickle',getSkimPickle(self.analysis,self.sample))
     self.treeName = kwargs.pop('treeName',getTreeName(self.analysis))
     if hasProgress:
         self.pbar = kwargs.pop('progressbar',ProgressBar(widgets=['{0}: '.format(sample),' ',SimpleProgress(),' events ',Percentage(),' ',Bar(),' ',ETA()]))
     else:
         self.pbar = None
     # get stuff needed to flatten
     self.infile = 0
     self.tchain = 0
     self.initialized = False
     self.counts = {}