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