FairRoot/PandaRoot
Public Member Functions | Public Attributes | Private Attributes | List of all members
GeCluster Class Reference

#include <GeCluster.h>

Inheritance diagram for GeCluster:

Public Member Functions

 GeCluster ()
 
virtual ~GeCluster ()
 
void SetPathGeo (TString path)
 
TList * CreateCluster (TGeoPgon *logicCrystal_test, TGeoPgon *lay_sci, TGeoCompositeShape *lay_cap, TGeoVolume &sphere, double distance, double theta, double phi, double depth_first_interaction, int id_start)
 
 ClassDef (GeCluster, 2)
 

Public Attributes

Double_t X_Crystal [105]
 
Double_t Y_Crystal [105]
 
Double_t Z_Crystal [105]
 
int Id_Crystal [105]
 
int Id_Cluster [105]
 
int Id_Crystal_In_Cluster [105]
 

Private Attributes

int fnum_crystal
 
int fnum_cluster
 
TString fpath
 
TGeoVolume * crystal_centre [105]
 
TGeoVolume * crystal [105]
 
TGeoVolume * laySci [105]
 
TGeoVolume * laySci_peri [105]
 
TGeoVolume * Cap [105]
 
TGeoVolume * Cap_peri [105]
 
TList * SenVolList
 

Detailed Description

Definition at line 18 of file GeCluster.h.

Constructor & Destructor Documentation

GeCluster::GeCluster ( )

Definition at line 42 of file GeCluster.cxx.

42  {
43 
44  SenVolList = new TList();
45 
46 }
TList * SenVolList
Definition: GeCluster.h:90
GeCluster::~GeCluster ( )
virtual

Definition at line 47 of file GeCluster.cxx.

References SenVolList.

47  {
48  delete SenVolList;
49 }
TList * SenVolList
Definition: GeCluster.h:90

Member Function Documentation

GeCluster::ClassDef ( GeCluster  ,
 
)
TList * GeCluster::CreateCluster ( TGeoPgon *  logicCrystal_test,
TGeoPgon *  lay_sci,
TGeoCompositeShape *  lay_cap,
TGeoVolume &  sphere,
double  distance,
double  theta,
double  phi,
double  depth_first_interaction,
int  id_start 
)

Definition at line 52 of file GeCluster.cxx.

References a, b, Cap, Cap_peri, crystal, crystal_centre, Double_t, fnum_cluster, fnum_crystal, fpath, PndHypGeReader::GetData(), gGeoManager, laySci, laySci_peri, phi, Pi, DataG4::posX, DataG4::posY, DataG4::posZ, SenVolList, and TString.

Referenced by PndHypGe::ConstructHPGeGeometry().

79 {
80 
81  SenVolList->Clear();
82 
83  //G4SDManager* SDman = G4SDManager::GetSDMpointer();
84 
85  char cluster_name[10];
86  if(id_start==800) sprintf(cluster_name,"J");
87  if(id_start==700) sprintf(cluster_name,"G");
88  if(id_start==100) sprintf(cluster_name,"A");
89  if(id_start==200) sprintf(cluster_name,"B");
90  if(id_start==900) sprintf(cluster_name,"K");
91 
92  if(id_start==1100) sprintf(cluster_name,"M");
93  if(id_start==300) sprintf(cluster_name,"C");
94  if(id_start==500) sprintf(cluster_name,"E");
95  if(id_start==1500) sprintf(cluster_name,"R");
96  if(id_start==1300) sprintf(cluster_name,"P");
97 
98  if(id_start== 400) sprintf(cluster_name,"D");
99  if(id_start== 600) sprintf(cluster_name,"F");
100  if(id_start==1000) sprintf(cluster_name,"L");
101  if(id_start==1200) sprintf(cluster_name,"N");
102 
103  if(id_start==1400) sprintf(cluster_name,"Q");
104 
105  Double_t deg = TMath::Pi()/180.;
106  Double_t phi1;
107 
108  fnum_crystal = 0; // each cluster consists of several crystals
109  fnum_cluster = 0; // cluster number
110 
111  distance = distance + 2.5;
112 
113  phi1=phi*deg;
114 
115  if(phi1 >360.0*deg) phi1 = phi1 - 360.0*deg;
116  if(phi1>=0.0 && phi1 <=180.0*deg) phi1 = 180.0*deg - phi1;
117  if(phi1>180.0*deg && phi1 <360.0*deg) phi1 = 540.0*deg - phi1;
118  phi1 = phi1+90.0*deg;
119 
120  if(phi >360.0) phi = phi - 360.0;
121  if(phi>=0.0 && phi <=180.0) phi = 180.0 - phi;
122  if(phi>180.0 && phi <360.0) phi = 540.0 - phi;
123  phi = phi+90.0;
124 
125 
126  TString pclus,psci;
127  pclus = fpath;
128  psci = fpath;
129  pclus += "/hypGe/GeGlusterPos3Clus.dat";
130  psci += "/hypGe/GeClusterPosSci31.dat";
131 
132  PndHypGeReader *read;
133  read = new PndHypGeReader(pclus.Data());
134  PndHypGeReader *readsci;
135  readsci = new PndHypGeReader(psci.Data());
136 
137  TGeoRotation rot3D;
138  TRotation rho;
139  TRotation rho2;
140  TVector3 rotatedPos,PosOrb;
141 
142  //TGeoCombiTrans *c1;
143 
144  TGeoRotation rot3D2;
145  TVector3 rotatedPos2;
146  //TGeoCombiTrans *c2;
147  rot3D2.SetAngles(0, 0, 0);
148  rot3D2.RotateX(theta);
149  rot3D2.RotateZ(phi);
150 
151  rho2(0,0);
152  rho2.RotateX(theta*deg);
153  rho2.RotateZ(phi1);
154 
155  rot3D.SetAngles(0, 0, 0);
156  rot3D.RotateX(theta);
157  rot3D.RotateZ(phi);
158 
159  rho(0,0);
160  rho.RotateX(theta*deg);
161  rho.RotateZ(phi1);
162 
163 
164 
165 
166 
167 
168 
169  TGeoMedium *Ge = gGeoManager->GetMedium("germanium");
170  //scintillator plate
171  TGeoMedium *sci = gGeoManager->GetMedium("polypropylene");
172  //capsule
173  TGeoMedium *cap = gGeoManager->GetMedium("HYPaluminium");
174 
175  //Int_t geid = Ge->GetId();
176  //cout<<" media "<<geid<<endl;
177 
178  //TGeoMedium *Si= gGeoManager->GetMedium("air");
179  //TGeoMedium *Ge= gGeoManager->Medium("germanium",700,1,1,30.,10.0, 0.1, 0.1, 0.1, 0.1);
180  // Germanium
181  // a = 72.61*g/mole;
182  //density = 5.323*g/cm3;
183  //G4Material* Ge = new G4Material(name="Germanium" , z=32., a, density);
184  // Definition of materials
185 
186 
187  //cout<<"media "<<medPWO<<endl;
188 
189  char name_crystal[13];
190  sprintf (name_crystal,"GeCrystal%02d",id_start+6);
191 
192 
193  char name_lay[13];
194  char name_cap[13];
195  //scint.
196  sprintf (name_lay,"laySci%02d",id_start+6);
197  //capsula
198  sprintf (name_cap,"Cap%02d",id_start+6);
199 
200 
201  crystal_centre[fnum_crystal] = new TGeoVolume(name_crystal,
202  (const TGeoShape *)logicCrystal_test,
203  (const TGeoMedium *)Ge );
204 
205  laySci[fnum_crystal] = new TGeoVolume(name_lay,
206  (const TGeoShape *)lay_sci,
207  (const TGeoMedium *)sci );
208 
209  Cap[fnum_crystal] = new TGeoVolume(name_cap,(const TGeoShape *)lay_cap,
210  (const TGeoMedium *)cap );
211 
212  DataG4 data;
213  data = read->GetData(id_start+6);
214 
215  // sphere.AddNode(crystal_centre[fnum_crystal],id_start+6,
216  // new TGeoCombiTrans(rotatedPos.X(),
217  // rotatedPos.Y(),
218  // rotatedPos.Z(),
219  // new TGeoRotation (rot3D)));
220 
221  sphere.AddNode(crystal_centre[fnum_crystal],id_start+6,
222  new TGeoCombiTrans(data.posX/10.,
223  data.posY/10.,
224  data.posZ/10.,
225  new TGeoRotation (rot3D)));
226 
227  sphere.AddNode(Cap[fnum_crystal],id_start+6,
228  new TGeoCombiTrans(data.posX/10.,
229  data.posY/10.,
230  (data.posZ/10.),
231  new TGeoRotation (rot3D)));
232 
233  //scint
234  DataG4 data2;
235  data2 = readsci->GetData(id_start+6);
237 
238 
239  sphere.AddNode(laySci[fnum_crystal],id_start+6,
240  new TGeoCombiTrans(data2.posX/10.,
241  data2.posY/10.,
242  (data2.posZ/10.),
243  new TGeoRotation (rot3D)));
244 
245 
246 
247  //------------------------------------------------
248  // Sensitive detectors
249  //------------------------------------------------
250 
251  //AddSensitiveVolume(crystal_centre[fnum_crystal]);
252  SenVolList->AddLast(crystal_centre[fnum_crystal]);
253  SenVolList->AddLast(laySci[fnum_crystal]);
254  SenVolList->AddLast(Cap[fnum_crystal]);
255 
256 
257 
258 
259  // cout << id_start+6 << " " << rotatedPos.X() << " "
260 // << rotatedPos.Y() << " "
261 // << rotatedPos.Z() << std::endl;
262 
263 
264 
265 
266 
267 
268  //------------------------------------------------
269  // Crystals surrounding the central one.
270  //------------------------------------------------
271 
272  fnum_crystal = fnum_crystal + 1;
273 
274  //Float_t v1[6],v2[6],v3[6];
275 
276  TRotation a;
277  TVector3 b;
278  a.RotateZ(90.*deg);
279  b=TVector3(0,1.,0).Transform(a);
280 
281  char tempname[100];
282  char periname[13];
283  char cappname[13];
284  for(int iii=0;iii<=1;iii++)
285  {
286 
287 
288  rot3D.SetAngles(0., 0., 0.);
289  rot3D.RotateX(-6.66);
290  rot3D.RotateZ((-1*iii+1)*60.0);
291  rot3D.RotateX(theta);
292  rot3D.RotateZ(phi);
293 
294  //rho(0,0,0);
295  rho.RotateX(0.*deg);
296  rho.RotateY(0.*deg);
297  rho.RotateZ(0.*deg);
298 
299  rho.RotateX(-6.66*deg);
300  rho.RotateZ((-1*iii+1)*60.0*deg);
301  rho.RotateX(theta*deg);
302  rho.RotateZ(phi1);
303 
304  rotatedPos.SetXYZ(0.,0.,0.);
305  rotatedPos2.SetXYZ(0.,0.,0.);
306 
307 
308 
309 
310 
311  sprintf(tempname,"GeCrystal%04d",id_start+iii);
312  //TGeoVolume *crystal[fnum_crystal];
313 
314  //scint
315  sprintf (periname,"laySci%04d",id_start+iii);
316  //capsula
317  sprintf (cappname,"Cap%04d",id_start+iii);
318 
319  crystal[fnum_crystal] = new TGeoVolume(tempname,
320  (const TGeoShape *)logicCrystal_test,
321  (const TGeoMedium *)Ge);
322 
323  laySci_peri[fnum_crystal] = new TGeoVolume(periname,
324  (const TGeoShape *)lay_sci,
325  (const TGeoMedium *)sci);
326 
327  Cap_peri[fnum_crystal] = new TGeoVolume(cappname,
328  (const TGeoShape *)lay_cap,
329  (const TGeoMedium *)cap);
330 
331 
332  DataG4 data3;
333  data3 = read->GetData(id_start+iii);
334 
335  // sphere.AddNode(crystal[fnum_crystal],id_start+iii,
336  // new TGeoCombiTrans(PosOrb.X(),PosOrb.Y(),
337  // PosOrb.Z(), new TGeoRotation (rot3D)));
338 
339  sphere.AddNode(crystal[fnum_crystal],id_start+iii,
340  new TGeoCombiTrans(data3.posX/10.,data3.posY/10.,
341  data3.posZ/10., new TGeoRotation (rot3D)));
342 
343  //capsula
344  sphere.AddNode(Cap_peri[fnum_crystal],id_start+iii,
345  new TGeoCombiTrans(data3.posX/10.,
346  data3.posY/10.,
347  (data3.posZ/10.),
348  new TGeoRotation (rot3D)));
349 
350  DataG4 data4;
351  data4 = readsci->GetData(id_start+iii);
352 
353 
354 
355  sphere.AddNode(laySci_peri[fnum_crystal],id_start+iii,
356  new TGeoCombiTrans(data4.posX/10.,
357  data4.posY/10.,
358  (data4.posZ/10.),
359  new TGeoRotation (rot3D)));
360 
361 
362  //------------------------------------------------
363  // Sensitive detectors
364  //------------------------------------------------
365 
366  //AddSensitiveVolume(crystal[fnum_crystal]);
367 
368  SenVolList->AddLast(crystal[fnum_crystal]);
369  SenVolList->AddLast(laySci_peri[fnum_crystal]);
370  SenVolList->AddLast(Cap_peri[fnum_crystal]);
371 
372 
373 
374  cout << id_start+iii << " " << data.posX << " "
375  << data.posY << " "
376  << data.posZ << " "<<std::endl;
377 
378  fnum_crystal = fnum_crystal + 1;
379 
380  }
381 
383 
384  return SenVolList;
385 
386 }
int fnum_crystal
Definition: GeCluster.h:69
TGeoVolume * laySci_peri[105]
Definition: GeCluster.h:87
TTree * b
TList * SenVolList
Definition: GeCluster.h:90
TGeoVolume * laySci[105]
Definition: GeCluster.h:86
TGeoManager * gGeoManager
int fnum_cluster
Definition: GeCluster.h:70
TGeoVolume * crystal[105]
Definition: GeCluster.h:85
TGeoVolume * crystal_centre[105]
Definition: GeCluster.h:84
TString fpath
Definition: GeCluster.h:71
Int_t a
Definition: anaLmdDigi.C:126
Double_t
double posX
Definition: PndEmcReader.h:21
double posZ
Definition: PndEmcReader.h:21
double posY
Definition: PndEmcReader.h:21
DataG4 GetData(int crystal)
Double_t Pi
TGeoVolume * Cap[105]
Definition: GeCluster.h:88
TGeoVolume * Cap_peri[105]
Definition: GeCluster.h:89
void GeCluster::SetPathGeo ( TString  path)
inline

Definition at line 35 of file GeCluster.h.

References fpath.

Referenced by PndHypGe::ConstructHPGeGeometry().

35  {
36  fpath = path;
37  };
TString fpath
Definition: GeCluster.h:71

Member Data Documentation

TGeoVolume* GeCluster::Cap[105]
private

Definition at line 88 of file GeCluster.h.

Referenced by CreateCluster().

TGeoVolume* GeCluster::Cap_peri[105]
private

Definition at line 89 of file GeCluster.h.

Referenced by CreateCluster().

TGeoVolume* GeCluster::crystal[105]
private

Definition at line 85 of file GeCluster.h.

Referenced by CreateCluster().

TGeoVolume* GeCluster::crystal_centre[105]
private

Definition at line 84 of file GeCluster.h.

Referenced by CreateCluster().

int GeCluster::fnum_cluster
private

Definition at line 70 of file GeCluster.h.

Referenced by CreateCluster().

int GeCluster::fnum_crystal
private

Definition at line 69 of file GeCluster.h.

Referenced by CreateCluster().

TString GeCluster::fpath
private

Definition at line 71 of file GeCluster.h.

Referenced by CreateCluster(), and SetPathGeo().

int GeCluster::Id_Cluster[105]

Definition at line 32 of file GeCluster.h.

int GeCluster::Id_Crystal[105]

Definition at line 30 of file GeCluster.h.

int GeCluster::Id_Crystal_In_Cluster[105]

Definition at line 33 of file GeCluster.h.

TGeoVolume* GeCluster::laySci[105]
private

Definition at line 86 of file GeCluster.h.

Referenced by CreateCluster().

TGeoVolume* GeCluster::laySci_peri[105]
private

Definition at line 87 of file GeCluster.h.

Referenced by CreateCluster().

TList* GeCluster::SenVolList
private

Definition at line 90 of file GeCluster.h.

Referenced by CreateCluster(), and ~GeCluster().

Double_t GeCluster::X_Crystal[105]

Definition at line 26 of file GeCluster.h.

Double_t GeCluster::Y_Crystal[105]

Definition at line 27 of file GeCluster.h.

Double_t GeCluster::Z_Crystal[105]

Definition at line 28 of file GeCluster.h.


The documentation for this class was generated from the following files: