void Det() { gSystem->Load("libGeom"); TGeoRotation *rot; TGeoNode *Node, *Node1; #ifndef _L1_LHeC_h_ #define _L1_LHeC_h_ #endif #define L1 int transpd=0; TGeoManager *L1 = new TGeoManager(L1,"Det.C"); //-----------List of Materials and Mixtures-------------- TGeoMaterial *mat5 = new TGeoMaterial("BERILLIUM",9.01,4,1.848); mat5->SetUniqueID( 5); TGeoMaterial *mat15 = new TGeoMaterial("AIR",14.61,7.3,0.1205000E-02); mat15->SetUniqueID( 15); TGeoMaterial *mat16 = new TGeoMaterial("VACUUM",0,0,0); mat16->SetUniqueID( 16); //-----------List of Tracking Media-------------- TGeoMedium *med1 = new TGeoMedium("VACUUM",1,16,0,3,30,1,0.1000000E+11,0,0.1000000E-02,0); TGeoMedium *med2 = new TGeoMedium("AIR",2,15,0,3,30,1,0.1000000E+11,0.2488534,0.1000000E-02,1.15055); TGeoMedium *med3 = new TGeoMedium("BERYLLIUM",3,5,0,3,30,1,0.1000000E+11,0.2163378,0.1000000E-02,0.2434059E-01); //-----------List of Rotation matrices-------------- TGeoRotation *rot1 = new TGeoRotation("rot1",90,0,90,270,180,0); //-----------Outer Boundaries of L1 -------------- #define DetBoxHalfX 1000. #define DetBoxHalfY 1000. #define DetBoxHalfZ 1000. //-----------Boundaries of CDET -------------- #define CDetTubRMin 0. #define CDetTubRMax 91. #define CDetTubZHalf 950.1 //-----------BP Constants ------------------ #define BPipeWThickn 0.1 #define BPinnerXHalf 12.5 //defines the elliptical extension #define BPinnerYHalf 2.2 #define BPipeETubZHalf1 192. #define BPipeETubZHalf2 105. //-----------Beam Pipe and System -------------- #define BPipeETubXHalf(x) (x+BPipeWThickn); #define BPipeETubYHalf(x) (x+BPipeWThickn); float bpxH =BPipeETubXHalf(BPinnerXHalf); float bpyH =BPipeETubYHalf(BPinnerYHalf); cout << bpxH << "= bpxH, bpyH =" << bpyH << endl; //-----------Beam Pipe Container -------------- #define BPipeCETubXHalf(x) (x + 0.01); #define BPipeCETubYHalf(x) (x + 0.01); #define BPipeCETubZHalf(x) (x + 0.01); float bpCxH =BPipeCETubXHalf(bpxH); float pbCyH =BPipeCETubYHalf(bpyH); float pbCZH1 =BPipeCETubZHalf(BPipeETubZHalf1); float pbCZH2 =BPipeCETubZHalf(BPipeETubZHalf2); //-----------Beam Pipe Vacuum -------------- #define BPipeVETubXHalf(x) (x - BPipeWThickn); #define BPipeVETubYHalf(x) (x - BPipeWThickn); float bpVxH =BPipeVETubXHalf(bpxH); float pbVyH=BPipeVETubYHalf(bpyH); cout << bpVxH << "= bpVxH, pbVyH =" << pbVyH << endl; //-----------List of Volumes-------------- TGeoVolume *LHED = gGeoManager->MakeBox("LHED",med2,DetBoxHalfX,DetBoxHalfY,DetBoxHalfZ); //container Det. LHED->SetVisibility(0); TGeoVolume *CDET = gGeoManager->MakeTube("CDET",med2,CDetTubRMin,CDetTubRMax,CDetTubZHalf); //container Centr. Det. CDET->SetVisibility(0); // Be-beam pipe TGeoVolume *PIPE = gGeoManager->MakeEltu("PIPE",med2,bpCxH,pbCyH,pbCZH1); //cont. Be-pipe PIPE->SetVisibility(0); TGeoVolume *PIP1 = gGeoManager->MakeEltu("PIP1",med3,bpxH,bpyH,BPipeETubZHalf1); TGeoVolume *PIP2 = gGeoManager->MakeEltu("PIP2",med3,bpxH,bpyH,BPipeETubZHalf2); TGeoVolume *PIPV1 = gGeoManager->MakeEltu("PIPV1",med1,bpVxH,pbVyH,pbCZH1); TGeoVolume *PIPV2 = gGeoManager->MakeEltu("PIPV2",med1,bpVxH,pbVyH,pbCZH2); TGeoVolume *PIPS1 = gGeoManager->MakeTubs("PIPS1",med3,BPinnerYHalf,bpyH,BPipeETubZHalf1,270.,90.); TGeoVolume *PIPS2 = gGeoManager->MakeTubs("PIPS2",med3,BPinnerYHalf,bpyH,BPipeETubZHalf2,270.,90.); TGeoVolume *PIPT1 = gGeoManager->MakeTubs("PIPT1",med3,bpyH,bpxH,pbCZH1,270.,90.); TGeoVolume *PIPT2 = gGeoManager->MakeTubs("PIPT2",med3,bpyH,bpxH,pbCZH2,270.,90.); TGeoCompositeShape *PIPR1= new TGeoCompositeShape("PIPR1","(((PIP1-PIPV1)+PIPS1)-PIPT1)"); TGeoVolume *PIPF1 = new TGeoVolume("PIPF1",PIPR1); PIPF1->SetLineColor(16); TGeoCompositeShape *PIPR2= new TGeoCompositeShape("PIPR2","(((PIP2-PIPV2)+PIPS2)-PIPT2)"); TGeoVolume *PIPF2 = new TGeoVolume("PIPF2",PIPR2); PIPF2->SetLineColor(16); gGeoManager->SetNsegments(200); //-----------List of Nodes-------------- gGeoManager->SetTopVolume(LHED); // central detector LHED->AddNodeOverlap(CDET,1,gGeoIdentity); //container Centr.Det. // elliptical beam pipe CDET->AddNodeOverlap(PIPE,1,gGeoIdentity); PIPE->AddNode(PIPF1,1,new TGeoTranslation(0.,0.,BPipeETubZHalf1)); // circ_elliptical beam pipe PIPE->AddNode(PIPF2,1,new TGeoCombiTrans(0.,0.,-BPipeETubZHalf2,rot1)); // circ_elliptical beam pipe if( transpd ){ gGeoManager->GetVolume("PIPF1")->SetTransparency(66); gGeoManager->GetVolume("PIPF2")->SetTransparency(66); } //--------------END--------------------- gGeoManager->Export("MyGeom.gdml"); gGeoManager->CloseGeometry(); gGeoManager->GetVolume("LHED"); LHED->Draw("ogl"); }