diff --git a/DataQuality/DataQualityUtils/data/postprocessing/LArMonPostProc.yaml b/DataQuality/DataQualityUtils/data/postprocessing/LArMonPostProc.yaml index 2f81d98af3fb770e8e6e70bdf5d273a15a714f8d..a25d27c2990503a93a4964485483785d3116b4ca 100644 --- a/DataQuality/DataQualityUtils/data/postprocessing/LArMonPostProc.yaml +++ b/DataQuality/DataQualityUtils/data/postprocessing/LArMonPostProc.yaml @@ -145,4 +145,14 @@ Output: [ 'LAr/NoiseCorrelation/FCal{side}/NoiseCorr_FCal{side}ft{ftid}slot{slot Function: LArMonitoring.LArMonTransforms.computeCorrelations Description: NoiseCorrelationMon_FCal +--- +Input: [ 'LAr/PedMonGroupNewAlg/(?P<part>EMB|EMEC|HEC|FCal)/nbOfFebBlocks_(?P=part)(?P<side>A|C)' ] +Output: [ 'LAr/MeanFeb' ] +Function: LArMonitoring.LArMonTransforms.Mean +#Parameters: { useMean : True, useRms : False, useErr: False, useErr_s: False} +Description: LAr_NbOfFebvsPartition_Mean +Input: [ 'LAr/PedMonGroupNewAlg/(?P<part>EMB|EMEC|HEC|FCal)/nbOfFebBlocks_(?P=part)(?P<side>A|C)' ] +Output: [ 'LAr/RMSFeb' ] +Function: LArMonitoring.LArMonTransforms.RMS +Description: LAr_NbOfFebvs_RMS diff --git a/LArCalorimeter/LArMonitoring/python/LArCalibPedMonAlg_REN.py b/LArCalorimeter/LArMonitoring/python/LArCalibPedMonAlg_REN.py index 3ac1fdd58c3ae64375c19558053446553e53afa7..cc81040a5a809cdc68d147ac5998c5ea3d0551a0 100644 --- a/LArCalorimeter/LArMonitoring/python/LArCalibPedMonAlg_REN.py +++ b/LArCalorimeter/LArMonitoring/python/LArCalibPedMonAlg_REN.py @@ -38,6 +38,7 @@ def LArCalibPedMonConfigCore_REN(helper,algoinstance,inputFlags,gain="",doAccDig larPedMonAlgTest.LArAccumulatedCalibDigitContainerKey=gain elif doCalibDigit: larPedMonAlgTest.LArCalibDigitContainerKey=gain + # this creates a "Group" called "PedMonGroup" which will put its histograms into the subdirectory "'/LAr/'+GroupName+'/'" GroupName="PedMonGroup" @@ -76,7 +77,7 @@ def LArCalibPedMonConfigCore_REN(helper,algoinstance,inputFlags,gain="",doAccDig xbins=lArDQGlobals.N_FEB_Parttions_Max, xmin=-0.5, xmax=lArDQGlobals.N_FEB_Parttions_Max-0.5, ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5, ylabels=lArDQGlobals.Partitions) - Group.defineHistogram('febError,part;NbOfLArFEBMonErrors_dE', + Group.defineHistogram('febError,part;NbOfFEBMonErrors_dE', title='# of data corruption errors', type='TH2I', path=summary_hist_path, @@ -93,7 +94,7 @@ def LArCalibPedMonConfigCore_REN(helper,algoinstance,inputFlags,gain="",doAccDig type='TH1I', path=summary_hist_path, xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max) - Group.defineHistogram('LB0,LArEvSize;eventSizeVsLB', + Group.defineHistogram('LB0,LArEvSize;LAreventSizeVsLB', title='LAr event size (w/o ROS headers);LBs;Megabytes', type='TProfile', path=summary_hist_path, @@ -142,9 +143,11 @@ if __name__=='__main__': from LArMonitoring.LArMonConfigFlags import createLArMonConfigFlags createLArMonConfigFlags() +#/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00395761/data21_calib.00395761.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00395761.calibration_LArElec-Pedestal-32s-High-All.daq.RAW_lb0000._SFO-2._0001.data - run="00395761" - ConfigFlags.Input.Files = ["/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00395761/data21_calib.00395761.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00395761.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-3._0001.data"] +#/eos/atlas/atlastier0/rucio/data20_calib/calibration_LArElec-Pedestal-32s-High-All/00384597/data20_calib.00384597.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data20_calib.00384597.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-2._0001.data + run="00404637" + ConfigFlags.Input.Files = ["/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00404637/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-1._0001.data"] ConfigFlags.Output.HISTFileName = 'LArCalibPedMonOutput_'+run+'.root' ConfigFlags.DQ.enableLumiAccess = False ConfigFlags.Input.isMC = False @@ -170,7 +173,7 @@ if __name__=='__main__': # If you want to turn on more detailed messages ... # LArCalibPedMonConfig_REN.getEventAlgo('larPedMonAlgTest').OutputLevel = 2 # DEBUG - cfg.printConfig(withDetails=True) #set True for exhaustive info + cfg.printConfig(withDetails=False) #set True for exhaustive info ConfigFlags.dump() f=open("LArCalibPedMon_"+run+".pkl","wb") diff --git a/LArCalorimeter/LArMonitoring/python/LArMonTransforms.py b/LArCalorimeter/LArMonitoring/python/LArMonTransforms.py index f8cbaccdb8641bd907cac97ec06614501898270b..e6d68a4d026bdd7e1e731aaefd129acaf377432c 100644 --- a/LArCalorimeter/LArMonitoring/python/LArMonTransforms.py +++ b/LArCalorimeter/LArMonitoring/python/LArMonTransforms.py @@ -10,7 +10,7 @@ # -from ROOT import TMath, TH2F +from ROOT import TMath, TH2F, TH1F, TProfile import cppyy def setMaxMin(inputs,maxVal=0,minVal=0,useMax=True,useMin=True): @@ -349,5 +349,134 @@ def computeCorrelations(inputs): return [cl] +def Mean(inputs): + cl = TProfile("summary","Summary;Partition;Mean",8,0.,8.,0.,10., "s") + cl.SetDirectory(0) + cl.GetXaxis().SetBinLabel(1,"EMBA") + cl.GetXaxis().SetBinLabel(2,"EMBC") + cl.GetXaxis().SetBinLabel(3,"EMECA") + cl.GetXaxis().SetBinLabel(4,"EMECC") + cl.GetXaxis().SetBinLabel(5,"HECA") + cl.GetXaxis().SetBinLabel(6,"HECC") + cl.GetXaxis().SetBinLabel(7,"FCalA") + cl.GetXaxis().SetBinLabel(8,"FCalC") + cl.GetXaxis().SetLabelSize(0.055) + cl.GetYaxis().SetLabelSize(0.055) + + for i in inputs: + assert len(i[1])==1, len(i[1]) + + #x bin + pr=i[0]['part'] + if "EMB" in pr: + ix=1 + elif "EMEC" in pr: + ix=3 + elif "HEC" in pr: + ix=5 + elif "FCal" in pr: + ix=7 + else: + ix=-10 + pass + if i[0]['side'] == "C": + ix=ix+1 + pass + + #y bin + if i[1][0].GetEntries()==0: + continue + else: + if ix>=0: + #filling the profile histogram for each x_bin separately + for xbin in range(0,i[1][0].GetNbinsX()): + #cl.Fill (ix-1, i[1][0].GetBinContent(xbin)) + if i[1][0].GetBinContent(xbin) > 0.: #only for non-zero bins + cl.Fill (ix-1, i[1][0].GetBinContent(xbin)) + ##mean=i[1][0].GetEntries()/float(i[1][0].GetNbinsX()) + ##pass + + ##get mean and rms from c2 histogram + #mean = c2.GetBinContent(ix) #mean of Y + #err = c2.GetBinError(ix) #(default), error of the mean of all y values + #c2.SetErrorOption("i") + #err_s = c2.GetBinError(ix) #standard error on the mean + #c2.SetErrorOption("s") + #rms = c2.GetBinError(ix) #standard deviation of Y + #pass + + #if ix>0: + #if useMean: + #cl.GetYaxis().SetLabel("Mean Events") + #mean = c2.GetBinContent(ix) #mean of Y + #cl.Fill(ix, mean, 1) + #pass + #if useRms: + #cl.GetYaxis().SetLabel("RMS") + #c2.SetErrorOption("s") + #rms = c2.GetBinError(ix) #standard deviation of Y + #cl.Fill(ix, rms, 1) + #pass + #if useErr: + #cl.GetYaxis().SetLabel("Error of the mean") + #err = c2.GetBinError(ix) #(default), error of the mean of all y values + #cl.Fill(ix, err, 1) + #pass + #if useErr_s: + #cl.GetYaxis().SetLabel("Standard error on the mean") + #c2.SetErrorOption("i") + #err_s = c2.GetBinError(ix) #standard error on the mean + #cl.Fill(ix, err_s, 1) + #pass + + pass #end of input loop + return [cl] + +def RMS(inputs): + + #cl = TH1F('Mean', 'FEBs of all partition; N_FEB', 450, 0, 450) + cl = TH2F("Mean","Mean of each partition's FEB hist;Partition;Mean",8,0.,8.,450,0,450) + cl.SetDirectory(0) + cl.GetXaxis().SetBinLabel(1,"EMBA") + cl.GetXaxis().SetBinLabel(2,"EMBC") + cl.GetXaxis().SetBinLabel(3,"EMECA") + cl.GetXaxis().SetBinLabel(4,"EMECC") + cl.GetXaxis().SetBinLabel(5,"HECA") + cl.GetXaxis().SetBinLabel(6,"HECC") + cl.GetXaxis().SetBinLabel(7,"FCalA") + cl.GetXaxis().SetBinLabel(8,"FCalC") + cl.GetXaxis().SetLabelSize(0.055) + cl.GetYaxis().SetLabelSize(0.055) + + for i in inputs: + assert len(i[1])==1, len(i[1]) + + #x bin + pr=i[0]['part'] + if "EMB" in pr: + ix=1 + elif "EMEC" in pr: + ix=3 + elif "HEC" in pr: + ix=5 + elif "FCal" in pr: + ix=7 + else: + ix=-10 + pass + if i[0]['side'] == "C": + ix=ix+1 + pass + + j = [_[1][0] for _ in inputs] # all plots passed as first element of list + + content = 0. + for plot in j: + mean=plot.GetMean() + if mean > 0.: + content = content + 1 + cl.Fill(ix, mean, content) + + return [cl]