ATLAS Offline Software
SUSYWeightMetadata.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
2 
3 def addSUSYWeights(seq, pref = ""):
4 
5  from AthenaCommon.AppMgr import ToolSvc
6  from ReweightUtils.ReweightUtilsConf import SumOfWeightsAlg,McEventWeight
7  from DerivationFrameworkSUSY.DerivationFrameworkSUSYConf import SUSYIDWeight
8 
9  #Load standard generator event weight
10  #mcEventWeightNom = McEventWeight(name = pref+"mcWNom")
11  #ToolSvc += mcEventWeightNom
12 
13  sumOfWeightsAlg = SumOfWeightsAlg(name = pref+"SUSYSumWeightsAlg")
14 
15  #Load all potential SUSY process IDs
16  # following Prospino conventions
17  # https://twiki.cern.ch/twiki/bin/view/AtlasProtected/SUSYSignalUncertainties#Subprocess_IDs
18  listTools = []
19  susyWeight = []
20  for i in range(0, 225):
21 
22  if i==0: #flat sum of all processes (i.e. sum the weight no matter what)
23  susyWeight.append( McEventWeight(name = pref+"SUSYWeight_ID"+"_"+str(i), UseTruthEvents = True))
24  else: #add weight only to keeper associated to current process id
25  susyWeight.append( SUSYIDWeight(name = pref+"SUSYWeight_ID"+"_"+str(i), SUSYProcID = i, UseTruthEvents = True))
26 
27  ToolSvc += susyWeight[i]
28 
29  listTools.append(susyWeight[i])
30 
31  sumOfWeightsAlg.WeightTools = listTools
32  seq += sumOfWeightsAlg
33 
SUSYIDWeight
Definition: SUSYIDWeight.h:25
SumOfWeightsAlg
Definition: SumOfWeightsAlg.h:30
McEventWeight
Definition: McEventWeight.h:21
python.SUSYWeightMetadata.addSUSYWeights
def addSUSYWeights(seq, pref="")
Definition: SUSYWeightMetadata.py:3
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
str
Definition: BTagTrackIpAccessor.cxx:11