ATLAS Offline Software
Loading...
Searching...
No Matches
LArSCvsRawChannelMonAlg.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
4from AthenaConfiguration.ComponentFactory import CompFactory
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from LArByteStream.LArRawDataReadingConfig import LArRawDataReadingCfg
7from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
8from AthenaConfiguration.MainServicesConfig import MainServicesCfg
9from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArOnOffIdMappingSCCfg
10
11
13 acc=ComponentAccumulator()
14 from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg
15 acc.merge(LArBadChannelCfg(flags))
16 acc.merge(LArBadChannelCfg(flags,isSC=True))
17
18 acc.merge(LArOnOffIdMappingCfg(flags))
19 acc.merge(LArOnOffIdMappingSCCfg(flags))
20 acc.merge(LArRawSCDataReadingCfg(flags))
21
22 from CaloRec.CaloBCIDAvgAlgConfig import CaloBCIDAvgAlgCfg
23 acc.merge(CaloBCIDAvgAlgCfg(flags))
24
25 if flags.Input.isMC is False and not flags.Common.isOnline:
26 from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
27 acc.merge(LuminosityCondAlgCfg(flags))
28 from LumiBlockComps.LBDurationCondAlgConfig import LBDurationCondAlgCfg
29 acc.merge(LBDurationCondAlgCfg(flags))
30
31 from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper
32 helper = AthMonitorCfgHelper(flags,'LArSuperCellMonAlgCfg')
33 acc.merge(LArSCvsRawChannelMonConfigCore(helper, flags))
34
35 return acc
36
37
38def LArSCvsRawChannelMonConfigCore(helper, flags, algname="LArSCvsRawChannelMon"):
39
40
41 alg= helper.addAlgorithm(CompFactory.LArSCvsRawChannelMonAlg,algname)
42
43
44 GroupName="LArSCvsRawGroup"
45 alg.MonGroupName = GroupName
46 alg.SCEnergyCut=90
47 alg.ProblemsToMask=["deadReadout","deadPhys"]
48 cellMonGroup = helper.addGroup(alg,GroupName,'LArSCvsRawChannelMon')
49
50
51 partGroup = helper.addArray([alg.LayerNames], alg, 'LArSCvsRawChannelMon', topPath='LArSCvsRawChannelMon/PerLayer')
52
53 from LArMonitoring.GlobalVariables import lArDQGlobals
54
55
56 for pName in alg.PartitionNames:
57 cellMonGroup.defineHistogram(f"scEne_{pName},eneSum_{pName};h_SCEne_vs_RawChannelEne_{pName}",
58 title=f'Super Cell energy vs sum of RawChannel energies ({pName}) ;SC [MeV]; Sum [MeV]',
59 type='TH2F', path="",
60 xbins = 100, xmin=0,xmax=50000,
61 ybins = 100, ymin=0,ymax=50000)
62
63
64
65 for lName in alg.LayerNames:
66 Side = lName[-1]
67 if "HEC" in lName:
68 Sampling = "0"
69 Part = lName[:-1]
70 else:
71 Sampling = lName[-2]
72 Part = lName[:-2]
73 if Part == "FCAL":
74 Part = "FCal"
75 if Sampling == "P":
76 Sampling = "0"
77 print(lName, "part", Part, "side", Side, "sampling", Sampling)
78 partxbins=lArDQGlobals.SuperCell_Variables["etaRange"][Part][Side][Sampling]
79 partybins=lArDQGlobals.SuperCell_Variables["phiRange"][Part][Side][Sampling]
80
81
82 partGroup.defineHistogram('part_eta,part_phi,part_eneFrac; Coverage_SCEne_div_cellEne_coverage_test',
83 title='SC energy / sum of cell energy',
84 type="TProfile2D",
85 xbins=partxbins,
86 ybins=partybins,
87 path='Coverage',
88 pattern=[(lName)])
89
90 partGroup.defineHistogram("part_scEne,part_eneSum;h_SCEne_vs_RawChannelEne",
91 title=f'Super Cell energy vs sum of RawChannel energies ({lName}) ;SC [MeV]; Sum [MeV]',
92 type='TH2F',
93 xbins = 100, xmin=0,xmax=50000,
94 ybins = 100, ymin=0,ymax=50000,
95 pattern=[(lName)])
96
97
98
99
100
101
102 return helper.result()
103
104if __name__=="__main__":
105
106 from AthenaConfiguration.AllConfigFlags import initConfigFlags
107 flags=initConfigFlags()
108 from AthenaCommon.Logging import log
109 from AthenaCommon.Constants import DEBUG
110 log.setLevel(DEBUG)
111 from AthenaConfiguration.TestDefaults import defaultGeometryTags
112
113 flags.LAr.doAlign=False
114 flags.Input.Files = ["data24_13p6TeV.00481893.physics_Main.daq.RAW._lb1058._SFO-17._0002.data",]
115 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
116 flags.Output.HISTFileName = 'LArSuperCellvsRC.root'
117 flags.Exec.FPE=-1
118 flags.fillFromArgs()
119 flags.lock()
120
121 acc = MainServicesCfg( flags )
122 acc.merge(LArRawDataReadingCfg(flags))
123
124 acc.merge(LArSCvsRawChannelMonAlgCfg(flags))
125 acc.getService("AvalancheSchedulerSvc").ShowDataDependencies=True
126 alg=acc.getEventAlgo("LArSCvsRawChannelMon")
127 alg.EnableLumi=False
128 alg.TrigDecisionTool=""
129 alg.WarnOffenders=True
130 acc.run()
void print(char *figname, TCanvas *c1)
LArSCvsRawChannelMonConfigCore(helper, flags, algname="LArSCvsRawChannelMon")