| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 | #ifndef detector_H
|
|---|
| 7 | #define detector_H 1
|
|---|
| 8 |
|
|---|
| 9 | // %%%%%%%%%%
|
|---|
| 10 | // G4 headers
|
|---|
| 11 | // %%%%%%%%%%
|
|---|
| 12 | #include "G4Colour.hh"
|
|---|
| 13 | #include "G4FieldManager.hh"
|
|---|
| 14 | #include "G4LogicalVolume.hh"
|
|---|
| 15 | #include "G4Material.hh"
|
|---|
| 16 | #include "G4PVPlacement.hh"
|
|---|
| 17 | #include "G4ThreeVector.hh"
|
|---|
| 18 | #include "G4VisAttributes.hh"
|
|---|
| 19 | #include "G4VSensitiveDetector.hh"
|
|---|
| 20 | #include "G4VSolid.hh"
|
|---|
| 21 |
|
|---|
| 22 | // %%%%%%%%%%%%%
|
|---|
| 23 | // gemc headers
|
|---|
| 24 | // %%%%%%%%%%%%%
|
|---|
| 25 | #include "usage.h"
|
|---|
| 26 | #include "identifier.h"
|
|---|
| 27 | #include "run_conditions.h"
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 | class detector
|
|---|
| 31 | {
|
|---|
| 32 |
|
|---|
| 33 | public:
|
|---|
| 34 | detector();
|
|---|
| 35 | ~detector(){};
|
|---|
| 36 |
|
|---|
| 37 | string name;
|
|---|
| 38 | string mother;
|
|---|
| 39 | string description;
|
|---|
| 40 |
|
|---|
| 41 | G4ThreeVector pos;
|
|---|
| 42 | G4RotationMatrix rot;
|
|---|
| 43 |
|
|---|
| 44 | G4VisAttributes VAtts;
|
|---|
| 45 |
|
|---|
| 46 | string type;
|
|---|
| 47 | vector<double> dimensions;
|
|---|
| 48 |
|
|---|
| 49 | string material;
|
|---|
| 50 | string magfield;
|
|---|
| 51 |
|
|---|
| 52 | int ncopy;
|
|---|
| 53 | bool pMany;
|
|---|
| 54 |
|
|---|
| 55 | int exist;
|
|---|
| 56 | int visible;
|
|---|
| 57 | int style;
|
|---|
| 58 |
|
|---|
| 59 | string sensitivity;
|
|---|
| 60 | string hitType;
|
|---|
| 61 | vector<identifier> identity;
|
|---|
| 62 |
|
|---|
| 63 | int scanned;
|
|---|
| 64 |
|
|---|
| 65 | private:
|
|---|
| 66 | G4VSolid* SolidV;
|
|---|
| 67 | G4LogicalVolume* LogicV;
|
|---|
| 68 | G4VPhysicalVolume* PhysicalV;
|
|---|
| 69 |
|
|---|
| 70 | public:
|
|---|
| 71 | int create_solid(gemc_opts, map<string, detector>*);
|
|---|
| 72 | int create_logical_volume(map<string, G4Material*>*, gemc_opts);
|
|---|
| 73 | int create_physical_volumes(gemc_opts, G4LogicalVolume*);
|
|---|
| 74 | void setSensitivity(G4VSensitiveDetector *SD){LogicV->SetSensitiveDetector(SD);}
|
|---|
| 75 |
|
|---|
| 76 | G4VSolid *GetSolid() { return SolidV;}
|
|---|
| 77 | G4LogicalVolume *GetLogical() { return LogicV;}
|
|---|
| 78 | G4VPhysicalVolume *GetPhysical(){ return PhysicalV;}
|
|---|
| 79 | void SetLogical(G4LogicalVolume *LV){LogicV = LV;}
|
|---|
| 80 | void SetTranslation(G4ThreeVector TR){PhysicalV->SetTranslation(TR);}
|
|---|
| 81 | void RemoveDaughter(G4VPhysicalVolume* PV){LogicV->RemoveDaughter(PV);}
|
|---|
| 82 | void AssignMFM(G4FieldManager* MFM){LogicV->SetFieldManager(MFM, true);}
|
|---|
| 83 |
|
|---|
| 84 | void SetUserLimits(G4UserLimits* L) { LogicV->SetUserLimits(L);}
|
|---|
| 85 |
|
|---|
| 86 | friend ostream &operator<<(ostream &stream, detector);
|
|---|
| 87 | bool operator== (const detector& D) const;
|
|---|
| 88 | };
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 | // All these functions defined here but maybe should be moved somewhere else for consistency.
|
|---|
| 92 | vector< vector<string> > dimensionstype(string);
|
|---|
| 93 | double get_number(string);
|
|---|
| 94 | string TrimSpaces(string in);
|
|---|
| 95 | map<string, detector> read_detector(gemc_opts, run_conditions);
|
|---|
| 96 | map<string, G4Material*> DefineMaterials();
|
|---|
| 97 | vector<int> set_IDshifts(vector<int>);
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 | #endif
|
|---|
| 101 |
|
|---|