File indexing completed on 2025-08-05 08:11:58
0001
0002 void PipeInit() {}
0003
0004 double Pipe(PHG4Reco* g4Reco,
0005 double radius,
0006 const int absorberactive = 0,
0007 int verbosity = 0) {
0008
0009 double be_pipe_radius = 2.0005;
0010 double be_pipe_thickness = 0.0760;
0011 double be_pipe_length = 80.0;
0012
0013 double al_pipe_radius = 2.0005;
0014 double al_pipe_thickness = 0.1600;
0015 double al_pipe_length = 88.3;
0016
0017 if (radius > be_pipe_radius) {
0018 cout << "inconsistency: radius: " << radius
0019 << " larger than pipe inner radius: " << be_pipe_radius << endl;
0020 gSystem->Exit(-1);
0021 }
0022
0023 gSystem->Load("libg4detectors.so");
0024 gSystem->Load("libg4testbench.so");
0025
0026
0027 PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("VAC_BE_PIPE", 0);
0028 cyl->set_double_param("radius",0.0);
0029 cyl->set_int_param("lengthviarapidity",0);
0030 cyl->set_double_param("length",be_pipe_length);
0031 cyl->set_string_param("material","G4_Galactic");
0032 cyl->set_double_param("thickness",be_pipe_radius);
0033 cyl->SuperDetector("PIPE");
0034 if (absorberactive) cyl->SetActive();
0035 g4Reco->registerSubsystem( cyl );
0036
0037 PHG4CylinderSubsystem *cyl = new PHG4CylinderSubsystem("BE_PIPE", 1);
0038 cyl->set_double_param("radius",be_pipe_radius);
0039 cyl->set_int_param("lengthviarapidity",0);
0040 cyl->set_double_param("length",be_pipe_length);
0041 cyl->set_string_param("material","G4_Be");
0042 cyl->set_double_param("thickness",be_pipe_thickness);
0043 cyl->SuperDetector("PIPE");
0044 if (absorberactive) cyl->SetActive();
0045 g4Reco->registerSubsystem( cyl );
0046
0047
0048 cyl = new PHG4CylinderSubsystem("VAC_N_AL_PIPE", 2);
0049 cyl->set_double_param("place_z",0.5*be_pipe_length+0.5*al_pipe_length+no_overlapp);
0050 cyl->set_double_param("radius",0.0);
0051 cyl->set_int_param("lengthviarapidity",0);
0052 cyl->set_double_param("length",al_pipe_length);
0053 cyl->set_string_param("material","G4_Galactic");
0054 cyl->set_double_param("thickness",al_pipe_radius);
0055 cyl->SuperDetector("PIPE");
0056 if (absorberactive) cyl->SetActive();
0057 g4Reco->registerSubsystem( cyl );
0058
0059 cyl = new PHG4CylinderSubsystem("N_AL_PIPE", 3);
0060 cyl->set_double_param("place_z",0.5*be_pipe_length+0.5*al_pipe_length+no_overlapp);
0061 cyl->set_double_param("radius",al_pipe_radius);
0062 cyl->set_int_param("lengthviarapidity",0);
0063 cyl->set_double_param("length",al_pipe_length);
0064 cyl->set_string_param("material","G4_Al");
0065 cyl->set_double_param("thickness",al_pipe_thickness);
0066 cyl->SuperDetector("PIPE");
0067 if (absorberactive) cyl->SetActive();
0068 g4Reco->registerSubsystem( cyl );
0069
0070
0071 cyl = new PHG4CylinderSubsystem("VAC_S_AL_PIPE", 4);
0072 cyl->set_double_param("place_z",-0.5*be_pipe_length-0.5*al_pipe_length-no_overlapp);
0073 cyl->set_double_param("radius",0.0);
0074 cyl->set_int_param("lengthviarapidity",0);
0075 cyl->set_double_param("length",al_pipe_length);
0076 cyl->set_string_param("material","G4_Galactic");
0077 cyl->set_double_param("thickness",al_pipe_radius);
0078 cyl->SuperDetector("PIPE");
0079 if (absorberactive) cyl->SetActive();
0080 g4Reco->registerSubsystem( cyl );
0081
0082 cyl = new PHG4CylinderSubsystem("S_AL_PIPE", 5);
0083 cyl->set_double_param("place_z",-0.5*be_pipe_length-0.5*al_pipe_length-no_overlapp);
0084 cyl->set_double_param("radius",al_pipe_radius);
0085 cyl->set_int_param("lengthviarapidity",0);
0086 cyl->set_double_param("length",al_pipe_length);
0087 cyl->set_string_param("material","G4_Al");
0088 cyl->set_double_param("thickness",al_pipe_thickness);
0089 cyl->SuperDetector("PIPE");
0090 if (absorberactive) cyl->SetActive();
0091 g4Reco->registerSubsystem( cyl );
0092
0093 radius = be_pipe_radius + be_pipe_thickness;
0094
0095 if (verbosity > 0) {
0096 cout << "=========================== G4_Pipe.C::Pipe() =============================" << endl;
0097 cout << " PIPE Material Description:" << endl;
0098 cout << " inner radius = " << be_pipe_radius << " cm" << endl;
0099 cout << " thickness = " << be_pipe_thickness << " cm" << endl;
0100 cout << " outer radius = " << be_pipe_radius + be_pipe_thickness << " cm" << endl;
0101 cout << " length = " << be_pipe_length << " cm" << endl;
0102 cout << "===========================================================================" << endl;
0103 }
0104
0105 radius += no_overlapp;
0106
0107 return radius;
0108 }