EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Tracking_JLeic.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Tracking_JLeic.C
1 #ifndef MACRO_G4TRACKINGJLEIC_C
2 #define MACRO_G4TRACKINGJLEIC_C
3 
4 #include <GlobalVariables.C>
5 
6 #include <G4_VTX_JLeic.C>
7 
9 
10 #include <g4eval/SvtxEvaluator.h>
11 
14 
15 R__LOAD_LIBRARY(libg4eval.so)
16 R__LOAD_LIBRARY(libg4trackfastsim.so)
17 
18 namespace Enable
19 {
20  bool TRACKING = false;
21  bool TRACKING_EVAL = false;
22  int TRACKING_VERBOSITY = 0;
23 } // namespace Enable
24 
25 namespace G4TRACKING
26 {
27  bool DISPLACED_VERTEX = false;
28  bool PROJECTION_JLDIRC = false;
29 } // namespace G4TRACKING
30 
31 //-----------------------------------------------------------------------------//
33 {
34  TRACKING::TrackNodeName = "TrackMap";
35 }
36 
38 {
40 
41  //---------------
42  // Fun4All server
43  //---------------
44 
46 
47  PHG4TrackFastSim *kalman = new PHG4TrackFastSim("PHG4TrackFastSim");
48  kalman->Verbosity(verbosity);
49 
51  {
52  // do not use truth vertex in the track fitting,
53  // which would lead to worse momentum resolution for prompt tracks
54  // but this allows displaced track analysis including DCA and vertex finding
55  kalman->set_use_vertex_in_fitting(false);
56  kalman->set_vertex_xy_resolution(0); // do not smear the vertex used in the built-in DCA calculation
57  kalman->set_vertex_z_resolution(0); // do not smear the vertex used in the built-in DCA calculation
58  kalman->enable_vertexing(true); // enable vertex finding and fitting
59  }
60  else
61  {
62  // constraint to a primary vertex and use it as part of the fitting level arm
63  kalman->set_use_vertex_in_fitting(true);
64  kalman->set_vertex_xy_resolution(50e-4);
65  kalman->set_vertex_z_resolution(50e-4);
66  }
67 
68  kalman->set_sub_top_node_name("TRACKS");
70 
71  // VTX
72  if (Enable::VTX)
73  {
74  kalman->add_phg4hits(
75  "G4HIT_JLVTX", // const std::string& phg4hitsNames,
76  PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
77  20e-4, // const float radres,
78  20e-4, // const float phires,
79  20e-4, // const float lonres,
80  1, // const float eff,
81  0 // const float noise
82  );
83  }
84  // CTD
85  if (Enable::CTD)
86  {
87  kalman->add_phg4hits(
88  "G4HIT_JLCTD", // const std::string& phg4hitsNames,
89  PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
90  5e-2, // const float radres,
91  5e-2, // const float phires,
92  5e-2, // const float lonres,
93  1, // const float eff,
94  0 // const float noise
95  );
96  }
97  //
98  // GEM0, 70um azimuthal resolution, 1cm radial strips
99  if (Enable::GEM)
100  {
101  kalman->add_phg4hits(
102  "G4HIT_GEMHADRON", // const std::string& phg4hitsNames,
103  PHG4TrackFastSim::Vertical_Plane, // const DETECTOR_TYPE phg4dettype,
104  1. / sqrt(12.), // const float radres,
105  70e-4, // const float phires,
106  100e-4, // const float lonres,
107  1, // const float eff,
108  0 // const float noise
109  );
110  }
111 
112  se->registerSubsystem(kalman);
113 
114  return;
115 }
116 
117 void Tracking_Eval(std::string const &outputfile)
118 {
120 
121  //---------------
122  // Fun4All server
123  //---------------
124 
126 
127  //----------------
128  // Fast Tracking evaluation
129  //----------------
130 
131  PHG4TrackFastSimEval *fast_sim_eval = new PHG4TrackFastSimEval("FastTrackingEval");
133  fast_sim_eval->set_filename(outputfile);
134  se->registerSubsystem(fast_sim_eval);
135 }
136 
137 #endif // MACRO_G4TRACKINGJLEIC_C