Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_EGEM_EIC.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_EGEM_EIC.C
1 // $Id: G4_FGEM_ePHENIX.C,v 1.4 2013/10/13 21:45:27 jinhuang Exp $
2 
11 using namespace std;
12 
13 void
15 {
16 
17 }
18 
19 void
21 {
22  /* Careful with dimensions! If GEM station volumes overlap, e.g. with TPC volume, they will be
23  * drawn in event display but will NOT register any hits.
24  *
25  * Geometric constraints:
26  * TPC length = 211 cm --> from z = -105.5 to z = +105.5
27  */
28  make_GEM_station("EGEM_0", g4Reco, -32., -1.72, -3.4); // increase min eta from -1.6 to -1.72 to fit into barrel tracker geometry
29  make_GEM_station("EGEM_1", g4Reco, -58., -2.1, -3.98); // reduce max eta from -4.0 to -3.98 to avoid overlap with volume S_AL_PIPE_5 (aluminum beam pipe)
30  make_GEM_station("EGEM_2", g4Reco, -106., -1.2, -4.5); // move station from z = -101. to z= -106. because of increased TPC length
31 
32 }
33 
34 int
35 make_GEM_station(string name, PHG4Reco* g4Reco, double zpos, double etamin,
36  double etamax)
37 {
38 
39  // cout
40  // << "make_GEM_station - GEM construction with PHG4SectorSubsystem - make_GEM_station_EdgeReadout of "
41  // << name << endl;
42 
43  double polar_angle = 0;
44 
45  if (zpos < 0)
46  {
47  zpos = -zpos;
48  polar_angle = TMath::Pi();
49 
50  }
51  if (etamax < etamin)
52  {
53  double t = etamax;
54  etamax = etamin;
55  etamin = t;
56  }
57 
59  gem = new PHG4SectorSubsystem(name.c_str());
60 
61  gem->get_geometry().set_normal_polar_angle(polar_angle);
68  gem->get_geometry().set_material("G4_METHANE");
69  gem->get_geometry().set_N_Sector(1);
71 
74  g4Reco->registerSubsystem(gem);
75 
76 }
77 
79 
80  //---------------
81  // Load libraries
82  //---------------
83 
84  gSystem->Load("libfun4all.so");
85  gSystem->Load("libg4hough.so");
86 
87  //---------------
88  // Fun4All server
89  //---------------
90 
92 
93  PHG4TrackFastSim* kalman = new PHG4TrackFastSim("PHG4TrackFastSim");
94  kalman->Verbosity(0);
95 
96  kalman->set_use_vertex_in_fitting(true);
97  kalman->set_vertex_xy_resolution(50E-4);
98  kalman->set_vertex_z_resolution(50E-4);
99 
100  kalman->set_detector_type(PHG4TrackFastSim::Vertical_Plane); // Vertical_Plane, Cylinder
101  kalman->set_phi_resolution(50E-4);
102  kalman->set_r_resolution(1.);
103 
104  kalman->set_pat_rec_hit_finding_eff(1.);
105  kalman->set_pat_rec_noise_prob(0.);
106 
107  std::string phg4hits_names[] = {"G4HIT_EGEM_0","G4HIT_EGEM_1","G4HIT_EGEM_2"};
108  kalman->set_phg4hits_names(phg4hits_names, 3);
109  kalman->set_sub_top_node_name("SVTX");
110  kalman->set_trackmap_out_name("SvtxTrackMap_FastSimEtaMinus");
111 
112  // Saved track states (projections)
113  std::string state_names[] = {"EEMC"};
114  kalman->set_state_names(state_names, 1);
115 
116  kalman->set_fit_alg_name("KalmanFitterRefTrack");//
117  kalman->set_primary_assumption_pid(-211); // -211 = pi-
118  kalman->set_do_evt_display(false);
119 
120  se->registerSubsystem(kalman);
121 
122 }
123