FairRoot/PandaRoot
Functions
create_scit_rootgeo_pSuperModule.C File Reference

Go to the source code of this file.

Functions

int create_scit_rootgeo_pSuperModule (Double_t distance=750)
 

Function Documentation

int create_scit_rootgeo_pSuperModule ( Double_t  distance = 750)

Definition at line 1 of file create_scit_rootgeo_pSuperModule.C.

References cos(), Double_t, fi, geobuild, geoFace, geoLoad, gGeoMan, m, Media, nmed, outfile, phi0, pi, sin(), top, and TString.

1  {
2  // Forward tof geometry parameters
3  //-----------------------------
4  //-- macro created by Alicia S. based on step file
5  //-- barrel-SciTil_18122012
6  //-- edited by D. Steinschaden
7  //-- last update 08.2015
8 
9 
10  //--------------------------------------------------------------------
11  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
12 
13  // Load this libraries
14  gSystem->Load("libGeoBase");
15  gSystem->Load("libParBase");
16  gSystem->Load("libBase");
17  gSystem->Load("libPndData");
18  gSystem->Load("libPassive");
19 
20  TString outfile= "../../../geometry/SciTil_pSuperModule.root";
21  //TString outfile= "../../../geometry/SciTil_test.root";
22  TFile* fi = new TFile(outfile,"RECREATE");
23 
24  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
25  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
26  geoFace->setMediaFile("../../../geometry/media_pnd.geo");
27  geoFace->readMedia();
28  geoFace->print();
29 
30  FairGeoMedia *Media = geoFace->getMedia();
31  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
32 
33  FairGeoMedium *MediumSci = Media->getMedium("polyvinyltoluene");
34  FairGeoMedium *MediumSiPm = Media->getMedium("silicon");
35  FairGeoMedium *MediumCard = Media->getMedium("pcbmvd");
36 
37  const Double_t pi = 3.1415926535;
38  Int_t nmed=geobuild->createMedium(MediumSci); // ----why is the return value saved?
39  nmed=geobuild->createMedium(MediumSiPm);
40  nmed=geobuild->createMedium(MediumCard);
41 
42  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
43  TGeoVolume *top = new TGeoVolumeAssembly("SciT");
44 
45 
46  gGeoMan->SetTopVolume(top);
47 
48 
49  //Volumes containing SENSOR in the name will be taken into account in the MC hit production
50  //check PndSciT.h and PndSciT.cxx and the listofsensitives
51 
52  TGeoBBox* TileShape;
53  TileShape = new TGeoBBox("SciTil_logicTile", 9.0, 0.25, 90.0);// dimension is always given from the mid to the end e.g. only the half length
54 
55  TGeoVolume* TileVol;
56  TileVol = new TGeoVolume("SciTil_SENSOR",TileShape, gGeoMan->GetMedium("polyvinyltoluene"));
57  TileVol->SetLineColor(kBlue);
58 
59 
60  // -----------------creating Barrel --------------------------------------------
61  TGeoVolumeAssembly* BarrelAssVol = new TGeoVolumeAssembly("SciTil_barrel");
62 
63  // ------------Values of Dirc Detector------------
64  Double_t radius = 50.55 ; // 50. radius in middle of the barbox (x and y)
65  Double_t hthick = 1.7/2.; // 1.7/2. half thickness of the bars
66  Double_t barnum = 6; // 6 number of bars per barbox
67  Int_t bbnum = 16; //16. total number of sides = barboxes
68  Double_t bbGap = 1.5; //1.5 gap btw the neighboring barboxes (at the middle height)
69  Double_t pipehAngle = 3.6; //3.6 [degrees] half of the angular space needed for the target pipe
70 
71 
72  Double_t phi0 = (180.-2.*pipehAngle)/bbnum + pipehAngle;
73  Double_t dphi = (180.-2.*pipehAngle)/bbnum*2.;
74 
75 //taking angles from dirc geometry
76  Double_t dx_bbox, dy_bbox, dz_bbox, phi_curr;
77 
78  for(Int_t m = 0; m < bbnum; m ++){
79  phi_curr = (90. - phi0 - dphi*m)/180.*pi;
80  if(m > bbnum/2-1){ phi_curr = (90. - phi0 - dphi*m - 2.*pipehAngle)/180.*pi; }
81  dx_bbox = radius * cos(phi_curr);
82  dy_bbox = radius * sin(phi_curr);
83 
84  TGeoRotation rot_bbox;
85  rot_bbox.RotateZ( -phi0 - m*dphi - (TMath::Floor(2.*m/bbnum))*(2.*pipehAngle));
86  BarrelAssVol->AddNode(TileVol, m, new TGeoCombiTrans(dx_bbox, dy_bbox, 0, new TGeoRotation(rot_bbox)));
87  }
88 
89 
90  top->AddNode(BarrelAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
91  //top->AddNode(SModAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
92  //top->AddNode(LineAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
93 
94  gGeoMan->SetVisLevel(5);
95  gGeoMan->CloseGeometry();
96  top->Write();
97  fi->Close();
98  // gGeoManager->Export(outfile);
99  top->Draw("ogl");
100 
101  return 0;
102  }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
FairGeoLoader * geoLoad
FairGeoMedia * Media
__m128 m
Definition: P4_F32vec4.h:28
TGeoManager * gGeoMan
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
#define pi
Definition: createSTT.C:60
TGeoVolume * top
FairGeoBuilder * geobuild
TFile * fi
Double_t
Double_t phi0
Definition: checkhelixhit.C:60
FairGeoInterface * geoFace
TString outfile