EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fun4all.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file fun4all.cc
1 void MyDetectorDetector::ConstructMe(G4LogicalVolume *logicWorld)
2 {
3  // Import ROOT file with an "EicToyModel" singleton class instance;
4  auto eic = EicToyModel::Import("example.root");
5 
6  // Construct the integration volumes geometry, internally;
7  eic->Construct();
8 
9  // Place them as G4 volumes into the IR world volume all at once;
10  eic->PlaceG4Volumes(logicWorld);
11 
12  // Singleton instance, no mess;
13  auto eic = EicToyModel::Instance();
14 
15  // Get pointer to a particular G4VPhysicalVolume;
16  auto hcal = eic->fwd()->get("HCal")->GetG4Volume();
17 
18  // ...
19 
20  G4VPhysicalVolume *phy = new G4PVPlacement(
21  rotm,
22  G4ThreeVector(m_Params->get_double_param("place_x") * cm,
23  m_Params->get_double_param("place_y") * cm,
24  m_Params->get_double_param("place_z") * cm),
25  //logical, "MyDetector", logicWorld, 0, false, OverlapCheck());
26  logical, "MyDetector", hcal->GetLogicalVolume(), 0, false, OverlapCheck());
27 
28  // ...
29 }