32 for(
unsigned int det = 0; det < 2; ++det ) {
37 const double endcapSign = det==0 ? 1.: -1.;
40 for(
unsigned int disk = 5; disk < 9; ++disk ) {
71 const double radius = 564.;
75 int det = 0,
beam = 0, disk = 0;
87 double phiCorrection = 0.;
132 std::vector<Alignable*> theHalfBarrels( 6 );
133 theHalfBarrels.at( 0 ) = theEndcaps.at( 0 );
134 theHalfBarrels.at( 1 ) = theEndcaps.at( 1 );
135 theHalfBarrels.at( 2 ) = theInnerHalfBarrels.at( 1 );
136 theHalfBarrels.at( 3 ) = theInnerHalfBarrels.at( 0 );
137 theHalfBarrels.at( 4 ) = theOuterHalfBarrels.at( 1 );
138 theHalfBarrels.at( 5 ) = theOuterHalfBarrels.at( 0 );
142 std::vector<std::vector<double> > halfbarrelEndfaceZPositions( 6, std::vector<double>( 2, 0. ) );
143 halfbarrelEndfaceZPositions.at( 0 ).at( 0 ) = 1322.5;
144 halfbarrelEndfaceZPositions.at( 0 ).at( 1 ) = 2667.5;
145 halfbarrelEndfaceZPositions.at( 1 ).at( 0 ) = -2667.5;
146 halfbarrelEndfaceZPositions.at( 1 ).at( 1 ) = -1322.5;
147 halfbarrelEndfaceZPositions.at( 2 ).at( 0 ) = 300.;
148 halfbarrelEndfaceZPositions.at( 2 ).at( 1 ) = 700.;
149 halfbarrelEndfaceZPositions.at( 3 ).at( 0 ) = -700.;
150 halfbarrelEndfaceZPositions.at( 3 ).at( 1 ) = -300.;
151 halfbarrelEndfaceZPositions.at( 4 ).at( 0 ) = 300.;
152 halfbarrelEndfaceZPositions.at( 4 ).at( 1 ) = 1090.;
153 halfbarrelEndfaceZPositions.at( 5 ).at( 0 ) = -1090.;
154 halfbarrelEndfaceZPositions.at( 5 ).at( 1 ) = -300.;
158 std::vector<double> theBarrelLength( 6, 0. );
159 theBarrelLength.at( 0 ) = 1345.;
160 theBarrelLength.at( 1 ) = 1345.;
161 theBarrelLength.at( 2 ) = 400.;
162 theBarrelLength.at( 3 ) = 400.;
163 theBarrelLength.at( 4 ) = 790.;
164 theBarrelLength.at( 5 ) = 790.;
169 std::vector<double> theHalfbarrelCenters( 6, 0. );
170 for(
int halfbarrel = 0; halfbarrel < 6; ++halfbarrel ) {
171 theHalfbarrelCenters.at( halfbarrel ) = theHalfBarrels.at( halfbarrel )->globalPosition().z() * 10.;
177 const double fromMmToCm = 10.;
180 for(
int halfBarrel = 2; halfBarrel < 6; ++halfBarrel ) {
199 const align::Scalar rxLocal = ( barrelParameters.
GetParameter( halfBarrel, 0, 2 ).first - barrelParameters.
GetParameter( halfBarrel, 1, 2 ).first ) / theBarrelLength.at( halfBarrel );
200 theHalfBarrels.at( halfBarrel )->rotateAroundLocalX( direction * rxLocal );
203 const align::Scalar ryLocal = ( barrelParameters.
GetParameter( halfBarrel, 1, 1 ).first - barrelParameters.
GetParameter( halfBarrel, 0, 1 ).first ) / theBarrelLength.at( halfBarrel );
204 theHalfBarrels.at( halfBarrel )->rotateAroundLocalY( direction * ryLocal );
208 theHalfBarrels.at( halfBarrel )->rotateAroundLocalZ( -1. * direction * rzLocal );
215 std::vector<double> correctedEndfaceOffsetsX( 2, 0. );
216 correctedEndfaceOffsetsX.at( 0 ) = barrelParameters.
GetParameter( halfBarrel, 0, 1 ).first
217 + ( theHalfbarrelCenters.at( halfBarrel ) - halfbarrelEndfaceZPositions.at( halfBarrel ).at( 0 ) ) * ryLocal;
218 correctedEndfaceOffsetsX.at( 1 ) = barrelParameters.
GetParameter( halfBarrel, 1, 1 ).first
219 - ( halfbarrelEndfaceZPositions.at( halfBarrel ).at( 1 ) - theHalfbarrelCenters.at( halfBarrel ) ) * ryLocal;
221 std::vector<double> correctedEndfaceOffsetsY( 2, 0. );
222 correctedEndfaceOffsetsY.at( 0 ) = barrelParameters.
GetParameter( halfBarrel, 0, 2 ).first
223 - ( theHalfbarrelCenters.at( halfBarrel ) - halfbarrelEndfaceZPositions.at( halfBarrel ).at( 0 ) ) * rxLocal;
224 correctedEndfaceOffsetsY.at( 1 ) = barrelParameters.
GetParameter( halfBarrel, 1, 2 ).first
225 + ( halfbarrelEndfaceZPositions.at( halfBarrel ).at( 1 ) - theHalfbarrelCenters.at( halfBarrel ) ) * rxLocal;
228 const align::GlobalVector dxLocal( ( correctedEndfaceOffsetsX.at( 0 ) + correctedEndfaceOffsetsX.at( 1 ) ) / 2. / fromMmToCm, 0., 0. );
229 theHalfBarrels.at( halfBarrel )->move( direction * ( dxLocal ) );
232 const align::GlobalVector dyLocal( 0., ( correctedEndfaceOffsetsY.at( 0 ) + correctedEndfaceOffsetsY.at( 1 ) ) / 2. / fromMmToCm, 0. );
233 theHalfBarrels.at( halfBarrel )->move( direction * ( dyLocal ) );
249 std::vector<std::vector<double> > wheelZPositions( 2, std::vector<double>( 9, 0. ) );
250 for(
int wheel = 0; wheel < 9; ++wheel ) {
251 wheelZPositions.at( 0 ).at( wheel ) = theEndcaps.at( 0 )->components().at( wheel )->globalPosition().z();
252 wheelZPositions.at( 1 ).at( wheel ) = theEndcaps.at( 1 )->components().at( wheel )->globalPosition().z();
260 for(
int det = 0; det < 2; ++det ) {
262 const int& side = det;
270 for(
int wheel = 0; wheel < 9; ++wheel ) {
271 theEndcaps.at( det )->components().at( wheel )->rotateAroundLocalZ( direction * endcapParameters.
GetDiskParameter( det, wheel, 0 ).first );
273 theEndcaps.at( det )->components().at( wheel )->move( direction * dXY );
282 theEndcaps.at( det )->rotateAroundLocalZ( -1. * direction * dphi1 );
286 barrelParameters.
GetParameter( det, side, 2 ).first / fromMmToCm,
288 theEndcaps.at( det )->move( direction * dxy1 );
297 ( barrelParameters.
GetParameter( det, 1, 2 ).first - barrelParameters.
GetParameter( det, 0, 2 ).first ) / fromMmToCm,
303 for(
int wheel = 0; wheel < 9; ++wheel ) {
304 const double reducedZ = ( wheelZPositions.at( det ).at( wheel ) - wheelZPositions.at( det ).at( 0 ) ) / theBarrelLength.at( det ) * fromMmToCm;
305 theEndcaps.at( det )->components().at( wheel )->rotateAroundLocalZ( -1. * direction * reducedZ * resultingPhi9 );
306 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.