/[PAMELA software]/PamVMC/include/PamVMCDetGeom.h
ViewVC logotype

Contents of /PamVMC/include/PamVMCDetGeom.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Jun 12 18:39:16 2009 UTC (15 years, 5 months ago) by pam-rm2
Branch: MAIN
CVS Tags: v1r0, HEAD
Changes since 1.1: +1 -1 lines
File MIME type: text/plain
Error occurred while calculating annotation data.
- Introduced user-defined names of output files and random seeds number.
Users can do it use options of PamVMCApplication constructor:
PamVMCApplication(const char* name,  const char *title, const char*
filename="pamtest", Int_t seed=0).
The Random object that I use is TRandom3 object which has astronomical
large period (in case of default initialization 0). All random generators
in the code use this object by calling of gRandom singleton which keeps
it.

- Corrected TOF digitization routine. No problems with TDC hits due to
hadronic interactions anymore.

- Some small changes was done to compile code under Root 5.23. +
geant4_vmc v. 2.6 without any warnings

- Some classes of PamG4RunConfiguartion was changed for geant4_vmc v.
2.6.Some obsolete classes was deleted as soon as developers implemented
regions.

- Navigation was changed from "geomRootToGeant4" to "geomRoot", because on
VMC web page written that as soon as Geant4 has no option ONLY/MANY
translation of overlapped geometry to Geant4 through VGM could be wrong.
I'd like to stay with Root navigation:
http://root.cern.ch/root/vmc/Geant4VMC.html. This should be default
option.

- New Tracker digitization routine written by Sergio was implemented

- PamVMC again became compatible with geant4_vmc v.2.5 and ROOT 5.20.
 The problem was that ROOT developers introduced in TVirtualMC class a new
method SetMagField and new base class:TVirtualMagField from which
user-defined classes shoukd be derived

1 #ifndef PAMVMC_DET_GEOM_H
2 #define PAMVMC_DET_GEOM_H
3 #include <iostream>
4
5 #include <TMap.h>
6 #include <TObject.h>
7 #include <TString.h>
8 #include <TObjString.h>
9 #include <TList.h>
10
11 #include <Riostream.h>
12 #include <TVirtualMC.h>
13 #include <TGeoManager.h>
14 #include <TGeoMatrix.h>
15
16 #include "PamVMCMat.h"
17
18 struct pMotherProp : public TObject{
19
20 TGeoVolume *fmother;
21 Int_t fcopyNo;
22 TGeoMatrix *fmothermatrix;
23
24
25 pMotherProp():fmother(0),fcopyNo(-1),fmothermatrix(0){};
26 pMotherProp(TGeoVolume *mother, Int_t copyNo, TGeoMatrix *mothermatrix):
27 fmother(mother),fcopyNo(copyNo),fmothermatrix(mothermatrix){};
28
29 };
30
31
32 class PamVMCDetGeom : public TObject {
33
34 protected:
35
36 enum kind {MAT,MED,VOL};
37 TString fdname;
38 TMap fdrot; //Map of geometry transformations
39 TObjArray fmotherprop; // Vector of mother volume to be passed as node of other mother volumes
40 TMap fmat; //Map of Material
41 TMap fmix; // Mixtures
42 TMap fmed; // Mediums
43 TMap fvol; // Volumes
44 TGeoVolume *fmother; // Mother volume of the detector in case of any
45
46 public:
47
48
49 PamVMCDetGeom(const char *dname="NoDetGeom" ):
50 fdname(dname), fmother(0)
51 {
52
53 };
54
55
56 virtual ~PamVMCDetGeom() {
57 fdrot.DeleteAll();
58 fmotherprop.Clear();
59 fmat.DeleteAll();
60 fmix.DeleteAll();
61 fmed.DeleteAll();
62 //delete fmother;
63 }
64
65
66 // virtual void ConstructGeometry()=0;
67
68
69 TGeoRotation* GetRot(const char* rot){
70 return (TGeoRotation*)fdrot(rot);
71 }
72
73
74 Int_t GetMedID(const char *name){ return GetMed(name)->GetId(); }
75
76 TGeoMaterial* GetMat(const char *name){ return (TGeoMaterial*)CheckDef(name,MAT); }
77
78 TGeoMedium* GetMed(const char *name){ return (TGeoMedium*)CheckDef(name,MED); }
79
80 TGeoVolume* GetVol(const char *name){ return (TGeoVolume*)CheckDef(name,VOL); }
81
82 TObject* CheckDef(const char *name, kind k){
83 switch(k){
84 case MAT:
85 return gGeoManager->GetMaterial(name);
86 case MED:
87 return gGeoManager->GetMedium(name);
88 case VOL:
89 return gGeoManager->GetVolume(name);
90 default:
91 return 0;
92 }
93 }
94
95
96 void AddMotherProp(pMotherProp *mp) {SetMotherProp(mp);}
97
98 void AddMotherProp(TObjArray *mp) {fmotherprop.AddAll(mp); }
99
100 void SetMotherProp(pMotherProp *mp) {
101 SetMotherProp(mp->fmother,mp->fcopyNo,mp->fmothermatrix);
102 }
103
104 void SetMotherProp(TGeoVolume *mv, Int_t cn, TGeoMatrix* mx){
105
106 fmotherprop.Add(new pMotherProp(mv,cn,mx) );
107 }
108
109 void SetMotherVol(TGeoVolume *mv) { fmother=mv; }
110
111 TObjArray* GetMotherProp(){ return &fmotherprop;}
112
113 void RegisterNodes() { RegisterNodes(&fmotherprop); }
114
115 void RegisterNodes( TObjArray * to ) {
116 // Some exception or error printout
117 // should be added to signal that fmother is empty
118 if(fmother) {
119 TIterator *p= (TIterator *)(*to).MakeIterator();
120 pMotherProp *k;
121 while( (k=(pMotherProp *) p->Next())) {
122 fmother->AddNode((*k).fmother,(*k).fcopyNo,(*k).fmothermatrix);
123 }
124 }
125 }
126
127 ClassDef(PamVMCDetGeom,1)
128 };
129
130
131 #endif //PAMVMC_DET_GEOM_H

  ViewVC Help
Powered by ViewVC 1.1.23