Skip to content
Snippets Groups Projects
Unverified Commit 6f1fa818 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

tracking_performances: adapt to upcoming naming change for truth/real seeding...

tracking_performances: adapt to upcoming naming change for truth/real seeding collection names (#50)
parent f1b8dd22
Branches
Tags
No related merge requests found
...@@ -42,7 +42,7 @@ rule tracking_performance_recon: ...@@ -42,7 +42,7 @@ rule tracking_performance_recon:
set -m # monitor mode to prevent lingering processes set -m # monitor mode to prevent lingering processes
exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \ exec env DETECTOR_CONFIG={wildcards.DETECTOR_CONFIG} \
eicrecon {input} -Ppodio:output_file={output} \ eicrecon {input} -Ppodio:output_file={output} \
-Ppodio:output_collections=MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralTrackVertices -Ppodio:output_collections=MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralCKFTruthSeededTrackParameters,CentralTrackVertices
""" """
...@@ -73,13 +73,13 @@ rule tracking_performance_at_momentum: ...@@ -73,13 +73,13 @@ rule tracking_performance_at_momentum:
shell: shell:
""" """
if [[ "{wildcards.SEEDING}" == "truthseed" ]]; then if [[ "{wildcards.SEEDING}" == "truthseed" ]]; then
SEEDING="" TRUTH_SEEDING="true"
elif [[ "{wildcards.SEEDING}" == "realseed" ]]; then elif [[ "{wildcards.SEEDING}" == "realseed" ]]; then
SEEDING="Seeded" TRUTH_SEEDING="false"
fi fi
hadd {output.combined_root} {input.sim} hadd {output.combined_root} {input.sim}
cd {wildcards.CAMPAIGN} cd {wildcards.CAMPAIGN}
root -l -b -q ../{input.script}'("../{output.combined_root}", "{wildcards.PARTICLE}", {wildcards.MOMENTUM}, 0.15, "'$SEEDING'")' root -l -b -q ../{input.script}'("../{output.combined_root}", "{wildcards.PARTICLE}", {wildcards.MOMENTUM}, 0.15, '$TRUTH_SEEDING')'
""" """
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "TMath.h" #include "TMath.h"
#define mpi 0.139 // 1.864 GeV/c^2 #define mpi 0.139 // 1.864 GeV/c^2
void Tracking_Performances(TString filename="tracking_output",TString particle="pi-", double mom=0.1, Double_t pTcut = 0.15, TString name = "") void Tracking_Performances(TString filename="tracking_output",TString particle="pi-", double mom=0.1, Double_t pTcut = 0.15, bool truth_seeding=false)
{ {
// style of the plot // style of the plot
...@@ -23,11 +23,6 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" ...@@ -23,11 +23,6 @@ void Tracking_Performances(TString filename="tracking_output",TString particle="
gStyle->SetOptFit(1); gStyle->SetOptFit(1);
gStyle->SetOptStat(1); gStyle->SetOptStat(1);
TString dir = "";
TString dist_dir_mom = ""; TString dist_dir_dca = "";
if (name=="") {dist_dir_mom = "mom_resol_truth"; dist_dir_dca = "dca_resol_truth"; dir = "truthseed";}
else {dist_dir_mom = "mom_resol_realseed"; dist_dir_dca = "dca_resol_realseed"; dir = "realseed";}
bool debug=true; bool debug=true;
// Tree with reconstructed tracks // Tree with reconstructed tracks
const int nbins_eta = 5; const int nbins_eta = 5;
...@@ -51,6 +46,32 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" ...@@ -51,6 +46,32 @@ void Tracking_Performances(TString filename="tracking_output",TString particle="
TTreeReader myReader("events", file); // name of tree and file TTreeReader myReader("events", file); // name of tree and file
if (debug) cout<<"Filename: "<<file->GetName()<<"\t NEvents: "<<myReader.GetEntries()<<endl; if (debug) cout<<"Filename: "<<file->GetName()<<"\t NEvents: "<<myReader.GetEntries()<<endl;
TTree *tree = dynamic_cast<TTree*>(file->Get("events"));
if (!(tree->GetBranch("CentralCKFSeededTrackParameters") || tree->GetBranch("CentralCKFTruthSeededTrackParameters"))) {
cerr << "Found neither CentralCKFSeededTrackParameters nor CentralCKFTruthSeededTrackParameters!" << endl;
return;
}
bool is_old_style = tree->GetBranch("CentralCKFSeededTrackParameters");
TString dir = "";
TString dist_dir_mom = ""; TString dist_dir_dca = "";
TString tag = "";
if (truth_seeding) {
dist_dir_mom = "mom_resol_truth"; dist_dir_dca = "dca_resol_truth"; dir = "truthseed";
if (is_old_style) {
tag = "";
} else {
tag = "TruthSeeded";
}
} else {
dist_dir_mom = "mom_resol_realseed"; dist_dir_dca = "dca_resol_realseed"; dir = "realseed";
if (is_old_style) {
tag = "Seeded";
} else {
tag = "";
}
}
// MC and Reco information // MC and Reco information
TTreeReaderArray<Float_t> charge(myReader, "MCParticles.charge"); TTreeReaderArray<Float_t> charge(myReader, "MCParticles.charge");
TTreeReaderArray<Double_t> vx_mc(myReader, "MCParticles.vertex.x"); TTreeReaderArray<Double_t> vx_mc(myReader, "MCParticles.vertex.x");
...@@ -61,12 +82,12 @@ void Tracking_Performances(TString filename="tracking_output",TString particle=" ...@@ -61,12 +82,12 @@ void Tracking_Performances(TString filename="tracking_output",TString particle="
TTreeReaderArray<Float_t> pz_mc(myReader, "MCParticles.momentum.z"); TTreeReaderArray<Float_t> pz_mc(myReader, "MCParticles.momentum.z");
TTreeReaderArray<Int_t> status(myReader, "MCParticles.generatorStatus"); TTreeReaderArray<Int_t> status(myReader, "MCParticles.generatorStatus");
TTreeReaderArray<Int_t> pdg(myReader, "MCParticles.PDG"); TTreeReaderArray<Int_t> pdg(myReader, "MCParticles.PDG");
TTreeReaderArray<Int_t> match_flag(myReader, Form("CentralCKF%sTrackParameters.type",name.Data())); TTreeReaderArray<Int_t> match_flag(myReader, Form("CentralCKF%sTrackParameters.type",tag.Data()));
TTreeReaderArray<Float_t> d0xy(myReader, Form("CentralCKF%sTrackParameters.loc.a",name.Data())); TTreeReaderArray<Float_t> d0xy(myReader, Form("CentralCKF%sTrackParameters.loc.a",tag.Data()));
TTreeReaderArray<Float_t> d0z(myReader, Form("CentralCKF%sTrackParameters.loc.b",name.Data())); TTreeReaderArray<Float_t> d0z(myReader, Form("CentralCKF%sTrackParameters.loc.b",tag.Data()));
TTreeReaderArray<Float_t> theta(myReader, Form("CentralCKF%sTrackParameters.theta",name.Data())); TTreeReaderArray<Float_t> theta(myReader, Form("CentralCKF%sTrackParameters.theta",tag.Data()));
TTreeReaderArray<Float_t> phi(myReader, Form("CentralCKF%sTrackParameters.phi",name.Data())); TTreeReaderArray<Float_t> phi(myReader, Form("CentralCKF%sTrackParameters.phi",tag.Data()));
TTreeReaderArray<Float_t> qoverp(myReader, Form("CentralCKF%sTrackParameters.qOverP",name.Data())); TTreeReaderArray<Float_t> qoverp(myReader, Form("CentralCKF%sTrackParameters.qOverP",tag.Data()));
int count =0; int count =0;
int matchId = 1; // Always matched track assigned the index 0 int matchId = 1; // Always matched track assigned the index 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment