GEMC  2.2
Geant4 Monte-Carlo Framework
detector.h
Go to the documentation of this file.
1 
32 
44 
45 #ifndef detector_H
46 #define detector_H 1
47 
48 // G4 headers
49 #include "G4PVPlacement.hh"
50 #include "G4VSensitiveDetector.hh"
51 #include "G4VSolid.hh"
52 #include "G4VisManager.hh"
53 
54 // gemc headers
55 #include "identifier.h"
56 #include "run_conditions.h"
57 #include "string_utilities.h"
58 
59 
60 class detector
61 {
62 
63  public:
64  detector();
65  ~detector(){;}
66 
67  string name;
68  string mother;
69  string description;
70 
71  G4ThreeVector pos;
72  G4RotationMatrix rot;
73 
74  G4VisAttributes VAtts;
75 
76  string type;
77  vector<double> dimensions;
78 
79  string material;
80  string magfield;
81 
82  int ncopy;
83  bool pMany;
84 
85  int exist;
86  int visible;
87  int style;
88 
89  string sensitivity;
90  string hitType;
91  vector<identifier> identity;
92 
93  int scanned;
94 
95  string system;
96  string factory;
97  string variation;
98  int run;
99 
100  private:
101  G4VSolid* SolidV;
102  G4LogicalVolume* LogicV;
103  G4VPhysicalVolume* PhysicalV;
104 
105  public:
106  int create_solid(goptions, map<string, detector>*);
107  int create_logical_volume(map<string, G4Material*>*, goptions);
108  int create_physical_volumes(goptions, G4LogicalVolume*);
109  void setSensitivity(G4VSensitiveDetector *SD){LogicV->SetSensitiveDetector(SD);}
110 
111  G4VSolid *GetSolid() { return SolidV;}
112  G4LogicalVolume *GetLogical() { return LogicV;}
113  G4VPhysicalVolume *GetPhysical(){ return PhysicalV;}
114  void SetLogical(G4LogicalVolume *LV){LogicV = LV;}
115  void SetTranslation(G4ThreeVector TR){PhysicalV->SetTranslation(TR);}
116  void RemoveDaughter(G4VPhysicalVolume* PV){LogicV->RemoveDaughter(PV);}
117  void AssignMFM(G4FieldManager* MFM){LogicV->SetFieldManager(MFM, true);}
118 
119  void SetUserLimits(G4UserLimits* L) { LogicV->SetUserLimits(L);}
120 
121  friend ostream &operator<<(ostream &stream, detector);
122  bool operator== (const detector& D) const;
123 };
124 
125 
126 #endif
127 
friend ostream & operator<<(ostream &stream, detector)
Overloaded "<<" for detector class. Dumps infos on screen.
Definition: detector.cc:1071
G4LogicalVolume * GetLogical()
Returns Logical Volume pointer.
Definition: detector.h:112
int create_logical_volume(map< string, G4Material * > *, goptions)
Creates the Logical Volume.
Definition: detector.cc:725
string sensitivity
Defines the Sensitive Detector. possible choices: "no" "hits collection name".
Definition: detector.h:89
string mother
Mother Volume name.
Definition: detector.h:68
void AssignMFM(G4FieldManager *MFM)
Assigns Magnetic Field Manager to LogicV.
Definition: detector.h:117
int run
run number that generated the detector
Definition: detector.h:98
G4ThreeVector pos
Position relative to the mother volume, as G4ThreeVector.
Definition: detector.h:71
int create_physical_volumes(goptions, G4LogicalVolume *)
Creates the Physical Volume.
Definition: detector.cc:787
string system
detector system
Definition: detector.h:95
bool operator==(const detector &D) const
Overloaded "==" operator for detector class.
Definition: detector.cc:1109
G4VisAttributes VAtts
Visual Attributes: color, transparency, style (wireframe, solid), visibility.
Definition: detector.h:74
void SetTranslation(G4ThreeVector TR)
Sets Physical Volume Position.
Definition: detector.h:115
bool pMany
Needed by geant4 at G4PVPlacement time.
Definition: detector.h:83
int create_solid(goptions, map< string, detector > *)
Creates the Solid. If it&#39;s a Copy Placement, retrieve and assigns LogicV.
Definition: detector.cc:46
string factory
factory that generated the detector
Definition: detector.h:96
int ncopy
copy number
Definition: detector.h:82
string name
Name of the volume. Since this is the key of the STL map, it has to be unique.
Definition: detector.h:67
string material
Volume Material name.
Definition: detector.h:79
detector()
Definition: detector.cc:39
void SetUserLimits(G4UserLimits *L)
Definition: detector.h:119
int visible
visibility of the detector: 0=invisible 1=visible
Definition: detector.h:86
int style
Visual style: 0=wireframe 1=solid.
Definition: detector.h:87
string hitType
Hit Process routine name. A Hit Process HitProcess derived class must exists with this name...
Definition: detector.h:90
vector< identifier > identity
Vector of identifiers. Example: superlayer manual 1 type manual 2 segment manual 3 strip manual 4...
Definition: detector.h:91
string magfield
Magnetic Field. The string "no" means that the field is inherited from the mother volume...
Definition: detector.h:80
G4RotationMatrix rot
Rotation Matrix, defined by rotations along x,y,z axis relative to the mother volume.
Definition: detector.h:72
int exist
detector ON/OFF switch
Definition: detector.h:85
G4VSolid * GetSolid()
Returns G4 Solid pointer.
Definition: detector.h:111
~detector()
Definition: detector.h:65
G4VPhysicalVolume * GetPhysical()
Returns Physical Volume pointer.
Definition: detector.h:113
void SetLogical(G4LogicalVolume *LV)
Sets Logical Volume pointer.
Definition: detector.h:114
string type
solid type. This follows the GEANT4 definitions
Definition: detector.h:76
vector< double > dimensions
vector of dimensions. Size, units depends on solid type
Definition: detector.h:77
int scanned
for use during construction
Definition: detector.h:93
string variation
variation that generated the detector
Definition: detector.h:97
void RemoveDaughter(G4VPhysicalVolume *PV)
Remove Physical Volumes from LogicV.
Definition: detector.h:116
void setSensitivity(G4VSensitiveDetector *SD)
Assign the sensitive detector to the Logical Volume.
Definition: detector.h:109
string description
Volume Description for documentation.
Definition: detector.h:69