29def LArCalibPedMonConfigCore(helper,algoinstance,flags,gain="",doAccDigit=False,doCalibDigit=False,doAccCalibDigit=False):
30
31 from LArMonitoring.GlobalVariables import lArDQGlobals
32
33 larPedMonAlgTest = helper.addAlgorithm(algoinstance,'larCalibPedMonAlgTest')
34 if gain != "":
35 if doAccDigit:
36 larPedMonAlgTest.LArAccumulatedDigitContainerKey=gain
37 elif doAccCalibDigit:
38 larPedMonAlgTest.LArAccumulatedCalibDigitContainerKey=gain
39 elif doCalibDigit:
40 larPedMonAlgTest.LArCalibDigitContainerKey=gain
41
42
43 GroupName="PedMonGroup"
44
45 larPedMonAlgTest.LArPedGroupName=GroupName
46 larPedMonAlgTest.PartitionNames=lArDQGlobals.Partitions
47 larPedMonAlgTest.SubDetNames=lArDQGlobals.SubDet
48
49 Group = helper.addGroup(larPedMonAlgTest,GroupName,'/LAr/'+GroupName+'/')
50
51
52
53 summary_hist_path='Summary/'
54
55
56
57
58 Group.defineHistogram('nbChan;NbOfReadoutChannelsGlobal',
59 title='# of readout channels;Total channels for all FEB;Events',
60 type='TH1I',
61 path=summary_hist_path,
62 xbins=lArDQGlobals.N_FEB*lArDQGlobals.FEB_N_channels+5,
63 xmin=-0.5, xmax=lArDQGlobals.N_FEB*lArDQGlobals.FEB_N_channels+4.5)
64 Group.defineHistogram('nbFEB;NbOfReadoutFEBGlobal',
65 title='# of readout FEB/DSP header;N_FEB;Events',
66 type='TH1I',
67 path=summary_hist_path,
68 xbins=lArDQGlobals.N_FEB+11, xmin=-0.5, xmax=lArDQGlobals.N_FEB+10+0.5)
69 Group.defineHistogram('nbFEBpart,part;NbOfEvts2d',
70 title='# of readout FEB/DSP header;N_FEB;Partition',
71 type='TH2I',
72 path=summary_hist_path,
73 xbins=lArDQGlobals.N_FEB_Parttions_Max, xmin=-0.5, xmax=lArDQGlobals.N_FEB_Parttions_Max-0.5,
74 ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
75 ylabels=lArDQGlobals.Partitions)
76 Group.defineHistogram('febError,part;NbOfFEBMonErrors_dE',
77 title='# of data corruption errors',
78 type='TH2I',
79 path=summary_hist_path,
80 xbins=lArDQGlobals.N_FEBErrors, xmin=0.5, xmax=lArDQGlobals.N_FEBErrors+0.5,
81 ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
82 xlabels=lArDQGlobals.FEBErrors, ylabels=lArDQGlobals.Partitions)
83 Group.defineHistogram('LB0,EvtRejYield;RAW_YieldOfRejectedEventsVsLB',
84 title='Yield of corrupted events (DATACORRUPTED);LBs;Yield(%)',
85 type='TProfile',
86 path=summary_hist_path,
87 xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
88 Group.defineHistogram('LB0;NbOfEventsVsLB',
89 title='Nb of events per LB;LBs;Events',
90 type='TH1I',
91 path=summary_hist_path,
92 xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
93 Group.defineHistogram('LB0,LArEvSize;LAreventSizeVsLB',
94 title='LAr event size (w/o ROS headers);LBs;Megabytes',
95 type='TProfile',
96 path=summary_hist_path,
97 xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
98
99 for subdet in range(0,lArDQGlobals.N_SubDet):
100 hist_path='/LAr/'+GroupName+'/'+lArDQGlobals.SubDet[subdet]+'/'
101 slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
102 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
103 slot_n = int(slot_up - slot_low)
104 ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
105 ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
106 ft_n = int(ft_up - ft_low)
107
108 darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larPedMonAlgTest,lArDQGlobals.SubDet[subdet])
109
110 darray.defineHistogram('nbFEBpart;nbOfFebBlocks',
111 title='# of readout FEBs (DSP header check only);N_FEB;Events',
112 type='TH1I',
113 path=hist_path,
114 xbins=lArDQGlobals.N_FEB_Parttions_Max, xmin=-0.5, xmax=lArDQGlobals.N_FEB_Parttions_Max-0.5)
115 darray.defineHistogram('slotnb,FTnb;RAW_nbOfEvts',
116 title='Nb of events (DSP header check only);Slot;FT',
117 type='TH2I',
118 path=hist_path,
119 xbins=slot_n,xmin=slot_low,xmax=slot_up,
120 ybins=ft_n, ymin=ft_low, ymax=ft_up)
121
122 darray.defineHistogram('slotnb,FTnb;RAW_nbOfFT',
123 title='Average # of cells with (qfactor+time) readout;Slot;FT',
124 type='TProfile1D',
125 path=hist_path,
126 xbins=slot_n,xmin=slot_low,xmax=slot_up,
127 ybins=ft_n, ymin=ft_low, ymax=ft_up)
128
129