FairRoot/PandaRoot
PndGeoHypGeSingleCluster.cxx
Go to the documentation of this file.
1 // ******** Implementation of class to build HypGe Double Cluster Geometry *************
2 // by steinen@kph.uni-mainz.de
4 #include "PndGeoHypGeCrystal.h"
5 #include <iostream>
6 
7 
9 
10 using namespace std;
11 //double Pi = TMath::Pi();
12 // ----- Default constructor -------------------------------------------
14 {
15  // Constructor
16 }
17 // ----- constructor to use -------------------------------------------
18 PndGeoHypGeSingleCluster::PndGeoHypGeSingleCluster(TGeoMedium *ExtGe, TGeoMedium *ExtAl,TGeoMedium *ExtCu ,Int_t ExtClusterNumber)
19 {
20  MakeTop = true;
21 
22  Ge = ExtGe;
23  Al = ExtAl;
24  Cu = ExtCu;
25  ClusterNumber= ExtClusterNumber;
26  StartClusterNumber = ExtClusterNumber;
32  char* InputTitleBuffer;
35 
36 
37  CryostatFrontThickness= 0.1; //ZValuesInputArray[1]-ZValuesInputArray[0];
38  CryostatSideHeight = 12;
41  ColdFinger1Height = 10;
42  ColdFinger1Height = 10;
43 }
44 
45 
46 
47 // ------- destructor --------------
49 {
50  cout << "Destrucor called" << endl;
51 };
52 
53 // --------------- build the crystals ---------------------------
54 
55 void PndGeoHypGeSingleCluster::BuildCrystals(Int_t *CrystalNumber)
56 {
57  //create 2 crystals. The copy number of a crystal is composed of the number of the cluster and a running number for every placed crystal like e.g.: cluster 4, crystal 7: 407 ; cluster 11, crystal 21: 1121
58  Crystal1Number = *CrystalNumber;
59  *CrystalNumber+=1;
60  cout << "Cluster:" << ClusterNumber << "\tCrystal1Number: "<< Crystal1Number<<endl;
61 
63 
64 
65 
66  //set positions of the 2 crystals
67 
68 
69  SingleCrystalZOffset = 0.3; //measured in CAD
70 
71  Crystal1Rotation = new TGeoRotation("Crystal1Rotation", 0,0,0); //angles measured in CAD drawing
72  Crystal1Rotation ->RegisterYourself();
73 
74 
75  //maybe some signs needs adaption
76  Crystal1Position = new TGeoCombiTrans(0,0,-SingleCrystalZOffset,Crystal1Rotation);
77  Crystal1Position->RegisterYourself();
78 
79 
80 
82 };
83 
84 // --------------- build the cryostat --------------------------
86 {
87  // the cryostat is a combination front, side and top parts. The single crystal detector is easy and consists of only 2 +x parts
88 
89  string CompositeShapeExpression;
90 
91 
92  //cout << CompositeShapeExpression << endl;
93 
94 
95  CryostatFront = new TGeoTube("CryostatFront",0,6,CryostatFrontThickness/2);
96  CryostatSide = new TGeoTube ("CryostatSide", 6,6.2,CryostatSideHeight/2);
97  CryostatBack1 = new TGeoTube ("CryostatBack1", 4.2,6,CryostatBack1Height/2);
98  CryostatBack2 = new TGeoTube ("CryostatBack2", 4,4.2,CryostatBack2Height/2);
99 
100 
101  CryostatFrontTranslation = new TGeoTranslation("CryostatFrontTranslation",0,0,CryostatFrontThickness/2);
102  CryostatFrontTranslation->RegisterYourself();
103  CryostatSideTranslation = new TGeoTranslation("CryostatSideTranslation",0,0,CryostatSideHeight/2);
104  CryostatSideTranslation->RegisterYourself();
105 
106  CryostatBack1Translation = new TGeoTranslation("CryostatBack1Translation",0,0,CryostatSideHeight+CryostatBack1Height/2);
107  CryostatBack1Translation->RegisterYourself();
108  CryostatBack2Translation = new TGeoTranslation("CryostatBack2Translation",0,0,CryostatSideHeight+CryostatBack2Height/2);
109  CryostatBack2Translation->RegisterYourself();
110 
111 
112 
113  CompositeShapeExpression = "CryostatFront : CryostatFrontTranslation + CryostatSide : CryostatSideTranslation + CryostatBack1 : CryostatBack1Translation + CryostatBack2 : CryostatBack2Translation";
114 
115  //cout << CompositeShapeExpression << endl;
116  //combine the cryostat
117  CryostatShape = new TGeoCompositeShape("CryostatShape",CompositeShapeExpression.data() );
118  Cryostat = new TGeoVolume("Cryostat",CryostatShape,Al);
119  Cryostat->SetLineColor(kGreen);
120  Cryostat->SetFillColor(kGreen);
121 
122  // add the coldfinger
123  ColdFinger1 = new TGeoTube ("ColdFinger1", 0,1.5,ColdFinger1Height/2);
124  ColdFinger2 = new TGeoTube ("ColdFinger2", 0,1.5,ColdFinger2Height/2);
125 
126  ColdFinger1Translation= new TGeoTranslation("ColdFinger1Translation",0,0,-SingleCrystalZOffset+10+ColdFinger1Height/2);
127  ColdFinger1Translation->RegisterYourself();
128  ColdFinger2Translation= new TGeoTranslation("ColdFinger2Translation",0,0,-SingleCrystalZOffset+10+ColdFinger1Height+ColdFinger2Height/2);
129  ColdFinger2Translation->RegisterYourself();
130 
131  string ColdFingerShapeExpression = "ColdFinger1 : ColdFinger1Translation + ColdFinger2 : ColdFinger2Translation"; // problem here? no trans if only one part?
132  ColdFingerShape = new TGeoCompositeShape("ColdFingerShape",ColdFingerShapeExpression.data() );
133  ColdFinger = new TGeoVolume("ColdFinger", ColdFingerShape,Cu);
134  //bring the Cryostat in the right position
135  CryostatCombiTrans = new TGeoCombiTrans("CryostatCombiTrans",0,0,0,new TGeoRotation("CryostatRotation",0,180,0));
136  CryostatCombiTrans->RegisterYourself();
137 
139  ClusterAssembly->AddNode(ColdFinger,ClusterNumber,CryostatCombiTrans);
140 
141 };
142 
143 // --------------- Prints the nodes of a cluster -----------------
145 {
146  if (nLevels == 0)
147  {
148  cout << "Nothing to Print, use higher number to go deeper in the tree." << endl;
149  }
150  if (nLevels > 0)
151  {
152  cout << "Printing the content of the cluster assembly." << endl;
153  cout <<endl << "Number of Nodes in cluster assembly: " << ClusterAssembly->GetNdaughters() << endl;
154  ClusterAssembly->PrintNodes();
155  }
156  if (nLevels > 1)
157  {
158  cout << "Printing the content of the crystal assemblies." << endl;
159  cout <<endl << "Number of Nodes in crystal assembly 1: " << Crystal1->GetNdaughters() << endl;
160  Crystal1->PrintNodes();
161  cout <<endl << "Number of Nodes in crystal assembly 2: " << Crystal2->GetNdaughters() << endl;
162  Crystal2->PrintNodes();
163  }
164 }
TGeoTranslation * ColdFinger2Translation
TGeoCombiTrans * CryostatCombiTrans
PndGeoHypGeCrystal * Crystal2
TGeoVolume * ClusterAssembly
PndGeoHypGeCrystal * Crystal1
void BuildCrystals(Int_t *CrystalNumber)
void PlaceCrystal(TGeoVolume *top, TGeoMatrix *CrystalPlaceAndDirectionTranslation)
TGeoTranslation * CryostatBack1Translation
TGeoCompositeShape * CryostatShape
TGeoTranslation * CryostatBack2Translation
Double_t
Double_t * ZValuesInputArray
TGeoCombiTrans * Crystal1Position
TGeoRotation * Crystal1Rotation
TGeoTranslation * CryostatSideTranslation
Double_t * CoordinatesInputArray
TGeoTranslation * ColdFinger1Translation
ClassImp(PndAnaContFact)
TGeoCompositeShape * ColdFingerShape
TGeoTranslation * CryostatFrontTranslation