EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rich.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file rich.C
1 //
2 // Purpose of script is to emulate a simple RICH configuration with
3 // fake material for approximation of BeAST config.
4 //
5 
6 // Units are given explicitly and as such given to the
7 // ROOT primitive creation and positioning routines;
8 
9 // Meaningless numbers for now; fine;
10 #define _VERSION_ 1
11 #define _SUBVERSION_ 0
12 
13 void rich()
14 {
15  // Load basic libraries;
16  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
17 
19 
20  // Simplify things for the time being;
21  double beam_pipe_radius = 20.0 * eic::mm;
22 
23  Double_t rMin = 850.0 * eic::mm;
24  Double_t rMax = 1600.0 * eic::mm;
25  Double_t wndThickness = 200 * eic::um;
26  Double_t wndEnLocation = 1250.0 * eic::mm;
27  Double_t cf4Thickness = 1000.0 * eic::mm;
28  Double_t cf4Location = wndEnLocation + wndThickness/2 + cf4Thickness/2;
29  Double_t wndExLocation = wndEnLocation + wndThickness + cf4Thickness;
30 
31  // Relative to the gas volume center;
32  Double_t profilerOffset = -200.0 * eic::mm;
33  // Should not really matter, but somehow low density material profiler does not
34  // work well (missing hits); just use a very thin silicon layer;
35  Double_t profilerThickness = 10 * eic::um;
36  Double_t profilerRadius = rMin + (profilerOffset + cf4Thickness/2 - profilerThickness/2)*(rMax-rMin)/cf4Thickness;
37 
38  // RICH entrance window;
39  TGeoTube *wnden = new TGeoTube("richWndEn",
40  beam_pipe_radius,
41  rMin,
42  wndThickness/2);
43  TGeoVolume *vwnden = new TGeoVolume("richWndEn", wnden, rich->GetMedium("carbon"));
44 
45  rich->GetTopVolume()->AddNode(vwnden, 0, new TGeoCombiTrans(0.0, 0.0, wndEnLocation, new TGeoRotation()));
46 
47  // RICH gas volume;
48  TGeoCone *cf4 = new TGeoCone("richVolume",
49  cf4Thickness/2,
50  beam_pipe_radius,
51  rMin,
52  beam_pipe_radius,
53  rMax);
54  TGeoVolume *vcf4 = new TGeoVolume("richVolume", cf4, rich->GetMedium("CF4"));
55  rich->GetTopVolume()->AddNode(vcf4, 0, new TGeoCombiTrans(0.0, 0.0, cf4Location, new TGeoRotation()));
56 
57  // RICH volume tracking profiler plane;
58  TGeoTube *prof = new TGeoTube("richProfiler",
59  beam_pipe_radius,
60  profilerRadius,
61  profilerThickness/2);
62  // Yes, want a different material here, otherwise TGeo transport gets confused;
63  TGeoVolume *vprof = new TGeoVolume("richProfiler", prof, rich->GetMedium("silicon"));
64  vcf4->AddNode(vprof, 0, new TGeoCombiTrans(0.0, 0.0, profilerOffset, new TGeoRotation()));
65  EicGeoMap *richmap = rich->CreateNewMap();
66  richmap->AddGeantVolumeLevel("richProfiler", 1);
67  richmap->SetSingleSensorContainerVolume("richProfiler");
68  rich->AddLogicalVolumeGroup(0, 0, 1);
69  {
70  UInt_t geant[1] = {0}, group = 0, logical[3] = {0, 0, 0};
71 
72  if(rich->SetMappingTableEntry(richmap, geant, group, logical)){
73  cout << "Failed to set mapping table entry!" << endl;
74  exit(0);
75  }//if
76  }
77 
78  // RICH exit window;
79  TGeoTube *wndex = new TGeoTube("richWndEx",
80  beam_pipe_radius,
81  rMax,
82  wndThickness/2);
83  TGeoVolume *vwndex = new TGeoVolume("richWndEx", wndex, rich->GetMedium("carbon"));
84  rich->GetTopVolume()->AddNode(vwndex, 0, new TGeoCombiTrans(0.0, 0.0, wndExLocation, new TGeoRotation()));
85 
86  rich->GetColorTable()->AddPatternMatch("richWndEn", kRed);
87  rich->GetTransparencyTable()->AddPatternMatch("richWndEn", 50);
88 
89  rich->GetColorTable()->AddPatternMatch("richVolume", kMagenta);
90  rich->GetTransparencyTable()->AddPatternMatch("richVolume", 50);
91 
92  rich->GetColorTable()->AddPatternMatch("richProfiler", kCyan);
93  rich->GetTransparencyTable()->AddPatternMatch("richProfiler", 50);
94 
95  rich->GetColorTable()->AddPatternMatch("richWndEx", kRed);
96  rich->GetTransparencyTable()->AddPatternMatch("richWndEx", 50);
97 
98  rich->FinalizeOutput();
99  exit(0);
100 }//rich()