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,
45 size_z_steel_tube = 500,
47 size_xy_scint_strip = 7,
48 size_z_scint_strip = 150,
50 radius_internal_active_zone = 93. / 2, pos_z_begin_of_active_zone_from_target_center = 80,
52 size_z_delta_between_active_zone_and_external_cover = 7,
53 radius_delta_between_active_zone_and_external_cover = 5,
55 radius_external_mother_volume =
56 radius_internal_active_zone + size_xy_scint_strip + radius_delta_between_active_zone_and_external_cover,
57 size_z_mother_volume = size_z_steel_tube,
58 pos_z_mother_volume = pos_z_begin_of_active_zone_from_target_center + size_z_scint_strip
59 + size_z_delta_between_active_zone_and_external_cover - size_z_mother_volume / 2;
62 std::string points, position, rotation;
63 points =
"0.0 0.0 0.0";
64 position =
"0.0 0.0 0.0";
65 rotation =
"1. 0. 0. 0. 1. 0. 0. 0. 1.";
69 char mothername[30] =
Form(
"%s01", detector_name);
71 Mpdshape* mother =
new Mpdshape(f, mothername,
"cave",
"TUBE",
"air", points, position, rotation, 1);
72 mother->
Fill_TUBE(size_z_mother_volume / 2, radius_external_steel_tube - thickness_steel_tube,
73 radius_external_mother_volume);
80 char steel_tube_name[30] =
Form(
"%s01steel", detector_name);
82 Mpdshape* steel_tube =
new Mpdshape(f, steel_tube_name, mothername,
"TUBE",
"steel", points, position, rotation, 1);
83 steel_tube->
Fill_TUBE(size_z_steel_tube / 2, radius_external_steel_tube - thickness_steel_tube,
84 radius_external_steel_tube);
91 char scint_strip_name[30] =
Form(
"%s01strip", detector_name);
98 new Mpdshape(f, scint_strip_name, mothername,
"BOX",
"FscScint", points, position, rotation, 1);
99 scint_strip->
Fill_BOX(size_xy_scint_strip / 2, size_xy_scint_strip / 2, size_z_scint_strip / 2);
101 coord[1] = radius_internal_active_zone + size_xy_scint_strip / 2;
102 coord[2] = pos_z_begin_of_active_zone_from_target_center + size_z_scint_strip / 2 - pos_z_mother_volume;
103 scint_strip->
SetPosition(coord[0], coord[1], coord[2]);
104 scint_strip->
SetRotation(rotm[0], rotm[1], rotm[2], rotm[3], rotm[4], rotm[5], rotm[6], rotm[7], rotm[8]);
112 for (
int i = 1;
i < number_of_scint_strips;
i++) {
115 scint_strip->
SetRotation(rotm[0], rotm[1], rotm[2], rotm[3], rotm[4], rotm[5], rotm[6], rotm[7], rotm[8]);