本文整理汇总了C++中TGeoManager::PrintOverlaps方法的典型用法代码示例。如果您正苦于以下问题:C++ TGeoManager::PrintOverlaps方法的具体用法?C++ TGeoManager::PrintOverlaps怎么用?C++ TGeoManager::PrintOverlaps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGeoManager
的用法示例。
在下文中一共展示了TGeoManager::PrintOverlaps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_bpipe_geometry_v13e
//.........这里部分代码省略.........
pipe->AddNode(pipe3, 0);
TGeoVolume* pipevac2 = MakeVacuum(2, nSects02, z02, rin02, rout02, vacuum, &infoFile);
pipevac2->SetLineColor(kCyan);
pipe->AddNode(pipevac2, 0);
//*/
// define some rotation & translation for pipe4-pipe7 & pipevac3-pipevac5
// Initial phi (Euler rotation angle about Z)
// Initial theta (Euler rotation angle about new X)
// Initial psi (Euler rotation angle about new Z)
cout<<endl<<"Rotation angle (@[0;0;1800]mm)="<< rotangle <<"deg";
TGeoRotation *r1 = new TGeoRotation("r1", 90., rotangle, 0.); // deg - Euler angles
r1->RegisterYourself();
Double_t shift = rotangle/10.+0.1; // cm - volume boolean operation correction - TODO
Double_t dx=0., dy=0., dz=1800.-10.*shift; // mm
TGeoCombiTrans *c1 = new TGeoCombiTrans("c1", dx/10., dy/10., dz/10., r1); // mm->cm
c1->RegisterYourself();
TGeoTranslation *t1 = new TGeoTranslation("t1", 0., 0., 180.-shift); // cm
t1->RegisterYourself();
Double_t phi, theta, psi;
c1->GetRotation()->GetAngles(phi, theta, psi);
infoFile << endl << "Beam pipe section: " << pipe4name << endl;
infoFile << "Traslation(dx,dy,dz): "<< dx <<" "<< dy <<" "<< dz <<" mm" << endl;
infoFile << "Rotation(phi,theta,psi): " << phi <<" "<< theta <<" "<< psi <<" deg"<< endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
// create shape components for pipe4
TGeoPcon* p4 = MakeShape(nSects4, "p4", z4, rin4, rout4, &infoFile);
TGeoBBox* b = new TGeoBBox("b", 7., 7., shift); // cm 0.13
// create a composite for pipe4
//*
TGeoCompositeShape *cs1 = new TGeoCompositeShape("cs1", "p4:r1-b");
TGeoVolume *pipe4 = new TGeoVolume("pipe4",cs1, pipeMedium);
pipe4->SetLineColor(kGreen+2);
pipe->AddNode(pipe4, 0, t1);
//*/
// create shape components for pipevac3
TGeoPcon* p03 = MakeShape(nSects03, "p03", z03, rin03, rout03, &infoFileEmpty);
// create a composite for pipevac3
TGeoCompositeShape *cs2 = new TGeoCompositeShape("cs2", "p03:r1-b");
TGeoVolume *pipevac3 = new TGeoVolume("pipevac3",cs2, vacuum);
pipevac3->SetLineColor(kCyan);
pipe->AddNode(pipevac3, 0, t1);
//*
infoFile << endl << "Beam pipe section: " << pipe5name << endl;
infoFile << "Traslation(dx,dy,dz): "<< dx <<" "<< dy <<" "<< dz <<" mm" << endl;
infoFile << "Rotation(phi,theta,psi): " << phi <<" "<< theta <<" "<< psi <<" deg"<< endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
TGeoVolume* pipe5 = MakePipe (5, nSects5, z5, rin5, rout5, pipeMedium, &infoFile);
pipe5->SetLineColor(kGreen);
pipe->AddNode(pipe5, 0, c1);
TGeoVolume* pipevac4 = MakeVacuum(4, nSects04, z04, rin04, rout04, vacuum, &infoFile);
pipevac4->SetLineColor(kCyan);
pipe->AddNode(pipevac4, 0, c1);
infoFile << endl << "Beam pipe section: " << pipe6name << endl;
infoFile << "Traslation(dx,dy,dz): "<< dx <<" "<< dy <<" "<< dz <<" mm" << endl;
infoFile << "Rotation(phi,theta,psi): " << phi <<" "<< theta <<" "<< psi <<" deg"<< endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
TGeoVolume* pipe6 = MakePipe (6, nSects6, z6, rin6, rout6, pipeMedium, &infoFile);
pipe6->SetLineColor(kBlue);
pipe->AddNode(pipe6, 0, c1);
infoFile << endl << "Beam pipe section: " << pipe7name << endl;
infoFile << "Traslation(dx,dy,dz): "<< dx <<" "<< dy <<" "<< dz <<" mm" << endl;
infoFile << "Rotation(phi,theta,psi): " << phi <<" "<< theta <<" "<< psi <<" deg"<< endl;
infoFile << setw(2) << "i" << setw(10) << "Z,mm" << setw(10) << "Rin,mm" << setw(10) << "Rout,mm" << setw(10) << "h,mm" << endl;
TGeoVolume* pipe7 = MakePipe (7, nSects7, z7, rin7, rout7, pipeMedium, &infoFile);
pipe7->SetLineColor(kGreen);
pipe->AddNode(pipe7, 0, c1);
TGeoVolume* pipevac5 = MakeVacuum(5, nSects05, z05, rin05, rout05, vacuum, &infoFile);
pipevac5->SetLineColor(kCyan);
pipe->AddNode(pipevac5, 0, c1);
//*/
// ----- End --------------------------------------------------
// --------------- Finish -----------------------------------------------
top->AddNode(pipe, 1);
cout << endl << endl;
gGeoMan->CloseGeometry();
gGeoMan->CheckOverlaps(0.001);
gGeoMan->PrintOverlaps();
gGeoMan->Test();
// visualize it with ray tracing, OGL/X3D viewer
//top->Raytrace();
top->Draw("ogl");
//top->Draw("x3d");
TFile* rootFile = new TFile(rootFileName, "RECREATE");
top->Write();
cout << endl;
cout << "Geometry " << top->GetName() << " written to "
<< rootFileName << endl;
rootFile->Close();
infoFile.close();
}