21void create_geom_bmnbd(
const char* filename =
"",
const char* detector_name =
"bd",
const char* version_index =
"1_0")
23 char mothername[30] =
Form(
"%s01", detector_name);
27 Filename =
Form(
"%s_v%s\.geo", detector_name, version_index);
31 f =
new ofstream(Filename.
Data(), ios::out | ios::trunc);
33 cout <<
"filename: " << Filename.
Data() << endl;
35 *f <<
"//*****************************************************" << endl;
36 *f <<
"// BD (BARREL) detector for BMN project," << endl;
37 *f <<
"// geometry version " << version_index << endl;
38 *f <<
"// generated " << __DATE__ <<
" by macro create_geom_bmnbd.C" << endl;
39 *f <<
"//*****************************************************" << endl;
41 Int_t number_of_scint_strips = 40;
44 radius_external_steel_tube = 80 / 2,
46 size_z_steel_tube = 160,
48 size_xy_scint_strip = 7,
50 size_z_scint_strip = 160,
52 radius_internal_active_zone = 93. / 2,
54 pos_z_begin_of_active_zone_from_target_center = -80,
56 size_z_delta_between_active_zone_and_external_cover = 7,
57 radius_delta_between_active_zone_and_external_cover = 5,
59 radius_external_mother_volume =
60 radius_internal_active_zone + size_xy_scint_strip + radius_delta_between_active_zone_and_external_cover,
61 size_z_mother_volume = size_z_steel_tube,
62 pos_z_mother_volume = pos_z_begin_of_active_zone_from_target_center + size_z_scint_strip
63 + size_z_delta_between_active_zone_and_external_cover - size_z_mother_volume / 2;
66 pos_z_mother_volume = -30.;
71 std::string points, position, rotation;
72 points =
"0.0 0.0 0.0";
73 position =
"0.0 0.0 0.0";
74 rotation =
"1. 0. 0. 0. 1. 0. 0. 0. 1.";
78 char mothername[30] =
Form(
"%s01", detector_name);
80 Mpdshape* mother =
new Mpdshape(f, mothername,
"cave",
"TUBE",
"air", points, position, rotation, 1);
81 mother->
Fill_TUBE(size_z_mother_volume / 2, radius_external_steel_tube - thickness_steel_tube,
82 radius_external_mother_volume);
84 mother->
SetPosition(pos_x_mother_volume, pos_y_mother_volume, pos_z_mother_volume);
90 char steel_tube_name[30] =
Form(
"%s01steel", detector_name);
92 Mpdshape* steel_tube =
new Mpdshape(f, steel_tube_name, mothername,
"TUBE",
"steel", points, position, rotation, 1);
93 steel_tube->
Fill_TUBE(size_z_steel_tube / 2, radius_external_steel_tube - thickness_steel_tube,
94 radius_external_steel_tube);
101 char scint_strip_name[30] =
Form(
"%s01strip", detector_name);
108 new Mpdshape(f, scint_strip_name, mothername,
"BOX",
"FscScint", points, position, rotation, 1);
109 scint_strip->
Fill_BOX(size_xy_scint_strip / 2, size_xy_scint_strip / 2, size_z_scint_strip / 2);
111 coord[1] = radius_internal_active_zone + size_xy_scint_strip / 2;
114 scint_strip->
SetPosition(coord[0], coord[1], coord[2]);
115 scint_strip->
SetRotation(rotm[0], rotm[1], rotm[2], rotm[3], rotm[4], rotm[5], rotm[6], rotm[7], rotm[8]);
123 for (
int i = 1;
i < number_of_scint_strips;
i++) {
126 scint_strip->
SetRotation(rotm[0], rotm[1], rotm[2], rotm[3], rotm[4], rotm[5], rotm[6], rotm[7], rotm[8]);