ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
Tools
CaloSamplingFractionAnalysis
python
LArFCalSamplingFractionConfig.py
Go to the documentation of this file.
1
#!/usr/bin/env athena.py
2
3
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4
#
5
# This CA configuration script replaces the previously used legacy script for simulating sampling fractions
6
#
7
8
import
sys
9
10
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
11
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
12
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
13
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
14
from
AthenaConfiguration.ComponentFactory
import
CompFactory
15
from
TileConditions.TileCablingSvcConfig
import
TileCablingSvcCfg
16
from
TileConditions.TileSamplingFractionConfig
import
TileSamplingFractionCondAlgCfg
17
from
LArConfiguration.LArElecCalibDBConfig
import
LArElecCalibDBCfg
18
from
LArGeoAlgsNV.LArGMConfig
import
LArGMCfg
19
20
# Adding algorithm
21
def
LarFCalSamplingFractionCfg
(flags, name="LarFCalSamplingFraction", **kwargs):
22
acc = ComponentAccumulator()
23
24
acc.addService(CompFactory.THistSvc(name=
"THistSvc"
, Output=[ f
"AANT DATAFILE='{flags.Output.HISTFileName}' OPT='RECREATE'"
]))
25
26
kwargs.setdefault(
'Calibration'
,
True
)
27
28
acc.merge( TileCablingSvcCfg(flags) )
29
acc.merge( TileSamplingFractionCondAlgCfg(flags) )
30
acc.getCondAlgo(
'TileSamplingFractionCondAlg'
).G4Version=-1
31
requiredConditons=[
"Shape"
,
"AutoCorr"
,
"Noise"
,
"Pedestal"
,
"fSampl"
,
"MinBias"
]
32
acc.merge(LArElecCalibDBCfg(flags,requiredConditons))
33
acc.merge(LArGMCfg(flags))
34
acc.addEventAlgo(CompFactory.LArFCalSamplingFraction(name, **kwargs))
35
36
return
acc
37
38
if
__name__ ==
"__main__"
:
39
# Setting flags
40
flags = initConfigFlags()
41
flags.IOVDb.GlobalTag =
'OFLCOND-MC23-SDR-RUN3-04'
42
flags.Input.Files = [
'test.root'
]
43
flags.Output.HISTFileName =
'LArFCal_SF.root'
44
flags.Exec.MaxEvents = -1
45
flags.fillFromArgs()
46
flags.dump()
47
flags.lock()
48
49
# Main CA and basic services
50
acc = MainServicesCfg(flags)
51
acc.merge(PoolReadCfg(flags))
52
acc.merge(
LarFCalSamplingFractionCfg
(flags))
53
acc.printConfig(withDetails=
True
)
54
55
# Finalize
56
sys.exit( acc.run().isFailure() )
LArFCalSamplingFractionConfig.LarFCalSamplingFractionCfg
LarFCalSamplingFractionCfg(flags, name="LarFCalSamplingFraction", **kwargs)
Definition
LArFCalSamplingFractionConfig.py:21
Generated on
for ATLAS Offline Software by
1.17.0