Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4TpcEndCapSubsystem.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4TpcEndCapSubsystem.cc
2 
6 
7 #include <phparameter/PHParameters.h>
8 
9 #include <g4detectors/PHG4DetectorSubsystem.h> // for PHG4DetectorSubsystem
10 
11 #include <g4main/PHG4DisplayAction.h> // for PHG4DisplayAction
14 
15 #include <phool/PHCompositeNode.h>
16 #include <phool/PHIODataNode.h>
17 #include <phool/PHNode.h>
18 #include <phool/PHNodeIterator.h>
19 #include <phool/PHObject.h>
20 #include <phool/getClass.h>
21 
22 //_______________________________________________________________________
24  : PHG4DetectorSubsystem(name)
25 {
26  // call base class method which will set up parameter infrastructure
27  // and call our SetDefaultParameters() method
29 }
30 
32 {
33  delete m_DisplayAction;
34 }
35 
36 //_______________________________________________________________________
38 {
39  PHNodeIterator iter(topNode);
40  PHCompositeNode *dstNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "DST"));
41 
42  // create display settings before detector (detector adds its volumes to it)
44 
45  // create detector
46  m_Detector = new PHG4TpcEndCapDetector(this, topNode, GetParams(), Name());
50 
51  if (GetParams()->get_int_param("active"))
52  {
53  PHNodeIterator dstIter(dstNode);
54  PHCompositeNode *DetNode = dstNode;
55  if (SuperDetector() != "NONE" && !SuperDetector().empty())
56  {
57  PHNodeIterator iter_dst(dstNode);
58  DetNode = dynamic_cast<PHCompositeNode *>(iter_dst.findFirst("PHCompositeNode", SuperDetector()));
59 
60  if (!DetNode)
61  {
62  DetNode = new PHCompositeNode(SuperDetector());
63  dstNode->addNode(DetNode);
64  }
65  }
66  std::string detector_suffix = SuperDetector();
67  if (detector_suffix == "NONE" || detector_suffix.empty())
68  {
69  detector_suffix = Name();
70  }
71  m_HitNodeName = "G4HIT_" + detector_suffix;
72  PHG4HitContainer *g4_hits = findNode::getClass<PHG4HitContainer>(DetNode, m_HitNodeName);
73  if (!g4_hits)
74  {
75  g4_hits = new PHG4HitContainer(m_HitNodeName);
76  DetNode->addNode(new PHIODataNode<PHObject>(g4_hits, m_HitNodeName, "PHObject"));
77  }
78  }
79  // create stepping action if detector is active
80  if (GetParams()->get_int_param("active"))
81  {
84  }
85  return 0;
86 }
87 //_______________________________________________________________________
89 {
90  // pass top node to stepping action so that it gets
91  // relevant nodes needed internally
92  if (m_SteppingAction)
93  {
95  }
96  return 0;
97 }
98 //_______________________________________________________________________
100 {
101  if (m_Detector)
102  {
103  m_Detector->Print(what);
104  }
105  return;
106 }
107 
108 //_______________________________________________________________________
110 {
111  return m_Detector;
112 }
113 
114 //_______________________________________________________________________
116 {
117  set_default_int_param("construction_verbosity", 0);
118  // sizes are in cm
119  // angles are in deg
120  // units should be converted to G4 units when used
121  //implement your own here//
122  set_default_double_param("place_x", 0.);
123  set_default_double_param("place_y", 0.);
124  set_default_double_param("place_z", 0.);
125  set_default_double_param("rot_x", 0.);
126  set_default_double_param("rot_y", 0.);
127  set_default_double_param("rot_z", 0.);
128 
129  set_default_double_param("envelop_r_min", 20.);
130  set_default_double_param("envelop_r_max", 76.27);
131  set_default_double_param("envelop_front_surface_z", 211. / 2.);
132 
133  set_default_int_param("n_GEM_layers", 4);
134 
135  const double inch_to_cm = 2.54;
136 
137  set_default_int_param("n_sectors", 12);
138  set_default_int_param("n_radial_modules", 3);
139 
140  set_default_string_param("wagon_wheel_material", "G4_Al");
141 
142  set_default_double_param("wagon_wheel_sector_phi_offset_degree", 360. / 12. / 2.);
143 
144  set_default_double_param("wagon_wheel_front_frame_thickness", inch_to_cm * .38);
145  set_default_double_param("wagon_wheel_front_frame_spoke_width", inch_to_cm * 1.12);
146 
147  set_default_double_param("wagon_wheel_front_frame_R_inner", inch_to_cm * 15.74 / 2.);
148  set_default_double_param("wagon_wheel_front_frame_R_outer", inch_to_cm * 30.7);
149 
150  set_default_double_param("wagon_wheel_front_frame_R_R1_inner", inch_to_cm * 9.81);
151  set_default_double_param("wagon_wheel_front_frame_R_R1_outer", inch_to_cm * 15.47);
152 
153  set_default_double_param("wagon_wheel_front_frame_R_R2_inner", inch_to_cm * 16.59);
154  set_default_double_param("wagon_wheel_front_frame_R_R2_outer", inch_to_cm * 22.24);
155 
156  set_default_double_param("wagon_wheel_front_frame_R_R3_inner", inch_to_cm * 23.36);
157  set_default_double_param("wagon_wheel_front_frame_R_R3_outer", inch_to_cm * 29.02);
158 
159  set_default_double_param("wagon_wheel_rim_outer_Rin", inch_to_cm * 29.58);
160  set_default_double_param("wagon_wheel_rim_outer_Rout", inch_to_cm * 60.49 / 2.);
161  set_default_double_param("wagon_wheel_rim_outer_thickness", inch_to_cm * (4.5 - .38));
162 
163  set_default_double_param("wagon_wheel_spoke_width", inch_to_cm * .36);
164  set_default_double_param("wagon_wheel_spoke_height_inner", inch_to_cm * (1.715 - .38));
165  set_default_double_param("wagon_wheel_spoke_height_outer", inch_to_cm * (4.5 - .38));
166  set_default_double_param("wagon_wheel_spoke_R_inner", inch_to_cm * 9);
167  set_default_double_param("wagon_wheel_spoke_R_outer", inch_to_cm * 29.5);
168 
169  set_default_int_param("electronics_enable", 1);
170  set_default_int_param("electronics_nFEE_R1", 6);
171  set_default_int_param("electronics_nFEE_R2", 8);
172  set_default_int_param("electronics_nFEE_R3", 12);
173 
174  // 10 layer PCB: https://indico.bnl.gov/event/8332/
175  set_default_double_param("electronics_FEE_depth", inch_to_cm * 5.57);
176  set_default_double_param("electronics_FEE_Cu_thickness", 35e-4 * 10 * .8); // 1.4mil Copper 80% filling factor
177  set_default_double_param("electronics_FEE_PCB_thickness", inch_to_cm * 0.07);
178  set_default_double_param("electronics_FEE_Al_thickness", inch_to_cm * .13);
179 
180  set_default_string_param("electronics_cooling_block_material", "G4_Al");
181  set_default_double_param("electronics_cooling_block_thickness", inch_to_cm * 3.5);
182 
183  set_default_double_param("electronics_cooling_block_R_inner", inch_to_cm * 9.26);
184  set_default_double_param("electronics_cooling_block_R_outer", inch_to_cm * 29.57);
185 
186  set_default_double_param("electronics_cooling_block_R_R1_inner", inch_to_cm * 9.81);
187  set_default_double_param("electronics_cooling_block_R_R1_outer", inch_to_cm * 15.47);
188 
189  set_default_double_param("electronics_cooling_block_R_R2_inner", inch_to_cm * 16.59);
190  set_default_double_param("electronics_cooling_block_R_R2_outer", inch_to_cm * 22.24);
191 
192  set_default_double_param("electronics_cooling_block_R_R3_inner", inch_to_cm * 23.36);
193  set_default_double_param("electronics_cooling_block_R_R3_outer", inch_to_cm * 29.02);
194 }