126void create_geom_bmnzdc(
const char* filename =
"",
const char* detector_name =
"zdc",
int version = 1)
128 TString mappingFile =
"ZDC_map_Mar08.txt";
133 x_fullwidth_mother = 1650.,
134 y_fullwidth_mother = 1056.,
135 z_fullwidth_mother = 1450.,
137 z_fullwidth_box = 1190.,
141 xy_fullwidth_big_box = 150.,
142 xy_fullwidth_small_box = 75.,
144 x_fullwidth_big_plate =
145 xy_fullwidth_big_box - 2 * thickness_box,
146 y_fullwidth_big_plate = x_fullwidth_big_plate - 4,
147 x_fullwidth_small_plate =
148 xy_fullwidth_small_box - 2 * thickness_box,
149 y_fullwidth_small_plate = x_fullwidth_small_plate - 4,
156 Int_t number_of_layers_along_Z = 64;
158 Int_t nlayers = number_of_layers_along_Z;
165 if (!strlen(filename)) {
167 sprintf(filename1,
"%s_%dmodules_%dlayers_v%d\.geo", detector_name,
n_rec, number_of_layers_along_Z, version);
168 f =
new ofstream(filename1, ios::out | ios::trunc);
169 cout <<
"filename: " << filename1 << endl;
171 f =
new ofstream(filename, ios::out | ios::trunc);
172 cout <<
"filename: " << filename << endl;
176 std::ostringstream points, position, rotation;
177 points.setf(ios::showpoint);
178 position.setf(ios::showpoint);
179 position.setf(ios::fixed);
180 position << setprecision(6);
181 rotation.setf(ios::showpoint);
182 rotation.setf(ios::fixed);
183 rotation << setprecision(6);
187 char mothername[30] =
Form(
"%s01", detector_name);
189 *f <<
"//*****************************************************" << endl;
190 *f <<
"// ZDC detector for BMN project," << endl;
191 *f <<
"// geometry version 1" << endl;
192 *f <<
"// created 19-11-2015 by E.I.Litvinenko" << endl;
193 *f <<
"//*****************************************************" << endl;
197 Mpdshape* detmother =
new Mpdshape(f, mothername,
"cave",
"BOX",
"air", points.str(), position.str());
201 detmother->
SetPosition(0., 0., initDist + z_fullwidth_mother / 2);
202 detmother->
SetRotation(
" 1. 0. 0. 0. 1. 0. 0. 0. 1.");
209 char boxnames[30] =
Form(
"%s01boxs", detector_name);
214 Mpdshape* detmoduleboxs =
new Mpdshape(f, boxnames, mothername,
"BOX",
"steel", points.str(), position.str());
221 char boxnameb[30] =
Form(
"%s01boxb", detector_name);
226 Mpdshape* detmoduleboxb =
new Mpdshape(f, boxnameb, mothername,
"BOX",
"steel", points.str(), position.str());
233 char modulenames[30] =
Form(
"%s01ms", detector_name);
238 Mpdshape* detmodules =
new Mpdshape(f, modulenames, boxnames,
"BOX",
"air", points.str(), position.str());
246 char modulenameb[30] =
Form(
"%s01mb", detector_name);
251 Mpdshape* detmoduleb =
new Mpdshape(f, modulenameb, boxnameb,
"BOX",
"air", points.str(), position.str());
259 char absorber_names[30] =
Form(
"%s01as", detector_name);
260 char scintillator_names[30] =
Form(
"%s01ss", detector_name);
261 char absorber_nameb[30] =
Form(
"%s01ab", detector_name);
262 char scintillator_nameb[30] =
Form(
"%s01sb", detector_name);
264 Mpdshape *detlayer_abss = 0, *detlayer_scis = 0;
265 Mpdshape *detlayer_absb = 0, *detlayer_scib = 0;
268 Int_t imodule, jmodule;
270 char module_rotation[30] =
"1. 0. 0. 0. 1. 0. 0. 0. 1.";
272 Bool_t first_small = 1, first_large = 1;
274 for (imodule = 0; imodule <
n_rec; imodule++) {
279 detmoduleboxs->
SetPosition(xm, ym, (z_fullwidth_box - z_fullwidth_mother - 2) / 2);
283 for (
int ilayer = 0; ilayer < nlayers; ilayer++) {
289 new Mpdshape(f, absorber_names, modulenames,
"BOX",
"lead", points.str(), position.str());
295 detlayer_scis =
new Mpdshape(f, scintillator_names, modulenames,
"BOX",
"polystyrene",
296 points.str(), position.str());
297 detlayer_scis->SetSegment(1);
301 -z_fullwidth_box / 2 + zWidthA * 0.5 + (zWidthA + zWidthS) * ilayer);
302 detlayer_abss->
SetRotation(
" 1. 0. 0. 0. 1. 0. 0. 0. 1.");
304 detlayer_scis->SetPosition(
305 0., 0., -z_fullwidth_box / 2 + zWidthA + zWidthS * 0.5 + (zWidthA + zWidthS) * ilayer);
306 detlayer_scis->SetRotation(
" 1. 0. 0. 0. 1. 0. 0. 0. 1.");
307 detlayer_scis->DumpWithIncrement();
312 detmoduleboxb->
SetPosition(xm, ym, (z_fullwidth_box - z_fullwidth_mother - 2) / 2);
316 for (
int ilayer = 0; ilayer < nlayers; ilayer++) {
322 new Mpdshape(f, absorber_nameb, modulenameb,
"BOX",
"lead", points.str(), position.str());
328 detlayer_scib =
new Mpdshape(f, scintillator_nameb, modulenameb,
"BOX",
"polystyrene",
329 points.str(), position.str());
330 detlayer_scib->SetSegment(1);
334 -z_fullwidth_box / 2 + zWidthA * 0.5 + (zWidthA + zWidthS) * ilayer);
335 detlayer_absb->
SetRotation(
" 1. 0. 0. 0. 1. 0. 0. 0. 1.");
337 detlayer_scib->SetPosition(
338 0., 0., -z_fullwidth_box / 2 + zWidthA + zWidthS * 0.5 + (zWidthA + zWidthS) * ilayer);
339 detlayer_scib->SetRotation(
" 1. 0. 0. 0. 1. 0. 0. 0. 1.");
340 detlayer_scib->DumpWithIncrement();
345 cout <<
" imodule: " << imodule <<
" " << xm <<
" " << ym << endl;
347 cout <<
" layers: " << nlayers << endl;
348 cout <<
" modules: " << imodule << endl;