7def averageModules (suffix):
8
9 blocklist = ["LI_S01_C_M4","LI_S03_A_M4","LI_S05_C_M4","LI_S11_A_M4","LI_S12_A_M4","LI_S13_C_M4"]
10
11 indir = "/eos/atlas/user/j/jdickins/Pixel/LeakageCurrent/IBLData/processedData/means/"
12 header = ["unix-timestamp","HV_VMeas","start","intlumi","HV_VSet","volume","HV_VMeas_0","HV_VMeas_1","PP4LV","TModule","HV_IMeas","ENV_TT","I_Eg1.12","I_Eg1.21","I_Eg1.30"]
13
14 df_concat = pd.DataFrame({})
15
16 for stave in range(1,15):
17 staveString = str(stave)
18 if stave<10:
19 staveString="0"+str(stave)
20 m = "LI_S" + str(staveString) + "_" + suffix
22 this_infile = indir + m + ".ssv"
23 if m in blocklist:
24 print(m +
" is blocklisted. Skipping...")
25 continue
26
27 this_infile = indir + "LI_S" + str(staveString) + "_" + suffix + ".ssv"
28 this_df = pd.read_csv(this_infile, names=header, delimiter=',', skiprows=1)
29 df_concat = df_concat.append(this_df)
30
31 df_avg = df_concat.groupby(df_concat.index).
mean()
32 df_avg = df_avg[["intlumi","I_Eg1.12","I_Eg1.21","I_Eg1.30"]]
33
34
35
36
37 saveFileName = indir + suffix + ".ssv"
38 if os.path.exists(saveFileName):
39 os.remove(saveFileName)
40 df_avg.to_csv(saveFileName,index=False)
41
42
void print(char *figname, TCanvas *c1)
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")