26 for (
unsigned int det = 0; det < 2; ++det) {
30 const double endcapSign = det == 0 ? 1. : -1.;
33 for (
unsigned int disk = 5; disk < 9; ++disk) {
55 const double radius = 564.;
59 int det = 0,
beam = 0, disk = 0;
68 double phiCorrection = 0.;
109 theHalfBarrels.at(0) = theEndcaps.at(0);
110 theHalfBarrels.at(1) = theEndcaps.at(1);
111 theHalfBarrels.at(2) = theInnerHalfBarrels.at(1);
112 theHalfBarrels.at(3) = theInnerHalfBarrels.at(0);
113 theHalfBarrels.at(4) = theOuterHalfBarrels.at(1);
114 theHalfBarrels.at(5) = theOuterHalfBarrels.at(0);
118 std::vector<std::vector<double> > halfbarrelEndfaceZPositions(6, std::vector<double>(2, 0.));
119 halfbarrelEndfaceZPositions.at(0).at(0) = 1322.5;
120 halfbarrelEndfaceZPositions.at(0).at(1) = 2667.5;
121 halfbarrelEndfaceZPositions.at(1).at(0) = -2667.5;
122 halfbarrelEndfaceZPositions.at(1).at(1) = -1322.5;
123 halfbarrelEndfaceZPositions.at(2).at(0) = 300.;
124 halfbarrelEndfaceZPositions.at(2).at(1) = 700.;
125 halfbarrelEndfaceZPositions.at(3).at(0) = -700.;
126 halfbarrelEndfaceZPositions.at(3).at(1) = -300.;
127 halfbarrelEndfaceZPositions.at(4).at(0) = 300.;
128 halfbarrelEndfaceZPositions.at(4).at(1) = 1090.;
129 halfbarrelEndfaceZPositions.at(5).at(0) = -1090.;
130 halfbarrelEndfaceZPositions.at(5).at(1) = -300.;
134 std::vector<double> theBarrelLength(6, 0.);
135 theBarrelLength.at(0) = 1345.;
136 theBarrelLength.at(1) = 1345.;
137 theBarrelLength.at(2) = 400.;
138 theBarrelLength.at(3) = 400.;
139 theBarrelLength.at(4) = 790.;
140 theBarrelLength.at(5) = 790.;
144 std::vector<double> theHalfbarrelCenters(6, 0.);
145 for (
int halfbarrel = 0; halfbarrel < 6; ++halfbarrel) {
146 theHalfbarrelCenters.at(halfbarrel) = theHalfBarrels.at(halfbarrel)->globalPosition().z() * 10.;
150 const double fromMmToCm = 10.;
153 for (
int halfBarrel = 2; halfBarrel < 6; ++halfBarrel) {
171 barrelParameters.
GetParameter(halfBarrel, 1, 2).first) /
172 theBarrelLength.at(halfBarrel);
173 theHalfBarrels.at(halfBarrel)->rotateAroundLocalX(direction * rxLocal);
177 barrelParameters.
GetParameter(halfBarrel, 0, 1).first) /
178 theBarrelLength.at(halfBarrel);
179 theHalfBarrels.at(halfBarrel)->rotateAroundLocalY(direction * ryLocal);
183 barrelParameters.
GetParameter(halfBarrel, 1, 0).first) /
185 theHalfBarrels.at(halfBarrel)
186 ->rotateAroundLocalZ(-1. * direction * rzLocal);
193 std::vector<double> correctedEndfaceOffsetsX(2, 0.);
194 correctedEndfaceOffsetsX.at(0) =
196 (theHalfbarrelCenters.at(halfBarrel) - halfbarrelEndfaceZPositions.at(halfBarrel).at(0)) * ryLocal;
197 correctedEndfaceOffsetsX.at(1) =
199 (halfbarrelEndfaceZPositions.at(halfBarrel).at(1) - theHalfbarrelCenters.at(halfBarrel)) * ryLocal;
201 std::vector<double> correctedEndfaceOffsetsY(2, 0.);
202 correctedEndfaceOffsetsY.at(0) =
204 (theHalfbarrelCenters.at(halfBarrel) - halfbarrelEndfaceZPositions.at(halfBarrel).at(0)) * rxLocal;
205 correctedEndfaceOffsetsY.at(1) =
207 (halfbarrelEndfaceZPositions.at(halfBarrel).at(1) - theHalfbarrelCenters.at(halfBarrel)) * rxLocal;
211 (correctedEndfaceOffsetsX.at(0) + correctedEndfaceOffsetsX.at(1)) / 2. / fromMmToCm, 0., 0.);
212 theHalfBarrels.at(halfBarrel)->move(direction * (dxLocal));
216 0., (correctedEndfaceOffsetsY.at(0) + correctedEndfaceOffsetsY.at(1)) / 2. / fromMmToCm, 0.);
217 theHalfBarrels.at(halfBarrel)->move(direction * (dyLocal));
230 std::vector<std::vector<double> > wheelZPositions(2, std::vector<double>(9, 0.));
232 wheelZPositions.at(0).at(
wheel) = theEndcaps.at(0)->components().at(
wheel)->globalPosition().z();
233 wheelZPositions.at(1).at(
wheel) = theEndcaps.at(1)->components().at(
wheel)->globalPosition().z();
240 for (
int det = 0; det < 2; ++det) {
241 const int& side = det;
250 theEndcaps.at(det)->components().at(
wheel)->rotateAroundLocalZ(
255 theEndcaps.at(det)->components().at(
wheel)->move(direction * dXY);
262 theEndcaps.at(det)->rotateAroundLocalZ(-1. * direction *
267 barrelParameters.
GetParameter(det, side, 2).first / fromMmToCm,
269 theEndcaps.at(det)->move(direction * dxy1);
284 const double reducedZ =
285 (wheelZPositions.at(det).at(
wheel) - wheelZPositions.at(det).at(0)) / theBarrelLength.at(det) * fromMmToCm;
286 theEndcaps.at(det)->components().at(
wheel)->rotateAroundLocalZ(-1. * direction * reducedZ *
288 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.