Skip to content

Commit

Permalink
Merge pull request #116 from JeffersonLab/aaust_PIDstudy_dEdx
Browse files Browse the repository at this point in the history
plot correct dEdx cut for different particles
  • Loading branch information
jrstevenjlab authored Jun 5, 2020
2 parents 3a98884 + 8443e9d commit 1c9672c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions AnalysisHowTo/PIDstudy/plotPIDdataMC.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,17 @@ def GetKeyNames( self, dir = "" ):

# default dE/dx cut for plotting on 2D distribution
fMinProton_dEdx = TF1("fMinProton_dEdx", "exp(-1.*[0]*x + [1]) + [2]", 0., 10.) # cut for dEdx curve
fMinProton_dEdx.SetParameters(5.2, 3.0, 0.9)
fMinProton_dEdx.SetParameters(4.0, 2.25, 1.0)
fMinProton_dEdx.SetLineColor(2)

fMaxPion_dEdx = TF1("fMaxPion_dEdx", "exp(-1.*[0]*x + [1]) + [2]", 0., 10.) # cut for dEdx curve
fMaxPion_dEdx.SetParameters(7.0, 3.0, 6.2)
fMaxPion_dEdx.SetLineColor(2)

fMaxElectron_dEdx = TF1("fMaxElectron_dEdx", "[0]", 0., 10.) # cut for dEdx curve
fMaxElectron_dEdx.SetParameter(0,5.5)
fMaxElectron_dEdx.SetLineColor(2)


# Parser needs
## Files name and label from text input (defines canvas size and labels)
Expand All @@ -41,7 +49,7 @@ def GetKeyNames( self, dir = "" ):
# Insert your input files here for Data and MC
files = []
files.append(TFile.Open("hist_sum_30730_30788.root")) # Data
files.append(TFile.Open("hist_sum_30274_31057_sim_g4.root")) #MC
files.append(TFile.Open("hist_sum_30730_30788_sim_g4.root")) #MC

# Open file and get list of keys
f = files[0]
Expand Down Expand Up @@ -123,7 +131,12 @@ def GetKeyNames( self, dir = "" ):
h.Draw("colz")

if "CDC dE/dx" in h.GetYaxis().GetTitle():
fMinProton_dEdx.Draw("same")
if h.GetTitle() == "p":
fMinProton_dEdx.Draw("same")
elif "e^" in h.GetTitle():
fMaxElectron_dEdx.Draw("same")
else:
fMaxPion_dEdx.Draw("same")

ifile += 1
ihist += 1
Expand Down

0 comments on commit 1c9672c

Please sign in to comment.