FairRoot/PandaRoot
Functions
create_scit_rootgeo_201508.C File Reference

Go to the source code of this file.

Functions

int create_scit_rootgeo_201508 (Double_t distance=750)
 

Function Documentation

int create_scit_rootgeo_201508 ( Double_t  distance = 750)

Definition at line 1 of file create_scit_rootgeo_201508.C.

References cos(), Double_t, 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 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_201508.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 //-------------------- creating Tile and SiPm and Readout Card --------------------
50 
51  //Volumes containing SENSOR in the name will be taken into account in the MC hit production
52  //check PndSciT.h and PndSciT.cxx and the listofsensitives
53 
54  TGeoBBox* TileShape;
55  TileShape = new TGeoBBox("SciTil_logicTile", 4.2425, 0.25, 1.425);// dimension is always given from the mid to the end e.g. only the half length
56 
57  TGeoVolume* TileVol;
58  TileVol = new TGeoVolume("SciTil_SENSOR",TileShape, gGeoMan->GetMedium("polyvinyltoluene"));
59  TileVol->SetLineColor(kBlue);
60 
61  TGeoBBox* SiPmShape= new TGeoBBox("SiPm_logicSiPm",0.215,0.1925,0.0725);
62  TGeoVolume* SiPmVol= new TGeoVolume("SiPm",SiPmShape, gGeoMan->GetMedium("silicon"));
63  SiPmVol->SetLineColor(kRed);
64 
65  TGeoBBox* CardShape= new TGeoBBox("Card_logicCard",0.075,0.25,1.4);
66  TGeoVolume* CardVol= new TGeoVolume("SciTil_Card",CardShape, gGeoMan->GetMedium("pcbmvd"));
67  CardVol->SetLineColor(kYellow);
68 
69  TGeoBBox* CardOutShape= new TGeoBBox("CardOut_logicCard",0.5,0.075,90.);
70  TGeoVolume* CardOutVol= new TGeoVolume("SciTil_CardOut",CardOutShape, gGeoMan->GetMedium("pcbmvd"));
71  CardOutVol->SetLineColor(kGreen);
72 
73 
74  // --------------creating module (Line)-------------
75 
76  TGeoVolumeAssembly* LineAssVol = new TGeoVolumeAssembly("SciTil_Line");// 2 tiles + 16 SiPm + 3 connection cards
77 
78  TGeoRotation* rot_SiPm = new TGeoRotation;
79  LineAssVol->AddNode(TileVol,0,new TGeoCombiTrans(4.4625, 0., 0., new TGeoRotation (0)));
80  LineAssVol->AddNode(TileVol,1,new TGeoCombiTrans(-4.4625, 0., 0., new TGeoRotation (0)));
81 
82  rot_SiPm.SetAngles(90.,90.,90.);
83  LineAssVol->AddNode(SiPmVol,0,new TGeoCombiTrans(8.7775, 0., 1.06875, rot_SiPm));
84  LineAssVol->AddNode(SiPmVol,1,new TGeoCombiTrans(8.7775, 0., 0.35625, rot_SiPm));
85  LineAssVol->AddNode(SiPmVol,2,new TGeoCombiTrans(8.7775, 0., -0.35625, rot_SiPm));
86  LineAssVol->AddNode(SiPmVol,3,new TGeoCombiTrans(8.7775, 0., -1.06875, rot_SiPm));
87 
88  LineAssVol->AddNode(SiPmVol,4,new TGeoCombiTrans(0.1475, 0., 1.06875, rot_SiPm));
89  LineAssVol->AddNode(SiPmVol,5,new TGeoCombiTrans(0.1475, 0., 0.35625, rot_SiPm));
90  LineAssVol->AddNode(SiPmVol,6,new TGeoCombiTrans(0.1475, 0., -0.35625, rot_SiPm));
91  LineAssVol->AddNode(SiPmVol,7,new TGeoCombiTrans(0.1475, 0., -1.06875, rot_SiPm));
92 
93  LineAssVol->AddNode(SiPmVol,8,new TGeoCombiTrans(-0.1475, 0., 1.06875, rot_SiPm));
94  LineAssVol->AddNode(SiPmVol,9,new TGeoCombiTrans(-0.1475, 0., 0.35625, rot_SiPm));
95  LineAssVol->AddNode(SiPmVol,10,new TGeoCombiTrans(-0.1475, 0., -0.35625, rot_SiPm));
96  LineAssVol->AddNode(SiPmVol,11,new TGeoCombiTrans(-0.1475, 0., -1.06875, rot_SiPm));
97 
98  LineAssVol->AddNode(SiPmVol,12,new TGeoCombiTrans(-8.7775, 0., 1.06875, rot_SiPm));
99  LineAssVol->AddNode(SiPmVol,13,new TGeoCombiTrans(-8.7775, 0., 0.35625, rot_SiPm));
100  LineAssVol->AddNode(SiPmVol,14,new TGeoCombiTrans(-8.7775, 0., -0.35625, rot_SiPm));
101  LineAssVol->AddNode(SiPmVol,15,new TGeoCombiTrans(-8.7775, 0., -1.06875, rot_SiPm));
102 
103  LineAssVol->AddNode(CardVol,0,new TGeoCombiTrans(8.925, 0., 0., new TGeoRotation (0)));
104  LineAssVol->AddNode(CardVol,1,new TGeoCombiTrans(0., 0., 0., new TGeoRotation (0)));
105  LineAssVol->AddNode(CardVol,2,new TGeoCombiTrans(-8.925, 0., 0., new TGeoRotation (0)));
106 
107  //-----------------creating Super-Module----------------
108 
109  TGeoVolumeAssembly* SModAssVol = new TGeoVolumeAssembly("SciTil_Mod");//60 Lines
110 
111  Double_t dz=0;
112  for(int j=0;j<60;j++){
113  dz = -90+1.5+j*3;
114  SModAssVol->AddNode(LineAssVol, j, new TGeoCombiTrans(0., 0., dz, new TGeoRotation (0)));
115  }
116  SModAssVol->AddNode(CardOutVol, 0, new TGeoCombiTrans(8.925, 0.325, 0., new TGeoRotation (0)));
117  SModAssVol->AddNode(CardOutVol, 1, new TGeoCombiTrans(0., 0.325, 0., new TGeoRotation (0)));
118  SModAssVol->AddNode(CardOutVol, 2, new TGeoCombiTrans(-8.925, 0.325, 0., new TGeoRotation (0)));
119 
120 
121  // -----------------creating Barrel --------------------------------------------
122  TGeoVolumeAssembly* BarrelAssVol = new TGeoVolumeAssembly("SciTil_barrel");
123 
124  // ------------Values of Dirc Detector------------
125  Double_t radius = 50.55; // 50. radius in middle of the barbox (x and y)
126  Double_t hthick = 1.7/2.; // 1.7/2. half thickness of the bars
127  Double_t barnum = 6; // 6 number of bars per barbox
128  Int_t bbnum = 16; //16. total number of sides = barboxes
129  Double_t bbGap = 1.5; //1.5 gap btw the neighboring barboxes (at the middle height)
130  Double_t pipehAngle = 3.6; //3.6 [degrees] half of the angular space needed for the target pipe
131 
132 
133  Double_t phi0 = (180.-2.*pipehAngle)/bbnum + pipehAngle;
134  Double_t dphi = (180.-2.*pipehAngle)/bbnum*2.;
135 
136 //taking angles from dirc geometry
137  Double_t dx_bbox, dy_bbox, dz_bbox, phi_curr;
138 
139  for(Int_t m = 0; m < bbnum; m ++){
140  phi_curr = (90. - phi0 - dphi*m)/180.*pi;
141  if(m > bbnum/2-1){ phi_curr = (90. - phi0 - dphi*m - 2.*pipehAngle)/180.*pi; }
142  dx_bbox = radius * cos(phi_curr);
143  dy_bbox = radius * sin(phi_curr);
144 
145  TGeoRotation rot_bbox;
146  rot_bbox.RotateZ( -phi0 - m*dphi - (TMath::Floor(2.*m/bbnum))*(2.*pipehAngle));
147  BarrelAssVol->AddNode(SModAssVol, m, new TGeoCombiTrans(dx_bbox, dy_bbox, 0, new TGeoRotation(rot_bbox)));
148  }
149 
150 
151  top->AddNode(BarrelAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
152  //top->AddNode(SModAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
153  //top->AddNode(LineAssVol,0, new TGeoCombiTrans(0.,0.,32.,new TGeoRotation()));
154 
155  gGeoMan->SetVisLevel(5);
156  gGeoMan->CloseGeometry();
157  top->Write();
158  fi->Close();
159  // gGeoManager->Export(outfile);
160  top->Draw("ogl");
161 
162  return 0;
163  }
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