コード例 #1
0
    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))
コード例 #2
0
ファイル: MCBasedEstimate.py プロジェクト: wardVD/Copy
  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) )
コード例 #3
0
ファイル: Setup.py プロジェクト: wardVD/Copy
 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]
コード例 #4
0
ファイル: Setup.py プロジェクト: wardVD/StopsDilepton
 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]