325 TGeoVolume *top = gGeoManager->GetTopVolume();
327 TGeoMedium *air = gGeoManager->GetMedium(
"air");
329 TGeoMedium *Se = gGeoManager->GetMedium(
"ShipSens");
331 TGeoMedium *Al = gGeoManager->GetMedium(
"aluminium");
333 TGeoMedium *mylar = gGeoManager->GetMedium(
"mylar");
335 TGeoMedium *sttmix9010_2bar = gGeoManager->GetMedium(
"STTmix9010_2bar");
337 TGeoMedium *tungsten = gGeoManager->GetMedium(
"tungsten");
341 TGeoMedium *med = gGeoManager->GetMedium(
"vacuum");
343 gGeoManager->SetVisLevel(4);
344 gGeoManager->SetTopVisible();
349 Double_t epsS=0.0001;
351 Double_t framewidth = 40.;
359 Double_t rmin, rmax, dx, dy, dz, z, density,a,w;
361 Int_t nel,numed,isvol,ifield;
362 Double_t radl, absl, TStationz;
371 TGeoCompositeShape *detcomp1 =
new TGeoCompositeShape(
"detcomp1",
"detbox1-detbox2");
372 TGeoCompositeShape *detcomp1_12 =
new TGeoCompositeShape(
"detcomp1_12",
"detbox1_12-detbox2_12");
373 TGeoBBox *vetovacbox;
374 TGeoCompositeShape *detcomp1_veto;
382 detcomp1_veto =
new TGeoCompositeShape(
"detcomp1_veto",
"detbox1_veto-detbox2_veto");
388 TGeoTube *straw_tube =
new TGeoTube(
"straw",rmin,rmax,
fStraw_length-4.*eps);
389 TGeoVolume *straw =
new TGeoVolume(
"straw",straw_tube, mylar);
390 straw->SetLineColor(4);
391 straw->SetVisibility(kTRUE);
392 TGeoTube *straw_tube_12 =
new TGeoTube(
"straw_12",rmin,rmax,
fStraw_length_12-4.*eps);
393 TGeoVolume *straw_12 =
new TGeoVolume(
"straw_12",straw_tube_12, mylar);
394 straw_12->SetLineColor(4);
395 straw_12->SetVisibility(kTRUE);
396 TGeoVolume *straw_veto;
398 TGeoTube *straw_tube_veto =
new TGeoTube(
"straw_veto",rmin,rmax,
fStraw_length_veto-4.*eps);
399 straw_veto =
new TGeoVolume(
"straw_veto",straw_tube_veto, mylar);
400 straw_veto->SetLineColor(4);
401 straw_veto->SetVisibility(kTRUE);
406 TGeoTube *gas_tube =
new TGeoTube(
"gas",rmin,rmax,
fStraw_length-6.*eps);
407 TGeoVolume *gas =
new TGeoVolume(
"gas",gas_tube, sttmix9010_2bar);
408 gas->SetLineColor(5);
409 AddSensitiveVolume(gas);
410 TGeoTube *gas_tube_12 =
new TGeoTube(
"gas_12",rmin,rmax,
fStraw_length_12-6.*eps);
411 TGeoVolume *gas_12 =
new TGeoVolume(
"gas_12",gas_tube_12, sttmix9010_2bar);
412 gas_12->SetLineColor(5);
413 AddSensitiveVolume(gas_12);
414 TGeoVolume *gas_veto;
415 TGeoBBox *layer_veto;
417 TGeoTube *gas_tube_veto =
new TGeoTube(
"gas_veto",rmin,rmax,
fStraw_length_veto-6.*eps);
418 gas_veto =
new TGeoVolume(
"gas_veto",gas_tube_veto, sttmix9010_2bar);
419 gas_veto->SetLineColor(5);
420 AddSensitiveVolume(gas_veto);
426 TGeoTube *wire_tube =
new TGeoTube(
"wire",rmin,rmax,
fStraw_length-8.*eps);
427 TGeoVolume *wire =
new TGeoVolume(
"wire",wire_tube, tungsten);
428 wire->SetLineColor(6);
429 TGeoTube *wire_tube_12 =
new TGeoTube(
"wire_12",rmin,rmax,
fStraw_length_12-8.*eps);
430 TGeoVolume *wire_12 =
new TGeoVolume(
"wire_12",wire_tube_12, tungsten);
431 wire_12->SetLineColor(6);
434 TGeoTube *wire_tube_veto =
new TGeoTube(
"wire_veto",rmin,rmax,
fStraw_length_veto-8.*eps);
435 TGeoVolume *wire_veto =
new TGeoVolume(
"wire_veto",wire_tube_veto, tungsten);
436 wire_veto->SetLineColor(6);
439 TGeoVolume *vetovac =
new TGeoVolume(
"Veto", vetovacbox, med);
441 top->AddNode(vetovac, statnb,
new TGeoTranslation(0,0,
fT0z));
447 TString nmveto =
"Veto";
449 for (Int_t vnb=0; vnb<2; vnb++) {
458 nmveto = nmveto+
"_x";
462 nmveto = nmveto+
"_u";
466 nmveto = nmveto+
"_x";
469 TGeoVolume *viewframe_veto =
new TGeoVolume(nmveto, detcomp1_veto, Al);
473 r5.SetAngles(angle,0,0);
474 TGeoCombiTrans c5(t5, r5);
475 TGeoHMatrix *h5 =
new TGeoHMatrix(c5);
476 vetovac->AddNode(viewframe_veto, statnb*10000000+vnb*1000000,h5);
477 viewframe_veto->SetLineColor(kRed);
481 for (Int_t pnb=0; pnb<2; pnb++) {
483 TString nmplane_veto = nmveto+
"_plane_"; nmplane_veto += pnb;
486 TGeoVolume *planebox_veto =
new TGeoVolume(nmplane_veto, plane_veto, med);
491 TGeoCombiTrans d5(t5, r5);
492 TGeoHMatrix *j5 =
new TGeoHMatrix(d5);
493 vetovac->AddNode(planebox_veto, statnb*10000000+vnb*1000000+pnb*100000,j5);
495 for (Int_t lnb=0; lnb<2; lnb++) {
496 TString nmlayer_veto = nmplane_veto+
"_layer_"; nmlayer_veto += lnb;
499 TGeoVolume *layerbox_veto =
new TGeoVolume(nmlayer_veto, layer_veto, med);
501 planebox_veto->AddNode(layerbox_veto, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,
new TGeoTranslation(0,0,(lnb-1./2.)*
fDeltaz_layer12));
505 Int_t nr = statnb*10000000+vnb*1000000+pnb*100000+lnb*10000;
509 r6v.SetAngles(90,90,0);
510 TGeoCombiTrans c6v(t6v, r6v);
511 TGeoHMatrix *h6v =
new TGeoHMatrix(c6v);
513 layerbox_veto->AddNode(straw_veto,nr+1000+snb,h6v);
514 layerbox_veto->AddNode(gas_veto, nr+2000+snb,h6v);
515 layerbox_veto->AddNode(wire_veto, nr+3000+snb,h6v);
535 TGeoBBox *vacbox =
new TGeoBBox(
"vacbox", x_prime+eps, y_prime+eps, 2.*
fDeltaz_view);
536 TGeoBBox *vacbox_12 =
new TGeoBBox(
"vacbox_12", x_prime_12+eps, y_prime_12+eps, 2.*
fDeltaz_view);
540 for (statnb=1;statnb<5;statnb++) {
542 TString nmstation =
"Tr";
543 std::stringstream ss;
545 nmstation = nmstation + ss.str();
551 vac_12 =
new TGeoVolume(nmstation, vacbox_12, med);
552 top->AddNode(vac_12, statnb,
new TGeoTranslation(0,0,TStationz));
556 vac_12 =
new TGeoVolume(nmstation, vacbox_12, med);
557 top->AddNode(vac_12, statnb,
new TGeoTranslation(0,0,TStationz));
561 vac =
new TGeoVolume(nmstation, vacbox, med);
562 top->AddNode(vac, statnb,
new TGeoTranslation(0,0,TStationz));
566 vac =
new TGeoVolume(nmstation, vacbox, med);
567 top->AddNode(vac, statnb,
new TGeoTranslation(0,0,TStationz));
573 if ((statnb==1)||(statnb==2)) {
574 for (Int_t vnb=0; vnb<4; vnb++) {
585 nmview_12 = nmstation+
"_x1";
589 nmview_12 = nmstation+
"_u";
593 nmview_12 = nmstation+
"_v";
597 nmview_12 = nmstation+
"_x2";
601 nmview_12 = nmstation+
"_x1";
604 TGeoVolume *viewframe_12;
606 viewframe_12 =
new TGeoVolume(nmview_12, detcomp1_12, Al);
609 viewframe_12 =
new TGeoVolume(nmview_12, detcomp1_12, FrameMatPtr);
616 r5.SetAngles(angle,0,0);
617 TGeoCombiTrans c5(t5, r5);
618 TGeoHMatrix *h5 =
new TGeoHMatrix(c5);
620 vac_12->AddNode(viewframe_12, statnb*10000000+vnb*1000000,h5);
621 viewframe_12->SetLineColor(kRed);
623 for (Int_t pnb=0; pnb<2; pnb++) {
625 TString nmplane_12 = nmview_12+
"_plane_";
628 TGeoVolume *planebox_12 =
new TGeoVolume(nmplane_12, plane_12, med);
634 TGeoCombiTrans d3(t3, r5);
635 TGeoHMatrix *j3 =
new TGeoHMatrix(d3);
636 vac_12->AddNode(planebox_12, statnb*10000000+vnb*1000000+pnb*100000,j3);
638 for (Int_t lnb=0; lnb<2; lnb++) {
643 TString nmlayer_12 = nmplane_12+
"_layer_"; nmlayer_12 += lnb;
645 TGeoVolume *layerbox_12 =
new TGeoVolume(nmlayer_12, layer_12, med);
646 planebox_12->AddNode(layerbox_12, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,
new TGeoTranslation(0,0,(lnb-1./2.)*
fDeltaz_layer12));
654 r6s.SetAngles(90,90,0);
655 TGeoCombiTrans c6s(t6s, r6s);
656 TGeoHMatrix *h6s =
new TGeoHMatrix(c6s);
657 layerbox_12->AddNode(straw_12,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+1000+snb,h6s);
658 layerbox_12->AddNode(gas_12,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+2000+snb,h6s);
659 layerbox_12->AddNode(wire_12,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+3000+snb,h6s);
671 if ((statnb==3)||(statnb==4)) {
672 for (Int_t vnb=0; vnb<4; vnb++) {
682 nmview = nmstation+
"_x1";
686 nmview = nmstation+
"_u";
690 nmview = nmstation+
"_v";
694 nmview = nmstation+
"_x2";
698 nmview = nmstation+
"_x1";
701 TGeoVolume *viewframe;
703 viewframe =
new TGeoVolume(nmview, detcomp1, Al);
706 viewframe =
new TGeoVolume(nmview, detcomp1, FrameMatPtr);
713 r5.SetAngles(angle,0,0);
714 TGeoCombiTrans c5(t5, r5);
715 TGeoHMatrix *h5 =
new TGeoHMatrix(c5);
717 vac->AddNode(viewframe, statnb*10000000+vnb*1000000,h5);
718 viewframe->SetLineColor(kRed);
720 for (Int_t pnb=0; pnb<2; pnb++) {
722 TString nmplane = nmview+
"_plane_";
724 TGeoBBox *plane =
new TGeoBBox(
"plane box",
fStraw_length+eps/2,
ftr34ydim+eps/2, planewidth/2.+3.*eps/2);
725 TGeoVolume *planebox =
new TGeoVolume(nmplane, plane, med);
731 TGeoCombiTrans d3(t3, r5);
732 TGeoHMatrix *j3 =
new TGeoHMatrix(d3);
733 vac->AddNode(planebox, statnb*10000000+vnb*1000000+pnb*100000,j3);
735 for (Int_t lnb=0; lnb<2; lnb++) {
740 TString nmlayer = nmplane+
"_layer_"; nmlayer += lnb;
742 TGeoVolume *layerbox =
new TGeoVolume(nmlayer, layer, med);
743 planebox->AddNode(layerbox, statnb*10000000+vnb*1000000+pnb*100000+lnb*10000,
new TGeoTranslation(0,0,(lnb-1./2.)*
fDeltaz_layer12));
751 r6s.SetAngles(90,90,0);
752 TGeoCombiTrans c6s(t6s, r6s);
753 TGeoHMatrix *h6s =
new TGeoHMatrix(c6s);
754 layerbox->AddNode(straw,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+1000+snb,h6s);
755 layerbox->AddNode(gas,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+2000+snb,h6s);
756 layerbox->AddNode(wire,statnb*10000000+vnb*1000000+pnb*100000+lnb*10000+3000+snb,h6s);
772 std::cout <<
"tracking stations added" << std::endl;