|
ATLAS Offline Software
|
#include <ALFA_GeometryReader.h>
|
| ALFA_GeometryReader () |
|
| ~ALFA_GeometryReader () |
|
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 |
( |
| ) |
|
◆ ~ALFA_GeometryReader()
ALFA_GeometryReader::~ALFA_GeometryReader |
( |
| ) |
|
◆ 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 815 of file ALFA_GeometryReader.cxx.
819 const int N=nPointCnt;
820 CLHEP::HepVector vecAux1,vecAux2;
821 CLHEP::HepVector xmean,ymean,
t;
822 CLHEP::HepMatrix
C,U,V,
R,
W;
824 HepGeom::Rotate3D AuxRot;
825 HepGeom::Translate3D AuxTranslation;
828 if(nPointCnt==3 && !bForceUseSVD)
831 VecRealRefPoints[0],VecRealRefPoints[1],VecRealRefPoints[2]);
832 AuxTrans.getDecomposition(
Scale,AuxRot,AuxTranslation);
839 std::vector<CLHEP::HepVector> pX (
N);
840 std::vector<CLHEP::HepVector> pY (
N);
841 std::vector<CLHEP::HepVector> pXs (
N);
842 std::vector<CLHEP::HepVector> pYs(
N);
845 pX[
i]=CLHEP::Hep3Vector(VecIdealRefPoints[
i].
x(),VecIdealRefPoints[
i].
y(),VecIdealRefPoints[
i].
z());
846 pY[
i]=CLHEP::Hep3Vector(VecRealRefPoints[
i].
x(),VecRealRefPoints[
i].
y(),VecRealRefPoints[
i].
z());
850 vecAux1=CLHEP::Hep3Vector();
851 vecAux2=CLHEP::Hep3Vector();
857 xmean=vecAux1/(1.0*
N);
858 ymean=vecAux2/(1.0*
N);
860 C=CLHEP::HepMatrix(3,3);
864 C+=pYs[
i]*pXs[
i].T();
868 std::vector<double*> ppfA(3);
869 std::vector<double*> ppfV(3);
871 ppfA[
i]=
new double[3];
874 ppfV[
i]=
new double[3];
878 std::vector<double> pfW (3);
882 for(j=0;j<3;j++) ppfA[
i][j]=(
double)
C[
i][j];
885 dsvd(ppfA.data(),3,3,pfW.data(),ppfV.data());
887 U=CLHEP::HepMatrix(3,3); V=CLHEP::HepMatrix(3,3);
889 for(j=0;j<3;j++) U[
i][j]=(
double)ppfA[
i][j];
890 for(j=0;j<3;j++) V[
i][j]=(
double)ppfV[
i][j];
893 W=CLHEP::HepMatrix(3,3);
894 W[0][0]=1;
W[1][1]=1;
895 W[2][2]=(U*V).determinant();
901 CLHEP::HepRep3x3 matAux;
902 matAux.xx_=
R[0][0]; matAux.xy_=
R[0][1]; matAux.xz_=
R[0][2];
903 matAux.yx_=
R[1][0]; matAux.yy_=
R[1][1]; matAux.yz_=
R[1][2];
904 matAux.zx_=
R[2][0]; matAux.zy_=
R[2][1]; matAux.zz_=
R[2][2];
905 CLHEP::HepRotation TransM=CLHEP::HepRotation(matAux);
906 CLHEP::Hep3Vector TransT=CLHEP::Hep3Vector(
t[0],
t[1],
t[2]);
◆ GetASPosParams()
Definition at line 1853 of file ALFA_GeometryReader.cxx.
1860 pASPosParams->clear();
1862 *pASPosParams=(*iter).second;
1866 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 2725 of file ALFA_GeometryReader.cxx.
2733 HepGeom::Point3D<double> PointInAtlasCS, PointInRPotCS;
2738 HepGeom::Vector3D<double>
Shift=RPPin1-MainPoint;
2739 HepGeom::Point3D<double> PointInMainPoint=
Shift+AlfaRefPoint+PointInDetCS;
2742 PointInAtlasCS=TotTransform*PointInRPotCS;
2745 throw new GaudiException(
" The GetDetPointInAtlas() can be used only with EFCS_ATLAS or EFCS_CLADDING flag ",
"ALFA_GeometryReader::GetDetPointInAtlas", StatusCode::FAILURE);
2748 return PointInAtlasCS;
◆ GetDetPointInRPot()
HepGeom::Point3D< double > ALFA_GeometryReader::GetDetPointInRPot |
( |
eRPotName |
eRPName, |
|
|
const HepGeom::Point3D< double > & |
PointInDetCS |
|
) |
| |
Definition at line 2751 of file ALFA_GeometryReader.cxx.
2757 HepGeom::Point3D<double> PointInRPotCS;
2762 HepGeom::Vector3D<double>
Shift=RPPin1-MainPoint;
2763 HepGeom::Point3D<double> PointInMainPoint=
Shift+AlfaRefPoint+PointInDetCS;
2767 throw new GaudiException(
" The GetDetPointInAtlas() can be used only with EFCS_ATLAS or EFCS_CLADDING flag ",
"ALFA_GeometryReader::GetDetPointInAtlas", StatusCode::FAILURE);
2770 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 1814 of file ALFA_GeometryReader.cxx.
1816 std::string strLabel;
1817 std::map<eRPotName,ROMAPOT>::const_iterator rpiter;
1819 if(pMapRPotName!=
nullptr){
1820 pMapRPotName->clear();
1824 pMapRPotName->insert(std::pair<eRPotName,std::string>((*rpiter).first,strLabel));
◆ GetMDFiberOffset()
◆ GetMDFiberParams()
Definition at line 1889 of file ALFA_GeometryReader.cxx.
1895 if(pFiberParams==
nullptr)
1897 LogStream<<MSG::ERROR<<
"pFiberParams points to NULL"<<
endmsg;
1901 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1912 LogStream<<MSG::ERROR<<
"Invalid fiber type"<<
endmsg;
◆ GetMDFiberSlope()
◆ GetMDFiberZPos()
◆ GetODFiberAngle()
◆ GetODFiberCentreYPos()
◆ GetODFiberOffset()
◆ GetODFiberParams()
Definition at line 1921 of file ALFA_GeometryReader.cxx.
1924 std::list<FIBERPARAMS>::const_iterator iter;
1925 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1935 for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter)
1937 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1940 if (iter==(*rpiter).second.ListODFibersU0.end())
1942 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1946 *pFiberParams = *iter;
1954 for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter)
1956 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1959 if (iter==(*rpiter).second.ListODFibersV0.end())
1961 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1965 *pFiberParams = *iter;
1973 for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter)
1975 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1978 if (iter==(*rpiter).second.ListODFibersU1.end())
1980 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1984 *pFiberParams = *iter;
1992 for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter)
1994 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1997 if (iter==(*rpiter).second.ListODFibersV1.end())
1999 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2003 *pFiberParams = *iter;
2011 LogStream<<MSG::ERROR<<
"Unknown ODFiber eFType="<<eFType<<
endmsg;
2018 LogStream<<MSG::ERROR<<
"Unknown Roma pot PotID="<<eRPName<<
endmsg;
◆ GetODFiberSlope()
◆ GetODFiberZPos()
◆ GetPlateParams()
Definition at line 1516 of file ALFA_GeometryReader.cxx.
1525 if((pliter=(*rpiter).second.MapPlates.find(nPlateID))!=(*rpiter).second.MapPlates.end()){
1526 *pPlateParams=(*pliter).second;
1530 LogStream<<MSG::ERROR<<
"Unknown Ti plate ID "<<nPlateID<<
endmsg;
1534 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 2710 of file ALFA_GeometryReader.cxx.
2713 double fOutputValue=0.0;
2715 n=vecPolyFitParams.size();
2719 fOutputValue+=vecPolyFitParams[
i]*
pow(fInputValue,
n-1-
i);
2722 return fOutputValue;
◆ GetRPGeometryType()
◆ GetRPotCount()
int ALFA_GeometryReader::GetRPotCount |
( |
| ) |
const |
|
inline |
◆ GetRPotLabel()
◆ GetRPotZPosInAtlas()
double ALFA_GeometryReader::GetRPotZPosInAtlas |
( |
const eRPotName |
eRPName | ) |
|
◆ GetRPPosParams()
Definition at line 1834 of file ALFA_GeometryReader.cxx.
1841 pRPPosParams->clear();
1843 *pRPPosParams=(*iter).second;
1847 LogStream<<MSG::ERROR<<
"Unknown Roma pot ID="<<eRPName<<
endmsg;
◆ GetTransformMatrix()
Definition at line 2831 of file ALFA_GeometryReader.cxx.
2844 HepGeom::Vector3D<double> Shift1=RPPin1-MainPoint;
2845 HepGeom::Vector3D<double> Shift2=RPPin1-MainPoint+AlfaRefPoint;
2846 HepGeom::Vector3D<double> Shift3=0.5*(AParams.
ShiftE+AParams.
ShiftS);
2860 TransMatrix=HepGeom::Translate3D(-Shift1);
2863 TransMatrix=HepGeom::Translate3D(Shift2);
2866 TransMatrix=HepGeom::Translate3D(-Shift3);
2869 throw GaudiException(
" Invalid matrix identificator ",
"ALFA_GeometryReader::GetTransformMatrix", StatusCode::FAILURE);
◆ GetUFiberAngle()
◆ GetUFiberCentreXPos()
◆ GetUFiberParams()
Definition at line 1322 of file ALFA_GeometryReader.cxx.
1325 std::list<FIBERPARAMS>::const_iterator iter;
1326 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1331 for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1332 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1335 if(iter==(*rpiter).second.ListUFibers.end()){
1336 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1339 *pFiberParams = *iter;
1344 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ GetVFiberAngle()
◆ GetVFiberCentreXPos()
◆ GetVFiberParams()
Definition at line 1350 of file ALFA_GeometryReader.cxx.
1353 std::list<FIBERPARAMS>::const_iterator iter;
1354 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1359 for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1360 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1363 if(iter==(*rpiter).second.ListVFibers.end()) {
1364 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1368 *pFiberParams = *iter;
1373 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ Initialize()
Definition at line 634 of file ALFA_GeometryReader.cxx.
666 LogStream<<MSG::INFO<<
"Metrology data loaded from file "<<
FilePath<<
endmsg;
680 throw GaudiException(
" Unknown metrology type ",
"ALFA_GeometryReader::Initialize", StatusCode::FAILURE);
◆ InitializeDefault()
Definition at line 393 of file ALFA_GeometryReader.cxx.
407 strcpy(ASPosParams.
szLabel,
"B7L1");
413 strcpy(ASPosParams.
szLabel,
"A7L1");
419 strcpy(ASPosParams.
szLabel,
"A7R1");
425 strcpy(ASPosParams.
szLabel,
"B7R1");
433 strcpy(RPPosParams.
szLabel,
"B7L1U");
458 strcpy(RPPosParams.
szLabel,
"B7L1L");
483 strcpy(RPPosParams.
szLabel,
"A7L1U");
508 strcpy(RPPosParams.
szLabel,
"A7L1L");
533 strcpy(RPPosParams.
szLabel,
"A7R1U");
558 strcpy(RPPosParams.
szLabel,
"A7R1L");
583 strcpy(RPPosParams.
szLabel,
"B7R1U");
608 strcpy(RPPosParams.
szLabel,
"B7R1L");
◆ ParseArrayOfValues()
bool ALFA_GeometryReader::ParseArrayOfValues |
( |
const char * |
szvalue, |
|
|
std::vector< double > & |
vecValues |
|
) |
| |
|
private |
Definition at line 2489 of file ALFA_GeometryReader.cxx.
2493 char *ppos1,*ppos2,*pstop;
2497 memset(szbuff,0,
sizeof(szbuff));
2498 if(szvalue) strncpy(szbuff,szvalue,
sizeof(szbuff)-1);
2501 ppos2=strchr(ppos1,
',');
2503 while(ppos2!=
nullptr){
2506 faux=strtod(ppos1,&pstop);
2507 if(pstop==ppos2) vecValues.push_back(faux);
2514 ppos2=strchr(ppos1,
',');
2518 faux=strtod(ppos1,&pstop);
2519 if(*pstop==0) vecValues.push_back(faux);
2523 if(!bRes) vecValues.clear();
◆ ParseRefPoints()
bool ALFA_GeometryReader::ParseRefPoints |
( |
const char * |
szvalue, |
|
|
std::vector< HepGeom::Point3D< double > > & |
vecRefPoints, |
|
|
eMetrologyCoordSystem |
eCSystem |
|
) |
| |
|
private |
Definition at line 2412 of file ALFA_GeometryReader.cxx.
2414 double fx{},fy{},fz{},faux{};
2415 char *ppos1,*ppos2,*ppos3,*ppos4,*pstop;
2417 HepGeom::Point3D<double> RefPoint;
2420 if (strlen(szvalue) <513){
2421 strcpy(szbuff,szvalue);
2423 LogStream<<MSG::ERROR<<
"String too long for buffer."<<
endmsg;
2428 while((ppos1=strchr(ppos2,
'['))!=
nullptr){
2429 if(!(ppos2=strchr(ppos1+1,
']')))
return false;
2434 if(nCnt==0)
return false;
2435 vecRefPoints.resize(nCnt);
2439 while((ppos1=strchr(ppos2,
'['))!=
nullptr){
2440 if(!(ppos2=strchr(ppos1,
']')))
return false;
2444 if(!(ppos4=strchr(ppos3+1,
',')))
return false;
2446 faux=strtod(ppos3,&pstop);
2447 if(pstop!=ppos4 && *pstop!=
' ')
return false;
2452 if(!(ppos4=strchr(ppos3+1,
',')))
return false;
2454 faux=strtod(ppos3,&pstop);
2455 if(pstop!=ppos4 && *pstop!=
' ')
return false;
2460 if(!(ppos4=strchr(ppos3+1,
']')))
return false;
2462 faux=strtod(ppos3,&pstop);
2463 if(pstop!=ppos4 && *pstop!=
' ')
return false;
2468 RefPoint[0]=fx; RefPoint[1]=fy; RefPoint[2]=fz;
2471 RefPoint[0]=fx; RefPoint[1]=fz; RefPoint[2]=-fy;
2474 RefPoint[0]=fx; RefPoint[1]=-fz; RefPoint[2]=fy;
2477 RefPoint[0]=fx; RefPoint[1]=fy; RefPoint[2]=fz;
2479 else throw new GaudiException(
"Invalid type of metrology coordinate system",
"ALFA_GeometryReader::ParseRefPoints", StatusCode::FAILURE);
2481 vecRefPoints[
i++]=RefPoint;
◆ ParseRPMetrology()
bool ALFA_GeometryReader::ParseRPMetrology |
( |
eGeoSourceType |
eSourceType, |
|
|
const char * |
szDataSource |
|
) |
| |
|
private |
Definition at line 2319 of file ALFA_GeometryReader.cxx.
2330 if(CfgParams.
Init(szDataSource,
"[B7L1]")==0)
return false;
2333 if(CfgParams.
Init(szDataSource,
"[A7L1]")==0)
return false;
2336 if(CfgParams.
Init(szDataSource,
"[A7R1]")==0)
return false;
2339 if(CfgParams.
Init(szDataSource,
"[B7R1]")==0)
return false;
2344 if(CfgParams.
Init(szDataSource,
"[B7L1U]")==0)
return false;
2349 if(CfgParams.
Init(szDataSource,
"[B7L1L]")==0)
return false;
2354 if(CfgParams.
Init(szDataSource,
"[A7L1U]")==0)
return false;
2359 if(CfgParams.
Init(szDataSource,
"[A7L1L]")==0)
return false;
2364 if(CfgParams.
Init(szDataSource,
"[A7R1U]")==0)
return false;
2369 if(CfgParams.
Init(szDataSource,
"[A7R1L]")==0)
return false;
2374 if(CfgParams.
Init(szDataSource,
"[B7R1U]")==0)
return false;
2379 if(CfgParams.
Init(szDataSource,
"[B7R1L]")==0)
return false;
2387 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 1548 of file ALFA_GeometryReader.cxx.
1551 std::list<FIBERPARAMS>::const_iterator iter;
1552 std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1558 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1563 OutStream<<std::endl<<
"Geometry of U-fibers in Roma Pot "<<(*rpiter).first<<std::endl;
1567 for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1568 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";
1573 OutStream<<std::endl<<
"Geometry of V-fibers in Roma Pot "<<(*rpiter).first<<std::endl;
1577 for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1578 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";
1583 OutStream<<std::endl<<
"Geometry of V0-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1587 for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter){
1588 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";
1593 OutStream<<std::endl<<
"Geometry of U0-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1597 for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter){
1598 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";
1603 OutStream<<std::endl<<
"Geometry of U1-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1607 for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter){
1608 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";
1613 OutStream<<std::endl<<
"Geometry of V1-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1617 for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter){
1618 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 1234 of file ALFA_GeometryReader.cxx.
1242 std::vector<std::string> strDBElements;
1246 memset(szSource,0,
sizeof(szSource));
1247 if(szDataSource) strncpy(szSource, szDataSource,
sizeof(szSource)-1);
1248 char* strtok_ptr =
nullptr;
1249 pch = strtok_r(szSource,
":",&strtok_ptr);
1250 while (pch !=
nullptr)
1252 strDBElements.emplace_back(pch);
1253 pch = strtok_r(
nullptr,
":",&strtok_ptr);
1259 bRes = p_DBAccess->
ReadGeometry(eRPName, eFType, strDBElements[2], strDBElements[1], strDBElements[0]);
1270 m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1276 std::list<FIBERDATA>::const_iterator iter;
1279 if (eRPName == (*iter).nPotID)
1283 FiberParams.
nLayerID = (*iter).nLayerID;
1284 FiberParams.
nFiberID = (*iter).nFiberID;
1285 FiberParams.
fSlope = (*iter).fSlope;
1286 FiberParams.
fOffset = (*iter).fOffset;
1287 FiberParams.
fZPos = (*iter).fZPos;
◆ ReadFiberGeometry()
Definition at line 918 of file ALFA_GeometryReader.cxx.
922 std::list<eRPotName>::const_iterator iterRPName;
930 nRPCfgIndex=((
int)(*iterRPName))-1;
◆ ReadFile()
Definition at line 1088 of file ALFA_GeometryReader.cxx.
1093 int i,nLine,nLength;
1111 m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1117 if((pFile=fopen(szFilename,
"r"))==
nullptr){
1118 LogStream<<MSG::ERROR<<
"Could not open the file "<<szFilename<<
endmsg;
1123 while(!feof(pFile)){
1124 if(fgets(szLine,
sizeof(szLine),pFile)!=
nullptr){
1129 if(nLine<6)
continue;
1131 nLength=strlen(szLine);
1134 for(
i=0;
i<nLength;
i++) {
if(*(szLine+
i)==
' ')
continue;
else break; }
1136 pch2=strchr(pch1,
' ');
1143 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1150 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break;}
1152 pch2=strchr(pch1,
' ');
1158 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1165 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break; }
1167 pch2=strchr(pch1,
' ');
1173 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1180 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break; }
1182 pch2=strchr(pch1,
' ');
1188 LogStream<<MSG::ERROR<<
"Error at line "<<nLine<<
" while reading the data file "<<szFilename<<
endmsg;
1195 for(
i=0;
i<nLength;
i++) {
if(*(pch2+
i)==
' ')
continue;
else break; }
1228 if(pFile) fclose(pFile);
◆ ReadSource()
Definition at line 946 of file ALFA_GeometryReader.cxx.
950 std::string strDetType,
FilePath, GeomFile;
959 LogStream<<MSG::INFO<<
"The IDEAL "<<strDetType<<
" fiber geometry will be loaded for RP "<<
GetRPotLabel(eRPName)<<
endmsg;
964 GeomFile=std::string(
"geom_")+strDetType+std::string(
"_")+std::string(
GetRPotLabel(eRPName))+std::string(
".dat");
966 else FilePath=std::string(szDataSource);
968 LogStream<<MSG::INFO<<
"The "<<strDetType<<
" fiber geometry will be loaded from FILE "<<
FilePath.c_str()<<
" for RP "<<
GetRPotLabel(eRPName)<<
endmsg;
972 LogStream<<MSG::INFO<<
"The "<<strDetType<<
" fiber geometry will be loaded from DATABASE for RP "<<
GetRPotLabel(eRPName)<<
endmsg;
983 m_MapRPot[eRPName].MapPlates.insert(std::pair<int,PLATEPARAMS>(
i,PlateParams));
987 m_MapRPot[eRPName].MapODPlates.insert(std::pair<int,PLATEPARAMS>(
i,PlateParams));
997 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 2774 of file ALFA_GeometryReader.cxx.
2777 double fRotX,fRotY,fRotZ;
2779 FILE *
pfile=fopen(szDataDestination,
"w");
2782 fprintf(
pfile,
"Romain pot geometry info: ----------------------------------------\r\n");
2786 fprintf(
pfile,
"Transformation matrix of RP in station MainPoint:\r\n");
2794 fprintf(
pfile,
"RotX=%.5f rad, RotY=%.5f rad, RotZ=%.5f rad\r\n",fRotX,fRotY,fRotZ);
2797 fprintf(
pfile,
"\r\nDetector geometry info: ------------------------------------------\r\n");
2798 fprintf(
pfile,
"Transformation matrix of detector in RP MainPoint:\r\n");
2806 fprintf(
pfile,
"RotX=%.5f rad, RotY=%.5f rad, RotZ=%.5f rad\r\n",fRotX,fRotY,fRotZ);
2808 fprintf(
pfile,
"\r\nReference pins and Track point info: ------------------------------------------\r\n");
2809 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(),
2811 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(),
2813 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(),
2815 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(),
2818 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 1003 of file ALFA_GeometryReader.cxx.
1023 m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1063 m_MapRPot[eRPName].ListODFibersV0.push_back(FiberParams);
1068 m_MapRPot[eRPName].ListODFibersV1.push_back(FiberParams);
1074 m_MapRPot[eRPName].ListODFibersU0.push_back(FiberParams);
1079 m_MapRPot[eRPName].ListODFibersU1.push_back(FiberParams);
◆ SetODFiberPositionToMainReference()
Definition at line 2024 of file ALFA_GeometryReader.cxx.
2029 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::SetODFiberPositionToMainReference");
2032 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
2042 for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter)
2044 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2047 if (iter==(*rpiter).second.ListODFibersU0.end())
2049 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2054 (*iter).MainRefPointPos=TransPoint;
2055 (*iter).fMainRefPointSlope=fTransSlope;
2062 for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter)
2064 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2067 if (iter==(*rpiter).second.ListODFibersV0.end())
2069 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV0 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2073 (*iter).MainRefPointPos=TransPoint;
2074 (*iter).fMainRefPointSlope=fTransSlope;
2081 for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter)
2083 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2086 if (iter==(*rpiter).second.ListODFibersU1.end())
2088 LogStream<<MSG::ERROR<<
"Cannot find ODFiberU1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2092 (*iter).MainRefPointPos=TransPoint;
2093 (*iter).fMainRefPointSlope=fTransSlope;
2100 for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter)
2102 if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
2105 if (iter==(*rpiter).second.ListODFibersV1.end())
2107 LogStream<<MSG::ERROR<<
"Cannot find ODFiberV1 PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
2111 (*iter).MainRefPointPos=TransPoint;
2112 (*iter).fMainRefPointSlope=fTransSlope;
2119 LogStream<<MSG::ERROR<<
"Unknown ODFiber eFType="<<eFType<<
endmsg;
2126 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 1452 of file ALFA_GeometryReader.cxx.
1458 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::SetUFiberPositionToMainReference");
1461 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1466 for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1467 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1470 if(iter==(*rpiter).second.ListUFibers.end()) {
1471 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1475 (*iter).MainRefPointPos=TransPoint;
1476 (*iter).fMainRefPointSlope=fTransSlope;
1480 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ SetupCurrentLVDT()
◆ SetupDetMetrologyPoints()
Definition at line 2528 of file ALFA_GeometryReader.cxx.
2537 double xr1,yr1,xr2,yr2;
2538 HepGeom::Point3D<double> PointIdealD3, PointRealD3;
2539 HepGeom::Point3D<double> PointIdealD4, PointRealD4;
2540 HepGeom::Point3D<double> PointIdealD5, PointRealD5;
2542 std::vector<double> vecDetEdges;
2543 std::vector<HepGeom::Point3D<double> > vecNominalDetPoints;
2544 std::vector<HepGeom::Point3D<double> > vecRealDetPoints;
2547 if(!CfgParams.
IsKey(
"idealrefdetpoints"))
return false;
2549 if(!CfgParams.
IsKey(
"realrefdetpoints"))
return false;
2552 if(!CfgParams.
IsKey(
"realdetedgeypos"))
return false;
2555 fZc=0.5*(vecDetEdges[0]+vecDetEdges[1]);
2556 PointIdealD3=HepGeom::Point3D<double>(10.0,0.0,0.0);
2557 PointIdealD4=HepGeom::Point3D<double>(0.0,10.0,0.0);
2558 PointIdealD5=HepGeom::Point3D<double>(0.0,0.0,10.0);
2561 xp1=vecNominalDetPoints[0].x();
2562 yp1=vecNominalDetPoints[0].y();
2565 xr1=vecRealDetPoints[0].x();
2566 yr1=vecRealDetPoints[0].y();
2567 xr2=vecRealDetPoints[1].x();
2568 yr2=vecRealDetPoints[1].y();
2571 double alpha=-
atan((xr2-xr1)/(yr2-yr1));
2581 CorrectionInDetPin1=HepGeom::Translate3D(a3,a4,fZc-113.0*
CLHEP::mm)*HepGeom::RotateZ3D(alpha);
2588 HepGeom::Vector3D<double> OriginShift=RPPin1+DetPin1-MainPoint;
2590 CLHEP::Hep3Vector TranslationInMainPoint=CorrectionInDetPin1.getTranslation()-CorrectionInDetPin1*OriginShift+OriginShift;
2592 CLHEP::HepRotation RotationInMainPoint=CorrectionInDetPin1.getRotation();
2595 PointRealD3=CorrectionInMainPoint*PointIdealD3;
2596 PointRealD4=CorrectionInMainPoint*PointIdealD4;
2597 PointRealD5=CorrectionInMainPoint*PointIdealD5;
2602 m_RPPosParams[eRPName].VecIdealDetRefPoints[0]=std::move(PointIdealD5);
2603 m_RPPosParams[eRPName].VecRealDetRefPoints[0]=std::move(PointRealD5);
2605 m_RPPosParams[eRPName].VecIdealDetRefPoints[1]=std::move(PointIdealD4);
2606 m_RPPosParams[eRPName].VecRealDetRefPoints[1]=std::move(PointRealD4);
2608 m_RPPosParams[eRPName].VecIdealDetRefPoints[2]=std::move(PointIdealD3);
2609 m_RPPosParams[eRPName].VecRealDetRefPoints[2]=std::move(PointRealD3);
◆ SetupRPMetrologyPoints()
Definition at line 2614 of file ALFA_GeometryReader.cxx.
2620 double fCurrentLVDTmm;
2621 HepGeom::Point3D<double> PSinStation, RPPinNominal;
2622 double fCurrentLVDT=0.0;
2623 std::vector<double> vecPolyFitParams;
2624 std::vector<HepGeom::Point3D<double> > vecPSinRPCS;
2625 std::vector<HepGeom::Point3D<double> > vecNominalPSinStationCS;
2626 std::vector<HepGeom::Point3D<double> > vecRealPSinStationCS;
2637 vecNominalPSinStationCS.resize(nCnt);
2638 vecRealPSinStationCS.resize(nCnt);
2641 if(!CfgParams.
IsKey(
"psinrpss"))
return false;
2645 for(
i=0;
i<nCnt;
i++){
2646 vecNominalPSinStationCS[
i]=RPPinNominal+HepGeom::RotateX3D(RPPosParams.
bIsLow? 180*
CLHEP::deg:0.0)*vecPSinRPCS[
i];
2663 PSinStation.set(fx,fy,fz);
2664 vecRealPSinStationCS[0]=PSinStation;
2672 PSinStation.set(fx,fy,fz);
2673 vecRealPSinStationCS[1]=PSinStation;
2681 PSinStation.set(fx,fy,fz);
2682 vecRealPSinStationCS[2]=std::move(PSinStation);
2685 m_RPPosParams[eRPName].VecIdealRPRefPoints=std::move(vecNominalPSinStationCS);
2686 m_RPPosParams[eRPName].VecRealRPRefPoints=std::move(vecRealPSinStationCS);
◆ SetupStationMetrologyPoints()
Definition at line 2693 of file ALFA_GeometryReader.cxx.
2695 std::vector<HepGeom::Point3D<double> > vecShiftPoints;
2698 if(!CfgParams.
IsKey(
"shifte"))
return false;
2703 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 1484 of file ALFA_GeometryReader.cxx.
1490 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::SetVFiberPositionToMainReference");
1493 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1498 for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1499 if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID))
break;
1502 if(iter==(*rpiter).second.ListVFibers.end()){
1503 LogStream<<MSG::ERROR<<
"Cannot find fiber PotID="<<eRPName<<
", PlateID="<<nPlateID<<
" and FiberID="<<nFiberID<<
endmsg;
1507 (*iter).MainRefPointPos=TransPoint;
1508 (*iter).fMainRefPointSlope=fTransSlope;
1512 LogStream<<MSG::ERROR<<
"Unknown Roman pot PotID="<<eRPName<<
endmsg;
◆ StoreReconstructionGeometry()
Definition at line 1625 of file ALFA_GeometryReader.cxx.
1628 double fParamB, fY, fX, fZ, fSlope;
1635 LogStream<<MSG::ERROR<<
"Invalid coordinate system"<<
endmsg;
1639 pFile = fopen(szDataDestination,
"w");
1640 if(pFile==
nullptr)
return false;
1642 fprintf(pFile,
"xxxxxxxxxxxxxxxxxxx\n");
1647 fprintf(pFile,
"20\n");
1659 fParamB=fY-fSlope*fX;
1667 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2-1), j, fSlope, fParamB, fZ);
1680 fParamB=fY-fSlope*fX;
1688 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2), j, fSlope, fParamB, fZ);
1695 fprintf(pFile,
"6\n");
1709 fParamB=fY-fSlope*fX;
1717 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2-1), j, fSlope, fParamB, fZ);
1731 fParamB=fY-fSlope*fX;
1739 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2-1), j, fSlope, fParamB, fZ);
1753 fParamB=fY-fSlope*fX;
1760 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2), j, fSlope, fParamB, fZ);
1775 fParamB=fY-fSlope*fX;
1782 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (
i*2), j, fSlope, fParamB, fZ);
◆ TransformFiberPositions()
◆ TransformFiberPositionsFCSAtlas()
Definition at line 266 of file ALFA_GeometryReader.cxx.
273 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::TransformFiberPositionsFCSAtlas");
274 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};
275 static constexpr std::array<double,3> OD_stagger{0.0, -0.167, -0.334};
276 static constexpr
double fSCY=-126.3765+0.0045;
278 static constexpr
double fSCY_ODFiberU=-106.333;
279 static constexpr
double fSCY_ODFiberV=-113.833;
281 double fCentrePos=0.0, fZOffset=0.0;
293 pFiberParams->
fOffset=-1.414213562*fCentrePos+fSCY-fStagger;
297 pFiberParams->
fOffset=+1.414213562*fCentrePos+fSCY+fStagger;
307 if(
const auto i = pFiberParams->
nPlateID; (
i<1) || (
i>3)){
308 LogStream<<MSG::ERROR<<
"(EFT_ODFIBERV1): Wrong ODPlateID "<<
i<<
" (RP no."<<eRPName<<
")"<<
endmsg;
318 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberV+fStagger;
322 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberV+fStagger;
331 if(
const auto i = pFiberParams->
nPlateID; (
i<1) || (
i>3)){
332 LogStream<<MSG::ERROR<<
"(EFT_ODFIBERU1): Wrong ODPlateID "<<
i<<
" (RP no."<<eRPName<<
")"<<
endmsg;
341 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberU+fStagger;
345 pFiberParams->
fOffset=fCentrePos+fSCY_ODFiberU+fStagger;
357 HepGeom::Point3D<double> DetFiberPoint1, DetFiberPoint2, DetPin1Point;
358 HepGeom::Point3D<double> AtlFiberPoint1, AtlFiberPoint2, AtlDetPin1Point;
359 HepGeom::Point3D<double> AtlProjFiberPoint1, AtlProjFiberPoint2;
361 DetPin1Point=HepGeom::Point3D<double>(0.0,0.0,0.0);
362 DetFiberPoint1=HepGeom::Point3D<double>(0.0,pFiberParams->
fOffset,(RPPosParams.
bIsLow)? -fZOffset:+fZOffset);
363 DetFiberPoint2=HepGeom::Point3D<double>(-pFiberParams->
fOffset/pFiberParams->
fSlope,0.0,(RPPosParams.
bIsLow)? -fZOffset:+fZOffset);
369 AtlProjFiberPoint1=HepGeom::Point3D<double>(AtlFiberPoint1[0],AtlFiberPoint1[1],AtlDetPin1Point[2]+fZOffset);
370 AtlProjFiberPoint2=HepGeom::Point3D<double>(AtlFiberPoint2[0],AtlFiberPoint2[1],AtlDetPin1Point[2]+fZOffset);
372 double fx2=AtlProjFiberPoint1[0]+AtlProjFiberPoint1[1]*(AtlProjFiberPoint2[0]-AtlProjFiberPoint1[0])/(AtlProjFiberPoint1[1]-AtlProjFiberPoint2[1]);
373 double fy1=AtlProjFiberPoint1[1]+AtlProjFiberPoint1[0]*(AtlProjFiberPoint2[1]-AtlProjFiberPoint1[1])/(AtlProjFiberPoint1[0]-AtlProjFiberPoint2[0]);
380 HepGeom::Vector3D<double> DirVector=AtlFiberPoint2-AtlFiberPoint1;
◆ TransformFiberPositionsFCSCladding()
Definition at line 135 of file ALFA_GeometryReader.cxx.
137 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};
138 static constexpr std::array<double,3> OD_stagger{0.0, -0.167, -0.334};
139 static constexpr
double fSCY=-126.3765+0.0045;
141 static constexpr
double fSCY_ODFiberU=-106.333;
142 static constexpr
double fSCY_ODFiberV=-113.833;
144 static constexpr
double fSCX_ODFiber00=-23.00;
145 static constexpr
double fSCX_ODFiber01=+23.00;
149 MsgStream LogStream(
Athena::getMessageSvc(),
"ALFA_GeometryReader::TransformFiberPositionsFCSCladding");
156 LogStream<<MSG::ERROR<<
"(EFT_VFIBER): Wrong PlateID "<<pFiberParams->
nPlateID<<
" (RP no."<<eRPName<<
")"<<
endmsg;
166 if(
const auto i = pFiberParams->
nPlateID; (
i<1) || (
i>3)){
167 LogStream<<MSG::ERROR<<
"(EFT_ODFIBERV1): Wrong ODPlateID "<<
i<<
" (RP no."<<eRPName<<
")"<<
endmsg;
◆ UpdateGeometry()
void ALFA_GeometryReader::UpdateGeometry |
( |
| ) |
|
|
private |
◆ UpdateSimRPPos()
Definition at line 744 of file ALFA_GeometryReader.cxx.
748 HepGeom::Scale3D AuxScale;
773 HepGeom::Vector3D<double> NominalDetNormal=HepGeom::Vector3D<double>(0.0,0.0,1.0);
779 HepGeom::Point3D<double> RPPin1,MainPoint;
786 std::vector<HepGeom::Point3D<double> > VecIdealDetRefPoints(nCnt);
787 std::vector<HepGeom::Point3D<double> > VecRealDetRefPoints(nCnt);
790 VecIdealDetRefPoints[
i]=
m_RPPosParams[eRPName].VecIdealDetRefPoints[
i];
803 CLHEP::HepRotation RotationInMainPoint=Params.
DetSWTransform.getRotation();
◆ UpdateStationsPosParams()
void ALFA_GeometryReader::UpdateStationsPosParams |
( |
| ) |
|
|
private |
Definition at line 713 of file ALFA_GeometryReader.cxx.
717 HepGeom::Vector3D<double> MeanShift;
723 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
729 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
735 m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
741 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
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)