2 #include "G4RunManager.hh"
3 #include "G4UImanager.hh"
4 #include "G4VisExecutive.hh"
5 #include "G4UIExecutive.hh"
7 #include "G4VUserDetectorConstruction.hh"
8 #include "G4VModularPhysicsList.hh"
11 #include "G4AssemblyVolume.hh"
12 #include "G4PVPlacement.hh"
13 #include "G4NistManager.hh"
32 printf(
"\n\nIR box size: Z +/- %.2f [cm], R ~ %.2f [cm]\n\n",
33 eic->GetIrRegionLength()/2,
eic->GetIrRegionRadius());
36 auto expHall_phys =
eic->ConstructG4World();
37 if (!expHall_phys)
exit(0);
38 expHall_phys->GetLogicalVolume()->SetVisAttributes(G4VisAttributes::Invisible);
44 eic->PlaceG4Volumes(expHall_phys);
54 gdmlParser.
Read(
"../../../build/example.vc.gdml",
false);
55 G4AssemblyVolume *avol = GDMLRS->GetAssembly(
"VC.ASSEMBLY");
57 G4VisAttributes* visAttg =
new G4VisAttributes();
58 visAttg->SetColor(.5, .5, .5);
59 visAttg->SetVisibility(
true);
60 visAttg->SetForceWireframe(
false);
61 visAttg->SetForceSolid(
true);
63 std::vector<G4VPhysicalVolume *>::iterator
it = avol->GetVolumesIterator();
64 for (
unsigned int i = 0; i < avol->TotalImprintedVolumes(); i++) {
66 (*it)->GetLogicalVolume()->SetVisAttributes(visAttg);
73 avol->MakeImprint(expHall_phys->GetLogicalVolume(), g4vec,
74 new G4RotationMatrix(), 0,
true);
93 int main(
int argc,
char** argv)
96 printf(
"\n\n usage: %s <EicToyModel-root-file-name>\n\n\n", argv[0]);
104 G4RunManager *runManager =
new G4RunManager;
107 runManager->Initialize();
109 G4VisManager *visManager =
new G4VisExecutive(
"Quiet");
110 visManager->Initialize();
112 G4UImanager *UImanager = G4UImanager::GetUIpointer();
114 G4UIExecutive *ui =
new G4UIExecutive(argc, argv);
115 UImanager->ApplyCommand(
"/vis/open OGL 600x600-0+0");
117 UImanager->ApplyCommand(
"/vis/viewer/set/viewpointThetaPhi 110. 150.");
118 UImanager->ApplyCommand(
"/vis/viewer/set/lightsThetaPhi 110. 150.");
119 UImanager->ApplyCommand(
"/vis/drawVolume ! ! ! -box m -10 0 0 10 -10 10");
123 UImanager->ApplyCommand(
"/vis/viewer/set/background white");
124 UImanager->ApplyCommand(
"/vis/viewer/zoom 2.0");
133 delete ui;
delete visManager;
delete runManager;