EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
makeGeom.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file makeGeom.C
1 void makeGeom()
2 {
3  //--- Definition of a simple geometry
4  // gSystem->Load("libGeom");
5  new TGeoManager("genfitGeom", "GENFIT geometry");
6 
7 
8  unsigned int medInd(0);
9  Double_t mPar[10];
10  //TAG sollte wieder 0 werden sens flag
11  mPar[0]=0.;//sensitive volume flag
12  mPar[1]=1.;//magnetic field flag
13  mPar[2]=30.;//max fiel in kGauss
14  mPar[3]=0.1;//maximal angular dev. due to field
15  mPar[4]=0.01;//max step allowed (in cm)
16  mPar[5]=1.e-5;//max fractional energy loss
17  mPar[6]=1.e-3;//boundary crossing accuracy
18  mPar[7]=1.e-5;//minimum step
19  mPar[8]=0.;//not defined
20  mPar[9]=0.;//not defined
21 
22  TGeoMaterial *_siliconMat = new TGeoMaterial("siliconMat",28.0855,14.,2.329);
23  _siliconMat->SetRadLen(1.);//calc automatically, need this for elemental mats.
24  TGeoMedium *_silicon = new TGeoMedium("silicon",medInd++,_siliconMat,mPar);
25 
26  TGeoMixture *_airMat = new TGeoMixture("airMat",3);
27  _airMat->AddElement(14.01,7.,.78);
28  _airMat->AddElement(16.00,8.,.21);
29  _airMat->AddElement(39.95,18.,.01);
30  _airMat->SetDensity(1.2e-3);
31  TGeoMedium *_air = new TGeoMedium("air",medInd++,_airMat,mPar);
32 
33  TGeoMixture *_vacuumMat = new TGeoMixture("vacuumMat",3);
34  _vacuumMat->AddElement(14.01,7.,.78);
35  _vacuumMat->AddElement(16.00,8.,.21);
36  _vacuumMat->AddElement(39.95,18.,.01);
37  _vacuumMat->SetDensity(1.2e-15);
38  TGeoMedium *_vacuum = new TGeoMedium("vacuum",medInd++,_vacuumMat,mPar);
39 
40 
41 
42 
43  TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
44  assert(vacuum!=NULL);
45  TGeoMedium *air = gGeoManager->GetMedium("air");
46  assert(air!=NULL);
47  TGeoMedium *sil = gGeoManager->GetMedium("silicon");
48  assert(sil!=NULL);
49 
50  TGeoVolume *top = gGeoManager->MakeBox("TOPPER", air, 1000., 1000., 1000.);
51  gGeoManager->SetTopVolume(top); // mandatory !
52 
53  double thickness(0.05);
54  double distance = 1;
55 
56  for (unsigned int i=1; i<5; ++i){
57  TGeoVolume *redBullCan = gGeoManager->MakeTube("redBullCan", sil, i*distance, i*distance+thickness, 20.);//, 90., 270.);
58  redBullCan->SetLineColor(kRed);
59  top->AddNode(redBullCan, 1, gGeoIdentity);
60  }
61 
62 
63  //--- close the geometry
64  gGeoManager->CloseGeometry();
65 
66  //--- draw the ROOT box
67  gGeoManager->SetVisLevel(10);
68  //top->Draw("ogl");
69  TFile *outfile = TFile::Open("genfitGeom.root","RECREATE");
70  gGeoManager->Write();
71  outfile->Close();
72 }