50         const double bend_begin = 360.; 
 
   51         const double bend_radius = 5750.; 
 
   52         const double bend_angle = 40.068e-3; 
 
   53         const double bend_end = bend_begin+
sin(bend_angle)*bend_radius; 
 
   55         gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
 
   56         TString vmcWorkdir = gSystem->Getenv(
"VMCWORKDIR");
 
   60         bool create_sensors = 
false;
 
   62         std::vector< double > sensor_positions;
 
   65         FairGeoLoader* 
geoLoad = 
new FairGeoLoader(
"TGeo", 
"FairGeoLoader");
 
   66         FairGeoInterface* 
geoFace = geoLoad->getGeoInterface();
 
   67         geoFace->setMediaFile(vmcWorkdir + 
"/geometry/media_pnd.geo");
 
   70         FairGeoMedia* 
geoMedia = geoFace->getMedia();
 
   71         FairGeoBuilder* 
geoBuild = geoLoad->getGeoBuilder();
 
   73         std::string str_ti = 
"Aluminum"; 
 
   75         FairGeoMedium* FairMediumSteel = geoMedia->getMedium(
"steel");
 
   76         FairGeoMedium* FairMediumTi = geoMedia->getMedium(str_ti.c_str()); 
 
   77         FairGeoMedium* FairMediumKapton = geoMedia->getMedium(
"mylar"); 
 
   79         if (!FairMediumAir || !FairMediumSteel || !FairMediumTi || !FairMediumKapton) {
 
   80                 std::cout << 
" warning: not all media found " << std::endl;
 
   83         geoBuild->createMedium(FairMediumAir);
 
   84         geoBuild->createMedium(FairMediumSteel);
 
   85         geoBuild->createMedium(FairMediumTi);
 
   86         geoBuild->createMedium(FairMediumKapton);
 
   87         std::cout << 
" done " << std::endl;
 
   90         TFile* 
fi = 
new TFile(fGeoFile, 
"RECREATE");
 
   99         TGeoVolume *
cave = 
new TGeoVolumeAssembly(
"pipeassembly");
 
  113         Double_t const rad = 3.1415926 / 180.;
 
  116         TGeoRotation* 
r1 = 
new TGeoRotation(
"r1", 0., 0., 0.); 
 
  117         TGeoRotation* 
r2 = 
new TGeoRotation(
"r2", 0., 90., 180.); 
 
  118         TGeoRotation* r3 = 
new TGeoRotation(
"r3", 0., -90., 0); 
 
  119         TGeoRotation* r4 = 
new TGeoRotation(
"r4", 90., 0., 0); 
 
  121         TGeoCombiTrans* tr0 = 
new TGeoCombiTrans(
"tra0", 0., 0., z0, r1);
 
  122         tr0->RegisterYourself();
 
  127         TGeoCombiTrans* trv1 = 
new TGeoCombiTrans(
"trv1", 0., 0., 1.075, r1);
 
  128         trv1->RegisterYourself();
 
  129         TGeoCombiTrans* trv2 = 
new TGeoCombiTrans(
"trv2", 0., 0., 3.53875, r1);
 
  130         trv2->RegisterYourself();
 
  131         TGeoCombiTrans* trv3 = 
new TGeoCombiTrans(
"trv3", 0., 0., 6.0075, r1);
 
  132         trv3->RegisterYourself();
 
  137         TGeoBBox* VATvalve63a = 
new TGeoBBox(
"VATvalve63a", 5.6, 12.45, 1.35, ov1);
 
  138         TGeoTube* VATvalve63b = 
new TGeoTube(
"VATvalve63b", 3.5, 6.5, 1.075);
 
  139         TGeoTube* tv1 = 
new TGeoTube(
"tv1", 0., 3.5, 1.35 + delta);
 
  141         TGeoCompositeShape *SVATvalve630 = 
new TGeoCompositeShape(
"VATvalve630",
 
  143         TGeoCompositeShape *SVATvalve63 = 
new TGeoCompositeShape(
"VATvalve63",
 
  144                         "VATvalve63b:trv1+VATvalve630:trv2+VATvalve63b:trv3");
 
  149         TGeoBBox* VATvalve100a = 
new TGeoBBox(
"VATvalve100a", 7.2, 16.0, 1.35, ov2);
 
  150         TGeoTube* VATvalve100b = 
new TGeoTube(
"VATvalve100b", 5.0, 8.25, 1.075);
 
  151         TGeoTube* tv2 = 
new TGeoTube(
"tv2", 0., 5.0, 1.35 + delta);
 
  153         TGeoCompositeShape *SVATvalve1000 = 
new TGeoCompositeShape(
"VATvalve1000",
 
  155         TGeoCompositeShape *SVATvalve100 = 
new TGeoCompositeShape(
"VATvalve100",
 
  156                         "VATvalve100b:trv1+VATvalve1000:trv2+VATvalve100b:trv3");
 
  161         TGeoBBox* VATvalve160a =
 
  162                         new TGeoBBox(
"VATvalve160a", 9.1, 21.75, 1.35, ov3);
 
  163         TGeoTube* VATvalve160b = 
new TGeoTube(
"VATvalve160b", 7.5, 11.25, 1.075);
 
  164         TGeoTube* tv3 = 
new TGeoTube(
"tv3", 0., 7.5, 1.35 + delta);
 
  166         TGeoCompositeShape *SVATvalve1600 = 
new TGeoCompositeShape(
"VATvalve1600",
 
  168         TGeoCompositeShape *SVATvalve160 = 
new TGeoCompositeShape(
"VATvalve160",
 
  169                         "VATvalve160b:trv1+VATvalve1600:trv2+VATvalve160b:trv3");
 
  172         Double_t psv1[27] = { 0., 360., 8, .0, 6.0, 10.85, 7.6, 6.0, 10.85, 7.6,
 
  173                         6.0, 10.15, 16.6, 6.0, 10.15, 16.6, 6.0, 9.0, 24.0, 6.0, 9.0, 24.0,
 
  174                         0., 9.0, 24.2, 0., 9.0 };
 
  175         TGeoPcon* TVP700 = 
new TGeoPcon(
"TVP700", 0., 360., 8);
 
  176         TVP700->SetDimensions(psv1);
 
  179         Double_t psv2[39] = { 0., 360., 12, 0.0, 7.5, 11.25, 2.45, 7.5, 11.25,
 
  180                         2.45, 7.5, 7.965, 3.45, 7.5, 7.965, 6.45, 7.5, 12.9, 8.45, 0.,
 
  181                         12.9, 8.45, 0., 12.05, 24.00, 0., 12.05, 24.00, 0., 12.9, 26.00,
 
  182                         0., 12.9, 26.00, 0., 7.5, 36.85, 0., 7.5 };
 
  183         TGeoPcon* TVP1000 = 
new TGeoPcon(
"TVP1000", 0., 360., 12);
 
  184         TVP1000->SetDimensions(psv2);
 
  188         Double_t psv3[21] = { 0., 360., 6, 0., 7.5, 10.125, 2.0, 7.5, 10.125, 2.0,
 
  189                         7.5, 7.7, 10.0, 7.5, 7.7, 10.0, 0., 20.0, 60.7, 0., 20.0 };
 
  190         TGeoPcon* IGP1000 = 
new TGeoPcon(
"IGP1000", 0., 360., 6);
 
  191         IGP1000->SetDimensions(psv3);
 
  202         TGeoVolume *Vgvhesr = 
new TGeoVolume(
"gvhesr", SVATvalve100,
 
  204         Vgvhesr->SetLineColor(30);
 
  208         fprintf(stderr, 
"currentz a: %f\n", currentz);
 
  213         Double_t psb1[27] = { 0., 360., 8, 0., 4.35, 7.58, 2.0, 4.35, 7.58, 2.0,
 
  214                         4.35, 4.45, 20.0, 4.35, 4.45, 31.3328, 7.50, 7.60, 156.0328, 7.50,
 
  215                         7.60, 156.0328, 7.50, 10.125, 158.2328, 7.50, 10.125 };
 
  216         TGeoPcon* pipeup = 
new TGeoPcon(
"pipeup", 0., 360., 8);
 
  217         pipeup->SetDimensions(psb1);
 
  219         TGeoCombiTrans* trb1 =
 
  220                         new TGeoCombiTrans(
"trb1", 0., 0., z0 + currentz, r1);
 
  221         trb1->RegisterYourself();
 
  224         TGeoVolume *Vpipeup = 
new TGeoVolume(
"pipeup", pipeup,
 
  226         Vpipeup->SetLineColor(31);
 
  229         currentz += 158.2328;
 
  230         fprintf(stderr, 
"currentz b: %f\n", currentz);
 
  236         Double_t psc1[21] = { 0., 360., 6, -16.7, 7.50, 10.125, -14.5, 7.50,
 
  237                         10.125, -14.5, 7.50, 7.70, 14.5, 7.50, 7.70, 14.5, 7.50, 10.125,
 
  238                         16.7, 7.50, 10.125 };
 
  239         TGeoPcon* ktmpump0 = 
new TGeoPcon(
"ktmpump0", 0., 360., 6);
 
  240         ktmpump0->SetDimensions(psc1);
 
  241         TGeoTube* tc1 = 
new TGeoTube(
"tc1", 0., 7.7, 7.7);
 
  243         TGeoCombiTrans* 
trc1 = 
new TGeoCombiTrans(
"trc1", 0., 0., 0, r2);
 
  244         trc1->RegisterYourself();
 
  245         TGeoCombiTrans* 
trc2 = 
new TGeoCombiTrans(
"trc2", 0., 0.,
 
  246                         z0 + currentz + 16.7, r1);
 
  247         trc2->RegisterYourself();
 
  249         TGeoCompositeShape *csc1 = 
new TGeoCompositeShape(
"csc1",
 
  250                         "(ktmpump0-tc1:trc1)");
 
  251         TGeoCompositeShape *Sktmpump = 
new TGeoCompositeShape(
"ktmpump",
 
  254         TGeoVolume *Vktmpump = 
new TGeoVolume(
"ktmpump", Sktmpump,
 
  256         Vktmpump->SetLineColor(32);
 
  261         fprintf(stderr, 
"currentz c1: %f\n", currentz);
 
  266         TGeoCombiTrans* 
trc3 = 
new TGeoCombiTrans(
"trc3", 0., 0., 7.0, r1);
 
  267         trc3->RegisterYourself();
 
  268         TGeoCombiTrans* trc4 = 
new TGeoCombiTrans(
"trc4", 0., -16.7, currentz, r2);
 
  269         trc4->RegisterYourself();
 
  270         TGeoCombiTrans* trc5 = 
new TGeoCombiTrans(
"trc5", 0., 16.7, currentz, r3);
 
  271         trc5->RegisterYourself();
 
  273         TGeoCompositeShape *STVPwValve = 
new TGeoCompositeShape(
"TVPwValve",
 
  274                         "(VATvalve160+TVP1000:trc3)");
 
  275         TGeoCompositeShape *STpumps = 
new TGeoCompositeShape(
"Tpumps",
 
  276                         "TVPwValve:trc4+TVPwValve:trc5");
 
  278         TGeoVolume *VTpumps = 
new TGeoVolume(
"Tpump", STpumps,
 
  280         VTpumps->SetLineColor(33);
 
  285         fprintf(stderr, 
"currentz c2: %f\n", currentz);
 
  290         Double_t psd1[27] = { 0., 360., 8, 0.0, 7.5, 10.125, 2.20, 7.5, 10.125,
 
  291                         2.20, 7.5, 7.70, 148.80, 7.5, 7.70, 148.80, 7.5, 10.125, 153.80,
 
  292                         7.5, 10.125, 153.80, 7.5, 7.70, 231.30, 7.5, 7.70 };
 
  293         TGeoPcon* pipeTSup = 
new TGeoPcon(
"pipeTSup", 0., 360., 8);
 
  294         pipeTSup->SetDimensions(psd1);
 
  296         TGeoCombiTrans* trd1 =
 
  297                         new TGeoCombiTrans(
"trd1", 0., 0., z0 + currentz, r1);
 
  298         trd1->RegisterYourself();
 
  300         TGeoVolume *VpipeTSup = 
new TGeoVolume(
"pipeTSup", pipeTSup,
 
  302         VpipeTSup->SetLineColor(34);
 
  307         fprintf(stderr, 
"currentz d: %f\n", currentz);
 
  314         fprintf(stderr, 
"Target position: 0 / 0 / %f\n", z0 + currentz + tz);
 
  317         Double_t pse1[24] = { 0., 360., 7, 0., 7.5, 7.55, 10.45, 7.5, 7.55, 26.8,
 
  318                         1.25, 1.30, 26.8, 1.25, 1.27, 29.98, 1.25, 1.27, 29.98, 0., 1.27,
 
  320         TGeoPcon* Tcross1 = 
new TGeoPcon(
"Tcross1", 0., 360., 7);
 
  321         Tcross1->SetDimensions(pse1);
 
  323         TGeoTube* Tcross2 = 
new TGeoTube(
"Tcross2", 1.0, 1.02, 11.5);
 
  326         Double_t pse2[63] = { 0., 360., 20, -182.0, 7.5, 7.7, -135.5, 7.5, 7.7,
 
  327                         -125.5, 4.5, 4.6, -95.5, 4.5, 4.6, -95.5, 3.0, 3.1, -54.0, 3.0,
 
  328                         3.1, -54.0, 2.0, 2.1, -42.1, 2.0, 2.1, -17.0, 2.0, 2.1, -17.0, 1.0,
 
  329                         1.02, 17.0, 1.0, 1.02, 17.0, 2.0, 2.1, 42.1, 2.0, 2.1, 54.0, 2.0,
 
  330                         2.1, 54.0, 3.0, 3.1, 95.5, 3.0, 3.1, 95.5, 4.5, 4.6, 133.5, 4.5,
 
  331                         4.6, 143.5, 7.85, 7.95, 168.69, 7.85, 7.95,
 
  334         TGeoPcon* Tcross3 = 
new TGeoPcon(
"Tcross3", 0., 360., 20);
 
  335         Tcross3->SetDimensions(pse2);
 
  337         TGeoTube* te1 = 
new TGeoTube(
"te1", 0., 1.25, 0.51 + delta);
 
  338         TGeoTube* te2 = 
new TGeoTube(
"te2", 0., 1.00, 0.51 + delta);
 
  339         TGeoTube* te3 = 
new TGeoTube(
"te3", 0., 1.00, 1.27 + delta);
 
  340         TGeoTube* te4 = 
new TGeoTube(
"te4", 0., 1.00, 1.02 + delta);
 
  342         TGeoCombiTrans* tre1 = 
new TGeoCombiTrans(
"tre1", 0., 0., tz, r2);
 
  343         tre1->RegisterYourself();
 
  344         TGeoCombiTrans* tre2 = 
new TGeoCombiTrans(
"tre2", 0., 0., -11.5, r2);
 
  345         tre2->RegisterYourself();
 
  346         TGeoCombiTrans* tre3 = 
new TGeoCombiTrans(
"tre3", 0., 0., 0., r2);
 
  347         tre3->RegisterYourself();
 
  348         TGeoCombiTrans* tre4 = 
new TGeoCombiTrans(
"tre4", 0., 0., -0.51, r1);
 
  349         tre4->RegisterYourself();
 
  350         TGeoCombiTrans* tre5 = 
new TGeoCombiTrans(
"tre5", 0., 0., 0.51, r1);
 
  351         tre5->RegisterYourself();
 
  352         TGeoCombiTrans* tre6 = 
new TGeoCombiTrans(
"tre6", 0., 0., 41.5, r1);
 
  353         tre6->RegisterYourself();
 
  354         TGeoCombiTrans* tre7 = 
new TGeoCombiTrans(
"tre7", 0., 0., tz, r1);
 
  355         tre7->RegisterYourself();
 
  356         TGeoCombiTrans* tre8 = 
new TGeoCombiTrans(
"tre8", 0., -175.0, tz, r3);
 
  357         tre8->RegisterYourself();
 
  359         TGeoCombiTrans* tre9 =
 
  360                         new TGeoCombiTrans(
"tre9", 0., 0., z0 + currentz, r1);
 
  361         tre9->RegisterYourself();
 
  363         TGeoCompositeShape *STcross0a = 
new TGeoCompositeShape(
"Tcross0a",
 
  365         TGeoCompositeShape *STcross0b = 
new TGeoCompositeShape(
"Tcross0b",
 
  367         TGeoCompositeShape *STcross0c = 
new TGeoCompositeShape(
"Tcross0c",
 
  368                         "Tcross3:tre3-te1:tre4-te2:tre5");
 
  370         TGeoCompositeShape *STcross = 
new TGeoCompositeShape(
"Tcross",
 
  371                         "Tcross0a+Tcross0b:tre6+Tcross0c:tre7+VATvalve160:tre8");
 
  373         TGeoVolume *VTcross = 
new TGeoVolume(
"Tcross", STcross,
 
  375         VTcross->SetLineColor(35);
 
  380         fprintf(stderr, 
"currentz e: %f\n", currentz);
 
  385         Double_t psf1[51] = { 0., 360., 16, 0.000, 1.0, 1.02, 3.7321, 2.0, 2.02,
 
  386                         3.7321, 2.0, 2.05, 93.0000, 2.0, 2.05, 97.4785, 3.2, 3.25,
 
  387                         101.0000, 3.2, 3.25, 101.0000, 3.2, 3.4, 106.0225, 3.2, 3.4,
 
  388                         106.0225, 3.2, 3.27, 241.8225, 3.2, 3.27, 241.8225, 3.2, 3.35,
 
  389                         244.8225, 3.2, 3.35, 244.8225, 3.2, 3.27, 261.0725, 3.2, 3.27,
 
  390                         261.0725, 3.2, 5.675, 262.8225, 3.2, 5.675 };
 
  391         TGeoPcon* pipeTSdown = 
new TGeoPcon(
"pipeTSdown", 0., 360., 16);
 
  392         pipeTSdown->SetDimensions(psf1);
 
  394         TGeoCombiTrans* trf1 =
 
  395                         new TGeoCombiTrans(
"trf1", 0., 0., z0 + currentz, r1);
 
  396         trf1->RegisterYourself();
 
  398         TGeoVolume *VpipeTSdown = 
new TGeoVolume(
"pipeTSdown", pipeTSdown,
 
  400         VpipeTSdown->SetLineColor(36);
 
  404         currentz += 262.8225;
 
  405         fprintf(stderr, 
"currentz f: %f\n", currentz);
 
  411         Double_t psg1[27] = { 0., 360., 8, 0.000, 3.2, 5.675, 1.7200, 3.2, 5.675,
 
  412                         1.7200, 3.2, 3.27, 3.3653, 3.2, 3.27, 10.0830, 5.0, 5.07, 51.0,
 
  413                         5.0, 5.07, 51.0, 5.0, 7.60, 53.0, 5.0, 7.60 };
 
  414         TGeoPcon* crossTS1 = 
new TGeoPcon(
"crossTS1", 0., 360., 8);
 
  415         crossTS1->SetDimensions(psg1);
 
  417         TGeoTube* tg1 = 
new TGeoTube(
"tg1", 0., 6.07, 5.07 + delta);
 
  418         TGeoCombiTrans* trg1 = 
new TGeoCombiTrans(
"trg1", 0., 0., 26.0, r2);
 
  419         trg1->RegisterYourself();
 
  420         TGeoCompositeShape *ScrossTSa = 
new TGeoCompositeShape(
"crossTSa",
 
  421                         "crossTS1-tg1:trg1");
 
  424         Double_t psg2[21] = { 0., 360., 6, -55.0, 6.0, 10.125, -52.8, 6.0, 10.125,
 
  425                         -52.8, 6.0, 6.07, 52.8, 6.0, 6.07, 52.8, 6.0, 10.125, 55.0, 6.0,
 
  427         TGeoPcon* crossTS2 = 
new TGeoPcon(
"crossTS2", 0., 360., 22);
 
  428         crossTS2->SetDimensions(psg2);
 
  430         TGeoTube* tg2 = 
new TGeoTube(
"tg2", 0., 5.07, 6.07 + delta);
 
  431         TGeoCombiTrans* trg2 = 
new TGeoCombiTrans(
"trg2", 0., -55.0, 0., r2);
 
  432         trg2->RegisterYourself();
 
  433         TGeoCombiTrans* trg3 = 
new TGeoCombiTrans(
"trg3", 0., 55.0, 0., r3);
 
  434         trg3->RegisterYourself();
 
  435         TGeoCombiTrans* trg4 = 
new TGeoCombiTrans(
"trg4", 0., 0., 7.0775, r1);
 
  436         trg4->RegisterYourself();
 
  437         TGeoCombiTrans* trg5 = 
new TGeoCombiTrans(
"trg5", 0., 0., 33.0775, r1);
 
  438         trg5->RegisterYourself();
 
  441         TGeoCompositeShape *ScrossTSb = 
new TGeoCompositeShape(
"crossTSb",
 
  442                         "crossTS2:r2-tg2+TVP700:trg2+TVP700:trg3");
 
  443         TGeoCompositeShape *ScrossTS = 
new TGeoCompositeShape(
"crossTS",
 
  444                         "crossTSa:trg4+crossTSb:trg5");
 
  446         TGeoCombiTrans* trg6 = 
new TGeoCombiTrans(
"trg6", 0., 0., 60.0775, r1);
 
  447         trg6->RegisterYourself();
 
  448         TGeoCombiTrans* trg7 =
 
  449                         new TGeoCombiTrans(
"trg7", 0., 0., z0 + currentz, r1);
 
  450         trg7->RegisterYourself();
 
  452         TGeoCompositeShape *ScrossTSTMPs = 
new TGeoCompositeShape(
"crossTSTMPs",
 
  453                         "VATvalve63+crossTS+VATvalve100:trg6");
 
  455         TGeoVolume *VcrossTSTMPs = 
new TGeoVolume(
"crossTSTMPs", ScrossTSTMPs,
 
  457         VcrossTSTMPs->SetLineColor(37);
 
  462         fprintf(stderr, 
"currentz g: %f\n", currentz);
 
  474         TGeoRotation *dipolerot = 
new TGeoRotation(
"dipolerot", 90., dphi / rad,
 
  476         fprintf(stderr, 
"Rotation due to dipole magnet: %f\n", dphi / rad);
 
  486         Double_t psh1[15] = { 0., 360., 4, 0., 5.0, 7.6, 2.0, 5.0, 7.6, 2.0, 5.0,
 
  487                         5.2, 7.1225, 5.0, 5.2, };
 
  488         TGeoPcon* Dippip1 = 
new TGeoPcon(
"Dippip1", 0., 360., 4);
 
  489         Dippip1->SetDimensions(psh1);
 
  492         TGeoTorus *Dippip2 = 
new TGeoTorus(
"Dippip2", R, 5.0, 5.2, 0., dphi / rad);
 
  493         Double_t psh2[24] = { 0., 360., 7, 0., 5.0, 5.2, 5.0225, 5.0, 5.2, 19.3385,
 
  494                         9.0, 9.2, 19.3385, 9.0, 9.3, 439.3572 + 11.1, 9.0, 9.3, 439.3572 + 11.1, 9.0,
 
  495                         12.65, 441.7572 + 11.1, 9.0, 12.65, }; 
 
  498         TGeoPcon* Dippip3 = 
new TGeoPcon(
"Dippip3", 0., 360., 7);
 
  499         Dippip3->SetDimensions(psh2);
 
  501         TGeoCombiTrans* trh1 = 
new TGeoCombiTrans(
"trh1", R, 0., 7.1225,
 
  502                         new TGeoRotation(
"a", 0., -90., 180.));
 
  503         trh1->RegisterYourself();
 
  504         TGeoCombiTrans* trh2 = 
new TGeoCombiTrans(
"trh2", dx0, .0, 7.1225 + dz0,
 
  507         trh2->RegisterYourself();
 
  509         TGeoCombiTrans* trh3 = 
new TGeoCombiTrans(
"trh3", dx0 + s * 
sin(dphi), 0.,
 
  510                         7.1225 + dz0 + s * 
cos(dphi), dipolerot);
 
  511         trh3->RegisterYourself();
 
  512         s = s + 441.7572 + 11.1; 
 
  513         TGeoCombiTrans* trh4 =
 
  514                         new TGeoCombiTrans(
"trh4", 0., 0., z0 + currentz, r1);
 
  515         trh4->RegisterYourself();
 
  518         TGeoCompositeShape *SDippip = 
new TGeoCompositeShape(
"Dippip",
 
  519                         "Dippip1+Dippip2:trh1+VATvalve100:trh2+Dippip3:trh3");
 
  521         TGeoVolume *VDipolePip = 
new TGeoVolume(
"DipolePip", SDippip,
 
  523         VDipolePip->SetLineColor(38);
 
  526         currentz += 7.1225 + dz0 + s * 
cos(dphi);
 
  527         fprintf(stderr, 
"currentz/s h: %f %f\n", currentz, s);
 
  528         std::cout << 
" luminosity monitor starts at " << currentz + z0 << std::endl;
 
  533         TGeoTube* lmd_beampipe_upstr = 
new TGeoTube(
 
  534                         "lmd_beampipe_upstr", 9., 9.2, 25.);
 
  535         TGeoCombiTrans* lmd_trans_b_up = 
new TGeoCombiTrans(
"lmd_trans_b_up", 0., 0., 25.+delta, r1);
 
  536         lmd_trans_b_up->RegisterYourself();
 
  537         TGeoTube* lmd_flange_upstr = 
new TGeoTube(
 
  538                         "lmd_flange_upstr", 9.2, 25.3/2., 1.2);
 
  539         TGeoCombiTrans* lmd_trans_fl_up = 
new TGeoCombiTrans(
"lmd_trans_fl_up", 0., 0., 1.2+delta, r1);
 
  540         lmd_trans_fl_up->RegisterYourself();
 
  542         TGeoTube* lmd_cone_flange_upstr = 
new TGeoTube(
 
  543                         "lmd_cone_flange_upstr", 9.2, 25.3/2., 1.5);
 
  544         TGeoCombiTrans* lmd_trans_co_fl_up = 
new TGeoCombiTrans(
"lmd_trans_co_fl_up", 0., 0., -1.5+50.-delta, r1);
 
  545         lmd_trans_co_fl_up->RegisterYourself();
 
  548         TGeoCone* lmd_capton_cone = 
new TGeoCone(
"lmd_capton_cone", 23.386/2., 20.4/2., 20.4/2.+0.002/2., 7./2., 7./2.+0.002/2.);
 
  549         TGeoCombiTrans* lmd_trans_cap_co = 
new TGeoCombiTrans(
"lmd_trans_cap_co", 0., 0., 50.+23.386/2., r1);
 
  550         lmd_trans_cap_co->RegisterYourself();
 
  553         TGeoCone* lmd_cone_flange_downstr = 
new TGeoCone(
"lmd_cone_flange_downstr", 3.12/2., 3.1, 8.6/2., 3.1, 3.2);
 
  554         TGeoCombiTrans* lmd_trans_co_fl_do = 
new TGeoCombiTrans(
"lmd_trans_co_fl_do", 0., 0., 50.+23.386+3.12/2., r1);
 
  555         lmd_trans_co_fl_do->RegisterYourself();
 
  557         TGeoTube* lmd_beam_pipe = 
new TGeoTube(
"lmd_beam_pipe", 3.5, 3.6, 50./2.);
 
  558         TGeoCombiTrans* lmd_trans_p = 
new TGeoCombiTrans(
"lmd_trans_p", 0., 0., 50.+23.386+50./2., r1);
 
  559         lmd_trans_p->RegisterYourself();
 
  561         TGeoCone* lmd_cone_downstr = 
new TGeoCone(
"lmd_cone_downstr", 20./2., 3.5, 3.7, 9./2., 9.2/2.);
 
  562         TGeoCombiTrans* lmd_trans_co_do = 
new TGeoCombiTrans(
"lmd_trans_co_do", 0., 0., 50.+23.386+50.+20./2., r1);
 
  563         lmd_trans_co_do->RegisterYourself();
 
  565         TGeoTube* lmd_beam_pipe_downstream = 
new TGeoTube(
"lmd_beam_pipe_downstream", 9./2., 9.2/2., 56./2.);
 
  566         TGeoCombiTrans* lmd_trans_p_down = 
new TGeoCombiTrans(
"lmd_trans_p_down", 0., 0., 50.+23.386+50.+20.+56./2., r1);
 
  567         lmd_trans_p_down->RegisterYourself();
 
  605         TGeoCompositeShape *slum_beampipe_upstream = 
new TGeoCompositeShape(
"slum_beampipe_upstream",
 
  606                         "lmd_flange_upstr:lmd_trans_fl_up+lmd_beampipe_upstr:lmd_trans_b_up+lmd_cone_flange_upstr:lmd_trans_co_fl_up");
 
  607         TGeoCompositeShape *slum_CaptonCone = 
new TGeoCompositeShape(
"slum_CaptonCone", 
"lmd_capton_cone:lmd_trans_cap_co-lmd_cone_flange_downstr:lmd_trans_co_fl_do-lmd_cone_flange_upstr:lmd_trans_co_fl_up");
 
  608         TGeoCompositeShape *slum_beampipe_downstream = 
new TGeoCompositeShape(
"slum_beampipe_downstream",
 
  609                                 "lmd_beam_pipe:lmd_trans_p+lmd_cone_downstr:lmd_trans_co_do+lmd_beam_pipe_downstream:lmd_trans_p_down");
 
  612         TGeoCombiTrans* tri6 = 
new TGeoCombiTrans(
"tri6", dx0 + s * 
sin(dphi), 0.,
 
  613                         z0 + currentz, dipolerot);
 
  618         tri6->RegisterYourself();
 
  621         TGeoVolume *vlum_beampipe_upstream = 
new TGeoVolume(
"vlum_beampipe_upstream", slum_beampipe_upstream,
 
  623         vlum_beampipe_upstream->SetLineColor(39);
 
  624         TGeoVolume *vlum_CaptonCone = 
new TGeoVolume(
"vlum_CaptonCone", slum_CaptonCone,
 
  626         vlum_CaptonCone->SetLineColor(kRed);
 
  627         TGeoVolume *vlum_beampipe_downstream = 
new TGeoVolume(
"vlum_beampipe_downstream", slum_beampipe_downstream,
 
  629         vlum_beampipe_downstream->SetLineColor(39);
 
  633         currentz += 200.00 * 
cos(dphi);
 
  634         fprintf(stderr, 
"currentz/s i: %f %f\n", currentz, s);
 
  640         Double_t psj1[15] = { 0., 360., 4, 0., 7.5, 10.125, 2.0, 7.5, 10.125, 2.0,
 
  641                         7.5, 7.7, 16.7, 7.5, 7.7 };
 
  642         TGeoPcon* EndCross0a = 
new TGeoPcon(
"EndCross0a", 0., 360., 4);
 
  643         EndCross0a->SetDimensions(psj1);
 
  646         Double_t psj2[15] = { 0., 360., 4, 16.7, 4.5, 4.7, 34.7, 4.5, 4.7, 34.7,
 
  647                         4.5, 7.6, 36.7, 4.5, 7.6 };
 
  648         TGeoPcon* EndCross0b = 
new TGeoPcon(
"EndCross0b", 0., 360., 4);
 
  649         EndCross0b->SetDimensions(psj2);
 
  652         Double_t psj3[21] = { 0., 360., 6, -16.7, 7.5, 10.125, -14.7, 7.5, 10.125,
 
  653                         -14.7, 7.5, 7.7, 14.7, 7.5, 7.7, 14.7, 7.5, 10.125, 16.7, 7.5,
 
  655         TGeoPcon* EndCross1 = 
new TGeoPcon(
"EndCross1", 0., 360., 6);
 
  656         EndCross1->SetDimensions(psj3);
 
  658         TGeoTube* tj1 = 
new TGeoTube(
"tj1", 0., 7.7, 10.125 + delta);
 
  659         TGeoTube* tj2 = 
new TGeoTube(
"tj2", 0., 7.7, 3.85 + delta);
 
  660         TGeoTube* tj3 = 
new TGeoTube(
"tj3", 0., 4.7, 3.85 + delta);
 
  662         TGeoCombiTrans* trj1 = 
new TGeoCombiTrans(
"trj1", 0., 0., 16.7, r2);
 
  663         trj1->RegisterYourself();
 
  664         TGeoCombiTrans* trj2 =
 
  665                         new TGeoCombiTrans(
"trj2", 0., 0., 12.85 - delta, r1);
 
  666         trj2->RegisterYourself();
 
  667         TGeoCombiTrans* trj3 =
 
  668                         new TGeoCombiTrans(
"trj3", 0., 0., 20.55 + delta, r1);
 
  669         trj3->RegisterYourself();
 
  670         TGeoCombiTrans* trj4 = 
new TGeoCombiTrans(
"trj4", 0., 0., 36.7, r1);
 
  671         trj4->RegisterYourself();
 
  672         TGeoCombiTrans* trj5 = 
new TGeoCombiTrans(
"trj5", 0., 16.7, 16.7, r3);
 
  673         trj5->RegisterYourself();
 
  674         TGeoCombiTrans* trj6 = 
new TGeoCombiTrans(
"trj6", 0., -23.7, 16.7, r3);
 
  675         trj6->RegisterYourself();
 
  676         TGeoCombiTrans* trj7 = 
new TGeoCombiTrans(
"trj7", 0., -23.7, 16.7, r2); 
 
  677         trj7->RegisterYourself();
 
  680         TGeoCompositeShape *EndCross2 = 
new TGeoCompositeShape(
"EndCross2",
 
  681                         "EndCross0a+EndCross0b-tj1:trj1");
 
  682         TGeoCompositeShape *EndCross3 = 
new TGeoCompositeShape(
"EndCross3",
 
  683                         "EndCross1:trj1-tj2:trj2-tj3:trj3");
 
  684         TGeoCompositeShape *EndCross4 = 
new TGeoCompositeShape(
"EndCross4",
 
  685                         "TVPwValve:trj5+VATvalve160:trj6+IGP1000:trj7");
 
  686         TGeoCompositeShape *EndCross = 
new TGeoCompositeShape(
"EndCross",
 
  687                         "EndCross2+EndCross3+EndCross4+VATvalve100:trj4");
 
  689         TGeoCombiTrans* trj8 = 
new TGeoCombiTrans(
"trj8", dx0 + s * 
sin(dphi), 0.,
 
  690                         z0 + currentz, dipolerot);
 
  691         trj8->RegisterYourself();
 
  694         TGeoVolume *VEndCross = 
new TGeoVolume(
"EndCross", EndCross,
 
  696         VEndCross->SetLineColor(40);
 
  700         currentz += 43.7 * 
cos(dphi);
 
  701         fprintf(stderr, 
"currentz/s j: %f %f\n", currentz, s);
 
  706         TGeoVolume *beamPipe = 
new TGeoVolumeAssembly(
"BeamPipe");
 
  708         beamPipe->AddNode(Vgvhesr, 0, tr0); 
 
  709         beamPipe->AddNode(Vpipeup, 0, trb1); 
 
  710         beamPipe->AddNode(Vktmpump, 0, trc2); 
 
  711         beamPipe->AddNode(VTpumps, 0, tr0); 
 
  712         beamPipe->AddNode(VpipeTSup, 0, trd1); 
 
  713         beamPipe->AddNode(VTcross, 0, tre9); 
 
  714         beamPipe->AddNode(VpipeTSdown, 0, trf1); 
 
  715         beamPipe->AddNode(VcrossTSTMPs, 0, trg7); 
 
  716         beamPipe->AddNode(VDipolePip, 0, trh4); 
 
  724         for (
int iposz = 0; iposz < 1200; iposz+=10) sensor_positions.push_back(iposz);
 
  727                 for (
unsigned int isensor = 0; isensor < sensor_positions.size(); isensor++){
 
  728                         std::stringstream volume_name;
 
  729                         volume_name << 
"_" << isensor;
 
  731                         TGeoTube* disc = 
new TGeoTube((
"disc"+volume_name.str()).c_str(), 0., 40., 0.0000001);
 
  732                         TGeoVolume* Vdisc = 
new TGeoVolume((
"LumActive_pipe_sensor_"+volume_name.str()).c_str(), disc,
 
  734                         TGeoCombiTrans* tre_disc =
 
  735                                                 new TGeoCombiTrans((
"tre_"+volume_name.str()).c_str(), 0., 0., sensor_positions[isensor], 
r1);
 
  736                         tre_disc->RegisterYourself();
 
  737                         Vdisc->SetLineColor(2);
 
  738                         beamPipe->AddNode(Vdisc,      0, tre_disc);
 
  749         cave->AddNode(beamPipe, 1);
 
  769         fprintf(stderr, 
"\n");
 
  770         fprintf(stderr, 
"<I> Geometry of PANDA beam pipe written to %s\n",
 
  772         fprintf(stderr, 
"\n");
 
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
TGeoManager * gGeoManager
FairGeoMedium * FairMediumAir
FairGeoInterface * geoFace
FairGeoBuilder * geoBuild