ATLAS Offline Software
TRTMonitoringRun3RAW_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 
6  from AthenaMonitoring import AthMonitorCfgHelper
7  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9  helper = AthMonitorCfgHelper(flags, 'TRTMonitoringCfg')
10 
11  from AthenaConfiguration.ComponentFactory import CompFactory
12  algTRTMonitoringRun3RAW = helper.addAlgorithm(
13  CompFactory.TRTMonitoringRun3RAW_Alg,
14  'AlgTRTMonitoringRun3RAW',
15  ByteStreamErrors= "" if flags.Input.isMC else "TRT_ByteStreamErrs"
16  )
17 
18  # @TODO really run the TRT hole search ? Hole search still seems to use a condition service
19  from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg
20  algTRTMonitoringRun3RAW.TrackSummaryTool = rv.popToolsAndMerge(
22  from InDetConfig.TRT_TrackHoleSearchConfig import TRTTrackHoleSearchToolCfg
23  algTRTMonitoringRun3RAW.trt_hole_search= rv.popToolsAndMerge(
25 
26 
27  maxLumiBlockSummary = 3000
28  maxLumiBlockShift = 3000
29  numberOfBarrelStacks = 32
30  distToStraw = 0.4
31  numberOfStacks = (32, 32)
32  moduleNum = (96, 64)
33  iChipMax = (104, 240)
34  strawMax = (1642, 3840)
35  moduleOrWheel = ('Module', 'Wheel')
36  barrelOrEndcap = ('Barrel', 'EndCap')
37  beId = ('B', 'E')
38  sideId = ('A', 'C')
39  stackOrSector = ('Barrel Stack', 'Endcap Sector')
40  moduleNumAssign = ( 'Modules Type 1 (1-32), Type 2 (33-64), Type 3 (65-96)', 'Wheels A (1-32), B (33-64)')
41 
42  algTRTMonitoringRun3RAW.strawMax = strawMax
43  algTRTMonitoringRun3RAW.iChipMax = iChipMax
44 
45 
47  for ibe in range(2):
48  for i in range(numberOfStacks[ibe]*2):
49  rdoStackGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOStackHistograms{0}{1}'.format(ibe,i))
50  if ibe == 0:
51  if i < numberOfStacks[ibe]:
52  oss = 'TRT/Barrel/Stack' + str(i + 1) + 'A'
53  elif i >= numberOfStacks[ibe]:
54  oss = 'TRT/Barrel/Stack' + str(i + 1 - 32) + 'C'
55  elif ibe == 1:
56  if i < numberOfStacks[ibe]:
57  oss = 'TRT/EndcapA/Sector' + str(i + 1)
58  elif i >= numberOfStacks[ibe]:
59  oss = 'TRT/EndcapC/Sector' + str(i + 1 - 32)
60 
61  rdoStackGroup.defineHistogram('strawNumber,HitWMapS_passed;hHitWMapS',cutmask='HitWMapS_cut',type='TProfile',title='Leading Edge in Time Window: Straws;Straw Number in Stack;Probability per Event',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
62  rdoStackGroup.defineHistogram('strawNumber,HitTrWMapS_y;hHitTrWMapS',cutmask='HitTrWMapS_cut',type='TProfile',title='Mean Trailing Edge in Time Window: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
63  rdoStackGroup.defineHistogram('strawNumber,HitTrMapS_y;hHitTrMapS',type='TProfile',title='Mean Trailing Edge: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
64  rdoStackGroup.defineHistogram('strawNumber,HitAWMapS_passed;hHitAWMapS',cutmask='HitAWMapS_cut',type='TProfile',title='LL in Time Window: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
65  rdoStackGroup.defineHistogram('strawNumber,HitAMapS_passed;hHitAMapS',cutmask='HitAMapS_cut',type='TProfile',title='Any LL Bit: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
66  rdoStackGroup.defineHistogram('strawNumber;unscaled_hHitAMapS',cutmask='HitAMapS_cut',type='TH1F',title='Any LL Bit: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
67  rdoStackGroup.defineHistogram('strawNumber,HitToTMapS_y;hHitToTMapS',type='TProfile',title='Mean ToT: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
68  rdoStackGroup.defineHistogram('strawNumber,HitToTMapS_y;hHitToTLongMapS',cutmask='HitToTLong_cut',type='TProfile',title='Mean ToT for Straws with ToT > LongToTCut: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
69  rdoStackGroup.defineHistogram('strawNumber,HitTrMapS_y;hHitToTLongTrMapS',cutmask='HitToTLong_cut',type='TProfile',title='Mean Trailing Edge for Straws with ToT > LongToTCut: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
70  rdoStackGroup.defineHistogram('strawNumber,HitHMapS_passed;hHitHMapS',cutmask='HitHMapS_cut',type='TProfile',title='Any HL Bit: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
71  rdoStackGroup.defineHistogram('strawNumber,HitHWMapS_passed;hHitHWMapS',cutmask='HitHWMapS_cut',type='TProfile',title='HL in Time Window: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
72  rdoStackGroup.defineHistogram('HtoLMapS,HtoLMapS_passed;hHtoLMapS',type='TProfile',title='HL/LL Ratio: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
73 
74  rdoStackGroup.defineHistogram('chipNumber,HitWMapC_passed;hHitWMapC',cutmask='HitWMapC_cut',type='TProfile',title='Leading Edge in Time Window: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
75  rdoStackGroup.defineHistogram('chipNumber,HitTrMapC_y;hHitTrMapC',type='TProfile',title='Mean Trailing Edge: Chips;Chip Number in Stack;Time (ns)',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
76  rdoStackGroup.defineHistogram('chipNumber,HitTrMapC_y;hHitTrWMapC',cutmask='HitTrWMapC_cut',type='TProfile',title='Mean Trailing Edge in Time Window: Chips;Chip Number in Stack;Time (ns)',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
77  rdoStackGroup.defineHistogram('chipNumber,HitAWMapC_passed;hHitAWMapC',cutmask='HitAWMapC_cut',type='TProfile',title='LL in Time Window: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
78  rdoStackGroup.defineHistogram('chipNumber,HitAMapC_passed;hHitAMapC',cutmask='HitAMapC_cut',type='TProfile',title='Any LL Bit: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
79  rdoStackGroup.defineHistogram('chipNumber;unscaled_hHitAMapC',cutmask='HitAMapC_cut',type='TH1F',title='Any LL Bit: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
80  rdoStackGroup.defineHistogram('chipNumber,HitToTMapC_y;hHitToTMapC',type='TProfile',title='Mean ToT: Chips;Chip Number in Stack;Time (ns)',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
81  rdoStackGroup.defineHistogram('chipNumber,HitHMapC_passed;hHitHMapC',cutmask='HitHMapC_cut',type='TProfile',title='Any HL Bit: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
82  rdoStackGroup.defineHistogram('chipNumber,HitHWMapC_passed;hHitHWMapC',cutmask='HitHWMapC_cut',type='TProfile',title='HL in Time Window: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
83  rdoStackGroup.defineHistogram('HtoLMapC,HtoLMapC_passed;hHtoLMapC',type='TProfile',title='HL/LL Ratio: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
84  rdoStackGroup.defineHistogram('HtoBCMapC_x,chipNumber;hHtoBCMapC',cutmask='HtoBCMap_cut',type='TH2F',title='HL in BC: Chips;Bunch Crossing ID;Chip Number in Stack',path=oss,xbins=3,xmin=0,xmax=3,ybins=iChipMax[ibe],ymin=0,ymax=iChipMax[ibe],opt='kAlwaysCreate')
85 
86  if ibe == 0: rdoStackGroup.defineHistogram('HtoBCMapB_x,HtoBCMapB_y;hHtoBCMapB',type='TH2F',title='HL in BC: Boards;Bunch Crossing ID;Board Number in Stack',path=oss,xbins=3,xmin=0,xmax=3,ybins=9,ymin=0,ymax=9,opt='kAlwaysCreate')
87  elif ibe == 1: rdoStackGroup.defineHistogram('HtoBCMapB_x,HtoBCMapB_y;hHtoBCMapB',type='TH2F',title='HL in BC: Boards;Bunch Crossing ID;Board Number in Stack',path=oss,xbins=3,xmin=0,xmax=3,ybins=20,ymin=-0.5,ymax=19.5,opt='kAlwaysCreate')
88 
89 
90  for ibe in range(2):
91  for iside in range(2):
92  regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
93  rdoShiftSmryRebinnedGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOShiftSmryRebinnedHistograms{0}{1}'.format(ibe,iside))
94  rdoShiftSmryRebinnedGroup.defineHistogram('ChipBSErrorsVsLB_x,ChipBSErrorsVsLB_y;hChipBSErrorsVsLB_{0}{1}'.format(beId[ibe],sideId[iside]),type='TProfile',title='Chip Bytestream Errors vs LB{0};Luminosity Block;Fraction of Chips with Errors'.format(regionTag),path='TRT/Shift/Summary',xbins=maxLumiBlockSummary + 1,xmin=-0.5,xmax=maxLumiBlockSummary + 0.5,opt='kAlwaysCreate')
95  rdoShiftSmryRebinnedGroup.defineHistogram('RobBSErrorsVsLB_x,RobBSErrorsVsLB_y;hRobBSErrorsVsLB_{0}{1}'.format(beId[ibe],sideId[iside]),type='TProfile',title='Rob Bytestream Errors vs LB{0};Luminosity Block;Fraction of RODs with Errors'.format(regionTag),path='TRT/Shift/Summary',xbins=maxLumiBlockSummary + 1,xmin=-0.5,xmax=maxLumiBlockSummary + 0.5,opt='kAlwaysCreate')
96 
97  # Barrel/Endcap Histograms
98  for ibe in range(2):
99  regionTag = ' (' + barrelOrEndcap[ibe] + ')'
100  rdoGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOHistograms{0}'.format(ibe))
101  rdoGroup.defineHistogram('BCIDvsOcc_x,BCIDvsOcc_y;hBCIDvsOcc',type='TProfile',title='Avg. Occupancy vs BCID{0};Bunch Crossing ID;Occupancy'.format(regionTag),path='TRT/{0}/Expert'.format(barrelOrEndcap[ibe]),xbins=3564,xmin=0,xmax=3564,opt='kAlwaysCreate')
102  if ibe == 0:
103  rdoGroup.defineHistogram('strawNumber,HitWMap_passed;hHitWMap',cutmask='isNotAr',type='TProfile',title='Leading Edge in Time Window: Xenon Straws (Barrel);Straw Number in Stack;Probability',path='TRT/Shift/{0}'.format(str(barrelOrEndcap[ibe])),xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
104  rdoGroup.defineHistogram('strawNumber,HitWMap_Ar_passed;hHitWMap_Ar',cutmask='isAr',type='TProfile',title='Leading Edge in Time Window: Argon Straws (Barrel);Straw Number in Stack;Probability',path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
105  rdoGroup.defineHistogram('OccAll;hOccAll',type='TH1F',title='Occupancy per Event;Occupancy;Events',path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=400,xmin=0.0,xmax=1.0,opt='kAlwaysCreate')
106  elif ibe == 1:
107  for iside in range(2):
108  side = ('A', 'C')
109  rdoEndcapGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOHistograms1{0}'.format(iside))
110  rdoEndcapGroup.defineHistogram('strawNumber,HitWMap_passed;hHitWMap_{0}'.format(side[iside]),cutmask='isNotAr',type='TProfile',title='Leading Edge in Time Window: Xenon Straws (E{0});Straw Number in Stack;Probability'.format(side[iside]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
111  rdoEndcapGroup.defineHistogram('strawNumber,HitWMap_Ar_passed;hHitWMap_Ar_{0}'.format(side[iside]),cutmask='isAr',type='TProfile',title='Leading Edge in Time Window: Argon Straws (E{0});Straw Number in Stack;Probability'.format(side[iside]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
112  for iside in range(2):
113  regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
114  regionMarker = (beId[ibe] + sideId[iside]) if flags.Common.isOnline else (sideId[iside])
115  rdoLLHLOccGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOLLHLOccHistograms{0}{1}'.format(ibe,iside))
116  rdoLLHLOccGroup.defineHistogram('AvgHLOcc_side_x,AvgHLOcc_side_y;hAvgHLOcc_{0}'.format(regionMarker),type='TProfile',title='Avg. HL Occupancy{0};{1};Occupancy'.format(regionTag,stackOrSector[ibe]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=1,xmax=33,opt='kAlwaysCreate')
117  rdoLLHLOccGroup.defineHistogram('AvgLLOcc_side_x,AvgLLOcc_side_y;hAvgLLOcc_{0}'.format(regionMarker),type='TProfile',title='Avg. LL Occupancy{0};{1};Occupancy'.format(regionTag,stackOrSector[ibe]),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=1,xmax=33,opt='kAlwaysCreate')
118  rdoLLHLOccGroup.defineHistogram('AvgLLOccMod_side_x,AvgLLOccMod_side_y;hAvgLLOccMod_{0}'.format(regionMarker),type='TProfile',title='Avg. LL Occupancy: {0}s{1};{2};Occupancy'.format(moduleOrWheel[ibe],regionTag,moduleNumAssign[ibe]),path='TRT/{0}/Expert'.format(barrelOrEndcap[ibe]),xbins=moduleNum[ibe],xmin=0,xmax=moduleNum[ibe],opt='kAlwaysCreate')
119  rdoLLHLOccGroup.defineHistogram('AvgHLOccMod_side_x,AvgHLOccMod_side_y;hAvgHLOccMod_{0}'.format(regionMarker),type='TProfile',title='Avg. HL Occupancy: {0}s{1};{2};Occupancy'.format(moduleOrWheel[ibe],regionTag,moduleNumAssign[ibe]),path='TRT/{0}/Expert'.format(barrelOrEndcap[ibe]),xbins=moduleNum[ibe],xmin=0,xmax=moduleNum[ibe],opt='kAlwaysCreate')
120 
121  effGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistograms')
122  effGroup.defineHistogram('Efficiency_eta_passed,Efficiency_eta;hEfficiency_eta',type='TProfile',title='Efficiency vs #eta;#eta;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.8,xmax=2.8,opt='kAlwaysCreate')
123  effGroup.defineHistogram('Efficiency_phi_passed,Efficiency_phi;hEfficiency_phi',type='TProfile',title='Efficiency vs #phi;#phi (deg);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-3.2,xmax=3.2,opt='kAlwaysCreate')
124  effGroup.defineHistogram('Efficiency_pt_passed,Efficiency_pt;hEfficiency_pt',type='TProfile',title='Efficiency vs pT;pT (GeV);Efficiency',path='TRT/Efficiency',xbins=250,xmin=0,xmax=50,opt='kAlwaysCreate')
125  effGroup.defineHistogram('Efficiency_z0_passed,Efficiency_z0;hEfficiency_z0',type='TProfile',title='Efficiency vs z0;z0;Efficiency',path='TRT/Efficiency',xbins=50,xmin=-200,xmax=200,opt='kAlwaysCreate')
126  effGroup.defineHistogram('EfficiencyBarrel_locR,EfficiencyBarrel_locR_passed;hEfficiencyBarrel_locR',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Xenon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5,opt='kAlwaysCreate')
127  effGroup.defineHistogram('EfficiencyBarrel_locR_Ar,EfficiencyBarrel_locR_Ar_passed;hEfficiencyBarrel_locR_Ar',type='TProfile',title='Efficiency vs Track-to-Wire Distance for Argon Straws (Barrel);Track-to-Wire Distance (mm);Efficiency',path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5,opt='kAlwaysCreate')
128  effBarrelGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsBarrel')
129  effBarrelGroup.defineHistogram('EfficiencyBarrelMap,EfficiencyBarrelMap_passed;hEfficiencyBarrelMap',type='TProfile',title='Straw Efficiency Map (Barrel);Straw Number;Efficiency',path='TRT/Efficiency',xbins=strawMax[0],xmin=0,xmax=strawMax[0],opt='kAlwaysCreate')
130  effEndcapGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsEndCap')
131  effEndcapGroup.defineHistogram('EfficiencyEndCapMap,EfficiencyEndCapMap_passed;hEfficiencyEndCapMap',type='TProfile',title='Straw Efficiency Map (Endcap);Straw Number;Efficiency',path='TRT/Efficiency',xbins=strawMax[1],xmin=0,xmax=strawMax[1],opt='kAlwaysCreate')
132 
133  for iside in range(2):
134  regionTag = ' (' + beId[1] + sideId[iside] + ')'
135  effTRTEndcapACGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistogramsEndCap{0}'.format(iside))
136  effTRTEndcapACGroup.defineHistogram('EfficiencyEndCap_locR,EfficiencyEndCap_locR_passed;hEfficiencyEndCap{0}_locR'.format(sideId[iside]),type='TProfile',title='Efficiency vs Track-to-Wire Distance for Xenon Straws{0};Track-to-Wire Distance (mm);Efficiency'.format(regionTag),path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5,opt='kAlwaysCreate')
137  effTRTEndcapACGroup.defineHistogram('EfficiencyEndCap_locR_Ar,EfficiencyEndCap_locR_Ar_passed;hEfficiencyEndCap{0}_locR_Ar'.format(sideId[iside]),type='TProfile',title='Efficiency vs Track-to-Wire Distance for Argon Straws{0};Track-to-Wire Distance (mm);Efficiency'.format(regionTag),path='TRT/Efficiency',xbins=50,xmin=-2.5,xmax=2.5,opt='kAlwaysCreate')
138 
139  for ibe in range(2):
140  for iside in range(2):
141  regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
142  imintmp = numberOfBarrelStacks*iside
143  imaxtmp = numberOfBarrelStacks*(iside + 1)
144  for i in range(imintmp,imaxtmp):
145  if ibe == 0:
146  oss = 'TRT/Barrel/Stack' + str(i + 1 - 32*iside) + str(sideId[iside])
147  elif ibe == 1:
148  oss = 'TRT/Endcap' + str(sideId[iside]) + '/Sector' + str(i + 1 - 32*iside)
149  effStrawChipGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTEfficiencyHistograms{0}{1}'.format(ibe,i))
150  effStrawChipGroup.defineHistogram('EfficiencyS,EfficiencyS_passed;hHitEfficiencyS',type='TProfile',title='Straw Efficiency Map;Straw Number;Efficiency',path=oss,xbins=strawMax[ibe],xmin=0.5,xmax=strawMax[ibe],opt='kAlwaysCreate')
151  effStrawChipGroup.defineHistogram('EfficiencyC,EfficiencyC_passed;hHitEfficiencyC',type='TProfile',title='Chip Efficiency Map;Chip Number;Efficiency', path=oss,xbins=iChipMax[ibe],xmin=0.5,xmax=iChipMax[ibe],opt='kAlwaysCreate')
152 
153 
154 
155  for ibe in range(2):
156  oss_distance = distToStraw
157  distance = str(oss_distance)
158  regionTag = ' (' + barrelOrEndcap[ibe] + ')'
159  for i in range(numberOfStacks[ibe]*2):
160  trackGroup = helper.addGroup(algTRTMonitoringRun3RAW,'TRTTrackHistograms{0}{1}'.format(ibe,i))
161  nBarrelModules = 0
162  if ibe == 0:
163  if i < numberOfStacks[ibe]:
164  nBarrelModules = i + 1
165  oss = 'TRT/Barrel/Stack{0}A'.format(nBarrelModules)
166  elif i >= numberOfStacks[ibe]:
167  nBarrelModules = i + 1 - 32
168  oss = 'TRT/Barrel/Stack{0}C'.format(nBarrelModules)
169  elif ibe == 1:
170  if i < numberOfStacks[ibe]:
171  nBarrelModules = i + 1
172  oss = 'TRT/EndcapA/Sector{0}'.format(nBarrelModules)
173  elif i >= numberOfStacks[ibe]:
174  nBarrelModules = i + 1 - 32
175  oss = 'TRT/EndcapC/Sector{0}'.format(nBarrelModules)
176 
177  trackGroup.defineHistogram('HitWonTMapS;unscaled_hHitWonTMapS',type='TH1F',title='Leading Edge on Track in Time Window: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
178  trackGroup.defineHistogram('HitAonTMapS;unscaled_hHitAonTMapS',type='TH1F',title='Any LL Bit on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
179  trackGroup.defineHistogram('HitHonTMapS;unscaled_hHitHonTMapS',type='TH1F',title='HL Hit on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
180  trackGroup.defineHistogram('HitHWonTMapS;unscaled_hHitHWonTMapS',type='TH1F',title='HL Hit(In Time Window) on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
181  trackGroup.defineHistogram('HitAWonTMapS;unscaled_hHitAWonTMapS',type='TH1F',title='Any LL Bit on Track in Time Window: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
182  trackGroup.defineHistogram('EfficiencyS,EfficiencyS_passed;hEfficiencyS',type='TProfile',title='Straw Efficiency with {0} mm Cut;Straw Number in Stack;Efficiency'.format(distance),path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
183  trackGroup.defineHistogram('EfficiencyC,EfficiencyC_passed;hEfficiencyC',type='TProfile',title='Chip Efficiency with {0} mm Cut;Chip Number in Stack;Efficiency'.format(distance),path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
184  trackGroup.defineHistogram('HitWonTMapC;unscaled_hHitWonTMapC',type='TH1F',title='Leading Edge on Track in Time Window: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
185  trackGroup.defineHistogram('HitAonTMapC;unscaled_hHitAonTMapC',type='TH1F',title='Any LL Bit on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
186  trackGroup.defineHistogram('HitAWonTMapC;unscaled_hHitAWonTMapC',type='TH1F',title='Any LL Bit on Track in Time Window: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
187  trackGroup.defineHistogram('HitHonTMapC;unscaled_hHitHonTMapC',type='TH1F',title='HL Hit on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
188  trackGroup.defineHistogram('HitHWonTMapC;unscaled_hHitHWonTMapC',type='TH1F',title='HL Hit(In time Window) on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
189  trackGroup.defineHistogram('HtoLonTMapS,HtoLonTMapS_passed;hHtoLonTMapS',type='TProfile',title='HL/LL Ratio on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
190  trackGroup.defineHistogram('HtoLWonTMapS,HtoLWonTMapS_passed;hHtoLWonTMapS',type='TProfile',title='HL/LL (In Time Window) Ratio on Track: Straws;Straw Number in Stack;Probability',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],opt='kAlwaysCreate')
191  trackGroup.defineHistogram('HtoLWonTMapC,HtoLWonTMapC_passed;hHtoLWonTMapC',type='TProfile',title='HL/LL(In Time Window) Ratio on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
192  trackGroup.defineHistogram('HtoLonTMapC,HtoLonTMapC_passed;hHtoLonTMapC',type='TProfile',title='HL/LL Ratio on Track: Chips;Chip Number in Stack;Probability',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],opt='kAlwaysCreate')
193 
194  trackGroup.defineHistogram('HitTronTMapS_x,HitTronTMapS_y;hHitTronTMapS',type='TProfile',title='Mean Trailing Edge on Track: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],duration='run',opt='kAlwaysCreate')
195  trackGroup.defineHistogram('HitToTonTMapS_x,HitToTonTMapS_y;hHitToTonTMapS',type='TProfile',title='Mean ToT on Track: Straws;Straw Number in Stack;Time (ns)',path=oss,xbins=strawMax[ibe],xmin=0,xmax=strawMax[ibe],duration='run',opt='kAlwaysCreate')
196  trackGroup.defineHistogram('HitTronTMapC_x,HitTronTMapC_y;hHitTronTMapC',type='TProfile',title='Mean Trailing Edge on Track: Chips;Chip Number in Stack;Time (ns)',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],duration='run',opt='kAlwaysCreate')
197  trackGroup.defineHistogram('HitToTonTMapC_x,HitToTonTMapC_y;hHitToTonTMapC',type='TProfile',title='Chip Number in Stack;Time (ns);Chip Number in Stack;Time (ns)',path=oss,xbins=iChipMax[ibe],xmin=0,xmax=iChipMax[ibe],duration='run',opt='kAlwaysCreate')
198 
199  for ibe in range(2):
200  if ibe == 0:
201  regionTag = ' (' + barrelOrEndcap[ibe] + ')'
202  shiftTrackGroup = helper.addGroup(algTRTMonitoringRun3RAW,'ShiftTRTTrackHistograms0')
203  shiftTrackGroup.defineHistogram('HtoLRatioOnTrack_B_Ar;hHtoLRatioOnTrack_Ar',type='TH1F',title='HL/LL Ratio per Reconstructed Track for Argon{0};HL/LL Ratio;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=1,opt='kAlwaysCreate')
204  shiftTrackGroup.defineHistogram('HtoLRatioOnTrack_B_Xe;hHtoLRatioOnTrack_Xe',type='TH1F',title='HL/LL Ratio per Reconstructed Track for Xenon{0};HL/LL Ratio;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=1,opt='kAlwaysCreate')
205  shiftTrackGroup.defineHistogram('NumSwLLWoT_B;hNumSwLLWoT',type='TH1F',title='Number of Straws with Hits on Track in Time Window{0};Number of LL Hits per Track;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=150,xmin=0,xmax=150,opt='kAlwaysCreate')
206  shiftTrackGroup.defineHistogram('HLhitOnTrack_B;hHLhitOnTrack',type='TH1F',title='Number of HL Hits per Reconstructed Track{0};Number of HL Hits per Track;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=50,opt='kAlwaysCreate')
207  shiftTrackGroup.defineHistogram('HtoLRatioOnTrack_B;hHtoLRatioOnTrack',type='TH1F',title='HL/LL Ratio per Reconstructed Track for All{0};HL/LL Ratio;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=1,opt='kAlwaysCreate')
208  shiftTrackGroup.defineHistogram('strawNumber,HitWonTMap_B_y;hHitWonTMap',type='TProfile',title='Leading Edge in Time Window per Reconstructed Track{0};Straw Number;Norm. Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[0],xmin=0,xmax=strawMax[0],opt='kAlwaysCreate')
209  shiftTrackGroup.defineHistogram('StrawEffDetPhi_B_passed,StrawEffDetPhi_B;hStrawEffDetPhi',type='TProfile',title='Straw Efficiency on Track with {0} mm Cut vs #phi(2D){1};Stack;Avg. Straw Efficiency'.format(distance,regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=0,xmax=32,opt='kAlwaysCreate')
210  elif ibe == 1:
211  for iside in range(2):
212  regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
213  shiftTrackEndcapGroup = helper.addGroup(algTRTMonitoringRun3RAW,'ShiftTRTTrackHistograms1{0}'.format(iside))
214  shiftTrackEndcapGroup.defineHistogram('HtoLRatioOnTrack_E_Ar;hHtoLRatioOnTrack_Ar_{0}'.format(sideId[iside]),type='TH1F',title='HL/LL Ratio per Reconstructed Track for Argon{0};HL/LL Ratio;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=1,opt='kAlwaysCreate')
215  shiftTrackEndcapGroup.defineHistogram('HtoLRatioOnTrack_E_Xe;hHtoLRatioOnTrack_Xe_{0}'.format(sideId[iside]),type='TH1F',title='HL/LL Ratio per Reconstructed Track for Xenon{0};HL/LL Ratio;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=1,opt='kAlwaysCreate')
216  shiftTrackEndcapGroup.defineHistogram('NumSwLLWoT_E;hNumSwLLWoT_{0}'.format(sideId[iside]),type='TH1F',title='Number of Straws with Hits on Track in Time Window{0};Number of LL Hits per Track;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=150,xmin=0,xmax=150,opt='kAlwaysCreate')
217  shiftTrackEndcapGroup.defineHistogram('HLhitOnTrack_E;hHLhitOnTrack_{0}'.format(sideId[iside]),type='TH1F',title='Number of HL Hits per Reconstructed Track{0};Number of HL Hits per Track;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=50,opt='kAlwaysCreate')
218  shiftTrackEndcapGroup.defineHistogram('HtoLRatioOnTrack_E;hHtoLRatioOnTrack_{0}'.format(sideId[iside]),type='TH1F',title='HL/LL Ratio per Reconstructed Track for All{0};HL/LL Ratio;Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=50,xmin=0,xmax=1,opt='kAlwaysCreate')
219  shiftTrackEndcapGroup.defineHistogram('strawNumber,HitWonTMap_E_y;hHitWonTMap_{0}'.format(sideId[iside]),type='TProfile',title='Leading Edge in Time Window per Reconstructed Track{0};Straw Number;Norm. Entries'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=strawMax[1],xmin=0,xmax=strawMax[1],opt='kAlwaysCreate')
220  shiftTrackEndcapGroup.defineHistogram('StrawEffDetPhi_E_passed,StrawEffDetPhi_E;hStrawEffDetPhi_{0}'.format(sideId[iside]),type='TProfile',title='Straw Efficiency on Track with {0} mm Cut vs #phi(2D){1};Stack;Avg. Straw Efficiency'.format(distance,regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=32,xmin=0,xmax=32,opt='kAlwaysCreate')
221 
222 
223  for ibe in range(2):
224  regionTag = ' (' + barrelOrEndcap[ibe] + ')'
225  if ibe == 0:
226  rdoShiftRebinnedBarrelGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOShiftRebinnedBarrelHistograms0')
227  rdoShiftRebinnedBarrelGroup.defineHistogram('NHitsperLB_x,NHitsperLB_y;hNHitsperLB',type='TProfile',title='Avg. Occupancy{0};Luminosity Block;Occupancy'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=maxLumiBlockShift+1,xmin=-0.5,xmax=maxLumiBlockShift+0.5,duration='run',opt='kAlwaysCreate') #CAN_REBIN(m_hNHitsperLB_B);
228  rdoShiftRebinnedBarrelGroup.defineHistogram('NHLHitsperLB_x,NHLHitsperLB_y;hNHLHitsperLB',type='TProfile',title='Avg. HL Occupancy{0};Luminosity Block;Occupancy'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=maxLumiBlockShift+1,xmin=-0.5,xmax=maxLumiBlockShift+0.5,duration='run',opt='kAlwaysCreate') #CAN_REBIN(m_hNHLHitsperLB_B);
229  elif ibe == 1:
230  for iside in range(2):
231  regionTag = ' (' + beId[ibe] + sideId[iside] + ')'
232  rdoShiftRebinnedEndcapGroup = helper.addGroup(algTRTMonitoringRun3RAW,'RDOShiftRebinnedEndcapHistograms1{0}'.format(iside))
233  rdoShiftRebinnedEndcapGroup.defineHistogram('NHitsperLB_x,NHitsperLB_y;hNHitsperLB_{0}'.format(sideId[iside]),type='TProfile',title='Avg. Occupancy{0};Luminosity Block;Occupancy'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=maxLumiBlockShift+1,xmin=-0.5,xmax=maxLumiBlockShift+0.5,duration='run',opt='kAlwaysCreate') #CAN_REBIN(m_hNHitsperLB_E[iside]);
234  rdoShiftRebinnedEndcapGroup.defineHistogram('NHLHitsperLB_x,NHLHitsperLB_y;hNHLHitsperLB_{0}'.format(sideId[iside]),type='TProfile',title='Avg. HL Occupancy{0};Luminosity Block;Occupancy'.format(regionTag),path='TRT/Shift/{0}'.format(barrelOrEndcap[ibe]),xbins=maxLumiBlockShift+1,xmin=-0.5,xmax=maxLumiBlockShift+0.5,duration='run',opt='kAlwaysCreate') #CAN_REBIN(m_hNHLHitsperLB_E[iside]);
235 
236 
237  rv.merge(helper.result())
238  return rv
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
TRTMonitoringRun3RAW_Alg.TRTMonitoringRun3RAW_AlgConfig
def TRTMonitoringRun3RAW_AlgConfig(flags)
Definition: TRTMonitoringRun3RAW_Alg.py:5
python.TrkTrackSummaryToolConfig.InDetTrackSummaryToolCfg
def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:22
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
str
Definition: BTagTrackIpAccessor.cxx:11
python.TRT_TrackHoleSearchConfig.TRTTrackHoleSearchToolCfg
def TRTTrackHoleSearchToolCfg(flags, name="TRTTrackHoleSearchTool", **kwargs)
Definition: TRT_TrackHoleSearchConfig.py:7