ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
Tools
CaloSamplingFractionAnalysis
python
LArEMSamplingFractionConfig.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
LarEMSamplingFractionCfg
(flags, name="LarEMSamplingFraction", **kwargs):
22
acc = ComponentAccumulator()
23
24
acc.addService(CompFactory.THistSvc(name=
"THistSvc"
, Output=[ f
"MYSTREAM DATAFILE='{flags.Output.HISTFileName}' OPT='RECREATE'"
]))
25
26
kwargs.setdefault(
'DoCells'
, 0)
27
28
kwargs.setdefault(
'CalibrationHitContainerNames'
, [
29
"LArCalibrationHitInactive"
,
30
"LArCalibrationHitActive"
,
31
"TileCalibHitInactiveCell"
,
32
"TileCalibHitActiveCell"
,
33
] )
34
35
acc.merge( TileCablingSvcCfg(flags) )
36
acc.merge( TileSamplingFractionCondAlgCfg(flags) )
37
acc.getCondAlgo(
'TileSamplingFractionCondAlg'
).G4Version=-1
38
requiredConditons=[
"Shape"
,
"AutoCorr"
,
"Noise"
,
"Pedestal"
,
"fSampl"
,
"MinBias"
]
39
acc.merge(LArElecCalibDBCfg(flags,requiredConditons))
40
acc.merge(LArGMCfg(flags))
41
acc.addEventAlgo(CompFactory.LarEMSamplingFraction(name, **kwargs))
42
43
return
acc
44
45
46
# Setting flags
47
flags = initConfigFlags()
48
flags.IOVDb.GlobalTag =
'OFLCOND-MC23-SDR-RUN3-04'
49
flags.Input.Files = [
'test.root'
]
50
flags.Output.HISTFileName =
'LArEM_SF.root'
51
flags.Exec.MaxEvents = -1
52
flags.fillFromArgs()
53
flags.dump()
54
flags.lock()
55
56
# Main CA and basic services
57
acc = MainServicesCfg(flags)
58
acc.merge(PoolReadCfg(flags))
59
acc.merge(
LarEMSamplingFractionCfg
(flags))
60
acc.printConfig(withDetails=
True
)
61
62
# Finalize
63
sys.exit( acc.run().isFailure() )
LArEMSamplingFractionConfig.LarEMSamplingFractionCfg
LarEMSamplingFractionCfg(flags, name="LarEMSamplingFraction", **kwargs)
Definition
LArEMSamplingFractionConfig.py:21
Generated on
for ATLAS Offline Software by
1.17.0