EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4All_G4_QtDisplay.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4All_G4_QtDisplay.C
1 
2 //
3 // VST geometry creation and visualization;
4 //
5 
7 #include <g4main/PHG4Reco.h>
8 #include <g4main/PHG4Detector.h>
9 
10 #include <EicToyModelSubsystem.h>
11 #include <EicRootVstSubsystem.h>
12 #include <EtmOrphans.h>
13 
14 R__LOAD_LIBRARY(libeicdetectors.so)
15 
16 // Optionally may want to place the detectors into the respective EicToyModel integration volume bubbles;
17 #define _USE_INTEGRATION_VOLUMES_
18 
20 {
21  // Make the Server;
23 
24  // Geant4 setup;
25  PHG4Reco* g4 = new PHG4Reco();
26  // Well, the GDML export does not work properly for these volumes;
27  g4->save_DST_geometry(false);
28 
29  // EicToyModel integration volumes;
30 #ifdef _USE_INTEGRATION_VOLUMES_
31  auto etm = new EicToyModelSubsystem("EicToyModel");
32  etm->set_string_param("EtmInputRootFile", "../../build/eicroot.root");
33  etm->SetActive(false);
34  //beast->SuperDetector("MAGNET");
35  g4->registerSubsystem(etm);
36 #endif
37 
38  // EicRoot media import; neither bound to EicToyModel nor to a particular EicRoot detector;
39  EicGeoParData::ImportMediaFile("../../examples/eicroot/media.geo");
40 
41  // EicRoot vertex tracker;
42  auto vst = new EicRootVstSubsystem("EicVst");
43  vst->SetActive(true);
44  // Otherwise will be placed into the world volume directly;
45 #ifdef _USE_INTEGRATION_VOLUMES_
46  vst->set_string_param("MotherVolume", "TRACKER");
47 #endif
48  {
49  auto ibcell = new MapsMimosaAssembly();
50 
51  // Compose barrel layers; parameters are:
52  // - cell assembly type;
53  // - number of staves in this layer;
54  // - number of chips in a stave;
55  // - chip center installation radius;
56  // - additional stave slope around beam line direction; [degree];
57  // - layer rotation around beam axis "as a whole"; [degree];
58  vst->AddBarrelLayer(ibcell, 3*12, 9, 3*23.4 * etm::mm, 12.0, 0.0);
59  }
61 
62  se->registerSubsystem(g4);
63 
64  g4->InitRun(se->topNode());
65  g4->ApplyDisplayAction();
66  g4->StartGui();
67 } // Fun4All_G4_QtDisplay()