Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4_Pipe.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4_Pipe.C
1 
2 void PipeInit() {}
3 
4 double Pipe(PHG4Reco* g4Reco,
5  double radius,
6  const int absorberactive = 0,
7  int verbosity = 0) {
8 
9  double be_pipe_radius = 2.0005; // 4.001 cm inner diameter from spec sheet
10  double be_pipe_thickness = 0.0760; // 760 um based on spec sheet
11  double be_pipe_length = 80.0; // +/- 40 cm
12 
13  double al_pipe_radius = 2.0005; // same as Be pipe
14  double al_pipe_thickness = 0.1600; // 1.6 mm based on spec
15  double al_pipe_length = 88.3; // extension beyond +/- 40 cm
16 
17  if (radius > be_pipe_radius) {
18  cout << "inconsistency: radius: " << radius
19  << " larger than pipe inner radius: " << be_pipe_radius << endl;
20  gSystem->Exit(-1);
21  }
22 
23  gSystem->Load("libg4detectors.so");
24  gSystem->Load("libg4testbench.so");
25 
26  // mid-rapidity beryillium pipe
27  PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("VAC_BE_PIPE", 0);
28  cyl->set_double_param("radius",0.0);
29  cyl->set_int_param("lengthviarapidity",0);
30  cyl->set_double_param("length",be_pipe_length);
31  cyl->set_string_param("material","G4_Galactic");
32  cyl->set_double_param("thickness",be_pipe_radius);
33  cyl->SuperDetector("PIPE");
34  if (absorberactive) cyl->SetActive();
35  g4Reco->registerSubsystem( cyl );
36 
37  PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("BE_PIPE", 1);
38  cyl->set_double_param("radius",be_pipe_radius);
39  cyl->set_int_param("lengthviarapidity",0);
40  cyl->set_double_param("length",be_pipe_length);
41  cyl->set_string_param("material","G4_Be");
42  cyl->set_double_param("thickness",be_pipe_thickness);
43  cyl->SuperDetector("PIPE");
44  if (absorberactive) cyl->SetActive();
45  g4Reco->registerSubsystem( cyl );
46 
47  // north aluminum pipe
48  cyl = new PHG4CylinderSubsystem("VAC_N_AL_PIPE", 2);
49  cyl->set_double_param("place_z",0.5*be_pipe_length+0.5*al_pipe_length+no_overlapp);
50  cyl->set_double_param("radius",0.0);
51  cyl->set_int_param("lengthviarapidity",0);
52  cyl->set_double_param("length",al_pipe_length);
53  cyl->set_string_param("material","G4_Galactic");
54  cyl->set_double_param("thickness",al_pipe_radius);
55  cyl->SuperDetector("PIPE");
56  if (absorberactive) cyl->SetActive();
57  g4Reco->registerSubsystem( cyl );
58 
59  cyl = new PHG4CylinderSubsystem("N_AL_PIPE", 3);
60  cyl->set_double_param("place_z",0.5*be_pipe_length+0.5*al_pipe_length+no_overlapp);
61  cyl->set_double_param("radius",al_pipe_radius);
62  cyl->set_int_param("lengthviarapidity",0);
63  cyl->set_double_param("length",al_pipe_length);
64  cyl->set_string_param("material","G4_Al");
65  cyl->set_double_param("thickness",al_pipe_thickness);
66  cyl->SuperDetector("PIPE");
67  if (absorberactive) cyl->SetActive();
68  g4Reco->registerSubsystem( cyl );
69 
70  // south aluminum pipe
71  cyl = new PHG4CylinderSubsystem("VAC_S_AL_PIPE", 4);
72  cyl->set_double_param("place_z",-0.5*be_pipe_length-0.5*al_pipe_length-no_overlapp);
73  cyl->set_double_param("radius",0.0);
74  cyl->set_int_param("lengthviarapidity",0);
75  cyl->set_double_param("length",al_pipe_length);
76  cyl->set_string_param("material","G4_Galactic");
77  cyl->set_double_param("thickness",al_pipe_radius);
78  cyl->SuperDetector("PIPE");
79  if (absorberactive) cyl->SetActive();
80  g4Reco->registerSubsystem( cyl );
81 
82  cyl = new PHG4CylinderSubsystem("S_AL_PIPE", 5);
83  cyl->set_double_param("place_z",-0.5*be_pipe_length-0.5*al_pipe_length-no_overlapp);
84  cyl->set_double_param("radius",al_pipe_radius);
85  cyl->set_int_param("lengthviarapidity",0);
86  cyl->set_double_param("length",al_pipe_length);
87  cyl->set_string_param("material","G4_Al");
88  cyl->set_double_param("thickness",al_pipe_thickness);
89  cyl->SuperDetector("PIPE");
90  if (absorberactive) cyl->SetActive();
91  g4Reco->registerSubsystem( cyl );
92 
93  radius = be_pipe_radius + be_pipe_thickness;
94 
95  if (verbosity > 0) {
96  cout << "=========================== G4_Pipe.C::Pipe() =============================" << endl;
97  cout << " PIPE Material Description:" << endl;
98  cout << " inner radius = " << be_pipe_radius << " cm" << endl;
99  cout << " thickness = " << be_pipe_thickness << " cm" << endl;
100  cout << " outer radius = " << be_pipe_radius + be_pipe_thickness << " cm" << endl;
101  cout << " length = " << be_pipe_length << " cm" << endl;
102  cout << "===========================================================================" << endl;
103  }
104 
105  radius += no_overlapp;
106 
107  return radius;
108 }