26 void getXrange(
double dphi,
double radiusCornerOut,
double radiusCornerIn,
double MCPactiveArea,
int cas1,
int cas2,
double ylow,
double step,
double &x1,
double &x2);
27 double getX(TVector3 corner1, TVector3 corner2,
double yy);
28 int findSectorIn(
double y,
double dphi,
double radius,
double EVdrop,
double hthick);
29 int findSectorOut(
double y,
double dphi_rad,
double radiusCornerOut);
35 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
37 TString vmcWorkdir = getenv(
"VMCWORKDIR");
40 gSystem->Load(
"libGeoBase");
41 gSystem->Load(
"libParBase");
42 gSystem->Load(
"libBase");
43 gSystem->Load(
"libPndData");
44 gSystem->Load(
"libPassive");
45 gSystem->Load(
"libEve");
65 Double_t dphi = (180.-2.*pipehAngle)/bbnum*2.;
70 Double_t bbox_hlen = 0.5*(bbox_zdown - bbox_zup);
71 Double_t bbox_shift = bbox_zup + bbox_hlen;
90 const Int_t NpixTotal = Npix*Npix;
96 Double_t hgap = 0.5*(MCPsize - MCPactiveArea + MCPgap);
97 Double_t step = MCPactiveArea + 2.*hgap;
101 Double_t sob_shift = -bbox_hlen + bbox_shift - sob_len;
107 Double_t sob_angle = atan((5.*step-2.*hthick-EVoffset-EVdrop)/sob_len)/pi*180.;
108 Double_t sob_Rout = (radius + hthick + EVoffset +(MCPsize-MCPactiveArea)+ 2.*boxgap+2.*boxthick +(sob_len + EVgreaseLayer + PDbaseLayer)*tan(sob_angle/180.*pi));
110 Double_t bbSideGap = 0.5*( ((barwidth+2.*barhgap)*barnum) - (2.*radius*
sin((dphi-bbGapAngle)/180.*pi/2.)+2.*barhgap) );
111 Double_t bbX = 2.*radius*
sin((dphi-bbGapAngle)/180.*pi/2.)+2.*barhgap;
113 Double_t radiusCornerIn = (radius-hthick-EVdrop)/
cos(dphi/2./180.*pi);
114 Double_t radiusCornerOut = sob_Rout/
cos(dphi_rad/2.);
115 Double_t radiusMiddleSmall = radius-hthick-EVdrop;
117 cout<<
"radius = "<<radius<<
"rad corner in = "<< radiusCornerIn<<
", rad corner out = "<< radiusCornerOut<<endl; cout<<
"pixel gap = "<< PixelGap<<endl;
118 cout<<
"sob_angle = "<<sob_angle<<endl;
119 cout<<
"sob_Rout = "<<sob_Rout<<endl;
120 cout<<
"bbSideGap = "<<bbSideGap<<
", bbX+2.sidegap = "<<bbX+2.*bbSideGap<<
", 5*barwidth+5*2*bargap = "<<5.*barwidth+5.*2.*barhgap<<endl;
121 cout<<
", bbX = "<<bbX<<endl;
122 cout<<
"dphi = "<<dphi<<
", phi0 = "<<phi0<<endl;
129 TString fGeoFile= Form(
"../../geometry/dirc_l%d_p%d_mirrorGap_sepEV_06_2013.root",fFocusingSystem, fprizm);
130 TFile*
fi =
new TFile(fGeoFile,
"RECREATE");
131 cout<<
"Output file = "<<fGeoFile<<endl;
133 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
134 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
135 cout <<
"geoface setmediafile" << endl;
136 geoFace->setMediaFile(
"../../geometry/media_pnd.geo");
138 geoFace->readMedia();
143 FairGeoMedia *
Media = geoFace->getMedia();
144 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
146 FairGeoMedium *DrcAir = Media->getMedium(
"air");
147 FairGeoMedium *DrcAirNoSens = Media->getMedium(
"DIRCairNoSens");
148 FairGeoMedium *DrcEpotek301_2 = Media->getMedium(
"Epotek301_2");
149 FairGeoMedium *DrcOpticalGrease = Media->getMedium(
"OpticalGrease");
150 FairGeoMedium *DrcCarbonFiber = Media->getMedium(
"DIRCcarbonFiber");
151 FairGeoMedium *DrcFusedSil = Media->getMedium(
"FusedSil");
152 FairGeoMedium *DrcMirror = Media->getMedium(
"Mirror");
153 FairGeoMedium *DrcMarcol82_7 = Media->getMedium(
"Marcol82_7");
154 FairGeoMedium *DrcNLAK33A = Media->getMedium(
"NLAK33A");
155 FairGeoMedium *DrcPhotocathode= Media->getMedium(
"Photocathode");
157 Int_t
nmed=geobuild->createMedium(DrcAir);
158 nmed=geobuild->createMedium(DrcAirNoSens);
159 nmed=geobuild->createMedium(DrcEpotek301_2);
160 nmed=geobuild->createMedium(DrcOpticalGrease);
161 nmed=geobuild->createMedium(DrcCarbonFiber);
162 nmed=geobuild->createMedium(DrcFusedSil);
163 nmed=geobuild->createMedium(DrcMirror);
164 nmed=geobuild->createMedium(DrcMarcol82_7);
165 nmed=geobuild->createMedium(DrcNLAK33A);
166 nmed=geobuild->createMedium(DrcPhotocathode);
170 if(fFocusingSystem == 0){
172 fSlabEnd = -bbox_hlen + bbox_shift + flen;
173 cout<<
"bar ends at = "<<fSlabEnd<<endl;
178 if (fFocusingSystem == 1){
187 cout<<
" DIRC a,b = "<<a<<
" "<<b<<endl;
200 len = b + 0.2 + b3 + 0.5;
202 cout<<
"DIRC len= "<<len<<endl;
204 fSlabEnd = -bbox_hlen + bbox_shift + len;
205 cout<<
"bar ends at = "<<fSlabEnd<<endl;
212 TGeoSphere* logicSphere=
new TGeoSphere(
"S",0.,r, 0. ,180.,0.,360.);
213 TGeoBBox* lBox =
new TGeoBBox(
"B", barwidth/2., hthick, b/2.);
214 TGeoTranslation *tr1 =
new TGeoTranslation(
"tr1", 0.,0., t);
215 tr1->RegisterYourself();
216 TGeoCompositeShape *cs =
new TGeoCompositeShape(
"cs",
"S*(B:tr1)");
217 TGeoVolume *lens1 =
new TGeoVolume(
"DrcLENS1Sensor",cs,
gGeoManager->GetMedium(
"FusedSil"));
218 lens1->SetLineColor(kRed-8);
219 lens1->SetTransparency(40);
225 fdz_lens1 = -(bbox_hlen)+len -(-r+b);
230 TGeoSphere* logicSphere2 =
new TGeoSphere(
"S2",0 ,r2, 0. ,180.,0.,360.);
231 TGeoBBox* lBox2 =
new TGeoBBox(
"B2", barwidth/2., hthick, b2/2.);
232 TGeoTranslation *tr2 =
new TGeoTranslation(
"tr2", 0.,0., t2);
233 tr2->RegisterYourself();
234 TGeoCompositeShape *cs2 =
new TGeoCompositeShape(
"cs2",
"(B2:tr2)-S2");
235 TGeoVolume *lens2 =
new TGeoVolume(
"DrcLENS2Sensor",cs2,
gGeoManager->GetMedium(
"NLAK33A"));
236 lens2->SetLineColor(kRed+2);
237 lens2->SetTransparency(40);
245 fdz_lens2 = -(bbox_hlen)+len -(-r2) -
b;
249 TGeoSphere* logicSphere3=
new TGeoSphere(
"S3",0.,r3, 0. ,180.,0.,360.);
250 TGeoBBox* lBox3 =
new TGeoBBox(
"B3", barwidth/2., hthick, b3/2.);
251 TGeoTranslation *tr3 =
new TGeoTranslation(
"tr3", 0.,0., t3);
252 tr3->RegisterYourself();
253 TGeoCompositeShape *cs3 =
new TGeoCompositeShape(
"cs3",
"S3*(B3:tr3)");
254 TGeoVolume *lens3 =
new TGeoVolume(
"DrcLENS3Sensor",cs3,
gGeoManager->GetMedium(
"NLAK33A"));
255 lens3->SetLineColor(kRed-6);
256 lens3->SetTransparency(40);
265 fdz_lens3 = -(bbox_hlen)+len -(-r3+b3) -b - b2/2. ;
271 if (fFocusingSystem == 2){
277 len = -130. + zpos + 1.;
283 Double_t focal_length = 2. * bbox_hlen + sob_len -
fabs(len) + len1;
284 Double_t mirror_radius = 2. * focal_length;
286 cout<<
" mirror radius: "<<mirror_radius<<endl;
291 TGeoSphere* logicSphere =
new TGeoSphere(
"S",0.,mirror_radius, 0. ,180.,0.,360.);
292 TGeoBBox* lBox =
new TGeoBBox(
"B", barwidth/2., hthick,
fabs(len1)/2.);
296 TGeoTranslation *tr1 =
new TGeoTranslation(
"tr1", 0.,0., t);
297 tr1->RegisterYourself();
298 TGeoCompositeShape *cs =
new TGeoCompositeShape(
"cs",
"S*(B:tr1)");
300 TGeoVolume *block1 =
new TGeoVolume(
"DrcBlock1",cs,
gGeoManager->GetMedium(
"FusedSil"));
301 block1->SetLineColor(kRed);
302 block1->SetTransparency(40);
305 Double_t shift1 = len1-mirror_radius;
306 shift1 += bbox_hlen-
fabs(len)-2.*mirr_hthick;
318 TGeoSphere* logicSphere2 =
new TGeoSphere(
"S2",0,mirror_radius, 0. ,180.,0.,360.);
319 TGeoBBox* lBox2 =
new TGeoBBox(
"B2", barwidth/2., hthick,
fabs(len2)/2.);
324 TGeoTranslation *tr2 =
new TGeoTranslation(
"tr2", 0.,0., t2);
325 tr2->RegisterYourself();
326 TGeoCompositeShape *cs2 =
new TGeoCompositeShape(
"cs2",
"(B2:tr2)-S2");
328 TGeoVolume *block2 =
new TGeoVolume(
"DrcBlock2",cs2,
gGeoManager->GetMedium(
"Mirror"));
329 block2->SetLineColor(kGreen);
330 block2->SetTransparency(40);
334 shift2 += bbox_hlen-
fabs(len)-2*mirr_hthick;
335 shift2 += len1 + gap;
354 fSlabEnd = -bbox_hlen + bbox_shift + flen;
355 cout<<
"bar ends at = "<<fSlabEnd<<endl;
360 if(fFocusingSystem == 3){
371 cout<<
"DIRC: len = "<<len<<endl;
373 cout<<
"length = "<< Lcyl<<
", angle = "<<Acyl/3.1415*180.<<
", translation = "<<Tcyl1<<endl;
374 cout<<
"lens 0.5*width = "<<hthick<<
", 0.5*thickness = "<< 0.5*Rcyl*(1.-
TMath::Cos(Acyl))<<
", 0.5*heigth = "<<Lcyl <<endl;
377 TGeoEltu* lCylinder =
new TGeoEltu(
"Cyl",Rcyl,Rcyl,Lcyl);
378 TGeoBBox* lCylBox =
new TGeoBBox(
"CylBox", hthick, hthick, Lcyl);
381 TGeoTranslation *trCyl1 =
new TGeoTranslation(
"trCyl", 0., Rcyl*
TMath::Cos(Acyl)+hthick, 0.);
382 trCyl1->RegisterYourself();
383 TGeoCompositeShape *llens1 =
new TGeoCompositeShape(
"llens1",
"Cyl*(CylBox:trCyl)");
384 TGeoVolume *CylLens1 =
new TGeoVolume(
"DrcLENS1Sensor",llens1,
gGeoManager->GetMedium(
"NLAK33A"));
385 CylLens1->SetLineColor(kRed-8);
386 CylLens1->SetTransparency(40);
388 fdz_lens1 = -(bbox_hlen - barWin_hthick) + len - (-Rcyl + Rcyl*(1.-
TMath::Cos(Acyl)));
391 TGeoTranslation *trCyl2 =
new TGeoTranslation(
"trCyl2", 0., Rcyl + Hcyl2 - hthick, 0.);
392 trCyl2->RegisterYourself();
393 TGeoCompositeShape *llens2 =
new TGeoCompositeShape(
"llens2",
"(CylBox:trCyl2) - Cyl");
394 TGeoVolume* CylLens2 =
new TGeoVolume(
"DrcLENS2Sensor", llens2,
gGeoManager->GetMedium(
"FusedSil"));
395 CylLens2->SetLineColor(kRed+2);
396 CylLens2->SetTransparency(40);
404 fdz_lens2 = -(bbox_hlen - barWin_hthick) + len + (hthick - Rcyl*(1.-
TMath::Cos(Acyl)) - Hcyl2);
405 fSlabEnd = -bbox_hlen + bbox_shift;
406 cout<<
"bar ends at = "<<fSlabEnd<<endl;
413 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
415 TGeoBBox* lTop =
new TGeoBBox(500,500,300);
416 TGeoVolume*
top =
new TGeoVolume(
"DIRC", lTop,
gGeoManager->GetMedium(
"air"));
421 TGeoPcon*
shape =
new TGeoPcon(
"BarrelDIRCShape", 0, 360., 4);
422 shape->DefineSection(0, bbox_zdown, 35., 60.);
423 shape->DefineSection(1, bbox_zup, 35., 60.);
424 shape->DefineSection(2, bbox_zup - sob_len, 35., sob_Rout+EVoffset+1.);
425 shape->DefineSection(3, bbox_zup - sob_len - PDbaseLayer - EVgreaseLayer, 35., sob_Rout+EVoffset+1.);
426 vLocalMother =
new TGeoVolume(
"BarrelDIRC", shape,
gGeoManager->GetMedium(
"DIRCairNoSens"));
427 top->AddNode(vLocalMother, 0,0);
429 cout<<
"bbox length = "<<2.*(bbox_hlen-0.5*(boxgap+boxthick))<<endl;
434 logicbbL =
new TGeoBBox(
"logicbbL", 0.5*barnum*(barwidth+2.*barhgap)+bbSideGap+boxthick, hthick+boxgap+boxthick, bbox_hlen);
436 TGeoTrap* logicPrizmBox =
new TGeoTrap(
"logicPrizmBox",sob_len/2. + PDbaseLayer/2. + EVgreaseLayer/2.,
437 atan(tan(sob_angle/180.*pi)/2.)/pi*180.,
439 (2.*hthick+EVdrop+EVoffset+(MCPsize-MCPactiveArea)+ 2.*boxgap+2.*boxthick+(sob_len + PDbaseLayer + EVgreaseLayer)*tan(sob_angle*pi/180.))/2.,
440 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea))+ boxgap + boxthick,
441 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea))+ boxgap + boxthick,
443 (2.*hthick+EVdrop+EVoffset+(MCPsize-MCPactiveArea) +2.*boxgap+2.*boxthick)/2.,
444 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea))+ boxgap + boxthick,
445 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea))+ boxgap + boxthick,
449 TGeoTranslation* trprb =
new TGeoTranslation(
"trprb", 0., 0.5*(logicPrizmBox->GetH1()+ logicPrizmBox->GetH2())-hthick-EVdrop-boxthick-boxgap-0.5*(MCPsize-MCPactiveArea), -bbox_hlen-sob_len/2.-PDbaseLayer/2.-EVgreaseLayer/2.);
450 trprb->RegisterYourself();
451 TGeoCompositeShape *cspb =
new TGeoCompositeShape(
"cspb",
"logicbbL + logicPrizmBox:trprb");
453 bbox =
new TGeoVolume(
"DrcBarBox", logicbbL,
gGeoManager->GetMedium(
"DIRCcarbonFiber"));
454 bbox->SetLineColor(30);
459 logicbbS =
new TGeoBBox(
"logicbbS", 0.5*barnum*(barwidth+2.*barhgap)+bbSideGap, hthick+boxgap, bbox_hlen-barWin_hthick);
460 abox =
new TGeoVolume(
"DrcAirBox", logicbbS,
gGeoManager->GetMedium(
"DIRCairNoSens"));
461 bbox->AddNode(abox, 1,
new TGeoCombiTrans(0., 0., barWin_hthick,
new TGeoRotation(0)));
462 abox->SetLineColor(19);
465 TGeoBBox* logicBarWin =
new TGeoBBox(
"logicBarWin", 0.5*barnum*(barwidth+2.*barhgap)+bbSideGap, hthick+boxgap, barWin_hthick);
466 TGeoVolume* barwin =
new TGeoVolume(
"DrcBarboxWindowSensor", logicBarWin,
gGeoManager->GetMedium(
"FusedSil"));
467 barwin->SetLineColor(kBlue-4);
468 bbox->AddNode(barwin, 1,
new TGeoCombiTrans(0.,0.,-bbox_hlen+barWin_hthick,
new TGeoRotation(0)));
481 TGeoBBox* logicEVgrease =
new TGeoBBox(
"logicEVgrease", 0.5*barnum*(barwidth+2.*barhgap)+bbSideGap, hthick+boxgap, EVgreaseLayer/2.);
482 TGeoVolume* evgrease =
new TGeoVolume(
"DrcEVgrease", logicEVgrease,
gGeoManager->GetMedium(
"OpticalGrease"));
483 evgrease->SetLineColor(kSpring);
486 cout<<
"width of the expansion volume = "<<2.*(0.5*barnum*(barwidth+2.*barhgap)-barhgap)<<
", step * 3 = "<<step*3.<<endl;
487 TGeoTrap *Trd =
new TGeoTrap(
"Trd",sob_len/2.,
488 atan(((2.*hthick+EVdrop+EVoffset+sob_len*tan(sob_angle*pi/180.))-(2.*hthick+EVdrop+EVoffset))/(2.*sob_len))*180./pi,
490 (2.*hthick+EVdrop+EVoffset+sob_len*tan(sob_angle*pi/180.))/2.,
491 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea)),
492 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea)),
494 (2.*hthick+EVdrop+EVoffset)/2.,
495 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea)),
496 0.5*(3.*step - MCPgap - (MCPsize - MCPactiveArea)),
498 TGeoVolume *EVsep =
new TGeoVolume(
"SepEVSensor",Trd,
gGeoManager->GetMedium(
"FusedSil"));
499 EVsep->SetLineColor(kCyan-9);
503 TGeoBBox* logicPDbase =
new TGeoBBox(
"logicPDbase", 0.5*3.*step, (2.*hthick+EVdrop+EVoffset+sob_len*tan(sob_angle*pi/180.))/2.+ 0.5*(MCPsize-MCPactiveArea), PDbaseLayer/2.);
504 TGeoVolume *pdbase =
new TGeoVolume(
"DrcPDbase", logicPDbase,
gGeoManager->GetMedium(
"DIRCcarbonFiber"));
505 pdbase->SetLineColor(kGreen-6);
506 pdbase->SetTransparency(40);
509 TGeoBBox* logicPD =
new TGeoBBox(
"logicPD", MCPactiveArea/2., MCPactiveArea/2., PDsensitiveThick/2.);
510 TGeoVolume *pixelholder =
new TGeoVolume(
"DrcPDSensor", logicPD,
gGeoManager->GetMedium(
"FusedSil"));
511 pixelholder->SetLineColor(kGreen+1);
514 TGeoBBox* logicPhCathode =
new TGeoBBox(
"logicPhCathode", MCPactiveArea/2., MCPactiveArea/2., PhCathodeThick/2.);
515 TGeoVolume *phcathode =
new TGeoVolume(
"DrcPhCathodeSensor", logicPhCathode,
gGeoManager->GetMedium(
"Photocathode"));
516 phcathode->SetLineColor(kGray+1);
519 TGeoBBox* logicWindow =
new TGeoBBox(
"logicWindow", MCPsize/2., MCPsize/2., PDwindowThick/2.);
520 TGeoVolume *window =
new TGeoVolume(
"DrcPDwindowSensor", logicWindow,
gGeoManager->GetMedium(
"FusedSil"));
521 window->SetLineColor(kBlue-4);
524 TGeoBBox* logicMCPgrease =
new TGeoBBox(
"logicMCPgrease", MCPsize/2., MCPsize/2., PDgreaseLayer/2.);
525 TGeoVolume *mcpgrease =
new TGeoVolume(
"DrcMcpGreaseSensor", logicMCPgrease,
gGeoManager->GetMedium(
"OpticalGrease"));
526 mcpgrease->SetLineColor(kSpring);
532 for(Int_t
i=0;
i<5;
i++){
533 for(Int_t j=0; j<3; j++){
534 xcurr = -0.5*(3.*step) + 0.5*step+j*step;
535 ycurr = -(2.*hthick+EVdrop+EVoffset+sob_len*tan(sob_angle*pi/180.))/2. + 0.5*step+
i*step - 0.5*(MCPsize-MCPactiveArea);
536 TotalNmcp = TotalNmcp+1;
538 pdbase->AddNode(phcathode, TotalNmcp,
new TGeoCombiTrans(xcurr, ycurr, PDbaseLayer/2.-PDgreaseLayer-PhCathodeThick/2.-PDwindowThick,
new TGeoRotation(0)));
540 pdbase->AddNode(window, TotalNmcp,
new TGeoCombiTrans(xcurr, ycurr, PDbaseLayer/2.-PDgreaseLayer-PDwindowThick/2.,
new TGeoRotation(0)));
542 pdbase->AddNode(mcpgrease, TotalNmcp,
new TGeoCombiTrans(xcurr, ycurr, PDbaseLayer/2.-PDgreaseLayer/2.,
new TGeoRotation(0)));
544 pdbase->AddNode(pixelholder, TotalNmcp,
new TGeoCombiTrans(xcurr, ycurr, PDbaseLayer/2.-PDgreaseLayer-PDwindowThick-PhCathodeThick-PDsensitiveThick/2.,
new TGeoRotation(0)));
551 cout<<
"bar width = "<<barwidth <<
", bar with gaps = "<<(bbX/barnum)<<endl;
552 cout<<
"barboxL width = "<<bbX/2.+boxgap+boxthick<<
", barboxS width = "<<bbX/2.+boxgap<<endl;
555 TGeoBBox* logicBar =
new TGeoBBox(
"logicBar", barwidth/2., hthick, bbox_hlen-
fabs(len)/2.-mirr_hthick-barWin_hthick);
558 bar =
new TGeoVolume(
"DrcBarSensor",logicBar,
gGeoManager->GetMedium(
"FusedSil"));
559 bar->SetLineColor(kCyan-9);
560 bar->SetTransparency(60);
563 TGeoBBox* logicMirror =
new TGeoBBox(
"logicMirror", barwidth/2., hthick, mirr_hthick /2.);
564 TGeoVolume *mirr =
new TGeoVolume(
"DrcMirr", logicMirror,
gGeoManager->GetMedium(
"Mirror"));
565 mirr->SetLineColor(5);
568 TGeoBBox* logicBarGlue =
new TGeoBBox(
"logicBarGlue", barwidth/2., hthick, gluehthick);
569 TGeoVolume *barglue =
new TGeoVolume(
"DrcBarGlueSensor", logicBarGlue,
gGeoManager->GetMedium(
"Epotek301_2"));
570 barglue->SetLineColor(kSpring-5);
571 bar->AddNode(barglue, 1,
new TGeoCombiTrans(0., 0., 0.,
new TGeoRotation (0)));
574 Double_t dx_bbox, dy_bbox, dz_bbox, phi_curr;
575 Double_t evLocShift = (Trd->GetH1()+Trd->GetH2())/2.-hthick - EVdrop;
576 Double_t pdLocShift = logicPDbase->GetDY()-hthick-0.5*(MCPsize-MCPactiveArea);
577 for(Int_t
m = 0;
m < bbnum;
m ++){
578 phi_curr = (90. - phi0 - dphi*
m)/180.*pi;
579 if(
m > bbnum/2-1){ phi_curr = (90. - phi0 - dphi*
m - 2.*pipehAngle)/180.*pi; }
580 dx_bbox = radius *
cos(phi_curr);
581 dy_bbox = radius *
sin(phi_curr);
582 dz_bbox = bbox_shift;
584 TGeoRotation rot_bbox;
585 rot_bbox.RotateZ( -phi0 -
m*dphi - (TMath::Floor(2.*
m/bbnum))*(2.*pipehAngle));
586 vLocalMother->AddNode(bbox,
m+1,
new TGeoCombiTrans(dx_bbox, dy_bbox, dz_bbox,
new TGeoRotation(rot_bbox)));
588 vLocalMother->AddNode(EVsep,
m+1,
new TGeoCombiTrans(dx_bbox+evLocShift*
cos(phi_curr), dy_bbox+evLocShift*
sin(phi_curr), -bbox_hlen+bbox_shift-sob_len/2.-EVgreaseLayer,
new TGeoRotation(rot_bbox)));
589 vLocalMother->AddNode(pdbase,
m+1,
new TGeoCombiTrans(dx_bbox+pdLocShift*
cos(phi_curr), dy_bbox+pdLocShift*
sin(phi_curr), -bbox_hlen+bbox_shift-sob_len-EVgreaseLayer-PDbaseLayer/2.,
new TGeoRotation(rot_bbox)));
595 for(Int_t j=0; j<barnum; j++){
596 dx = - (bbX/2.) - bbSideGap + (barwidth+2.*barhgap)/2. + j * (barwidth+2.*barhgap);
598 if(fFocusingSystem == 0 || fFocusingSystem == 1 || fFocusingSystem == 2){
599 dz_mirr = bbox_hlen - barWin_hthick - mirr_hthick;
600 dz_bar = len/2.-mirr_hthick;
602 if(fFocusingSystem == 3){
603 dz_mirr = bbox_hlen - barWin_hthick - mirr_hthick;
604 dz_bar = -mirr_hthick + len/2.;
606 if(fFocusingSystem == 1){
607 abox->AddNode(lens1, 1+j,
new TGeoCombiTrans(dx, dy, fdz_lens1,
new TGeoRotation (0)));
608 abox->AddNode(lens2, 1+j,
new TGeoCombiTrans(dx, dy, fdz_lens2,
new TGeoRotation (0)));
609 abox->AddNode(lens3, 1+j,
new TGeoCombiTrans(dx, dy, fdz_lens3,
new TGeoRotation (0)));
611 if(fFocusingSystem == 2){
612 abox->AddNode(block1, 1+j,
new TGeoCombiTrans(dx, dy, fdz_mirr1,
new TGeoRotation (0)));
613 abox->AddNode(block2, 1+j,
new TGeoCombiTrans(dx, dy, fdz_mirr2,
new TGeoRotation (0)));
615 if(fFocusingSystem == 3){
616 TGeoRotation rot_lens3;
617 rot_lens3.RotateZ(-90.);
618 rot_lens3.RotateY( 90.);
619 abox->AddNode(CylLens1, 1+j,
new TGeoCombiTrans(dx, dy, fdz_lens1,
new TGeoRotation(rot_lens3)));
620 abox->AddNode(CylLens2, 1+j,
new TGeoCombiTrans(dx, dy, fdz_lens1,
new TGeoRotation(rot_lens3)));
622 abox->AddNode(bar, 1+j,
new TGeoCombiTrans(dx, dy, dz_bar,
new TGeoRotation(0)));
623 if(fFocusingSystem != 2){
624 abox->AddNode(mirr, 1+j,
new TGeoCombiTrans(dx, dy, dz_mirr,
new TGeoRotation(0)));
630 top->CheckOverlaps(0.0001,
"");
642 TObjArray *listOfOverlaps =
gGeoManager->GetListOfOverlaps();
643 cout<<listOfOverlaps->GetEntries()<<endl;
644 listOfOverlaps->Print();
static T ASin(const T &x)
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
int createRootGeometry_DIRC_sepEV_06_2013(Int_t fFocusingSystem=0, Bool_t fprizm=kFALSE)
TGeoManager * gGeoManager
FairGeoBuilder * geobuild
double eps(TVector3 v1, TVector3 v2)
int findSectorOut(double y, double dphi_rad, double radiusCornerOut)
friend F32vec4 fabs(const F32vec4 &a)
FairGeoInterface * geoFace
void getXrange(double dphi, double radiusCornerOut, double radiusCornerIn, double MCPactiveArea, int cas1, int cas2, double ylow, double step, double &x1, double &x2)
int findSectorIn(double y, double dphi, double radius, double EVdrop, double hthick)
double getX(TVector3 corner1, TVector3 corner2, double yy)