ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ALFA_GeometryReader Class Reference

#include <ALFA_GeometryReader.h>

Collaboration diagram for ALFA_GeometryReader:

Public Member Functions

 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)
 

Public Attributes

std::map< eRPotName, RPPOSPARAMSm_RPPosParams
 
std::map< eAStationName, ASPOSPARAMSm_ASPosParams
 

Static Public Attributes

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)
 

Private Member Functions

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)
 

Private Attributes

eFiberCoordSystem m_eFCoordSystem
 
GEOMETRYCONFIGURATION m_ConfigOpts
 
eMetrologyType m_eMetrologyType
 
std::map< eRPotName, ROMAPOTm_MapRPot
 
std::list< eRPotNamem_ListExistingRPots
 

Detailed Description

Definition at line 214 of file ALFA_GeometryReader.h.

Constructor & Destructor Documentation

◆ ALFA_GeometryReader()

ALFA_GeometryReader::ALFA_GeometryReader ( )

Definition at line 108 of file ALFA_GeometryReader.cxx.

109 {
112  m_MapRPot.clear();
113 }

◆ ~ALFA_GeometryReader()

ALFA_GeometryReader::~ALFA_GeometryReader ( )

Definition at line 115 of file ALFA_GeometryReader.cxx.

116 {
117  m_MapRPot.clear();
118 }

Member Function Documentation

◆ 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.

817 {
818  int i,j;
819  const int N=nPointCnt;
820  CLHEP::HepVector vecAux1,vecAux2;
821  CLHEP::HepVector xmean,ymean,t;
822  CLHEP::HepMatrix C,U,V,R,W;
823  HepGeom::Transform3D TransTot;
824  HepGeom::Rotate3D AuxRot;
825  HepGeom::Translate3D AuxTranslation;
826 
827 
828  if(nPointCnt==3 && !bForceUseSVD)
829  {
830  HepGeom::Transform3D AuxTrans=HepGeom::Transform3D(VecIdealRefPoints[0],VecIdealRefPoints[1],VecIdealRefPoints[2],
831  VecRealRefPoints[0],VecRealRefPoints[1],VecRealRefPoints[2]);
832  AuxTrans.getDecomposition(Scale,AuxRot,AuxTranslation);
833 
834  TransTot=HepGeom::Transform3D(AuxTrans.getRotation(),AuxTrans.getTranslation());
835 
836  }
837  else
838  {
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);
843 
844  for(i=0;i<N;i++){
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());
847  }
848 
849 
850  vecAux1=CLHEP::Hep3Vector();
851  vecAux2=CLHEP::Hep3Vector();
852  for(i=0;i<N;i++){
853  vecAux1+=pX[i];
854  vecAux2+=pY[i];
855  }
856 
857  xmean=vecAux1/(1.0*N);
858  ymean=vecAux2/(1.0*N);
859 
860  C=CLHEP::HepMatrix(3,3);
861  for(i=0;i<N;i++){
862  pXs[i]=pX[i]-xmean;
863  pYs[i]=pY[i]-ymean;
864  C+=pYs[i]*pXs[i].T();
865  }
866 
867 
868  std::vector<double*> ppfA(3);
869  std::vector<double*> ppfV(3);
870  for(i=0;i<3;i++){
871  ppfA[i]=new double[3];
872  std::fill (ppfA[i], ppfA[i]+3, 0);
873 
874  ppfV[i]=new double[3];
875  std::fill (ppfV[i], ppfV[i]+3, 0);
876  }
877 
878  std::vector<double> pfW (3);
879 
880 
881  for(i=0;i<3;i++){
882  for(j=0;j<3;j++) ppfA[i][j]=(double)C[i][j];
883  }
884 
885  dsvd(ppfA.data(),3,3,pfW.data(),ppfV.data());
886 
887  U=CLHEP::HepMatrix(3,3); V=CLHEP::HepMatrix(3,3);
888  for(i=0;i<3;i++){
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];
891  }
892 
893  W=CLHEP::HepMatrix(3,3);
894  W[0][0]=1; W[1][1]=1;
895  W[2][2]=(U*V).determinant();
896 
897  R=U*W*V.T();
898  t=ymean-R*xmean;
899 
900 
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]);
907  TransTot=HepGeom::Transform3D(TransM,TransT);
908 
909  for(i=0;i<3;i++){
910  delete [] ppfA[i];
911  delete [] ppfV[i];
912  }
913  }
914 
915  return TransTot;
916 }

◆ GetASPosParams()

bool ALFA_GeometryReader::GetASPosParams ( PASPOSPARAMS  pRPosParams,
const eAStationName  eASName 
)

Definition at line 1853 of file ALFA_GeometryReader.cxx.

1854 {
1855  bool bRes=false;
1857 
1858  MsgStream LogStream(Athena::getMessageSvc(),"ALFA_GeometryReader::GetASPosParams");
1859 
1860  pASPosParams->clear();
1861  if((iter=m_ASPosParams.find(eASName))!=m_ASPosParams.end()){
1862  *pASPosParams=(*iter).second;
1863  bRes=true;
1864  }
1865  else{
1866  LogStream<<MSG::ERROR<<"Unknown ALFA Station ID="<<eASName<<endmsg;
1867  }
1868 
1869  return bRes;
1870 }

◆ GetAStationLabel()

const char* ALFA_GeometryReader::GetAStationLabel ( const eAStationName  eASName)
inline

Definition at line 279 of file ALFA_GeometryReader.h.

279 { return m_ASPosParams[eASName].szLabel; }

◆ GetDetPointInAtlas()

HepGeom::Point3D< double > ALFA_GeometryReader::GetDetPointInAtlas ( eRPotName  eRPName,
const HepGeom::Point3D< double > &  PointInDetCS 
)

Definition at line 2725 of file ALFA_GeometryReader.cxx.

2726 {
2727  RPPOSPARAMS RPPosParams;
2728  ASPOSPARAMS ASPosParams;
2729 
2730  HepGeom::Point3D<double> RPPin1=ms_NominalRPPin1;//HepGeom::Point3D<double>(+77.5*mm,+172.2*mm,-114.0*mm);
2731  HepGeom::Point3D<double> MainPoint=ms_NominalRPMainPoint;//HepGeom::Point3D<double>(0.0*mm,31.025*mm,18.0*mm);
2732  HepGeom::Point3D<double> AlfaRefPoint=ms_NominalAlfaRefPoint;//HepGeom::Point3D<double>(-77.5*mm,-35.7*mm,114.0*mm);
2733  HepGeom::Point3D<double> PointInAtlasCS, PointInRPotCS;
2734 
2736  GetRPPosParams(&RPPosParams, eRPName);
2737  GetASPosParams(&ASPosParams, RPPosParams.eASName);
2738  HepGeom::Vector3D<double> Shift=RPPin1-MainPoint;
2739  HepGeom::Point3D<double> PointInMainPoint=Shift+AlfaRefPoint+PointInDetCS;
2740  HepGeom::Point3D<double> PointInRPotCS=RPPosParams.DetTransformInMainPoint*PointInMainPoint; //wrt. MainPoint
2741  HepGeom::Transform3D TotTransform=ASPosParams.ASTransformInATLAS*RPPosParams.RPTransformInStation;
2742  PointInAtlasCS=TotTransform*PointInRPotCS;
2743  }
2744  else{
2745  throw new GaudiException(" The GetDetPointInAtlas() can be used only with EFCS_ATLAS or EFCS_CLADDING flag ", "ALFA_GeometryReader::GetDetPointInAtlas", StatusCode::FAILURE);
2746  }
2747 
2748  return PointInAtlasCS;
2749 }

◆ GetDetPointInRPot()

HepGeom::Point3D< double > ALFA_GeometryReader::GetDetPointInRPot ( eRPotName  eRPName,
const HepGeom::Point3D< double > &  PointInDetCS 
)

Definition at line 2751 of file ALFA_GeometryReader.cxx.

2752 {
2753  RPPOSPARAMS RPPosParams;
2754  HepGeom::Point3D<double> RPPin1=ms_NominalRPPin1;
2755  HepGeom::Point3D<double> MainPoint=ms_NominalRPMainPoint;
2756  HepGeom::Point3D<double> AlfaRefPoint=ms_NominalAlfaRefPoint;
2757  HepGeom::Point3D<double> PointInRPotCS;
2758 
2760  GetRPPosParams(&RPPosParams, eRPName);
2761 
2762  HepGeom::Vector3D<double> Shift=RPPin1-MainPoint;
2763  HepGeom::Point3D<double> PointInMainPoint=Shift+AlfaRefPoint+PointInDetCS;
2764  PointInRPotCS=RPPosParams.DetTransformInMainPoint*PointInMainPoint-Shift; // wrt. RPPin1
2765  }
2766  else{
2767  throw new GaudiException(" The GetDetPointInAtlas() can be used only with EFCS_ATLAS or EFCS_CLADDING flag ", "ALFA_GeometryReader::GetDetPointInAtlas", StatusCode::FAILURE);
2768  }
2769 
2770  return PointInRPotCS;
2771 }

◆ GetListOfExistingRPotIDs()

void ALFA_GeometryReader::GetListOfExistingRPotIDs ( std::list< eRPotName > *  pListRPotName)

Definition at line 1829 of file ALFA_GeometryReader.cxx.

1830 {
1831  *pListRPotName=m_ListExistingRPots;
1832 }

◆ GetListOfRPotIDs()

void ALFA_GeometryReader::GetListOfRPotIDs ( std::map< eRPotName, std::string > *  pMapRPotName)

Definition at line 1814 of file ALFA_GeometryReader.cxx.

1815 {
1816  std::string strLabel;
1817  std::map<eRPotName,ROMAPOT>::const_iterator rpiter;
1818 
1819  if(pMapRPotName!=nullptr){
1820  pMapRPotName->clear();
1821 
1822  for(rpiter=m_MapRPot.begin();rpiter!=m_MapRPot.end();++rpiter){
1823  strLabel=GetRPotLabel((*rpiter).first);
1824  pMapRPotName->insert(std::pair<eRPotName,std::string>((*rpiter).first,strLabel));
1825  }
1826  }
1827 }

◆ GetMDFiberOffset()

double ALFA_GeometryReader::GetMDFiberOffset ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2200 of file ALFA_GeometryReader.cxx.

2201 {
2202  double fOffset=0.0;
2203  FIBERPARAMS FiberParams;
2204 
2205  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetMDFiberOffset");
2206 
2208  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2209  return 0.0;
2210  }
2211 
2212  switch(eFType){
2213  case EFT_UFIBER:
2214  if(GetUFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
2215  fOffset=FiberParams.fcs_atlas.fOffset;
2216  }
2217  break;
2218  case EFT_VFIBER:
2219  if(GetVFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
2220  fOffset=FiberParams.fcs_atlas.fOffset;
2221  }
2222  break;
2223  default:
2224  LogStream<<MSG::ERROR<<"Invalid fiber type"<<endmsg;
2225  break;
2226  }
2227 
2228  return fOffset;
2229 }

◆ GetMDFiberParams()

bool ALFA_GeometryReader::GetMDFiberParams ( PFIBERPARAMS  pFiberParams,
const eFiberType  eFType,
const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1889 of file ALFA_GeometryReader.cxx.

1890 {
1891  bool bRes=false;
1892 
1893  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetMDFiberParams");
1894 
1895  if(pFiberParams==nullptr)
1896  {
1897  LogStream<<MSG::ERROR<<"pFiberParams points to NULL"<<endmsg;
1898  }
1899  else if(m_eFCoordSystem!=EFCS_ATLAS)
1900  {
1901  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1902  }
1903  else{
1904  switch(eFType){
1905  case EFT_UFIBER:
1906  bRes=GetUFiberParams(pFiberParams, eRPName, nPlateID, nFiberID);
1907  break;
1908  case EFT_VFIBER:
1909  bRes=GetVFiberParams(pFiberParams, eRPName, nPlateID, nFiberID);
1910  break;
1911  default:
1912  LogStream<<MSG::ERROR<<"Invalid fiber type"<<endmsg;
1913  break;
1914  }
1915  }
1916 
1917  return bRes;
1918 }

◆ GetMDFiberSlope()

double ALFA_GeometryReader::GetMDFiberSlope ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2169 of file ALFA_GeometryReader.cxx.

2170 {
2171  double fSlope=0.0;
2172  FIBERPARAMS FiberParams;
2173 
2174  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetMDFiberSlope");
2175 
2177  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2178  return 0.0;
2179  }
2180 
2181  switch(eFType){
2182  case EFT_UFIBER:
2183  if(GetUFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
2184  fSlope=FiberParams.fcs_atlas.fSlope;
2185  }
2186  break;
2187  case EFT_VFIBER:
2188  if(GetVFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
2189  fSlope=FiberParams.fcs_atlas.fSlope;
2190  }
2191  break;
2192  default:
2193  LogStream<<MSG::ERROR<<"Invalid fiber type"<<endmsg;
2194  break;
2195  }
2196 
2197  return fSlope;
2198 }

◆ GetMDFiberZPos()

double ALFA_GeometryReader::GetMDFiberZPos ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2231 of file ALFA_GeometryReader.cxx.

2232 {
2233  double fZPos=0.0;
2234  FIBERPARAMS FiberParams;
2235 
2236  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetMDFiberZPos");
2237 
2239  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2240  return 0.0;
2241  }
2242 
2243  switch(eFType){
2244  case EFT_UFIBER:
2245  if(GetUFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
2246  fZPos=FiberParams.fcs_atlas.fZPos;
2247  }
2248  break;
2249  case EFT_VFIBER:
2250  if(GetVFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
2251  fZPos=FiberParams.fcs_atlas.fZPos;
2252  }
2253  break;
2254  default:
2255  LogStream<<MSG::ERROR<<"Invalid fiber type"<<endmsg;
2256  break;
2257  }
2258 
2259  return fZPos;
2260 }

◆ GetODFiberAngle()

double ALFA_GeometryReader::GetODFiberAngle ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2150 of file ALFA_GeometryReader.cxx.

2151 {
2152  double fAngle=0.0;
2153  FIBERPARAMS FiberParams;
2154 
2156  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetODFiberAngle");
2157  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2158  return 0.0;
2159  }
2160 
2161  if(GetODFiberParams(&FiberParams, eFType, eRPName, nPlateID, nFiberID))
2162  {
2163  fAngle=FiberParams.fcs_cladding.fAngle;
2164  }
2165 
2166  return fAngle;
2167 }

◆ GetODFiberCentreYPos()

double ALFA_GeometryReader::GetODFiberCentreYPos ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2131 of file ALFA_GeometryReader.cxx.

2132 {
2133  double fYPos=0.0;
2134  FIBERPARAMS FiberParams;
2135 
2137  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetODFiberCentreYPos");
2138  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2139  return 0.0;
2140  }
2141 
2142  if(GetODFiberParams(&FiberParams, eFType, eRPName, nPlateID, nFiberID))
2143  {
2144  fYPos=FiberParams.fcs_cladding.fCentreYPos;
2145  }
2146 
2147  return fYPos;
2148 }

◆ GetODFiberOffset()

double ALFA_GeometryReader::GetODFiberOffset ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2281 of file ALFA_GeometryReader.cxx.

2282 {
2283  double fOffset=0.0;
2284  FIBERPARAMS FiberParams;
2285 
2287  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetODFiberOffset");
2288  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2289  return 0.0;
2290  }
2291 
2292  if(GetODFiberParams(&FiberParams, eFType, eRPName, nPlateID, nFiberID))
2293  {
2294  fOffset=FiberParams.fcs_atlas.fOffset;
2295  }
2296 
2297  return fOffset;
2298 }

◆ GetODFiberParams()

bool ALFA_GeometryReader::GetODFiberParams ( PFIBERPARAMS  pFiberParams,
const eFiberType  eFType,
const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1921 of file ALFA_GeometryReader.cxx.

1922 {
1923  bool bRes=false;
1924  std::list<FIBERPARAMS>::const_iterator iter;
1925  std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1926 
1927  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetODFiberParams");
1928 
1929  if ((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end())
1930  {
1931  switch (eFType)
1932  {
1933  case EFT_ODFIBERU0:
1934  {
1935  for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter)
1936  {
1937  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1938  }
1939 
1940  if (iter==(*rpiter).second.ListODFibersU0.end())
1941  {
1942  LogStream<<MSG::ERROR<<"Cannot find ODFiberU0 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1943  }
1944  else
1945  {
1946  *pFiberParams = *iter;
1947  bRes=true;
1948  }
1949 
1950  break;
1951  }
1952  case EFT_ODFIBERV0:
1953  {
1954  for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter)
1955  {
1956  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1957  }
1958 
1959  if (iter==(*rpiter).second.ListODFibersV0.end())
1960  {
1961  LogStream<<MSG::ERROR<<"Cannot find ODFiberV0 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1962  }
1963  else
1964  {
1965  *pFiberParams = *iter;
1966  bRes=true;
1967  }
1968 
1969  break;
1970  }
1971  case EFT_ODFIBERU1:
1972  {
1973  for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter)
1974  {
1975  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1976  }
1977 
1978  if (iter==(*rpiter).second.ListODFibersU1.end())
1979  {
1980  LogStream<<MSG::ERROR<<"Cannot find ODFiberU1 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1981  }
1982  else
1983  {
1984  *pFiberParams = *iter;
1985  bRes=true;
1986  }
1987 
1988  break;
1989  }
1990  case EFT_ODFIBERV1:
1991  {
1992  for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter)
1993  {
1994  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1995  }
1996 
1997  if (iter==(*rpiter).second.ListODFibersV1.end())
1998  {
1999  LogStream<<MSG::ERROR<<"Cannot find ODFiberV1 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
2000  }
2001  else
2002  {
2003  *pFiberParams = *iter;
2004  bRes=true;
2005  }
2006 
2007  break;
2008  }
2009  default:
2010  {
2011  LogStream<<MSG::ERROR<<"Unknown ODFiber eFType="<<eFType<<endmsg;
2012  break;
2013  }
2014  }
2015  }
2016  else
2017  {
2018  LogStream<<MSG::ERROR<<"Unknown Roma pot PotID="<<eRPName<<endmsg;
2019  }
2020 
2021  return bRes;
2022 }

◆ GetODFiberSlope()

double ALFA_GeometryReader::GetODFiberSlope ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2262 of file ALFA_GeometryReader.cxx.

2263 {
2264  double fSlope=0.0;
2265  FIBERPARAMS FiberParams;
2266 
2268  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetODFiberSlope");
2269  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2270  return 0.0;
2271  }
2272 
2273  if(GetODFiberParams(&FiberParams, eFType, eRPName, nPlateID, nFiberID))
2274  {
2275  fSlope=FiberParams.fcs_atlas.fSlope;
2276  }
2277 
2278  return fSlope;
2279 }

◆ GetODFiberZPos()

double ALFA_GeometryReader::GetODFiberZPos ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 2300 of file ALFA_GeometryReader.cxx.

2301 {
2302  double fZPos=0.0;
2303  FIBERPARAMS FiberParams;
2304 
2306  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetODFiberZPos");
2307  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2308  return 0.0;
2309  }
2310 
2311  if(GetODFiberParams(&FiberParams, eFType, eRPName, nPlateID, nFiberID))
2312  {
2313  fZPos=FiberParams.fcs_atlas.fZPos;
2314  }
2315 
2316  return fZPos;
2317 }

◆ GetPlateParams()

bool ALFA_GeometryReader::GetPlateParams ( PPLATEPARAMS  pPlateParams,
const eRPotName  eRPName,
const int  nPlateID 
)

Definition at line 1516 of file ALFA_GeometryReader.cxx.

1517 {
1518  bool bRes=false;
1521 
1522  MsgStream LogStream(Athena::getMessageSvc(),"ALFA_GeometryReader::GetPlateParams");
1523 
1524  if((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end()){
1525  if((pliter=(*rpiter).second.MapPlates.find(nPlateID))!=(*rpiter).second.MapPlates.end()){
1526  *pPlateParams=(*pliter).second;
1527  bRes=true;
1528  }
1529  else{
1530  LogStream<<MSG::ERROR<<"Unknown Ti plate ID "<<nPlateID<<endmsg;
1531  }
1532  }
1533  else{
1534  LogStream<<MSG::ERROR<<"Unknown Roman pot PotID="<<eRPName<<endmsg;
1535  }
1536 
1537  return bRes;
1538 }

◆ GetPolyFitValue()

double ALFA_GeometryReader::GetPolyFitValue ( const double  fInputValue,
const std::vector< double > &  vecPolyFitParams 
)
private

Definition at line 2710 of file ALFA_GeometryReader.cxx.

2711 {
2712  int i,n;
2713  double fOutputValue=0.0;
2714 
2715  n=vecPolyFitParams.size();
2716 
2717  for(i=0;i<n;i++)
2718  {
2719  fOutputValue+=vecPolyFitParams[i]*pow(fInputValue,n-1-i);
2720  }
2721 
2722  return fOutputValue;
2723 }

◆ GetRPGeometryType()

eGeoSourceType ALFA_GeometryReader::GetRPGeometryType ( const eRPotName  eRPName,
eFiberType  eFType 
)

Definition at line 1872 of file ALFA_GeometryReader.cxx.

1873 {
1874  eGeoSourceType eGeoType=EGST_UNDEFINED;
1875 
1876  if(m_MapRPot.find(eRPName)!=m_MapRPot.end()){
1877  if(eFType==EFT_FIBERMD) eGeoType=m_MapRPot[eRPName].eMDGeometryType;
1878  else if(eFType==EFT_FIBEROD) eGeoType=m_MapRPot[eRPName].eODGeometryType;
1879  }
1880  else{
1881  MsgStream LogStream(Athena::getMessageSvc(),"ALFA_GeometryReader::GetRPGeometryType");
1882  LogStream<<MSG::ERROR<<"Unknown Roman pot ID="<<eRPName<<endmsg;
1883  }
1884 
1885 
1886  return eGeoType;
1887 }

◆ GetRPotCount()

int ALFA_GeometryReader::GetRPotCount ( ) const
inline

Definition at line 267 of file ALFA_GeometryReader.h.

267 { return (int)m_MapRPot.size(); }

◆ GetRPotLabel()

const char* ALFA_GeometryReader::GetRPotLabel ( const eRPotName  eRPName)
inline

Definition at line 278 of file ALFA_GeometryReader.h.

278 { return m_RPPosParams[eRPName].szLabel; }

◆ GetRPotZPosInAtlas()

double ALFA_GeometryReader::GetRPotZPosInAtlas ( const eRPotName  eRPName)

Definition at line 2876 of file ALFA_GeometryReader.cxx.

2877 {
2878  RPPOSPARAMS RPParams;
2879  GetRPPosParams(&RPParams, eRPName);
2880 
2881  return RPParams.RefPins.DCPInAtlasCS.z();
2882 }

◆ GetRPPosParams()

bool ALFA_GeometryReader::GetRPPosParams ( PRPPOSPARAMS  pRPosParams,
const eRPotName  eRPName 
)

Definition at line 1834 of file ALFA_GeometryReader.cxx.

1835 {
1836  bool bRes=false;
1838 
1839  MsgStream LogStream(Athena::getMessageSvc(),"ALFA_GeometryReader::GetRPPosParams");
1840 
1841  pRPPosParams->clear();
1842  if((iter=m_RPPosParams.find(eRPName))!=m_RPPosParams.end()){
1843  *pRPPosParams=(*iter).second;
1844  bRes=true;
1845  }
1846  else{
1847  LogStream<<MSG::ERROR<<"Unknown Roma pot ID="<<eRPName<<endmsg;
1848  }
1849 
1850  return bRes;
1851 }

◆ GetTransformMatrix()

HepGeom::Transform3D ALFA_GeometryReader::GetTransformMatrix ( const eRPotName  eRPName,
const eTransformElement  eMatrixType 
)

Definition at line 2831 of file ALFA_GeometryReader.cxx.

2832 {
2833  HepGeom::Transform3D TransMatrix;
2834  ASPOSPARAMS AParams;
2835  RPPOSPARAMS RPParams;
2836 
2837  HepGeom::Point3D<double> RPPin1=ms_NominalRPPin1;
2838  HepGeom::Point3D<double> MainPoint=ms_NominalRPMainPoint;
2839  HepGeom::Point3D<double> AlfaRefPoint=ms_NominalAlfaRefPoint;
2840 
2841  GetRPPosParams(&RPParams, eRPName);
2842  GetASPosParams(&AParams, RPParams.eASName);
2843 
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);
2847 
2848  switch(eMatrixType)
2849  {
2850  case ETE_A1:
2851  TransMatrix=RPParams.RPTransformInStation;
2852  break;
2853  case ETE_A2:
2854  TransMatrix=RPParams.DetTransformInMainPoint;
2855  break;
2856  case ETE_A3:
2857  TransMatrix=AParams.ASTransformInATLAS;
2858  break;
2859  case ETE_T1:
2860  TransMatrix=HepGeom::Translate3D(-Shift1);
2861  break;
2862  case ETE_T2:
2863  TransMatrix=HepGeom::Translate3D(Shift2);
2864  break;
2865  case ETE_T3:
2866  TransMatrix=HepGeom::Translate3D(-Shift3);
2867  break;
2868  default:
2869  throw GaudiException(" Invalid matrix identificator ", "ALFA_GeometryReader::GetTransformMatrix", StatusCode::FAILURE);
2870  break;
2871  }
2872 
2873  return TransMatrix;
2874 }

◆ GetUFiberAngle()

double ALFA_GeometryReader::GetUFiberAngle ( const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1416 of file ALFA_GeometryReader.cxx.

1417 {
1418  double fAngle=0.0;
1419  FIBERPARAMS FiberParams;
1420 
1422  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetUFiberAngle");
1423  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1424  return 0.0;
1425  }
1426 
1427  if(GetUFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
1428  fAngle=FiberParams.fcs_cladding.fAngle;
1429  }
1430 
1431  return fAngle;
1432 }

◆ GetUFiberCentreXPos()

double ALFA_GeometryReader::GetUFiberCentreXPos ( const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1380 of file ALFA_GeometryReader.cxx.

1381 {
1382  double fXPos=0.0;
1383  FIBERPARAMS FiberParams;
1384 
1386  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetUFiberCentreXPos");
1387  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1388  return 0.0;
1389  }
1390 
1391  if(GetUFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
1392  fXPos=FiberParams.fcs_cladding.fCentreXPos;
1393  }
1394 
1395  return fXPos;
1396 }

◆ GetUFiberParams()

bool ALFA_GeometryReader::GetUFiberParams ( PFIBERPARAMS  pFiberParams,
const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1322 of file ALFA_GeometryReader.cxx.

1323 {
1324  bool bRes=false;
1325  std::list<FIBERPARAMS>::const_iterator iter;
1326  std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1327 
1328  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetUFiberParams");
1329 
1330  if((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end()){
1331  for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1332  if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1333  }
1334 
1335  if(iter==(*rpiter).second.ListUFibers.end()){
1336  LogStream<<MSG::ERROR<<"Cannot find fiber PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1337  }
1338  else{
1339  *pFiberParams = *iter;
1340  bRes=true;
1341  }
1342  }
1343  else{
1344  LogStream<<MSG::ERROR<<"Unknown Roman pot PotID="<<eRPName<<endmsg;
1345  }
1346 
1347  return bRes;
1348 }

◆ GetVFiberAngle()

double ALFA_GeometryReader::GetVFiberAngle ( const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1434 of file ALFA_GeometryReader.cxx.

1435 {
1436  double fAngle=0.0;
1437  FIBERPARAMS FiberParams;
1438 
1440  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetVFiberAngle");
1441  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1442  return 0.0;
1443  }
1444 
1445  if(GetVFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
1446  fAngle=FiberParams.fcs_cladding.fAngle;
1447  }
1448 
1449  return fAngle;
1450 }

◆ GetVFiberCentreXPos()

double ALFA_GeometryReader::GetVFiberCentreXPos ( const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1398 of file ALFA_GeometryReader.cxx.

1399 {
1400  double fXPos=0.0;
1401  FIBERPARAMS FiberParams;
1402 
1404  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetVFiberCentreXPos");
1405  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1406  return 0.0;
1407  }
1408 
1409  if(GetVFiberParams(&FiberParams, eRPName, nPlateID, nFiberID)){
1410  fXPos=FiberParams.fcs_cladding.fCentreXPos;
1411  }
1412 
1413  return fXPos;
1414 }

◆ GetVFiberParams()

bool ALFA_GeometryReader::GetVFiberParams ( PFIBERPARAMS  pFiberParams,
const eRPotName  eRPName,
const int  nPlateID,
const int  nFiberID 
)

Definition at line 1350 of file ALFA_GeometryReader.cxx.

1351 {
1352  bool bRes=false;
1353  std::list<FIBERPARAMS>::const_iterator iter;
1354  std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1355 
1356  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::GetVFiberParams");
1357 
1358  if((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end()){
1359  for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1360  if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1361  }
1362 
1363  if(iter==(*rpiter).second.ListVFibers.end()) {
1364  LogStream<<MSG::ERROR<<"Cannot find fiber PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1365  //throw new Exception("Wrong U-fiber");
1366  }
1367  else{
1368  *pFiberParams = *iter;
1369  bRes=true;
1370  }
1371  }
1372  else{
1373  LogStream<<MSG::ERROR<<"Unknown Roman pot PotID="<<eRPName<<endmsg;
1374  }
1375 
1376 
1377  return bRes;
1378 }

◆ Initialize()

bool ALFA_GeometryReader::Initialize ( const PGEOMETRYCONFIGURATION  pConfig,
eFiberCoordSystem  eFCoordSystem 
)

Definition at line 634 of file ALFA_GeometryReader.cxx.

635 {
636  int i;
637  bool bRes=true;
638  std::string FilePath;
639  m_eFCoordSystem=eFCoordSystem;
640 
641  if(pConfig!=nullptr)
642  {
643  if(InitializeDefault(pConfig))
644  {
645  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::Initialize");
646  LogStream<<MSG::INFO<<"Metrology type:"<<pConfig->eRPMetrologyGeoType<<endmsg;
647  LogStream<<MSG::INFO<<"Metrology source:"<<pConfig->strRPMetrologyConnString<<endmsg;
648 
649  if(pConfig->bShiftToX97Pos)
650  {
651  m_ASPosParams[EASN_B7L1].ASTransformInATLAS=HepGeom::TranslateX3D(-97.0*CLHEP::mm)*m_ASPosParams[EASN_B7L1].ASTransformInATLAS;
652  m_ASPosParams[EASN_A7L1].ASTransformInATLAS=HepGeom::TranslateX3D(-97.0*CLHEP::mm)*m_ASPosParams[EASN_A7L1].ASTransformInATLAS;
653  m_ASPosParams[EASN_A7R1].ASTransformInATLAS=HepGeom::TranslateX3D(-97.0*CLHEP::mm)*m_ASPosParams[EASN_A7R1].ASTransformInATLAS;
654  m_ASPosParams[EASN_B7R1].ASTransformInATLAS=HepGeom::TranslateX3D(-97.0*CLHEP::mm)*m_ASPosParams[EASN_B7R1].ASTransformInATLAS;
655  }
656 
659  SetupUserCorrections(pConfig);
660  }
661  else if(m_eMetrologyType==EMT_METROLOGY) {
662  SetupCurrentLVDT(pConfig);
663 
665  else FilePath=pConfig->strRPMetrologyConnString;
666  LogStream<<MSG::INFO<<"Metrology data loaded from file "<<FilePath<<endmsg;
667  bRes=ParseRPMetrology(EGST_FILE,FilePath.c_str());
668  if(bRes) {
670  }
671  else return false;
672  }
674  SetupSWCorrections(pConfig);
675  }
677  //do nothing, there will be no shift to regular positions
678  }
679  else{
680  throw GaudiException(" Unknown metrology type ", "ALFA_GeometryReader::Initialize", StatusCode::FAILURE);
681  }
682 
683  for(i=1;i<=RPOTSCNT;i++)
684  {
685  eRPotName eName=(eRPotName)i;
686 
687  if(pConfig->eRPMetrologyGeoType!=EMT_UNDEFINED) UpdateSimRPPos(eName);
688  m_ListExistingRPots.push_back(eName);
689  }
690 
691  }
692  }
693  else
694  {
695  m_ListExistingRPots.push_back(ERPN_B7L1U);
696  m_ListExistingRPots.push_back(ERPN_B7L1L);
697  m_ListExistingRPots.push_back(ERPN_A7L1U);
698  m_ListExistingRPots.push_back(ERPN_A7L1L);
699  m_ListExistingRPots.push_back(ERPN_A7R1U);
700  m_ListExistingRPots.push_back(ERPN_A7R1L);
701  m_ListExistingRPots.push_back(ERPN_B7R1U);
702  m_ListExistingRPots.push_back(ERPN_B7R1L);
703  }
704 
705  //2010-11-04 (LN): ReadGeometry removed and it should be called by user due to SW transformation feature
706  //2012-08-03 (LN): back to call ReadGeometry because user corrections implemented to geometry consfiguration structure
707  //read fiber geometry
708  bRes=ReadFiberGeometry(pConfig);
709 
710  return bRes;
711 }

◆ InitializeDefault()

bool ALFA_GeometryReader::InitializeDefault ( const PGEOMETRYCONFIGURATION  pConfig)
private

Definition at line 393 of file ALFA_GeometryReader.cxx.

394 {
395  RPPOSPARAMS RPPosParams;
396  ASPOSPARAMS ASPosParams;
397 
398  m_MapRPot.clear();
399  m_RPPosParams.clear();
400  m_ListExistingRPots.clear();
401 
402  double fYOffset;
403 
404  // ALFA Station positions
405  //B7L1
406  ASPosParams.clear();
407  strcpy(ASPosParams.szLabel,"B7L1");
408  ASPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm,0.0*CLHEP::mm,pConfig->fNominalZPosB7L1+10.0*CLHEP::mm); //241538.0
409  ASPosParams.ASTransformInATLAS=HepGeom::Translate3D(0.0*CLHEP::mm,0.0*CLHEP::mm,ASPosParams.IdealMainPoint[2]);
410  m_ASPosParams.insert(std::pair<eAStationName,ASPOSPARAMS>(EASN_B7L1,ASPosParams));
411  //A7L1
412  ASPosParams.clear();
413  strcpy(ASPosParams.szLabel,"A7L1");
414  ASPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm,0.0*CLHEP::mm,pConfig->fNominalZPosA7L1+10.0*CLHEP::mm); //237398.0
415  ASPosParams.ASTransformInATLAS=HepGeom::Translate3D(0.0*CLHEP::mm,0.0*CLHEP::mm,ASPosParams.IdealMainPoint[2]);
416  m_ASPosParams.insert(std::pair<eAStationName,ASPOSPARAMS>(EASN_A7L1,ASPosParams));
417  //A7R1
418  ASPosParams.clear();
419  strcpy(ASPosParams.szLabel,"A7R1");
420  ASPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm,0.0*CLHEP::mm,pConfig->fNominalZPosA7R1+10.0*CLHEP::mm); //-237398 (old:-237418.0)
421  ASPosParams.ASTransformInATLAS=HepGeom::Translate3D(0.0*CLHEP::mm,0.0*CLHEP::mm,ASPosParams.IdealMainPoint[2]);
422  m_ASPosParams.insert(std::pair<eAStationName,ASPOSPARAMS>(EASN_A7R1,ASPosParams));
423  //B7R1
424  ASPosParams.clear();
425  strcpy(ASPosParams.szLabel,"B7R1");
426  ASPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm,0.0*CLHEP::mm,pConfig->fNominalZPosB7R1+10.0*CLHEP::mm); //-241538 (old:-241558.0)
427  ASPosParams.ASTransformInATLAS=HepGeom::Translate3D(0.0*CLHEP::mm,0.0*CLHEP::mm,ASPosParams.IdealMainPoint[2]);
428  m_ASPosParams.insert(std::pair<eAStationName,ASPOSPARAMS>(EASN_B7R1,ASPosParams));
429 
430  // Roma Pot positions
431  //B7L1U -1 --------------------------------------------
432  RPPosParams.clear();
433  strcpy(RPPosParams.szLabel,"B7L1U");
434  RPPosParams.eASName=EASN_B7L1;
435  RPPosParams.bIsLow=false;
437  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, 136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]-10.0*CLHEP::mm); //241528.0
438  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm,18.0*CLHEP::mm);
439  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]+18.0*CLHEP::mm);
440  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
441  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
442  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
443  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
449  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
450  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,+124.0*CLHEP::mm);
451  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
452  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);
453  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
454  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_B7L1U,RPPosParams));
455 
456  //B7L1L -2
457  RPPosParams.clear();
458  strcpy(RPPosParams.szLabel,"B7L1L");
459  RPPosParams.eASName=EASN_B7L1;
460  RPPosParams.bIsLow=true;
462  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]+10.0*CLHEP::mm); //241548.0
463  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm,-18.0*CLHEP::mm);
464  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]-18.0*CLHEP::mm);
465  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
466  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
467  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
468  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
474  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
475  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,-124.0*CLHEP::mm);
476  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
477  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.012*CLHEP::mm,0.0*CLHEP::mm);
478  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
479  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_B7L1L,RPPosParams));
480 
481  //A7L1U -3 --------------------------------------------
482  RPPosParams.clear();
483  strcpy(RPPosParams.szLabel,"A7L1U");
484  RPPosParams.eASName=EASN_A7L1;
485  RPPosParams.bIsLow=false;
487  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, 136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]-10.0*CLHEP::mm); //237388.0
488  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm,+18.0*CLHEP::mm);
489  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]+18.0*CLHEP::mm);
490  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
491  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
492  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
493  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
499  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
500  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,+124.0*CLHEP::mm);
501  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
502  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.034*CLHEP::mm,0.0*CLHEP::mm);
503  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
504  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_A7L1U,RPPosParams));
505 
506  //A7L1L -4
507  RPPosParams.clear();
508  strcpy(RPPosParams.szLabel,"A7L1L");
509  RPPosParams.eASName=EASN_A7L1;
510  RPPosParams.bIsLow=true;
512  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]+10.0*CLHEP::mm); //237408.0
513  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm,-18.0*CLHEP::mm);
514  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]-18.0*CLHEP::mm);
515  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
516  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
517  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
518  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
524  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
525  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,-124.0*CLHEP::mm);
526  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
527  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-134.948*CLHEP::mm,0.0*CLHEP::mm);
528  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
529  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_A7L1L,RPPosParams));
530 
531  //A7R1U -5 --------------------------------------------
532  RPPosParams.clear();
533  strcpy(RPPosParams.szLabel,"A7R1U");
534  RPPosParams.eASName=EASN_A7R1;
535  RPPosParams.bIsLow=false;
537  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, 136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]-10.0*CLHEP::mm); //-237408.0
538  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm,+18.0*CLHEP::mm);
539  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]+18.0*CLHEP::mm);
540  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
541  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
542  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
543  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
549  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
550  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,+124.0*CLHEP::mm);
551  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
552  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.08*CLHEP::mm,0.0*CLHEP::mm);
553  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
554  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_A7R1U,RPPosParams));
555 
556  //A7R1L -6
557  RPPosParams.clear();
558  strcpy(RPPosParams.szLabel,"A7R1L");
559  RPPosParams.eASName=EASN_A7R1;
560  RPPosParams.bIsLow=true;
562  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]+10.0*CLHEP::mm); //-237388.0
563  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm,-18.0*CLHEP::mm);
564  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]-18.0*CLHEP::mm);
565  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
566  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
567  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
568  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
574  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
575  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,-124.0*CLHEP::mm);
576  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
577  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-134.995*CLHEP::mm,0.0*CLHEP::mm);
578  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
579  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_A7R1L,RPPosParams));
580 
581  //B7R1U -7 --------------------------------------------
582  RPPosParams.clear();
583  strcpy(RPPosParams.szLabel,"B7R1U");
584  RPPosParams.eASName=EASN_B7R1;
585  RPPosParams.bIsLow=false;
587  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, 136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]-10.0*CLHEP::mm); //-241548.0
588  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm,+18.0*CLHEP::mm);
589  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, (29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]+18.0*CLHEP::mm);
590  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
591  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
592  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
593  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
599  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
600  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,+124.0*CLHEP::mm);
601  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,+172.2*CLHEP::mm,-124.0*CLHEP::mm);
602  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.005*CLHEP::mm,0.0*CLHEP::mm);
603  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
604  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_B7R1U,RPPosParams));
605 
606  //B7R1L -8
607  RPPosParams.clear();
608  strcpy(RPPosParams.szLabel,"B7R1L");
609  RPPosParams.eASName=EASN_B7R1;
610  RPPosParams.bIsLow=true;
612  RPPosParams.IdealRefPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -136.5*CLHEP::mm, m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2]+10.0*CLHEP::mm); //-241528.0
613  RPPosParams.IdealMainPointInStation=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm,-18.0*CLHEP::mm);
614  RPPosParams.IdealMainPoint=HepGeom::Point3D<double>(0.0*CLHEP::mm, -(29.525+fYOffset)*CLHEP::mm, RPPosParams.IdealRefPoint[2]-18.0*CLHEP::mm);
615  RPPosParams.RPIdealTransformInStation=HepGeom::Translate3D(RPPosParams.IdealMainPoint[0]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[0],
616  RPPosParams.IdealMainPoint[1]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[1],
617  RPPosParams.IdealMainPoint[2]-m_ASPosParams[RPPosParams.eASName].IdealMainPoint[2])*HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0*CLHEP::deg);
618  //RPPosParams.RPTransformInStation=RPPosParams.RPIdealTransformInStation;
624  RPPosParams.RefPins.IdealRPPin1=HepGeom::Point3D<double>(+77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
625  RPPosParams.RefPins.IdealRPPin2=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,-124.0*CLHEP::mm);
626  RPPosParams.RefPins.IdealRPPin3=HepGeom::Point3D<double>(-77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
627  RPPosParams.RefPins.DTPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,0.0*CLHEP::mm);//HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.021*CLHEP::mm,0.0*CLHEP::mm);
628  RPPosParams.RefPins.DCPInAlfaCS=HepGeom::Point3D<double>(0.0*CLHEP::mm,-135.0*CLHEP::mm,+10.0*CLHEP::mm);
629  m_RPPosParams.insert(std::pair<eRPotName,RPPOSPARAMS>(ERPN_B7R1L,RPPosParams));
630 
631  return true;
632 }

◆ ParseArrayOfValues()

bool ALFA_GeometryReader::ParseArrayOfValues ( const char *  szvalue,
std::vector< double > &  vecValues 
)
private

Definition at line 2489 of file ALFA_GeometryReader.cxx.

2490 {
2491  bool bRes=true;
2492  double faux;
2493  char *ppos1,*ppos2,*pstop;
2494  char szbuff[512];
2495 
2496  vecValues.clear();
2497  memset(szbuff,0,sizeof(szbuff));
2498  if(szvalue) strncpy(szbuff,szvalue,sizeof(szbuff)-1);
2499 
2500  ppos1=szbuff;
2501  ppos2=strchr(ppos1,',');
2502  if(ppos2!=nullptr){
2503  while(ppos2!=nullptr){
2504  *ppos2=0;
2505 
2506  faux=strtod(ppos1,&pstop);
2507  if(pstop==ppos2) vecValues.push_back(faux);
2508  else{
2509  bRes=false;
2510  break;
2511  }
2512 
2513  ppos1=ppos2+1;
2514  ppos2=strchr(ppos1,',');
2515  }
2516 
2517  //load last value
2518  faux=strtod(ppos1,&pstop);
2519  if(*pstop==0) vecValues.push_back(faux);
2520  else bRes=false;
2521  }
2522 
2523  if(!bRes) vecValues.clear();
2524 
2525  return bRes;
2526 }

◆ 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.

2413 {
2414  double fx{},fy{},fz{},faux{};
2415  char *ppos1,*ppos2,*ppos3,*ppos4,*pstop;
2416  char szbuff[513]{};
2417  HepGeom::Point3D<double> RefPoint;
2418 
2419  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::ParseRefPoints");
2420  if (strlen(szvalue) <513){
2421  strcpy(szbuff,szvalue);
2422  } else {
2423  LogStream<<MSG::ERROR<<"String too long for buffer."<<endmsg;
2424  }
2425  //get point count
2426  int i,nCnt=0;
2427  ppos2=szbuff;
2428  while((ppos1=strchr(ppos2,'['))!=nullptr){
2429  if(!(ppos2=strchr(ppos1+1,']'))) return false;
2430  ppos2++;
2431  nCnt++;
2432  }
2433 
2434  if(nCnt==0) return false;
2435  vecRefPoints.resize(nCnt);
2436 
2437  i=0;
2438  ppos2=szbuff;
2439  while((ppos1=strchr(ppos2,'['))!=nullptr){
2440  if(!(ppos2=strchr(ppos1,']'))) return false;
2441 
2442  //x-coordinate
2443  ppos3=ppos1+1;
2444  if(!(ppos4=strchr(ppos3+1,','))) return false;
2445  *ppos4=0;
2446  faux=strtod(ppos3,&pstop);
2447  if(pstop!=ppos4 && *pstop!=' ') return false;
2448  else fx=faux;
2449 
2450  //y-coordinate
2451  ppos3=ppos4+1;
2452  if(!(ppos4=strchr(ppos3+1,','))) return false;
2453  *ppos4=0;
2454  faux=strtod(ppos3,&pstop);
2455  if(pstop!=ppos4 && *pstop!=' ') return false;
2456  else fy=faux;
2457 
2458  //z-coordinate
2459  ppos3=ppos4+1;
2460  if(!(ppos4=strchr(ppos3+1,']'))) return false;
2461  *ppos4=0;
2462  faux=strtod(ppos3,&pstop);
2463  if(pstop!=ppos4 && *pstop!=' ') return false;
2464  else fz=faux;
2465 
2466  //rearanging coordinates to ATLAS scheme
2467  if(eCSystem==EMCS_ATLAS){
2468  RefPoint[0]=fx; RefPoint[1]=fy; RefPoint[2]=fz; // no swap
2469  }
2470  else if(eCSystem==EMCS_STATION){
2471  RefPoint[0]=fx; RefPoint[1]=fz; RefPoint[2]=-fy;
2472  }
2473  else if(eCSystem==EMCS_ROMANPOT){
2474  RefPoint[0]=fx; RefPoint[1]=-fz; RefPoint[2]=fy;
2475  }
2476  else if(eCSystem==EMCS_DETPIN1){
2477  RefPoint[0]=fx; RefPoint[1]=fy; RefPoint[2]=fz; // no swap
2478  }
2479  else throw new GaudiException("Invalid type of metrology coordinate system", "ALFA_GeometryReader::ParseRefPoints", StatusCode::FAILURE);
2480 
2481  vecRefPoints[i++]=RefPoint;
2482 
2483  ppos2++;
2484  }
2485 
2486  return true;
2487 }

◆ ParseRPMetrology()

bool ALFA_GeometryReader::ParseRPMetrology ( eGeoSourceType  eSourceType,
const char *  szDataSource 
)
private

Definition at line 2319 of file ALFA_GeometryReader.cxx.

2320 {
2321  bool bRes=false;
2322 
2323  eRPotName eRPName=ERPN_UNDEFINED;
2324  ALFA_ConfigParams CfgParams;
2325 
2326  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::ParseRPMetrology");
2327 
2328  if(eSourceType==EGST_FILE){
2329  // resolve ALFA Stations parameters
2330  if(CfgParams.Init(szDataSource,"[B7L1]")==0) return false;
2331  if(!SetupStationMetrologyPoints(CfgParams,EASN_B7L1)) return false;
2332 
2333  if(CfgParams.Init(szDataSource,"[A7L1]")==0) return false;
2334  if(!SetupStationMetrologyPoints(CfgParams,EASN_A7L1)) return false;
2335 
2336  if(CfgParams.Init(szDataSource,"[A7R1]")==0) return false;
2337  if(!SetupStationMetrologyPoints(CfgParams,EASN_A7R1)) return false;
2338 
2339  if(CfgParams.Init(szDataSource,"[B7R1]")==0) return false;
2340  if(!SetupStationMetrologyPoints(CfgParams,EASN_B7R1)) return false;
2341 
2342  // resolve Romain Pots parameters
2343  eRPName=ERPN_B7L1U;
2344  if(CfgParams.Init(szDataSource,"[B7L1U]")==0) return false;
2345  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2346  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2347 
2348  eRPName=ERPN_B7L1L;
2349  if(CfgParams.Init(szDataSource,"[B7L1L]")==0) return false;
2350  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2351  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2352 
2353  eRPName=ERPN_A7L1U;
2354  if(CfgParams.Init(szDataSource,"[A7L1U]")==0) return false;
2355  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2356  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2357 
2358  eRPName=ERPN_A7L1L;
2359  if(CfgParams.Init(szDataSource,"[A7L1L]")==0) return false;
2360  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2361  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2362 
2363  eRPName=ERPN_A7R1U;
2364  if(CfgParams.Init(szDataSource,"[A7R1U]")==0) return false;
2365  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2366  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2367 
2368  eRPName=ERPN_A7R1L;
2369  if(CfgParams.Init(szDataSource,"[A7R1L]")==0) return false;
2370  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2371  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2372 
2373  eRPName=ERPN_B7R1U;
2374  if(CfgParams.Init(szDataSource,"[B7R1U]")==0) return false;
2375  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2376  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2377 
2378  eRPName=ERPN_B7R1L;
2379  if(CfgParams.Init(szDataSource,"[B7R1L]")==0) return false;
2380  if(!SetupRPMetrologyPoints(CfgParams,eRPName)) return false;
2381  if(!SetupDetMetrologyPoints(CfgParams,eRPName)) return false;
2382 
2383  bRes=true;
2384  }
2385  else
2386  {
2387  LogStream<<MSG::ERROR<<"The file source is supported only."<<endmsg;
2388  bRes=false;
2389  }
2390 
2391  return bRes;
2392 }

◆ PrintFiberGeometry() [1/2]

void ALFA_GeometryReader::PrintFiberGeometry ( const char *  szOutFilename)

Definition at line 1541 of file ALFA_GeometryReader.cxx.

1542 {
1543  std::ofstream OutStream(szOutFilename);
1545  OutStream.close();
1546 }

◆ PrintFiberGeometry() [2/2]

void ALFA_GeometryReader::PrintFiberGeometry ( std::ostream &  OutStream)

Definition at line 1548 of file ALFA_GeometryReader.cxx.

1549 {
1550 
1551  std::list<FIBERPARAMS>::const_iterator iter;
1552  std::map<eRPotName, ROMAPOT>::const_iterator rpiter;
1553  FIBERPARAMS FiberParams;
1554 
1555  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::PrintGeometry");
1556 
1558  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1559  return;
1560  }
1561 
1562  for(rpiter=m_MapRPot.begin();rpiter!=m_MapRPot.end();++rpiter){
1563  OutStream<<std::endl<<"Geometry of U-fibers in Roma Pot "<<(*rpiter).first<<std::endl;
1564  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfCentreXPos\t\t\t\tfAngle"<<std::endl;
1565  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfSlope\t\t\t\tfOffset\t\t\t\tfZPos"<<std::endl;
1566 
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";
1569  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<(*iter).fcs_cladding.fCentreXPos<<"\t\t\t\t"<<(*iter).fcs_cladding.fAngle<<std::endl;
1570  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<(*iter).fcs_atlas.fSlope<<"\t\t\t\t"<<(*iter).fcs_atlas.fOffset<<(*iter).fcs_atlas.fZPos<<std::endl;
1571  }
1572 
1573  OutStream<<std::endl<<"Geometry of V-fibers in Roma Pot "<<(*rpiter).first<<std::endl;
1574  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<"nPotID\t\t\tnPlateID\t\t\tnFiberID\t\t\tnLayerID\t\t\tfCentreXPos\t\t\tfAngle\t\t\tfSlope\t\t\tfOffset\t\t\tfZPos"<<std::endl;
1575  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfSlope\t\t\t\tfOffset\t\t\t\tfZPos"<<std::endl;
1576 
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";
1579  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<(*iter).fcs_cladding.fCentreXPos<<"\t\t\t\t"<<(*iter).fcs_cladding.fAngle<<std::endl;
1580  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<(*iter).fcs_atlas.fSlope<<"\t\t\t\t"<<(*iter).fcs_atlas.fOffset<<(*iter).fcs_atlas.fZPos<<std::endl;
1581  }
1582 
1583  OutStream<<std::endl<<"Geometry of V0-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1584  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<"nPotID\t\t\tnPlateID\t\t\tnFiberID\t\t\tnLayerID\t\t\tfCentreXPos\t\t\tfAngle\t\t\tfSlope\t\t\tfOffset\t\t\tfZPos"<<std::endl;
1585  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfSlope\t\t\t\tfOffset\t\t\t\tfZPos"<<std::endl;
1586 
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";
1589  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<(*iter).fcs_cladding.fCentreYPos<<"\t\t\t\t"<<(*iter).fcs_cladding.fAngle<<std::endl;
1590  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<(*iter).fcs_atlas.fSlope<<"\t\t\t\t"<<(*iter).fcs_atlas.fOffset<<(*iter).fcs_atlas.fZPos<<std::endl;
1591  }
1592 
1593  OutStream<<std::endl<<"Geometry of U0-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1594  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<"nPotID\t\t\tnPlateID\t\t\tnFiberID\t\t\tnLayerID\t\t\tfCentreXPos\t\t\tfAngle\t\t\tfSlope\t\t\tfOffset\t\t\tfZPos"<<std::endl;
1595  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfSlope\t\t\t\tfOffset\t\t\t\tfZPos"<<std::endl;
1596 
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";
1599  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<(*iter).fcs_cladding.fCentreYPos<<"\t\t\t\t"<<(*iter).fcs_cladding.fAngle<<std::endl;
1600  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<(*iter).fcs_atlas.fSlope<<"\t\t\t\t"<<(*iter).fcs_atlas.fOffset<<(*iter).fcs_atlas.fZPos<<std::endl;
1601  }
1602 
1603  OutStream<<std::endl<<"Geometry of U1-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1604  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<"nPotID\t\t\tnPlateID\t\t\tnFiberID\t\t\tnLayerID\t\t\tfCentreXPos\t\t\tfAngle\t\t\tfSlope\t\t\tfOffset\t\t\tfZPos"<<std::endl;
1605  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfSlope\t\t\t\tfOffset\t\t\t\tfZPos"<<std::endl;
1606 
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";
1609  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<(*iter).fcs_cladding.fCentreYPos<<"\t\t\t\t"<<(*iter).fcs_cladding.fAngle<<std::endl;
1610  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<(*iter).fcs_atlas.fSlope<<"\t\t\t\t"<<(*iter).fcs_atlas.fOffset<<(*iter).fcs_atlas.fZPos<<std::endl;
1611  }
1612 
1613  OutStream<<std::endl<<"Geometry of V1-ODFibers in Roma Pot "<<(*rpiter).first<<std::endl;
1614  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<"nPotID\t\t\tnPlateID\t\t\tnFiberID\t\t\tnLayerID\t\t\tfCentreXPos\t\t\tfAngle\t\t\tfSlope\t\t\tfOffset\t\t\tfZPos"<<std::endl;
1615  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<"nPotID\t\t\t\tnPlateID\t\t\t\tnFiberID\t\t\t\tnLayerID\t\t\t\tfSlope\t\t\t\tfOffset\t\t\t\tfZPos"<<std::endl;
1616 
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";
1619  if(m_eFCoordSystem==EFCS_CLADDING) OutStream<<(*iter).fcs_cladding.fCentreYPos<<"\t\t\t\t"<<(*iter).fcs_cladding.fAngle<<std::endl;
1620  else if(m_eFCoordSystem==EFCS_ATLAS) OutStream<<(*iter).fcs_atlas.fSlope<<"\t\t\t\t"<<(*iter).fcs_atlas.fOffset<<(*iter).fcs_atlas.fZPos<<std::endl;
1621  }
1622  }
1623 }

◆ ReadDatabase()

bool ALFA_GeometryReader::ReadDatabase ( const eRPotName  eRPName,
const eFiberType  eFType,
const char *  szDataSource 
)
private

Definition at line 1234 of file ALFA_GeometryReader.cxx.

1235 {
1236  bool bRes=false;
1237 
1238 
1239  eFiberType eType=EFT_UNDEFINED;
1240  ROMAPOT RomaPot;
1241 
1242  std::vector<std::string> strDBElements;
1243  char szSource[64];
1244  char *pch;
1245 
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)
1251  {
1252  strDBElements.emplace_back(pch);
1253  pch = strtok_r(nullptr, ":",&strtok_ptr);
1254  }
1255 
1256 
1257  ALFA_RDBAccess* p_DBAccess = new ALFA_RDBAccess();
1258 
1259  bRes = p_DBAccess->ReadGeometry(eRPName, eFType, strDBElements[2], strDBElements[1], strDBElements[0]);
1260 
1261  if(m_MapRPot.find(eRPName)==m_MapRPot.end()){
1262  //RP not yet defined
1263  RomaPot.ListUFibers.clear();
1264  RomaPot.ListVFibers.clear();
1265  RomaPot.ListODFibersU0.clear();
1266  RomaPot.ListODFibersU1.clear();
1267  RomaPot.ListODFibersV0.clear();
1268  RomaPot.ListODFibersV1.clear();
1269 
1270  m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1271  }
1272 
1273  if(eFType==EFT_FIBERMD) m_MapRPot[eRPName].eMDGeometryType=EGST_DATABASE;
1274  else if(eFType==EFT_FIBEROD) m_MapRPot[eRPName].eODGeometryType=EGST_DATABASE;
1275 
1276  std::list<FIBERDATA>::const_iterator iter;
1277  for(iter = p_DBAccess->m_ListFiberData.begin(); iter != p_DBAccess->m_ListFiberData.end(); ++iter)
1278  {
1279  if (eRPName == (*iter).nPotID)
1280  {
1281  FIBERPARAMS FiberParams;
1282 
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;
1288 
1289  FiberParams.nPlateID=FiberParams.nLayerID/2+FiberParams.nLayerID%2;
1290 
1291  //Resolve fiber type
1292  if(eFType==EFT_FIBERMD)
1293  {
1294  eType=(FiberParams.fSlope<0)? EFT_UFIBER:EFT_VFIBER;
1295  }
1296  else if(eFType==EFT_FIBEROD)
1297  {
1298  if(FiberParams.nLayerID%2==1 && FiberParams.nFiberID<=15) eType=EFT_ODFIBERV0;
1299  if(FiberParams.nLayerID%2==1 && FiberParams.nFiberID>=16 && FiberParams.nFiberID<=30) eType=EFT_ODFIBERU0;
1300  if(FiberParams.nLayerID%2==0 && FiberParams.nFiberID<=15) eType=EFT_ODFIBERU1;
1301  if(FiberParams.nLayerID%2==0 && FiberParams.nFiberID>=16 && FiberParams.nFiberID<=30) eType=EFT_ODFIBERV1;
1302 
1303  }
1304 
1305  //Transform & save values for RP
1306  TransformFiberPositions(&FiberParams, eRPName, eType, EGST_DATABASE);
1307 
1308  if(eType==EFT_UFIBER) m_MapRPot[eRPName].ListUFibers.push_back(FiberParams);
1309  if(eType==EFT_VFIBER) m_MapRPot[eRPName].ListVFibers.push_back(FiberParams);
1310  if(eType==EFT_ODFIBERU0) m_MapRPot[eRPName].ListODFibersU0.push_back(FiberParams);
1311  if(eType==EFT_ODFIBERV0) m_MapRPot[eRPName].ListODFibersV0.push_back(FiberParams);
1312  if(eType==EFT_ODFIBERV1) m_MapRPot[eRPName].ListODFibersV1.push_back(FiberParams);
1313  if(eType==EFT_ODFIBERU1) m_MapRPot[eRPName].ListODFibersU1.push_back(FiberParams);
1314  }
1315  }
1316 
1317  delete p_DBAccess;
1318 
1319  return bRes;
1320 }

◆ ReadFiberGeometry()

bool ALFA_GeometryReader::ReadFiberGeometry ( const PGEOMETRYCONFIGURATION  pConfig)

Definition at line 918 of file ALFA_GeometryReader.cxx.

919 {
920  bool bFailRes=false;
921  int nRPCfgIndex;
922  std::list<eRPotName>::const_iterator iterRPName;
923  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_DetectorReader::ReadGeometry");
924 
925  if(pConfig!=nullptr)
926  {
927  LogStream<<MSG::INFO<<"Number of active or inactive Romain Pots: "<<m_ListExistingRPots.size()<<endmsg;
928 
929  for(iterRPName=m_ListExistingRPots.begin();iterRPName!=m_ListExistingRPots.end();++iterRPName){
930  nRPCfgIndex=((int)(*iterRPName))-1;
931  bFailRes|=!ReadSource((eGeoSourceType)pConfig->CfgRPosParams[nRPCfgIndex].eMDGeoType, *iterRPName, EFT_FIBERMD, pConfig->CfgRPosParams[nRPCfgIndex].strMDConnString.c_str());
932  bFailRes|=!ReadSource((eGeoSourceType)pConfig->CfgRPosParams[nRPCfgIndex].eODGeoType, *iterRPName, EFT_FIBEROD, pConfig->CfgRPosParams[nRPCfgIndex].strODConnString.c_str());
933  }
934  }
935  else //set ideal geometry if pConfig is not provided
936  {
937  for(iterRPName=m_ListExistingRPots.begin();iterRPName!=m_ListExistingRPots.end();++iterRPName){
938  bFailRes|=!ReadSource(EGST_IDEALGEOMETRY, *iterRPName, EFT_FIBERMD, nullptr);
939  bFailRes|=!ReadSource(EGST_IDEALGEOMETRY, *iterRPName, EFT_FIBEROD, nullptr);
940  }
941  }
942 
943  return !bFailRes;
944 }

◆ ReadFile()

bool ALFA_GeometryReader::ReadFile ( const eRPotName  eRPName,
const eFiberType  eFType,
const char *  szFilename 
)
private

Definition at line 1088 of file ALFA_GeometryReader.cxx.

1089 {
1090  if(eFType!=EFT_FIBERMD && eFType!=EFT_FIBEROD) return false;
1091 
1092  bool bRes=true;
1093  int i,nLine,nLength;
1094  char szLine[64];
1095  char* pch1, *pch2;
1096  FILE* pFile;
1097  eFiberType eType=EFT_UNDEFINED;
1098  ROMAPOT RomaPot;
1099 
1100  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::ReadFile");
1101 
1102  if(m_MapRPot.find(eRPName)==m_MapRPot.end()){
1103  //RP not yet defined
1104  RomaPot.ListUFibers.clear();
1105  RomaPot.ListVFibers.clear();
1106  RomaPot.ListODFibersU0.clear();
1107  RomaPot.ListODFibersU1.clear();
1108  RomaPot.ListODFibersV0.clear();
1109  RomaPot.ListODFibersV1.clear();
1110 
1111  m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1112  }
1113 
1114  if(eFType==EFT_FIBERMD) m_MapRPot[eRPName].eMDGeometryType=EGST_FILE;
1115  else if(eFType==EFT_FIBEROD) m_MapRPot[eRPName].eODGeometryType=EGST_FILE;
1116 
1117  if((pFile=fopen(szFilename,"r"))==nullptr){
1118  LogStream<<MSG::ERROR<< "Could not open the file "<<szFilename<<endmsg;
1119  return false;
1120  }
1121 
1122  nLine=0;
1123  while(!feof(pFile)){
1124  if(fgets(szLine,sizeof(szLine),pFile)!=nullptr){
1125 
1126  FIBERPARAMS FiberParams;
1127 
1128  nLine++;
1129  if(nLine<6) continue;
1130 
1131  nLength=strlen(szLine);
1132 
1133  //1. column - Layer ID
1134  for(i=0;i<nLength;i++) { if(*(szLine+i)==' ') continue; else break; }
1135  pch1=szLine+i;
1136  pch2=strchr(pch1,' ');
1137  if(pch2!=nullptr){
1138  *pch2='\0';
1139  FiberParams.nLayerID=atoi(pch1);
1140  FiberParams.nPlateID=FiberParams.nLayerID/2+FiberParams.nLayerID%2;
1141  }
1142  else{
1143  LogStream<<MSG::ERROR<< "Error at line "<<nLine<<" while reading the data file "<<szFilename<<endmsg;
1144  bRes=false;
1145  break;
1146  }
1147 
1148  //2. column - Fiber ID
1149  pch2++;
1150  for(i=0;i<nLength;i++) { if(*(pch2+i)==' ') continue; else break;}
1151  pch1=pch2+i;
1152  pch2=strchr(pch1,' ');
1153  if(pch2!=nullptr){
1154  *pch2='\0';
1155  FiberParams.nFiberID=atoi(pch1);
1156  }
1157  else{
1158  LogStream<<MSG::ERROR<< "Error at line "<<nLine<<" while reading the data file "<<szFilename<<endmsg;
1159  bRes=false;
1160  break;
1161  }
1162 
1163  //3. column - Slope
1164  pch2++;
1165  for(i=0;i<nLength;i++) { if(*(pch2+i)==' ') continue; else break; }
1166  pch1=pch2+i;
1167  pch2=strchr(pch1,' ');
1168  if(pch2!=nullptr){
1169  *pch2='\0';
1170  FiberParams.fSlope=atof(pch1);
1171  }
1172  else{
1173  LogStream<<MSG::ERROR<< "Error at line "<<nLine<<" while reading the data file "<<szFilename<<endmsg;
1174  bRes=false;
1175  break;
1176  }
1177 
1178  //4. column - Offset
1179  pch2++;
1180  for(i=0;i<nLength;i++) { if(*(pch2+i)==' ') continue; else break; }
1181  pch1=pch2+i;
1182  pch2=strchr(pch1,' ');
1183  if(pch2!=nullptr){
1184  *pch2='\0';
1185  FiberParams.fOffset=atof(pch1);
1186  }
1187  else{
1188  LogStream<<MSG::ERROR<< "Error at line "<<nLine<<" while reading the data file "<<szFilename<<endmsg;
1189  bRes=false;
1190  break;
1191  }
1192 
1193  //5. column - Z position
1194  pch2++;
1195  for(i=0;i<nLength;i++) { if(*(pch2+i)==' ') continue; else break; }
1196  pch1=pch2+i;
1197  FiberParams.fZPos=atof(pch1);
1198 
1199  //Resolve fiber type
1200  if(eFType==EFT_FIBERMD)
1201  {
1202  eType=(FiberParams.fSlope<0)? EFT_UFIBER:EFT_VFIBER;
1203  }
1204  else if(eFType==EFT_FIBEROD)
1205  {
1206  if(FiberParams.nLayerID%2==1 && FiberParams.nFiberID<=15) eType=EFT_ODFIBERV0;
1207  if(FiberParams.nLayerID%2==1 && FiberParams.nFiberID>=16 && FiberParams.nFiberID<=30) eType=EFT_ODFIBERU0;
1208 
1209 
1210  if(FiberParams.nLayerID%2==0 && FiberParams.nFiberID<=15) eType=EFT_ODFIBERV1;
1211  if(FiberParams.nLayerID%2==0 && FiberParams.nFiberID>=16 && FiberParams.nFiberID<=30) eType=EFT_ODFIBERU1;
1212  }
1213 
1214 
1215  //Transform & save values for RP
1216  TransformFiberPositions(&FiberParams, eRPName, eType, EGST_FILE);
1217 
1218  if(eType==EFT_UFIBER) m_MapRPot[eRPName].ListUFibers.push_back(FiberParams);
1219  if(eType==EFT_VFIBER) m_MapRPot[eRPName].ListVFibers.push_back(FiberParams);
1220  if(eType==EFT_ODFIBERU0) m_MapRPot[eRPName].ListODFibersU0.push_back(FiberParams);
1221  if(eType==EFT_ODFIBERV0) m_MapRPot[eRPName].ListODFibersV0.push_back(FiberParams);
1222  if(eType==EFT_ODFIBERV1) m_MapRPot[eRPName].ListODFibersV1.push_back(FiberParams);
1223  if(eType==EFT_ODFIBERU1) m_MapRPot[eRPName].ListODFibersU1.push_back(FiberParams);
1224 
1225  }
1226  }
1227 
1228  if(pFile) fclose(pFile);
1229  pFile=nullptr;
1230 
1231  return bRes;
1232 }

◆ ReadSource()

bool ALFA_GeometryReader::ReadSource ( const eGeoSourceType  eSourceType,
const eRPotName  eRPName,
const eFiberType  eFType,
const char *  szDataSource 
)
private

Definition at line 946 of file ALFA_GeometryReader.cxx.

947 {
948  bool bRes=false;
949  int i;
950  std::string strDetType, FilePath, GeomFile;
951  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_DetectorReader::ReadGeometry");
952 
953  if(eFType!=EFT_FIBERMD && eFType!=EFT_FIBEROD) return false;
954 
955  strDetType=(eFType==EFT_FIBERMD)? "MD":"OD";
956 
957  switch(eSourceType){
958  case EGST_IDEALGEOMETRY:
959  LogStream<<MSG::INFO<<"The IDEAL "<<strDetType<<" fiber geometry will be loaded for RP "<<GetRPotLabel(eRPName)<<endmsg;
960  bRes=SetIdealGeometry(eRPName, eFType);
961  break;
962  case EGST_FILE:
963 
964  GeomFile=std::string("geom_")+strDetType+std::string("_")+std::string(GetRPotLabel(eRPName))+std::string(".dat");
965  if(szDataSource==nullptr || !strcmp(szDataSource,"")) FilePath = PathResolver::find_file(GeomFile,"DATAPATH", PathResolver::RecursiveSearch);
966  else FilePath=std::string(szDataSource);
967 
968  LogStream<<MSG::INFO<<"The "<<strDetType<<" fiber geometry will be loaded from FILE "<<FilePath.c_str()<<" for RP "<<GetRPotLabel(eRPName)<<endmsg;
969  bRes=ReadFile(eRPName, eFType, FilePath.c_str());
970  break;
971  case EGST_DATABASE:
972  LogStream<<MSG::INFO<<"The "<<strDetType<<" fiber geometry will be loaded from DATABASE for RP "<<GetRPotLabel(eRPName)<<endmsg;
973  bRes=ReadDatabase(eRPName, eFType, szDataSource);
974  break;
975  default:
976  bRes=false;
977  break;
978  }
979 
980  if(bRes){
981  PLATEPARAMS PlateParams {0, 0};
982  for(i=1;i<=ALFAFIBERSCNT;i++){
983  m_MapRPot[eRPName].MapPlates.insert(std::pair<int,PLATEPARAMS>(i,PlateParams));
984  }
985 
986  for(i=1;i<=ODFIBERSCNT;i++){
987  m_MapRPot[eRPName].MapODPlates.insert(std::pair<int,PLATEPARAMS>(i,PlateParams));
988  }
989 
990  UpdateGeometry();
991  }
992  else
993  {
994  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::ReadSource");
995  LogStream << MSG::FATAL << " Could not load geometry! " << endmsg;
996 
997  throw GaudiException(" Could not load geometry ", "ALFA_GeometryReader::ReadSource", StatusCode::FAILURE);
998  }
999 
1000  return bRes;
1001 }

◆ ResolveRPotRefPoints()

bool ALFA_GeometryReader::ResolveRPotRefPoints ( const char *  szvalue,
eRPotName  eRPName,
eRefPointType  eRPointType 
)
private

Definition at line 2394 of file ALFA_GeometryReader.cxx.

2395 {
2396  bool bRes=false;
2397  std::vector<HepGeom::Point3D<double> > vecRefPoints;
2398 
2399  if(eRPointType==ERPT_IDEAL || eRPointType==ERPT_REAL) bRes=ParseRefPoints(szvalue,vecRefPoints,EMCS_STATION);
2400  else if(eRPointType==ERPT_DETIDEAL || eRPointType==ERPT_DETREAL) bRes=ParseRefPoints(szvalue,vecRefPoints,EMCS_ROMANPOT);
2401 
2402  if(bRes){
2403  if(eRPointType==ERPT_IDEAL) m_RPPosParams[eRPName].VecIdealRPRefPoints=std::move(vecRefPoints);
2404  else if(eRPointType==ERPT_REAL) m_RPPosParams[eRPName].VecRealRPRefPoints=std::move(vecRefPoints);
2405  else if(eRPointType==ERPT_DETIDEAL) m_RPPosParams[eRPName].VecIdealDetRefPoints=std::move(vecRefPoints);
2406  else if(eRPointType==ERPT_DETREAL) m_RPPosParams[eRPName].VecRealDetRefPoints=std::move(vecRefPoints);
2407  }
2408 
2409  return bRes;
2410 }

◆ SaveRPGeometryParams()

bool ALFA_GeometryReader::SaveRPGeometryParams ( const eRPotName  eRPName,
const char *  szDataDestination 
)

Definition at line 2774 of file ALFA_GeometryReader.cxx.

2775 {
2776  bool bRes= false;
2777  double fRotX,fRotY,fRotZ;
2778 
2779  FILE *pfile=fopen(szDataDestination,"w");
2780  if(pfile!=nullptr)
2781  {
2782  fprintf(pfile,"Romain pot geometry info: ----------------------------------------\r\n");
2783 
2784  fprintf(pfile,"LVDT: %.3f mm\r\n\r\n",m_RPPosParams[eRPName].fCurrentLVDTmm);
2785 
2786  fprintf(pfile,"Transformation matrix of RP in station MainPoint:\r\n");
2787  fprintf(pfile,"%+.5f %+.5f %+.5f %+.5f\r\n",m_RPPosParams[eRPName].RPTransformInStation.xx(),m_RPPosParams[eRPName].RPTransformInStation.xy(),m_RPPosParams[eRPName].RPTransformInStation.xz(),m_RPPosParams[eRPName].RPTransformInStation.dx());
2788  fprintf(pfile,"%+.5f %+.5f %+.5f %+.5f\r\n",m_RPPosParams[eRPName].RPTransformInStation.yx(),m_RPPosParams[eRPName].RPTransformInStation.yy(),m_RPPosParams[eRPName].RPTransformInStation.yz(),m_RPPosParams[eRPName].RPTransformInStation.dy());
2789  fprintf(pfile,"%+.5f %+.5f %+.5f %+.5f\r\n",m_RPPosParams[eRPName].RPTransformInStation.zx(),m_RPPosParams[eRPName].RPTransformInStation.zy(),m_RPPosParams[eRPName].RPTransformInStation.zz(),m_RPPosParams[eRPName].RPTransformInStation.dz());
2790 
2791  fRotZ=atan2(m_RPPosParams[eRPName].RPTransformInStation.yx(),m_RPPosParams[eRPName].RPTransformInStation.xx());
2792  fRotY=atan2(-m_RPPosParams[eRPName].RPTransformInStation.zx(),sqrt(pow(m_RPPosParams[eRPName].RPTransformInStation.zy(),2)+pow(m_RPPosParams[eRPName].RPTransformInStation.zz(),2)));//asin(m_RPPosParams[eRPName].RPTransformInStation.zx());
2793  fRotX=atan2(m_RPPosParams[eRPName].RPTransformInStation.zy(),m_RPPosParams[eRPName].RPTransformInStation.zz());
2794  fprintf(pfile,"RotX=%.5f rad, RotY=%.5f rad, RotZ=%.5f rad\r\n",fRotX,fRotY,fRotZ);
2795 
2796 
2797  fprintf(pfile,"\r\nDetector geometry info: ------------------------------------------\r\n");
2798  fprintf(pfile,"Transformation matrix of detector in RP MainPoint:\r\n");
2799  fprintf(pfile,"%+.5f %+.5f %+.5f %+.5f\r\n",m_RPPosParams[eRPName].DetTransformInMainPoint.xx(),m_RPPosParams[eRPName].DetTransformInMainPoint.xy(),m_RPPosParams[eRPName].DetTransformInMainPoint.xz(),m_RPPosParams[eRPName].DetTransformInMainPoint.dx());
2800  fprintf(pfile,"%+.5f %+.5f %+.5f %+.5f\r\n",m_RPPosParams[eRPName].DetTransformInMainPoint.yx(),m_RPPosParams[eRPName].DetTransformInMainPoint.yy(),m_RPPosParams[eRPName].DetTransformInMainPoint.yz(),m_RPPosParams[eRPName].DetTransformInMainPoint.dy());
2801  fprintf(pfile,"%+.5f %+.5f %+.5f %+.5f\r\n",m_RPPosParams[eRPName].DetTransformInMainPoint.zx(),m_RPPosParams[eRPName].DetTransformInMainPoint.zy(),m_RPPosParams[eRPName].DetTransformInMainPoint.zz(),m_RPPosParams[eRPName].DetTransformInMainPoint.dz());
2802 
2803  fRotZ=atan2(m_RPPosParams[eRPName].DetTransformInMainPoint.yx(),m_RPPosParams[eRPName].DetTransformInMainPoint.xx());
2804  fRotY=atan2(-m_RPPosParams[eRPName].DetTransformInMainPoint.zx(),sqrt(pow(m_RPPosParams[eRPName].DetTransformInMainPoint.zy(),2)+pow(m_RPPosParams[eRPName].DetTransformInMainPoint.zz(),2)));//asin(m_RPPosParams[eRPName].RPTransformInStation.zx());
2805  fRotX=atan2(m_RPPosParams[eRPName].DetTransformInMainPoint.zy(),m_RPPosParams[eRPName].DetTransformInMainPoint.zz());
2806  fprintf(pfile,"RotX=%.5f rad, RotY=%.5f rad, RotZ=%.5f rad\r\n",fRotX,fRotY,fRotZ);
2807 
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(),
2810  m_RPPosParams[eRPName].RefPins.RealRPPin1.x(),m_RPPosParams[eRPName].RefPins.RealRPPin1.y(),m_RPPosParams[eRPName].RefPins.RealRPPin1.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(),
2812  m_RPPosParams[eRPName].RefPins.RealRPPin2.x(),m_RPPosParams[eRPName].RefPins.RealRPPin2.y(),m_RPPosParams[eRPName].RefPins.RealRPPin2.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(),
2814  m_RPPosParams[eRPName].RefPins.RealRPPin3.x(),m_RPPosParams[eRPName].RefPins.RealRPPin3.y(),m_RPPosParams[eRPName].RefPins.RealRPPin3.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(),
2816  m_RPPosParams[eRPName].RefPins.DTPInRPotCS.x(),m_RPPosParams[eRPName].RefPins.DTPInRPotCS.y(),m_RPPosParams[eRPName].RefPins.DTPInRPotCS.z(),
2817  m_RPPosParams[eRPName].RefPins.DTPInAtlasCS.x(),m_RPPosParams[eRPName].RefPins.DTPInAtlasCS.y(),m_RPPosParams[eRPName].RefPins.DTPInAtlasCS.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(),
2819  m_RPPosParams[eRPName].RefPins.DCPInRPotCS.x(),m_RPPosParams[eRPName].RefPins.DCPInRPotCS.y(),m_RPPosParams[eRPName].RefPins.DCPInRPotCS.z(),
2820  m_RPPosParams[eRPName].RefPins.DCPInAtlasCS.x(),m_RPPosParams[eRPName].RefPins.DCPInAtlasCS.y(),m_RPPosParams[eRPName].RefPins.DCPInAtlasCS.z());
2821 
2822 
2823  fclose(pfile);
2824 
2825  bRes=true;
2826  }
2827 
2828  return bRes;
2829 }

◆ SetIdealGeometry()

bool ALFA_GeometryReader::SetIdealGeometry ( const eRPotName  eRPName,
const eFiberType  eFType 
)
private

Definition at line 1003 of file ALFA_GeometryReader.cxx.

1004 {
1005  if(eFType!=EFT_FIBERMD && eFType!=EFT_FIBEROD) return false;
1006 
1007  int i,j;
1008  bool bRes=true;
1009  eFiberType eFiberAlfaType;
1010  ROMAPOT RomaPot;
1011 
1012 
1013  if(m_MapRPot.find(eRPName)==m_MapRPot.end())
1014  {
1015  //RP not yet defined
1016  RomaPot.ListUFibers.clear();
1017  RomaPot.ListVFibers.clear();
1018  RomaPot.ListODFibersU0.clear();
1019  RomaPot.ListODFibersU1.clear();
1020  RomaPot.ListODFibersV0.clear();
1021  RomaPot.ListODFibersV1.clear();
1022 
1023  m_MapRPot.insert(std::pair<eRPotName,ROMAPOT>(eRPName,RomaPot));
1024  }
1025 
1026  if(eFType==EFT_FIBERMD) m_MapRPot[eRPName].eMDGeometryType=EGST_IDEALGEOMETRY;
1027  else if(eFType==EFT_FIBEROD) m_MapRPot[eRPName].eODGeometryType=EGST_IDEALGEOMETRY;
1028 
1029  if (eFType==EFT_FIBERMD)
1030  {
1031  for(i=1;i<=ALFALAYERSCNT*ALFAPLATESCNT;i++){
1032  for(j=1;j<=ALFAFIBERSCNT;j++){
1033  FIBERPARAMS FiberParams;
1034 
1035  eFiberAlfaType=(i%2==0)? EFT_VFIBER:EFT_UFIBER;
1036  FiberParams.nLayerID=i;
1037  FiberParams.nFiberID=j;
1038  FiberParams.fSlope=(eFiberAlfaType==EFT_VFIBER)? 1.0:-1.0;
1039  FiberParams.nPlateID=FiberParams.nLayerID/2+FiberParams.nLayerID%2;
1040  TransformFiberPositions(&FiberParams, eRPName, eFiberAlfaType, EGST_IDEALGEOMETRY);
1041 
1042  if(eFiberAlfaType==EFT_UFIBER) m_MapRPot[eRPName].ListUFibers.push_back(FiberParams);
1043  if(eFiberAlfaType==EFT_VFIBER) m_MapRPot[eRPName].ListVFibers.push_back(FiberParams);
1044  }
1045  }
1046  }
1047  else if (eFType==EFT_FIBEROD)
1048  {
1049  for(i=1;i<=ODLAYERSCNT*ODPLATESCNT;i++)
1050  {
1051  for(j=1;j<=ODFIBERSCNT;j++)
1052  {
1053  FIBERPARAMS FiberParams;
1054 
1055  FiberParams.nLayerID=i;
1056  FiberParams.nPlateID=FiberParams.nLayerID/2+FiberParams.nLayerID%2;
1057  FiberParams.fSlope = 0;
1058 
1059  if (i%2==0)
1060  { //for V0 and V1 ODFibers
1061  FiberParams.nFiberID=j;
1062  TransformFiberPositions(&FiberParams, eRPName, EFT_ODFIBERV0, EGST_IDEALGEOMETRY);
1063  m_MapRPot[eRPName].ListODFibersV0.push_back(FiberParams);
1064 
1065  //1.10.2010 LN: change of indexation scheme
1066  FiberParams.nFiberID=j;//j+15;
1067  TransformFiberPositions(&FiberParams, eRPName, EFT_ODFIBERV1, EGST_IDEALGEOMETRY);
1068  m_MapRPot[eRPName].ListODFibersV1.push_back(FiberParams);
1069  }
1070  else if (i%2==1)
1071  { //for U0 and U1 ODFibers
1072  FiberParams.nFiberID=j+15;
1073  TransformFiberPositions(&FiberParams, eRPName, EFT_ODFIBERU0, EGST_IDEALGEOMETRY);
1074  m_MapRPot[eRPName].ListODFibersU0.push_back(FiberParams);
1075 
1076  //1.10.2010 LN: change of indexation scheme
1077  FiberParams.nFiberID=j+15;//j;
1078  TransformFiberPositions(&FiberParams, eRPName, EFT_ODFIBERU1, EGST_IDEALGEOMETRY);
1079  m_MapRPot[eRPName].ListODFibersU1.push_back(FiberParams);
1080  }
1081  }
1082  }
1083  }
1084 
1085  return bRes;
1086 }

◆ SetODFiberPositionToMainReference()

void ALFA_GeometryReader::SetODFiberPositionToMainReference ( const eRPotName  eRPName,
const eFiberType  eFType,
const int  nPlateID,
const int  nFiberID,
const HepGeom::Point3D< float > &  TransPoint,
const double  fTransSlope 
)

Definition at line 2024 of file ALFA_GeometryReader.cxx.

2025 {
2028 
2029  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::SetODFiberPositionToMainReference");
2030 
2032  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
2033  return;
2034  }
2035 
2036  if ((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end())
2037  {
2038  switch (eFType)
2039  {
2040  case EFT_ODFIBERU0:
2041  {
2042  for(iter=(*rpiter).second.ListODFibersU0.begin();iter!=(*rpiter).second.ListODFibersU0.end();++iter)
2043  {
2044  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
2045  }
2046 
2047  if (iter==(*rpiter).second.ListODFibersU0.end())
2048  {
2049  LogStream<<MSG::ERROR<<"Cannot find ODFiberU0 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
2050  //throw new G4Exception("Wrong ODFiberU0");
2051  }
2052  else
2053  {
2054  (*iter).MainRefPointPos=TransPoint;
2055  (*iter).fMainRefPointSlope=fTransSlope;
2056  }
2057 
2058  break;
2059  }
2060  case EFT_ODFIBERV0:
2061  {
2062  for(iter=(*rpiter).second.ListODFibersV0.begin();iter!=(*rpiter).second.ListODFibersV0.end();++iter)
2063  {
2064  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
2065  }
2066 
2067  if (iter==(*rpiter).second.ListODFibersV0.end())
2068  {
2069  LogStream<<MSG::ERROR<<"Cannot find ODFiberV0 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
2070  }
2071  else
2072  {
2073  (*iter).MainRefPointPos=TransPoint;
2074  (*iter).fMainRefPointSlope=fTransSlope;
2075  }
2076 
2077  break;
2078  }
2079  case EFT_ODFIBERU1:
2080  {
2081  for(iter=(*rpiter).second.ListODFibersU1.begin();iter!=(*rpiter).second.ListODFibersU1.end();++iter)
2082  {
2083  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
2084  }
2085 
2086  if (iter==(*rpiter).second.ListODFibersU1.end())
2087  {
2088  LogStream<<MSG::ERROR<<"Cannot find ODFiberU1 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
2089  }
2090  else
2091  {
2092  (*iter).MainRefPointPos=TransPoint;
2093  (*iter).fMainRefPointSlope=fTransSlope;
2094  }
2095 
2096  break;
2097  }
2098  case EFT_ODFIBERV1:
2099  {
2100  for(iter=(*rpiter).second.ListODFibersV1.begin();iter!=(*rpiter).second.ListODFibersV1.end();++iter)
2101  {
2102  if (((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
2103  }
2104 
2105  if (iter==(*rpiter).second.ListODFibersV1.end())
2106  {
2107  LogStream<<MSG::ERROR<<"Cannot find ODFiberV1 PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
2108  }
2109  else
2110  {
2111  (*iter).MainRefPointPos=TransPoint;
2112  (*iter).fMainRefPointSlope=fTransSlope;
2113  }
2114 
2115  break;
2116  }
2117  default:
2118  {
2119  LogStream<<MSG::ERROR<<"Unknown ODFiber eFType="<<eFType<<endmsg;
2120  break;
2121  }
2122  }
2123  }
2124  else
2125  {
2126  LogStream<<MSG::ERROR<<"Unknown Roman pot PotID="<<eRPName<<endmsg;
2127  }
2128 
2129 }

◆ 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.

1453 {
1456  FIBERPARAMS FiberParams;
1457 
1458  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::SetUFiberPositionToMainReference");
1459 
1461  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1462  return;
1463  }
1464 
1465  if((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end()){
1466  for(iter=(*rpiter).second.ListUFibers.begin();iter!=(*rpiter).second.ListUFibers.end();++iter){
1467  if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1468  }
1469 
1470  if(iter==(*rpiter).second.ListUFibers.end()) {
1471  LogStream<<MSG::ERROR<<"Cannot find fiber PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1472  //throw new Exception("Wrong U-fiber");
1473  }
1474  else{
1475  (*iter).MainRefPointPos=TransPoint;
1476  (*iter).fMainRefPointSlope=fTransSlope;
1477  }
1478  }
1479  else{
1480  LogStream<<MSG::ERROR<<"Unknown Roman pot PotID="<<eRPName<<endmsg;
1481  }
1482 }

◆ SetupCurrentLVDT()

void ALFA_GeometryReader::SetupCurrentLVDT ( const PGEOMETRYCONFIGURATION  pConfig)
private

Definition at line 2884 of file ALFA_GeometryReader.cxx.

2885 {
2886  m_RPPosParams[ERPN_B7L1U].fCurrentLVDTmm=pConfig->CfgRPosParams[0].fCurrentLVDTmm;
2887  m_RPPosParams[ERPN_B7L1L].fCurrentLVDTmm=pConfig->CfgRPosParams[1].fCurrentLVDTmm;
2888  m_RPPosParams[ERPN_A7L1U].fCurrentLVDTmm=pConfig->CfgRPosParams[2].fCurrentLVDTmm;
2889  m_RPPosParams[ERPN_A7L1L].fCurrentLVDTmm=pConfig->CfgRPosParams[3].fCurrentLVDTmm;
2890  m_RPPosParams[ERPN_A7R1U].fCurrentLVDTmm=pConfig->CfgRPosParams[4].fCurrentLVDTmm;
2891  m_RPPosParams[ERPN_A7R1L].fCurrentLVDTmm=pConfig->CfgRPosParams[5].fCurrentLVDTmm;
2892  m_RPPosParams[ERPN_B7R1U].fCurrentLVDTmm=pConfig->CfgRPosParams[6].fCurrentLVDTmm;
2893  m_RPPosParams[ERPN_B7R1L].fCurrentLVDTmm=pConfig->CfgRPosParams[7].fCurrentLVDTmm;
2894 }

◆ SetupDetMetrologyPoints()

bool ALFA_GeometryReader::SetupDetMetrologyPoints ( ALFA_ConfigParams CfgParams,
eRPotName  eRPName 
)
private

Definition at line 2528 of file ALFA_GeometryReader.cxx.

2529 {
2530  //bool bIsLightMetrology=true;
2531 
2532  double fZc;
2533  //double a1,a2;
2534  double a3,a4;
2535  double xp1,yp1;
2536  //double xp2,yp2,xp3,yp3,xr3;
2537  double xr1,yr1,xr2,yr2;//,yr3;
2538  HepGeom::Point3D<double> PointIdealD3, PointRealD3;
2539  HepGeom::Point3D<double> PointIdealD4, PointRealD4;
2540  HepGeom::Point3D<double> PointIdealD5, PointRealD5;
2541 
2542  std::vector<double> vecDetEdges;
2543  std::vector<HepGeom::Point3D<double> > vecNominalDetPoints;
2544  std::vector<HepGeom::Point3D<double> > vecRealDetPoints;
2545 
2546  // load nominal & real position of PSx in RP CS
2547  if(!CfgParams.IsKey("idealrefdetpoints")) return false;
2548  if(!ParseRefPoints(CfgParams.GetParameter("idealrefdetpoints"),vecNominalDetPoints,EMCS_ROMANPOT)) return false;
2549  if(!CfgParams.IsKey("realrefdetpoints")) return false;
2550  if(!ParseRefPoints(CfgParams.GetParameter("realrefdetpoints"),vecRealDetPoints,EMCS_ROMANPOT)) return false;
2551 
2552  if(!CfgParams.IsKey("realdetedgeypos")) return false;
2553  if(!ParseArrayOfValues(CfgParams.GetParameter("realdetedgeypos"),vecDetEdges)) return false;
2554 
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);
2559 
2560  //compute in-plane transformation matrix (deformation not included)
2561  xp1=vecNominalDetPoints[0].x();
2562  yp1=vecNominalDetPoints[0].y();
2563 
2564 
2565  xr1=vecRealDetPoints[0].x();
2566  yr1=vecRealDetPoints[0].y();
2567  xr2=vecRealDetPoints[1].x();
2568  yr2=vecRealDetPoints[1].y();
2569 
2570 
2571  double alpha=-atan((xr2-xr1)/(yr2-yr1));
2572  a3=xr1-xp1;//a3=0.5*(xr1+xr2);
2573  a4=yr1-yp1;//a4=0.5*(yr1+yr2);
2574 
2575 
2576 
2577  //-----------------------------------------
2578  HepGeom::Transform3D CorrectionInMainPoint, CorrectionInDetPin1;
2579 
2580  //use light metrology
2581  CorrectionInDetPin1=HepGeom::Translate3D(a3,a4,fZc-113.0*CLHEP::mm)*HepGeom::RotateZ3D(alpha);
2582 
2583  HepGeom::Point3D<double> MainPoint=ms_NominalRPMainPoint;
2584  HepGeom::Point3D<double> RPPin1=ms_NominalRPPin1;
2585  HepGeom::Point3D<double> DetPin1=ms_NominalDetPin1;
2586 
2587  //recalculate SW transform in MainPoint
2588  HepGeom::Vector3D<double> OriginShift=RPPin1+DetPin1-MainPoint;
2589 
2590  CLHEP::Hep3Vector TranslationInMainPoint=CorrectionInDetPin1.getTranslation()-CorrectionInDetPin1*OriginShift+OriginShift;
2591 
2592  CLHEP::HepRotation RotationInMainPoint=CorrectionInDetPin1.getRotation();
2593  CorrectionInMainPoint=HepGeom::Transform3D(RotationInMainPoint,TranslationInMainPoint);
2594 
2595  PointRealD3=CorrectionInMainPoint*PointIdealD3;
2596  PointRealD4=CorrectionInMainPoint*PointIdealD4;
2597  PointRealD5=CorrectionInMainPoint*PointIdealD5;
2598 
2599  m_RPPosParams[eRPName].VecIdealDetRefPoints.resize(3);
2600  m_RPPosParams[eRPName].VecRealDetRefPoints.resize(3);
2601 
2602  m_RPPosParams[eRPName].VecIdealDetRefPoints[0]=std::move(PointIdealD5);
2603  m_RPPosParams[eRPName].VecRealDetRefPoints[0]=std::move(PointRealD5);
2604 
2605  m_RPPosParams[eRPName].VecIdealDetRefPoints[1]=std::move(PointIdealD4);
2606  m_RPPosParams[eRPName].VecRealDetRefPoints[1]=std::move(PointRealD4);
2607 
2608  m_RPPosParams[eRPName].VecIdealDetRefPoints[2]=std::move(PointIdealD3);
2609  m_RPPosParams[eRPName].VecRealDetRefPoints[2]=std::move(PointRealD3);
2610 
2611  return true;
2612 }

◆ SetupRPMetrologyPoints()

bool ALFA_GeometryReader::SetupRPMetrologyPoints ( ALFA_ConfigParams CfgParams,
eRPotName  eRPName 
)
private

Definition at line 2614 of file ALFA_GeometryReader.cxx.

2615 {
2616  bool bRes=true;
2617  const int nCnt=3;
2618  int i;
2619  double fx,fy,fz;
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;
2627  RPPOSPARAMS RPPosParams;
2628 
2629  GetRPPosParams(&RPPosParams,eRPName);
2630  if(!RPPosParams.bIsLow){
2631  RPPinNominal=HepGeom::Point3D<double>(77.5*CLHEP::mm,172.2*CLHEP::mm,-124.0*CLHEP::mm);
2632  }
2633  else{
2634  RPPinNominal=HepGeom::Point3D<double>(77.5*CLHEP::mm,-172.2*CLHEP::mm,+124.0*CLHEP::mm);
2635  }
2636 
2637  vecNominalPSinStationCS.resize(nCnt);
2638  vecRealPSinStationCS.resize(nCnt);
2639 
2640  // load nominal position of PSx in RP CS
2641  if(!CfgParams.IsKey("psinrpss")) return false;
2642  if(!ParseRefPoints(CfgParams.GetParameter("psinrpss"),vecPSinRPCS,EMCS_ROMANPOT)) return false;
2643 
2644  //compute nominal position of PSx in Station CS
2645  for(i=0;i<nCnt;i++){
2646  vecNominalPSinStationCS[i]=RPPinNominal+HepGeom::RotateX3D(RPPosParams.bIsLow? 180*CLHEP::deg:0.0)*vecPSinRPCS[i];
2647  }
2648 
2649 
2650  //calculate LVDT position from position in [mm]
2651  fCurrentLVDTmm=RPPosParams.fCurrentLVDTmm;
2652 
2653  ParseArrayOfValues(CfgParams.GetParameter("mm2lvdtfit"),vecPolyFitParams);
2654  fCurrentLVDT=GetPolyFitValue(fCurrentLVDTmm,vecPolyFitParams); // true LVDT value
2655 
2656  //compute real position of PSx in Station CS from LVDT parametrization
2657  ParseArrayOfValues(CfgParams.GetParameter("ps1xlvdtpolyfit"),vecPolyFitParams);
2658  fx=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2659  ParseArrayOfValues(CfgParams.GetParameter("ps1ylvdtpolyfit"),vecPolyFitParams);
2660  fy=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2661  ParseArrayOfValues(CfgParams.GetParameter("ps1zlvdtpolyfit"),vecPolyFitParams);
2662  fz=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2663  PSinStation.set(fx,fy,fz);
2664  vecRealPSinStationCS[0]=PSinStation;
2665 
2666  ParseArrayOfValues(CfgParams.GetParameter("ps2xlvdtpolyfit"),vecPolyFitParams);
2667  fx=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2668  ParseArrayOfValues(CfgParams.GetParameter("ps2ylvdtpolyfit"),vecPolyFitParams);
2669  fy=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2670  ParseArrayOfValues(CfgParams.GetParameter("ps2zlvdtpolyfit"),vecPolyFitParams);
2671  fz=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2672  PSinStation.set(fx,fy,fz);
2673  vecRealPSinStationCS[1]=PSinStation;
2674 
2675  ParseArrayOfValues(CfgParams.GetParameter("ps3xlvdtpolyfit"),vecPolyFitParams);
2676  fx=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2677  ParseArrayOfValues(CfgParams.GetParameter("ps3ylvdtpolyfit"),vecPolyFitParams);
2678  fy=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2679  ParseArrayOfValues(CfgParams.GetParameter("ps3zlvdtpolyfit"),vecPolyFitParams);
2680  fz=GetPolyFitValue(fCurrentLVDT,vecPolyFitParams);
2681  PSinStation.set(fx,fy,fz);
2682  vecRealPSinStationCS[2]=std::move(PSinStation);
2683 
2684 
2685  m_RPPosParams[eRPName].VecIdealRPRefPoints=std::move(vecNominalPSinStationCS);
2686  m_RPPosParams[eRPName].VecRealRPRefPoints=std::move(vecRealPSinStationCS);
2687 
2688  bRes=true;
2689 
2690  return bRes;
2691 }

◆ SetupStationMetrologyPoints()

bool ALFA_GeometryReader::SetupStationMetrologyPoints ( ALFA_ConfigParams CfgParams,
eAStationName  eASName 
)
private

Definition at line 2693 of file ALFA_GeometryReader.cxx.

2694 {
2695  std::vector<HepGeom::Point3D<double> > vecShiftPoints;
2696 
2697  // load shift E
2698  if(!CfgParams.IsKey("shifte")) return false;
2699  if(!ParseRefPoints(CfgParams.GetParameter("shifte"),vecShiftPoints,EMCS_ATLAS)) return false;
2700  m_ASPosParams[eASName].ShiftE=vecShiftPoints[0];
2701 
2702  // load shift S
2703  if(!CfgParams.IsKey("shifts")) return false;
2704  if(!ParseRefPoints(CfgParams.GetParameter("shifts"),vecShiftPoints,EMCS_ATLAS)) return false;
2705  m_ASPosParams[eASName].ShiftS=vecShiftPoints[0];
2706 
2707  return true;
2708 }

◆ SetupSWCorrections()

void ALFA_GeometryReader::SetupSWCorrections ( const PGEOMETRYCONFIGURATION  pConfig)
private

Definition at line 2896 of file ALFA_GeometryReader.cxx.

2897 {
2898  int i, nSign;
2899  double fTotYOffset;
2900 
2901  for(i=0;i<RPOTSCNT;i++){
2902  nSign=(i%2==0)? +1:-1;
2903  fTotYOffset=pConfig->CfgRPosParams[i].swcorr.fYOffset-nSign*(2.0*CLHEP::mm);//+nSign*arrFWDistance[i];
2904 
2905  m_RPPosParams[(eRPotName)(i+1)].OriginOfDetSWTransform=HepGeom::Point3D<double>(-77.5*CLHEP::mm+pConfig->CfgRPosParams[i].swcorr.fXOffset,-170.2*CLHEP::mm,114.0*CLHEP::mm);
2906  m_RPPosParams[(eRPotName)(i+1)].DetSWTransform=HepGeom::RotateZ3D(nSign*pConfig->CfgRPosParams[i].swcorr.fTheta);
2907  m_RPPosParams[(eRPotName)(i+1)].RPSWTransformInStation=HepGeom::Translate3D(-pConfig->CfgRPosParams[i].swcorr.fXOffset,fTotYOffset,0.0*CLHEP::mm);
2908  }
2909 }

◆ SetupUserCorrections()

void ALFA_GeometryReader::SetupUserCorrections ( const PGEOMETRYCONFIGURATION  pConfig)
private

Definition at line 2911 of file ALFA_GeometryReader.cxx.

2912 {
2914  for(int i=0;i<RPOTSCNT;i++){
2916  m_RPPosParams[(eRPotName)(i+1)].OriginOfDetSWTransform=pConfig->CfgRPosParams[i].usercorr.UserOriginOfDetTransInRPot;
2917  m_RPPosParams[(eRPotName)(i+1)].DetSWTransform=pConfig->CfgRPosParams[i].usercorr.UserTransformOfDetInRPot;
2918  m_RPPosParams[(eRPotName)(i+1)].RPSWTransformInStation=pConfig->CfgRPosParams[i].usercorr.UserTransformOfRPInStation;
2919  }
2920  }
2921  }
2922 }

◆ 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.

1485 {
1488  FIBERPARAMS FiberParams;
1489 
1490  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::SetVFiberPositionToMainReference");
1491 
1493  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1494  return;
1495  }
1496 
1497  if((rpiter=m_MapRPot.find(eRPName))!=m_MapRPot.end()){
1498  for(iter=(*rpiter).second.ListVFibers.begin();iter!=(*rpiter).second.ListVFibers.end();++iter){
1499  if(((*iter).nPlateID==nPlateID) && ((*iter).nFiberID==nFiberID)) break;
1500  }
1501 
1502  if(iter==(*rpiter).second.ListVFibers.end()){
1503  LogStream<<MSG::ERROR<<"Cannot find fiber PotID="<<eRPName<<", PlateID="<<nPlateID<<" and FiberID="<<nFiberID<<endmsg;
1504  //throw new Exception("Wrong U-fiber");
1505  }
1506  else{
1507  (*iter).MainRefPointPos=TransPoint;
1508  (*iter).fMainRefPointSlope=fTransSlope;
1509  }
1510  }
1511  else{
1512  LogStream<<MSG::ERROR<<"Unknown Roman pot PotID="<<eRPName<<endmsg;
1513  }
1514 }

◆ StoreReconstructionGeometry()

bool ALFA_GeometryReader::StoreReconstructionGeometry ( const eRPotName  eRPName,
const eFiberType  eFType,
const char *  szDataDestination 
)

Definition at line 1625 of file ALFA_GeometryReader.cxx.

1626 {
1627  int i,j;
1628  double fParamB, fY, fX, fZ, fSlope;
1629  FILE * pFile;
1630  FIBERPARAMS FiberParams;
1631 
1632  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::StoreReconstructionGeometry");
1633 
1635  LogStream<<MSG::ERROR<<"Invalid coordinate system"<<endmsg;
1636  return false;
1637  }
1638 
1639  pFile = fopen(szDataDestination, "w");
1640  if(pFile==nullptr) return false;
1641 
1642  fprintf(pFile, "xxxxxxxxxxxxxxxxxxx\n");
1643 
1644 
1645  if (eFType==EFT_FIBERMD)
1646  {
1647  fprintf(pFile, "20\n");
1648 
1649  for(i=1;i<=ALFAPLATESCNT;i++){
1650  //U-fiber
1651  for(j=1;j<=ALFAFIBERSCNT;j++){
1652  if(GetUFiberParams(&FiberParams, eRPName, i, j)){
1654  fX=FiberParams.MainRefPointPos.x();
1655  fY=FiberParams.MainRefPointPos.y();
1656  fZ=FiberParams.MainRefPointPos.z();
1657  fSlope=FiberParams.fMainRefPointSlope;
1658  //fSlope=FiberParams.fSlope;
1659  fParamB=fY-fSlope*fX;
1660  }
1661  else {
1662  fSlope=FiberParams.fcs_atlas.fSlope;
1663  fParamB=FiberParams.fcs_atlas.fOffset;
1664  fZ=FiberParams.fcs_atlas.fZPos;
1665  }
1666 
1667  fprintf(pFile, " %2d %2d %7.5f %7.4f %7.3f\n", (i*2-1), j, fSlope, fParamB, fZ);
1668  }
1669  }
1670 
1671  //V-fiber
1672  for(j=1;j<=ALFAFIBERSCNT;j++){
1673  if(GetVFiberParams(&FiberParams, eRPName, i, j)){
1675  fX=FiberParams.MainRefPointPos.x();
1676  fY=FiberParams.MainRefPointPos.y();
1677  fZ=FiberParams.MainRefPointPos.z();
1678  fSlope=FiberParams.fMainRefPointSlope;
1679  //fSlope=FiberParams.fSlope;
1680  fParamB=fY-fSlope*fX;
1681  }
1682  else {
1683  fSlope=FiberParams.fcs_atlas.fSlope;
1684  fParamB=FiberParams.fcs_atlas.fOffset;
1685  fZ=FiberParams.fcs_atlas.fZPos;
1686  }
1687 
1688  fprintf(pFile, " %2d %2d %7.5f %7.4f %7.3f\n", (i*2), j, fSlope, fParamB, fZ);
1689  }
1690  }
1691  }
1692  }
1693  else if (eFType==EFT_FIBEROD)
1694  {
1695  fprintf(pFile, "6\n");
1696 
1697  for(int i=1; i<=ODPLATESCNT; i++)
1698  {
1699  //V0-ODFiber
1700  for(j=1;j<=ODFIBERSCNT;j++)
1701  {
1702  if(GetODFiberParams(&FiberParams, EFT_ODFIBERV0, eRPName, i, j))
1703  {
1705  fX=FiberParams.MainRefPointPos.x();
1706  fY=FiberParams.MainRefPointPos.y();
1707  fZ=FiberParams.MainRefPointPos.z();
1708  fSlope=FiberParams.fMainRefPointSlope;
1709  fParamB=fY-fSlope*fX;
1710  }
1711  else {
1712  fSlope=FiberParams.fcs_atlas.fSlope;
1713  fParamB=FiberParams.fcs_atlas.fOffset;
1714  fZ=FiberParams.fcs_atlas.fZPos;
1715  }
1716 
1717  fprintf(pFile, " %2d %2d %7.5f %7.4f %7.3f\n", (i*2-1), j, fSlope, fParamB, fZ);
1718  }
1719  }
1720 
1721  //U0-ODFiber (note: U0-nFiberID is indexed from 16 to 30)
1722  for(j=ODFIBERSCNT+1;j<=ODFIBERSCNT+15;j++)
1723  {
1724  if(GetODFiberParams(&FiberParams, EFT_ODFIBERU0, eRPName, i, j))
1725  {
1727  fX=FiberParams.MainRefPointPos.x();
1728  fY=FiberParams.MainRefPointPos.y();
1729  fZ=FiberParams.MainRefPointPos.z();
1730  fSlope=FiberParams.fMainRefPointSlope;
1731  fParamB=fY-fSlope*fX;
1732  }
1733  else {
1734  fSlope=FiberParams.fcs_atlas.fSlope;
1735  fParamB=FiberParams.fcs_atlas.fOffset;
1736  fZ=FiberParams.fcs_atlas.fZPos;
1737  }
1738 
1739  fprintf(pFile, " %2d %2d %7.5f %7.4f %7.3f\n", (i*2-1), j, fSlope, fParamB, fZ);
1740  }
1741  }
1742 
1743 
1744  for(j=1;j<=ODFIBERSCNT;j++)
1745  {
1746  if(GetODFiberParams(&FiberParams, EFT_ODFIBERV1, eRPName, i, j))
1747  {
1749  fX=FiberParams.MainRefPointPos.x();
1750  fY=FiberParams.MainRefPointPos.y();
1751  fZ=FiberParams.MainRefPointPos.z();
1752  fSlope=FiberParams.fMainRefPointSlope;
1753  fParamB=fY-fSlope*fX;
1754  }
1755  else {
1756  fSlope=FiberParams.fcs_atlas.fSlope;
1757  fParamB=FiberParams.fcs_atlas.fOffset;
1758  fZ=FiberParams.fcs_atlas.fZPos;
1759  }
1760  fprintf(pFile, " %2d %2d %7.5f %7.4f %7.3f\n", (i*2), j, fSlope, fParamB, fZ);
1761  }
1762  }
1763 
1764  //U1-ODFiber
1765 
1766  for(j=ODFIBERSCNT+1;j<=ODFIBERSCNT+15;j++)
1767  {
1768  if(GetODFiberParams(&FiberParams, EFT_ODFIBERU1, eRPName, i, j))
1769  {
1771  fX=FiberParams.MainRefPointPos.x();
1772  fY=FiberParams.MainRefPointPos.y();
1773  fZ=FiberParams.MainRefPointPos.z();
1774  fSlope=FiberParams.fMainRefPointSlope;
1775  fParamB=fY-fSlope*fX;
1776  }
1777  else {
1778  fSlope=FiberParams.fcs_atlas.fSlope;
1779  fParamB=FiberParams.fcs_atlas.fOffset;
1780  fZ=FiberParams.fcs_atlas.fZPos;
1781  }
1782  fprintf(pFile, " %2d %2d %7.5f %7.4f %7.3f\n", (i*2), j, fSlope, fParamB, fZ);
1783  }
1784  }
1785 
1786  }
1787  }
1788 
1789  fclose(pFile);
1790 
1791  return true;
1792 }

◆ TransformFiberPositions()

void ALFA_GeometryReader::TransformFiberPositions ( PFIBERPARAMS  pFiberParams,
eRPotName  eRPName,
const eFiberType  eType,
const eGeoSourceType  eSourceType 
)
private

Definition at line 120 of file ALFA_GeometryReader.cxx.

121 {
122  switch(m_eFCoordSystem)
123  {
124  case EFCS_CLADDING:
125  TransformFiberPositionsFCSCladding(pFiberParams, eRPName, eType, eSourceType);
126  break;
127  case EFCS_ATLAS:
128  TransformFiberPositionsFCSAtlas(pFiberParams, eRPName, eType, eSourceType);
129  break;
130  default:
131  break;
132  }
133 }

◆ TransformFiberPositionsFCSAtlas()

void ALFA_GeometryReader::TransformFiberPositionsFCSAtlas ( PFIBERPARAMS  pFiberParams,
eRPotName  eRPName,
const eFiberType  eType,
const eGeoSourceType  eSourceType 
)
private

Definition at line 266 of file ALFA_GeometryReader.cxx.

267 {
268  HepGeom::Transform3D TotTrans;
269  RPPOSPARAMS RPPosParams;
270  ASPOSPARAMS ASPosParams;
271  GetRPPosParams(&RPPosParams, eRPName);
272  GetASPosParams(&ASPosParams, RPPosParams.eASName);
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;
277 
278  static constexpr double fSCY_ODFiberU=-106.333;
279  static constexpr double fSCY_ODFiberV=-113.833;
280 
281  double fCentrePos=0.0, fZOffset=0.0;
282  double fStagger=0.0;
283 
284  switch(eType)
285  {
286  case EFT_VFIBER:
287  case EFT_UFIBER:
288  fStagger=MD_stagger[pFiberParams->nPlateID-1]*CLHEP::mm;
289 
290  if(eSourceType==EGST_IDEALGEOMETRY){
291  if(eType==EFT_VFIBER){
292  fCentrePos=(+15.75-0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
293  pFiberParams->fOffset=-1.414213562*fCentrePos+fSCY-fStagger;
294  }
295  else if(eType==EFT_UFIBER){
296  fCentrePos=(+15.75-0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
297  pFiberParams->fOffset=+1.414213562*fCentrePos+fSCY+fStagger;
298  }
299  }
300 
301  if(!RPPosParams.bIsLow) fZOffset=(pFiberParams->nLayerID-1)*CLHEP::mm;
302  else fZOffset=-(pFiberParams->nLayerID-1)*CLHEP::mm;
303 
304  break;
305  case EFT_ODFIBERV0:
306  case EFT_ODFIBERV1:
307  if(const auto i = pFiberParams->nPlateID; (i<1) || (i>3)){
308  LogStream<<MSG::ERROR<<"(EFT_ODFIBERV1): Wrong ODPlateID "<<i<<" (RP no."<<eRPName<<")"<<endmsg;
309  return;
310  } else {
311  fStagger=OD_stagger[i-1]*CLHEP::mm;
312  }
313 
314 
315  if(eSourceType==EGST_IDEALGEOMETRY){
316  if(eType==EFT_ODFIBERV0){
317  fCentrePos=(-29.75+0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
318  pFiberParams->fOffset=fCentrePos+fSCY_ODFiberV+fStagger;
319  }
320  else if(eType==EFT_ODFIBERV1){
321  fCentrePos=(-29.75+0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
322  pFiberParams->fOffset=fCentrePos+fSCY_ODFiberV+fStagger;
323  }
324  }
325 
326  if(!RPPosParams.bIsLow) fZOffset=2*(pFiberParams->nPlateID-1)*CLHEP::mm+33.65*CLHEP::mm;
327  else fZOffset=-2*(pFiberParams->nPlateID-1)*CLHEP::mm-33.65*CLHEP::mm;
328  break;
329  case EFT_ODFIBERU0:
330  case EFT_ODFIBERU1:{
331  if(const auto i = pFiberParams->nPlateID; (i<1) || (i>3)){
332  LogStream<<MSG::ERROR<<"(EFT_ODFIBERU1): Wrong ODPlateID "<<i<<" (RP no."<<eRPName<<")"<<endmsg;
333  return;
334  } else {
335  fStagger=OD_stagger[i-1]*CLHEP::mm;
336  }
337 
338  if(eSourceType==EGST_IDEALGEOMETRY){
339  if(eType==EFT_ODFIBERU0){
340  fCentrePos=(-29.75+0.5*(pFiberParams->nFiberID-16))*CLHEP::mm;
341  pFiberParams->fOffset=fCentrePos+fSCY_ODFiberU+fStagger;
342  }
343  else if(eType==EFT_ODFIBERU1){
344  fCentrePos=(-29.75+0.5*(pFiberParams->nFiberID-16))*CLHEP::mm;
345  pFiberParams->fOffset=fCentrePos+fSCY_ODFiberU+fStagger;
346  }
347  }
348 
349  if(!RPPosParams.bIsLow) fZOffset=2*(pFiberParams->nPlateID-1)*CLHEP::mm+32.35*CLHEP::mm;
350  else fZOffset=-2*(pFiberParams->nPlateID-1)*CLHEP::mm-32.35*CLHEP::mm;
351  break;
352  }
353  default:
354  break;
355  }
356 
357  HepGeom::Point3D<double> DetFiberPoint1, DetFiberPoint2, DetPin1Point;
358  HepGeom::Point3D<double> AtlFiberPoint1, AtlFiberPoint2, AtlDetPin1Point;
359  HepGeom::Point3D<double> AtlProjFiberPoint1, AtlProjFiberPoint2;
360 
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);
364 
365  AtlDetPin1Point=GetDetPointInAtlas(eRPName,AtlDetPin1Point);
366  AtlFiberPoint1=GetDetPointInAtlas(eRPName,DetFiberPoint1);
367  AtlFiberPoint2=GetDetPointInAtlas(eRPName,DetFiberPoint2);
368 
369  AtlProjFiberPoint1=HepGeom::Point3D<double>(AtlFiberPoint1[0],AtlFiberPoint1[1],AtlDetPin1Point[2]+fZOffset);
370  AtlProjFiberPoint2=HepGeom::Point3D<double>(AtlFiberPoint2[0],AtlFiberPoint2[1],AtlDetPin1Point[2]+fZOffset);
371 
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]);
374 
375  pFiberParams->fcs_atlas.fSlope=-fy1/fx2;
376  pFiberParams->fcs_atlas.fOffset=fy1;
377  pFiberParams->fcs_atlas.fZPos=AtlDetPin1Point[2]+fZOffset;
378 
379  //add full space parameters
380  HepGeom::Vector3D<double> DirVector=AtlFiberPoint2-AtlFiberPoint1;
381 
382  pFiberParams->fcs_atlas_full.fOriginX=AtlFiberPoint1[0];
383  pFiberParams->fcs_atlas_full.fOriginY=AtlFiberPoint1[1];
384  pFiberParams->fcs_atlas_full.fOriginZ=AtlFiberPoint1[2];
385  pFiberParams->fcs_atlas_full.fDirX=DirVector[0]/DirVector.mag();
386  pFiberParams->fcs_atlas_full.fDirY=DirVector[1]/DirVector.mag();
387  pFiberParams->fcs_atlas_full.fDirZ=DirVector[2]/DirVector.mag();
388 
389 
390 }

◆ TransformFiberPositionsFCSCladding()

void ALFA_GeometryReader::TransformFiberPositionsFCSCladding ( PFIBERPARAMS  pFiberParams,
eRPotName  eRPName,
const eFiberType  eType,
const eGeoSourceType  eSourceType 
)
private

Definition at line 135 of file ALFA_GeometryReader.cxx.

136 {
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;
140 
141  static constexpr double fSCY_ODFiberU=-106.333;
142  static constexpr double fSCY_ODFiberV=-113.833;
143 
144  static constexpr double fSCX_ODFiber00=-23.00;
145  static constexpr double fSCX_ODFiber01=+23.00;
146 
147  double fStagger=0.0;
148 
149  MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::TransformFiberPositionsFCSCladding");
150 
151  switch(eType)
152  {
153  case EFT_UFIBER:
154  case EFT_VFIBER:
155  if(pFiberParams->nPlateID<1 || pFiberParams->nPlateID>10){
156  LogStream<<MSG::ERROR<<"(EFT_VFIBER): Wrong PlateID "<<pFiberParams->nPlateID<<" (RP no."<<eRPName<<")"<<endmsg;
157  return;
158  } else {
159  fStagger=ALFA_stagger[pFiberParams->nPlateID-1]*CLHEP::mm;
160  }
161  break;
162  case EFT_ODFIBERU0:
163  case EFT_ODFIBERU1:
164  case EFT_ODFIBERV0:
165  case EFT_ODFIBERV1:
166  if(const auto i = pFiberParams->nPlateID; (i<1) || (i>3)){
167  LogStream<<MSG::ERROR<<"(EFT_ODFIBERV1): Wrong ODPlateID "<<i<<" (RP no."<<eRPName<<")"<<endmsg;
168  return;
169  } else {
170  fStagger=OD_stagger[i-1]*CLHEP::mm;
171  }
172  break;
173  default:
174  break;
175  }
176 
177  switch(eSourceType){
178  case EGST_IDEALGEOMETRY:
179  if(eType==EFT_VFIBER){
180  pFiberParams->fcs_cladding.fAngle=(+90*CLHEP::deg-atan(pFiberParams->fSlope))-(+45*CLHEP::deg);
181  pFiberParams->fcs_cladding.fCentreXPos=(+15.75-0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
182 
183  //adjust fiber offset
184  pFiberParams->fOffset=-1.414213562*pFiberParams->fcs_cladding.fCentreXPos+fSCY-fStagger;
185  }
186  if(eType==EFT_UFIBER){
187  pFiberParams->fcs_cladding.fAngle=(-90*CLHEP::deg-atan(pFiberParams->fSlope))-(-45*CLHEP::deg);
188  pFiberParams->fcs_cladding.fCentreXPos=(+15.75-0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
189 
190  //adjust fiber offset
191  pFiberParams->fOffset=+1.414213562*pFiberParams->fcs_cladding.fCentreXPos+fSCY+fStagger;
192  }
193  if(eType==EFT_ODFIBERV0)
194  {
195  pFiberParams->fcs_cladding.fAngle=0*CLHEP::deg;
196  pFiberParams->fcs_cladding.fCentreYPos=(-29.75+0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
197 
198  //adjust fiber offset
199  pFiberParams->fOffset=pFiberParams->fcs_cladding.fCentreYPos+fSCY_ODFiberV+fStagger;
200  }
201  if(eType==EFT_ODFIBERU0)
202  {
203  pFiberParams->fcs_cladding.fAngle=0*CLHEP::deg;
204  pFiberParams->fcs_cladding.fCentreYPos=(-29.75+0.5*(pFiberParams->nFiberID-16))*CLHEP::mm;
205 
206  //adjust fiber offset
207  pFiberParams->fOffset=pFiberParams->fcs_cladding.fCentreYPos+fSCY_ODFiberU+fStagger;
208  }
209  if(eType==EFT_ODFIBERU1)
210  {
211  pFiberParams->fcs_cladding.fAngle=0*CLHEP::deg;
212  pFiberParams->fcs_cladding.fCentreYPos=(-29.75+0.5*(pFiberParams->nFiberID-16))*CLHEP::mm;
213 
214  //adjust fiber offset
215  pFiberParams->fOffset=pFiberParams->fcs_cladding.fCentreYPos+fSCY_ODFiberU+fStagger;
216  }
217  if (eType==EFT_ODFIBERV1)
218  {
219  pFiberParams->fcs_cladding.fAngle=0*CLHEP::deg;
220  //1.10.2010 LN: change of indexation scheme
221  //pFiberParams->fcs_cladding.fCentreYPos=(-22.75-0.5*(pFiberParams->nFiberID-16))*CLHEP::mm;
222  pFiberParams->fcs_cladding.fCentreYPos=(-29.75+0.5*(pFiberParams->nFiberID-1))*CLHEP::mm;
223 
224  //adjust fiber offset
225  pFiberParams->fOffset=pFiberParams->fcs_cladding.fCentreYPos+fSCY_ODFiberV+fStagger;
226  }
227  break;
228  case EGST_FILE:
229  case EGST_DATABASE:
230  if(eType==EFT_VFIBER){
231  //Geant4: pFiberParams->fAngle=(+90*deg-atan(pFiberParams->fSlope))-(+45*deg);
232  pFiberParams->fcs_cladding.fAngle=(+90*CLHEP::deg-atan(pFiberParams->fSlope))-(+45*CLHEP::deg);
233  pFiberParams->fcs_cladding.fCentreXPos=1.414213562*((fStagger+fSCY-pFiberParams->fOffset)/(pFiberParams->fSlope+1)-fStagger);
234  }
235  if(eType==EFT_UFIBER){
236  //Geant4: pFiberParams->fAngle=(-90*deg-atan(pFiberParams->fSlope))-(-45*deg);
237  pFiberParams->fcs_cladding.fAngle=(-90*CLHEP::deg-atan(pFiberParams->fSlope))-(-45*CLHEP::deg);
238  pFiberParams->fcs_cladding.fCentreXPos=1.414213562*((-fStagger+fSCY-pFiberParams->fOffset)/(pFiberParams->fSlope-1)-fStagger);
239  }
240  if(eType==EFT_ODFIBERV0)
241  {
242  pFiberParams->fcs_cladding.fAngle=atan(pFiberParams->fSlope);
243  pFiberParams->fcs_cladding.fCentreYPos=pFiberParams->fSlope*fSCX_ODFiber00+pFiberParams->fOffset-fSCY_ODFiberV-fStagger;
244  }
245  if(eType==EFT_ODFIBERV1)
246  {
247  pFiberParams->fcs_cladding.fAngle=(-1)*atan(pFiberParams->fSlope);
248  pFiberParams->fcs_cladding.fCentreYPos=pFiberParams->fSlope*fSCX_ODFiber01+pFiberParams->fOffset-fSCY_ODFiberV-fStagger;
249  }
250  if(eType==EFT_ODFIBERU0)
251  {
252  pFiberParams->fcs_cladding.fAngle=atan(pFiberParams->fSlope);
253  pFiberParams->fcs_cladding.fCentreYPos=pFiberParams->fSlope*fSCX_ODFiber00+pFiberParams->fOffset-fSCY_ODFiberU-fStagger;
254  }
255  if(eType==EFT_ODFIBERU1)
256  {
257  pFiberParams->fcs_cladding.fAngle=(-1)*atan(pFiberParams->fSlope);
258  pFiberParams->fcs_cladding.fCentreYPos=pFiberParams->fSlope*fSCX_ODFiber01+pFiberParams->fOffset-fSCY_ODFiberU-fStagger;
259  }
260  break;
261  default:
262  break;
263  }
264 }

◆ UpdateGeometry()

void ALFA_GeometryReader::UpdateGeometry ( )
private

Definition at line 1794 of file ALFA_GeometryReader.cxx.

1795 {
1796  int i;
1798  std::list<FIBERPARAMS>::const_iterator iter;
1799  FIBERPARAMS Fiber01Params,Fiber64Params;
1800 
1801  for(rpiter=m_MapRPot.begin();rpiter!=m_MapRPot.end();++rpiter){
1802  for(i=1;i<=10;i++){
1803  GetUFiberParams(&Fiber01Params,(*rpiter).first,i,1);
1804  GetUFiberParams(&Fiber64Params,(*rpiter).first,i,64);
1805  (*rpiter).second.MapPlates[i].fUCladdingSizeX=2.0*(fmax(fabs(Fiber01Params.fcs_cladding.fCentreXPos),fabs(Fiber64Params.fcs_cladding.fCentreXPos))+0.24);
1806 
1807  GetVFiberParams(&Fiber01Params,(*rpiter).first,i,1);
1808  GetVFiberParams(&Fiber64Params,(*rpiter).first,i,64);
1809  (*rpiter).second.MapPlates[i].fVCladdingSizeX=2.0*(fmax(fabs(Fiber01Params.fcs_cladding.fCentreXPos),fabs(Fiber64Params.fcs_cladding.fCentreXPos))+0.24);
1810  }
1811  }
1812 }

◆ UpdateSimRPPos()

void ALFA_GeometryReader::UpdateSimRPPos ( const eRPotName  eRPName)
private

Definition at line 744 of file ALFA_GeometryReader.cxx.

745 {
746  int i, nCnt;
747  HepGeom::Transform3D CorrTransform;
748  HepGeom::Scale3D AuxScale;
749  RPPOSPARAMS& Params=m_RPPosParams[eRPName];
750 
751  //MsgStream LogStream(Athena::getMessageSvc(), "ALFA_GeometryReader::UpdateSimRPPos");
752 
753  //correct position of the RP in the station due to metrology data -------------------------------------------------------------------
754  nCnt=Params.VecIdealRPRefPoints.size();
755  HepGeom::Transform3D IdealTransform=Params.RPIdealTransformInStation;
756  if(m_eMetrologyType==EMT_METROLOGY) CorrTransform=ComputeTransformMatrix(Params.VecIdealRPRefPoints,Params.VecRealRPRefPoints, nCnt, AuxScale,true);
757  else CorrTransform=HepGeom::Transform3D();
758 
759  //----------------------------------------------
760  //double fRotZ=atan2(CorrTransform.yx(),CorrTransform.xx());
761  //HepGeom::Transform3D auxTransform=HepGeom::Transform3D(HepRotationZ(fRotZ),CorrTransform.getTranslation());
762  //CorrTransform=auxTransform;
763  //----------------------------------------------
764 
765  //note: SW Corrections are set either via EMT_SWCORRECTIONS flag or by user with EMT_NOMINAL flag
766  m_RPPosParams[eRPName].RPTransformInStation=m_ASPosParams[Params.eASName].ASTransformInMainPoint*CorrTransform*Params.RPSWTransformInStation*IdealTransform;
767  m_RPPosParams[eRPName].RPScaleInStation=AuxScale;
768 
769  m_RPPosParams[eRPName].RefPins.RealRPPin1=CorrTransform*Params.RPSWTransformInStation*m_RPPosParams[eRPName].RefPins.IdealRPPin1;
770  m_RPPosParams[eRPName].RefPins.RealRPPin2=CorrTransform*Params.RPSWTransformInStation*m_RPPosParams[eRPName].RefPins.IdealRPPin2;
771  m_RPPosParams[eRPName].RefPins.RealRPPin3=CorrTransform*Params.RPSWTransformInStation*m_RPPosParams[eRPName].RefPins.IdealRPPin3;
772 
773  HepGeom::Vector3D<double> NominalDetNormal=HepGeom::Vector3D<double>(0.0,0.0,1.0);
774  m_RPPosParams[eRPName].DetectorNormal=m_RPPosParams[eRPName].RPTransformInStation*NominalDetNormal;
775 
776  //correct position of the RP's detector in the RP due to metrology data --------------------------------------------------------------
777  IdealTransform=Params.DetIdealTransformInMainPoint;
778 
779  HepGeom::Point3D<double> RPPin1,MainPoint; //point relative to the station
780 
781  RPPin1=ms_NominalRPPin1;
782  MainPoint=ms_NominalRPMainPoint;
783 
785  nCnt=Params.VecIdealDetRefPoints.size();
786  std::vector<HepGeom::Point3D<double> > VecIdealDetRefPoints(nCnt);
787  std::vector<HepGeom::Point3D<double> > VecRealDetRefPoints(nCnt);
788 
789  for(i=0;i<(int)Params.VecIdealDetRefPoints.size();i++){
790  VecIdealDetRefPoints[i]=m_RPPosParams[eRPName].VecIdealDetRefPoints[i];//+CoordShift;
791  VecRealDetRefPoints[i]=m_RPPosParams[eRPName].VecRealDetRefPoints[i];//+CoordShift;
792  }
793 
794  CorrTransform=ComputeTransformMatrix(VecIdealDetRefPoints,VecRealDetRefPoints, nCnt, AuxScale);
795  }
796  else{
797  CorrTransform=HepGeom::Transform3D();
798  }
799 
800  //recalculate SW transform in MainPoint
801  HepGeom::Vector3D<double> OriginShift=(RPPin1-MainPoint)+Params.OriginOfDetSWTransform;
802  CLHEP::Hep3Vector TranslationInMainPoint=Params.DetSWTransform.getTranslation()-Params.DetSWTransform*OriginShift+OriginShift;
803  CLHEP::HepRotation RotationInMainPoint=Params.DetSWTransform.getRotation();
804  m_RPPosParams[eRPName].DetSWTransformInMainPoint=HepGeom::Transform3D(RotationInMainPoint,TranslationInMainPoint);
805 
806  m_RPPosParams[eRPName].DetTransformInMainPoint=m_RPPosParams[eRPName].DetSWTransformInMainPoint*CorrTransform*IdealTransform;
807  m_RPPosParams[eRPName].RPScaleInStation=AuxScale;
808 
809  m_RPPosParams[eRPName].RefPins.DTPInAtlasCS=GetDetPointInAtlas(eRPName,m_RPPosParams[eRPName].RefPins.DTPInAlfaCS);
810  m_RPPosParams[eRPName].RefPins.DTPInRPotCS=GetDetPointInRPot(eRPName,m_RPPosParams[eRPName].RefPins.DTPInAlfaCS);
811  m_RPPosParams[eRPName].RefPins.DCPInAtlasCS=GetDetPointInAtlas(eRPName,m_RPPosParams[eRPName].RefPins.DCPInAlfaCS);
812  m_RPPosParams[eRPName].RefPins.DCPInRPotCS=GetDetPointInRPot(eRPName,m_RPPosParams[eRPName].RefPins.DCPInAlfaCS);
813 }

◆ UpdateStationsPosParams()

void ALFA_GeometryReader::UpdateStationsPosParams ( )
private

Definition at line 713 of file ALFA_GeometryReader.cxx.

714 {
715  ASPOSPARAMS Params;
716  eAStationName eASName;
717  HepGeom::Vector3D<double> MeanShift;
718 
719  //EASN_B7L1
720  eASName=EASN_B7L1;
721  GetASPosParams(&Params,eASName);
722  MeanShift=0.5*(Params.ShiftE+Params.ShiftS);
723  m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
724 
725  //EASN_A7L1
726  eASName=EASN_A7L1;
727  GetASPosParams(&Params,eASName);
728  MeanShift=0.5*(Params.ShiftE+Params.ShiftS);
729  m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
730 
731  //EASN_A7R1
732  eASName=EASN_A7R1;
733  GetASPosParams(&Params,eASName);
734  MeanShift=0.5*(Params.ShiftE+Params.ShiftS);
735  m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
736 
737  //EASN_B7R1
738  eASName=EASN_B7R1;
739  GetASPosParams(&Params,eASName);
740  MeanShift=0.5*(Params.ShiftE+Params.ShiftS);
741  m_ASPosParams[eASName].ASTransformInMainPoint=HepGeom::Translate3D(MeanShift);
742 }

Member Data Documentation

◆ m_ASPosParams

std::map<eAStationName,ASPOSPARAMS> ALFA_GeometryReader::m_ASPosParams

Definition at line 229 of file ALFA_GeometryReader.h.

◆ m_ConfigOpts

GEOMETRYCONFIGURATION ALFA_GeometryReader::m_ConfigOpts
private

Definition at line 224 of file ALFA_GeometryReader.h.

◆ m_eFCoordSystem

eFiberCoordSystem ALFA_GeometryReader::m_eFCoordSystem
private

Definition at line 223 of file ALFA_GeometryReader.h.

◆ m_eMetrologyType

eMetrologyType ALFA_GeometryReader::m_eMetrologyType
private

Definition at line 225 of file ALFA_GeometryReader.h.

◆ m_ListExistingRPots

std::list<eRPotName> ALFA_GeometryReader::m_ListExistingRPots
private

Definition at line 233 of file ALFA_GeometryReader.h.

◆ m_MapRPot

std::map<eRPotName,ROMAPOT> ALFA_GeometryReader::m_MapRPot
private

Definition at line 232 of file ALFA_GeometryReader.h.

◆ m_RPPosParams

std::map<eRPotName,RPPOSPARAMS> ALFA_GeometryReader::m_RPPosParams

Definition at line 228 of file ALFA_GeometryReader.h.

◆ 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

Definition at line 219 of file ALFA_GeometryReader.h.

◆ 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

Definition at line 220 of file ALFA_GeometryReader.h.

◆ 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

Definition at line 218 of file ALFA_GeometryReader.h.

◆ 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

Definition at line 217 of file ALFA_GeometryReader.h.


The documentation for this class was generated from the following files:
GEOMETRYCONFIGURATION::fNominalZPosB7R1
double fNominalZPosB7R1
Definition: ALFA_GeometryReader.h:204
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ERPT_IDEAL
@ ERPT_IDEAL
Definition: ALFA_GeometryReader.h:30
ALFA_GeometryReader::TransformFiberPositions
void TransformFiberPositions(PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType)
Definition: ALFA_GeometryReader.cxx:120
CFGRPPOSPARAMS::fYOffset
double fYOffset
Definition: ALFA_GeometryReader.h:182
eFiberType
eFiberType
Definition: ALFA_GeometryReader.h:25
RPPINS::DTPInAlfaCS
HepGeom::Point3D< double > DTPInAlfaCS
Definition: ALFA_GeometryReader.h:42
RPPOSPARAMS
Definition: ALFA_GeometryReader.h:49
ALFA_GeometryReader::ReadFile
bool ReadFile(const eRPotName eRPName, const eFiberType eFType, const char *szFilename)
Definition: ALFA_GeometryReader.cxx:1088
RPPOSPARAMS::IdealMainPointInStation
HepGeom::Point3D< double > IdealMainPointInStation
Definition: ALFA_GeometryReader.h:52
FIBERPARAMS::nLayerID
int nLayerID
Definition: ALFA_GeometryReader.h:101
PathResolver::RecursiveSearch
@ RecursiveSearch
Definition: PathResolver.h:28
ALFA_ConfigParams::Init
int Init(const char *szFile, const char *szSection)
Definition: ALFA_ConfigParams.cxx:36
METROLOGYFILE
#define METROLOGYFILE
Definition: ALFA_constants.h:36
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
dsvd
int dsvd(double **a, int m, int n, double *w, double **v)
Definition: ALFA_SvdCalc.cxx:38
ALFA_ConfigParams::GetParameter
const char * GetParameter(const char *szKey) const
Definition: ALFA_ConfigParams.cxx:82
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
EFT_ODFIBERV0
@ EFT_ODFIBERV0
Definition: ALFA_GeometryReader.h:25
ODLAYERSCNT
#define ODLAYERSCNT
Definition: ALFA_CLinkAlg.h:30
ROMAPOT::ListODFibersU1
std::list< FIBERPARAMS > ListODFibersU1
Definition: ALFA_GeometryReader.h:152
RPPOSPARAMS::IdealMainPoint
HepGeom::Point3D< double > IdealMainPoint
Definition: ALFA_GeometryReader.h:51
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
FIBERPARAMS::fOriginY
double fOriginY
Definition: ALFA_GeometryReader.h:118
ROMAPOT::ListVFibers
std::list< FIBERPARAMS > ListVFibers
Definition: ALFA_GeometryReader.h:149
ASPOSPARAMS::clear
void clear()
Definition: ALFA_GeometryReader.cxx:35
EGST_IDEALGEOMETRY
@ EGST_IDEALGEOMETRY
Definition: ALFA_GeometryReader.h:23
LArNewCalib_Delay_OFC_Cali.pfile
string pfile
Definition: LArNewCalib_Delay_OFC_Cali.py:173
JetTiledMap::W
@ W
Definition: TiledEtaPhiMap.h:44
RPPINS::IdealRPPin3
HepGeom::Point3D< double > IdealRPPin3
Definition: ALFA_GeometryReader.h:39
RPPINS::DCPInAlfaCS
HepGeom::Point3D< double > DCPInAlfaCS
Definition: ALFA_GeometryReader.h:43
EMCS_STATION
@ EMCS_STATION
Definition: ALFA_GeometryReader.h:31
ALFA_GeometryReader::SetupCurrentLVDT
void SetupCurrentLVDT(const PGEOMETRYCONFIGURATION pConfig)
Definition: ALFA_GeometryReader.cxx:2884
ALFA_RDBAccess::ReadGeometry
bool ReadGeometry(const eRPotName eRPName, eFiberType eFType, const std::string &element, const std::string &tag, const std::string &node)
Definition: ALFA_RDBAccess.cxx:17
ERPN_B7R1U
@ ERPN_B7R1U
Definition: ALFA_GeometryReader.h:27
ALFA_GeometryReader::SetupUserCorrections
void SetupUserCorrections(const PGEOMETRYCONFIGURATION pConfig)
Definition: ALFA_GeometryReader.cxx:2911
ALFA_GeometryReader::ReadDatabase
bool ReadDatabase(const eRPotName eRPName, const eFiberType eFType, const char *szDataSource)
Definition: ALFA_GeometryReader.cxx:1234
FIBERPARAMS::fOffset
double fOffset
Definition: ALFA_GeometryReader.h:113
FIBERPARAMS::fZPos
double fZPos
Definition: ALFA_GeometryReader.h:114
ALFA_ConfigParams
Definition: ALFA_ConfigParams.h:21
INACTIVEDETEGDEDISTANCE
#define INACTIVEDETEGDEDISTANCE
Definition: ALFA_constants.h:32
ALFA_GeometryReader::SetIdealGeometry
bool SetIdealGeometry(const eRPotName eRPName, const eFiberType eFType)
Definition: ALFA_GeometryReader.cxx:1003
ALFAFIBERSCNT
#define ALFAFIBERSCNT
Definition: ALFA_constants.h:10
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
eRPotName
eRPotName
Definition: ALFA_GeometryReader.h:27
DMTest::C
C_v1 C
Definition: C.h:26
EMT_SWCORRECTIONS
@ EMT_SWCORRECTIONS
Definition: ALFA_GeometryReader.h:24
ALFA_GeometryReader::m_eFCoordSystem
eFiberCoordSystem m_eFCoordSystem
Definition: ALFA_GeometryReader.h:223
RPPOSPARAMS::IdealRefPoint
HepGeom::Point3D< double > IdealRefPoint
Definition: ALFA_GeometryReader.h:53
ALFA_GeometryReader::TransformFiberPositionsFCSAtlas
void TransformFiberPositionsFCSAtlas(PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType)
Definition: ALFA_GeometryReader.cxx:266
ALFA_GeometryReader::GetRPotLabel
const char * GetRPotLabel(const eRPotName eRPName)
Definition: ALFA_GeometryReader.h:278
FIBERPARAMS::fAngle
double fAngle
Definition: ALFA_GeometryReader.h:108
ERPN_A7L1U
@ ERPN_A7L1U
Definition: ALFA_GeometryReader.h:27
ROMAPOT::ListODFibersU0
std::list< FIBERPARAMS > ListODFibersU0
Definition: ALFA_GeometryReader.h:150
ALFA_GeometryReader::GetVFiberParams
bool GetVFiberParams(PFIBERPARAMS pFiberParams, const eRPotName eRPName, const int nPlateID, const int nFiberID)
Definition: ALFA_GeometryReader.cxx:1350
ASPOSPARAMS::IdealMainPoint
HepGeom::Point3D< double > IdealMainPoint
Definition: ALFA_GeometryReader.h:85
RPOTSCNT
#define RPOTSCNT
Definition: ALFA_CLinkAlg.h:26
FIBERPARAMS::fOriginX
double fOriginX
Definition: ALFA_GeometryReader.h:118
ASPOSPARAMS::ASTransformInATLAS
HepGeom::Transform3D ASTransformInATLAS
Definition: ALFA_GeometryReader.h:92
deg
#define deg
Definition: SbPolyhedron.cxx:17
RPPOSPARAMS::RefPins
RPPINS RefPins
Definition: ALFA_GeometryReader.h:56
FIBERPARAMS::fCentreYPos
double fCentreYPos
Definition: ALFA_GeometryReader.h:106
ERPN_B7R1L
@ ERPN_B7R1L
Definition: ALFA_GeometryReader.h:27
RunActsMaterialMapping.FilePath
FilePath
Definition: RunActsMaterialMapping.py:99
CFGRPPOSPARAMS::fTheta
double fTheta
Definition: ALFA_GeometryReader.h:184
EASN_A7R1
@ EASN_A7R1
Definition: ALFA_GeometryReader.h:26
RPPOSPARAMS::eASName
eAStationName eASName
Definition: ALFA_GeometryReader.h:55
ALFA_GeometryReader::GetDetPointInRPot
HepGeom::Point3D< double > GetDetPointInRPot(eRPotName eRPName, const HepGeom::Point3D< double > &PointInDetCS)
Definition: ALFA_GeometryReader.cxx:2751
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
RPPOSPARAMS::VecRealRPRefPoints
std::vector< HepGeom::Point3D< double > > VecRealRPRefPoints
Definition: ALFA_GeometryReader.h:62
GEOMETRYCONFIGURATION::fNominalZPosB7L1
double fNominalZPosB7L1
Definition: ALFA_GeometryReader.h:202
ALFA_GeometryReader::ParseRefPoints
bool ParseRefPoints(const char *szvalue, std::vector< HepGeom::Point3D< double > > &vecRefPoints, eMetrologyCoordSystem eCSystem)
Definition: ALFA_GeometryReader.cxx:2412
CFGRPPOSPARAMS::fXOffset
double fXOffset
Definition: ALFA_GeometryReader.h:183
ERPT_REAL
@ ERPT_REAL
Definition: ALFA_GeometryReader.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
RPPOSPARAMS::DetTransformInMainPoint
HepGeom::Transform3D DetTransformInMainPoint
Definition: ALFA_GeometryReader.h:76
RPPOSPARAMS::VecIdealRPRefPoints
std::vector< HepGeom::Point3D< double > > VecIdealRPRefPoints
Definition: ALFA_GeometryReader.h:61
EFCS_CLADDING
@ EFCS_CLADDING
Definition: ALFA_GeometryReader.h:29
EFT_FIBERMD
@ EFT_FIBERMD
Definition: ALFA_GeometryReader.h:25
ALFA_ConfigParams::IsKey
bool IsKey(const char *szKey) const
Definition: ALFA_ConfigParams.cxx:98
RPPOSPARAMS::szLabel
char szLabel[8]
Definition: ALFA_GeometryReader.h:50
x
#define x
FIBERPARAMS
Definition: ALFA_GeometryReader.h:98
ETE_T3
@ ETE_T3
Definition: ALFA_GeometryReader.h:32
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
ETE_A1
@ ETE_A1
Definition: ALFA_GeometryReader.h:32
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
ROMAPOT
Definition: ALFA_GeometryReader.h:139
EMT_NOMINAL
@ EMT_NOMINAL
Definition: ALFA_GeometryReader.h:24
eAStationName
eAStationName
Definition: ALFA_GeometryReader.h:26
CFGRPPOSPARAMS::strODConnString
std::string strODConnString
Definition: ALFA_GeometryReader.h:178
ALFA_GeometryReader::GetASPosParams
bool GetASPosParams(PASPOSPARAMS pRPosParams, const eAStationName eASName)
Definition: ALFA_GeometryReader.cxx:1853
CFGRPPOSPARAMS::strMDConnString
std::string strMDConnString
Definition: ALFA_GeometryReader.h:177
ASPOSPARAMS
Definition: ALFA_GeometryReader.h:83
CFGRPPOSPARAMS::fCurrentLVDTmm
double fCurrentLVDTmm
Definition: ALFA_GeometryReader.h:180
EMT_METROLOGY
@ EMT_METROLOGY
Definition: ALFA_GeometryReader.h:24
CFGRPPOSPARAMS::UserTransformOfDetInRPot
HepGeom::Transform3D UserTransformOfDetInRPot
Definition: ALFA_GeometryReader.h:190
FIBERPARAMS::fMainRefPointSlope
double fMainRefPointSlope
Definition: ALFA_GeometryReader.h:126
ALFA_GeometryReader::m_ASPosParams
std::map< eAStationName, ASPOSPARAMS > m_ASPosParams
Definition: ALFA_GeometryReader.h:229
ALFA_GeometryReader::PrintFiberGeometry
void PrintFiberGeometry(std::ostream &OutStream)
Definition: ALFA_GeometryReader.cxx:1548
FIBERPARAMS::fOriginZ
double fOriginZ
Definition: ALFA_GeometryReader.h:118
ALFA_RDBAccess::m_ListFiberData
std::list< FIBERDATA > m_ListFiberData
Definition: ALFA_RDBAccess.h:59
ALFA_GeometryReader::m_eMetrologyType
eMetrologyType m_eMetrologyType
Definition: ALFA_GeometryReader.h:225
CFGRPPOSPARAMS::swcorr
struct CFGRPPOSPARAMS::@51 swcorr
ETE_A2
@ ETE_A2
Definition: ALFA_GeometryReader.h:32
CFGRPPOSPARAMS::bIsEnabledUserTranform
bool bIsEnabledUserTranform
Definition: ALFA_GeometryReader.h:188
RPPOSPARAMS::VecIdealDetRefPoints
std::vector< HepGeom::Point3D< double > > VecIdealDetRefPoints
Definition: ALFA_GeometryReader.h:69
ALFA_GeometryReader::m_RPPosParams
std::map< eRPotName, RPPOSPARAMS > m_RPPosParams
Definition: ALFA_GeometryReader.h:228
eMetrologyType
eMetrologyType
Definition: ALFA_GeometryReader.h:24
EASN_B7L1
@ EASN_B7L1
Definition: ALFA_GeometryReader.h:26
ROMAPOT::ListUFibers
std::list< FIBERPARAMS > ListUFibers
Definition: ALFA_GeometryReader.h:148
ALFA_GeometryReader::ReadSource
bool ReadSource(const eGeoSourceType eSourceType, const eRPotName eRPName, const eFiberType eFType, const char *szDataSource)
Definition: ALFA_GeometryReader.cxx:946
RPPINS::DCPInAtlasCS
HepGeom::Point3D< double > DCPInAtlasCS
Definition: ALFA_GeometryReader.h:43
RPPOSPARAMS::RPSWTransformInStation
HepGeom::Transform3D RPSWTransformInStation
Definition: ALFA_GeometryReader.h:64
ERPPT_ACTIVE
@ ERPPT_ACTIVE
Definition: ALFA_GeometryReader.h:28
RPPOSPARAMS::DetSWTransformInMainPoint
HepGeom::Transform3D DetSWTransformInMainPoint
Definition: ALFA_GeometryReader.h:72
DETEDGEDISTANCE
#define DETEDGEDISTANCE
Definition: ALFA_constants.h:31
ERPN_B7L1U
@ ERPN_B7L1U
Definition: ALFA_GeometryReader.h:27
lumiFormat.i
int i
Definition: lumiFormat.py:85
ERPN_UNDEFINED
@ ERPN_UNDEFINED
Definition: ALFA_GeometryReader.h:27
ALFA_GeometryReader::ms_NominalDetPin1
static const HepGeom::Point3D< double > ms_NominalDetPin1
Definition: ALFA_GeometryReader.h:220
z
#define z
ALFA_GeometryReader::SetupSWCorrections
void SetupSWCorrections(const PGEOMETRYCONFIGURATION pConfig)
Definition: ALFA_GeometryReader.cxx:2896
ASPOSPARAMS::ShiftE
HepGeom::Vector3D< double > ShiftE
Definition: ALFA_GeometryReader.h:89
RPPOSPARAMS::RPTransformInStation
HepGeom::Transform3D RPTransformInStation
Definition: ALFA_GeometryReader.h:65
beamspotman.n
n
Definition: beamspotman.py:731
ASPOSPARAMS::ShiftS
HepGeom::Vector3D< double > ShiftS
Definition: ALFA_GeometryReader.h:90
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EFT_ODFIBERU1
@ EFT_ODFIBERU1
Definition: ALFA_GeometryReader.h:25
EGST_UNDEFINED
@ EGST_UNDEFINED
Definition: ALFA_GeometryReader.h:23
EFT_VFIBER
@ EFT_VFIBER
Definition: ALFA_GeometryReader.h:25
ALFA_GeometryReader::SetupStationMetrologyPoints
bool SetupStationMetrologyPoints(ALFA_ConfigParams &CfgParams, eAStationName eASName)
Definition: ALFA_GeometryReader.cxx:2693
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
FIBERPARAMS::fDirX
double fDirX
Definition: ALFA_GeometryReader.h:119
RPPOSPARAMS::DetIdealTransformInMainPoint
HepGeom::Transform3D DetIdealTransformInMainPoint
Definition: ALFA_GeometryReader.h:71
ALFA_GeometryReader::ms_NominalAlfaRefPoint
static const HepGeom::Point3D< double > ms_NominalAlfaRefPoint
Definition: ALFA_GeometryReader.h:219
FIBERPARAMS::fcs_cladding
struct FIBERPARAMS::@46 fcs_cladding
ERPN_B7L1L
@ ERPN_B7L1L
Definition: ALFA_GeometryReader.h:27
RPPINS::IdealRPPin1
HepGeom::Point3D< double > IdealRPPin1
Definition: ALFA_GeometryReader.h:37
RPPOSPARAMS::clear
void clear()
Definition: ALFA_GeometryReader.cxx:45
RPPOSPARAMS::RPIdealTransformInStation
HepGeom::Transform3D RPIdealTransformInStation
Definition: ALFA_GeometryReader.h:63
FIBERPARAMS::fDirZ
double fDirZ
Definition: ALFA_GeometryReader.h:119
GEOMETRYCONFIGURATION::CfgRPosParams
CFGRPPOSPARAMS CfgRPosParams[RPOTSCNT]
Definition: ALFA_GeometryReader.h:205
AnalysisUtils::Delta::R
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
Definition: AnalysisMisc.h:49
ASPOSPARAMS::szLabel
char szLabel[8]
Definition: ALFA_GeometryReader.h:84
FIBERPARAMS::MainRefPointPos
HepGeom::Point3D< float > MainRefPointPos
Definition: ALFA_GeometryReader.h:127
Scale
void Scale(TH1 *h, double d=1)
Definition: comparitor.cxx:76
ALFALAYERSCNT
#define ALFALAYERSCNT
Definition: ALFA_constants.h:8
FIBERPARAMS::nPlateID
int nPlateID
Definition: ALFA_GeometryReader.h:99
CxxUtils::atof
double atof(std::string_view str)
Converts a string into a double / float.
Definition: Control/CxxUtils/Root/StringUtils.cxx:91
CFGRPPOSPARAMS::usercorr
struct CFGRPPOSPARAMS::@52 usercorr
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
EFT_UFIBER
@ EFT_UFIBER
Definition: ALFA_GeometryReader.h:25
ALFA_GeometryReader::GetRPPosParams
bool GetRPPosParams(PRPPOSPARAMS pRPosParams, const eRPotName eRPName)
Definition: ALFA_GeometryReader.cxx:1834
ALFA_GeometryReader::m_ListExistingRPots
std::list< eRPotName > m_ListExistingRPots
Definition: ALFA_GeometryReader.h:233
ERPN_A7R1L
@ ERPN_A7R1L
Definition: ALFA_GeometryReader.h:27
FIBERPARAMS::fCentreXPos
double fCentreXPos
Definition: ALFA_GeometryReader.h:105
GEOMETRYCONFIGURATION::eRPMetrologyGeoType
int eRPMetrologyGeoType
Definition: ALFA_GeometryReader.h:197
FIBERPARAMS::nFiberID
int nFiberID
Definition: ALFA_GeometryReader.h:100
EFT_UNDEFINED
@ EFT_UNDEFINED
Definition: ALFA_GeometryReader.h:25
ALFA_GeometryReader::GetDetPointInAtlas
HepGeom::Point3D< double > GetDetPointInAtlas(eRPotName eRPName, const HepGeom::Point3D< double > &PointInDetCS)
Definition: ALFA_GeometryReader.cxx:2725
EGST_DATABASE
@ EGST_DATABASE
Definition: ALFA_GeometryReader.h:23
ALFA_GeometryReader::ms_NominalRPPin1
static const HepGeom::Point3D< double > ms_NominalRPPin1
Definition: ALFA_GeometryReader.h:217
ROMAPOT::ListODFibersV1
std::list< FIBERPARAMS > ListODFibersV1
Definition: ALFA_GeometryReader.h:153
RPPOSPARAMS::fCurrentLVDTmm
double fCurrentLVDTmm
Definition: ALFA_GeometryReader.h:57
ROMAPOT::ListODFibersV0
std::list< FIBERPARAMS > ListODFibersV0
Definition: ALFA_GeometryReader.h:151
ALFA_GeometryReader::GetODFiberParams
bool GetODFiberParams(PFIBERPARAMS pFiberParams, const eFiberType eFType, const eRPotName eRPName, const int nPlateID, const int nFiberID)
Definition: ALFA_GeometryReader.cxx:1921
ALFA_GeometryReader::ms_NominalRPMainPoint
static const HepGeom::Point3D< double > ms_NominalRPMainPoint
Definition: ALFA_GeometryReader.h:218
RPPOSPARAMS::OriginOfDetSWTransform
HepGeom::Point3D< double > OriginOfDetSWTransform
Definition: ALFA_GeometryReader.h:75
GEOMETRYCONFIGURATION::fNominalZPosA7L1
double fNominalZPosA7L1
Definition: ALFA_GeometryReader.h:201
EASN_A7L1
@ EASN_A7L1
Definition: ALFA_GeometryReader.h:26
CFGRPPOSPARAMS::UserOriginOfDetTransInRPot
HepGeom::Point3D< double > UserOriginOfDetTransInRPot
Definition: ALFA_GeometryReader.h:189
EMCS_ROMANPOT
@ EMCS_ROMANPOT
Definition: ALFA_GeometryReader.h:31
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
CFGRPPOSPARAMS::eODGeoType
int eODGeoType
Definition: ALFA_GeometryReader.h:176
ERPN_A7R1U
@ ERPN_A7R1U
Definition: ALFA_GeometryReader.h:27
ODPLATESCNT
#define ODPLATESCNT
Definition: ALFA_CLinkAlg.h:31
ALFA_GeometryReader::GetUFiberParams
bool GetUFiberParams(PFIBERPARAMS pFiberParams, const eRPotName eRPName, const int nPlateID, const int nFiberID)
Definition: ALFA_GeometryReader.cxx:1322
y
#define y
EFCS_ATLAS
@ EFCS_ATLAS
Definition: ALFA_GeometryReader.h:29
ODFIBERSCNT
#define ODFIBERSCNT
Definition: ALFA_CLinkAlg.h:32
CFGRPPOSPARAMS::eRPPosType
int eRPPosType
Definition: ALFA_GeometryReader.h:174
ALFA_GeometryReader::ParseRPMetrology
bool ParseRPMetrology(eGeoSourceType eSourceType, const char *szDataSource)
Definition: ALFA_GeometryReader.cxx:2319
ALFA_GeometryReader::m_MapRPot
std::map< eRPotName, ROMAPOT > m_MapRPot
Definition: ALFA_GeometryReader.h:232
ALFA_GeometryReader::ReadFiberGeometry
bool ReadFiberGeometry(const PGEOMETRYCONFIGURATION pConfig)
Definition: ALFA_GeometryReader.cxx:918
GEOMETRYCONFIGURATION::bShiftToX97Pos
bool bShiftToX97Pos
Definition: ALFA_GeometryReader.h:199
ERPT_DETIDEAL
@ ERPT_DETIDEAL
Definition: ALFA_GeometryReader.h:30
FIBERPARAMS::fSlope
double fSlope
Definition: ALFA_GeometryReader.h:112
EFT_ODFIBERU0
@ EFT_ODFIBERU0
Definition: ALFA_GeometryReader.h:25
RPPOSPARAMS::bIsLow
bool bIsLow
Definition: ALFA_GeometryReader.h:54
CFGRPPOSPARAMS::UserTransformOfRPInStation
HepGeom::Transform3D UserTransformOfRPInStation
Definition: ALFA_GeometryReader.h:191
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
ALFA_GeometryReader::InitializeDefault
bool InitializeDefault(const PGEOMETRYCONFIGURATION pConfig)
Definition: ALFA_GeometryReader.cxx:393
RPPOSPARAMS::DetSWTransform
HepGeom::Transform3D DetSWTransform
Definition: ALFA_GeometryReader.h:74
EGST_FILE
@ EGST_FILE
Definition: ALFA_GeometryReader.h:23
FIBERPARAMS::fDirY
double fDirY
Definition: ALFA_GeometryReader.h:119
eGeoSourceType
eGeoSourceType
Definition: ALFA_GeometryReader.h:23
ALFA_GeometryReader::UpdateGeometry
void UpdateGeometry()
Definition: ALFA_GeometryReader.cxx:1794
ALFA_GeometryReader::TransformFiberPositionsFCSCladding
void TransformFiberPositionsFCSCladding(PFIBERPARAMS pFiberParams, eRPotName eRPName, const eFiberType eType, const eGeoSourceType eSourceType)
Definition: ALFA_GeometryReader.cxx:135
EFT_ODFIBERV1
@ EFT_ODFIBERV1
Definition: ALFA_GeometryReader.h:25
FIBERPARAMS::fcs_atlas_full
struct FIBERPARAMS::@48 fcs_atlas_full
AthenaPoolTestStep2WriteDoubleSelector.OutStream
OutStream
Definition: AthenaPoolTestStep2WriteDoubleSelector.py:77
ALFA_RDBAccess
Definition: ALFA_RDBAccess.h:40
GEOMETRYCONFIGURATION::strRPMetrologyConnString
std::string strRPMetrologyConnString
Definition: ALFA_GeometryReader.h:198
ERPN_A7L1L
@ ERPN_A7L1L
Definition: ALFA_GeometryReader.h:27
EFT_FIBEROD
@ EFT_FIBEROD
Definition: ALFA_GeometryReader.h:25
EMT_UNDEFINED
@ EMT_UNDEFINED
Definition: ALFA_GeometryReader.h:24
EMCS_DETPIN1
@ EMCS_DETPIN1
Definition: ALFA_GeometryReader.h:31
Shift
@ Shift
Definition: CMAparameters.h:19
ALFA_GeometryReader::SetupRPMetrologyPoints
bool SetupRPMetrologyPoints(ALFA_ConfigParams &CfgParams, eRPotName eRPName)
Definition: ALFA_GeometryReader.cxx:2614
ALFA_GeometryReader::ComputeTransformMatrix
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)
Definition: ALFA_GeometryReader.cxx:815
RPPINS::IdealRPPin2
HepGeom::Point3D< double > IdealRPPin2
Definition: ALFA_GeometryReader.h:38
GEOMETRYCONFIGURATION::fNominalZPosA7R1
double fNominalZPosA7R1
Definition: ALFA_GeometryReader.h:203
EFCS_UNDEFINED
@ EFCS_UNDEFINED
Definition: ALFA_GeometryReader.h:29
CFGRPPOSPARAMS::eMDGeoType
int eMDGeoType
Definition: ALFA_GeometryReader.h:175
ERPT_DETREAL
@ ERPT_DETREAL
Definition: ALFA_GeometryReader.h:30
ALFA_GeometryReader::UpdateStationsPosParams
void UpdateStationsPosParams()
Definition: ALFA_GeometryReader.cxx:713
ALFA_GeometryReader::SetupDetMetrologyPoints
bool SetupDetMetrologyPoints(ALFA_ConfigParams &CfgParams, eRPotName eRPName)
Definition: ALFA_GeometryReader.cxx:2528
ALFAPLATESCNT
#define ALFAPLATESCNT
Definition: ALFA_constants.h:9
FIBERPARAMS::fcs_atlas
struct FIBERPARAMS::@47 fcs_atlas
ALFA_GeometryReader::GetPolyFitValue
double GetPolyFitValue(const double fInputValue, const std::vector< double > &vecPolyFitParams)
Definition: ALFA_GeometryReader.cxx:2710
ALFA_GeometryReader::UpdateSimRPPos
void UpdateSimRPPos(const eRPotName eRPName)
Definition: ALFA_GeometryReader.cxx:744
EASN_B7R1
@ EASN_B7R1
Definition: ALFA_GeometryReader.h:26
ALFA_GeometryReader::ParseArrayOfValues
bool ParseArrayOfValues(const char *szvalue, std::vector< double > &vecValues)
Definition: ALFA_GeometryReader.cxx:2489
EMCS_ATLAS
@ EMCS_ATLAS
Definition: ALFA_GeometryReader.h:31
ETE_A3
@ ETE_A3
Definition: ALFA_GeometryReader.h:32
ETE_T1
@ ETE_T1
Definition: ALFA_GeometryReader.h:32
PLATEPARAMS
Definition: ALFA_GeometryReader.h:133
ETE_T2
@ ETE_T2
Definition: ALFA_GeometryReader.h:32