FairRoot/PandaRoot
create_HypSTxy3Cmic_RootGeo5Lay.C
Go to the documentation of this file.
1 
2 
3 TVector3 ComputeTransformation(const int copyNo, Double_t *par)
4 {//{ComputeTransformation(const int copyNo, TVector3* origin,Double_t *par) const
5  TVector3 origin;
6 
7 
8  Double_t display= par[4]*( 20-copyNo);
9  Double_t position= par[0]+(copyNo)*par[2];
10 
11  origin.SetXYZ(0, display,position);
12 
13  return origin;
14 
15 }
16 
17 TVector3 ComputeDimensions( const int copyNo,Double_t *par)
18 {//ComputeDimensions(TVector3& Layer, const int copyNo,Double_t *par) const
19  TVector3 Layer;
20 
21  //Double_t fStartPosition = firstPosition;
22  //Double_t fHalfLayThick = 0.5*LayThick;
23  //Double_t fSpacing = LayThick;
24  //Double_t fHalfLengthFirst = 0.5 * firstLength;
25  //Double_t fHalfLengthIncr = 0.5 *(lastLength-firstLength)/20;
26  //Double_t fHalfLastLength = 0.5*lastLength;
27 
28  Double_t halfLength = par[3] + copyNo * par[4];
29  Layer.SetXYZ(par[5],halfLength,par[1]);
30  //Layer.SetX(par[5]);
31  //Layer.SetY(par[1]);
32  return Layer;
33 
34  //}
35 }
36 
37 TVector3 rotate(TVector3 vec, TGeoRotation* rotma)
38 {
39  TVector3 v;
40  v.SetXYZ(0,0,0);
41 
42  vec.Print();
43  const Double_t* b;
44  b = rotma->GetRotationMatrix();
45  //a = new TRotation(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8]);
46 
47  for (Int_t i=0; i<9; i++) {
48  if (TMath::Abs(b[i])<1E-10) b[i] = 0;
49  if (TMath::Abs(b[i]-1)<1E-10) b[i] = 1;
50  if (TMath::Abs(b[i]+1)<1E-10) b[i] = -1;
51  }
52  for(i=0;i<9;i++){
53  cout<<" matrix "<<b[i]<<endl;
54  }
55  v.SetX(b[0]*vec.X()+b[1]*vec.Y()+b[2]*vec.Z());
56  v.SetY(b[3]*vec.X()+b[4]*vec.Y()+b[5]*vec.Z());
57  v.SetZ(b[6]*vec.X()+b[7]*vec.Y()+b[8]*vec.Z());
58  //cout<<" rotate "<<v.X()<<" "<<v.Y()<<" "<<v.Z()<<endl;
59 
60  return v;
61 
62 
63 }
64 //version 3 from root geo ()create_HypSTxy3Cmic_rootgeo3(), complex assembly place
65 //the whole target setup at the (0,0,0). hypst assembly
66 //places pipe and traget at the desired position, here at -76.5 cm.
67 
69 {
70 
71  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
72 
73  // Load this libraries
74  gSystem->Load("libGeoBase");
75  gSystem->Load("libParBase");
76  gSystem->Load("libBase");
77  gSystem->Load("libPndData");
78  gSystem->Load("libPassive");
79 
80 
81  //TString outfile= "../../geometry/HYPST_assexy3C5Lay_test.root";
82  TString outfile= "../../geometry/HYPST_assexy3C5Lay.root";
83  TFile* fi = new TFile(outfile,"RECREATE");
84 
85  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
86  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
87  geoFace->setMediaFile("../../geometry/media_pnd.geo");
88  geoFace->readMedia();
89  geoFace->print();
90 
91  FairGeoMedia *Media = geoFace->getMedia();
92  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
93 
94  FairGeoMedium *medab = Media->getMedium("HYPdiamond");
95  Int_t nmedGe=geobuild->createMedium(medab);
96 
97  //Scintillator plate
98  FairGeoMedium *medsci = Media->getMedium("HYPsilicon");
99  Int_t nmedsci=geobuild->createMedium(medsci);
100 
101  FairGeoMedium *medcar = Media->getMedium("HYPcarbon");
102  Int_t nmedC=geobuild->createMedium(medcar);
103 
104 
105 
106  TGeoManager* gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
107 
108  TGeoVolume *top = new TGeoVolumeAssembly("hypst");
109 
110  gGeoMan->SetTopVolume(top);
111 
112  TGeoVolume *complex = new TGeoVolumeAssembly("complex");
113  //TGeoVolume *outer = new TGeoVolumeAssembly("outer");
114  //TGeoVolume *inner = new TGeoVolumeAssembly("inner");
115 
116  //936.4335456774155
117  const Int_t max = 80; // max. number of stations
118  Double_t xt[4]; // detector thickness [mm]
119  Double_t yt[4]; // inner radius [mm]
120  Double_t zt[4]; // outer radius [mm]
121  Double_t z[max]; // z position from target [mm]
122  Double_t dlt[max],dl[max]; // inner acceptance [deg]
123  Double_t hlt[max],hl[max]; // outer acceptance [deg]
124  Double_t zll[max],zlt[max]; // outer acceptance [deg]
125  Double_t xl[max]; // detector thickness [mm]
126  Double_t yl[max]; // inner radius [mm]
127  Double_t zl[max]; // outer radius [mm]
128 
129  Double_t da[max]; // inner acceptance [deg]
130  Double_t ha[max]; // outer acceptance [deg]
131  Double_t zla[max]; // outer acceptance [deg]
132  Double_t xa[max]; // detector thickness [mm]
133  Double_t ya[max]; // inner radius [mm]
134  Double_t za[max]; // outer radius [mm]
135 
136  Double_t dg[max]; // inner acceptance [deg]
137  Double_t hg[max]; // outer acceptance [deg]
138  Double_t zlg[max]; // outer acceptance [deg]
139  Double_t xg[max]; // detector thickness [mm]
140  Double_t yg[max]; // inner radius [mm]
141  Double_t zg[max]; // outer radius [mm]
142  Int_t n,nn,na,ng;
143 
144 
145  //ifstream geoin;
146  //geoin.open("secontarget.dat");
147  //ofstream geoout("nada.geo");
148 
149  Double_t fAbsorberThickness = 0.1; //Material mm
150  Double_t fGapThickness = 0.03; //Silicon mm
151  Int_t NbOfLayers = 20; //21
152 
153  Double_t lt = fAbsorberThickness + fGapThickness;
154  Double_t stt = NbOfLayers*lt;
155  Double_t stsyz = stt + 1.5;
156  Double_t hole = 0.75; //mm the radius of the hole(pipe)
157  Double_t SecTargThick = stt;
158  Double_t LayThick= lt;
159  Double_t SecTargSizeYZ = stsyz;
160  const Double_t pi = 3.1415926535;
161 
162  TVector3* v2;
163  TGeoRotation* rot = new TGeoRotation();
164  TGeoRotation* rotO = new TGeoRotation();
165  TGeoRotation* rot2 = new TGeoRotation();
166  char tempname[100];
167  char name4[100];
168 
169  TGeoVolume *BoxAsmb[4];
170 
171 
172  TGeoVolume *LayAsmb[80];
173  TGeoBBox *LayB;
174 
175  TGeoVolume *LayAO;
176  TGeoBBox *LayO;
177  TGeoVolume *LayAI;
178  TGeoBBox *LayI;
179 
180  Double_t side;
181  side = 9.5*TMath::Sin((9*pi)/180.);
182  double ang;
183  ang = 180*TMath::ASin(17.7/135)/pi;
184 
185  /* LayO = new TGeoBBox("stglOTile",side ,side ,0.03);
186 
187  LayAO = new TGeoVolume("outer_stglSi",LayO, gGeoMan->GetMedium("HYPsilicon"));
188 
189  LayI = new TGeoBBox("stglITile",side ,side ,0.03);
190 
191  LayAI = new TGeoVolume("inner_stglSi",LayI, gGeoMan->GetMedium("HYPsilicon"));
192 
193  // //creating Module
194 
195  // dy=0.;
196  // dx=0;
197  // dz=0.;
198  // Double_t Lx,Lz,g,d;
199  // d = 5.9;
200  // g = 0.1;
201  // Lx = 4*d +2*g;
202  // Lz = 30*d +29*g;
203 
204 
205  // for(int l=0;l<4;l++){
206  // dz = -0.5*Lz + (2*j + 1)*d*0.5 +j*g;
207  // dx = -0.5*Lx +(2*l + 1)*d*0.5 +l*g;
208 
209  // SModAssVol->AddNode(QuadAssVol,30*l+j,new TGeoCombiTrans(dx, 0.,dz, new TGeoRotation (0)));
210 
211  // }
212 
213 
214  Double_t dx_bbox, dy_bbox, dz_bbox, phi_curr;
215 
216  for(Int_t m = 0; m < 20; m ++){
217 
218  phi_curr = (m+1)*(18*pi)/180.;
219  rotO->SetAngles(0,0,0);
220  rotO->RotateX(90);
221  rotO->RotateZ( -(m)*18); //with -(m+1) it looks like a closed polygone.
222 
223  dx_bbox = 9.5* sin(phi_curr);
224  dy_bbox = 9.5* cos(phi_curr);
225 
226 
227  inner->AddNode(LayAO, m+1, new TGeoCombiTrans(dx_bbox, dy_bbox, 0, new TGeoRotation (*rotO)));
228 
229 
230  }
231  Double_t dx_bboxa, dy_bboxa, dz_bboxa, phi_curra;
232 
233  for(Int_t it = 0; it < 24; it ++){ //outer strip structure 26 layers 35 mm
234 
235  phi_curra = (it+1)*((2*ang)*pi)/180.;
236  rotO->SetAngles(0,0,0);
237  rotO->RotateX(90);
238  rotO->RotateZ( -(it)*(2*ang)); //with -(m+1) it looks like a closed polygone.
239 
240  dx_bboxa = 13.5* sin(phi_curra);
241  dy_bboxa = 13.5* cos(phi_curra);
242 
243 
244  outer->AddNode(LayAI, it+1, new TGeoCombiTrans(dx_bboxa, dy_bboxa, 0, new TGeoRotation (*rotO)));
245 
246 
247  }
248  */
249 
250 
251  TGeoBBox *BoxSi[80];
252  TGeoBBox *BoxAb[80];
253  TGeoVolume *LaySi[80];
254  TGeoVolume *LayAb[80];
255  TGeoTube *pipe;
256  TGeoVolume *hyppipe;
257  int d;
258  d=0;
259  for(int i=0;i<4;i++){
260 
261  //int i =0;
262  rot->SetAngles(0,0,0);
263  rot2->SetAngles(0,0,0);
264  rot->RotateX(90);
265  rot->RotateZ((-1*i)*90.0);
266  rot2->RotateZ(-1*i*90.0);
267  //cout<<" matr "<<-1*i*90.0<<endl;
268 
269  v2 = new TVector3(rotate(TVector3((stsyz/2)-hole,stsyz/2,0.),rot2));
270  sprintf(tempname,"stgQuad%d",i+1);
271  sprintf(name4,"transQuad%d",i+1);
272 
273  TGeoCombiTrans* trc5 = new TGeoCombiTrans(v2->x(), v2->y(), v2->z(),
274  new TGeoRotation (*rot));
275  trc5->SetName(name4);
276  trc5->RegisterYourself();
277 
278  BoxAsmb[d]= new TGeoVolumeAssembly(tempname);
279  complex->AddNode(BoxAsmb[d],0,trc5);
280 
281  d = d+1;
282  }
283 
284  string tmaterial[4]={"HYPdiamond","HYPdiamond","beryllium","aluminium"};
285  char tmp[100];
286  char tmplay[100],tmplayb[100],tmpAbs[100], tmpGap[100],tmpVAbs[100], tmpVGap[100];
287  char name[100], name1[100],name2[100];
288 
289  Double_t firstPosition = -0.5*SecTargThick + 0.5*LayThick;
290  Double_t theta = (40*TMath::Pi())/180.;
291  Double_t lengthpar = (hole+0.5*LayThick)/TMath::Tan(theta);
292  Double_t firstLength = 0.5*SecTargSizeYZ + lengthpar;
293  //Double_t firstLength = SecTargSizeYZ - ((SecTargThick)/TMath::Tan(theta));
294  //Double_t firstLength = SecTargSizeYZ - ((SecTargThick-0.5*LayThick)/TMath::Tan(theta));
295  Double_t lastLength = SecTargSizeYZ;
296 
297  TVector3 Lay;
298  TVector3 v_Pos;
299  TVector3 vecAbs,vecGap;
300 
301 
302 
303  //fNbOfLayers = NbOfLayers;
304 
305  Double_t fStartPosition = firstPosition;
306  Double_t fHalfLayThick = 0.5*LayThick;
307  Double_t fSpacing = LayThick;
308  Double_t fHalfLengthFirst = 0.5 * firstLength;
309  Double_t fHalfLengthIncr = 0.5 *(lastLength-firstLength)/NbOfLayers;
310  Double_t fHalfLastLength = 0.5*lastLength;
311 
312  Double_t param[6]={fStartPosition,fHalfLayThick,fSpacing,fHalfLengthFirst,
313  fHalfLengthIncr,fHalfLastLength};
314 
315  //for(Int_t k=0; k<4; k++)
316  //{
317  //geoin>>n>>dlt[k]>>hlt[k]>>zlt[k];
318  //cout<<"thick"<<dlt[k]<<endl;
319 
320  for(Int_t i=0; i<20; i++)
321  {
322 
323  //Lay.SetXYZ(0.,0.,0.);
324  //v_Pos.SetXYZ(0.,0.,0.);
325 
326 
327  v_Pos= ComputeTransformation(i,param);
328 
329  Lay = ComputeDimensions(i,param);
330 
331  v_Pos.SetY(-v_Pos.y());
332  //(k==0 ? v_Pos.SetZ(-v_Pos.z()): v_Pos.SetZ(v_Pos.z()));
333  v_Pos.SetZ(-v_Pos.z());
334 
335  dl[i] = Lay.X(); //length
336  hl[i] = Lay.Y(); //parametrised length
337  zll[i] = Lay.Z(); //thickness
338 
339  xl[i] = v_Pos.x();
340  yl[i] = v_Pos.y();
341  zl[i] = v_Pos.z();
342 
343  //absorver layer dimension//
344 
345  da[i]= dl[i];
346  ha[i]= hl[i];
347  zla[i]= fAbsorberThickness/2;
348 
349  //absorver layer placement
350 
351  //(k==0 ? vecAbs.SetZ(-fGapThickness/2.0) : vecAbs.SetZ(fGapThickness/2.0));
352  vecAbs.SetZ(-fGapThickness/2.0);
353 
354  xa[i] = vecAbs.x();
355  ya[i] = vecAbs.y();
356  za[i] = vecAbs.z();
357 
358  //Gap layer dimension//
359 
360  dg[i]= dl[i];
361  hg[i]= hl[i];
362  zlg[i]= fGapThickness/2.0;
363 
364  //Gap layer placement
365 
366  //(k==0 ? vecGap.SetZ(fAbsorberThickness/2) : vecGap.SetZ(-fAbsorberThickness/2));
367  vecGap.SetZ(fAbsorberThickness/2);
368 
369  xg[i] = vecGap.x();
370  yg[i] = vecGap.y();
371  zg[i] = vecGap.z();
372 
373 
374 
375  }
376  //}
377 
378 
379  int t,j;
380 
381 
382 
383  for(Int_t j=0; j<4;j++)
384  {
385 
386  if(j==0){
387  t=0;
388  for(Int_t k=0; k<20; k++)
389  {
390 
391  //sprintf(tmp,"stgQuad#0%d",j);
392  //sprintf(tmpAbs,"stglA%d%d%d#01",j,x,k);//target
393  //sprintf(tmpGap,"stglS%d%d%d#01",j,x,k);//silicon
394 
395  //sprintf(tmplayb,"stgLayB_%d",k);
396  sprintf(tmplay,"stgLay%d",k);
397  sprintf(tmpAbs,"stgBlAb%d",k);
398  sprintf(tmpGap,"stgBlSi%d",k);
399  sprintf(tmpVAbs,"stglAb%d",k);
400  sprintf(tmpVGap,"stglSi%d",k);
401 
402  sprintf(name,"transAb%d",k);
403  sprintf(name1,"transSi%d",k);
404  sprintf(name2,"transLay%d",k);
405 
406  LayAsmb[t]= new TGeoVolumeAssembly(tmplay);
407  // LayB=new TGeoBBox("stgLayB",dl[j][k],hl[j][k],zll[j][k]);
408  // LayAsmb= new TGeoVolume("stgLay",LayB,gGeoMan->GetMedium("vacuum"));
409 
410 
411 
412  BoxAb[t] = new TGeoBBox(tmpAbs,da[k],ha[k],zla[k]);
413  LayAb[t] = new TGeoVolume(tmpVAbs,BoxAb[t],gGeoMan->GetMedium("HYPdiamond"));
414  BoxSi[t] = new TGeoBBox(tmpGap,dg[k],hg[k],zlg[k]);
415  LaySi[t] = new TGeoVolume(tmpVGap,BoxSi[t],gGeoMan->GetMedium("HYPsilicon"));
416  LaySi[t]->SetLineColor(kPink);
417  LayAb[t]->SetLineColor(kYellow);
418 
419  if(k<2){
420  TGeoCombiTrans* trc1 = new TGeoCombiTrans(xa[k],ya[k],za[k],new TGeoRotation ());
421  trc1->SetName(name);
422  trc1->RegisterYourself();
423  LayAsmb[t]->AddNode(LayAb[t],k, trc1);
424  }
425 
426  if(k<2||(k==5||k==10||k==15)){
427  TGeoCombiTrans* trc2 = new TGeoCombiTrans(xg[k],yg[k],zg[k],new TGeoRotation ());
428  trc2->SetName(name1);
429  trc2->RegisterYourself();
430  LayAsmb[t]->AddNode(LaySi[t],k, trc2);
431  TGeoCombiTrans* trc3 = new TGeoCombiTrans(xl[k],yl[k],zl[k], new TGeoRotation ());
432  trc3->SetName(name2);
433  trc3->RegisterYourself();
434  BoxAsmb[j]->AddNode(LayAsmb[t],k,trc3);
435  }
436 
437  t = t+1;
438  }
439  }
440 
441  if(j==1){
442  t=20;
443  for(Int_t k=20; k<36; k++)
444  {
445 
446  //sprintf(tmp,"stgQuad#0%d",j);
447  //sprintf(tmpAbs,"stglA%d%d%d#01",j,x,k);//target
448  //sprintf(tmpGap,"stglS%d%d%d#01",j,x,k);//silicon
449 
450  // sprintf(tmplayb,"stgLayB_%d",k);
451  sprintf(tmplay,"stgLay%d",k);
452  sprintf(tmpAbs,"stgBlAb%d",k);
453  sprintf(tmpGap,"stgBlSi%d",k);
454  sprintf(tmpVAbs,"stglAb%d",k);
455  sprintf(tmpVGap,"stglSi%d",k);
456 
457  sprintf(name,"transAb%d",k);
458  sprintf(name1,"transSi%d",k);
459  sprintf(name2,"transLay%d",k);
460 
461  LayAsmb[t]= new TGeoVolumeAssembly(tmplay);
462  // LayB=new TGeoBBox("stgLayB",dl[j][k],hl[j][k],zll[j][k]);
463  // LayAsmb= new TGeoVolume("stgLay",LayB,gGeoMan->GetMedium("vacuum"));
464 
465 
466 
467  BoxAb[t] = new TGeoBBox(tmpAbs,da[k-20],ha[k-20],zla[k-20]);
468  LayAb[t] = new TGeoVolume(tmpVAbs,BoxAb[k],gGeoMan->GetMedium("HYPdiamond"));
469  BoxSi[t] = new TGeoBBox(tmpGap,dg[k-20],hg[k-20],zlg[k-20]);
470  LaySi[t] = new TGeoVolume(tmpVGap,BoxSi[t],gGeoMan->GetMedium("HYPsilicon"));
471  LaySi[t]->SetLineColor(kPink);
472  LayAb[t]->SetLineColor(kYellow);
473 
474  if(k<22){
475 
476  TGeoCombiTrans* trc1 = new TGeoCombiTrans(xa[k-20],ya[k-20],za[k-20],new TGeoRotation ());
477  trc1->SetName(name);
478  trc1->RegisterYourself();
479  LayAsmb[t]->AddNode(LayAb[t],k, trc1);
480  }
481 
482  if(k<22||(k==25||k==30||k==35)){
483 
484  TGeoCombiTrans* trc2 = new TGeoCombiTrans(xg[k-20],yg[k-20],zg[k-20],new TGeoRotation ());
485  trc2->SetName(name1);
486  trc2->RegisterYourself();
487  LayAsmb[t]->AddNode(LaySi[t],k, trc2);
488 
489 
490  TGeoCombiTrans* trc3 = new TGeoCombiTrans(xl[k-20],yl[k-20],zl[k-20], new TGeoRotation ());
491  trc3->SetName(name2);
492  trc3->RegisterYourself();
493  BoxAsmb[j]->AddNode(LayAsmb[t],k,trc3);
494  }
495 
496  t = t +1;
497  }
498  }
499 
500  if(j==2){
501  t=40;
502  for(Int_t k=40; k<56; k++)
503  {
504 
505  //sprintf(tmp,"stgQuad#0%d",j);
506  //sprintf(tmpAbs,"stglA%d%d%d#01",j,x,k);//target
507  //sprintf(tmpGap,"stglS%d%d%d#01",j,x,k);//silicon
508 
509  // sprintf(tmplayb,"stgLayB_%d",k);
510  sprintf(tmplay,"stgLay%d",k);
511  sprintf(tmpAbs,"stgBlAb%d",k);
512  sprintf(tmpGap,"stgBlSi%d",k);
513  sprintf(tmpVAbs,"stglAb%d",k);
514  sprintf(tmpVGap,"stglSi%d",k);
515 
516  sprintf(name,"transAb%d",k);
517  sprintf(name1,"transSi%d",k);
518  sprintf(name2,"transLay%d",k);
519 
520  LayAsmb[t]= new TGeoVolumeAssembly(tmplay);
521  // LayB=new TGeoBBox("stgLayB",dl[j][k],hl[j][k],zll[j][k]);
522  // LayAsmb= new TGeoVolume("stgLay",LayB,gGeoMan->GetMedium("vacuum"));
523 
524 
525 
526  BoxAb[t] = new TGeoBBox(tmpAbs,da[k-40],ha[k-40],zla[k-40]);
527  LayAb[t] = new TGeoVolume(tmpVAbs,BoxAb[t],gGeoMan->GetMedium("HYPdiamond"));
528  BoxSi[t] = new TGeoBBox(tmpGap,dg[k-40],hg[k-40],zlg[k-40]);
529  LaySi[t] = new TGeoVolume(tmpVGap,BoxSi[t],gGeoMan->GetMedium("HYPsilicon"));
530  LaySi[t]->SetLineColor(kPink);
531  LayAb[t]->SetLineColor(kYellow);
532 
533 
534 
535  if(k<42)
536  {
537  TGeoCombiTrans* trc1 = new TGeoCombiTrans(xa[k-40],ya[k-40],za[k-40],new TGeoRotation ());
538  trc1->SetName(name);
539  trc1->RegisterYourself();
540  LayAsmb[t]->AddNode(LayAb[t],k, trc1);
541  }
542  if(k<42||(k==45||k==50||k==55)){
543 
544  TGeoCombiTrans* trc2 = new TGeoCombiTrans(xg[k-40],yg[k-40],zg[k-40],new TGeoRotation ());
545  trc2->SetName(name1);
546  trc2->RegisterYourself();
547  LayAsmb[t]->AddNode(LaySi[t],k, trc2);
548 
549 
550  TGeoCombiTrans* trc3 = new TGeoCombiTrans(xl[k-40],yl[k-40],zl[k-40], new TGeoRotation ());
551  trc3->SetName(name2);
552  trc3->RegisterYourself();
553  BoxAsmb[j]->AddNode(LayAsmb[t],k,trc3);
554  }
555 
556  t = t +1;
557  }
558  }
559 
560  if(j==3){
561  t = 60;
562  for(Int_t k=60; k<76; k++)
563  {
564 
565  //sprintf(tmp,"stgQuad#0%d",j);
566  //sprintf(tmpAbs,"stglA%d%d%d#01",j,x,k);//target
567  //sprintf(tmpGap,"stglS%d%d%d#01",j,x,k);//silicon
568 
569  // sprintf(tmplayb,"stgLayB_%d",k);
570  sprintf(tmplay,"stgLay%d",k);
571  sprintf(tmpAbs,"stgBlAb%d",k);
572  sprintf(tmpGap,"stgBlSi%d",k);
573  sprintf(tmpVAbs,"stglAb%d",k);
574  sprintf(tmpVGap,"stglSi%d",k);
575 
576  sprintf(name,"transAb%d",k);
577  sprintf(name1,"transSi%d",k);
578  sprintf(name2,"transLay%d",k);
579 
580  LayAsmb[t]= new TGeoVolumeAssembly(tmplay);
581  // LayB=new TGeoBBox("stgLayB",dl[j][k],hl[j][k],zll[j][k]);
582  // LayAsmb= new TGeoVolume("stgLay",LayB,gGeoMan->GetMedium("vacuum"));
583 
584 
585 
586  BoxAb[t] = new TGeoBBox(tmpAbs,da[k-60],ha[k-60],zla[k-60]);
587  LayAb[t] = new TGeoVolume(tmpVAbs,BoxAb[t],gGeoMan->GetMedium("HYPdiamond"));
588  BoxSi[t] = new TGeoBBox(tmpGap,dg[k-60],hg[k-60],zlg[k-60]);
589  LaySi[t] = new TGeoVolume(tmpVGap,BoxSi[t],gGeoMan->GetMedium("HYPsilicon"));
590  LaySi[t]->SetLineColor(kPink);
591  LayAb[t]->SetLineColor(kYellow);
592 
593 
594  if(k<62){
595  TGeoCombiTrans* trc1 = new TGeoCombiTrans(xa[k-60],ya[k-60],za[k-60],new TGeoRotation ());
596  trc1->SetName(name);
597  trc1->RegisterYourself();
598  LayAsmb[t]->AddNode(LayAb[t],k, trc1);
599  }
600 
601  if(k<62||(k==65||k==70||k==75)){
602 
603  TGeoCombiTrans* trc2 = new TGeoCombiTrans(xg[k-60],yg[k-60],zg[k-60],new TGeoRotation ());
604  trc2->SetName(name1);
605  trc2->RegisterYourself();
606  LayAsmb[t]->AddNode(LaySi[t],k, trc2);
607 
608 
609 
610  TGeoCombiTrans* trc3 = new TGeoCombiTrans(xl[k-60],yl[k-60],zl[k-60], new TGeoRotation ());
611  trc3->SetName(name2);
612  trc3->RegisterYourself();
613  BoxAsmb[j]->AddNode(LayAsmb[t],k,trc3);
614  }
615 
616  t = t+1;
617  }
618 
619  }
620 
621  }
622 
623 
624  pipe = new TGeoTube("stghypPipe",0.69,0.7,10.);
625  hyppipe = new TGeoVolume("stglpipe",pipe,gGeoMan->GetMedium("HYPcarbon"));
626 
627  TGeoCombiTrans* trc4 = new TGeoCombiTrans(0., 0., 0., new TGeoRotation ());
628 
629  trc4->SetName("transpipe");
630  trc4->RegisterYourself();
631 
632  /* TGeoCombiTrans* trc5 = new TGeoCombiTrans(0., 0., 0., new TGeoRotation ());
633 
634  trc5->SetName("transouter");
635  trc5->RegisterYourself();
636 
637  TGeoCombiTrans* trc6 = new TGeoCombiTrans(0., 0., 0., new TGeoRotation ());
638 
639  trc6->SetName("transinner");
640  trc6->RegisterYourself();*/
641 
642  complex->AddNode(hyppipe, 0,trc4);
643  /* complex->AddNode(outer, 0,trc5);
644  complex->AddNode(inner, 0,trc6);*/
645 
646  //top->AddNode(complex,0,new TGeoCombiTrans(0., 0., -76.5, new TGeoRotation ()));
647  top->AddNode(complex,0,new TGeoCombiTrans(0., 0., -55.5, new TGeoRotation ()));
648 
649  gGeoMan->CloseGeometry();
650  top->Write();
651  fi->Close();
652  // top->Draw("ogl");
653  return 0;
654 }
655 
static T ASin(const T &x)
TObjArray * d
FairGeoLoader * geoLoad
Int_t i
Definition: run_full.C:25
FairGeoMedia * Media
TTree * b
TGeoManager * gGeoMan
static T Sin(const T &x)
Definition: PndCAMath.h:42
int n
Double_t par[3]
float Tan(float x)
Definition: PndCAMath.h:165
#define pi
Definition: createSTT.C:60
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
__m128 v
Definition: P4_F32vec4.h:4
TGeoVolume * top
TVector3 ComputeTransformation(const int copyNo, Double_t *par)
static T Abs(const T &x)
Definition: PndCAMath.h:39
int create_HypSTxy3Cmic_RootGeo5Lay()
Double_t const fAbsorberThickness
FairGeoBuilder * geobuild
TFile * fi
Double_t
TGeoRotation rot2
TGeoCombiTrans * trc3
Double_t z
TVector3 rotate(TVector3 vec, TGeoRotation *rotma)
TString name
TGeoCombiTrans * trc1
TVector3 v2
Definition: bump_analys.C:40
TGeoRotation rot
TTree * t
Definition: bump_analys.C:13
FairGeoInterface * geoFace
Double_t Pi
TGeoCombiTrans * trc2
dble_vec_t vec[12]
Definition: ranlxd.cxx:380
TString outfile
TVector3 ComputeDimensions(const int copyNo, Double_t *par)