EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
tracking.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file tracking.C
1 
2 //#define _SPLIT_
3 
4 {
5  auto eic = new EicToyModel();
6 
7  // Shift IP if needed; define canvas width; request eta=0 line in the drawing; set name;
8  eic->ip(-50.0)->width(1500)->AddEtaLine(0.0)->SetName("tracking-example");
9  // Define acceptance ranges and the vacuum chamber design;
10  eic->acceptance(-4.2, -1.0, 1.2, 4.2);
11  eic->DefineVacuumChamber(new vc2020_03_20());
12 
13  // Vertex tracker;
14  {
15  // BUG: G4 event display does not work well for <3.2cm;
16  auto vtx = eic->vtx(); vtx->offset(3.2 * etm::cm);
17 
18 #ifdef _SPLIT_
19  vtx->add("Si Tracker",17 * etm::cm);
20 #else
21  vtx->add("TRACKER", 17 * etm::cm);
22 #endif
23  }
24 
25  // Barrel;
26  {
27  auto mid = eic->mid(); mid->offset( 20 * etm::cm);
28 
29 #ifdef _SPLIT_
30  for(unsigned nn=0; nn<5; nn++) {
31  mid->add("MPGD", 5 * etm::cm)->brick();
32  mid->gap( 10 * etm::cm);
33  } //for nn
34 #else
35  mid->add("TRACKER", 75 * etm::cm);
36 #endif
37 
38  mid->add("Cherenkov", 10 * etm::cm)->brick();
39  mid->add("MPGD", 5 * etm::cm)->brick();
40  mid->add("TOF", 5 * etm::cm)->brick();
41 
42  mid->add("Preshower", 5 * etm::cm)->brick();
43  mid->add("EmCal", 30 * etm::cm);
44  mid->add("Cryostat", 40 * etm::cm);
45  mid->add("HCal", 120 * etm::cm);
46  }
47 
48  // Hadron-going endcap;
49  {
50  auto fwd = eic->fwd(); fwd->offset(150 * etm::cm);
51 
52 #ifdef _SPLIT_
53  for(unsigned nn=0; nn<3; nn++)
54  fwd->add("MPGD", 5 * etm::cm)->brick();
55 #else
56  fwd->add("TRACKER", 15 * etm::cm)->trim(0.8, 1.0);
57 #endif
58  fwd->marker();
59 
60  fwd->add("HM RICH", 110 * etm::cm)->trim(0.8, 1.0);
61  for(unsigned nn=0; nn<3; nn++)
62  fwd->add("TRD", 15 * etm::cm)->brick();
63  fwd->add("TOF", 5 * etm::cm);
64 
65  fwd->add("Preshower", 5 * etm::cm);
66  fwd->add("EmCal", 35 * etm::cm);
67  fwd->add("HCal", 105 * etm::cm);
68  }
69 
70  // Electron-going endcap;
71  {
72  auto bck = eic->bck(); bck->offset(120 * etm::cm);
73 
74 #ifdef _SPLIT_
75  for(unsigned nn=0; nn<3; nn++)
76  bck->add("MPGD", 5 * etm::cm)->brick();
77 
78  for(unsigned nn=0; nn<3; nn++)
79  bck->add("TRD", 15 * etm::cm)->brick();
80 #else
81  bck->add("TRACKER", 60 * etm::cm)->trim(1.0, 1.0);
82 #endif
83  bck->marker();
84 
85  bck->add("Cherenkov", 25 * etm::cm);
86  bck->add("Preshower", 5 * etm::cm)->brick();
87  bck->add("EmCal", 35 * etm::cm);
88  bck->add("HCal", 105 * etm::cm)->brick();
89  }
90 
91  // Declare eta boundary configuration;
92  {
93 #ifdef _SPLIT_
94  const char *si = "Si Tracker", *mpgd = "MPGD";
95 #else
96  const char *si = "TRACKER", *mpgd = si;
97 #endif
98  eic->vtx()->get(si) ->stretch(eic->bck()->get("Cherenkov"));
99  eic->vtx()->get(si) ->stretch(eic->fwd()->get("HM RICH"));
100 
101 #ifdef _SPLIT_
102  for(unsigned nn=0; nn<5; nn++) {
103  eic->mid()->get(mpgd, nn) ->stretch(eic->bck()->get(mpgd), -20.*(4-nn) * etm::cm);
104  eic->mid()->get(mpgd, nn) ->stretch(eic->fwd()->get(mpgd), -20.*(4-nn) * etm::cm);
105  } //for nn
106 #else
107  eic->mid()->get(mpgd) ->stretch(eic->bck()->get(mpgd));
108  eic->mid()->get(mpgd) ->stretch(eic->fwd()->get(mpgd));
109 #endif
110 
111  eic->mid()->get("HCal") ->stretch(eic->bck()->get("HCal"));
112  eic->mid()->get("HCal") ->stretch(eic->fwd()->get("HCal"));
113 
114  eic->mid()->get("Cryostat") ->stretch(eic->bck()->get("HCal"));
115  eic->mid()->get("EmCal") ->stretch(eic->bck()->get("EmCal"));
116  }
117 
118  // Beautify picture a little bit;
119  eic->ApplyStandardTrimming();
120 
121  // Draw horizontal cross cut view; write the .root file out;
122  eic->hdraw();
123  eic->write();
124  eic->Export("tracking-example.stp");
125 }