// // // RPC-ScannerParameterisation.cc // // // class RPC_ScannerParameterisation - implementation // // // ******************************************* // * Implements RPC Scanner Parameterisation * // ******************************************* // // Author: Miguel Couceiro // Version: 3.0 // Date: May 2009 // // ---------------------------------------------------------------------- // Revisions: // // Authors: Miguel Couceiro and Ana LuĂ­sa Lopes // Version: 4.0 // Date: July 2018 // ---------------------------------------------------------------------- /* ********************** */ /* **** Scannerer Files **** */ /* ********************** */ #ifdef G4VIS_USE #include #endif // G4VIS_USE #include "../include/RPC-ScannerParameterisation.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_ScannerParameterisation* RPC_ScannerParameterisation::m_pScannerParameterisation = 0; /* ********************************* */ /* **** Constructors/Destructor **** */ /* ********************************* */ // Constructor RPC_ScannerParameterisation::RPC_ScannerParameterisation() : RPC_Parameterisation() { // Get the number of heads m_nNumber = (RPC_Parameters::GetParameters())->GetScannerParameters()->GetNumberOfHeads(); CreateArrayParameters(); SetAllParameters(); } // Destructor RPC_ScannerParameterisation::~RPC_ScannerParameterisation() { DeleteArrayParameters(); } /* ************************************ */ /* **** Protected member functions **** */ /* ************************************ */ // SetAllParameters function - set all the parameters needed for parameterization void RPC_ScannerParameterisation::SetAllParameters (void) { RPC_ScannerParameters* pScannerParameters = (RPC_Parameters::GetParameters())->GetScannerParameters(); RPC_HeadParameters* pHeadParameters = (RPC_Parameters::GetParameters())->GetHeadParameters(); G4ThreeVector vRotationAxis = G4ThreeVector(0.0, 0.0, 1.0) - G4ThreeVector(0.0, 0.0, 0.0); char sHeadNumber[12]; for (G4int copyNo = 0 ; copyNo < m_nNumber ; copyNo++) { if (copyNo == 0) { m_fXPos[copyNo] = (pScannerParameters->GetContainerInnerThickness() + pHeadParameters->GetContainerOuterThickness())/2.0; if (pScannerParameters->GetCenterHeadsWithBore() && ((m_nNumber <= 2) || (pScannerParameters->GetContainerInnerWidth() >= pHeadParameters->GetContainerOuterWidth()))) m_fYPos[copyNo] = 0; else m_fYPos[copyNo] = (pHeadParameters->GetContainerOuterWidth() - pScannerParameters->GetContainerInnerWidth())/2.0 + pScannerParameters->GetHeadSpacing(); } else if (copyNo == 1) { if (m_nNumber == 2) { m_fXPos[copyNo] = -m_fXPos[copyNo-1]; m_fYPos[copyNo] = -m_fYPos[copyNo-1]; } else { if (pScannerParameters->GetCenterHeadsWithBore() && (pScannerParameters->GetContainerInnerThickness() >= pHeadParameters->GetContainerOuterWidth())) m_fXPos[copyNo] = 0; else m_fXPos[copyNo] = (pScannerParameters->GetContainerInnerThickness() - pHeadParameters->GetContainerOuterWidth())/2.0 - pScannerParameters->GetHeadSpacing(); m_fYPos[copyNo] = (pScannerParameters->GetContainerInnerWidth() + pHeadParameters->GetContainerOuterThickness())/2.0; } } else { m_fXPos[copyNo] = -m_fXPos[copyNo-2]; m_fYPos[copyNo] = -m_fYPos[copyNo-2]; } m_fZPos[copyNo] = 0.0*mm; m_vOrigin[copyNo] = G4ThreeVector(m_fXPos[copyNo], m_fYPos[copyNo], m_fZPos[copyNo]); if (m_nNumber == 2) m_pRotation[copyNo] = new G4RotationMatrix(vRotationAxis, -copyNo*180.0*deg); else m_pRotation[copyNo] = new G4RotationMatrix(vRotationAxis, -copyNo*90.0*deg); m_fHalfX[copyNo] = pHeadParameters->GetContainerOuterThickness()/2.0; m_fHalfY[copyNo] = pHeadParameters->GetContainerOuterWidth()/2.0; m_fHalfZ[copyNo] = pHeadParameters->GetContainerOuterLength()/2.0; m_sMaterial[copyNo] = pScannerParameters->GetContainerMaterial(); sprintf(sHeadNumber, "%.1d", copyNo); m_sName_sld[copyNo] = "Head_Case_" + G4String(sHeadNumber) + "_sld"; m_sName_log[copyNo] = "Head_Case_" + G4String(sHeadNumber) + "_log"; m_sName_phys[copyNo] = "Head_Case_" + G4String(sHeadNumber) + "_phys"; #ifdef G4VIS_USE m_Color[copyNo] = G4Color(1.0, 0.0, 1.0); m_pVisAtt[copyNo]->SetColour(m_pColor[copyNo]); #endif // G4VIS_USE } } /* ******************************************** */ /* **** General public interface functions **** */ /* ******************************************** */ // RPC_ScannerParameterisation* RPC_ScannerParameterisation::GetParameterisation (void) // { // if (m_pScannerParameterisation == 0) // m_pScannerParameterisation = new RPC_ScannerParameterisation(); // // return m_pScannerParameterisation; // }