// // // RPC-DetectorParameterisation.cc // // // class RPC_DetectorParameterisation - implementation // // // ******************************************** // * Implements RPC Detector Parameterisation * // ******************************************** // // ---------------------------------------------------------------------- // Author: Miguel Couceiro // Version: 3.0 // Date: May 2009 // ---------------------------------------------------------------------- /* ********************** */ /* **** Header Files **** */ /* ********************** */ #ifdef G4VIS_USE #include #endif // G4VIS_USE #include "../include/RPC-DetectorParameterisation.hh" #include "../include/RPC-ScannerParameters.hh" #include "../include/RPC-HeadParameters.hh" #include "../include/RPC-DetectorParameters.hh" #include "../include/RPC-ModuleParameters.hh" #include "../include/RPC-Parameters.hh" /* ************************************ */ /* **** Private static member data **** */ /* ************************************ */ // RPC_DetectorParameterisation* RPC_DetectorParameterisation::m_pDetectorParameterisation = 0; /* ********************************* */ /* **** Constructors/Destructor **** */ /* ********************************* */ // Constructor RPC_DetectorParameterisation::RPC_DetectorParameterisation() : RPC_Parameterisation() { m_nNumber = (RPC_Parameters::GetParameters())->GetDetectorParameters()->GetNumberOfModules(); CreateArrayParameters(); SetAllParameters(); } // Destructor RPC_DetectorParameterisation::~RPC_DetectorParameterisation() { DeleteArrayParameters(); } /* ************************************ */ /* **** Protected member functions **** */ /* ************************************ */ // SetAllParameters function - set all the parameters needed for parameterization void RPC_DetectorParameterisation::SetAllParameters (void) { RPC_DetectorParameters* pDetectorParameters = (RPC_Parameters::GetParameters())->GetDetectorParameters(); RPC_ModuleParameters* pModuleParameters = (RPC_Parameters::GetParameters())->GetModuleParameters(); G4ThreeVector rotationAxis = G4ThreeVector(0.0, 0.0, 1.0) - G4ThreeVector(0.0, 0.0, 0.0); char moduleName_sld[22]; char moduleName_log[22]; char moduleName_phys[24]; for (G4int i = 0 ; i < m_nNumber ; i++) { m_fHalfX[i] = pModuleParameters->GetContainerThickness()/2.0; m_fHalfY[i] = pModuleParameters->GetContainerWidth()/2.0; m_fHalfZ[i] = pModuleParameters->GetContainerLength()/2.0; m_fXPos[i] = -pDetectorParameters->GetContainerThickness()/2.0 + (2*i+1)*m_fHalfX[i]; m_fYPos[i] = 0.0*mm; m_fZPos[i] = 0.0*mm; m_vOrigin[i] = G4ThreeVector(m_fXPos[i], m_fYPos[i], m_fZPos[i]); m_pRotation[i] = new G4RotationMatrix(rotationAxis, (i%2 == 0) ? 0.0 : -180.0*deg); m_sMaterial[i] = pModuleParameters->GetContainerMaterial(); sprintf(moduleName_sld, "Module_%.3d_sld", i); sprintf(moduleName_log, "Module_%.3d_log", i); sprintf(moduleName_phys, "Module_%.3d_phys", i); m_sName_sld[i] = moduleName_sld; m_sName_log[i] = moduleName_log; m_sName_phys[i] = moduleName_phys; #ifdef G4VIS_USE m_Color[i] = G4Color(0.0, 0.6, 0.0); m_pVisAtt[i]->SetColour(m_pColor[i]); #endif // G4VIS_USE } } /* ******************************************** */ /* **** General public interface functions **** */ /* ******************************************** */ // RPC_DetectorParameterisation* RPC_DetectorParameterisation::GetParameterisation (void) // { // if (m_pDetectorParameterisation == 0) // m_pDetectorParameterisation = new RPC_DetectorParameterisation(); // // return m_pDetectorParameterisation; // }