def _estimate(self, region, channel, setup): if setup.verbose: printHeader("MC prediction for %s channel %s" % (self.name, channel)) if channel == 'all': return sum([ self.cachedEstimate(region, c, setup) for c in ['MuMu', 'EE', 'EMu'] ], u_float(0., 0.)) else: preSelection = setup.preselection('MC', channel=channel) cut = "&&".join([ region.cutString(setup.sys['selectionModifier']), preSelection['cut'] ]) weight = preSelection['weightStr'] if setup.verbose: print "Using cut %s and weight %s" % (cut, weight) if not self.sample[channel].has_key('chain'): loadChain(self.sample[channel]) return setup.lumi[channel] / 1000. * u_float( getYieldFromChain(self.sample[channel]['chain'], cutString=cut, weight=weight, returnError=True))
def _estimate(self, region, channel, setup): if setup.verbose: printHeader("MC prediction for %s channel %s" %(self.name, channel)) if channel=='all': return sum( [ self.cachedEstimate(region, c, setup) for c in ['MuMu', 'EE', 'EMu'] ], u_float(0., 0.) ) else: preSelection = setup.preselection('MC', channel=channel) cut = "&&".join([region.cutString(setup.sys['selectionModifier']), preSelection['cut']]) weight = preSelection['weightStr'] if setup.verbose: print "Using cut %s and weight %s"%(cut, weight) if not self.sample[channel].has_key('chain'): loadChain(self.sample[channel]) return setup.lumi[channel]/1000.*u_float(getYieldFromChain(self.sample[channel]['chain'], cutString = cut, weight=weight, returnError = True) )
def loadChains(self): for s in sum([s.values() for s in self.sample.values()], []): loadChain( s) # if not type(s)==type([]) else [loadChain(t) for t in s]
def loadChains(self): for s in sum([s.values() for s in self.sample.values()], []): loadChain(s) # if not type(s)==type([]) else [loadChain(t) for t in s]