FairRoot/PandaRoot
Functions | Variables
hypGeGeoCOSYsetup2014Passives.C File Reference
#include "TGeoManager.h"

Go to the source code of this file.

Functions

TString BuildOutputNameTarget (Double_t TargetThickness_Ext, Double_t Angle)
 
TGeoShape * makeMaytec (Double_t length, TString Name)
 
TGeoVolume * makeMaytecFrame (TGeoMedium *Med_ext)
 
TGeoVolume * makeGlueStackFrame (TGeoMedium *Al_ext, TGeoMedium *Steel_ext)
 
TGeoVolume * makeGlueSample (TGeoMedium *Al_ext, TGeoMedium *Glue_ext, Int_t SampleNumber, Bool_t PassivePart, Bool_t ActivePart)
 
TString hypGeGeoCOSYsetup2014Passives ()
 

Variables

double Pi = TMath::Pi()
 

Function Documentation

TString BuildOutputNameTarget ( Double_t  TargetThickness_Ext,
Double_t  Angle 
)

Definition at line 9 of file hypGeGeoCOSYsetup2014Passives.C.

References TString.

10 {
11  TString outfileWithoutPath = "hypGeGeoCOSYTarget_";
12  //char buf[10];
13  //sprintf(buf,"%.2f",TargetThickness_Ext);
14  //outfileWithoutPath += buf;
15  outfileWithoutPath +=TargetThickness_Ext;
16  //outfileWithoutPath +=
17  outfileWithoutPath += "cm_";
18  outfileWithoutPath += Angle;
19  outfileWithoutPath += "_Degree.root";
20  return outfileWithoutPath;
21 }
TString hypGeGeoCOSYsetup2014Passives ( )

Definition at line 220 of file hypGeGeoCOSYsetup2014Passives.C.

References CAMath::Cos(), Cu, Double_t, fi, geobuild, geoFace, geoLoad, geom(), gGeoManager, i, makeGlueSample(), makeGlueStackFrame(), makeMaytecFrame(), Media, outfile, Pi, PndGeoHypGeCluster::PlaceCluster(), RegisterYourself(), CAMath::Sin(), Target, top, and TString.

221 {
222  bool AddActives = 1;
223  bool AddPassives = 1;
224  bool GlueStackOnly = 0;
225  bool ElectronicsStackOnly = 0;
226 
227 
228  Double_t OffsetToAlPlate = -4.2;
229  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
230 
231  // Load this libraries
232  gSystem->Load("libGeoBase");
233  gSystem->Load("libParBase");
234  gSystem->Load("libBase");
235  gSystem->Load("libPndData");
236  gSystem->Load("libPassive");
237  gSystem->Load("libHypGe");
238 
239 
240 
241 
242  FairGeoLoader* geoLoad = new FairGeoLoader("TGeo","FairGeoLoader");
243  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
244  geoFace->setMediaFile("../../../../geometry/media_pnd.geo");
245  geoFace->readMedia();
246  //geoFace->print();
247 
248  FairGeoMedia *Media = geoFace->getMedia();
249  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
250 
251  FairGeoMedium *medcarbon = Media->getMedium("carbon");
252  Int_t nmedcap=geobuild->createMedium(medcarbon);
253  TGeoMedium *Carbon = gGeoManager->GetMedium("carbon");
254 
255  FairGeoMedium *medcap = Media->getMedium("HYPaluminium");
256  Int_t nmedcap=geobuild->createMedium(medcap);
257  TGeoMedium *Al = gGeoManager->GetMedium("HYPaluminium");
258 
259  FairGeoMedium *medGe = Media->getMedium("germanium");
260  Int_t nmedGe=geobuild->createMedium(medGe);
261  TGeoMedium *Ge = gGeoManager->GetMedium("germanium");
262 
263  FairGeoMedium *medsteel = Media->getMedium("steel");
264  Int_t nmedcap=geobuild->createMedium(medsteel);
265  TGeoMedium *Steel = gGeoManager->GetMedium("steel");
266 
267  FairGeoMedium *medcu = Media->getMedium("copper");
268  Int_t nmedcap=geobuild->createMedium(medcu);
269  TGeoMedium *Cu = gGeoManager->GetMedium("copper");
270 
271  FairGeoMedium *medpe_bor5 = Media->getMedium("pe_bor5");
272  Int_t nmedcap=geobuild->createMedium(medpe_bor5);
273  TGeoMedium *pe_bor5 = gGeoManager->GetMedium("pe_bor5"); // polyethylen with 5 % boronoxide
274 
275  FairGeoMedium *medacrylicGlass = Media->getMedium("acrylicGlass");
276  Int_t nmedcap=geobuild->createMedium(medacrylicGlass);
277  TGeoMedium *acrylicGlass = gGeoManager->GetMedium("acrylicGlass");
278 
279 
280  TGeoManager *geom = (TGeoManager*)gROOT->FindObject("FAIRGeom");
281  TGeoVolume *top = new TGeoVolumeAssembly("hpGe");
282  TGeoVolume *PassivesTop = new TGeoVolumeAssembly("PassivesTop");
283  TGeoVolume *ActivesTop = new TGeoVolumeAssembly("ActivesTop");
284 
285 //cout<<" geom "<<geom<<endl;
286  geom->SetTopVolume(top);
287 
288  // carbon target
289 
290  Double_t TargetThickness = 5;
291  Double_t Angle = 0;
292 
293  TGeoVolume *TargetAssembly = new TGeoVolumeAssembly("TargetAssembly");
294  TGeoVolume* Target = geom->MakeBox("Target",Carbon,2.4,2.4,TargetThickness/2);
295  Target->SetLineColor(kRed);
296  Target->SetFillColor(kRed);
297  TGeoRotation *TargetRot = new TGeoRotation("TargetRot",0,Angle,0);
298  TargetRot->RegisterYourself();
299  TargetAssembly->AddNode(Target,0,new TGeoCombiTrans("",0,0,TargetThickness/2/TMath::Cos(Angle*Pi/180),TargetRot));
300 
301  TGeoVolume* TargetAddition = geom->MakeBox("TargetAddition",Carbon,0.5,2.4,2.4);
302  TargetAddition->SetLineColor(kRed);
303  TargetAddition->SetFillColor(kRed);
304  TargetAssembly->AddNode(TargetAddition,1,new TGeoCombiTrans(-2.9,0,-0.1+TargetThickness/2/TMath::Cos(Angle*Pi/180),TargetRot));
305  TargetAssembly->AddNode(TargetAddition,2,new TGeoCombiTrans(-3.9,0,-0.1+TargetThickness/2/TMath::Cos(Angle*Pi/180),TargetRot));
306 
307  if (!GlueStackOnly && !ElectronicsStackOnly ) PassivesTop->AddNode(TargetAssembly,0);
308 
309 
310  // Al support of germanium setup: target holder, alu plate, maytec frame
311  TGeoVolume *AlSupportAssembly = new TGeoVolumeAssembly("AlSupportAssembly");
312  // target holder
313  // plate under target
314  TGeoTube *AlPlateTube = new TGeoTube("AlPlateTube",0,6,0.2);
315  TGeoRotation *AlPlateTubeRotation = new TGeoRotation ("AlPlateTubeRotation",90,90,0);
316  AlPlateTubeRotation->RegisterYourself();
317  TGeoBBox *AlPlateBox = new TGeoBBox("AlPlateBox",0.2,6,11.6/2);
318  TGeoTranslation *AlPlateBoxTranslation = new TGeoTranslation ("AlPlateBoxTranslation",0,0,+5.8);
319  AlPlateBoxTranslation->RegisterYourself();
320  TGeoCompositeShape *AlPlateShape = new TGeoCompositeShape("AlPlateShape", "AlPlateTube : AlPlateTubeRotation + AlPlateBox : AlPlateBoxTranslation");
321  TGeoVolume *AlPlate = new TGeoVolume("AlPlate", AlPlateShape, Al);
322  AlPlate->SetLineColor(14);
323  AlPlate->SetFillColor(14);
324 
325  // angle bracket in front of target
326  TGeoBBox *AlFrontAngleTop = new TGeoBBox("AlFrontAngleTop",0.5,2.5,0.1);
327  TGeoTranslation *AlFrontAngleTopTranslation = new TGeoTranslation ("AlFrontAngleTopTranslation",+0.2+0.5,0,-0.1);
328  AlFrontAngleTopTranslation->RegisterYourself();
329  TGeoBBox *AlFrontAngleBottom = new TGeoBBox("AlFrontAngleBottom",0.1,2.5,1.5);
330  TGeoTranslation *AlFrontAngleBottomTranslation = new TGeoTranslation ("AlFrontAngleBottomTranslation",+0.3,0,-1.5);
331  AlFrontAngleBottomTranslation->RegisterYourself();
332  TGeoBBox *AlFrontAngleBottomCutout = new TGeoBBox("AlFrontAngleBottomCutout",1,0.25,1.5);
333  TGeoTranslation *AlFrontAngleBottomCutoutTranslation = new TGeoTranslation ("AlFrontAngleBottomCutoutTranslation",+0.3,0,-2.5);
334  AlFrontAngleBottomCutoutTranslation->RegisterYourself();
335  TGeoCompositeShape *AlFrontAngleShape = new TGeoCompositeShape("AlFrontAngleShape", "(AlFrontAngleTop : AlFrontAngleTopTranslation + AlFrontAngleBottom : AlFrontAngleBottomTranslation ) - ( AlFrontAngleBottomCutout : AlFrontAngleBottomCutoutTranslation)");
336  TGeoVolume *AlFrontAngle = new TGeoVolume("AlFrontAngle", AlFrontAngleShape, Al);
337  AlFrontAngle ->SetLineColor(14);
338  AlFrontAngle ->SetFillColor(14);
339 
340  // angle bracket in the back of target
341  TGeoBBox *AlBackAngleTop = new TGeoBBox("AlBackAngleTop",0.5,2.5,0.1);
342  TGeoTranslation *AlBackAngleTopTranslation = new TGeoTranslation ("AlBackAngleTopTranslation",+0.2+0.5,0,4.9);
343  AlBackAngleTopTranslation->RegisterYourself();
344  TGeoBBox *AlBackAngleBottom = new TGeoBBox("AlBackAngleBottom",0.1,2.5,5);
345  TGeoTranslation *AlBackAngleBottomTranslation = new TGeoTranslation ("AlBackAngleBottomTranslation",+0.3,0,4.8+5);
346  AlBackAngleBottomTranslation->RegisterYourself();
347  TGeoBBox *AlBackAngleBottomCutout = new TGeoBBox("AlBackAngleBottomCutout",1,0.25,5);
348  TGeoTranslation *AlBackAngleBottomCutoutTranslation = new TGeoTranslation ("AlBackAngleBottomCutoutTranslation",+0.3,0,4.8+7);
349  AlBackAngleBottomCutoutTranslation->RegisterYourself();
350  TGeoCompositeShape *AlBackAngleShape = new TGeoCompositeShape("AlBackAngleShape", "(AlBackAngleTop : AlBackAngleTopTranslation + AlBackAngleBottom : AlBackAngleBottomTranslation ) - ( AlBackAngleBottomCutout : AlBackAngleBottomCutoutTranslation)");
351  TGeoVolume *AlBackAngle = new TGeoVolume("AlBackAngle", AlBackAngleShape, Al);
352  AlBackAngle ->SetLineColor(14);
353  AlBackAngle ->SetFillColor(14);
354 
355  // add Al goniometer
356  TGeoTube *AlGoniometerTube = new TGeoTube("AlGoniometerTube",5,6,2);
357  TGeoCombiTrans *AlGoniometerTubeCombiTrans = new TGeoCombiTrans ("AlGoniometerTubeCombiTrans",-2.2,0,0, new TGeoRotation("",90,90,0));
358  AlGoniometerTubeCombiTrans->RegisterYourself();
359  TGeoVolume *AlGoniometer = new TGeoVolume("AlGoniometer",AlGoniometerTube,Al);
360  AlGoniometer ->SetLineColor(14);
361  AlGoniometer ->SetFillColor(14);
362 
363  //screw head close to the beam
364 
365  TGeoTube *M5ScrewHeadOut = new TGeoTube("M5ScrewHeadOut",0.45/2,0.4,0.25);
366  TGeoTube *M5ScrewHeadIn = new TGeoTube("M5ScrewHeadIn",0,0.45/2,0.25/2);
367  TGeoTranslation *M5ScrewHeadInTrans = new TGeoTranslation("M5ScrewHeadInTrans",0,0,0.25/2);
368  M5ScrewHeadInTrans -> RegisterYourself();
369  TGeoCompositeShape *M5ScrewHeadShape = new TGeoCompositeShape("M5SrewHeadShape","M5ScrewHeadOut + M5ScrewHeadIn : M5ScrewHeadInTrans");
370  TGeoVolume *M5ScrewHead = new TGeoVolume("M5ScrewHead",M5ScrewHeadShape,Steel);
371  TGeoCombiTrans *M5ScrewHeadCombiTrans = new TGeoCombiTrans ("M5ScrewHeadCombiTrans",+0.4+0.25,0,8, new TGeoRotation("",90,270,0));
372  M5ScrewHeadCombiTrans->RegisterYourself();
373  TGeoCombiTrans *M5ScrewHead2CombiTrans = new TGeoCombiTrans ("M5ScrewHead2CombiTrans",+0.4+0.25,0,-2, new TGeoRotation("",90,270,0));
374  M5ScrewHead2CombiTrans->RegisterYourself();
375  M5ScrewHead->SetLineColor(36);
376  M5ScrewHead->SetFillColor(36);
377 
378  AlSupportAssembly->AddNode(M5ScrewHead,1, M5ScrewHeadCombiTrans);
379  AlSupportAssembly->AddNode(M5ScrewHead,2, M5ScrewHead2CombiTrans);
380 
381  // add Al base plate
382 
383  TGeoBBox *AlBasePlateBox = new TGeoBBox("AlBasePlateBox",0.4,30,40);
384  TGeoCombiTrans *AlBasePlateCombiTrans = new TGeoCombiTrans ("AlBasePlateCombiTrans",-4.6,25,-25, new TGeoRotation("",0,60,0));
385  AlBasePlateCombiTrans->RegisterYourself();
386  TGeoVolume *AlBasePlate = new TGeoVolume("AlBasePlate",AlBasePlateBox,Al);
387  AlBasePlate ->SetLineColor(14);
388  AlBasePlate ->SetFillColor(14);
389 
390  // add all Al parts to assembly
391  AlSupportAssembly->AddNode(AlBasePlate,1, AlBasePlateCombiTrans);
392  AlSupportAssembly->AddNode(AlGoniometer,1, AlGoniometerTubeCombiTrans);
393  AlSupportAssembly->AddNode(AlFrontAngle,1);
394  AlSupportAssembly->AddNode(AlBackAngle,1);
395  AlSupportAssembly->AddNode(AlPlate,1);
396 
397  TGeoVolume *Frame = makeMaytecFrame(Al);
398  AlSupportAssembly ->AddNode(Frame,1, new TGeoCombiTrans(OffsetToAlPlate,15*TMath::Sin(TMath::Pi()/180*60),-15*TMath::Cos(TMath::Pi()/180*60), new TGeoRotation("",0,-30,0)));
399 
400  if (!GlueStackOnly && !ElectronicsStackOnly ) PassivesTop->AddNode(AlSupportAssembly,1, new TGeoTranslation (-4.6,0,0));
401 
402  //plastic blocks under the Al plate
403 
404  TGeoBBox *PlasticBlockBox = new TGeoBBox("PlasticBlockBox",5,6,10);
405  TGeoVolume *PlasticBlock = new TGeoVolume ("PlasticBlock", PlasticBlockBox,acrylicGlass);
406  TGeoVolume *PlasticBlock2 = new TGeoVolume ("PlasticBlock2", PlasticBlockBox,acrylicGlass);
407 
408  PlasticBlock->SetFillColor(kBlue+4);
409  PlasticBlock->SetLineColor(kBlue+4);
410  PlasticBlock2->SetFillColor(kBlue+4);
411  PlasticBlock2->SetLineColor(kBlue+4);
412 
413  TGeoCombiTrans *PlasticBlock1Trans = new TGeoCombiTrans ("PlasticBlock1Trans",OffsetToAlPlate-4.6-0.8-5,-24*TMath::Cos(TMath::Pi()/180*60)-30*TMath::Sin(TMath::Pi()/180*60)+25,-24*TMath::Sin(TMath::Pi()/180*60)+30*TMath::Cos(TMath::Pi()/180*60)-25, new TGeoRotation("",0,60,0));
414  PlasticBlock1Trans->RegisterYourself();
415  TGeoCombiTrans *PlasticBlock2Trans = new TGeoCombiTrans ("PlasticBlock2Trans",OffsetToAlPlate-4.6-0.8-5,24*TMath::Cos(TMath::Pi()/180*60)-30*TMath::Sin(TMath::Pi()/180*60)+25,24*TMath::Sin(TMath::Pi()/180*60)+30*TMath::Cos(TMath::Pi()/180*60)-25 , new TGeoRotation("",0,60,0));
416  PlasticBlock2Trans->RegisterYourself();
417  if (!GlueStackOnly && !ElectronicsStackOnly ) PassivesTop->AddNode (PlasticBlock,0,PlasticBlock1Trans);
418  if (!GlueStackOnly && !ElectronicsStackOnly ) PassivesTop->AddNode (PlasticBlock2,0,PlasticBlock2Trans);
419 
420 
421  // neutron detectors
422 
423 
424  TGeoVolume *NeutronDetectorAssembly = new TGeoVolumeAssembly("NeutronDetectorAssembly");
425  // electronic neutron dosimeter (Kermit)
426  TGeoTube *KermitTube= new TGeoTube("KermitTube",0,23.5/2,26.4/2);
427  TGeoVolume *KermitVolume = new TGeoVolume("KermitCrystal",KermitTube,pe_bor5);
428  KermitVolume->SetFillColor(kWhite);
429  TGeoCombiTrans *KermitCombiTrans = new TGeoCombiTrans ("KermitHeadCombiTrans",24.5+23.5/2+OffsetToAlPlate,15+(26.4/2)*TMath::Sin(TMath::Pi()/180*60),-(15+26.4/2)*TMath::Cos(TMath::Pi()/180*60), new TGeoRotation("",0,60,0));
430  KermitCombiTrans->RegisterYourself();
431  NeutronDetectorAssembly ->AddNode(KermitVolume,1, KermitCombiTrans); // check x position of kermit, seems too high, but need better connection for this...
432 
433  // passive neutron ball
434  TGeoSphere *NeutronBallSphere = new TGeoSphere("NeutronBallSphere",0,32/2,0,180,0,360);
435  TGeoVolume *NeutronBall = new TGeoVolume ("NeutronBallCrystal", NeutronBallSphere,pe_bor5);
436  NeutronBall->SetFillColor(kBlack);
437  TGeoCombiTrans *NeutronBallCombiTrans = new TGeoCombiTrans ("NeutronBallHeadCombiTrans",20+OffsetToAlPlate,21.5+32/2,-54, new TGeoRotation("",0,0,0));
438  NeutronBallCombiTrans->RegisterYourself();
439  NeutronDetectorAssembly ->AddNode(NeutronBall,1, NeutronBallCombiTrans);
440 
441  if (!GlueStackOnly && !ElectronicsStackOnly ) ActivesTop->AddNode(NeutronDetectorAssembly,1, new TGeoTranslation (-4.6,0,0));
442 
443  //germanium
444 
445  PndGeoHypGeSingleCluster *SingleCluster = new PndGeoHypGeSingleCluster(Ge,Al,Cu,1);
446  Int_t CrystalNumber = 1;
447  if (!GlueStackOnly && !ElectronicsStackOnly ) SingleCluster ->PlaceCluster(ActivesTop, 0,15, 0,60,0,&CrystalNumber);
448 
449  // piezos
450  TGeoVolume* Piezo = geom->MakeBox("CrystalPiezo1",acrylicGlass,0.75,0.25,0.2);
451  TGeoVolume* Piezo2 = geom->MakeBox("CrystalPiezo2",acrylicGlass,0.75,0.25,0.2);
452  Piezo->SetLineColor(kBlue);
453  Piezo->SetFillColor(kBlue);
454  if (!GlueStackOnly && !ElectronicsStackOnly ) ActivesTop->AddNode(Piezo,0,new TGeoCombiTrans(-1,0,5.2,new TGeoRotation("",90,0,0)));
455  Piezo2->SetLineColor(kBlue);
456  Piezo2->SetFillColor(kBlue);
457  if (!GlueStackOnly && !ElectronicsStackOnly ) ActivesTop->AddNode(Piezo2,0,new TGeoCombiTrans(1,0,5.2,new TGeoRotation("",90,0,0)));
458 
459  // stack of glue samples
460  // first the frame
461 
462  TGeoVolume *GlueStackAssemblyActive = new TGeoVolumeAssembly("GlueStackAssemblyActive");
463  TGeoVolume *GlueStackAssemblyPassive = new TGeoVolumeAssembly("GlueStackAssemblyPassive");
464  TGeoVolume *GlueStackFrame = makeGlueStackFrame(Al,acrylicGlass);
465 
466  GlueStackAssemblyPassive->AddNode(GlueStackFrame,1);
467 
468  TGeoVolume *GlueSamplesActive[23];
469  TGeoVolume *GlueSamplesPassive[23];
470  //TGeoCombiTrans GlueSampleTrans[23];
471 
472  for (int i= 0; i < 23; i++)
473  {
474  GlueSamplesActive[i] = makeGlueSample(Al, Steel,i, 0, 1);
475  GlueSamplesPassive[i] = makeGlueSample(Al, Steel,i, 1, 0);
476  //GlueSampleTrans[i] = new TGeoCombiTrans (0,0,0.4 + i*(1), new TGeoRotation(0,0,0));
477  GlueStackAssemblyActive->AddNode(GlueSamplesActive[i],i, new TGeoCombiTrans (0,0,-(0.4 + i*(0.203)), new TGeoRotation("",i*90,0,0)));
478  GlueStackAssemblyPassive->AddNode(GlueSamplesPassive[i],i, new TGeoCombiTrans (0,0,-(0.4 + i*(0.203)), new TGeoRotation("",i*90,0,0)));
479  }
480  if ( !ElectronicsStackOnly ) ActivesTop->AddNode(GlueStackAssemblyActive,1, new TGeoCombiTrans (0,0,100, new TGeoRotation("",0,180,0)));
481  if ( !ElectronicsStackOnly ) PassivesTop->AddNode(GlueStackAssemblyPassive,1, new TGeoCombiTrans (0,0,100, new TGeoRotation("",0,180,0)));
482 
483  if (AddActives) top->AddNode(ActivesTop,0);
484  if (AddPassives) top->AddNode(PassivesTop,0);
485 
486  geom->CheckOverlaps();
487  geom->CloseGeometry();
488  cout << "# of Nodes: " << PassivesTop->CountNodes(10,1) << endl;
489 
490 
491 
492  // file with passive parts
493  TString outfileWithoutPath ="hypGeGeoCOSY2014setupPassives.root";//BuildOutputNameTarget(TargetThickness_Ext, Angle); //"hypGeGeoCOSYTarget_";
494  TString outfile= "../../../../geometry/";
495  outfile += outfileWithoutPath;
496 
497  cout << outfile << endl;
498  PassivesTop->PrintNodes();
499  ActivesTop->ls();
500 
501  TFile* fi = new TFile(outfile,"RECREATE");
502  TGeoVolume *PassivesTopWrap = new TGeoVolumeAssembly("PassivesTopWrap");
503  PassivesTopWrap->AddNode(PassivesTop,0);
504  PassivesTopWrap->Write();
505  fi->Close();
506  cout << "Wrote passives geometry to file: " << outfileWithoutPath << endl;
507 
508  // file with active parts
509  outfileWithoutPath ="hypGeGeoCOSY2014setupActives.root";
510  outfile= "../../../../geometry/";
511  outfile += outfileWithoutPath;
512 
513  cout << outfile << endl;
514  fi->Open(outfile,"RECREATE");
515 
516  TGeoVolume *ActivesTopWrap = new TGeoVolumeAssembly("ActivesTopWrap");
517  ActivesTopWrap->AddNode(ActivesTop,0);
518  ActivesTopWrap->Write();
519  fi->Close();
520 
521  top->Draw("ogl");
522  //PassivesTop->Draw("");
523 
524 
525 
526 
527 
528 
529  return outfileWithoutPath; // returns the name of the created geometry file
530 }
FairGeoLoader * geoLoad
Int_t i
Definition: run_full.C:25
FairGeoMedia * Media
static T Sin(const T &x)
Definition: PndCAMath.h:42
TFile * Target
Definition: hadd.C:35
trDW RegisterYourself()
TGeoManager * gGeoManager
static T Cos(const T &x)
Definition: PndCAMath.h:43
TGeoVolume * top
TGeoVolume * makeMaytecFrame(TGeoMedium *Med_ext)
FairGeoBuilder * geobuild
TFile * fi
Double_t
#define Cu
TGeoVolume * makeGlueStackFrame(TGeoMedium *Al_ext, TGeoMedium *Steel_ext)
TGeoVolume * makeGlueSample(TGeoMedium *Al_ext, TGeoMedium *Glue_ext, Int_t SampleNumber, Bool_t PassivePart, Bool_t ActivePart)
void PlaceCluster(TGeoVolume *top, TGeoMatrix *ClusterPlaceAndDirectionTranslation, Int_t *CrystalNumber)
FairGeoInterface * geoFace
Double_t Pi
TString outfile
TGeoVolume* makeGlueSample ( TGeoMedium *  Al_ext,
TGeoMedium *  Glue_ext,
Int_t  SampleNumber,
Bool_t  PassivePart,
Bool_t  ActivePart 
)

Definition at line 172 of file hypGeGeoCOSYsetup2014Passives.C.

References Double_t.

173 {
174  // one glue sample sandwich is constructed in this function
175 
176  Double_t HolderThickness = 0.1; // 1 mm
177  Double_t GlueThickness = 0.003; // 40 µm
178  char buf[100];
179 
180  sprintf (buf,"GlueSampleAssembly%d", SampleNumber);
181  TGeoVolume *SampleAssembly = new TGeoVolumeAssembly (buf);
182 
183  sprintf (buf,"GlueHolderBox%d", SampleNumber);
184  TGeoBBox *GlueHolderBox = new TGeoBBox(buf,7.8/2,2.6/2,HolderThickness/2);
185  sprintf (buf,"GlueSampleBox%d", SampleNumber);
186  TGeoBBox *GlueBox = new TGeoBBox(buf,7.8/2,2.6/2,GlueThickness/2);
187 
188  sprintf (buf,"GlueHolder_%d", SampleNumber);
189  TGeoVolume *GlueHolder = new TGeoVolume (buf, GlueHolderBox, Al_ext);
190  sprintf (buf,"GlueHolder2_%d", SampleNumber);
191  TGeoVolume *GlueHolder2 = new TGeoVolume (buf, GlueHolderBox, Al_ext);
192 
193  sprintf (buf,"GlueSampleCrystal%d", SampleNumber);
194  TGeoVolume *GlueSampleCrystal = new TGeoVolume (buf, GlueBox, Glue_ext);
195  GlueSampleCrystal->SetFillColor(kRed);
196  GlueSampleCrystal->SetLineColor(kRed);
197 
198  sprintf (buf,"GlueHolderTrans1%d", SampleNumber);
199  TGeoTranslation *GlueHolderTrans1 = new TGeoTranslation(buf,0,0,-HolderThickness/2);
200  GlueHolderTrans1->RegisterYourself();
201  sprintf (buf,"GlueHolderTrans2%d", SampleNumber);
202  TGeoTranslation *GlueHolderTrans2 = new TGeoTranslation(buf,0,0,-(HolderThickness+GlueThickness +HolderThickness/2));
203  GlueHolderTrans2->RegisterYourself();
204  sprintf (buf,"GlueTransd", SampleNumber);
205  TGeoTranslation *GlueTrans = new TGeoTranslation(buf,0,0,-(HolderThickness+GlueThickness/2));
206  GlueTrans->RegisterYourself();
207 
208  if (PassivePart)
209  {
210  SampleAssembly->AddNode(GlueHolder,0,GlueHolderTrans1);
211  SampleAssembly->AddNode(GlueHolder2,0,GlueHolderTrans2);
212  }
213  if (ActivePart)
214  SampleAssembly->AddNode(GlueSampleCrystal,0,GlueTrans);
215 
216  return SampleAssembly;
217 
218 }
Double_t
TGeoVolume* makeGlueStackFrame ( TGeoMedium *  Al_ext,
TGeoMedium *  Steel_ext 
)

Definition at line 141 of file hypGeGeoCOSYsetup2014Passives.C.

References Double_t, and TString.

142 {
143  // (0,0,0) on the front of the front plate of the stack!
144  Double_t BarLength = 6;
145 
146  TGeoBBox *GlueSampleFrameFrontBox = new TGeoBBox("GlueSampleFrameFrontBox",4,4,0.2);
147  //TGeoVolume *GlueSampleFrameFront = new TGeoVolume("GlueSampleFrameFront", GlueSampleFrontBox,Med_ext);
148 
149  TGeoTranslation *GlueSampleFrontTrans = new TGeoTranslation("GlueSampleFrontTrans",0,0,-0.2);
150  GlueSampleFrontTrans->RegisterYourself();
151  TGeoTranslation *GlueSampleBackTrans = new TGeoTranslation("GlueSampleBackTrans",0,0,-(0.4+BarLength+0.2));
152  GlueSampleBackTrans->RegisterYourself();
153 
154  TGeoBBox *GlueSampleFrameBarBox = new TGeoBBox("GlueSampleFrameBarBox",.4,.4,BarLength/2);
155  //TGeoVolume *GlueSampleFrameBar = new TGeoVolume("GlueSampleFrameBar", GlueSampleFrontBox,Med_ext);
156 
157  TGeoTranslation *GlueSampleFrameBarTrans1 = new TGeoTranslation("GlueSampleFrameBarTrans1",1.4+0.4,1.4+0.4,-(BarLength/2+0.4));
158  GlueSampleFrameBarTrans1->RegisterYourself();
159  TGeoTranslation *GlueSampleFrameBarTrans2 = new TGeoTranslation("GlueSampleFrameBarTrans2",-(1.4+0.4),1.4+0.4,-(BarLength/2+0.4));
160  GlueSampleFrameBarTrans2->RegisterYourself();
161  TGeoTranslation *GlueSampleFrameBarTrans3 = new TGeoTranslation("GlueSampleFrameBarTrans3",-(1.4+0.4),-(1.4+0.4),-(BarLength/2+0.4));
162  GlueSampleFrameBarTrans3->RegisterYourself();
163  TGeoTranslation *GlueSampleFrameBarTrans4 = new TGeoTranslation("GlueSampleFrameBarTrans4",1.4+0.4,-(1.4+0.4),-(BarLength/2+0.4));
164  GlueSampleFrameBarTrans4->RegisterYourself();
165 
166  TString ShapeString = "GlueSampleFrameFrontBox : GlueSampleFrontTrans + GlueSampleFrameFrontBox : GlueSampleBackTrans + GlueSampleFrameBarBox : GlueSampleFrameBarTrans1 + GlueSampleFrameBarBox : GlueSampleFrameBarTrans2 + GlueSampleFrameBarBox : GlueSampleFrameBarTrans3 + GlueSampleFrameBarBox : GlueSampleFrameBarTrans4";
167  TGeoCompositeShape *GlueStackFrameShape = new TGeoCompositeShape("GlueStackFrameShape", ShapeString.Data());
168  TGeoVolume *GlueSampleFrame = new TGeoVolume("GlueSampleFrame", GlueStackFrameShape,Al_ext);
169  return GlueSampleFrame;
170 }
Double_t
TGeoShape* makeMaytec ( Double_t  length,
TString  Name 
)

Definition at line 23 of file hypGeGeoCOSYsetup2014Passives.C.

References CAMath::Cos(), i, Pi, CAMath::Sin(), and TString.

24 {
25  char buf[100];
26  sprintf(buf, "%sRaw",Name.Data());
27  TGeoBBox *Raw = new TGeoBBox(buf,1.5,1.5,length/2);
28  sprintf(buf, "%sHole",Name.Data());
29  TGeoTube *Hole = new TGeoTube(buf,0,0.6, length);
30  sprintf(buf, "%sTrapez",Name.Data());
31  TGeoTrd1 *Trapez = new TGeoTrd1(buf,0.45,0.75,length,0.25);
32  sprintf(buf, "%sRectangle",Name.Data());
33  TGeoBBox *Rectangle = new TGeoBBox(buf,0.4,0.4,length);
34  sprintf(buf, "%sRectangle2",Name.Data());
35  TGeoBBox *Rectangle2 = new TGeoBBox(buf,0.15,0.5,length);
36  sprintf(buf, "%sRectangle3",Name.Data());
37  TGeoBBox *Rectangle3 = new TGeoBBox(buf,0.1,0.1,length);
38  sprintf(buf, "%sTube",Name.Data());
39  TGeoTubeSeg *Tube = new TGeoTubeSeg(buf, 0.2 , 1 ,length,0,90);
40 
41  TGeoCombiTrans *TrapezCombiTrans[4];
42  TGeoCombiTrans *RectangleCombiTrans[4];
43  TGeoCombiTrans *Rectangle2CombiTrans[4];
44  TGeoCombiTrans *Rectangle3CombiTrans[4];
45  TGeoCombiTrans *Rectangle3CombiTrans2[4];
46  TGeoCombiTrans *TubeCombiTrans[4];
47 
48  sprintf(buf,"%sRaw - %sHole",Name.Data(),Name.Data());
49  TString ShapeString = buf;
50 
51  // position and remove all the fine structure of a maytec profile
52  for (int i = 0; i< 4; i++)
53  {
54  sprintf(buf,"TrapezCombiTrans%d",i);
55  TrapezCombiTrans[i] = new TGeoCombiTrans(buf,1.05*TMath::Sin((i+1)*(TMath::Pi()/2)),1.05*TMath::Cos((i+1)*(TMath::Pi()/2)),0, new TGeoRotation("",90*(1-i),90,0) ); // sin for 4 fold symmetry
56  TrapezCombiTrans[i] ->RegisterYourself();
57  sprintf(buf,"-%sTrapez :TrapezCombiTrans%d",Name.Data(),i);
58  ShapeString += buf;
59  sprintf(buf,"RectangleCombiTrans%d",i);
60  RectangleCombiTrans[i] = new TGeoCombiTrans(buf,1.4*TMath::Sin((i+1)*(TMath::Pi()/2)),1.4*TMath::Cos((i+1)*(TMath::Pi()/2)),0, new TGeoRotation("",0,0,0) );
61  RectangleCombiTrans[i]->RegisterYourself();
62  sprintf(buf,"-%sRectangle :RectangleCombiTrans%d",Name.Data(),i);
63  ShapeString += buf;
64  sprintf(buf,"Rectangle2CombiTrans%d",i);
65  Rectangle2CombiTrans[i] = new TGeoCombiTrans(buf,0.9*pow(-1,i/2),0.9*pow(-1,(i+1)/2),0, new TGeoRotation("",-45+i*90,0,0) );
66  Rectangle2CombiTrans[i]->RegisterYourself();
67  sprintf(buf,"-%sRectangle2 :Rectangle2CombiTrans%d",Name.Data(),i);
68  ShapeString += buf;
69  sprintf(buf,"Rectangle3CombiTrans%d",i);
70  Rectangle3CombiTrans[i] = new TGeoCombiTrans(buf,0.9*pow(-1,i/2),1.58*pow(-1,(i+1)/2),0, new TGeoRotation("",0,0,0) );
71  Rectangle3CombiTrans[i]->RegisterYourself();
72  sprintf(buf,"-%sRectangle3 :Rectangle3CombiTrans%d",Name.Data(),i);
73  ShapeString += buf;
74  sprintf(buf,"Rectangle3CombiTrans2%d",i);
75  Rectangle3CombiTrans2[i] = new TGeoCombiTrans(buf,1.58*pow(-1,(i+1)/2),0.9*pow(-1,i/2),0, new TGeoRotation("",0,0,0) );
76  Rectangle3CombiTrans2[i]->RegisterYourself();
77  sprintf(buf,"-%sRectangle3 :Rectangle3CombiTrans2%d",Name.Data(),i);
78  ShapeString += buf;
79  sprintf(buf,"TubeCombiTrans%d",i);
80  TubeCombiTrans[i] = new TGeoCombiTrans(buf,1.3*pow(-1,(i+1)/2),1.3*pow(-1,i/2),0, new TGeoRotation("",i*90,0,0) );
81  TubeCombiTrans[i]->RegisterYourself();
82  sprintf(buf,"-%sTube :TubeCombiTrans%d",Name.Data(),i);
83  ShapeString += buf;
84  }
85 
86  TGeoCompositeShape *Profile = new TGeoCompositeShape(Name.Data(), ShapeString.Data());
87  //cout << ShapeString.Data() << endl;
88 
89 
90 
91  return Profile;
92 }
Int_t i
Definition: run_full.C:25
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
Double_t Pi
TGeoVolume* makeMaytecFrame ( TGeoMedium *  Med_ext)

Definition at line 94 of file hypGeGeoCOSYsetup2014Passives.C.

References Double_t, and makeMaytec().

95 {
96  cout << "frame start" << endl;
97  TGeoVolumeAssembly *FrameAssembly= new TGeoVolumeAssembly("FrameAssembly");
98 
99  Double_t Height = 20.6;
100  Double_t Depth = 18.1;
101  Double_t Width = 24;
102  Double_t KermitWidth = 5;
103 
104  TGeoVolume *Pillar = new TGeoVolume ("Pillar", makeMaytec(Height,"Pillar"),Med_ext);
105  TGeoVolume *Pillar2 = new TGeoVolume ("Pillar2", makeMaytec(Height,"Pillar1"),Med_ext);
106  TGeoVolume *Pillar3 = new TGeoVolume ("Pillar3", makeMaytec(Height,"Pillar2"),Med_ext);
107  TGeoVolume *Pillar4 = new TGeoVolume ("Pillar4", makeMaytec(Height,"Pillar3"),Med_ext);
108  Pillar ->SetFillColor(kBlue);
109  Pillar ->SetFillColor(kBlue);
110  Pillar2 ->SetFillColor(kBlue);
111  Pillar2 ->SetFillColor(kBlue);
112  Pillar3 ->SetFillColor(kBlue);
113  Pillar3 ->SetFillColor(kBlue);
114  Pillar4 ->SetFillColor(kBlue);
115  Pillar4 ->SetFillColor(kBlue);
116  TGeoVolume *Beam1 = new TGeoVolume ("Beam1", makeMaytec(Width,"Beam1"),Med_ext);
117  TGeoVolume *Beam12 = new TGeoVolume ("Beam12", makeMaytec(Width,"Beam12"),Med_ext);
118  Beam1->SetFillColor(14);
119  Beam1 ->SetFillColor(14);
120  Beam12->SetFillColor(14);
121  Beam12 ->SetFillColor(14);
122  TGeoVolume *Beam2 = new TGeoVolume ("Beam2", makeMaytec(Depth,"Beam2"),Med_ext);
123  TGeoVolume *Beam22 = new TGeoVolume ("Beam22", makeMaytec(Depth,"Beam22"),Med_ext);
124  Beam2->SetFillColor(14);
125  Beam2 ->SetFillColor(14);
126  Beam22->SetFillColor(14);
127  Beam22 ->SetFillColor(14);
128  FrameAssembly ->AddNode(Pillar,1, new TGeoCombiTrans(Height/2,1.5,Width/2-1.5, new TGeoRotation("",90,90,0)));
129  FrameAssembly ->AddNode(Pillar2,2, new TGeoCombiTrans(Height/2,1.5,-(Width/2-1.5), new TGeoRotation("",90,90,0)));
130  FrameAssembly ->AddNode(Pillar3,3, new TGeoCombiTrans(Height/2,1.5+Depth+3,-(Width/2-1.5), new TGeoRotation("",90,90,0)));
131  FrameAssembly ->AddNode(Pillar4,4, new TGeoCombiTrans(Height/2,1.5+Depth+3,(Width/2-1.5), new TGeoRotation("",90,90,0)));
132  FrameAssembly ->AddNode(Beam1,1, new TGeoCombiTrans(Height+1.5,1.5,0, new TGeoRotation("",0,0,0)));
133  FrameAssembly ->AddNode(Beam12,2, new TGeoCombiTrans(Height+1.5,1.5+Depth+3,0, new TGeoRotation("",0,0,0)));
134  FrameAssembly ->AddNode(Beam2,1, new TGeoCombiTrans(Height+1.5,1.5+Depth/2+1.5,(KermitWidth/2+1.5), new TGeoRotation("",0,90,0)));
135  FrameAssembly ->AddNode(Beam22,2, new TGeoCombiTrans(Height+1.5,1.5+Depth/2+1.5,-(KermitWidth/2+1.5), new TGeoRotation("",0,90,0)));
136 
137 
138  cout << "frame built" << endl;
139  return FrameAssembly;
140 }
Double_t
TGeoShape * makeMaytec(Double_t length, TString Name)

Variable Documentation

double Pi = TMath::Pi()

Definition at line 5 of file hypGeGeoCOSYsetup2014Passives.C.