ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkSUSY
python
SUSYWeightMetadataConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
4
from
AthenaConfiguration.ComponentFactory
import
CompFactory
5
6
# Sum of weights algorithm
7
def
SumOfWeightsAlgCfg
(flags, name, **kwargs):
8
""" Get the sum of weights algorithm """
9
from
EventBookkeeperTools.EventBookkeeperToolsConfig
import
CutFlowSvcCfg
10
acc = CutFlowSvcCfg( flags )
11
SumOfWeightsAlg = CompFactory.SumOfWeightsAlg
12
acc.addEventAlgo(
SumOfWeightsAlg
(name=name, **kwargs) )
13
return
acc
14
15
# McEventWeight Tool
16
def
McEventWeightToolCfg
(flags, name, **kwargs):
17
""" Get the MC Event Weight Tool """
18
acc = ComponentAccumulator()
19
McEventWeight = CompFactory.McEventWeight
20
acc.addPublicTool(
McEventWeight
(name=name, **kwargs) )
21
return
acc
22
23
# SUSY ID Weight Tool
24
def
SUSYIDWeightToolCfg
(flags, name, **kwargs):
25
""" Get the SUSY ID Weight Tool """
26
acc = ComponentAccumulator()
27
SUSYIDWeight = CompFactory.SUSYIDWeight
28
acc.addPublicTool(
SUSYIDWeight
(name=name, **kwargs) )
29
return
acc
30
31
# SUSY Event Weights
32
def
AddSUSYWeightsCfg
(flags, pref = ""):
33
"""Add SUSY weights"""
34
35
acc = ComponentAccumulator()
36
37
# Load all potential SUSY process IDs following Prospino conventions
38
# https://twiki.cern.ch/twiki/bin/view/AtlasProtected/SUSYSignalUncertainties#Subprocess_IDs
39
listTools = []
40
for
i
in
range(0, 225):
41
myName = pref+
"SUSYWeight_ID"
+
"_"
+str(i)
42
if
i==0:
#flat sum of all processes (i.e. sum the weight no matter what)
43
acc.merge(
McEventWeightToolCfg
(flags, name=myName, UseTruthEvents=
True
) )
44
else
:
#add weight only to keeper associated to current process id
45
acc.merge(
SUSYIDWeightToolCfg
(flags, name=myName, SUSYProcID=i, UseTruthEvents=
True
) )
46
listTools.append( acc.getPublicTool(myName) )
47
48
acc.merge(
SumOfWeightsAlgCfg
(flags, name=pref+
"SUSYSumWeightsAlg"
, WeightTools=listTools) )
49
return
acc
McEventWeight
Definition
McEventWeight.h:21
SUSYIDWeight
Definition
SUSYIDWeight.h:25
SumOfWeightsAlg
Definition
SumOfWeightsAlg.h:27
python.SUSYWeightMetadataConfig.SUSYIDWeightToolCfg
SUSYIDWeightToolCfg(flags, name, **kwargs)
Definition
SUSYWeightMetadataConfig.py:24
python.SUSYWeightMetadataConfig.SumOfWeightsAlgCfg
SumOfWeightsAlgCfg(flags, name, **kwargs)
Definition
SUSYWeightMetadataConfig.py:7
python.SUSYWeightMetadataConfig.McEventWeightToolCfg
McEventWeightToolCfg(flags, name, **kwargs)
Definition
SUSYWeightMetadataConfig.py:16
python.SUSYWeightMetadataConfig.AddSUSYWeightsCfg
AddSUSYWeightsCfg(flags, pref="")
Definition
SUSYWeightMetadataConfig.py:32
Generated on
for ATLAS Offline Software by
1.17.0