// beam pipe of PANDA { // proceeding from left to right // parameters Cyl1 const Double_t Cyl1InnerRadius = 15.0/2; // (cm) const Double_t Cyl1OuterRadius = 15.1/2; // (cm) const Double_t Cyl1Dz = 31./2.; // (cm) const Double_t Cyl1PosZ = (-19. - (50.- 19.)/2.); // (cm) // parameters Cone1 const Double_t Cone1InnerRadius1 = 15.0/2; // (cm) const Double_t Cone1OuterRadius1 = 15.1/2; // (cm) const Double_t Cone1InnerRadius2 = 2.0/2; // (cm) const Double_t Cone1OuterRadius2 = 2.1/2; // (cm) const Double_t Cone1Dz = (19.-2.)/2 ; // (cm) const Double_t Cone1PosZ = -2. - Cone1Dz; // parameters Cyl2 const Double_t Cyl2InnerRadius = 2.00/2; // (cm) const Double_t Cyl2OuterRadius = Cyl2InnerRadius + 0.02; // (cm) const Double_t Cyl2Dz = 1./2.; // (cm) const Double_t Cyl2PosZ = (-1. - (2.- 1.)/2.); // (cm) // parameters Cyl3 const Double_t Cyl3InnerRadius = 2.00/2; // (cm) const Double_t Cyl3OuterRadius = Cyl3InnerRadius + 0.02; // (cm) const Double_t Cyl3Dz = (20.-1.)/2.; // (cm) const Double_t Cyl3PosZ = (1. + Cyl3Dz); // (cm) // parameters Cone2 const Double_t Cone2InnerRadius1 = 2.0/2; // (cm) const Double_t Cone2OuterRadius1 = 2.1/2; // (cm) const Double_t Cone2InnerRadius2 = 4.0/2; // (cm) const Double_t Cone2OuterRadius2 = 4.1/2; // (cm) const Double_t Cone2Dz = (23.7-20.)/2 ; // (cm) const Double_t Cone2PosZ = 20. + Cone2Dz; // parameters Cyl4 const Double_t Cyl4InnerRadius = 4.00/2.; // (cm) const Double_t Cyl4OuterRadius = 4.10/2.; // (cm) const Double_t Cyl4Dz = (116.-23.7)/2.; // (cm) const Double_t Cyl4PosZ = (23.7 + Cyl4Dz); // (cm) // parameters Cyl5 const Double_t Cyl5InnerRadius = 2./2.; // (cm) const Double_t Cyl5OuterRadius = 2.0/2. + 0.02; // (cm) const Double_t Cyl5Dz = (15.-1.02)/2.; // (cm) const Double_t Cyl5PosZ = 1.02 + Cyl5Dz; // (cm) //-------------------------------------------------------------------- gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); // Load this libraries gSystem->Load("libGeoBase"); gSystem->Load("libParBase"); gSystem->Load("libBase"); gSystem->Load("libPndData"); gSystem->Load("libPassive"); TString outfile= "BeamPipe.root"; TFile* fi = new TFile(outfile,"RECREATE"); FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader"); FairGeoInterface *geoFace = geoLoad->getGeoInterface(); geoFace->setMediaFile("../../../../geometry/media_pnd.geo"); geoFace->readMedia(); geoFace->print(); FairGeoMedia *Media = geoFace->getMedia(); FairGeoBuilder *geobuild=geoLoad->getGeoBuilder(); FairGeoMedium *CbmMediumAir = Media->getMedium("air"); FairGeoMedium *CbmMediumBer = Media->getMedium("beryllium"); Int_t nmed=geobuild->createMedium(CbmMediumAir); nmed=geobuild->createMedium(CbmMediumBer); TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom"); TGeoVolume *top = new TGeoVolumeAssembly("BeamPipe"); gGeoMan->SetTopVolume(top); // defining shapes and volumes // Cyl1 TGeoShape *Cyl1 = new TGeoTube("Cyl1",Cyl1InnerRadius,Cyl1OuterRadius,Cyl1Dz); TGeoVolume* Cyl1Vol = new TGeoVolume("Cyl1_Vol_Sensor",Cyl1,gGeoMan->GetMedium("beryllium")); // Cone1 TGeoShape *Cone1 = new TGeoCone("Cone1",Cone1Dz,Cone1InnerRadius1,Cone1OuterRadius1, Cone1InnerRadius2,Cone1OuterRadius2); TGeoVolume* Cone1Vol = new TGeoVolume("Cone1_Vol_Sensor",Cone1,gGeoMan->GetMedium("beryllium")); // Cyl2 TGeoShape *Cyl2 = new TGeoTube("Cyl2",Cyl2InnerRadius,Cyl2OuterRadius,Cyl2Dz); TGeoVolume* Cyl2Vol = new TGeoVolume("Cyl2_Vol_Sensor",Cyl2,gGeoMan->GetMedium("beryllium")); // Cyl3 TGeoShape *Cyl3 = new TGeoTube("Cyl3",Cyl3InnerRadius,Cyl3OuterRadius,Cyl3Dz); TGeoVolume* Cyl3Vol = new TGeoVolume("Cyl3_Vol_Sensor",Cyl3,gGeoMan->GetMedium("beryllium")); // Cone2 TGeoShape *Cone2 = new TGeoCone("Cone2",Cone2Dz,Cone2InnerRadius1,Cone2OuterRadius1, Cone2InnerRadius2,Cone2OuterRadius2); TGeoVolume* Cone2Vol = new TGeoVolume("Cone2_Vol_Sensor",Cone2,gGeoMan->GetMedium("beryllium")); // Cyl4 TGeoShape *Cyl4 = new TGeoTube("Cyl4",Cyl4InnerRadius,Cyl4OuterRadius,Cyl4Dz); TGeoVolume* Cyl4Vol = new TGeoVolume("Cyl4_Vol_Sensor",Cyl4,gGeoMan->GetMedium("beryllium")); // Cyl5 TGeoShape *Cyl5 = new TGeoTube("Cyl5",Cyl5InnerRadius,Cyl5OuterRadius,Cyl5Dz); TGeoVolume* Cyl5Vol = new TGeoVolume("Cyl5_Vol_Sensor",Cyl5,gGeoMan->GetMedium("beryllium")); // transformations TGeoTranslation* trtCyl1 = new TGeoTranslation(0.,0.,Cyl1PosZ); TGeoTranslation* trtCone1 = new TGeoTranslation(0.,0.,Cone1PosZ); TGeoTranslation* trtCyl2 = new TGeoTranslation(0.,0.,Cyl2PosZ); TGeoTranslation* trtCyl3 = new TGeoTranslation(0.,0.,Cyl3PosZ); TGeoTranslation* trtCone2 = new TGeoTranslation(0.,0.,Cone2PosZ); TGeoTranslation* trtCyl4 = new TGeoTranslation(0.,0.,Cyl4PosZ); TGeoTranslation* trtCyl5 = new TGeoTranslation(0.,Cyl5PosZ,0.); TGeoTranslation* trtCyl5bis = new TGeoTranslation(0.,-1*Cyl5PosZ,0.); TGeoRotation* dummyrot = new TGeoRotation(); TGeoRotation* rotCyl5 = new TGeoRotation(); rotCyl5->SetAngles(0.,90.,0.); TGeoRotation* rotCyl5bis = new TGeoRotation(); rotCyl5bis->SetAngles(0.,-90.,0.); TGeoCombiTrans* trcCyl1= new TGeoCombiTrans(*trtCyl1,*dummyrot); trcCyl1->SetName("Cyl1"); trcCyl1->RegisterYourself(); TGeoCombiTrans* trcCone1= new TGeoCombiTrans(*trtCone1,*dummyrot); trcCone1->SetName("Cone1"); trcCone1->RegisterYourself(); TGeoCombiTrans* trcCyl2= new TGeoCombiTrans(*trtCyl2,*dummyrot); trcCyl2->SetName("Cyl2"); trcCyl2->RegisterYourself(); TGeoCombiTrans* trcCyl3= new TGeoCombiTrans(*trtCyl3,*dummyrot); trcCyl3->SetName("Cyl3"); trcCyl3->RegisterYourself(); TGeoCombiTrans* trcCone2= new TGeoCombiTrans(*trtCone2,*dummyrot); trcCone2->SetName("Cone2"); trcCone2->RegisterYourself(); TGeoCombiTrans* trcCyl4= new TGeoCombiTrans(*trtCyl4,*dummyrot); trcCyl4->SetName("Cyl4"); trcCyl4->RegisterYourself(); TGeoCombiTrans* trcCyl5= new TGeoCombiTrans(*trtCyl5,*rotCyl5); trcCyl5->SetName("Cyl5"); trcCyl5->RegisterYourself(); TGeoCombiTrans* trcCyl5bis= new TGeoCombiTrans(*trtCyl5bis,*rotCyl5bis); trcCyl5bis->SetName("Cyl6"); trcCyl5bis->RegisterYourself(); TGeoVolumeAssembly* SubunitVol = new TGeoVolumeAssembly("beampipe"); SubunitVol->AddNode(Cyl1Vol,0,trcCyl1); SubunitVol->AddNode(Cone1Vol,0,trcCone1); SubunitVol->AddNode(Cyl2Vol,0,trcCyl2); SubunitVol->AddNode(Cyl3Vol,0,trcCyl3); SubunitVol->AddNode(Cone2Vol,0,trcCone2); SubunitVol->AddNode(Cyl4Vol,0,trcCyl4); SubunitVol->AddNode(Cyl5Vol,0,trcCyl5); SubunitVol->AddNode(Cyl5Vol,0,trcCyl5bis); top->AddNode(SubunitVol,0,new TGeoCombiTrans()); gGeoMan->CloseGeometry(); top->Write(); fi->Close(); // gGeoManager->Export(outfile); top->Draw("ogl"); }