33 for(
unsigned int det = 0; det < 2; ++det ) {
35 for(
unsigned int beam = 0; beam < 8; ++beam ) {
38 const double endcapSign = det==0 ? 1.: -1.;
41 for(
unsigned int disk = 5; disk < 9; ++disk ) {
72 const double radius = 564.;
76 int det = 0, beam = 0, disk = 0;
88 double phiCorrection = 0.;
101 }
while( moduleLoop.
TEC2TECLoop( det, beam, disk ) );
134 theHalfBarrels.at( 0 ) = theEndcaps.at( 0 );
135 theHalfBarrels.at( 1 ) = theEndcaps.at( 1 );
136 theHalfBarrels.at( 2 ) = theInnerHalfBarrels.at( 1 );
137 theHalfBarrels.at( 3 ) = theInnerHalfBarrels.at( 0 );
138 theHalfBarrels.at( 4 ) = theOuterHalfBarrels.at( 1 );
139 theHalfBarrels.at( 5 ) = theOuterHalfBarrels.at( 0 );
143 std::vector<std::vector<double> > halfbarrelEndfaceZPositions( 6, std::vector<double>( 2, 0. ) );
144 halfbarrelEndfaceZPositions.at( 0 ).at( 0 ) = 1322.5;
145 halfbarrelEndfaceZPositions.at( 0 ).at( 1 ) = 2667.5;
146 halfbarrelEndfaceZPositions.at( 1 ).at( 0 ) = -2667.5;
147 halfbarrelEndfaceZPositions.at( 1 ).at( 1 ) = -1322.5;
148 halfbarrelEndfaceZPositions.at( 2 ).at( 0 ) = 300.;
149 halfbarrelEndfaceZPositions.at( 2 ).at( 1 ) = 700.;
150 halfbarrelEndfaceZPositions.at( 3 ).at( 0 ) = -700.;
151 halfbarrelEndfaceZPositions.at( 3 ).at( 1 ) = -300.;
152 halfbarrelEndfaceZPositions.at( 4 ).at( 0 ) = 300.;
153 halfbarrelEndfaceZPositions.at( 4 ).at( 1 ) = 1090.;
154 halfbarrelEndfaceZPositions.at( 5 ).at( 0 ) = -1090.;
155 halfbarrelEndfaceZPositions.at( 5 ).at( 1 ) = -300.;
159 std::vector<double> theBarrelLength( 6, 0. );
160 theBarrelLength.at( 0 ) = 1345.;
161 theBarrelLength.at( 1 ) = 1345.;
162 theBarrelLength.at( 2 ) = 400.;
163 theBarrelLength.at( 3 ) = 400.;
164 theBarrelLength.at( 4 ) = 790.;
165 theBarrelLength.at( 5 ) = 790.;
170 std::vector<double> theHalfbarrelCenters( 6, 0. );
171 for(
int halfbarrel = 0; halfbarrel < 6; ++halfbarrel ) {
172 theHalfbarrelCenters.at( halfbarrel ) = theHalfBarrels.at( halfbarrel )->globalPosition().z() * 10.;
178 const double fromMmToCm = 10.;
181 for(
int halfBarrel = 2; halfBarrel < 6; ++halfBarrel ) {
200 const align::Scalar rxLocal = ( barrelParameters.
GetParameter( halfBarrel, 0, 2 ).first - barrelParameters.
GetParameter( halfBarrel, 1, 2 ).first ) / theBarrelLength.at( halfBarrel );
201 theHalfBarrels.at( halfBarrel )->rotateAroundLocalX( direction * rxLocal );
204 const align::Scalar ryLocal = ( barrelParameters.
GetParameter( halfBarrel, 1, 1 ).first - barrelParameters.
GetParameter( halfBarrel, 0, 1 ).first ) / theBarrelLength.at( halfBarrel );
205 theHalfBarrels.at( halfBarrel )->rotateAroundLocalY( direction * ryLocal );
209 theHalfBarrels.at( halfBarrel )->rotateAroundLocalZ( -1. * direction * rzLocal );
216 std::vector<double> correctedEndfaceOffsetsX( 2, 0. );
217 correctedEndfaceOffsetsX.at( 0 ) = barrelParameters.
GetParameter( halfBarrel, 0, 1 ).first
218 + ( theHalfbarrelCenters.at( halfBarrel ) - halfbarrelEndfaceZPositions.at( halfBarrel ).at( 0 ) ) * ryLocal;
219 correctedEndfaceOffsetsX.at( 1 ) = barrelParameters.
GetParameter( halfBarrel, 1, 1 ).first
220 - ( halfbarrelEndfaceZPositions.at( halfBarrel ).at( 1 ) - theHalfbarrelCenters.at( halfBarrel ) ) * ryLocal;
222 std::vector<double> correctedEndfaceOffsetsY( 2, 0. );
223 correctedEndfaceOffsetsY.at( 0 ) = barrelParameters.
GetParameter( halfBarrel, 0, 2 ).first
224 - ( theHalfbarrelCenters.at( halfBarrel ) - halfbarrelEndfaceZPositions.at( halfBarrel ).at( 0 ) ) * rxLocal;
225 correctedEndfaceOffsetsY.at( 1 ) = barrelParameters.
GetParameter( halfBarrel, 1, 2 ).first
226 + ( halfbarrelEndfaceZPositions.at( halfBarrel ).at( 1 ) - theHalfbarrelCenters.at( halfBarrel ) ) * rxLocal;
229 const align::GlobalVector dxLocal( ( correctedEndfaceOffsetsX.at( 0 ) + correctedEndfaceOffsetsX.at( 1 ) ) / 2. / fromMmToCm, 0., 0. );
230 theHalfBarrels.at( halfBarrel )->move( direction * ( dxLocal ) );
233 const align::GlobalVector dyLocal( 0., ( correctedEndfaceOffsetsY.at( 0 ) + correctedEndfaceOffsetsY.at( 1 ) ) / 2. / fromMmToCm, 0. );
234 theHalfBarrels.at( halfBarrel )->move( direction * ( dyLocal ) );
250 std::vector<std::vector<double> > wheelZPositions( 2, std::vector<double>( 9, 0. ) );
252 wheelZPositions.at( 0 ).at(
wheel ) = theEndcaps.at( 0 )->components().at(
wheel )->globalPosition().z();
253 wheelZPositions.at( 1 ).at(
wheel ) = theEndcaps.at( 1 )->components().at(
wheel )->globalPosition().z();
261 for(
int det = 0; det < 2; ++det ) {
263 const int& side = det;
272 theEndcaps.at( det )->components().at(
wheel )->rotateAroundLocalZ( direction * endcapParameters.
GetDiskParameter( det,
wheel, 0 ).first );
274 theEndcaps.at( det )->components().at(
wheel )->move( direction * dXY );
283 theEndcaps.at( det )->rotateAroundLocalZ( -1. * direction * dphi1 );
287 barrelParameters.
GetParameter( det, side, 2 ).first / fromMmToCm,
289 theEndcaps.at( det )->move( direction * dxy1 );
298 ( barrelParameters.
GetParameter( det, 1, 2 ).first - barrelParameters.
GetParameter( det, 0, 2 ).first ) / fromMmToCm,
305 const double reducedZ = ( wheelZPositions.at( det ).at(
wheel ) - wheelZPositions.at( det ).at( 0 ) ) / theBarrelLength.at( det ) * fromMmToCm;
306 theEndcaps.at( det )->components().at(
wheel )->rotateAroundLocalZ( -1. * direction * reducedZ * resultingPhi9 );
307 theEndcaps.at( det )->components().at(
wheel )->move( direction * reducedZ * resultingXY9 );
std::pair< double, double > & GetParameter(int aSubdetector, int aDisk, int aParameter)
void TrackerUpdate(LASEndcapAlignmentParameterSet &, LASBarrelAlignmentParameterSet &, AlignableTracker &)
void SetMisalignmentFromRefGeometry(bool)
Sin< T >::type sin(const T &t)
double GetTecRadius(unsigned int ring) const
LASGeometryUpdater(LASGlobalData< LASCoordinateSet > &, LASConstants &)
bool isMisalignmentFromRefGeometry
double GetPhi(void) const
LASGlobalData< LASCoordinateSet > * aNominalCoordinates
bool TEC2TECLoop(int &, int &, int &) const
Alignables & endCaps()
Return TECs.
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
std::pair< double, double > & GetDiskParameter(int aSubdetector, int aDisk, int aParameter)
void SetReverseDirection(bool)
LASConstants lasConstants
double GetEndcapBsKink(unsigned int det, unsigned int ring, unsigned int beam) const
T & GetTEC2TECEntry(int subdetector, int beam, int tecDisk)
T & GetTECEntry(int subdetector, int tecRing, int beam, int tecDisk)
double GetTecZPosition(unsigned int det, unsigned int disk) const
double GetTecBsZPosition(unsigned int det) const
std::vector< Alignable * > Alignables
void ApplyBeamKinkCorrections(LASGlobalData< LASCoordinateSet > &) const
Alignables & innerHalfBarrels()
Return TIB half barrels.
LASGlobalData< LASCoordinateSet > nominalCoordinates
void EndcapUpdate(LASEndcapAlignmentParameterSet &, LASGlobalData< LASCoordinateSet > &)
Alignables & outerHalfBarrels()
Return TOB half barrels.