ATLAS Offline Software
Loading...
Searching...
No Matches
python.LArHVScaleConfig Namespace Reference

Functions

 LArHVScaleCfg (configFlags, **props)
 addHvScaleParserArgs (parser)
 buildHvScaleProps (args)
 setConsistentHVScaleOutputKeys (ca1, ca2)

Variables

 flags = initConfigFlags()
int nThreads = 1
 NumThreads
 ShowDataDeps
 ShowDataFlow
 ShowControlFlow
 NumConcurrentEvents
 Files
 cfg = MainServicesCfg(flags)

Function Documentation

◆ addHvScaleParserArgs()

addHvScaleParserArgs ( parser)

Definition at line 59 of file LArHVScaleConfig.py.

59def addHvScaleParserArgs(parser):
60 # used by LArCalib_HVCorrConfig,py and CaloNoiseConfig.py
61 parser.add_argument('-V','--voltage',type=str, default=[], action='append', nargs=1,
62 help="use -V \"<ID> <HV>\" to set the voltage for this line instead of reading it from DCS")
63 parser.add_argument('-I','--current',type=str, default=[], action='append', nargs=1,
64 help="use -I \"<ID> <current>\" to set the current for this line instead of reading it from DCS")
65
66

◆ buildHvScaleProps()

buildHvScaleProps ( args)

Definition at line 67 of file LArHVScaleConfig.py.

67def buildHvScaleProps(args):
68 from itertools import chain
69 from re import match
70 v = list(chain.from_iterable(args.voltage))
71 i = list(chain.from_iterable(args.current))
72 for x in v + i:
73 if match(r"\d+\s+\d+\.?\d*", x) is None:
74 raise ValueError("ERROR: invalid voltage/current specification, should be of the form \"<line ID> <HV>\"")
75 return {"fixHV": v, "fixCurrent": i}
76
77
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition hcg.cxx:359

◆ LArHVScaleCfg()

LArHVScaleCfg ( configFlags,
** props )

Definition at line 8 of file LArHVScaleConfig.py.

8def LArHVScaleCfg(configFlags, **props):
9 result=ComponentAccumulator()
10
11 from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
12
13 from LArGeoAlgsNV.LArGMConfig import LArGMCfg
14 result.merge(LArGMCfg(configFlags))
15
16 from LArCabling.LArHVCablingConfig import LArHVCablingCfg
17 result.merge(LArHVCablingCfg(configFlags))
18
19 result.merge(LArBadFebCfg(configFlags))
20
21 from IOVDbSvc.IOVDbSvcConfig import addFolders
22 LArHVCondAlg=CompFactory.LArHVCondAlg
23
24 if configFlags.Input.isMC:
25 hvcond = LArHVCondAlg(doHV=False, doAffectedHV=False)
26 elif not configFlags.Common.isOnline:
27 result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREl/I16"], "DCS_OFL", className="CondAttrListCollection"))
28 result.merge(addFolders(configFlags,["/LAR/DCS/HV/BARREL/I8"], "DCS_OFL", className="CondAttrListCollection"))
29
30 result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Pathologies"], "LAR_OFL", className="AthenaAttributeList"))
31 if configFlags.GeoModel.Run is not LHCPeriod.Run1:
32 result.merge(addFolders(configFlags,["/LAR/HVPathologiesOfl/Rvalues"], "LAR_OFL", className="AthenaAttributeList"))
33
34 result.merge(LArBadChannelCfg(configFlags))
35
36 LArHVPathologyDbCondAlg=CompFactory.LArHVPathologyDbCondAlg
37 hvpath = LArHVPathologyDbCondAlg(PathologyFolder="/LAR/HVPathologiesOfl/Pathologies",
38 HVMappingKey="LArHVIdMap",
39 HVPAthologyKey="LArHVPathology")
40 result.addCondAlgo(hvpath)
41
42 from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBCfg
43 result.merge(LArElecCalibDBCfg(configFlags,["HVScaleCorr",]))
44
45 if configFlags.GeoModel.Run is not LHCPeriod.Run1:
46 hvcond = LArHVCondAlg(HVPathologies="LArHVPathology")
47 else:
48 hvcond = LArHVCondAlg(HVPathologies="LArHVPathology",doR=False)
49 hvcond.keyOutputResidualCorr = props.pop("keyOutputResidualCorr", "LArHVScaleCorrRecomputed")
50 hvcond.keyOutputFullCorr = props.pop("keyOutputFullCorr", "")
51 hvcond.fixHV = props.pop("fixHV", [])
52 hvcond.fixCurrent = props.pop("fixCurrent", [])
53 if len(props) > 0: raise ValueError(f"tool properties not modified: {','.join(props.keys())}")
54 result.addCondAlgo(hvcond)
55
56 return result
57
58

◆ setConsistentHVScaleOutputKeys()

setConsistentHVScaleOutputKeys ( ca1,
ca2 )
When two CAs configured a LArHVCondAlg, make an attempt at harmonizing the respective 
alg properties such that CA deduplication won't fail, as long as the resulting 
behaviour is unchanged; e.g. enabling extra outputs. 
Properties for which invariance isn't guaranteed are left unchanged.

Definition at line 78 of file LArHVScaleConfig.py.

78def setConsistentHVScaleOutputKeys(ca1, ca2):
79 """
80 When two CAs configured a LArHVCondAlg, make an attempt at harmonizing the respective
81 alg properties such that CA deduplication won't fail, as long as the resulting
82 behaviour is unchanged; e.g. enabling extra outputs.
83 Properties for which invariance isn't guaranteed are left unchanged.
84 """
85 alg1 = ca1.getCondAlgo("LArHVCondAlg")
86 alg2 = ca2.getCondAlgo("LArHVCondAlg")
87 if alg1 and alg2:
88 for x, y in ((alg1, alg2), (alg2, alg1)):
89 if x.keyOutputResidualCorr == "": x.keyOutputResidualCorr = y.keyOutputResidualCorr
90 if x.keyOutputFullCorr == "": x.keyOutputFullCorr = y.keyOutputFullCorr
91
92

Variable Documentation

◆ cfg

python.LArHVScaleConfig.cfg = MainServicesCfg(flags)

Definition at line 111 of file LArHVScaleConfig.py.

◆ Files

python.LArHVScaleConfig.Files

Definition at line 106 of file LArHVScaleConfig.py.

◆ flags

python.LArHVScaleConfig.flags = initConfigFlags()

Definition at line 96 of file LArHVScaleConfig.py.

◆ nThreads

int python.LArHVScaleConfig.nThreads = 1

Definition at line 98 of file LArHVScaleConfig.py.

◆ NumConcurrentEvents

python.LArHVScaleConfig.NumConcurrentEvents

Definition at line 104 of file LArHVScaleConfig.py.

◆ NumThreads

python.LArHVScaleConfig.NumThreads

Definition at line 99 of file LArHVScaleConfig.py.

◆ ShowControlFlow

python.LArHVScaleConfig.ShowControlFlow

Definition at line 103 of file LArHVScaleConfig.py.

◆ ShowDataDeps

python.LArHVScaleConfig.ShowDataDeps

Definition at line 101 of file LArHVScaleConfig.py.

◆ ShowDataFlow

python.LArHVScaleConfig.ShowDataFlow

Definition at line 102 of file LArHVScaleConfig.py.