FairRoot/PandaRoot
Functions
create_scit_rootgeo_201505.C File Reference

Go to the source code of this file.

Functions

int create_scit_rootgeo_201505 (Double_t distance=750)
 

Function Documentation

int create_scit_rootgeo_201505 ( Double_t  distance = 750)

Definition at line 1 of file create_scit_rootgeo_201505.C.

References cos(), Double_t, dx, dz, 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 04.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_201505.root";
21  TFile* fi = new TFile(outfile,"RECREATE");
22 
23  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
24  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
25  geoFace->setMediaFile("../../../geometry/media_pnd.geo");
26  geoFace->readMedia();
27  geoFace->print();
28 
29  FairGeoMedia *Media = geoFace->getMedia();
30  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
31 
32  FairGeoMedium *MediumSci = Media->getMedium("polyvinyltoluene");
33  FairGeoMedium *MediumSiPm = Media->getMedium("silicon");
34  FairGeoMedium *MediumCard = Media->getMedium("pcbmvd");
35 
36  const Double_t pi = 3.1415926535;
37  Int_t nmed=geobuild->createMedium(MediumSci); // ----why is the return value saved?
38  nmed=geobuild->createMedium(MediumSiPm);
39  nmed=geobuild->createMedium(MediumCard);
40 
41  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
42  TGeoVolume *top = new TGeoVolumeAssembly("SciT");
43 
44 
45  gGeoMan->SetTopVolume(top);
46 
47 
48 //-------------------- creating Tile and SiPm and Readout Card --------------------
49 
50  //Volumes containing SENSOR in the name will be taken into account in the MC hit production
51  //check PndSciT.h and PndSciT.cxx and the listofsensitives
52 
53  TGeoBBox* TileShape;
54  TileShape = new TGeoBBox("SciTil_logicTile", 1.425, 0.25, 1.425);// dimension is always given from the mid to the end e.g. only the half length
55 
56  TGeoVolume* TileVol;
57  TileVol = new TGeoVolume("SciTil_SENSOR",TileShape, gGeoMan->GetMedium("polyvinyltoluene"));
58  TileVol->SetLineColor(kBlue);
59 
60  TGeoBBox* SiPmShape= new TGeoBBox("SiPm_logicSiPm",0.215,0.1925,0.0725);
61  TGeoVolume* SiPmVol= new TGeoVolume("SiPm",SiPmShape, gGeoMan->GetMedium("silicon"));
62  SiPmVol->SetLineColor(kRed);
63 
64  TGeoBBox* CardShape= new TGeoBBox("SciTil_logicCard",2.,0.075,2.);
65  TGeoVolume* CardVol= new TGeoVolume("Card",CardShape, gGeoMan->GetMedium("pcbmvd"));
66  CardVol->SetLineColor(kGreen);
67 
68 
69  // --------------creating module (Quad)-------------
70 
71  TGeoVolumeAssembly* QuadAssVol = new TGeoVolumeAssembly("SciTil_quad");// 4 tiles + 8 SiPm
72 
73 
74  TGeoRotation* rot_SiPm = new TGeoRotation;
75  TGeoRotation* rot_SiPm2 = new TGeoRotation;
76  QuadAssVol->AddNode(TileVol,0,new TGeoCombiTrans(1.5, 0.,1.5 , new TGeoRotation (0)));
77  QuadAssVol->AddNode(SiPmVol,0,new TGeoCombiTrans(2.2125, 0.,0.0025 , new TGeoRotation (0)));
78  rot_SiPm.SetAngles(90.,90.,90.);
79  QuadAssVol->AddNode(SiPmVol,1,new TGeoCombiTrans(0.0025., 0.,0.7875 , rot_SiPm) );
80 
81  QuadAssVol->AddNode(TileVol,1,new TGeoCombiTrans(1.5, 0.,-1.5, new TGeoRotation (0)) );
82  QuadAssVol->AddNode(SiPmVol,2,new TGeoCombiTrans(0.0025, 0.,-2.2125 , rot_SiPm) );
83  QuadAssVol->AddNode(SiPmVol,3,new TGeoCombiTrans(0.7875, 0.,-0.0025 , new TGeoRotation (0)));
84 
85  QuadAssVol->AddNode(TileVol,2,new TGeoCombiTrans(-1.5, 0.,-1.5, new TGeoRotation (0)));
86  QuadAssVol->AddNode(SiPmVol,4,new TGeoCombiTrans(-2.2125, 0.,-0.0025 ,new TGeoRotation (0)));
87  QuadAssVol->AddNode(SiPmVol,5,new TGeoCombiTrans(-0.0025, 0.,-0.7875 , rot_SiPm));
88 
89  QuadAssVol->AddNode(TileVol,3,new TGeoCombiTrans(-1.5, 0.,1.5 , new TGeoRotation (0)) );
90  QuadAssVol->AddNode(SiPmVol,6,new TGeoCombiTrans(-0.0025, 0.,2.2125 , rot_SiPm));
91  QuadAssVol->AddNode(SiPmVol,7,new TGeoCombiTrans(-0.7875, 0.,0.0025 , new TGeoRotation (0)));
92 
93  QuadAssVol->AddNode(CardVol,1,new TGeoCombiTrans(0.,0.325,0., new TGeoRotation (0)));
94 
95 
96  //-----------------creating Super-Module----------------
97 
98  TGeoVolumeAssembly* SModAssVol = new TGeoVolumeAssembly("SciTil_mod");//90 quads
99  Double_t dx, dz;
100 
101  dx=0.;
102  dz=0.;
103  for(int j=0;j<30;j++){
104  for(int l=0;l<3;l++){
105  dz = -90+3+j*6;
106  dx = -9+3+l*6;
107 
108  SModAssVol->AddNode(QuadAssVol,j*3+l,new TGeoCombiTrans(dx, 0.,dz, new TGeoRotation (0)));
109 
110  }
111  }
112 
113  // -----------------creating Barrel --------------------------------------------
114  TGeoVolumeAssembly* BarrelAssVol = new TGeoVolumeAssembly("SciTil_barrel");
115 
116  // ------------Values of Dirc Detector------------
117  Double_t radius = 50.55 ; // 50. radius in middle of the barbox (x and y)
118  Double_t hthick = 1.7/2.; // 1.7/2. half thickness of the bars
119  Double_t barnum = 6; // 6 number of bars per barbox
120  Int_t bbnum = 16; //16. total number of sides = barboxes
121  Double_t bbGap = 1.5; //1.5 gap btw the neighboring barboxes (at the middle height)
122  Double_t pipehAngle = 3.6; //3.6 [degrees] half of the angular space needed for the target pipe
123 
124 
125  Double_t phi0 = (180.-2.*pipehAngle)/bbnum + pipehAngle;
126  Double_t dphi = (180.-2.*pipehAngle)/bbnum*2.;
127 
128 //taking angles from dirc geometry
129  Double_t dx_bbox, dy_bbox, dz_bbox, phi_curr;
130 
131  for(Int_t m = 0; m < bbnum; m ++){
132  phi_curr = (90. - phi0 - dphi*m)/180.*pi;
133  if(m > bbnum/2-1){ phi_curr = (90. - phi0 - dphi*m - 2.*pipehAngle)/180.*pi; }
134  dx_bbox = radius * cos(phi_curr);
135  dy_bbox = radius * sin(phi_curr);
136 
137  TGeoRotation rot_bbox;
138  rot_bbox.RotateZ( -phi0 - m*dphi - (TMath::Floor(2.*m/bbnum))*(2.*pipehAngle));
139  BarrelAssVol->AddNode(SModAssVol, m+1, new TGeoCombiTrans(dx_bbox, dy_bbox, 0, new TGeoRotation(rot_bbox)));
140  }
141 
142 
143  top->AddNode(BarrelAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
144  //top->AddNode(QuadAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
145 
146  gGeoMan->SetVisLevel(5);
147  gGeoMan->CloseGeometry();
148  top->Write();
149  fi->Close();
150  // gGeoManager->Export(outfile);
151  top->Draw("ogl");
152 
153  return 0;
154  }
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
double dx
FairGeoInterface * geoFace
TString outfile