// // // RPC-HeadParameterisation.cc // // // class RPC_HeadParameterisation - implementation // // // **************************************** // * Implements RPC Head Parameterisation * // **************************************** // // ---------------------------------------------------------------------- // Author: Miguel Couceiro // Version: 3.0 // Date: May 2009 // ---------------------------------------------------------------------- // Revisions: // // Authors: Miguel Couceiro and Ana LuĂ­sa Lopes // Version: 4.0 // Date: June 2018 // ---------------------------------------------------------------------- /* ********************** */ /* **** Header Files **** */ /* ********************** */ #ifdef G4VIS_USE #include #endif // G4VIS_USE #include "../include/RPC-HeadParameterisation.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_HeadParameterisation* RPC_HeadParameterisation::m_pHeadParameterisation = 0; /* ********************************* */ /* **** Constructors/Destructor **** */ /* ********************************* */ // Constructor RPC_HeadParameterisation::RPC_HeadParameterisation() { // Get head parameters m_nNumber = (RPC_Parameters::GetParameters())->GetHeadParameters()->GetNumberOfDetectors(); CreateArrayParameters(); SetAllParameters(); } // Destructor RPC_HeadParameterisation::~RPC_HeadParameterisation() { DeleteArrayParameters(); } /* ************************************ */ /* **** Protected member functions **** */ /* ************************************ */ // SetAllParameters function - set all the parameters needed for parameterization void RPC_HeadParameterisation::SetAllParameters (void) { RPC_HeadParameters* pHeadParameters = (RPC_Parameters::GetParameters())->GetHeadParameters(); RPC_DetectorParameters* pDetectorParameters = (RPC_Parameters::GetParameters())->GetDetectorParameters(); char sDetNumX[12]; char sDetNumY[12]; char sDetNumZ[12]; for (G4int i = 0 , copyNo = 0 ; i < pHeadParameters->GetNumberOfDetectorsX() ; i++) { sprintf(sDetNumX, "%.3d", i); for (G4int j = 0 ; j < pHeadParameters->GetNumberOfDetectorsY() ; j++) { sprintf(sDetNumY, "%.3d", j); for (G4int k = 0 ; k < pHeadParameters->GetNumberOfDetectorsZ() ; k++) { sprintf(sDetNumZ, "%.3d", k); m_fXPos[copyNo] = -pHeadParameters->GetContainerInnerThickness()/2.0 + pHeadParameters->GetDetectorMarginX() + (2*i+1)*pDetectorParameters->GetContainerThickness()/2.0 + i*pHeadParameters->GetDetectorsSpacingX(); m_fYPos[copyNo] = -pHeadParameters->GetContainerInnerWidth()/2.0 + pHeadParameters->GetDetectorMarginY() + (2*j+1)*pDetectorParameters->GetContainerWidth()/2.0 + j*pHeadParameters->GetDetectorsSpacingY(); m_fZPos[copyNo] = -pHeadParameters->GetContainerInnerLength()/2.0 + pHeadParameters->GetDetectorMarginZ() + (2*k+1)*pDetectorParameters->GetContainerLength()/2.0 + k*pHeadParameters->GetDetectorsSpacingZ(); m_vOrigin[copyNo] = G4ThreeVector(m_fXPos[copyNo], m_fYPos[copyNo], m_fZPos[copyNo]); m_pRotation[copyNo] = new G4RotationMatrix(); m_fHalfX[copyNo] = pDetectorParameters->GetContainerThickness()/2.0; m_fHalfY[copyNo] = pDetectorParameters->GetContainerWidth()/2.0; m_fHalfZ[copyNo] = pDetectorParameters->GetContainerLength()/2.0; m_sMaterial[copyNo] = pDetectorParameters->GetContainerMaterial(); m_sName_sld[copyNo] = "Detector_" + G4String(sDetNumX) + "_" + G4String(sDetNumY) + "_" + G4String(sDetNumZ) + "_sld"; m_sName_log[copyNo] = "Detector_" + G4String(sDetNumX) + "_" + G4String(sDetNumY) + "_" + G4String(sDetNumZ) + "_log"; m_sName_phys[copyNo] = "Detector_" + G4String(sDetNumX) + "_" + G4String(sDetNumY) + "_" + G4String(sDetNumZ) + "_phys"; #ifdef G4VIS_USE m_Color[copyNo] = G4Color(0.0, 1.0, 1.0); m_pVisAtt[copyNo]->SetColour(m_pColor[copyNo]); #endif // G4VIS_USE copyNo++; } } } } /* ******************************************** */ /* **** General public interface functions **** */ /* ******************************************** */ // RPC_HeadParameterisation* RPC_HeadParameterisation::GetParameterisation (void) // { // if (m_pHeadParameterisation == 0) // m_pHeadParameterisation = new RPC_HeadParameterisation(); // // return m_pHeadParameterisation; // }