29 #ifndef HadrontherapyDetectorConstruction_H
30 #define HadrontherapyDetectorConstruction_H 1
65 void ConstructPhantom();
66 void ConstructDetector();
67 void ParametersCheck();
74 return phantomPosition + detectorPosition;
81 phantomSizeY/2 - detectorSizeY/2 + detectorPosition.
getY(),
82 phantomSizeZ/2 - detectorSizeZ/2 + detectorPosition.
getZ()
91 detectorPosition.
setX(detectorToPhantomPosition.
getX() - phantomSizeX/2 + detectorSizeX/2);
92 detectorPosition.
setY(detectorToPhantomPosition.
getY() - phantomSizeY/2 + detectorSizeY/2);
93 detectorPosition.
setZ(detectorToPhantomPosition.
getZ() - phantomSizeZ/2 + detectorSizeZ/2);
110 if (detectorX > phantomX)
112 G4cout <<
"Error: Detector X dimension must be smaller or equal to the corrispondent of the phantom" <<
G4endl;
115 if ( (phantomX - detectorX) < pos.
getX())
117 G4cout <<
"Error: X dimension doesn't fit with detector to phantom relative position" <<
G4endl;
123 if (detectorY > phantomY)
125 G4cout <<
"Error: Detector Y dimension must be smaller or equal to the corrispondent of the phantom" <<
G4endl;
128 if ( (phantomY - detectorY) < pos.
getY())
130 G4cout <<
"Error: Y dimension doesn't fit with detector to phantom relative position" <<
G4endl;
136 if (detectorZ > phantomZ)
138 G4cout <<
"Error: Detector Z dimension must be smaller or equal to the corrispondent of the phantom" <<
G4endl;
141 if ( (phantomZ - detectorZ) < pos.
getZ())
143 G4cout <<
"Error: Z dimension doesn't fit with detector to phantom relative position" <<
G4endl;
173 G4Box *phantom , *detector;
185 G4ThreeVector phantomPosition, detectorPosition, detectorToPhantomPosition;
191 G4int numberOfVoxelsAlongX;
192 G4int numberOfVoxelsAlongY;
193 G4int numberOfVoxelsAlongZ;
195 G4double volumeOfVoxel, massOfVoxel;
197 G4Material *phantomMaterial, *detectorMaterial;
void SetPhantomSize(G4double sizeX, G4double sizeY, G4double sizeZ)
G4VPhysicalVolume * motherPhys
CLHEP::Hep3Vector G4ThreeVector
HadrontherapyDetectorConstruction(G4VPhysicalVolume *)
static HadrontherapyDetectorConstruction * GetInstance()
G4LogicalVolume * GetDetectorLogicalVolume()
void SetDetectorSize(G4double sizeX, G4double sizeY, G4double sizeZ)
G4GLOB_DLL std::ostream G4cout
void SetPhantomPosition(G4ThreeVector)
void SetDetectorToPhantomPosition(G4ThreeVector DetectorToPhantomPosition)
HadrontherapyDetectorSD * detectorSD
bool IsInside(G4double detectorX, G4double detectorY, G4double detectorZ, G4double phantomX, G4double phantomY, G4double phantomZ, G4ThreeVector pos)
G4bool SetPhantomMaterial(G4String material)
void SetDetectorPosition()
G4ThreeVector GetDetectorToPhantomPosition()
void InitializeDetectorROGeometry(HadrontherapyDetectorROGeometry *, G4ThreeVector detectorToWorldPosition)
void SetVoxelSize(G4double sizeX, G4double sizeY, G4double sizeZ)
G4ThreeVector GetDetectorToWorldPosition()
~HadrontherapyDetectorConstruction()
static const G4double pos