diff --git a/macros/leakageCurrent/getCurrent.py b/macros/leakageCurrent/getCurrent.py index 3015224..cb33a28 100755 --- a/macros/leakageCurrent/getCurrent.py +++ b/macros/leakageCurrent/getCurrent.py @@ -7,7 +7,8 @@ import getPredictions # numbers of excluded fills due to special configuration (e.g. CCE scans) -bad_boys = [3960,3820,3478,3456,3232,3054,3109,3121,3108,3072,2797,2772,2576,2574,2564,2481,2480,2476,2472,2414,2252,2235,2083,1944,1943,1936,1932,1928,1616,1595,1554,1552,1547,1464,1463,1459,1455,1449,1436] +bad_boys = [4643,4639,4638,4518,3960,3820,3478,3456,3232,3054,3109,3121,3108,3072,2797,2772,2576,2574,2564,2481,2480,2476,2472,2414,2252,2235,2083,1944,1943,1936,1932,1928,1616,1595,1554,1552,1547,1464,1463,1459,1455,1449,1436] + # obtaining for a given sector the integrated luminosity, the time and the measured current # as an array @@ -26,6 +27,7 @@ return [lumi,time,curr] + # function to correct for the temperature -> normalisation from a temperature t1 to T = 8 degrees C (t2) # Eg: silicon energy gap in eV def tempCorr(t1,t2=8.0,Eg=1.21): @@ -35,6 +37,7 @@ t2 += kelvin return (t1/t2)**2*np.exp(-Eg/(2*kb)*(1/t2-1/t1)) + # function to apply the temperature correction for TT (i.e. two relevant temperature senssors CT5 and CT6 def corrCurrTT(time,curr,temp): i1=0 @@ -47,6 +50,7 @@ t1 = 0.5*(temp["CT5"][1][i1]+temp["CT6"][1][i2]) curr[i] *= tempCorr(t1) + # function to apply the temperature correction for IT # (taking the temperature sensor in the corresponding box) def corrCurrIT(time,curr,temp): @@ -57,14 +61,17 @@ t1 = temp[1][j] curr[i] *= tempCorr(t1) + # filter high-voltage channels according to a given layer name pattern def filterLayer(dic,expr): return dict((key,value) for key, value in dic.iteritems() if key.find(expr)>=0) + # filter high-voltage channels according to a given section/box name pattern def filterSect(dic,expr): return dict((key,value) for key, value in dic.iteritems() if key.find(expr)==len(key)-len(expr)) + # function to get the silicon volume connected to a particular value # returns 100000000000000.0 if the pattern does not match def getVolume(key): # in cm^3 @@ -130,6 +137,7 @@ mg_lumi.Add(g_lumi,"l") return [mg_time,mg_lumi] + # returns one multigraph for time and one multigraph for time for IT # filSector and filLayer are iterables representing different patterns to be selected # temp is a dictionnary of lists containing two elements, a time list and the corresponding temperature list @@ -151,6 +159,7 @@ mg_lumi.Add(g_lumi,"l") return [mg_time,mg_lumi] + # combines an iterable of graphs into a multigraph def combineMultigraph(name,graphs): mg = ROOT.TMultiGraph("mg_%s"%name,"Multigraph"); @@ -158,6 +167,7 @@ mg.Add(g) return mg + # sets the axis ranges etc. for a graph showing the current as a function of time def modifyGraphTime(mg): #mg.GetXaxis().SetLimits(1262304000,1360000000); @@ -172,6 +182,7 @@ mg.GetYaxis().SetTitleOffset(1.3); mg.GetXaxis().SetTitleOffset(1.4); + # sets the axis ranges etc. for a graph showing the current as a function of the luminosity def modifyGraphLumi(mg): mg.GetXaxis().SetLimits(0.0,3500.0);