Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Trkr_Eval.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Trkr_Eval.C
1 #ifndef MACRO_TRKREVAL_C
2 #define MACRO_TRKREVAL_C
3 
4 #include <GlobalVariables.C>
5 #include <G4_TrkrVariables.C>
6 #include <Trkr_TruthTables.C>
7 #include <g4eval/SvtxEvaluator.h>
11 
12 R__LOAD_LIBRARY(libg4eval.so)
13 
14 void Tracking_Eval(const std::string& outputfile)
15 {
17 
18  //---------------
19  // Fun4All server
20  //---------------
21 
24 
25  //----------------
26  // Tracking evaluation
27  //----------------
28  SvtxEvaluator* eval;
29  eval = new SvtxEvaluator("SVTXEVALUATOR", outputfile, "SvtxTrackMap",
34  eval->do_cluster_eval(true);
35  eval->do_g4hit_eval(false);
36  eval->do_hit_eval(false); // enable to see the hits that includes the chamber physics...
37  eval->do_gpoint_eval(true);
38  eval->do_vtx_eval_light(true);
39  eval->do_eval_light(true);
40  eval->do_track_eval(true);
41  eval->do_gtrack_eval(true);
42  eval->do_track_match(true);
44  bool embed_scan = true;
45  if(TRACKING::pp_mode) embed_scan = false;
46  eval->scan_for_embedded(embed_scan); // take all tracks if false - take only embedded tracks if true
47  eval->scan_for_primaries(embed_scan); // defaults to only thrown particles for ntp_gtrack
48  std::cout << "SvtxEvaluator: pp_mode set to " << TRACKING::pp_mode << " and scan_for_embedded set to " << embed_scan << std::endl;
49  eval->Verbosity(verbosity);
50 
51  se->registerSubsystem(eval);
52 
53  return;
54 }
55 
56 void Track_Matching(const std::string& ttreefilename) {
57  TrkrClusterIsMatcher* ismatcher = new TrkrClusterIsMatcher();
58  // These are the default values -- uncomment and change as desired
59  // ismatcher->single_pixel_phi_MVTX = false ; // default to pitch*max(N_pixels_M,N_pixels_T)*tol_MVTX
60  // ismatcher->single_pixel_phi_INTT = false ; // ... same as for MVTX
61  // ismatcher->single_bin_phi_TPC = true ; // default to pitch*tol_phi_TPC
62  //
63  // ismatcher->single_pixel_z_MVTX = false ; // default to pitch*max(N_pixels_M,N_pixels_T)*tol_z_MVTX
64  // ismatcher->single_pixel_z_INTT = false ; // ... same as for MVTX
65  // ismatcher->single_bin_t_TPC = true ; // default to pitch*tol_t_TPC
66  //
67  // ismatcher-> tol_phi_MVTX = 0.5;
68  // ismatcher-> tol_phi_INTT = 0.5;
69  // ismatcher-> tol_phi_TPC = 1.0;
70 
71  // ismatcher-> tol_z_MVTX = 0.5;
72  // ismatcher-> tol_t_TPC = 1.0;
73  auto trackmatcher = new TruthRecoTrackMatching(ismatcher);
74  trackmatcher->set_min_cl_match (5); // minimum number of matched clusters to make a matched track
75  trackmatcher->set_min_cl_ratio (0.1); // at least 10% of truth clusters must be matched
76  trackmatcher->set_cutoff_deta (0.3); // won't compare tracks with |Δeta|>0.3 away
77  trackmatcher->set_cutoff_dphi (0.3); // won't compare tracks with |Δphi|>0.3 away
78  trackmatcher->set_smallsearch_deta (0.05); // will first compare tracks within this |Δphi|
79  trackmatcher->set_smallsearch_dphi (0.05); // will first compare tracks within this |Δeta|
80  trackmatcher->set_max_nreco_per_truth (4); // maximum reco tracks matched for any truth track
81  trackmatcher->set_max_ntruth_per_reco (4); // maximum truth tracks matched for any reco track
83 
85  trackmatcher->Verbosity(verbosity);
86  se->registerSubsystem(trackmatcher);
87 
89  auto treefiller = new FillClusMatchTree(ismatcher, ttreefilename);//, true, true, true, outputFile);
90  treefiller->Verbosity(verbosity);
92  treefiller->m_fill_clusters = true;
93  treefiller->m_fill_SvUnmatched = true;
94  } else {
95  treefiller->m_fill_clusters = false;
96  treefiller->m_fill_SvUnmatched = false;
97  }
98  treefiller->m_fill_clusverbose = false;
99  se->registerSubsystem(treefiller);
100  }
101 }
102 
103 #endif