EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pid.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pid.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("pid-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  vtx->add("Si Tracker",17 * etm::cm);
19  }
20 
21  // Barrel;
22  {
23  auto mid = eic->mid(); mid->offset( 20 * etm::cm);
24 
25  mid->add("TPC", 60 * etm::cm);
26 
27 #ifdef _SPLIT_
28  mid->add("Cherenkov", 25 * etm::cm)->brick();
29  mid->add("MPGD", 5 * etm::cm)->brick();
30  mid->add("TOF", 5 * etm::cm)->brick();
31 #else
32  mid->add("PID", 35 * etm::cm);
33 #endif
34 
35  mid->add("Preshower", 5 * etm::cm)->brick();
36  mid->add("EmCal", 30 * etm::cm);
37  mid->add("Cryostat", 40 * etm::cm);
38  mid->add("HCal", 120 * etm::cm);
39  }
40 
41  // Hadron-going endcap;
42  {
43  auto fwd = eic->fwd(); fwd->offset(150 * etm::cm);
44 
45  for(unsigned nn=0; nn<3; nn++)
46  fwd->add("MPGD", 5 * etm::cm)->brick();
47  fwd->marker();
48 
49 #ifdef _SPLIT_
50  fwd->add("HM RICH", 120 * etm::cm)->trim(0.8, 1.0);
51  for(unsigned nn=0; nn<3; nn++)
52  fwd->add("TRD", 15 * etm::cm)->brick();
53  fwd->add("TOF", 5 * etm::cm);
54 #else
55  fwd->add("PID", 170 * etm::cm)->trim(1.0);
56 #endif
57 
58  fwd->add("Preshower", 5 * etm::cm);
59  fwd->add("EmCal", 35 * etm::cm);
60  fwd->add("HCal", 105 * etm::cm);//->trim(0.9, 0.0);
61  }
62 
63  // Electron-going endcap;
64  {
65  auto bck = eic->bck(); bck->offset(120 * etm::cm);
66 
67  for(unsigned nn=0; nn<3; nn++)
68  bck->add("MPGD", 5 * etm::cm)->brick();
69 
70  for(unsigned nn=0; nn<3; nn++)
71  bck->add("TRD", 15 * etm::cm)->brick();
72  bck->marker();
73 
74 #ifdef _SPLIT_
75  bck->add("TOF", 5 * etm::cm)->brick();
76  bck->add("Cherenkov", 25 * etm::cm);
77 #else
78  bck->add("PID", 30 * etm::cm);
79 #endif
80 
81  bck->add("Preshower", 5 * etm::cm)->brick();
82  bck->add("EmCal", 35 * etm::cm);
83  bck->add("HCal", 105 * etm::cm)->brick();
84  }
85 
86  // Declare eta boundary configuration;
87  {
88 #ifdef _SPLIT_
89  eic->vtx()->get("Si Tracker")->stretch(eic->bck()->get("TOF"));
90  eic->vtx()->get("Si Tracker")->stretch(eic->fwd()->get("HM RICH"));
91 #else
92  eic->vtx()->get("Si Tracker")->stretch(eic->bck()->get("PID"));
93  eic->vtx()->get("Si Tracker")->stretch(eic->fwd()->get("PID"));
94 #endif
95 
96  eic->mid()->get("TPC") ->stretch(eic->bck()->get("MPGD"));
97  eic->mid()->get("TPC") ->stretch(eic->fwd()->get("MPGD"));
98 
99  eic->mid()->get("HCal") ->stretch(eic->bck()->get("HCal"), 80 * etm::cm);
100  eic->mid()->get("HCal") ->stretch(eic->fwd()->get("HCal"), 10 * etm::cm);
101 
102  //eic->bck()->get("TRD", 1)->stretch(eic->mid()->get("EmCal"));
103  //eic->mid()->get("EmCal")->stretch(eic->bck()->get("PID"));
104  }
105 
106  // Beautify picture a little bit;
107  eic->ApplyStandardTrimming();
108 
109  // Draw horizontal cross cut view; write the .root file out;
110  eic->hdraw();
111  eic->write();
112 }