当前位置: 首页>>代码示例>>Python>>正文


Python PSet.Triggers方法代码示例

本文整理汇总了Python中icf.core.PSet.Triggers方法的典型用法代码示例。如果您正苦于以下问题:Python PSet.Triggers方法的具体用法?Python PSet.Triggers怎么用?Python PSet.Triggers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在icf.core.PSet的用法示例。


在下文中一共展示了PSet.Triggers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: AddHistPairWithL1

# 需要导入模块: from icf.core import PSet [as 别名]
# 或者: from icf.core.PSet import Triggers [as 别名]
def AddHistPairWithL1(cutTree = None,cut = None, RefTrig = None, TestTrig = None, L1ListRef = None,L1ListTest = None):
  """docstring for AddBinedHist"""
  out = []
  refTrigs = None
  if "Mu" in RefTrig:
   refTrigs = [TestTrig,RefTrig]
  else: refTrigs = [TestTrig]
  refPlots = PL_TriggerTurnOns( PSet(DirName = RefTrig+"_For_"+TestTrig,MinObjects =0 ,
                                MaxObjects = 15,Plots = True, ReWeight = True if "Mu" not in RefTrig else False,
                                TriggerReWeight = refTrigs,   Verbose = False,
                                ReWeightL1 = False, L1TriggerReWeight = [L1ListRef]).ps())

  testTrigPlots = PL_TriggerTurnOns( PSet(DirName = TestTrig+"_From_"+RefTrig,MinObjects = 0,
                                     MaxObjects = 15,Plots = True, ReWeight = True,
                                     TriggerReWeight = [TestTrig], Verbose = False,
                                     ReWeightL1 = True, L1TriggerReWeight = [L1ListTest]).ps())


  refTrigPS =  PSet(Verbose = False,UsePreScaledTriggers = True,Triggers = [] )
  refTrigPS.Triggers = [RefTrig]
  refTrigOP = OP_MultiTrigger( refTrigPS.ps() )
  testTrigPS = PSet(Verbose = False,UsePreScaledTriggers = True,Triggers = [] )
  testTrigPS.Triggers = [TestTrig]
  print "RefTrig = %s, testTrig = %s"%(refTrigPS.Triggers[0],testTrigPS.Triggers[0])
  testTrigOP = OP_MultiTrigger( testTrigPS.ps() )
  cutTree.TAttach(cut,refTrigOP)
  cutTree.TAttach(refTrigOP,refPlots)
  cutTree.TAttach(refTrigOP,testTrigOP)
  cutTree.TAttach(testTrigOP,testTrigPlots)
  out.append(refTrigOP)
  out.append(refPlots)
  out.append(testTrigPlots)
  out.append(testTrigOP)
  return out
  pass
开发者ID:brynmathias,项目名称:AnalysisV2,代码行数:37,代码来源:TriggerTurnOns.py

示例2: AddBinedHist

# 需要导入模块: from icf.core import PSet [as 别名]
# 或者: from icf.core.PSet import Triggers [as 别名]
def AddBinedHist(cutTree = None, OP = (), cut = None, htBins = [],TriggerDict = None,lab = ""):
  """docstring for AddBinedHist"""
  out = []
  if TriggerDict is not None:
      for lower,upper in zip(htBins,htBins[1:]+[None]):
        # print "Lower , Upper =", lower , upper
        if int(lower) == 325 and upper is None: continue
        if int(lower) == 375 and upper is None: continue
        if int(lower) == 475 and upper is None: continue
        if int(lower) == 675 and upper is None: continue
        # print "continue should have happened now"
        lowerCut = eval("RECO_CommonHTCut(%d)"%lower)
        triggerps = PSet(Verbose = False,
        UsePreScaledTriggers = False,
        Triggers = [])
        triggerps.Triggers = TriggerDict["%d%s"%(lower, "_%d"%upper if upper else "")]
        Trigger = OP_MultiTrigger( triggerps.ps() )
        out.append(triggerps)
        out.append(Trigger)
        out.append(lowerCut)
        cutTree.TAttach(cut,Trigger)
        cutTree.TAttach(Trigger,lowerCut)
        if upper:
          upperCut =  eval("RECO_CommonHTLessThanCut(%d)"%upper)
          out.append(upperCut)
          cutTree.TAttach(lowerCut,upperCut)
        pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = upperCut if upper else lowerCut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else ""))
        out.append(pOps) 
  else:
      for lower,upper in zip(htBins,htBins[1:]+[None]):
        # print "Lower , Upper =", lower , upper
        if int(lower) == 325 and upper is None: continue
        if int(lower) == 375 and upper is None: continue
        if int(lower) == 475 and upper is None: continue
        if int(lower) == 675 and upper is None: continue
        # print "continue should have happened now"
        lowerCut = eval("RECO_CommonHTCut(%d)"%lower)
        out.append(lowerCut)
        cutTree.TAttach(cut,lowerCut)
        if upper:
          upperCut =  eval("RECO_CommonHTLessThanCut(%d)"%upper)
          out.append(upperCut)
          cutTree.TAttach(lowerCut,upperCut)
        pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = upperCut if upper else lowerCut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else "")) 
        out.append(pOps)
  return out
  pass
开发者ID:DarrenBurton,项目名称:RA1_Muon_Analysis,代码行数:49,代码来源:batchGolden_btag.py

示例3: RECO_CommonHTCut

# 需要导入模块: from icf.core import PSet [as 别名]
# 或者: from icf.core.PSet import Triggers [as 别名]
  "HLT_HT400_AlphaT0p52_v5":(["HLT_Mu40_HT300_v4","HLT_Mu40_HT300_v5"],[(475.,575.),(575.,675.),(675.,775.),(775.,875.),(875.,14000.)]),
}
# refTrigList =  ["HLT_Mu40_HT200_v*","HLT_Mu40_HT200_v*"]
# TestTrigList = ["HLT_HT250_AlphaT0p53_v6","HLT_HT250_AlphaT0p55_v*"]
#


trigList = []
sigList = []
for key,vals in alphatTesting.iteritems():
    trigList+=vals[0]
    sigList.append(key)
htCut = RECO_CommonHTCut(375.)
alphaT055 = HadronicAlphaT(0.55)
dump = EventDump()
Cross_Trigger_PS.Triggers =  trigList
TriggersRef = OP_MultiTrigger(Cross_Trigger_PS.ps())
HT_Trigger_PS.Triggers = sigList
TriggersSig = OP_MultiTrigger(HT_Trigger_PS.ps())
cutTreeData.TAttach(muDr,TriggersRef)
cutTreeData.TAttach(TriggersRef,TriggersSig)
cutTreeData.FAttach(TriggersSig,alphaT055)
cutTreeData.TAttach(alphaT055,htCut)
cutTreeData.TAttach(htCut,dump)


skim_ps=PSet(
    SkimName = "myskim",
    DropBranches = False,
    Branches = [
        " keep * "
开发者ID:brynmathias,项目名称:AnalysisV2,代码行数:33,代码来源:TriggerTurnOns.py

示例4: AddBinedHist

# 需要导入模块: from icf.core import PSet [as 别名]
# 或者: from icf.core.PSet import Triggers [as 别名]
def AddBinedHist(cutTree = None, OP = (), cut = None, htBins = [],TriggerDict = None,lab = "", Muon=None):
  """docstring for AddBinedHist"""
  out = []

  if TriggerDict is not None:
    ## DATA
      for lower,upper in zip(htBins,htBins[1:]+[None]):
        if int(lower) == 325 and upper is None: continue
        if int(lower) == 375 and upper is None : continue
        if int(lower) == 675 and upper is None : continue
        # print "continue should have happened now"
        lowerCutVal=""
        if Muon!=None:
            lowerCutVal=("RECO_CommonHTTakeMuCut(%d)"%lower)
        else:
            lowerCutVal=("RECO_CommonHTCut(%d)"%lower)
        lowerCut = eval(lowerCutVal)
        useprescale = False

        triggerps = PSet(Verbose = False,
        UsePreScaledTriggers = False,
        Triggers = [])

        triggerps.Triggers = TriggerDict["%d%s"%(lower, "_%d"%upper if upper else "")]
        Trigger = OP_MultiTrigger( triggerps.ps() )
        
        out.append(triggerps)
        out.append(Trigger)
        out.append(lowerCut)
        

        #cutTree.TAttach(cut,Trigger)
        #cutTree.TAttach(Trigger,lowerCut)
        cutTree.TAttach(cut,lowerCut)

        if upper:
          upperCutVal=""
          if Muon!=None:
            upperCutVal=("RECO_CommonHTTakeMuLessThanCut(%d)"%upper)
          else:
            upperCutVal=("RECO_CommonHTLessThanCut(%d)"%upper)
          upperCut = eval(upperCutVal)
          out.append(upperCut)
          cutTree.TAttach(lowerCut,upperCut)
          cutTree.TAttach(upperCut,Trigger)

        if not upper:
          cutTree.TAttach(lowerCut,Trigger)

        pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = Trigger, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else ""))
        out.append(pOps)
  else:
    ## MC
      for lower,upper in zip(htBins,htBins[1:]+[None]):
        if int(lower) == 325 and upper is None: continue
        if int(lower) == 375 and upper is None: continue
        if int(lower) == 675 and upper is None : continue
        lowerCutVal=""
        if Muon!=None:
            lowerCutVal=("RECO_CommonHTTakeMuCut(%d)"%lower)
        else:
            lowerCutVal=("RECO_CommonHTCut(%d)"%lower)
        lowerCut = eval(lowerCutVal)
        out.append(lowerCut)
        cutTree.TAttach(cut,lowerCut)
        if upper:
          upperCutVal=""
          if Muon!=None:
            upperCutVal=("RECO_CommonHTTakeMuLessThanCut(%d)"%upper)
          else:
            upperCutVal=("RECO_CommonHTLessThanCut(%d)"%upper)
          upperCut = eval(upperCutVal)
          out.append(upperCut)
          cutTree.TAttach(lowerCut,upperCut)
        ###pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = lowerCut, label = "%s%d_"%(lab,lower)) 
        pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = upperCut if upper else lowerCut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else ""))
        out.append(pOps)
  return out
  pass
开发者ID:lucasc896,项目名称:susy_work,代码行数:81,代码来源:batchGolden.py

示例5: AddBinedHist

# 需要导入模块: from icf.core import PSet [as 别名]
# 或者: from icf.core.PSet import Triggers [as 别名]
def AddBinedHist(cutTree = None, OP = (), cut = None, htBins = [],TriggerDict = None,lab = "", Muon=None):
  """docstring for AddBinedHist"""
  out = []

  if TriggerDict is not None:
    ## DATA
      for lower,upper in zip(htBins,htBins[1:]+[None]):
        if int(lower) == 275 and upper is None: continue
        if int(lower) == 325 and upper is None: continue
        if int(lower) == 375 and upper is None : continue
        if int(lower) == 675 and upper is None : continue
        lowerCutVal=""
        if Muon!=None:
            lowerCutVal=("RECO_CommonHTTakeMuCut(%d)"%lower)
        else:
            lowerCutVal=("RECO_CommonHTCut(%d)"%lower)
        lowerCut = eval(lowerCutVal)
        
        # flips a bool in framework/.../CommonOps.cc to allow preScale > 1
        if TriggerDict == ht_triggers:
          useprescale = True
        else:
          useprescale = False

        triggerps = PSet(Verbose = False,
                      UsePreScaledTriggers = useprescale,
                      Triggers = [])

        triggerps.Triggers = TriggerDict["%d%s"%(lower, "_%d"%upper if upper else "")]
        Trigger = OP_MultiTrigger( triggerps.ps() )
        
        out.append(triggerps)
        out.append(Trigger)
        out.append(lowerCut)
        
        cutTree.TAttach(cut,lowerCut)

        if upper:
          upperCutVal=""
          if Muon!=None:
            upperCutVal=("RECO_CommonHTTakeMuLessThanCut(%d)"%upper)
          else:
            upperCutVal=("RECO_CommonHTLessThanCut(%d)"%upper)
          upperCut = eval(upperCutVal)
          out.append(upperCut)
          cutTree.TAttach(lowerCut,upperCut)
          cutTree.TAttach(upperCut,Trigger)

        if not upper:
          cutTree.TAttach(lowerCut,Trigger)

        pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = Trigger, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else ""))
        out.append(pOps)
  else:
    ## MC
      for lower,upper in zip(htBins,htBins[1:]+[None]):
        if int(lower) == 275 and upper is None: continue
        if int(lower) == 325 and upper is None: continue
        if int(lower) == 375 and upper is None: continue
        if int(lower) == 675 and upper is None : continue
        lowerCutVal=""
        if Muon!=None:
            lowerCutVal=("RECO_CommonHTTakeMuCut(%d)"%lower)
        else:
            lowerCutVal=("RECO_CommonHTCut(%d)"%lower)
        lowerCut = eval(lowerCutVal)
        out.append(lowerCut)

        if lower == 200.:
          newAlphaT = OP_HadAlphaTCut(0.6)
          out.append(newAlphaT)
          cutTree.TAttach(cut, newAlphaT)
          cutTree.TAttach(newAlphaT, lowerCut)
        else:
          cutTree.TAttach(cut,lowerCut)
        if upper:
          upperCutVal=""
          if Muon!=None:
            upperCutVal=("RECO_CommonHTTakeMuLessThanCut(%d)"%upper)
          else:
            upperCutVal=("RECO_CommonHTLessThanCut(%d)"%upper)
          upperCut = eval(upperCutVal)
          out.append(upperCut)
          cutTree.TAttach(lowerCut,upperCut)
          pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = upperCut if "noCut" not in lab else cut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else ""))
        else:
          pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = lowerCut if "noCut" not in lab else cut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else ""))
        out.append(pOps)
  return out
  pass
开发者ID:lucasc896,项目名称:charmStudy,代码行数:92,代码来源:batchGolden.py


注:本文中的icf.core.PSet.Triggers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。