EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ip.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ip.C
1 
2 //
3 // A small spherical shell located at (0,0,0);
4 //
5 
6 void ip()
7 {
8  // Load basic libraries;
9  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
10 
11  EicGeoParData *sph = new EicGeoParData("IP", 0, 0);
12  // Output ROOT file name;
13  sph->SetFileName("ip-sphere.root");
14 
15  double rmin = 0.020 *eic::mm;
16  double rmax = 0.050 *eic::mm;
17 
18  // Create a "container" TGeo box volume;
19  TGeoSphere *sphere = new TGeoSphere("Sphere", rmin, rmax);
20  TGeoVolume *vsphere = new TGeoVolume("Sphere", sphere, sph->GetMedium("air"));
21 
22  {
23  EicGeoMap *fgmap = sph->CreateNewMap();
24  fgmap->AddGeantVolumeLevel("Sphere", 1);
25  fgmap->SetSingleSensorContainerVolume("Sphere");
26 
27  sph->AddLogicalVolumeGroup(0, 0, 1);
28 
29  UInt_t geant[1] = {0}, group = 0, logical[3] = {0, 0, 0};
30 
31  sph->SetMappingTableEntry(fgmap, geant, group, logical);
32 
33  sph->GetTopVolume()->AddNode(vsphere, 0, new TGeoCombiTrans(0.0, 0.0, 0.0, new TGeoRotation()));
34  }
35 
36  // Define color attributes of the silicon wafers (NB: volumes which are not
37  // described this way will NOT be visible in the event display;
38  sph->GetColorTable()->AddPatternMatch ("Sphere", kGreen);
39  sph->GetTransparencyTable()->AddPatternMatch("Sphere", 50);
40 
41  // A unified user call which places assembled detector volume in a proper place in MASTER (top)
42  // coordinate system, puts this MASTER (top) volume into GEANT volume tree, and dumps this tree
43  // together with EicRoot mapping table in one file;
44  sph->FinalizeOutput();
45 
46  // Yes, always exit;
47  exit(0);
48 } // ip()
49