def plot_ModuleLoads(MappingFile, CMSSW_Silicon, CMSSW_Scintillator): #Load external data data = loadDataFile(MappingFile) #dataframe data_tcs_passing, data_tcs_passing_scin = getTCsPassing( CMSSW_Silicon, CMSSW_Scintillator) #from CMSSW lpgbt_loads_tcs, lpgbt_loads_words, lpgbt_layers = getHexModuleLoadInfo( data, data_tcs_passing, data_tcs_passing_scin) plot(lpgbt_loads_tcs, "loads_tcs.png", binwidth=0.1, xtitle='Number of TCs on a single lpGBT') plot(lpgbt_loads_words, "loads_words.png", binwidth=0.1, xtitle='Number of words on a single lpGBT') plot2D(lpgbt_loads_tcs, lpgbt_layers, "tcs_vs_layer.png", xtitle='Number of TCs on a single lpGBT') plot2D(lpgbt_loads_words, lpgbt_layers, "words_vs_layer.png", xtitle='Number of words on a single lpGBT')
def check_for_missing_modules_inCMSSW(MappingFile, CMSSW_Silicon, CMSSW_Scintillator): #Load external data data = loadDataFile(MappingFile) #dataframe data_tcs_passing, data_tcs_passing_scin = getTCsPassing( CMSSW_Silicon, CMSSW_Scintillator) #from CMSSW getHexModuleLoadInfo(data, data_tcs_passing, data_tcs_passing_scin, True)
def check_for_missing_modules_inMappingFile(MappingFile, CMSSW_Silicon, CMSSW_Scintillator): #Check for modules missing in the mapping file #Load external data data = loadDataFile(MappingFile) #dataframe data_tcs_passing, data_tcs_passing_scin = getTCsPassing( CMSSW_Silicon, CMSSW_Scintillator) #from CMSSW mappingfile_sil = data[data['density'] < 2][['layer', 'u', 'v']] mappingfile_scin = data[data['density'] == 2][['layer', 'u', 'v']] cmssw_sil = data_tcs_passing[['u', 'v', 'layer', 'nTCs']] cmssw_scin = data_tcs_passing_scin[['u', 'v', 'layer', 'nTCs']] #onlymapping_sil = mappingfile.merge(cmssw.drop_duplicates(), on=['u','v','layer'],how='left', indicator=True) onlycmssw_sil = cmssw_sil.merge(mappingfile_sil.drop_duplicates(), on=['u', 'v', 'layer'], how='left', indicator=True) onlycmssw_scin = cmssw_scin.merge(mappingfile_scin.drop_duplicates(), on=['u', 'v', 'layer'], how='left', indicator=True) onlycmssw_sil = onlycmssw_sil[onlycmssw_sil['_merge'] == 'left_only'] onlycmssw_scin = onlycmssw_scin[onlycmssw_scin['_merge'] == 'left_only'] print("Silicon") print(onlycmssw_sil[onlycmssw_sil['nTCs'] > 0][['layer', 'u', 'v' ]].to_string(index=False)) print("Scintillator") print(onlycmssw_scin[onlycmssw_scin['nTCs'] > 0][[ 'layer', 'u', 'v' ]].to_string(index=False))