EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ippt.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ippt.C
1 
2 //
3 // Example tracker: 10x 200um thick layers of silicon in H+ beam direction;
4 // output file (fwdst.root) can be used as geometry input for
5 // simulation.C->digitization.C->reconstruction.C scripts in this directory;
6 //
7 // resolutions are specified at a later stage (see digitization.C);
8 //
9 // Prefer to declare dimensions in [mm]; convert to [cm] when calling ROOT shape
10 // definition routines only;
11 //
12 
13 void ippt()
14 {
15  // Load basic libraries;
16  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17 
18  // Detector name will be "IPPT" (IP Point);
19  EicGeoParData *ippt = new EicGeoParData("IPPT", 0, 0);
20  ippt->SetFileName("ip-point.root");
21 
22  Double_t fakeThickness = 0.1;
23  //Double_t wndThickness = 0.3;
24  // Rectangular wafers; beam pipe will not be used in simulation.C anyway,
25  // so why bother about more realistic shapes;
26  //Double_t fakeWidth = 250.0;
27  Double_t fakeRadius = 20.0;
28 
29 
30  // Fake registering station at the IP;
31  TGeoTube *ipspot = new TGeoTube("IpPoint",
32  0.0,
33  0.1 * fakeRadius,
34  0.1 * fakeThickness/2);
35  TGeoVolume *vippt = new TGeoVolume("IpPoint", ipspot, ippt->GetMedium("silicon"));
36 
37  EicGeoMap *fgmap = ippt->CreateNewMap();
38  fgmap->AddGeantVolumeLevel("IpPoint", 1);
39  fgmap->SetSingleSensorContainerVolume("IpPoint");
40 
41  ippt->AddLogicalVolumeGroup(0, 0, 1);
42 
43  {
44  UInt_t geant[1] = {0}, group = 0, logical[3] = {0, 0, 0};
45 
46  if (ippt->SetMappingTableEntry(fgmap, geant, group, logical)) {
47  cout << "Failed to set mapping table entry!" << endl;
48  exit(0);
49  } //if
50 
51  ippt->GetTopVolume()->AddNode(vippt, 0, new TGeoCombiTrans(0.0, 0.0, 0.1, new TGeoRotation()));
52  } // for wf
53 
54 #if _LATER_
55  TGeoBBox *wndbox = new TGeoBBox("ExitWindow",
56  0.1 * fakeWidth/2,
57  0.1 * fakeWidth/2,
58  0.1 * wndThickness/2);
59  TGeoVolume *vwnd = new TGeoVolume("ExitWindow", wndbox, ippt->GetMedium("iron"));
60  ippt->GetTopVolume()->AddNode(vwnd, 0, new TGeoCombiTrans(0.0, 0.0, 0.1*4900.0, new TGeoRotation()));
61 #endif
62 
63  ippt->GetColorTable()->AddPatternMatch ("IpPoint", kBlue);
64  ippt->GetTransparencyTable()->AddPatternMatch("IpPoint", 50);
65  //ippt->GetColorTable()->AddPatternMatch ("Exit", kGreen);
66  //ippt->GetTransparencyTable()->AddPatternMatch("Exit", 50);
67 
68  // A unified user call which places assembled detector volume in a proper place in MASTER (top)
69  // coordinate system, puts this MASTER (top) volume into GEANT volume tree, and dumps this tree
70  // together with EicRoot mapping table in one file;
71  ippt->FinalizeOutput();
72 
73  // Yes, always exit;
74  exit(0);
75 } // tracker()
76