本文整理汇总了C++中TGeoManager::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoManager::SetName方法的具体用法?C++ TGeoManager::SetName怎么用?C++ TGeoManager::SetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGeoManager
的用法示例。
在下文中一共展示了TGeoManager::SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_bpipe_geometry_v13e
//.........这里部分代码省略.........
TString geoPath = gSystem->Getenv("VMCWORKDIR");
TString medFile = geoPath + "/geometry/media.geo";
geoFace->setMediaFile(medFile);
geoFace->readMedia();
TGeoManager* gGeoMan = gGeoManager;
// --------------------------------------------------------------------------
// ----------------- Get and create the required media -----------------
FairGeoMedia* geoMedia = geoFace->getMedia();
FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
// ---> pipe medium
FairGeoMedium* fPipeMedium = geoMedia->getMedium(pipeMediumName.Data());
TString fairError = "FairMedium " + pipeMediumName + " not found";
if ( ! fPipeMedium ) Fatal("Main", fairError.Data());
geoBuild->createMedium(fPipeMedium);
TGeoMedium* pipeMedium = gGeoMan->GetMedium(pipeMediumName.Data());
TString geoError = "Medium " + pipeMediumName + " not found";
if ( ! pipeMedium ) Fatal("Main", geoError.Data());
// ---> vacuum
FairGeoMedium* mVacuum = geoMedia->getMedium("vacuum");
if ( ! mVacuum ) Fatal("Main", "FairMedium vacuum not found");
geoBuild->createMedium(mVacuum);
TGeoMedium* vacuum = gGeoMan->GetMedium("vacuum");
if ( ! vacuum ) Fatal("Main", "Medium vacuum not found");
// --------------------------------------------------------------------------
// -------------- Create geometry and top volume -------------------------
gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
gGeoMan->SetName("PIPEgeom");
TGeoVolume* top = new TGeoVolumeAssembly("TOP");
gGeoMan->SetTopVolume(top);
TGeoVolume* pipe = new TGeoVolumeAssembly(pipeName.Data());
// --------------------------------------------------------------------------
// ----- Create sections -------------------------------------------------
infoFile << endl << "Beam pipe section: " << pipe1name << endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
//*
TGeoVolume* pipe1 = MakePipe (1, nSects1, z1, rin1, rout1, pipeMedium, &infoFile);
pipe1->SetLineColor(kGray);
pipe->AddNode(pipe1, 0);
infoFile << endl << "Beam pipe section: " << pipe2name << endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
TGeoVolume* pipe2 = MakePipe (2, nSects2, z2, rin2, rout2, pipeMedium, &infoFile);
pipe2->SetLineColor(kBlue);
pipe->AddNode(pipe2, 0);
TGeoVolume* pipevac1 = MakeVacuum(1, nSects01, z01, rin01, rout01, vacuum, &infoFile);
pipevac1->SetLineColor(kCyan);
pipe->AddNode(pipevac1, 0);
infoFile << endl << "Beam pipe section: " << pipe3name << endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
TGeoVolume* pipe3 = MakePipe (3, nSects3, z3, rin3, rout3, pipeMedium, &infoFile);
pipe3->SetLineColor(kGreen);
pipe->AddNode(pipe3, 0);
TGeoVolume* pipevac2 = MakeVacuum(2, nSects02, z02, rin02, rout02, vacuum, &infoFile);
pipevac2->SetLineColor(kCyan);
pipe->AddNode(pipevac2, 0);
//*/