6 """This method overrides the values of Birks Constant to the values
7 expected to be used in MC21 and sets the sampling fractions
8 consistently. (Based on using G4 10.6.3.3.)"""
9 if flags.Common.ProductionStep
in [ProductionStep.Simulation, ProductionStep.FastChain]:
11 if flags.Detector.EnableLAr:
12 EMBPresamplerCalculator = cfg.getService(
"EMBPresamplerCalculator")
13 EMBPresamplerCalculator.BirksLaw =
True
14 EMBPresamplerCalculator.Birksk = 0.0486 * 1.2
16 EMBCalculator = cfg.getService(
"EMBCalculator")
17 EMBCalculator.BirksLaw =
True
18 EMBCalculator.Birksk = 0.0486 * 1.2
20 EMECPosInnerWheelCalculator = cfg.getService(
"EMECPosInnerWheelCalculator")
21 EMECPosInnerWheelCalculator.BirksLaw =
True
22 EMECPosInnerWheelCalculator.Birksk = 0.0486 * 1.2
24 EMECNegInnerWheelCalculator = cfg.getService(
"EMECNegInnerWheelCalculator")
25 EMECNegInnerWheelCalculator.BirksLaw =
True
26 EMECNegInnerWheelCalculator.Birksk = 0.0486 * 1.2
28 EMECPosOuterWheelCalculator = cfg.getService(
"EMECPosOuterWheelCalculator")
29 EMECPosOuterWheelCalculator.BirksLaw =
True
30 EMECPosOuterWheelCalculator.Birksk = 0.0486 * 1.2
32 EMECNegOuterWheelCalculator = cfg.getService(
"EMECNegOuterWheelCalculator")
33 EMECNegOuterWheelCalculator.BirksLaw =
True
34 EMECNegOuterWheelCalculator.Birksk = 0.0486 * 1.2
36 EMECPresamplerCalculator = cfg.getService(
"EMECPresamplerCalculator")
37 EMECPresamplerCalculator.BirksLaw =
True
38 EMECPresamplerCalculator.Birksk = 0.0486 * 1.2
40 EMECPosBackOuterBarretteCalculator = cfg.getService(
"EMECPosBackOuterBarretteCalculator")
41 EMECPosBackOuterBarretteCalculator.BirksLaw =
True
42 EMECPosBackOuterBarretteCalculator.Birksk = 0.0486 * 1.2
44 EMECNegBackOuterBarretteCalculator = cfg.getService(
"EMECNegBackOuterBarretteCalculator")
45 EMECNegBackOuterBarretteCalculator.BirksLaw =
True
46 EMECNegBackOuterBarretteCalculator.Birksk = 0.0486 * 1.2
49 if flags.Detector.EnableTile:
51 gramsPerMeVcmSq = Units.g/(Units.MeV * Units.cm2)
52 TileGeoG4SDCalc = cfg.getService(
"TileGeoG4SDCalc")
53 TileGeoG4SDCalc.birk1 = 0.0130 * gramsPerMeVcmSq * 1.54
54 TileGeoG4SDCalc.birk2 = 0.0
56 if flags.Common.ProductionStep
is not ProductionStep.Simulation:
58 if flags.Detector.EnableLAr:
59 from IOVDbSvc.IOVDbSvcConfig
import addOverride
60 cfg.merge(
addOverride(flags,
"/LAR/ElecCalibMC/fSampl",
"LARElecCalibMCfSampl-G4106-v1-FTFP_BERT_BIRK"))
63 if flags.Detector.EnableTile:
64 tileInfoLoader = cfg.getService(
"TileInfoLoader")
65 tileInfoLoader.EmScaleA = 33.432914