ATLAS Offline Software
CscMonitoringRAW_Alg.py
Go to the documentation of this file.
1 #
2 #Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 from .CscMonUtils import getCSCLabelx
6 
7 
8 def CscMonitoringRAW_AlgConfig(inputFlags):
9  '''Function to configures some algorithms in the monitoring system.'''
10 
11 
15  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
16  result = ComponentAccumulator()
17 
18  # Make sure muon geometry is configured
19  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
20  result.merge(MuonGeoModelCfg(inputFlags))
21 
22  # The following class will make a sequence, configure algorithms, and link
23  # them to GenericMonitoringTools
24  from AthenaMonitoring import AthMonitorCfgHelper
25  helper = AthMonitorCfgHelper(inputFlags,'CscAthMonitorCfg')
26 
27  from AthenaConfiguration.ComponentFactory import CompFactory
28  cscRdoMonAlg = helper.addAlgorithm(CompFactory.CscRdoValMonAlg,'CscRdoMonAlg')
29 
30  cscRdoMonAlg.cscNoiseCut = 100
31 
32 
36  from MuonConfig.MuonCSC_CnvToolsConfig import MuonCscRDODecoderCfg
37  decodertool = result.popToolsAndMerge(MuonCscRDODecoderCfg(inputFlags))
38  cscRdoMonAlg.CscRDODecoder = decodertool
39 
40  cscRdoGroup = helper.addGroup(cscRdoMonAlg,'CscRdoMonitor','Muon/MuonRawDataMonitoring/CSC/')
41 
42  #RDO
43  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_etacluswidth',cutmask='measuresEta',type='TH2F',title='ROD precision-cluster width;no.of strips;[sector] + [0.2 #times layer]',
44  path='RDO/Expert',xbins=192,xmin=0.,xmax=192.,ybins=175,ymin=-17.,ymax=18.)
45  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_phicluswidth',cutmask='measuresPhi_mon',type='TH2F',title='ROD transverse-cluster width;width(no.of strips);[sector] + [0.2 #times layer]',
46  path='RDO/Expert',xbins=48,xmin=0.,xmax=48.,ybins=175,ymin=-17.,ymax=18.)
47  cscRdoGroup.defineHistogram('stripId,secLayer;h2csc_rdo_hitmap',type='TH2F',title='Hit Occupancy;channel;[sector] + [0.2 #times layer]',
48  path='RDO/Expert',xbins=242,xmin=-49.,xmax=193.,ybins=175,ymin=-17.,ymax=18.)
49  cscRdoGroup.defineHistogram('diff_max_mon;h1csc_rdo_maxdiffamp',type='TH1F',title='Max Amplitude in ROD Cluster;ADC counts;;',
50  path='RDO/Shift',xbins=500,xmin=0.,xmax=5000)
51  cscRdoGroup.defineHistogram('tmp_xVals_signal_mon,tmp_secLayer_sig_mon;h2csc_rdo_hitmap_signal',cutmask='isSignal',type='TH2F',title='Signal Occupancy;channel;[sector] + [0.2 #times layer]',
52  path='RDO/Shift',xbins=242,xmin=-49.,xmax=193.,ybins=175,ymin=-17.,ymax=18.)
53  cscRdoGroup.defineHistogram('tmp_xVals_signal_mon,tmp_secLayer_sig_mon;h2csc_rdo_hitmap_signal_EC',cutmask='sideC_signal',type='TH2F',title='EndCap C: Signal Occupancy;channel;[sector] + [0.2 #times layer]',
54  path='Overview/CSCEC/RDO',xbins=242,xmin=-49.,xmax=193.,ybins=85,ymin=-17.,ymax=0.)
55  cscRdoGroup.defineHistogram('tmp_xVals_signal_mon;h1csc_rdo_hitmap_signal_EC_count',cutmask='sideC_signal',type='TH1F',title='EndCap C: Signal Occupancy;channel;entries/channel',
56  path='Overview/CSCEC/RDO',xbins=242,xmin=-49.,xmax=193.)
57  thisLabelx=getCSCLabelx("labels_occupancy_signal_EC")
58  cscRdoGroup.defineHistogram('tmp_secLayer_sig_mon;h1csc_rdo_hitmap_signal_EC_occupancy',cutmask='sideC_signal',type='TH1F',title='EndCap C: Signal Occupancy;;entries/layer',
59  path='Overview/CSCEC/RDO',xbins=85,xmin=-17.,xmax=0.,xlabels=thisLabelx)
60  cscRdoGroup.defineHistogram('tmp_xVals_signal_mon,tmp_secLayer_sig_mon;h2csc_rdo_hitmap_signal_EA',cutmask='sideA_signal',type='TH2F',title='EndCap A: Signal Occupancy;channel;[sector] + [0.2 #times layer]',
61  path='Overview/CSCEA/RDO',xbins=242,xmin=-49.,xmax=193.,ybins=90,ymin=0.,ymax=18.)
62  cscRdoGroup.defineHistogram('tmp_xVals_signal_mon;h1csc_rdo_hitmap_signal_EA_count',cutmask='sideA_signal',type='TH1F',title='EndCap A: Signal Occupancy;channel;entries/channel',
63  path='Overview/CSCEA/RDO',xbins=242,xmin=-49.,xmax=193.)
64  thisLabelx=getCSCLabelx("labels_occupancy_signal_EA")
65  cscRdoGroup.defineHistogram('tmp_secLayer_sig_mon;h1csc_rdo_hitmap_signal_EA_occupancy',cutmask='sideA_signal',type='TH1F',title='EndCap A: Signal Occupancy;;[sector] + [0.2 #times layer];',
66  path='Overview/CSCEA/RDO',xbins=90,xmin=0.,xmax=18.,xlabels=thisLabelx)
67  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_etacluswidth_signal',cutmask='signal_measuresEta',type='TH2F',title='ROD precision-cluster width;no.of strips;[sector] + [0.2 #times layer]',
68  path='RDO/Shift',xbins=192,xmin=0.,xmax=192.,ybins=175,ymin=-17.,ymax=18.)
69  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_etacluswidth_signal_EC',cutmask='signal_measuresEta_sideC',type='TH2F',title='EndCap C: ROD precision-cluster width;no.of strips;[sector] + [0.2 #times layer]',
70  path='Overview/CSCEC/RDO',xbins=192,xmin=0.,xmax=192.,ybins=85,ymin=-17.,ymax=0.)
71  cscRdoGroup.defineHistogram('raw_clus_width;h1csc_rdo_etacluswidth_signal_EC_count',cutmask='signal_measuresEta_sideC',type='TH1F',title='EndCap C: ROD precision-cluster width;width(no.of strips);entries',
72  path='Overview/CSCEC/RDO',xbins=192,xmin=0.,xmax=192.)
73  thisLabelx=getCSCLabelx("labels_occupancy_signal_EC")
74  cscRdoGroup.defineHistogram('secLayer;h1csc_rdo_etacluswidth_signal_EC_occupancy',cutmask='signal_measuresEta_sideC',type='TH1F',title='EndCap C: ROD precision-cluster width;;entries/layer',
75  path='Overview/CSCEC/RDO',xbins=85,xmin=-17.,xmax=0.,xlabels=thisLabelx)
76  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_etacluswidth_signal_EA',cutmask='signal_measuresEta_sideA',type='TH2F',title='EndCap A: ROD precision-cluster width;no.of strips;',
77  path='Overview/CSCEA/RDO',xbins=192,xmin=0.,xmax=192.,ybins=90,ymin=0.,ymax=18.)
78  cscRdoGroup.defineHistogram('raw_clus_width;h1csc_rdo_etacluswidth_signal_EA_count',cutmask='signal_measuresEta_sideA',type='TH1F',title='EndCap A: ROD precision-cluster width;width(no.of strips);entries',
79  path='Overview/CSCEA/RDO',xbins=192,xmin=0.,xmax=192.)
80  thisLabelx=getCSCLabelx("labels_occupancy_signal_EA")
81  cscRdoGroup.defineHistogram('secLayer;h1csc_rdo_etacluswidth_signal_EA_occupancy',cutmask='signal_measuresEta_sideA',type='TH1F',title='EndCap A: ROD precision-cluster width;;entries/layer',
82  path='Overview/CSCEA/RDO',xbins=90,xmin=0.,xmax=18.,xlabels=thisLabelx)
83  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_phicluswidth_signal',cutmask='signal_measuresPhi',type='TH2F',title='ROD transverse-cluster width;width(no.of strips);',
84  path='RDO/Shift',xbins=48,xmin=0,xmax=48,ybins=175,ymin=-17.,ymax=18.)
85  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_phicluswidth_signal_EC',cutmask='signal_measuresPhi_sideC',type='TH2F',title='EndCap C: ROD transverse-cluster width;width(no.of strips);[sector] + [0.2 #times layer]',
86  path='Overview/CSCEC/RDO',xbins=48,xmin=0.,xmax=48.,ybins=85,ymin=-17.,ymax=0.)
87  cscRdoGroup.defineHistogram('raw_clus_width;h1csc_rdo_phicluswidth_signal_EC_count',cutmask='signal_measuresPhi_sideC',type='TH1F',title='EndCap C: ROD transverse-cluster width;width(no.of strips);entries',
88  path='Overview/CSCEC/RDO',xbins=48,xmin=0.,xmax=48.)
89  thisLabelx=getCSCLabelx("labels_occupancy_signal_EC")
90  cscRdoGroup.defineHistogram('secLayer;h1csc_rdo_phicluswidth_signal_EC_occupancy',cutmask='signal_measuresPhi_sideC',type='TH1F',title='EndCap C: ROD transverse-cluster width;;entries/layer',
91  path='Overview/CSCEC/RDO',xbins=85,xmin=-17.,xmax=0.,xlabels=thisLabelx)
92  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_phicluswidth_signal_EA',cutmask='signal_measuresPhi_sideA',type='TH2F',title='EndCap A: ROD transverse-cluster width;width(no.of strips);[sector] + [0.2 #times layer]',
93  path='Overview/CSCEA/RDO',xbins=48,xmin=0.,xmax=48.,ybins=90,ymin=0.,ymax=18.)
94  cscRdoGroup.defineHistogram('raw_clus_width;h1csc_rdo_phicluswidth_signal_EA_count',cutmask='signal_measuresPhi_sideA',type='TH1F',title='EndCap A: ROD transverse-cluster width;width(no.of strips);entries',
95  path='Overview/CSCEA/RDO',xbins=48,xmin=0.,xmax=48.)
96  thisLabelx=getCSCLabelx("labels_occupancy_signal_EA")
97  cscRdoGroup.defineHistogram('secLayer;h1csc_rdo_phicluswidth_signal_EA_occupancy',cutmask='signal_measuresPhi_sideA',type='TH1F',title='EndCap A: ROD transverse-cluster width;;entries/layer',
98  path='Overview/CSCEA/RDO',xbins=90,xmin=0.,xmax=18.,xlabels=thisLabelx)
99  cscRdoGroup.defineHistogram('tmp_xVals_noise_mon,tmp_secLayer_noise_mon;h2csc_rdo_hitmap_noise',cutmask='isNoise',type='TH2F',title='Noise Occupancy;channel;[sector] + [0.2 #times layer]',
100  path='RDO/Expert',xbins=242,xmin=-49.,xmax=193.,ybins=175,ymin=-17.,ymax=18.)
101  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_etacluswidth_noise',cutmask='noise_measuresEta',type='TH2F',title='ROD precision-cluster width;no.of strips;[sector] + [0.2 #times layer]',
102  path='RDO/Expert',xbins=192,xmin=0.,xmax=192,ybins=175,ymin=-17.,ymax=18.)
103  cscRdoGroup.defineHistogram('raw_clus_width,secLayer;h2csc_rdo_phicluswidth_noise',cutmask='noise_measuresPhi',type='TH2F',title='ROD precision-cluster width;no.of strips;[sector] + [0.2 #times layer]',
104  path='RDO/Expert',xbins=48,xmin=0.,xmax=48,ybins=175,ymin=-17.,ymax=18.)
105  cscRdoGroup.defineHistogram('nPhiClusWidthCnt_mon,nEtaClusWidthCnt_mon;h2csc_rdo_eta_vs_phi_cluswidth',type='TH2F',title='Eta vs. Phi Cluster width correlation;#varphi-cluster width;#eta-cluster width',
106  path='RDO/Expert',xbins=100,xmin=0.,xmax=100.,ybins=100,ymin=0.,ymax=100.)
107  cscRdoGroup.defineHistogram('count_mon,secLayer_count;h2csc_rdo_phicluscount',cutmask='mphi_mon',type='TH2F',title='ROD transverse-cluster count;no.of clusters;[sector] + [0.2 #times layer]',
108  path='RDO/Expert',xbins=20,xmin=0.,xmax=20.,ybins=175,ymin=-17.,ymax=18.)
109  cscRdoGroup.defineHistogram('scount_mon,secLayer_count;h2csc_rdo_phicluscount_signal',cutmask='mphi_scount',type='TH2F',title='ROD transverse-cluster count;no.of clusters;[sector] + [0.2 #times layer]',
110  path='RDO/Shift',xbins=20,xmin=0.,xmax=20.,ybins=175,ymin=-17.,ymax=18.)
111  cscRdoGroup.defineHistogram('tmp_counts_phi_mon,secLayer_count;h2csc_rdo_phicluscount_noise',cutmask='mphi_mon',type='TH2F',title='ROD transverse-cluster count;no.of clusters;[sector] + [0.2 #times layer]',
112  path='RDO/Expert',xbins=20,xmin=0.,xmax=20.,ybins=175,ymin=-17.,ymax=18.)
113 
114  cscRdoGroup.defineHistogram('count_mon,secLayer_count;h2csc_rdo_etacluscount',cutmask='mphi_inv',type='TH2F',title='ROD precision-cluster count;no.of clusters;[sector] + [0.2 #times layer]',
115  path='RDO/Expert',xbins=20,xmin=0.,xmax=20.,ybins=175,ymin=-17.,ymax=18.)
116  cscRdoGroup.defineHistogram('scount_mon,secLayer_count;h2csc_rdo_etacluscount_signal',cutmask='mphi_inv_scount',type='TH2F',title='ROD precision-cluster count;no.of clusters;[sector] + [0.2 #times layer]',
117  path='RDO/Shift',xbins=20,xmin=0.,xmax=20.,ybins=175,ymin=-17.,ymax=18.)
118  cscRdoGroup.defineHistogram('tmp_counts_eta_mon,secLayer_count;h2csc_rdo_etacluscount_noise',cutmask='mphi_inv',type='TH2F',title='ROD precision-cluster count;no.of clusters;[sector] + [0.2 #times layer]',
119  path='RDO/Expert',xbins=20,xmin=0.,xmax=20.,ybins=175,ymin=-17.,ymax=18.)
120  cscRdoGroup.defineHistogram('numphi_mon,numeta_mon;h2csc_rdo_eta_vs_phi_cluscount',type='TH2F',title='Eta vs. Phi Cluster count correlation;#varphi-cluster count;#eta-cluster count',
121  path='RDO/Expert',xbins=100,xmin=0,xmax=100,ybins=100,ymin=0.,ymax=100.)
122  cscRdoGroup.defineHistogram('numphisignal_mon,numetasignal_mon;h2csc_rdo_eta_vs_phi_cluscount_signal',type='TH2F',title='Eta vs. Phi Signal-Cluster count correlation;#varphi-cluster count;#eta-cluster count',
123  path='RDO/Expert',xbins=100,xmin=0,xmax=100,ybins=100,ymin=0.,ymax=100.)
124  cscRdoGroup.defineHistogram('diffnumphi,diffnumeta;h2csc_rdo_eta_vs_phi_cluscount_noise',type='TH2F',title='Eta vs. Phi Noise-Cluster count correlation;#varphi-cluster count;#eta-cluster count',
125  path='RDO/Expert',xbins=100,xmin=0,xmax=100,ybins=100,ymin=0.,ymax=100.)
126 
127  acc = helper.result()
128  result.merge(acc)
129  return result
130 
131 if __name__=='__main__':
132  # Setup logs
133  from AthenaCommon.Logging import log
134  from AthenaCommon.Constants import INFO
135  log.setLevel(INFO)
136 
137  # Set the Athena configuration flags
138  from AthenaConfiguration.AllConfigFlags import initConfigFlags
139  from AthenaConfiguration.TestDefaults import defaultTestFiles
140  flags = initConfigFlags()
141  flags.Input.Files = defaultTestFiles.RAW_RUN2
142 
143  flags.Output.HISTFileName = 'CscRDOMonitorOutput.root'
144  flags.Detector.GeometryMuon=False
145  flags.Detector.GeometryCSC=True
146  flags.Detector.GeometryRPC=False
147  flags.Detector.GeometryTGC=False
148  flags.Detector.GeometryMM=False
149  flags.Detector.GeometryMDT=False
150  #flags.Muon.useAlignmentCorrections=False
151  flags.Muon.Align.UseILines = False
152  #flags.Muon.Align.UseAsBuilt = True
153  flags.Muon.Align.UseALines = False
154  flags.Muon.Align.UseBLines = False
155  flags.DQ.enableLumiAccess = True
156  flags.DQ.useTrigger = False
157  flags.DQ.Environment = 'tier0Raw'
158 
159  flags.lock()
160  flags.dump()
161 
162  # Initialize configuration object, add accumulator, merge, and run.
163  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
164  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
165  cfg = MainServicesCfg(flags)
166  cfg.merge(ByteStreamReadCfg(flags))
167 
168  from MuonConfig.MuonBytestreamDecodeConfig import CscBytestreamDecodeCfg
169  cfg.merge(CscBytestreamDecodeCfg( flags, False))
170 
171  cscMonitorAcc = CscMonitoringRAW_AlgConfig(flags)
172  cfg.merge(cscMonitorAcc)
173 
174  cfg.printConfig(withDetails=True) # set True for exhaustive info
175 
176  cfg.run(20) #use cfg.run(20) to only run on first 20 events
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
CscMonitoringRAW_Alg.CscMonitoringRAW_AlgConfig
def CscMonitoringRAW_AlgConfig(inputFlags)
Definition: CscMonitoringRAW_Alg.py:8
python.MuonBytestreamDecodeConfig.CscBytestreamDecodeCfg
def CscBytestreamDecodeCfg(flags, name="CscRawDataProvider", **kwargs)
Definition: MuonBytestreamDecodeConfig.py:182
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.MuonCSC_CnvToolsConfig.MuonCscRDODecoderCfg
def MuonCscRDODecoderCfg(flags, **kwargs)
Definition: MuonCSC_CnvToolsConfig.py:6
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
CscMonUtils.getCSCLabelx
def getCSCLabelx(x)
Definition: CscMonUtils.py:8