|
ATLAS Offline Software
|
#include <ALFA_GeometryReader.h>
|
| ALFA_GeometryReader ()=default |
|
| ~ALFA_GeometryReader ()=default |
|
bool | Initialize (const PGEOMETRYCONFIGURATION pConfig, eFiberCoordSystem eFCoordSystem) |
|
bool | ReadFiberGeometry (const PGEOMETRYCONFIGURATION pConfig) |
|
int | GetRPotCount () const |
|
void | PrintFiberGeometry (std::ostream &OutStream) |
|
void | PrintFiberGeometry (const char *szOutFilename) |
|
void | GetListOfRPotIDs (std::map< eRPotName, std::string > *pMapRPotName) |
|
void | GetListOfExistingRPotIDs (std::list< eRPotName > *pListRPotName) |
|
bool | GetUFiberParams (PFIBERPARAMS pFiberParams, const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
bool | GetVFiberParams (PFIBERPARAMS pFiberParams, const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
bool | StoreReconstructionGeometry (const eRPotName eRPName, const eFiberType eFType, const char *szDataDestination) |
|
bool | GetPlateParams (PPLATEPARAMS pPlateParams, const eRPotName eRPName, const int nPlateID) |
|
bool | GetRPPosParams (PRPPOSPARAMS pRPosParams, const eRPotName eRPName) |
|
bool | GetASPosParams (PASPOSPARAMS pRPosParams, const eAStationName eASName) |
|
const char * | GetRPotLabel (const eRPotName eRPName) |
|
const char * | GetAStationLabel (const eAStationName eASName) |
|
eGeoSourceType | GetRPGeometryType (const eRPotName eRPName, eFiberType eFType) |
|
bool | GetMDFiberParams (PFIBERPARAMS pFiberParams, const eFiberType eFType, const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
bool | GetODFiberParams (PFIBERPARAMS pFiberParams, const eFiberType eFType, const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
bool | SaveRPGeometryParams (const eRPotName eRPName, const char *szDataDestination) |
|
HepGeom::Point3D< double > | GetDetPointInAtlas (eRPotName eRPName, const HepGeom::Point3D< double > &PointInDetCS) |
|
HepGeom::Point3D< double > | GetDetPointInRPot (eRPotName eRPName, const HepGeom::Point3D< double > &PointInDetCS) |
|
HepGeom::Transform3D | GetTransformMatrix (const eRPotName eRPName, const eTransformElement eMatrixType) |
|
double | GetRPotZPosInAtlas (const eRPotName eRPName) |
|
double | GetUFiberCentreXPos (const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
double | GetVFiberCentreXPos (const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
double | GetUFiberAngle (const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
double | GetVFiberAngle (const eRPotName eRPName, const int nPlateID, const int nFiberID) |
|
double | GetODFiberCentreYPos (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
double | GetODFiberAngle (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
void | SetUFiberPositionToMainReference (const eRPotName eRPName, const int nPlateID, const int nFiberID, const HepGeom::Point3D< float > &TransPoint, const double fTransSlope) |
|
void | SetVFiberPositionToMainReference (const eRPotName eRPName, const int nPlateID, const int nFiberID, const HepGeom::Point3D< float > &TransPoint, const double fTransSlope) |
|
void | SetODFiberPositionToMainReference (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID, const HepGeom::Point3D< float > &TransPoint, const double fTransSlope) |
|
double | GetMDFiberSlope (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
double | GetMDFiberOffset (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
double | GetMDFiberZPos (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
double | GetODFiberSlope (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
double | GetODFiberOffset (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
double | GetODFiberZPos (const eRPotName eRPName, const eFiberType eFType, const int nPlateID, const int nFiberID) |
|
|
static const HepGeom::Point3D< double > | ms_NominalRPPin1 =HepGeom::Point3D<double>(+77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm) |
|
static const HepGeom::Point3D< double > | ms_NominalRPMainPoint =HepGeom::Point3D<double>(0.0*CLHEP::mm,31.525*CLHEP::mm,8.0*CLHEP::mm) |
|
static const HepGeom::Point3D< double > | ms_NominalAlfaRefPoint =HepGeom::Point3D<double>(-77.5*CLHEP::mm,-35.2*CLHEP::mm,114.0*CLHEP::mm) |
|
static const HepGeom::Point3D< double > | ms_NominalDetPin1 =HepGeom::Point3D<double>(-77.5*CLHEP::mm,-35.0*CLHEP::mm,114.0*CLHEP::mm) |
|
|
bool | InitializeDefault (const PGEOMETRYCONFIGURATION pConfig) |
|
bool | ReadSource (const eGeoSourceType eSourceType, const eRPotName eRPName, const eFiberType eFType, const char *szDataSource) |
|
bool | SetIdealGeometry (const eRPotName eRPName, const eFiberType eFType) |
|
void | UpdateGeometry () |
|
void | UpdateStationsPosParams () |
|
void | UpdateSimRPPos (const eRPotName eRPName) |
|
bool | ReadFile (const eRPotName eRPName, const eFiberType eFType, const char *szFilename) |
|
bool | ReadDatabase (const eRPotName eRPName, const eFiberType eFType, const char *szDataSource) |
|
void | TransformFiberPositions (PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType) |
|
void | TransformFiberPositionsFCSCladding (PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType) |
|
void | TransformFiberPositionsFCSAtlas (PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType) |
|
HepGeom::Transform3D | ComputeTransformMatrix (const std::vector< HepGeom::Point3D< double > > &VecIdealRefPoints, const std::vector< HepGeom::Point3D< double > > &VecRealRefPoints, const int nPointCnt, HepGeom::Scale3D &Scale, bool bForceUseSVD=false) |
|
bool | ParseRPMetrology (eGeoSourceType eSourceType, const char *szDataSource) |
|
bool | ResolveRPotRefPoints (const char *szvalue, eRPotName eRPName, eRefPointType eRPointType) |
|
bool | ParseRefPoints (const char *szvalue, std::vector< HepGeom::Point3D< double > > &vecRefPoints, eMetrologyCoordSystem eCSystem) |
|
bool | ParseArrayOfValues (const char *szvalue, std::vector< double > &vecValues) |
|
bool | SetupRPMetrologyPoints (ALFA_ConfigParams &CfgParams, eRPotName eRPName) |
|
bool | SetupDetMetrologyPoints (ALFA_ConfigParams &CfgParams, eRPotName eRPName) |
|
bool | SetupStationMetrologyPoints (ALFA_ConfigParams &CfgParams, eAStationName eASName) |
|
double | GetPolyFitValue (const double fInputValue, const std::vector< double > &vecPolyFitParams) |
|
void | SetupCurrentLVDT (const PGEOMETRYCONFIGURATION pConfig) |
|
void | SetupSWCorrections (const PGEOMETRYCONFIGURATION pConfig) |
|
void | SetupUserCorrections (const PGEOMETRYCONFIGURATION pConfig) |
|
Definition at line 214 of file ALFA_GeometryReader.h.
◆ ALFA_GeometryReader()
ALFA_GeometryReader::ALFA_GeometryReader |
( |
| ) |
|
|
default |
◆ ~ALFA_GeometryReader()
ALFA_GeometryReader::~ALFA_GeometryReader |
( |
| ) |
|
|
default |
◆ ComputeTransformMatrix()
HepGeom::Transform3D ALFA_GeometryReader::ComputeTransformMatrix |
( |
const std::vector< HepGeom::Point3D< double > > & |
VecIdealRefPoints, |
|
|
const std::vector< HepGeom::Point3D< double > > & |
VecRealRefPoints, |
|
|
const int |
nPointCnt, |
|
|
HepGeom::Scale3D & |
Scale, |
|
|
bool |
bForceUseSVD = false |
|
) |
| |
|
private |
Definition at line 804 of file ALFA_GeometryReader.cxx.
808 const int N=nPointCnt;
809 CLHEP::HepVector vecAux1,vecAux2;
810 CLHEP::HepVector xmean,ymean,
t;
811 CLHEP::HepMatrix
C,U,V,
R,
W;
813 HepGeom::Rotate3D AuxRot;
814 HepGeom::Translate3D AuxTranslation;
817 if(nPointCnt==3 && !bForceUseSVD)
820 VecRealRefPoints[0],VecRealRefPoints[1],VecRealRefPoints[2]);
821 AuxTrans.getDecomposition(
Scale,AuxRot,AuxTranslation);
828 std::vector<CLHEP::HepVector> pX (
N);
829 std::vector<CLHEP::HepVector> pY (
N);
830 std::vector<CLHEP::HepVector> pXs (
N);
831 std::vector<CLHEP::HepVector> pYs(
N);
834 pX[
i]=CLHEP::Hep3Vector(VecIdealRefPoints[
i].
x(),VecIdealRefPoints[
i].
y(),VecIdealRefPoints[
i].
z());
835 pY[
i]=CLHEP::Hep3Vector(VecRealRefPoints[
i].
x(),VecRealRefPoints[
i].
y(),VecRealRefPoints[
i].
z());
839 vecAux1=CLHEP::Hep3Vector();
840 vecAux2=CLHEP::Hep3Vector();
846 xmean=vecAux1/(1.0*
N);
847 ymean=vecAux2/(1.0*
N);
849 C=CLHEP::HepMatrix(3,3);
853 C+=pYs[
i]*pXs[
i].T();
857 std::vector<double*> ppfA(3);
858 std::vector<double*> ppfV(3);
860 ppfA[
i]=
new double[3];
863 ppfV[
i]=
new double[3];
867 std::vector<double> pfW (3);
871 for(j=0;j<3;j++) ppfA[
i][j]=(
double)
C[
i][j];
874 dsvd(ppfA.data(),3,3,pfW.data(),ppfV.data());
876 U=CLHEP::HepMatrix(3,3); V=CLHEP::HepMatrix(3,3);
878 for(j=0;j<3;j++) U[
i][j]=(
double)ppfA[
i][j];
879 for(j=0;j<3;j++) V[
i][j]=(
double)ppfV[
i][j];
882 W=CLHEP::HepMatrix(3,3);
883 W[0][0]=1;
W[1][1]=1;
884 W[2][2]=(U*V).determinant();
890 CLHEP::HepRep3x3 matAux;
891 matAux.xx_=
R[0][0]; matAux.xy_=
R[0][1]; matAux.xz_=
R[0][2];
892 matAux.yx_=
R[1][0]; matAux.yy_=
R[1][1]; matAux.yz_=
R[1][2];
893 matAux.zx_=
R[2][0]; matAux.zy_=
R[2][1]; matAux.zz_=
R[2][2];
894 CLHEP::HepRotation TransM=CLHEP::HepRotation(matAux);
895 CLHEP::Hep3Vector TransT=CLHEP::Hep3Vector(
t[0],
t[1],
t[2]);
◆ GetASPosParams()
Definition at line 1842 of file ALFA_GeometryReader.cxx.
1849 pASPosParams->clear();
1851 *pASPosParams=(*iter).second;
1855 LogStream<<MSG::ERROR<<
"Unknown ALFA Station ID="<<eASName<<
endmsg;
◆ GetAStationLabel()
◆ GetDetPointInAtlas()
HepGeom::Point3D< double > ALFA_GeometryReader::GetDetPointInAtlas |
( |
eRPotName |
eRPName, |
|
|
const HepGeom::Point3D< double > & |
PointInDetCS |
|
) |
| |
Definition at line 2714 of file ALFA_GeometryReader.cxx.
2722 HepGeom::Point3D<double> PointInAtlasCS, PointInRPotCS;
2727 HepGeom::Vector3D<double>
Shift=RPPin1-MainPoint;
2728 HepGeom::Point3D<double> PointInMainPoint=
Shift+AlfaRefPoint+PointInDetCS;
2731 PointInAtlasCS=TotTransform*PointInRPotCS;
2734 throw new GaudiException(
" The GetDetPointInAtlas() can be used only with EFCS_ATLAS or EFCS_CLADDING flag ",
"ALFA_GeometryReader::GetDetPointInAtlas", StatusCode::FAILURE);
2737 return PointInAtlasCS;
◆ GetDetPointInRPot()
HepGeom::Point3D< double > ALFA_GeometryReader::GetDetPointInRPot |
( |
eRPotName |
eRPName, |
|
|
const HepGeom::Point3D< double > & |
PointInDetCS |
|
) |
| |
Definition at line 2740 of file ALFA_GeometryReader.cxx.
2746 HepGeom::Point3D<double> PointInRPotCS;
2751 HepGeom::Vector3D<double>
Shift=RPPin1-MainPoint;
2752 HepGeom::Point3D<double> PointInMainPoint=
Shift+AlfaRefPoint+PointInDetCS;
2756 throw new GaudiException(
" The GetDetPointInAtlas() can be used only with EFCS_ATLAS or EFCS_CLADDING flag ",
"ALFA_GeometryReader::GetDetPointInAtlas", StatusCode::FAILURE);
2759 return PointInRPotCS;
◆ GetListOfExistingRPotIDs()
void ALFA_GeometryReader::GetListOfExistingRPotIDs |
( |
std::list< eRPotName > * |
pListRPotName | ) |
|
◆ GetListOfRPotIDs()
void ALFA_GeometryReader::GetListOfRPotIDs |
( |
std::map< eRPotName, std::string > * |
pMapRPotName | ) |
|
Definition at line 1803 of file ALFA_GeometryReader.cxx.
1805 std::string strLabel;
1806 std::map<eRPotName,ROMAPOT>::const_iterator rpiter;
1808 if(pMapRPotName!=
nullptr){
1809 pMapRPotName->clear();
1813 pMapRPotName->insert(std::pair<eRPotName,std::string>((*rpiter).first,strLabel));
◆ GetMDFiberOffset()
◆ GetMDFiberParams()
Definition at line 1878 of file ALFA_GeometryReader.cxx.
1884 if(pFiberParams==
nullptr)
1886 LogStream<<MSG::ERROR<<
"pFiberParams points to NULL"<<
endmsg;
1890 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1901 LogStream<<MSG::ERROR<<
"Invalid fiber type"<<
endmsg;
◆ GetMDFiberSlope()
◆ GetMDFiberZPos()
◆ GetODFiberAngle()
◆ GetODFiberCentreYPos()
◆ GetODFiberOffset()
◆ GetODFiberParams()
Definition at line 1910 of file ALFA_GeometryReader.cxx.
1913 std::list<FIBERPARAMS>::const_iterator iter;
1914 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1924 for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter)
1926 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1929 if (iter==(*rpiter).second.ListODFibersU0.end())
1931 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1935 *pFiberParams = *iter;
1943 for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter)
1945 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1948 if (iter==(*rpiter).second.ListODFibersV0.end())
1950 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1954 *pFiberParams = *iter;
1962 for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter)
1964 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1967 if (iter==(*rpiter).second.ListODFibersU1.end())
1969 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1973 *pFiberParams = *iter;
1981 for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter)
1983 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1986 if (iter==(*rpiter).second.ListODFibersV1.end())
1988 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1992 *pFiberParams = *iter;
2000 LogStream<<MSG::ERROR<<
"Unknown ODFiber eFType="<<eFType<<
endmsg;
2007 LogStream<<MSG::ERROR<<
"Unknown Roma pot PotID="<<eRPName<<
endmsg;
◆ GetODFiberSlope()
◆ GetODFiberZPos()
◆ GetPlateParams()
Definition at line 1505 of file ALFA_GeometryReader.cxx.
1514 if((pliter=(*rpiter).second.MapPlates.find(nPlateID))!=(*rpiter).second.MapPlates.end()){
1515 *pPlateParams=(*pliter).second;
1519 LogStream<<MSG::ERROR<<
"Unknown Ti plate ID "<<nPlateID<<
endmsg;
1523 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ GetPolyFitValue()
double ALFA_GeometryReader::GetPolyFitValue |
( |
const double |
fInputValue, |
|
|
const std::vector< double > & |
vecPolyFitParams |
|
) |
| |
|
private |
Definition at line 2699 of file ALFA_GeometryReader.cxx.
2702 double fOutputValue=0.0;
2704 n=vecPolyFitParams.size();
2708 fOutputValue+=vecPolyFitParams[
i]*
pow(fInputValue,
n-1-
i);
2711 return fOutputValue;
◆ GetRPGeometryType()
◆ GetRPotCount()
int ALFA_GeometryReader::GetRPotCount |
( |
| ) |
const |
|
inline |
◆ GetRPotLabel()
◆ GetRPotZPosInAtlas()
double ALFA_GeometryReader::GetRPotZPosInAtlas |
( |
const eRPotName |
eRPName | ) |
|
◆ GetRPPosParams()
Definition at line 1823 of file ALFA_GeometryReader.cxx.
1830 pRPPosParams->clear();
1832 *pRPPosParams=(*iter).second;
1836 LogStream<<MSG::ERROR<<
"Unknown Roma pot ID="<<eRPName<<
endmsg;
◆ GetTransformMatrix()
Definition at line 2820 of file ALFA_GeometryReader.cxx.
2833 HepGeom::Vector3D<double> Shift1=RPPin1-MainPoint;
2834 HepGeom::Vector3D<double> Shift2=RPPin1-MainPoint+AlfaRefPoint;
2835 HepGeom::Vector3D<double> Shift3=0.5*(AParams.
ShiftE+AParams.
ShiftS);
2849 TransMatrix=HepGeom::Translate3D(-Shift1);
2852 TransMatrix=HepGeom::Translate3D(Shift2);
2855 TransMatrix=HepGeom::Translate3D(-Shift3);
2858 throw GaudiException(
" Invalid matrix identificator ",
"ALFA_GeometryReader::GetTransformMatrix", StatusCode::FAILURE);
◆ GetUFiberAngle()
◆ GetUFiberCentreXPos()
◆ GetUFiberParams()
Definition at line 1311 of file ALFA_GeometryReader.cxx.
1314 std::list<FIBERPARAMS>::const_iterator iter;
1315 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1320 for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1321 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1324 if(iter==(*rpiter).second.ListUFibers.end()){
1325 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1328 *pFiberParams = *iter;
1333 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ GetVFiberAngle()
◆ GetVFiberCentreXPos()
◆ GetVFiberParams()
Definition at line 1339 of file ALFA_GeometryReader.cxx.
1342 std::list<FIBERPARAMS>::const_iterator iter;
1343 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1348 for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1349 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1352 if(iter==(*rpiter).second.ListVFibers.end()) {
1353 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1357 *pFiberParams = *iter;
1362 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ Initialize()
Definition at line 623 of file ALFA_GeometryReader.cxx.
655 LogStream<<MSG::INFO<<
"Metrology data loaded from file "<<
FilePath<<
endmsg;
669 throw GaudiException(
" Unknown metrology type ",
"ALFA_GeometryReader::Initialize", StatusCode::FAILURE);
◆ InitializeDefault()
Definition at line 382 of file ALFA_GeometryReader.cxx.
396 strcpy(ASPosParams.
szLabel,
"B7L1");
402 strcpy(ASPosParams.
szLabel,
"A7L1");
408 strcpy(ASPosParams.
szLabel,
"A7R1");
414 strcpy(ASPosParams.
szLabel,
"B7R1");
422 strcpy(RPPosParams.
szLabel,
"B7L1U");
447 strcpy(RPPosParams.
szLabel,
"B7L1L");
472 strcpy(RPPosParams.
szLabel,
"A7L1U");
497 strcpy(RPPosParams.
szLabel,
"A7L1L");
522 strcpy(RPPosParams.
szLabel,
"A7R1U");
547 strcpy(RPPosParams.
szLabel,
"A7R1L");
572 strcpy(RPPosParams.
szLabel,
"B7R1U");
597 strcpy(RPPosParams.
szLabel,
"B7R1L");
◆ ParseArrayOfValues()
bool ALFA_GeometryReader::ParseArrayOfValues |
( |
const char * |
szvalue, |
|
|
std::vector< double > & |
vecValues |
|
) |
| |
|
private |
Definition at line 2478 of file ALFA_GeometryReader.cxx.
2482 char *ppos1,*ppos2,*pstop;
2486 memset(szbuff,0,
sizeof(szbuff));
2487 if(szvalue) strncpy(szbuff,szvalue,
sizeof(szbuff)-1);
2490 ppos2=strchr(ppos1,
',');
2492 while(ppos2!=
nullptr){
2495 faux=strtod(ppos1,&pstop);
2496 if(pstop==ppos2) vecValues.push_back(faux);
2503 ppos2=strchr(ppos1,
',');
2507 faux=strtod(ppos1,&pstop);
2508 if(*pstop==0) vecValues.push_back(faux);
2512 if(!bRes) vecValues.clear();
◆ ParseRefPoints()
bool ALFA_GeometryReader::ParseRefPoints |
( |
const char * |
szvalue, |
|
|
std::vector< HepGeom::Point3D< double > > & |
vecRefPoints, |
|
|
eMetrologyCoordSystem |
eCSystem |
|
) |
| |
|
private |
Definition at line 2401 of file ALFA_GeometryReader.cxx.
2403 double fx{},fy{},fz{},faux{};
2404 char *ppos1,*ppos2,*ppos3,*ppos4,*pstop;
2406 HepGeom::Point3D<double> RefPoint;
2409 if (strlen(szvalue) <513){
2410 strcpy(szbuff,szvalue);
2412 LogStream<<MSG::ERROR<<
"String too long for buffer."<<
endmsg;
2417 while((ppos1=strchr(ppos2,
'['))!=
nullptr){
2418 if(!(ppos2=strchr(ppos1+1,
']')))
return false;
2423 if(nCnt==0)
return false;
2424 vecRefPoints.resize(nCnt);
2428 while((ppos1=strchr(ppos2,
'['))!=
nullptr){
2429 if(!(ppos2=strchr(ppos1,
']')))
return false;
2433 if(!(ppos4=strchr(ppos3+1,
',')))
return false;
2435 faux=strtod(ppos3,&pstop);
2436 if(pstop!=ppos4 && *pstop!=
' ')
return false;
2441 if(!(ppos4=strchr(ppos3+1,
',')))
return false;
2443 faux=strtod(ppos3,&pstop);
2444 if(pstop!=ppos4 && *pstop!=
' ')
return false;
2449 if(!(ppos4=strchr(ppos3+1,
']')))
return false;
2451 faux=strtod(ppos3,&pstop);
2452 if(pstop!=ppos4 && *pstop!=
' ')
return false;
2457 RefPoint[0]=fx; RefPoint[1]=fy; RefPoint[2]=fz;
2460 RefPoint[0]=fx; RefPoint[1]=fz; RefPoint[2]=-fy;
2463 RefPoint[0]=fx; RefPoint[1]=-fz; RefPoint[2]=fy;
2466 RefPoint[0]=fx; RefPoint[1]=fy; RefPoint[2]=fz;
2468 else throw new GaudiException(
"Invalid type of metrology coordinate system",
"ALFA_GeometryReader::ParseRefPoints", StatusCode::FAILURE);
2470 vecRefPoints[
i++]=RefPoint;
◆ ParseRPMetrology()
bool ALFA_GeometryReader::ParseRPMetrology |
( |
eGeoSourceType |
eSourceType, |
|
|
const char * |
szDataSource |
|
) |
| |
|
private |
Definition at line 2308 of file ALFA_GeometryReader.cxx.
2319 if(CfgParams.
Init(szDataSource,
"[B7L1]")==0)
return false;
2322 if(CfgParams.
Init(szDataSource,
"[A7L1]")==0)
return false;
2325 if(CfgParams.
Init(szDataSource,
"[A7R1]")==0)
return false;
2328 if(CfgParams.
Init(szDataSource,
"[B7R1]")==0)
return false;
2333 if(CfgParams.
Init(szDataSource,
"[B7L1U]")==0)
return false;
2338 if(CfgParams.
Init(szDataSource,
"[B7L1L]")==0)
return false;
2343 if(CfgParams.
Init(szDataSource,
"[A7L1U]")==0)
return false;
2348 if(CfgParams.
Init(szDataSource,
"[A7L1L]")==0)
return false;
2353 if(CfgParams.
Init(szDataSource,
"[A7R1U]")==0)
return false;
2358 if(CfgParams.
Init(szDataSource,
"[A7R1L]")==0)
return false;
2363 if(CfgParams.
Init(szDataSource,
"[B7R1U]")==0)
return false;
2368 if(CfgParams.
Init(szDataSource,
"[B7R1L]")==0)
return false;
2376 LogStream<<MSG::ERROR<<
"The file source is supported only."<<
endmsg;
◆ PrintFiberGeometry() [1/2]
void ALFA_GeometryReader::PrintFiberGeometry |
( |
const char * |
szOutFilename | ) |
|
◆ PrintFiberGeometry() [2/2]
void ALFA_GeometryReader::PrintFiberGeometry |
( |
std::ostream & |
OutStream | ) |
|
Definition at line 1537 of file ALFA_GeometryReader.cxx.
1540 std::list<FIBERPARAMS>::const_iterator iter;
1541 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1547 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1552 OutStream<<std::endl<<
"Geometry of U-fibers in Roma Pot "<<(*rpiter).first<<std::endl;
1556 for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1557 OutStream<<(*rpiter).first<<
"\t\t\t\t"<<(*iter).nPlateID<<
"\t\t\t\t"<<(*iter).nFiberID<<
"\t\t\t\t"<<(*iter).nLayerID<<
"\t\t\t\t";
1562 OutStream<<std::endl<<
"Geometry of V-fibers in Roma Pot "<<(*rpiter).first<<std::endl;
1566 for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1567 OutStream<<(*rpiter).first<<
"\t\t\t\t"<<(*iter).nPlateID<<
"\t\t\t\t"<<(*iter).nFiberID<<
"\t\t\t\t"<<(*iter).nLayerID<<
"\t\t\t\t";
1572 OutStream<<std::endl<<
"Geometry of V0-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1576 for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter){
1577 OutStream<<(*rpiter).first<<
"\t\t\t\t"<<(*iter).nPlateID<<
"\t\t\t\t"<<(*iter).nFiberID<<
"\t\t\t\t"<<(*iter).nLayerID<<
"\t\t\t\t";
1582 OutStream<<std::endl<<
"Geometry of U0-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1586 for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter){
1587 OutStream<<(*rpiter).first<<
"\t\t\t\t"<<(*iter).nPlateID<<
"\t\t\t\t"<<(*iter).nFiberID<<
"\t\t\t\t"<<(*iter).nLayerID<<
"\t\t\t\t";
1592 OutStream<<std::endl<<
"Geometry of U1-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1596 for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter){
1597 OutStream<<(*rpiter).first<<
"\t\t\t\t"<<(*iter).nPlateID<<
"\t\t\t\t"<<(*iter).nFiberID<<
"\t\t\t\t"<<(*iter).nLayerID<<
"\t\t\t\t";
1602 OutStream<<std::endl<<
"Geometry of V1-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1606 for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter){
1607 OutStream<<(*rpiter).first<<
"\t\t\t\t"<<(*iter).nPlateID<<
"\t\t\t\t"<<(*iter).nFiberID<<
"\t\t\t\t"<<(*iter).nLayerID<<
"\t\t\t\t";
◆ ReadDatabase()
Definition at line 1223 of file ALFA_GeometryReader.cxx.
1231 std::vector<std::string> strDBElements;
1235 memset(szSource,0,
sizeof(szSource));
1236 if(szDataSource) strncpy(szSource, szDataSource,
sizeof(szSource)-1);
1237 char* strtok_ptr =
nullptr;
1238 pch = strtok_r(szSource,
":",&strtok_ptr);
1239 while (pch !=
nullptr)
1241 strDBElements.emplace_back(pch);
1242 pch = strtok_r(
nullptr,
":",&strtok_ptr);
1248 bRes = p_DBAccess->
ReadGeometry(eRPName, eFType, strDBElements[2], strDBElements[1], strDBElements[0]);
1259 m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1265 std::list<FIBERDATA>::const_iterator iter;
1268 if (eRPName == (*iter).nPotID)
1272 FiberParams.
nLayerID = (*iter).nLayerID;
1273 FiberParams.
nFiberID = (*iter).nFiberID;
1274 FiberParams.
fSlope = (*iter).fSlope;
1275 FiberParams.
fOffset = (*iter).fOffset;
1276 FiberParams.
fZPos = (*iter).fZPos;
◆ ReadFiberGeometry()
Definition at line 907 of file ALFA_GeometryReader.cxx.
911 std::list<eRPotName>::const_iterator iterRPName;
919 nRPCfgIndex=((
int)(*iterRPName))-1;
◆ ReadFile()
Definition at line 1077 of file ALFA_GeometryReader.cxx.
1082 int i,nLine,nLength;
1100 m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1106 if((pFile=fopen(szFilename,
"r"))==
nullptr){
1107 LogStream<<MSG::ERROR<<
"Could not open the file "<<szFilename<<
endmsg;
1112 while(!feof(pFile)){
1113 if(fgets(szLine,
sizeof(szLine),pFile)!=
nullptr){
1118 if(nLine<6)
continue;
1120 nLength=strlen(szLine);
1123 for(
i=0;
i<nLength;
i++) {
if(*(szLine+
i)==
' ')
continue;
else break; }
1125 pch2=strchr(pch1,
' ');
1132 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1139 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break;}
1141 pch2=strchr(pch1,
' ');
1147 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1154 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break; }
1156 pch2=strchr(pch1,
' ');
1162 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1169 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break; }
1171 pch2=strchr(pch1,
' ');
1177 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1184 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break; }
1217 if(pFile) fclose(pFile);
◆ ReadSource()
Definition at line 935 of file ALFA_GeometryReader.cxx.
939 std::string strDetType,
FilePath, GeomFile;
948 LogStream<<MSG::INFO<<
"The IDEAL "<<strDetType<<
" fiber geometry will be loaded for RP "<<
GetRPotLabel(eRPName)<<
endmsg;
953 GeomFile=std::string(
"geom_")+strDetType+std::string(
"_")+std::string(
GetRPotLabel(eRPName))+std::string(
".dat");
955 else FilePath=std::string(szDataSource);
957 LogStream<<MSG::INFO<<
"The "<<strDetType<<
" fiber geometry will be loaded from FILE "<<
FilePath.c_str()<<
" for RP "<<
GetRPotLabel(eRPName)<<
endmsg;
961 LogStream<<MSG::INFO<<
"The "<<strDetType<<
" fiber geometry will be loaded from DATABASE for RP "<<
GetRPotLabel(eRPName)<<
endmsg;
972 m_MapRPot[eRPName].MapPlates.insert(std::pair<int,PLATEPARAMS>(
i,PlateParams));
976 m_MapRPot[eRPName].MapODPlates.insert(std::pair<int,PLATEPARAMS>(
i,PlateParams));
986 throw GaudiException(
" Could not load geometry ",
"ALFA_GeometryReader::ReadSource", StatusCode::FAILURE);
◆ ResolveRPotRefPoints()
◆ SaveRPGeometryParams()
bool ALFA_GeometryReader::SaveRPGeometryParams |
( |
const eRPotName |
eRPName, |
|
|
const char * |
szDataDestination |
|
) |
| |
Definition at line 2763 of file ALFA_GeometryReader.cxx.
2766 double fRotX,fRotY,fRotZ;
2768 FILE *
pfile=fopen(szDataDestination,
"w");
2771 fprintf(
pfile,
"Romain pot geometry info: ----------------------------------------\r\n");
2775 fprintf(
pfile,
"Transformation matrix of RP in station MainPoint:\r\n");
2783 fprintf(
pfile,
"RotX=%.5f rad, RotY=%.5f rad, RotZ=%.5f rad\r\n",fRotX,fRotY,fRotZ);
2786 fprintf(
pfile,
"\r\nDetector geometry info: ------------------------------------------\r\n");
2787 fprintf(
pfile,
"Transformation matrix of detector in RP MainPoint:\r\n");
2795 fprintf(
pfile,
"RotX=%.5f rad, RotY=%.5f rad, RotZ=%.5f rad\r\n",fRotX,fRotY,fRotZ);
2797 fprintf(
pfile,
"\r\nReference pins and Track point info: ------------------------------------------\r\n");
2798 fprintf(
pfile,
"RPPin1: nominal=[%.3f,%.3f,%.3f], real=[%.3f,%.3f,%.3f] (Station CS)\r\n",
m_RPPosParams[eRPName].RefPins.IdealRPPin1.x(),
m_RPPosParams[eRPName].RefPins.IdealRPPin1.y(),
m_RPPosParams[eRPName].RefPins.IdealRPPin1.z(),
2800 fprintf(
pfile,
"RPPin2: nominal=[%.3f,%.3f,%.3f], real=[%.3f,%.3f,%.3f] (Station CS)\r\n",
m_RPPosParams[eRPName].RefPins.IdealRPPin2.x(),
m_RPPosParams[eRPName].RefPins.IdealRPPin2.y(),
m_RPPosParams[eRPName].RefPins.IdealRPPin2.z(),
2802 fprintf(
pfile,
"RPPin3: nominal=[%.3f,%.3f,%.3f], real=[%.3f,%.3f,%.3f] (Station CS)\r\n",
m_RPPosParams[eRPName].RefPins.IdealRPPin3.x(),
m_RPPosParams[eRPName].RefPins.IdealRPPin3.y(),
m_RPPosParams[eRPName].RefPins.IdealRPPin3.z(),
2804 fprintf(
pfile,
"Detector TrackPoint: [%.3f,%.3f,%.3f] (ALFA CS), [%.3f,%.3f,%.3f] (RPot CS), [%.3f,%.3f,%.3f] (ATLAS CS)\r\n",
m_RPPosParams[eRPName].RefPins.DTPInAlfaCS.x(),
m_RPPosParams[eRPName].RefPins.DTPInAlfaCS.y(),
m_RPPosParams[eRPName].RefPins.DTPInAlfaCS.z(),
2807 fprintf(
pfile,
"Detector CentrePoint: [%.3f,%.3f,%.3f] (ALFA CS), [%.3f,%.3f,%.3f] (RPot CS), [%.3f,%.3f,%.3f] (ATLAS CS)\r\n",
m_RPPosParams[eRPName].RefPins.DCPInAlfaCS.x(),
m_RPPosParams[eRPName].RefPins.DCPInAlfaCS.y(),
m_RPPosParams[eRPName].RefPins.DCPInAlfaCS.z(),
◆ SetIdealGeometry()
Definition at line 992 of file ALFA_GeometryReader.cxx.
1012 m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1052 m_MapRPot[eRPName].ListODFibersV0.push_back(FiberParams);
1057 m_MapRPot[eRPName].ListODFibersV1.push_back(FiberParams);
1063 m_MapRPot[eRPName].ListODFibersU0.push_back(FiberParams);
1068 m_MapRPot[eRPName].ListODFibersU1.push_back(FiberParams);
◆ SetODFiberPositionToMainReference()
Definition at line 2013 of file ALFA_GeometryReader.cxx.
2018 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::SetODFiberPositionToMainReference");
2021 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
2031 for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter)
2033 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2036 if (iter==(*rpiter).second.ListODFibersU0.end())
2038 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2043 (*iter).MainRefPointPos=TransPoint;
2044 (*iter).fMainRefPointSlope=fTransSlope;
2051 for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter)
2053 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2056 if (iter==(*rpiter).second.ListODFibersV0.end())
2058 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2062 (*iter).MainRefPointPos=TransPoint;
2063 (*iter).fMainRefPointSlope=fTransSlope;
2070 for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter)
2072 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2075 if (iter==(*rpiter).second.ListODFibersU1.end())
2077 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2081 (*iter).MainRefPointPos=TransPoint;
2082 (*iter).fMainRefPointSlope=fTransSlope;
2089 for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter)
2091 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2094 if (iter==(*rpiter).second.ListODFibersV1.end())
2096 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2100 (*iter).MainRefPointPos=TransPoint;
2101 (*iter).fMainRefPointSlope=fTransSlope;
2108 LogStream<<MSG::ERROR<<
"Unknown ODFiber eFType="<<eFType<<
endmsg;
2115 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ SetUFiberPositionToMainReference()
void ALFA_GeometryReader::SetUFiberPositionToMainReference |
( |
const eRPotName |
eRPName, |
|
|
const int |
nPlateID, |
|
|
const int |
nFiberID, |
|
|
const HepGeom::Point3D< float > & |
TransPoint, |
|
|
const double |
fTransSlope |
|
) |
| |
Definition at line 1441 of file ALFA_GeometryReader.cxx.
1447 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::SetUFiberPositionToMainReference");
1450 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1455 for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1456 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1459 if(iter==(*rpiter).second.ListUFibers.end()) {
1460 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1464 (*iter).MainRefPointPos=TransPoint;
1465 (*iter).fMainRefPointSlope=fTransSlope;
1469 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ SetupCurrentLVDT()
◆ SetupDetMetrologyPoints()
Definition at line 2517 of file ALFA_GeometryReader.cxx.
2526 double xr1,yr1,xr2,yr2;
2527 HepGeom::Point3D<double> PointIdealD3, PointRealD3;
2528 HepGeom::Point3D<double> PointIdealD4, PointRealD4;
2529 HepGeom::Point3D<double> PointIdealD5, PointRealD5;
2531 std::vector<double> vecDetEdges;
2532 std::vector<HepGeom::Point3D<double> > vecNominalDetPoints;
2533 std::vector<HepGeom::Point3D<double> > vecRealDetPoints;
2536 if(!CfgParams.
IsKey(
"idealrefdetpoints"))
return false;
2538 if(!CfgParams.
IsKey(
"realrefdetpoints"))
return false;
2541 if(!CfgParams.
IsKey(
"realdetedgeypos"))
return false;
2544 fZc=0.5*(vecDetEdges[0]+vecDetEdges[1]);
2545 PointIdealD3=HepGeom::Point3D<double>(10.0,0.0,0.0);
2546 PointIdealD4=HepGeom::Point3D<double>(0.0,10.0,0.0);
2547 PointIdealD5=HepGeom::Point3D<double>(0.0,0.0,10.0);
2550 xp1=vecNominalDetPoints[0].x();
2551 yp1=vecNominalDetPoints[0].y();
2554 xr1=vecRealDetPoints[0].x();
2555 yr1=vecRealDetPoints[0].y();
2556 xr2=vecRealDetPoints[1].x();
2557 yr2=vecRealDetPoints[1].y();
2560 double alpha=-
atan((xr2-xr1)/(yr2-yr1));
2570 CorrectionInDetPin1=HepGeom::Translate3D(a3,a4,fZc-113.0*
CLHEP::mm)*HepGeom::RotateZ3D(
alpha);
2577 HepGeom::Vector3D<double> OriginShift=RPPin1+DetPin1-MainPoint;
2579 CLHEP::Hep3Vector TranslationInMainPoint=CorrectionInDetPin1.getTranslation()-CorrectionInDetPin1*OriginShift+OriginShift;
2581 CLHEP::HepRotation RotationInMainPoint=CorrectionInDetPin1.getRotation();
2584 PointRealD3=CorrectionInMainPoint*PointIdealD3;
2585 PointRealD4=CorrectionInMainPoint*PointIdealD4;
2586 PointRealD5=CorrectionInMainPoint*PointIdealD5;
2591 m_RPPosParams[eRPName].VecIdealDetRefPoints[0]=std::move(PointIdealD5);
2592 m_RPPosParams[eRPName].VecRealDetRefPoints[0]=std::move(PointRealD5);
2594 m_RPPosParams[eRPName].VecIdealDetRefPoints[1]=std::move(PointIdealD4);
2595 m_RPPosParams[eRPName].VecRealDetRefPoints[1]=std::move(PointRealD4);
2597 m_RPPosParams[eRPName].VecIdealDetRefPoints[2]=std::move(PointIdealD3);
2598 m_RPPosParams[eRPName].VecRealDetRefPoints[2]=std::move(PointRealD3);
◆ SetupRPMetrologyPoints()
Definition at line 2603 of file ALFA_GeometryReader.cxx.
2609 double fCurrentLVDTmm;
2610 HepGeom::Point3D<double> PSinStation, RPPinNominal;
2611 double fCurrentLVDT=0.0;
2612 std::vector<double> vecPolyFitParams;
2613 std::vector<HepGeom::Point3D<double> > vecPSinRPCS;
2614 std::vector<HepGeom::Point3D<double> > vecNominalPSinStationCS;
2615 std::vector<HepGeom::Point3D<double> > vecRealPSinStationCS;
2626 vecNominalPSinStationCS.resize(nCnt);
2627 vecRealPSinStationCS.resize(nCnt);
2630 if(!CfgParams.
IsKey(
"psinrpss"))
return false;
2634 for(
i=0;
i<nCnt;
i++){
2635 vecNominalPSinStationCS[
i]=RPPinNominal+HepGeom::RotateX3D(RPPosParams.
bIsLow? 180*
CLHEP::deg:0.0)*vecPSinRPCS[
i];
2652 PSinStation.set(fx,fy,fz);
2653 vecRealPSinStationCS[0]=PSinStation;
2661 PSinStation.set(fx,fy,fz);
2662 vecRealPSinStationCS[1]=PSinStation;
2670 PSinStation.set(fx,fy,fz);
2671 vecRealPSinStationCS[2]=std::move(PSinStation);
2674 m_RPPosParams[eRPName].VecIdealRPRefPoints=std::move(vecNominalPSinStationCS);
2675 m_RPPosParams[eRPName].VecRealRPRefPoints=std::move(vecRealPSinStationCS);
◆ SetupStationMetrologyPoints()
Definition at line 2682 of file ALFA_GeometryReader.cxx.
2684 std::vector<HepGeom::Point3D<double> > vecShiftPoints;
2687 if(!CfgParams.
IsKey(
"shifte"))
return false;
2692 if(!CfgParams.
IsKey(
"shifts"))
return false;
◆ SetupSWCorrections()
◆ SetupUserCorrections()
◆ SetVFiberPositionToMainReference()
void ALFA_GeometryReader::SetVFiberPositionToMainReference |
( |
const eRPotName |
eRPName, |
|
|
const int |
nPlateID, |
|
|
const int |
nFiberID, |
|
|
const HepGeom::Point3D< float > & |
TransPoint, |
|
|
const double |
fTransSlope |
|
) |
| |
Definition at line 1473 of file ALFA_GeometryReader.cxx.
1479 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::SetVFiberPositionToMainReference");
1482 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1487 for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1488 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1491 if(iter==(*rpiter).second.ListVFibers.end()){
1492 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1496 (*iter).MainRefPointPos=TransPoint;
1497 (*iter).fMainRefPointSlope=fTransSlope;
1501 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ StoreReconstructionGeometry()
Definition at line 1614 of file ALFA_GeometryReader.cxx.
1617 double fParamB, fY, fX, fZ, fSlope;
1624 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1628 pFile = fopen(szDataDestination,
"w");
1629 if(pFile==
nullptr)
return false;
1631 fprintf(pFile,
"xxxxxxxxxxxxxxxxxxx\n");
1636 fprintf(pFile,
"20\n");
1648 fParamB=fY-fSlope*fX;
1656 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2-1), j, fSlope, fParamB, fZ);
1669 fParamB=fY-fSlope*fX;
1677 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2), j, fSlope, fParamB, fZ);
1684 fprintf(pFile,
"6\n");
1698 fParamB=fY-fSlope*fX;
1706 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2-1), j, fSlope, fParamB, fZ);
1720 fParamB=fY-fSlope*fX;
1728 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2-1), j, fSlope, fParamB, fZ);
1742 fParamB=fY-fSlope*fX;
1749 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2), j, fSlope, fParamB, fZ);
1764 fParamB=fY-fSlope*fX;
1771 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2), j, fSlope, fParamB, fZ);
◆ TransformFiberPositions()
◆ TransformFiberPositionsFCSAtlas()
Definition at line 255 of file ALFA_GeometryReader.cxx.
262 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::TransformFiberPositionsFCSAtlas");
263 static constexpr std::array<double,10> MD_stagger{0.0, 0.283, -0.141, 0.141, -0.283, 0.354, -0.071, 0.212, -0.212, 0.071};
264 static constexpr std::array<double,3> OD_stagger{0.0, -0.167, -0.334};
265 static constexpr
double fSCY=-126.3765+0.0045;
267 static constexpr
double fSCY_ODFiberU=-106.333;
268 static constexpr
double fSCY_ODFiberV=-113.833;
270 double fCentrePos=0.0, fZOffset=0.0;
282 pFiberParams->
fOffset=-1.414213562*fCentrePos+fSCY-fStagger;
286 pFiberParams->
fOffset=+1.414213562*fCentrePos+fSCY+fStagger;
296 if(
const auto i = pFiberParams->
nPlateID; (
i<1) || (
i>3)){
297 LogStream<<MSG::ERROR<<
"(EFT_ODFIBERV1): Wrong ODPlateID "<<
i<<
" (RP no."<<eRPName<<
")"<<
endmsg;
307 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberV+fStagger;
311 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberV+fStagger;
320 if(
const auto i = pFiberParams->
nPlateID; (
i<1) || (
i>3)){
321 LogStream<<MSG::ERROR<<
"(EFT_ODFIBERU1): Wrong ODPlateID "<<
i<<
" (RP no."<<eRPName<<
")"<<
endmsg;
330 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberU+fStagger;
334 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberU+fStagger;
346 HepGeom::Point3D<double> DetFiberPoint1, DetFiberPoint2, DetPin1Point;
347 HepGeom::Point3D<double> AtlFiberPoint1, AtlFiberPoint2, AtlDetPin1Point;
348 HepGeom::Point3D<double> AtlProjFiberPoint1, AtlProjFiberPoint2;
350 DetPin1Point=HepGeom::Point3D<double>(0.0,0.0,0.0);
351 DetFiberPoint1=HepGeom::Point3D<double>(0.0,pFiberParams->
fOffset,(RPPosParams.
bIsLow)? -fZOffset:+fZOffset);
352 DetFiberPoint2=HepGeom::Point3D<double>(-pFiberParams->
fOffset/pFiberParams->
fSlope,0.0,(RPPosParams.
bIsLow)? -fZOffset:+fZOffset);
358 AtlProjFiberPoint1=HepGeom::Point3D<double>(AtlFiberPoint1[0],AtlFiberPoint1[1],AtlDetPin1Point[2]+fZOffset);
359 AtlProjFiberPoint2=HepGeom::Point3D<double>(AtlFiberPoint2[0],AtlFiberPoint2[1],AtlDetPin1Point[2]+fZOffset);
361 double fx2=AtlProjFiberPoint1[0]+AtlProjFiberPoint1[1]*(AtlProjFiberPoint2[0]-AtlProjFiberPoint1[0])/(AtlProjFiberPoint1[1]-AtlProjFiberPoint2[1]);
362 double fy1=AtlProjFiberPoint1[1]+AtlProjFiberPoint1[0]*(AtlProjFiberPoint2[1]-AtlProjFiberPoint1[1])/(AtlProjFiberPoint1[0]-AtlProjFiberPoint2[0]);
369 HepGeom::Vector3D<double> DirVector=AtlFiberPoint2-AtlFiberPoint1;
◆ TransformFiberPositionsFCSCladding()
Definition at line 124 of file ALFA_GeometryReader.cxx.
126 static constexpr std::array<double,10> ALFA_stagger{0.0, 0.283, -0.141, 0.141, -0.283, 0.354, -0.071, 0.212, -0.212, 0.071};
127 static constexpr std::array<double,3> OD_stagger{0.0, -0.167, -0.334};
128 static constexpr
double fSCY=-126.3765+0.0045;
130 static constexpr
double fSCY_ODFiberU=-106.333;
131 static constexpr
double fSCY_ODFiberV=-113.833;
133 static constexpr
double fSCX_ODFiber00=-23.00;
134 static constexpr
double fSCX_ODFiber01=+23.00;
138 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::TransformFiberPositionsFCSCladding");
145 LogStream<<MSG::ERROR<<
"(EFT_VFIBER): Wrong PlateID "<<pFiberParams->
nPlateID<<
" (RP no."<<eRPName<<
")"<<
endmsg;
155 if(
const auto i = pFiberParams->
nPlateID; (
i<1) || (
i>3)){
156 LogStream<<MSG::ERROR<<
"(EFT_ODFIBERV1): Wrong ODPlateID "<<
i<<
" (RP no."<<eRPName<<
")"<<
endmsg;
◆ UpdateGeometry()
void ALFA_GeometryReader::UpdateGeometry |
( |
| ) |
|
|
private |
◆ UpdateSimRPPos()
Definition at line 733 of file ALFA_GeometryReader.cxx.
737 HepGeom::Scale3D AuxScale;
762 HepGeom::Vector3D<double> NominalDetNormal=HepGeom::Vector3D<double>(0.0,0.0,1.0);
768 HepGeom::Point3D<double> RPPin1,MainPoint;
775 std::vector<HepGeom::Point3D<double> > VecIdealDetRefPoints(nCnt);
776 std::vector<HepGeom::Point3D<double> > VecRealDetRefPoints(nCnt);
779 VecIdealDetRefPoints[
i]=
m_RPPosParams[eRPName].VecIdealDetRefPoints[
i];
792 CLHEP::HepRotation RotationInMainPoint=Params.
DetSWTransform.getRotation();
◆ UpdateStationsPosParams()
void ALFA_GeometryReader::UpdateStationsPosParams |
( |
| ) |
|
|
private |
Definition at line 702 of file ALFA_GeometryReader.cxx.
706 HepGeom::Vector3D<double> MeanShift;
712 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
718 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
724 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
730 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
◆ m_ASPosParams
◆ m_ConfigOpts
◆ m_eFCoordSystem
◆ m_eMetrologyType
◆ m_ListExistingRPots
std::list<eRPotName> ALFA_GeometryReader::m_ListExistingRPots |
|
private |
◆ m_MapRPot
◆ m_RPPosParams
◆ ms_NominalAlfaRefPoint
const HepGeom::Point3D< double > ALFA_GeometryReader::ms_NominalAlfaRefPoint =HepGeom::Point3D<double>(-77.5*CLHEP::mm,-35.2*CLHEP::mm,114.0*CLHEP::mm) |
|
static |
◆ ms_NominalDetPin1
const HepGeom::Point3D< double > ALFA_GeometryReader::ms_NominalDetPin1 =HepGeom::Point3D<double>(-77.5*CLHEP::mm,-35.0*CLHEP::mm,114.0*CLHEP::mm) |
|
static |
◆ ms_NominalRPMainPoint
const HepGeom::Point3D< double > ALFA_GeometryReader::ms_NominalRPMainPoint =HepGeom::Point3D<double>(0.0*CLHEP::mm,31.525*CLHEP::mm,8.0*CLHEP::mm) |
|
static |
◆ ms_NominalRPPin1
const HepGeom::Point3D< double > ALFA_GeometryReader::ms_NominalRPPin1 =HepGeom::Point3D<double>(+77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm) |
|
static |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
void TransformFiberPositions(PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType)
HepGeom::Point3D< double > DTPInAlfaCS
bool ReadFile(const eRPotName eRPName, const eFiberType eFType, const char *szFilename)
HepGeom::Point3D< double > IdealMainPointInStation
int Init(const char *szFile, const char *szSection)
int dsvd(double **a, int m, int n, double *w, double **v)
const char * GetParameter(const char *szKey) const
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
std::list< FIBERPARAMS > ListODFibersU1
HepGeom::Point3D< double > IdealMainPoint
std::list< FIBERPARAMS > ListVFibers
HepGeom::Point3D< double > IdealRPPin3
HepGeom::Point3D< double > DCPInAlfaCS
void SetupCurrentLVDT(const PGEOMETRYCONFIGURATION pConfig)
bool ReadGeometry(const eRPotName eRPName, eFiberType eFType, const std::string &element, const std::string &tag, const std::string &node)
void SetupUserCorrections(const PGEOMETRYCONFIGURATION pConfig)
bool ReadDatabase(const eRPotName eRPName, const eFiberType eFType, const char *szDataSource)
#define INACTIVEDETEGDEDISTANCE
bool SetIdealGeometry(const eRPotName eRPName, const eFiberType eFType)
eFiberCoordSystem m_eFCoordSystem
HepGeom::Point3D< double > IdealRefPoint
void TransformFiberPositionsFCSAtlas(PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType)
const char * GetRPotLabel(const eRPotName eRPName)
std::list< FIBERPARAMS > ListODFibersU0
bool GetVFiberParams(PFIBERPARAMS pFiberParams, const eRPotName eRPName, const int nPlateID, const int nFiberID)
HepGeom::Point3D< double > IdealMainPoint
HepGeom::Transform3D ASTransformInATLAS
HepGeom::Point3D< double > GetDetPointInRPot(eRPotName eRPName, const HepGeom::Point3D< double > &PointInDetCS)
std::vector< HepGeom::Point3D< double > > VecRealRPRefPoints
bool ParseRefPoints(const char *szvalue, std::vector< HepGeom::Point3D< double > > &vecRefPoints, eMetrologyCoordSystem eCSystem)
HepGeom::Transform3D DetTransformInMainPoint
std::vector< HepGeom::Point3D< double > > VecIdealRPRefPoints
bool IsKey(const char *szKey) const
IMessageSvc * getMessageSvc(bool quiet=false)
std::string strODConnString
bool GetASPosParams(PASPOSPARAMS pRPosParams, const eAStationName eASName)
std::string strMDConnString
HepGeom::Transform3D UserTransformOfDetInRPot
double fMainRefPointSlope
std::map< eAStationName, ASPOSPARAMS > m_ASPosParams
void PrintFiberGeometry(std::ostream &OutStream)
std::list< FIBERDATA > m_ListFiberData
eMetrologyType m_eMetrologyType
struct CFGRPPOSPARAMS::@51 swcorr
bool bIsEnabledUserTranform
std::vector< HepGeom::Point3D< double > > VecIdealDetRefPoints
std::map< eRPotName, RPPOSPARAMS > m_RPPosParams
std::list< FIBERPARAMS > ListUFibers
bool ReadSource(const eGeoSourceType eSourceType, const eRPotName eRPName, const eFiberType eFType, const char *szDataSource)
HepGeom::Point3D< double > DCPInAtlasCS
HepGeom::Transform3D RPSWTransformInStation
HepGeom::Transform3D DetSWTransformInMainPoint
static const HepGeom::Point3D< double > ms_NominalDetPin1
void SetupSWCorrections(const PGEOMETRYCONFIGURATION pConfig)
HepGeom::Vector3D< double > ShiftE
HepGeom::Transform3D RPTransformInStation
HepGeom::Vector3D< double > ShiftS
bool SetupStationMetrologyPoints(ALFA_ConfigParams &CfgParams, eAStationName eASName)
Eigen::Affine3d Transform3D
HepGeom::Transform3D DetIdealTransformInMainPoint
static const HepGeom::Point3D< double > ms_NominalAlfaRefPoint
struct FIBERPARAMS::@46 fcs_cladding
HepGeom::Point3D< double > IdealRPPin1
HepGeom::Transform3D RPIdealTransformInStation
CFGRPPOSPARAMS CfgRPosParams[RPOTSCNT]
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
HepGeom::Point3D< float > MainRefPointPos
void Scale(TH1 *h, double d=1)
double atof(std::string_view str)
Converts a string into a double / float.
struct CFGRPPOSPARAMS::@52 usercorr
void fill(H5::Group &out_file, size_t iterations)
bool GetRPPosParams(PRPPOSPARAMS pRPosParams, const eRPotName eRPName)
std::list< eRPotName > m_ListExistingRPots
HepGeom::Point3D< double > GetDetPointInAtlas(eRPotName eRPName, const HepGeom::Point3D< double > &PointInDetCS)
static const HepGeom::Point3D< double > ms_NominalRPPin1
std::list< FIBERPARAMS > ListODFibersV1
std::list< FIBERPARAMS > ListODFibersV0
bool GetODFiberParams(PFIBERPARAMS pFiberParams, const eFiberType eFType, const eRPotName eRPName, const int nPlateID, const int nFiberID)
static const HepGeom::Point3D< double > ms_NominalRPMainPoint
HepGeom::Point3D< double > OriginOfDetSWTransform
HepGeom::Point3D< double > UserOriginOfDetTransInRPot
bool GetUFiberParams(PFIBERPARAMS pFiberParams, const eRPotName eRPName, const int nPlateID, const int nFiberID)
bool ParseRPMetrology(eGeoSourceType eSourceType, const char *szDataSource)
std::map< eRPotName, ROMAPOT > m_MapRPot
bool ReadFiberGeometry(const PGEOMETRYCONFIGURATION pConfig)
HepGeom::Transform3D UserTransformOfRPInStation
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
bool InitializeDefault(const PGEOMETRYCONFIGURATION pConfig)
HepGeom::Transform3D DetSWTransform
void TransformFiberPositionsFCSCladding(PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType)
struct FIBERPARAMS::@48 fcs_atlas_full
std::string strRPMetrologyConnString
constexpr int pow(int base, int exp) noexcept
bool SetupRPMetrologyPoints(ALFA_ConfigParams &CfgParams, eRPotName eRPName)
HepGeom::Transform3D ComputeTransformMatrix(const std::vector< HepGeom::Point3D< double > > &VecIdealRefPoints, const std::vector< HepGeom::Point3D< double > > &VecRealRefPoints, const int nPointCnt, HepGeom::Scale3D &Scale, bool bForceUseSVD=false)
HepGeom::Point3D< double > IdealRPPin2
void UpdateStationsPosParams()
bool SetupDetMetrologyPoints(ALFA_ConfigParams &CfgParams, eRPotName eRPName)
struct FIBERPARAMS::@47 fcs_atlas
double GetPolyFitValue(const double fInputValue, const std::vector< double > &vecPolyFitParams)
void UpdateSimRPPos(const eRPotName eRPName)
bool ParseArrayOfValues(const char *szvalue, std::vector< double > &vecValues)