-
Notifications
You must be signed in to change notification settings - Fork 3
Adding a new campaign [25.10.4] #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Simple-Shyam
wants to merge
21
commits into
master
Choose a base branch
from
tracking_benchmark
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+142
−11
Open
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
48ea753
adding new campaign
shyam1990 b137a6f
Update Snakefile
Simple-Shyam af736ba
fixing title
shyam1990 6c62287
Adding pull distribution of track parameters
shyam1990 8081af5
fixing a bug
shyam1990 1a5b181
adding a drawing macro for pulls
shyam1990 2501f2b
Update Tracking_Performances.C
Simple-Shyam db248bf
Update Tracking_Performances.C
Simple-Shyam 61e1383
Update Snakefile
Simple-Shyam ad33f5b
Update draw_Pulls.C
Simple-Shyam 845d2d3
Update Snakefile
Simple-Shyam 6e0bce1
Update draw_Pulls.C
Simple-Shyam dca23b4
Update Snakefile
Simple-Shyam 74d2145
Update Snakefile
Simple-Shyam db3412c
Update draw_Pulls.C
Simple-Shyam 125ade4
Update Snakefile
Simple-Shyam 404510e
Update Snakefile
Simple-Shyam 3ee87c4
Update Snakefile
Simple-Shyam b6c76f3
Update Snakefile
Simple-Shyam 753d663
Update Snakefile
Simple-Shyam ce5db7b
Update Snakefile
Simple-Shyam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| // Code to extract the Tracking Performances | ||
| // Shyam Kumar; INFN Bari, Italy | ||
| // [email protected]; [email protected] | ||
| // Pull distributions: https://indico.bnl.gov/event/28544/contributions/109057/attachments/62799/108633/ePIC_Tracking_Meeting_30June2025_ShyamKumar.pdf | ||
|
|
||
| #include "TGraphErrors.h" | ||
| #include "TF1.h" | ||
|
|
@@ -30,7 +31,7 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" | |
| int nfiles = 100; | ||
| double eta[nbins_eta+1]={-3.5,-2.5,-1.0,1.0,2.5,3.5}; | ||
| double pt[nbins_eta+1]={0.5,1.0,2.0,5.0,10.0,20.1}; | ||
| TH1D *histp[nbins_eta]; | ||
| TH1D *histp[nbins_eta], *hpull_invp[nbins_eta], *hpull_d0xy[nbins_eta], *hpull_d0z[nbins_eta], *hpull_phi[nbins_eta], *hpull_theta[nbins_eta]; | ||
|
|
||
| TH3D *h_d0xy_3d= new TH3D("h_d0xy_3d","Transverse Pointing Resolution",500,-0.1,0.1,70,-3.5,3.5,201,0.,20.1); | ||
| TH3D *h_d0z_3d= new TH3D("h_d0z_3d","Longitudinal Pointing Resolution",500,-0.1,0.1,70,-3.5,3.5,201,0.,20.1); | ||
|
|
@@ -39,6 +40,26 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" | |
| histp[i] = new TH1D(Form("hist_etabin%d",i),Form("hist_etabin%d",i),600,-0.3,0.3); | ||
| histp[i]->SetTitle(Form("%1.1f < #eta < %1.1f && p = %1.1f ",eta[i],eta[i+1],mom)); | ||
| histp[i]->SetName(Form("hist_mom_%1.1f_%1.1f_pmax_%1.1f",mom,eta[i],eta[i+1])); | ||
|
|
||
| hpull_invp[i] = new TH1D(Form("hpull_invp_etabin%d",i),Form("hist_etabin%d",i),100,-10.0,10.0); | ||
| hpull_invp[i]->SetTitle(Form("%1.1f < #eta < %1.1f && p = %1.1f (GeV/c);Pull (q/p);Entries (a.u.)",eta[i],eta[i+1],mom)); | ||
| hpull_invp[i]->SetName(Form("hpull_invp_%1.1f_%1.1f_pmax_%1.1f",mom,eta[i],eta[i+1])); | ||
|
|
||
| hpull_d0xy[i] = new TH1D(Form("hpull_d0xy_etabin%d",i),Form("hist_etabin%d",i),100,-10.0,10.0); | ||
| hpull_d0xy[i]->SetTitle(Form("%1.1f < #eta < %1.1f && p = %1.1f (GeV/c);Pull (d0_{xy});Entries (a.u.)",eta[i],eta[i+1],mom)); | ||
| hpull_d0xy[i]->SetName(Form("hpull_d0xy_%1.1f_%1.1f_pmax_%1.1f",mom,eta[i],eta[i+1])); | ||
|
|
||
| hpull_d0z[i] = new TH1D(Form("hpull_d0z_etabin%d",i),Form("hist_etabin%d",i),100,-10.0,10.0); | ||
| hpull_d0z[i]->SetTitle(Form("%1.1f < #eta < %1.1f && p = %1.1f (GeV/c);Pull (d0_{z});Entries (a.u.)",eta[i],eta[i+1],mom)); | ||
| hpull_d0z[i]->SetName(Form("hpull_d0z_%1.1f_%1.1f_pmax_%1.1f",mom,eta[i],eta[i+1])); | ||
|
|
||
| hpull_phi[i] = new TH1D(Form("hpull_phi_etabin%d",i),Form("hist_etabin%d",i),100,-10.0,10.0); | ||
| hpull_phi[i]->SetTitle(Form("%1.1f < #eta < %1.1f && p = %1.1f (GeV/c);Pull (#phi);Entries (a.u.)",eta[i],eta[i+1],mom)); | ||
| hpull_phi[i]->SetName(Form("hpull_phi_%1.1f_%1.1f_pmax_%1.1f",mom,eta[i],eta[i+1])); | ||
|
|
||
| hpull_theta[i] = new TH1D(Form("hpull_theta_etabin%d",i),Form("hist_etabin%d",i),100,-10.0,10.0); | ||
| hpull_theta[i]->SetTitle(Form("%1.1f < #eta < %1.1f && p = %1.1f (GeV/c);Pull (#theta);Entries (a.u.)",eta[i],eta[i+1],mom)); | ||
| hpull_theta[i]->SetName(Form("hpull_theta_%1.1f_%1.1f_pmax_%1.1f",mom,eta[i],eta[i+1])); | ||
| } | ||
|
|
||
| TFile* file = TFile::Open(filename.Data()); | ||
|
|
@@ -88,6 +109,7 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" | |
| TTreeReaderArray<Float_t> theta(myReader, Form("CentralCKF%sTrackParameters.theta",tag.Data())); | ||
| TTreeReaderArray<Float_t> phi(myReader, Form("CentralCKF%sTrackParameters.phi",tag.Data())); | ||
| TTreeReaderArray<Float_t> qoverp(myReader, Form("CentralCKF%sTrackParameters.qOverP",tag.Data())); | ||
| TTreeReaderArray<std::array<float, 21>> rcTrkCov(myReader, Form("CentralCKF%sTrackParameters.covariance.covariance[21]",tag.Data())); | ||
|
|
||
| int count =0; | ||
| int matchId = 1; // Always matched track assigned the index 0 | ||
|
|
@@ -111,9 +133,24 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" | |
|
|
||
| Double_t etamc = -1.0*TMath::Log(TMath::Tan((TMath::ACos(pzmc/fabs(pmc)))/2)); | ||
| Double_t p_resol = (prec-pmc)/pmc; | ||
| // Accessing the pull distributions | ||
| std::array<float, 21>& cov = rcTrkCov.At(j); // access covariance | ||
| Double_t pull_invmom = (fabs(1./prec)-fabs(1./pmc))/sqrt(cov[14]); // cov[14] = sigma_1/p^2 | ||
| Double_t pull_dcaxy = d0xy[j]/sqrt(cov[0]); // cov[0] = sigma_l0^2 | ||
| Double_t pull_dcaz = d0z[j]/sqrt(cov[2]); // cov[2] = sigma_l1^2 | ||
| Double_t pull_phi = (phi[j]-phi_mc)/sqrt(cov[5]); | ||
| Double_t pull_theta = (theta[j]-theta_mc)/sqrt(cov[9]); | ||
|
|
||
|
|
||
| for (int ibin=0; ibin<nbins_eta; ++ibin){ | ||
| if(etamc>eta[ibin] && etamc<eta[ibin+1]) histp[ibin]->Fill(p_resol); | ||
| if(etamc>eta[ibin] && etamc<eta[ibin+1]){ | ||
| histp[ibin]->Fill(p_resol); | ||
| hpull_invp[ibin]->Fill(pull_invmom); | ||
| hpull_d0xy[ibin]->Fill(pull_dcaxy); | ||
| hpull_d0z[ibin]->Fill(pull_dcaz); | ||
| hpull_phi[ibin]->Fill(pull_phi); | ||
| hpull_theta[ibin]->Fill(pull_theta); | ||
| } | ||
| } | ||
| h_d0xy_3d->Fill(d0xy[j]*0.1, etamc, ptmc); // cm | ||
| h_d0z_3d->Fill(d0z[j]*0.1, etamc, ptmc); // cm | ||
|
|
@@ -124,7 +161,14 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" | |
|
|
||
| TFile *fout_mom = new TFile(Form("%s/%s/mom/Performances_mom_%1.1f_%s_%s.root",dir.Data(),particle.Data(),mom,dist_dir_mom.Data(),particle.Data()),"recreate"); | ||
| fout_mom->cd(); | ||
| for (int ibin=0; ibin<nbins_eta; ++ibin) histp[ibin]->Write(); | ||
| for (int ibin=0; ibin<nbins_eta; ++ibin){ | ||
| histp[ibin]->Write(); | ||
| hpull_invp[ibin]->Write(); | ||
| hpull_d0xy[ibin]->Write(); | ||
| hpull_d0z[ibin]->Write(); | ||
| hpull_phi[ibin]->Write(); | ||
| hpull_theta[ibin]->Write(); | ||
| } | ||
| fout_mom->Close(); | ||
|
|
||
| TFile *fout_dca = new TFile(Form("%s/%s/dca/Performances_dca_%1.1f_%s_%s.root",dir.Data(),particle.Data(),mom,dist_dir_dca.Data(),particle.Data()),"recreate"); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| // Macro to draw the pulls of the track parameters | ||
| // Shyam Kumar; INFN Bari, [email protected] | ||
|
|
||
| void draw_Pulls(TString particle = "pi-", double etamin = -1.0, double etamax = 1.0){ | ||
|
|
||
| gStyle->SetPalette(kRainBow); | ||
| gStyle->SetTitleSize(0.045,"XY"); | ||
| gStyle->SetTitleSize(0.04,"XY"); | ||
| gStyle->SetLabelSize(0.04,"XY"); | ||
| gStyle->SetTitleOffset(1.0,"XY"); | ||
| gStyle->SetOptStat(1); | ||
| gStyle->SetOptFit(1); | ||
| gStyle->SetOptTitle(1); | ||
| gStyle->SetGridColor(kBlack); | ||
| gStyle->SetGridWidth(2); | ||
| gStyle->SetGridStyle(2); | ||
|
|
||
| const Int_t nfiles = 6; | ||
| double mom[nfiles] ={0.5,1.0,2.0,5.0,10.0,20.0}; | ||
| TFile *fmom_real[nfiles]; | ||
|
|
||
| for (int i =0; i<nfiles; ++i){ | ||
|
|
||
| TCanvas *can = new TCanvas("can","can",1400,1000); | ||
| can->SetMargin(0.10, 0.05 ,0.1,0.07); | ||
|
|
||
| fmom_real[i] = TFile::Open(Form("./realseed/pi-/mom/Performances_mom_%1.1f_mom_resol_realseed_%s.root",mom[i],particle.Data())); | ||
| TH1D *hpull_invp = (TH1D*) fmom_real[i]->Get(Form("hpull_invp_%1.1f_%1.1f_pmax_%1.1f",mom[i],etamin,etamax)); | ||
| TH1D *hpull_d0xy = (TH1D*) fmom_real[i]->Get(Form("hpull_d0xy_%1.1f_%1.1f_pmax_%1.1f",mom[i],etamin,etamax)); | ||
| TH1D *hpull_d0z = (TH1D*) fmom_real[i]->Get(Form("hpull_d0z_%1.1f_%1.1f_pmax_%1.1f",mom[i],etamin,etamax)); | ||
| TH1D *hpull_phi = (TH1D*) fmom_real[i]->Get(Form("hpull_phi_%1.1f_%1.1f_pmax_%1.1f",mom[i],etamin,etamax)); | ||
| TH1D *hpull_theta = (TH1D*) fmom_real[i]->Get(Form("hpull_theta_%1.1f_%1.1f_pmax_%1.1f",mom[i],etamin,etamax)); | ||
|
|
||
| can->cd(); | ||
| hpull_invp->Draw("hist") | ||
| can->SaveAs(Form("Final_Results/%s/mom/hpull_invp_%1.1f_%1.1f_pmax_%1.1f",particle.Data(),etamin,etamax,mom[i])); | ||
|
|
||
| can->Clear(); can->cd(); | ||
| hpull_d0xy->Draw("hist") | ||
| can->SaveAs(Form("Final_Results/%s/mom/hpull_d0xy_%1.1f_%1.1f_pmax_%1.1f",particle.Data(),etamin,etamax,mom[i])); | ||
|
|
||
| can->Clear(); can->cd(); | ||
| hpull_d0z->Draw("hist") | ||
| can->SaveAs(Form("Final_Results/%s/mom/hpull_d0z_%1.1f_%1.1f_pmax_%1.1f",particle.Data(),etamin,etamax,mom[i])); | ||
|
|
||
| can->Clear(); can->cd(); | ||
| hpull_phi->Draw("hist") | ||
| can->SaveAs(Form("Final_Results/%s/mom/hpull_phi_%1.1f_%1.1f_pmax_%1.1f",particle.Data(),etamin,etamax,mom[i])); | ||
|
|
||
| can->Clear(); can->cd(); | ||
| hpull_theta->Draw("hist") | ||
| can->SaveAs(Form("Final_Results/%s/mom/hpull_theta_%1.1f_%1.1f_pmax_%1.1f",particle.Data(),etamin,etamax,mom[i])); | ||
|
|
||
| } | ||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add these paths to output of tracking_performance_summary_at_eta rule and input of the tracking_performance rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I did it.