Commit a32d44a1 authored by Chad Lantz's avatar Chad Lantz
Browse files

Started getting DetectorConstruction ready for use with DetectorMessenger

parent f01ff3df
......@@ -31,15 +31,19 @@
#ifndef DetectorConstruction_h
#define DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "globals.hh"
#include "ModTypeZDC.hh"
#include "ModTypeRPD.hh"
#include "XMLSettingsReader.hh"
#include "Materials.hh"
#include "G4VUserDetectorConstruction.hh"
#include "G4ThreeVector.hh"
#include "globals.hh"
#include "G4Cache.hh"
#include "G4MagneticField.hh"
#include "XMLSettingsReader.hh"
#include <vector>
#include "Materials.hh"
class G4Box;
class G4Para;
......@@ -56,7 +60,7 @@ class Survey {
public :
/** Type of detector - ZDC or RPD **/
std::string detector;
G4String detector;
/** x_pos for this survey */
double x_pos;
/** y_pos for this survey */
......@@ -104,25 +108,47 @@ public:
virtual ~DetectorConstruction();
virtual G4VPhysicalVolume* Construct();
virtual void DefineBorderProperties();
virtual G4VPhysicalVolume* ConstructDetector();
virtual G4VPhysicalVolume* ConstructTestBeam();
virtual G4VPhysicalVolume* LoadConfigurationFile();
virtual Survey* GetSurvey();
virtual Alignment* LoadAlignmentFile();
inline G4int GetnZDCs(){return ZDCvec.size();}
inline G4int GetnRPDs(){return RPDvec.size();}
inline G4bool SetClusterFlag(G4bool arg){CLUSTER = arg;}
virtual G4VPhysicalVolume* ConstructSPSTestBeam();
virtual G4VPhysicalVolume* ManualConstruction();
virtual void LoadConfigurationFile( G4String _inFile = "" );
virtual void LoadAlignmentFile( G4String _inFile = "" );
virtual Survey* GetSurvey( G4String name );
virtual void AddZDC( G4ThreeVector* position = NULL );
virtual void AddRPD( G4ThreeVector* position = NULL );
virtual void DuplicateZDC(G4int module);
virtual void DuplicateRPD(G4int module);
inline G4int GetnZDCs(){return m_ZDCvec.size();}
inline G4int GetnRPDs(){return m_RPDvec.size();}
inline G4bool GetClusterFlag(){return CLUSTER;}
inline void SetClusterFlag( G4bool arg ){CLUSTER = arg;}
inline G4bool GetOpticalFlag(){return OPTICAL;}
inline void SetOpticalFlag( G4bool arg ){OPTICAL = arg;}
inline void ForcePosition ( G4bool arg ){ForceDetectorPosition = arg;}
inline void SetCurrentZDC ( G4int arg ){currentZDC = arg;}
inline void SetCurrentRPD ( G4int arg ){currentZDC = arg;}
//For manual positioning ZDCs
inline void SetZDCPosition ( G4ThreeVector* vec ){ m_ZDCvec.at(currentZDC)->SetPosition(vec); }
inline void SetZDCFiberDimensions ( G4ThreeVector* vec ){ m_ZDCvec.at(currentZDC)->SetFiberDiameters(vec); }
inline void SetZDCAbsorberDimensions( G4ThreeVector* vec ){ m_ZDCvec.at(currentZDC)->SetAbsorberDimensions(vec);}
inline void SetZDCnAbsorbers ( G4int arg ){ m_ZDCvec.at(currentZDC)->SetnAbsorbers(arg); }
inline void SetZDCHousingThickness ( G4double arg ){ m_ZDCvec.at(currentZDC)->SetHousingThickness(arg); }
inline void SetZDCGapThickness ( G4double arg ){ m_ZDCvec.at(currentZDC)->SetGapThickness(arg); }
//For manual positioning RPDs
inline void SetRPDPosition ( G4ThreeVector* vec ){ m_RPDvec.at(currentRPD)->SetPosition(vec); }
inline void SetRPDFiberDimensions ( G4ThreeVector* vec ){ m_RPDvec.at(currentRPD)->SetFiberDiameters(vec); }
inline void SetRPDHousingThickness ( G4double arg ){ m_RPDvec.at(currentRPD)->SetHousingThickness(arg);}
inline void SetRPDFiberPitch ( G4double arg ){ m_RPDvec.at(currentRPD)->SetFiberPitch(arg); }
inline void SetRPDTileSize ( G4double arg ){ m_RPDvec.at(currentRPD)->SetTileSize(arg); }
protected:
Materials* materials;
Materials* m_materials;
protected:
/* World objects */
G4Box* m_solidWorld;
G4LogicalVolume* m_logicWorld;
......@@ -136,20 +162,24 @@ protected:
XMLSettingsReader* m_XMLparser;
Alignment* m_alignment;
Survey* m_survey;
std::vector < Survey* > surveyEntries;
G4int m_runNumber;
std::vector < Survey* > m_surveyEntries;
/* Number of each detector */
std::vector< ModTypeZDC* > ZDCvec;
std::vector< ModTypeRPD* > RPDvec;
/* Cluster Flag for forwarding to RunAction */
G4bool CLUSTER;
std::vector< ModTypeZDC* > m_ZDCvec;
std::vector< ModTypeRPD* > m_RPDvec;
G4int currentZDC;
G4int currentRPD;
private:
G4Cache<G4MagneticField*> fField; //pointer to the thread-local fields
/* Run condition flags */
G4bool CLUSTER;
G4bool OPTICAL;
G4bool ForceDetectorPosition;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......
......@@ -64,28 +64,32 @@ class DetectorMessenger: public G4UImessenger{
G4UIdirectory* fZDCDir;
G4UIcmdWithABool* fClusterCmd;
G4UIcmdWithAString* fConfigFileCmd;
G4UIcmdWithABool* fForcePositionCmd;
G4UIcmdWith3VectorAndUnit* fSetWorldDimensionsCmd;
//ZDC Commands
G4UIcmdWithoutParameter* fZDCAddCmd;
G4UIcmdWithAnInteger* fZDCSetCurrentCmd;
G4UIcmdWithABool* fZDCForcePositionCmd;
G4UIcmdWith3VectorAndUnit* fZDCPositionCmd;
G4UIcmdWithADouble* fZDCHousingThicknessCmd;
G4UIcmdWithAnInteger* fZDCnAbsorbersCmd;
G4UIcmdWith3VectorAndUnit* fZDCAbsorberDimensionsCmd;
G4UIcmdWithADouble* fZDCFiberCoreDiameterCmd;
G4UIcmdWithABool* fZDCUseOpticalMaterialsCmd;
G4UIcmdWith3VectorAndUnit* fZDCFiberDiametersCmd;
G4UIcmdWithAnInteger* fZDCSetCurrentCmd;
G4UIcmdWithAnInteger* fZDCnAbsorbersCmd;
G4UIcmdWithAnInteger* fZDCDuplicateCmd;
G4UIcmdWithADouble* fZDCHousingThicknessCmd;
G4UIcmdWithADouble* fZDCGapThicknessCmd;
//RPD commands
G4UIcmdWithoutParameter* fRPDAddCmd;
G4UIcmdWithAnInteger* fRPDSetCurrentCmd;
G4UIcmdWith3VectorAndUnit* fRPDFiberDiameterssCmd;
G4UIcmdWith3VectorAndUnit* fRPDPositionCmd;
G4UIcmdWithADouble* fRPDHousingThicknessCmd;
G4UIcmdWithADouble* fRPDSetFiberPitchCmd;
G4UIcmdWithADouble* fRPDSetTileSizeCmd;
G4UIcmdWith3VectorAndUnit* fRPDHousingThicknessCmd;
G4UIcmdWith3VectorAndUnit* fRPDFiberDimensionsCmd; //Core, Cladding, Buffer
G4UIcmdWithABool* fRPDUseOpticalMaterialsCmd;
G4UIcmdWithAnInteger* fRPDDuplicateCmd;
G4UIcmdWithAnInteger* fRPDSetCurrentCmd;
};
......
......@@ -47,10 +47,9 @@ class G4Material;
class ModTypeRPD
{
public:
ModTypeRPD(const int,
const G4ThreeVector&,
G4LogicalVolume*);
ModTypeRPD();
ModTypeRPD(const int, ModTypeRPD*);
ModTypeRPD(const int, const G4ThreeVector*, G4LogicalVolume*);
~ModTypeRPD();
......@@ -62,29 +61,36 @@ public:
virtual void ConstructDetector();
inline void SetPosition ( G4ThreeVector* vec ){ m_pos = vec; }
inline void SetFiberDiameters ( G4ThreeVector* vec ){ m_fiberDiam = vec; }
inline void SetHousingThickness ( G4double arg ){ m_HousingThickness = arg; }
inline void SetFiberPitch ( G4double arg ){ m_fiberPitch = arg; }
inline void SetTileSize ( G4double arg ){ m_tileSize = arg; }
inline G4ThreeVector* GetPosition ( ){ return m_pos; }
inline G4int GetModNum ( ){ return m_modNum; }
protected:
const int m_modNum;
const G4ThreeVector m_pos;
G4LogicalVolume* m_logicMother;
const G4int m_modNum;
G4ThreeVector* m_pos;
G4ThreeVector* m_fiberDiam;
G4double m_HousingThickness;
G4double m_fiberPitch;
G4double m_tileSize;
G4LogicalVolume* m_logicMother;
Materials* materials;
protected:
G4Material* m_matQuartz;
G4Material* m_Al;
G4Material* m_Poly;
G4Material* m_Air;
G4Material* m_PMMA;
G4Material* m_Grease;
G4OpticalSurface* m_photonDetSurface;
bool m_simCherenkov;
G4OpticalSurface* m_photonDetSurface;
G4SubtractionSolid* m_tile;
......
......@@ -31,6 +31,7 @@
#include "globals.hh"
#include "G4PVPlacement.hh"
#include "Materials.hh"
#include <vector>
......@@ -44,10 +45,10 @@ class G4Material;
class ModTypeZDC
{
public:
ModTypeZDC(const int,
const G4ThreeVector&,
G4LogicalVolume*);
ModTypeZDC();
ModTypeZDC(const int, ModTypeZDC*);
ModTypeZDC(const int, G4LogicalVolume*);
ModTypeZDC(const int, const G4ThreeVector*, G4LogicalVolume*);
~ModTypeZDC();
virtual void Construct();
......@@ -57,16 +58,30 @@ public:
virtual void ConstructDetector();
inline void SetPosition ( G4ThreeVector* vec ){ m_pos = vec; }
inline void SetFiberDiameters ( G4ThreeVector* vec ){ m_fiberDiam = vec; }
inline void SetAbsorberDimensions( G4ThreeVector* vec ){ m_absDim = vec; }
inline void SetnAbsorbers ( G4int arg ){ m_nAbsorbers = arg; }
inline void SetHousingThickness ( G4double arg ){ m_HousingThickness = arg; }
inline void SetGapThickness ( G4double arg ){ m_GapThickness = arg; }
virtual void SetHousingMaterial ( G4String material );
virtual void SetAbsorberMaterial ( G4String material );
inline G4ThreeVector* GetPosition ( ){ return m_pos; }
inline G4int GetModNum ( ){ return m_modNum; }
protected:
const int m_modNum;
const G4ThreeVector m_pos;
G4LogicalVolume* m_logicMother;
const G4int m_modNum;
G4int m_nAbsorbers;
G4ThreeVector* m_pos;
G4ThreeVector* m_fiberDiam;
G4ThreeVector* m_absDim;
G4double m_HousingThickness;
G4double m_GapThickness;
G4LogicalVolume* m_logicMother;
protected:
G4Material* m_matHousing;
G4Material* m_matQuartz;
G4Material* m_matAbsorber;
G4Material* m_matAir;
G4VSolid* m_ModuleBox;
G4LogicalVolume* m_ModuleLogical;
......@@ -76,24 +91,27 @@ protected:
G4LogicalVolume* m_AirScoringLogical;
G4VPhysicalVolume* m_AirScoringPhysical;
G4VSolid* m_SteelBox;
G4LogicalVolume* m_SteelLogical;
G4VPhysicalVolume* m_SteelBoxPhysical;
G4VSolid* m_HousingBox;
G4LogicalVolume* m_HousingLogical;
G4VPhysicalVolume* m_HousingPhysical;
G4VSolid* m_W;
G4LogicalVolume* m_WLogical;
G4VPhysicalVolume* m_WPhysical[11];
std::vector < G4VPhysicalVolume* > m_WPhysical;
// Vertical quartz strips (these strips are full -- no partial segments)
G4VSolid* m_StripTube;
G4LogicalVolume* m_StripLogical;
G4VPhysicalVolume* m_StripPhysical[12][100];
G4VSolid* m_FiberCoreTube;
G4LogicalVolume* m_FiberCoreLogical;
std::vector< std::vector < G4VPhysicalVolume* > > m_FiberCorePhysical;
G4VSolid* m_CladdingTube;
G4LogicalVolume* m_CladdingLogical;
G4VPhysicalVolume* m_CladdingPhysical[12][100];
std::vector< std::vector < G4VPhysicalVolume* > > m_FiberCladdingPhysical;
Materials* m_materials;
G4Material* m_matAbsorber;
G4Material* m_matHousing;
bool m_simCherenkov;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......
......@@ -30,20 +30,10 @@
#include "G4SolidStore.hh"
#include "G4LogicalVolumeStore.hh"
#include "G4PhysicalVolumeStore.hh"
#include "G4LogicalBorderSurface.hh"
#include "G4LogicalSkinSurface.hh"
#include "G4OpticalSurface.hh"
#include "G4MaterialTable.hh"
#include "G4RunManager.hh"
#include "G4NistManager.hh"
#include "G4CSGSolid.hh"
#include "G4UImanager.hh"
#include "G4Box.hh"
#include "G4Para.hh"
#include "G4Cons.hh"
#include "G4Orb.hh"
#include "G4Sphere.hh"
#include "G4Trd.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4SystemOfUnits.hh"
......@@ -57,7 +47,6 @@
#include "G4ChordFinder.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4PVParameterised.hh"
#include "G4ThreeVector.hh"
#include "G4PVReplica.hh"
#include "G4UniformMagField.hh"
#include "G4ExplicitEuler.hh"
......@@ -78,9 +67,14 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
m_solidWorld(NULL), m_logicWorld(NULL), m_physWorld(NULL),CLUSTER(false)
{materials = Materials::getInstance();}
: G4VUserDetectorConstruction(), m_solidWorld(NULL), m_logicWorld(NULL),
m_physWorld(NULL)
{
CLUSTER = false;
currentRPD = -1;
currentZDC = -1;
m_materials = Materials::getInstance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -104,130 +98,64 @@ G4VPhysicalVolume* DetectorConstruction::Construct(){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction :: DefineBorderProperties()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::ConstructDetector()
{
ConstructTestBeam()
G4UImanager* UImanager = G4UImanager::GetUIpointer();
UImanager->ApplyCommand("/control/execute geometry.mac");
if( ForceDetectorPosition ){
ManualConstruction();
}else{
ConstructSPSTestBeam();
}
return m_physWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::ConstructTestBeam()
{
// Create variables to be used in beamtest 2018 simulation
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ThreeVector zdc1Pos,zdc2Pos, rpdPos;
bool mag_on = targ_in = lead_in = ZDC1 = ZDC2 = RPD = false;
G4double mag_zOffset=0, density=0, fractionmass=0, leadblockZ=0,
zdc1X=0, zdc1Y=0, zdc1Z=0, zdc2X=0, zdc2Y=0, zdc2Z=0, rpdX=0,
rpdY=0, rpdZ=0, tableX_shift=0, tableY_shift=0;
G4double worldZoffset=16000*mm;
std::string detector[3];
G4int ncomponents;
LoadConfigurationFile(runNum);
LoadAlignmentFile(runNum);
Survey *srvy_zdc1 = GetSurvey("ZDC1"),
*srvy_zdc2 = GetSurvey("ZDC2"),
*srvy_rpd = GetSurvey("RPD");;
Alignment *m_alignment = GetAlignment();
//################################ SURVEY/ALIGNMENT_SETUP
if( ForceDetectorPosition ) == 0){
std::cout << "******************************************" << std::endl
<< " PLACING DETECTORS MANUALLY " << std::endl
<< "******************************************" << std::endl;
rpdX = srvy_rpd->x_pos*mm;
rpdY = srvy_rpd->y_pos*mm;
rpdZ = srvy_rpd->z_pos*mm;
zdc1X = srvy_zdc1->x_pos*mm;
zdc1Y = srvy_zdc1->y_pos*mm;
zdc1Z = srvy_zdc1->z_pos*mm;
zdc2X = srvy_zdc2->x_pos*mm;
zdc2Y = srvy_zdc2->y_pos*mm;
zdc2Z = srvy_zdc2->z_pos*mm;
} else{
//table(-2250,500) -> rpd/beam(0,0) where 100=0.1cm in table coordinates
//-320mm is offset to get from zdc mid to active area mid
tableX_shift = (-2250.0 - (m_alignment->x_table) )/100*mm ;//2257 more accurate
tableY_shift = (500.0 - (m_alignment->y_table) )/100*mm ;//501 more accurate
rpdX = (srvy_rpd ->x_pos) *1000.0*mm;
zdc1X = (( (srvy_zdc1->x_pos)*1000.0 ) - rpdX + tableX_shift )*mm;
zdc2X = (( (srvy_zdc2->x_pos)*1000.0 ) - rpdX + tableX_shift )*mm;
rpdX = tableX_shift;
rpdY = (srvy_rpd ->y_pos) *1000.0*mm;
zdc1Y = (( (srvy_zdc1->y_pos)*1000.0 ) - 320 - rpdY + tableY_shift )*mm;
zdc2Y = (( (srvy_zdc2->y_pos)*1000.0 ) - 320 - rpdY + tableY_shift )*mm;
rpdY = tableY_shift;
rpdZ = (( (srvy_rpd ->z_pos)*1000.0 ) -(worldZoffset) )*mm;
zdc1Z = (( (srvy_zdc1->z_pos)*1000.0 ) -(worldZoffset) )*mm;
zdc2Z = (( (srvy_zdc2->z_pos)*1000.0 ) -(worldZoffset) )*mm;
}
G4VPhysicalVolume* DetectorConstruction::ManualConstruction(){
std::cout << "******************************************" << std::endl
<< " PLACING DETECTORS MANUALLY " << std::endl
<< "******************************************" << std::endl;
zdc1Pos = G4ThreeVector( zdc1X, zdc1Y, zdc1Z);
zdc2Pos = G4ThreeVector( zdc2X, zdc2Y, zdc2Z);
rpdPos = G4ThreeVector( rpdX , rpdY , rpdZ );
/*
Make this do the thing using DetectorMessenger Commands
and member vectors
detector[0]=m_alignment->upstream_Det;
detector[1]=m_alignment->mid_Det;
detector[2]=m_alignment->downstream_Det;
*/
for(int i=0; i<3; i++){
if(detector[i]=="ZDC1") {ZDC1 = true;}
if(detector[i]=="ZDC2") {ZDC2 = true;}
if(detector[i]=="RPD" ) {RPD = true;}
}
return m_physWorld;
// Assign lead block position in mm, place approx 1 ft in front of ZDC1
// half ZDC Z width = 90mm
// 1ft ~ 300mm
leadblockZ = ( zdc1Z - 90 - 300)*mm;
}
targ_in = m_alignment->target_In;
mag_on = m_alignment->magnet_On;
lead_in = m_alignment->lead_In;
}
//################################ SURVEY/ALIGNMENT_END
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::ConstructSPSTestBeam(){
// Option to switch on/off checking of volumes overlaps
//
bool checkOverlaps = false;
if(TESTBEAM_SETUP==1){
worldSizeZ= 32000*mm;
if( std::abs(zdc1X) < std::abs(zdc2X) ) worldSizeX = 1.1 * 2 * ( std::abs(zdc2X) + maxModSizeX/2 )*mm;
else worldSizeX = 1.1 * 2 * ( std::abs(zdc1X) + maxModSizeX/2 )*mm;
if( std::abs(zdc1Y) < std::abs(zdc2Y) ) worldSizeY = 1.1 * 2 * ( std::abs(zdc2Y) + maxModSizeY/2 )*mm;
else worldSizeY = 1.1 * 2 * ( std::abs(zdc1Y) + maxModSizeY/2 )*mm;
if(!ZDC1 && !ZDC2) {
worldSizeX = 1.1 * 2 * ( std::abs(rpdX)+ maxModSizeX/2 ) * mm;
worldSizeY = 1.1 * 2 * ( std::abs(rpdY) + maxModSizeY/2 ) * mm;
}
}
G4Material* g4Air = nist->FindOrBuildMaterial("G4_AIR");
// Create variables to be used in beamtest 2018 simulation
G4ThreeVector zdc1Pos,zdc2Pos, rpdPos;
bool ZDC1 = false, ZDC2 = false, RPD = false;
G4double mag_zOffset=0, firstDetZ, detX, detY, detZ,
tableX_shift=0, tableY_shift=0;
G4Material* Lead = m_materials->Pb;
G4double worldSizeX = 180*mm;
G4double worldSizeY = 1200*mm;
G4double worldSizeZ = 32000*mm;
G4double worldZoffset= worldSizeZ/2.0;
std::string detector[3];
//Air
if (config->GetValue("OPTICAL_ON",false) == 1){
materials->UseOpticalMaterials(true); //set this an an option later ARIC!
materials->DefineOpticalProperties();
g4Air = materials->Air;
}
//################################ World volume construction
m_materials->UseOpticalMaterials(OPTICAL); //set this an an option later ARIC!
m_materials->DefineOpticalProperties();
G4Material* g4Air = m_materials->Air;
printf( "Building world with x %5.1f y %5.1f z %5.1f\n",
worldSizeX, worldSizeY, worldSizeZ );
......@@ -258,23 +186,82 @@ G4VPhysicalVolume* DetectorConstruction::ConstructTestBeam()
m_logicWorld ->SetVisAttributes(boxVisAtt_world);
ModTypeZDC *mod1 = new ModTypeZDC(0,zdc1Pos,m_logicWorld,m_sd);
ModTypeZDC *mod2 = new ModTypeZDC(1,zdc2Pos,m_logicWorld,m_sd);
ModTypeRPD *mod3 = new ModTypeRPD(0,rpdPos, m_logicWorld,m_sd);
if(ZDC1){ mod1->Construct();
std::cout << "ZDC1 center = " << "(" << zdc1Pos.getX() << ", " << zdc1Pos.getY() << ", " << zdc1Pos.getZ() << ")" << std::endl;
//################################ SURVEY/ALIGNMENT_SETUP
LoadConfigurationFile();
LoadAlignmentFile();
//table(-2250,500) -> rpd/beam(0,0) where 100=0.1cm in table coordinates
//-320mm is offset to get from zdc mid to active area mid
tableX_shift = (-2250.0 - (m_alignment->x_table) )/100*mm ;//2257 more accurate
tableY_shift = (500.0 - (m_alignment->y_table) )/100*mm ;//501 more accurate
Survey *srvy_rpd = GetSurvey("RPD");
detector[0]=m_alignment->upstream_Det;
detector[1]=m_alignment->mid_Det;
detector[2]=m_alignment->downstream_Det;
for(int i=0; i<3; i++){
if(detector[i]=="ZDC1") {ZDC1 = true;}
if(detector[i]=="ZDC2") {ZDC2 = true;}
if(detector[i]=="RPD" ) {RPD = true;}
}
firstDetZ = worldSizeZ;
for(Survey* survey : m_surveyEntries){
detX = (survey->x_pos*1000.0)*mm;
detY = (survey->y_pos*1000.0)*mm;
detZ = (survey->z_pos*1000.0 - worldZoffset )*mm;
if(detZ < firstDetZ) firstDetZ = detZ;
if( survey->detector == "ZDC1" && ZDC1 ){
AddZDC( new G4ThreeVector( detX + ( - srvy_rpd->x_pos + tableX_shift)*mm,
detY + (- 230 - srvy_rpd->y_pos + tableY_shift)*mm,
detZ ) );
} else if( survey->detector == "ZDC2" && ZDC2 ){
AddZDC( new G4ThreeVector( detX + ( - srvy_rpd->x_pos + tableX_shift)*mm,
detY + (- 230 - srvy_rpd->y_pos + tableY_shift)*mm,
detZ ) );
}else if( survey->detector == "RPD" && RPD ){
AddRPD( new G4ThreeVector( detX, detY, detZ) );
}
}
if(ZDC2){ mod2->Construct();
std::cout << "ZDC2 center = " << "(" << zdc2Pos.getX() << ", " << zdc2Pos.getY() << ", " << zdc2Pos.getZ() << ")" << std::endl;
G4ThreeVector* pos;
G4int modNum;
for(ModTypeZDC* zdc : m_ZDCvec){
zdc->SetFiberDiameters ( new G4ThreeVector(1.5*mm,0.0,0.0) );
zdc->SetAbsorberDimensions( new G4ThreeVector(90.0*mm, 180.0*mm, 11.0*mm) );