# Make plots for non filtered tracks # Get regular file file = TFile.Open("../runSimPlots_v2/"+fitMode[i]+"/"+config[j]+"/simPlots_"+config[j]+".root") print(file) # Grab plain DCA histograms (denominator) h1 = file.Get("oneWrong/PlanesHit"); # h1 = file.Get("oneWrong/WrongHit/PlanesHit"); print(h1) h1.SetStats(0) # Draw denominator FancyDraw1D(h1, ";Planes hit;Tracks","../images/"+fitMode[i]+"/"+config[j]+"/planesHit") # Make plots for filtered tracks for k in range(len(filters)): # Make plots for non filtered tracks # Get regular file file = TFile.Open("../runSimPlots_v2/"+fitMode[i]+"/"+config[j]+"/filteredPlots_"+filters[k]+".root") print(file) # Grab plain DCA histograms (denominator) h2 = file.Get("oneWrong/PlanesHit"); print(h2)
#fitMode = ["tracksTruthLR", "tracksMainFit", "tracksFullSeqFit"] #config = ["vacuum_2um_allTimes_noMaterial_noBinning","vacuum_2um_allTimes_noMaterial_withBinning"] # New fitMode = ["tracksMainFit"] # config = ["vacuum_2um_allTimes_noMaterial_noBinning"] config = ["nominal"] filters = ["noneWrongOneHitInView", "oneWrongSingleViewFirstLastModAllDCAs", ] for i in range(len(fitMode)): for j in range(len(config)): for k in range(len(filters)): # If not truthLR, don't use the withBinning config #if(i>0 and j>0): continue # Get file file = TFile.Open("../runSimPlots_v2/"+fitMode[i]+"/"+config[j]+"/filterPlots_"+filters[k]+".root") # file = TFile.Open("../runSimPlots_v2/"+fitMode[i]+"/simPlots_"+config[j]+".root") print(file) # Get hist hist = file.Get("nonePlusWrongPlanesHitCut/pValues") print(hist) # Make plots FancyDraw1D(hist, ";p-values;Tracks", "../images/"+fitMode[i]+"/"+config[j]+"/pValues_"+filters[k])
# Make plots for non filtered tracks # Get regular file file = TFile.Open("../runSimPlots_v2/" + fitMode[i] + "/" + config[j] + "/simPlots_" + config[j] + ".root") print(file) # No planes hit condition # No DCA condition for i_plane in range(9, 15): name = "oneWrong/WrongHits/WrongHitPos" + str(i_plane) h1 = file.Get(name) print(h1) h1.SetStats(0) FancyDraw1D( h1, ";Wrong hit position;Wrong LR hits", "../images/" + fitMode[i] + "/" + config[j] + "/wrongHitPos" + str(i_plane)) # High DCAs for i_plane in range(9, 15): name = "oneWrong/WrongHitsDCA2000/WrongHitPos" + str(i_plane) h2 = file.Get(name) print(h2) h2.SetStats(0) FancyDraw1D( h2, ";Wrong hit position;Wrong LR hits", "../images/" + fitMode[i] + "/" + config[j] + "/wrongHitPosHighDCA" + str(i_plane)) # Low DCAs for i_plane in range(9, 15): name = "oneWrong/WrongHitsDCA500/WrongHitPos" + str(i_plane) h3 = file.Get(name)
# Get regular file file = TFile.Open("../runSimPlots_v2/" + fitMode[i] + "/" + config[j] + "/simPlots_" + config[j] + ".root") print(file) # Grab plain DCA histograms (denominator) h1 = file.Get("oneWrong/DCA") print(h1) # Sort out axis h1.GetXaxis().SetRangeUser(0, 2500) # Draw denominator FancyDraw1D( h1, ";Measured DCA [#mum];Hits", "../images/" + fitMode[i] + "/" + config[j] + "/measDCAOneWrong") # Get wrong hits histograms (numerator) h2 = file.Get("oneWrong/WrongHits/DCA") # Make ratio hist ratio = Ratio(h2, h1) print(ratio) # Remove stat box for this one ratio.SetStats(0) # Sort out axis ratio.GetXaxis().SetRangeUser(0, 2500)
# Get regular file file = TFile.Open("../runSimPlots_v2/" + fitMode[i] + "/" + config[j] + "/simPlots_" + config[j] + ".root") print(file) # Grab all hits file h1 = file.Get("Pull") h2 = file.Get("WrongHits/Pull") h3 = file.Get("RightHits/Pull") print(h1) print(h2) print(h3) # Draw FancyDraw1D( h1, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullAllHits") FancyDraw1D( h2, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullWrongHits") FancyDraw1D( h3, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullRightHits") # Make plots for filtered tracks for k in range(len(filters)): # Make plots for non filtered tracks # Get regular file
h3 = file.Get("oneWrong/RightHits/Pull") # fine # 12 planes hit cut h4 = file.Get("oneWrongPlanesHitCut/Pull") # fine h5 = file.Get("oneWrongPlanesHitCut/WrongHits/Pull") # fine h6 = file.Get("oneWrongPlanesHitCut/RightHits/Pull") # fine print(h1) print(h2) print(h3) print(h4) print(h5) print(h6) # Draw FancyDraw1D( h1, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullAllHits") FancyDraw1D( h2, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullWrongHits") FancyDraw1D( h3, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullRightHits") # Draw FancyDraw1D( h4, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullAllHits12PlanesHitCut") FancyDraw1D( h5, ";Hit pull;Hits", "../images/" + fitMode[i] + "/" + config[j] + "/pullWrongHits12PlanesHitCut") FancyDraw1D(
for i in range(len(fnames)): # quality on/off files # get file file = TFile.Open("../plots/flipLR/magic/" + fnames[i]) print(file) for j in range(len(fitModes)): # fit modes for k in range(len(stations)): # stations radial = file.Get("extrapPlots" + fitModes[j] + "/vertices/" + stations[k] + "/h_radialPos") vertical = file.Get("extrapPlots" + fitModes[j] + "/vertices/" + stations[k] + "/h_verticalPos") radial.GetXaxis().SetRangeUser(-100, 100) vertical.GetXaxis().SetRangeUser(-100, 100) # print(radial) # print(vertical) # Now plot FancyDraw1D( radial, ";Radial decay position [mm];Tracks", "../images/magic/" + fitModes[j] + "/" + stations[k] + "/radialPos") FancyDraw1D( vertical, ";Vertical decay position [mm];Tracks", "../images/magic/" + fitModes[j] + "/" + stations[k] + "/vertialPos")