EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicToyModelDetector.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicToyModelDetector.cc
1 
2 #include <phparameter/PHParameters.h>
3 
4 #include <EicToyModelDetector.h>
5 #include <EicToyModel.h>
6 
7 using namespace std;
8 
9 //____________________________________________________________________________..
11  PHCompositeNode *Node,
13  const std::string &dnam)
14  : PHG4Detector(subsys, Node, dnam)
15  , m_Params(parameters)
16 {
17 }
18 
19 //_______________________________________________________________
20 int EicToyModelDetector::IsInDetector(G4VPhysicalVolume *volume) const
21 {
22  set<G4VPhysicalVolume *>::const_iterator iter = m_PhysicalVolumesSet.find(volume);
23  if (iter != m_PhysicalVolumesSet.end())
24  {
25  return 1;
26  }
27  return 0;
28 }
29 
30 //_______________________________________________________________
31 void EicToyModelDetector::ConstructMe(G4LogicalVolume *logicWorld)
32 {
33  auto eic = EicToyModel::Import(m_Params->get_string_param("EtmInputRootFile").c_str());
34  // Build internal representation;
35  eic->Construct();
36 
37  // Place all of the integration volumes into the provided World G4LogicalVolume;
38  // this is optional (can also place them one by one, by hand);
39  //eic->PlaceG4Volumes(logicWorld);
40  eic->DefineG4World(logicWorld);
41 
42  return;
43 }
44 
45 //_______________________________________________________________
46 void EicToyModelDetector::Print(const std::string &what) const
47 {
48  cout << "EicToyModel Detector:" << endl;
49  if (what == "ALL" || what == "VOLUME")
50  {
51  cout << "Version 0.1" << endl;
52  cout << "Parameters:" << endl;
53  m_Params->Print();
54  }
55  return;
56 }