EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
beampipe.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file beampipe.C
1 
3 {
4  // Load basic libraries;
5  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
6 
7  //
8  // Prefer to think in [mm] and convert to [cm] when calling ROOT shape
9  // definition routines only;
10  //
11 
13 
14  // Create a central beam pipe element; 800um thick beryllium;
15  BeamPipeElement *ip = new BeamPipeElement("beryllium", 0.800);
16  // Let it be a cylindrical pipe of some length; more or less similar to ALICE IP;
17  ip->AddSection(-400.0, 36.00);
18  ip->AddSection( 400.0, 36.00);
19 
20  // And some arbitrary stucture to cover the rest of +/-4.5m around the IP;
21  BeamPipeElement *p1 = new BeamPipeElement("aluminum", 1.000);
22  // NB: starting offset does not really matter here;
23  p1->AddSection( 400.0, 36.00);
24  p1->AddSection(1000.0, 40.00);
25  p1->AddSection(4500.0, 40.00);
26 
27  // Place all elements in this order; assume can use IP-symmetric pipe
28  // for now; NB: swap the electron-beam-going piece;
29  bpipe->AddElement (p1, BeamPipeElement::Swap);
30  bpipe->AddIpElement(ip);
31  bpipe->AddElement (p1);
32 
33  // Let it just be all gray?;
34  bpipe->GetColorTable()->AddPrefixMatch("Beampipe", kGray);
35 
36  // Geometry is declared -> create it in ROOT and write out;
37  bpipe->ConstructGeometry();
38 
39  // Yes, always exit, since otherwise CINT (sometimes) ignores editing results and uses
40  // cached values (really so?);
41  exit(0);
42 }
43