139 {
140
144
145
146
147
148
151
155
156
159
160 surfacePhi *= (
m_flatDist->shoot() > 0.5) ? -1. : 1.;
161 double startX = startR *
cos(surfacePhi);
162 double startY = startR *
sin(surfacePhi);
164
165
167 alphaZ *= (
m_flatDist->shoot() > 0.5) ? -1. : 1.;
168
169
171 startY,
172 startZ,
174 alphaZ),
175 10e3, 10e3);
176
177
179 covMat.setZero();
180
181
187 startSurface,
188 covMat);
189
191
192
193
195
196
197
198 Trk::CylinderSurface estimationCylinder(Amg::
Transform3D(), estimationR, 10e10);
199
200 ATH_MSG_VERBOSE(
"Cylinder to be intersected : " << estimationCylinder);
201
202 auto estimationParameters =
m_propagator->propagateParameters(ctx,
203 startParameters,
204 estimationCylinder,
206 false,
208 if (!estimationParameters) {
209 ATH_MSG_VERBOSE(
"Estimation of intersection did not work - skip event !");
210 return StatusCode::SUCCESS;
211 }
212
214
215 const Amg::Vector3D& estimatedPosition = estimationParameters->position();
216
217 double estimationX = estimatedPosition.x();
218 double estimationY = estimatedPosition.y();
219 double estimationZ = estimatedPosition.z();
220
221 double estimationPhi = estimatedPosition.phi();
222 double estimationTheta = estimatedPosition.theta();
223
224
225
227 rotateTrans *= (
m_flatDist->shoot() > 0.5) ? -1. : 1.;
228
230
232
233 Amg::Vector3D radialVector(estimatedPosition.x(), estimatedPosition.y(), 0.);
236
237 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
238
240 surfaceRotation.col(0) = surfaceXdirection;
241 surfaceRotation.col(1) = surfaceYdirection;
242 surfaceRotation.col(2) = surfaceZdirection;
245 } else
247 estimationY,
248 estimationZ,
249 estimationPhi,
250 estimationTheta,
251 rotateTrans);
252
253
254
255 Trk::PlaneSurface destinationSurface(surfaceTransform, 10e5, 10e5);
256
257
258
259 std::optional<Trk::TransportJacobian> optTransportJacobian {};
261 testMatrix.setZero();
262 Trk::TransportJacobian currentStepJacobian(testMatrix);
263 double pathLimit = -1.;
264
266 startParameters,
267 destinationSurface,
269 false,
271 optTransportJacobian,
272 pathLimit);
273
274
275 if (trackParameters && optTransportJacobian) {
276 unsigned int recStep = 0;
277 const auto& transportJacobian = (*optTransportJacobian);
278
280
281
282
283 m_loc1loc1[recStep] = (transportJacobian) (0, 0);
284 m_loc1loc2[recStep] = (transportJacobian) (0, 1);
285 m_loc1phi[recStep] = (transportJacobian) (0, 2);
287 m_loc1qop[recStep] = (transportJacobian) (0, 4);
289
290 m_loc2loc1[recStep] = (transportJacobian) (1, 0);
291 m_loc2loc2[recStep] = (transportJacobian) (1, 1);
292 m_loc2phi[recStep] = (transportJacobian) (1, 2);
294 m_loc2qop[recStep] = (transportJacobian) (1, 4);
296
297 m_philoc1[recStep] = (transportJacobian) (2, 0);
298 m_philoc2[recStep] = (transportJacobian) (2, 1);
299 m_phiphi[recStep] = (transportJacobian) (2, 2);
300 m_phitheta[recStep] = (transportJacobian) (2, 3);
301 m_phiqop[recStep] = (transportJacobian) (2, 4);
303
306 m_thetaphi[recStep] = (transportJacobian) (3, 2);
308 m_thetaqop[recStep] = (transportJacobian) (3, 4);
310
311 m_qoploc1[recStep] = (transportJacobian) (4, 0);
312 m_qoploc2[recStep] = (transportJacobian) (4, 1);
313 m_qopphi[recStep] = (transportJacobian) (4, 2);
314 m_qoptheta[recStep] = (transportJacobian) (4, 3);
315 m_qopqop[recStep] = (transportJacobian) (4, 4);
317
318 ++recStep;
319
320
321
323
325
326
329
332
335
338
341
342
343 auto endLoc1Minus =
m_propagator->propagateParameters(ctx,
344 startLoc1Minus,
345 destinationSurface,
347 false,
349
350
351 auto endLoc1Plus =
m_propagator->propagateParameters(ctx,
352 startLoc1Plus,
353 destinationSurface,
355 false,
357
358 auto endLoc2Minus =
m_propagator->propagateParameters(ctx,
359 startLoc2Minus,
360 destinationSurface,
362 false,
364
365 auto endLoc2Plus =
m_propagator->propagateParameters(ctx,
366 startLoc2Plus,
367 destinationSurface,
369 false,
371
372 auto endPhiMinus =
m_propagator->propagateParameters(ctx,
373 startPhiMinus,
374 destinationSurface,
376 false,
378
379 auto endPhiPlus =
m_propagator->propagateParameters(ctx,
380 startPhiPlus,
381 destinationSurface,
383 false,
385
386 auto endThetaMinus =
m_propagator->propagateParameters(ctx,
387 startThetaMinus,
388 destinationSurface,
390 false,
392
393 auto endThetaPlus =
m_propagator->propagateParameters(ctx,
394 startThetaPlus,
395 destinationSurface,
397 false,
399
400 auto endQopMinus =
m_propagator->propagateParameters(ctx,
401 startQopMinus,
402 destinationSurface,
404 false,
406
407 auto endQopPlus =
m_propagator->propagateParameters(ctx,
408 startQopPlus,
409 destinationSurface,
411 false,
413 if (endLoc1Minus
414 && endLoc1Plus
415 && endLoc2Minus
416 && endLoc2Plus
417 && endPhiMinus
418 && endPhiPlus
419 && endThetaMinus
420 && endThetaPlus
421 && endQopMinus
422 && endQopPlus) {
423
424 const Amg::VectorX& endLoc1MinusPar = endLoc1Minus->parameters();
425 const Amg::VectorX& endLoc1PlusPar = endLoc1Plus->parameters();
426
427 const Amg::VectorX& endLoc2MinusPar = endLoc2Minus->parameters();
428 const Amg::VectorX& endLoc2PlusPar = endLoc2Plus->parameters();
429
430 const Amg::VectorX& endPhiMinusPar = endPhiMinus->parameters();
431 const Amg::VectorX& endPhiPlusPar = endPhiPlus->parameters();
432
433 const Amg::VectorX& endThetaMinusPar = endThetaMinus->parameters();
434 const Amg::VectorX& endThetaPlusPar = endThetaPlus->parameters();
435
436 const Amg::VectorX& endQopMinusPar = endQopMinus->parameters();
437 const Amg::VectorX& endQopPlusPar = endQopPlus->parameters();
438
439
440 Amg::VectorX endLoc1Diff(endLoc1PlusPar - endLoc1MinusPar);
441 Amg::VectorX endLoc2Diff(endLoc2PlusPar - endLoc2MinusPar);
442 Amg::VectorX endPhiDiff(endPhiPlusPar - endPhiMinusPar);
443 Amg::VectorX endThetaDiff(endThetaPlusPar - endThetaMinusPar);
444 Amg::VectorX endQopDiff(endQopPlusPar - endQopMinusPar);
445
450 currentStepJacobian(0, 4) = endQopDiff[0] / (2. *
m_qOpVariations[istep]);
451
452 m_loc1loc1[recStep] = currentStepJacobian(0, 0);
453 m_loc1loc2[recStep] = currentStepJacobian(0, 1);
454 m_loc1phi[recStep] = currentStepJacobian(0, 2);
456 m_loc1qop[recStep] = currentStepJacobian(0, 4);
458
463 currentStepJacobian(1, 4) = endQopDiff[1] / (2. *
m_qOpVariations[istep]);
464
465 m_loc2loc1[recStep] = currentStepJacobian(1, 0);
466 m_loc2loc2[recStep] = currentStepJacobian(1, 1);
467 m_loc2phi[recStep] = currentStepJacobian(1, 2);
469 m_loc2qop[recStep] = currentStepJacobian(1, 4);
471
476 currentStepJacobian(2, 4) = endQopDiff[2] / (2. *
m_qOpVariations[istep]);
477
478 m_philoc1[recStep] = currentStepJacobian(2, 0);
479 m_philoc2[recStep] = currentStepJacobian(2, 1);
480 m_phiphi[recStep] = currentStepJacobian(2, 2);
481 m_phitheta[recStep] = currentStepJacobian(2, 3);
482 m_phiqop[recStep] = currentStepJacobian(2, 4);
484
489 currentStepJacobian(3, 4) = endQopDiff[3] / (2. *
m_qOpVariations[istep]);
490
493 m_thetaphi[recStep] = currentStepJacobian(3, 2);
495 m_thetaqop[recStep] = currentStepJacobian(3, 4);
497
502 currentStepJacobian(4, 4) = endQopDiff[4] / (2. *
m_qOpVariations[istep]);
503
504 m_qoploc1[recStep] = currentStepJacobian(4, 0);
505 m_qoploc2[recStep] = currentStepJacobian(4, 1);
506 m_qopphi[recStep] = currentStepJacobian(4, 2);
507 m_qoptheta[recStep] = currentStepJacobian(4, 3);
508 m_qopqop[recStep] = currentStepJacobian(4, 4);
510
511 ATH_MSG_DEBUG(
"Current TransportJacobian : " << currentStepJacobian);
512
513 ++recStep;
514 }
515 }
516
517
518 if (recStep > 2) {
519
520
539
558
575
594
611
612 currentStepJacobian(0, 0) =
m_loc1loc1[recStep];
613 currentStepJacobian(0, 1) =
m_loc1loc2[recStep];
614 currentStepJacobian(0, 2) =
m_loc1phi[recStep];
616 currentStepJacobian(0, 4) =
m_loc1qop[recStep];
617
618 currentStepJacobian(1, 0) =
m_loc2loc1[recStep];
619 currentStepJacobian(1, 1) =
m_loc2loc2[recStep];
620 currentStepJacobian(1, 2) =
m_loc2phi[recStep];
622 currentStepJacobian(1, 4) =
m_loc2qop[recStep];
623
624 currentStepJacobian(2, 0) =
m_philoc1[recStep];
625 currentStepJacobian(2, 1) =
m_philoc2[recStep];
626 currentStepJacobian(2, 2) =
m_phiphi[recStep];
627 currentStepJacobian(2, 3) =
m_phitheta[recStep];
628 currentStepJacobian(2, 4) =
m_phiqop[recStep];
629
632 currentStepJacobian(3, 2) =
m_thetaphi[recStep];
634 currentStepJacobian(3, 4) =
m_thetaqop[recStep];
635
636 currentStepJacobian(4, 0) =
m_qoploc1[recStep];
637 currentStepJacobian(4, 1) =
m_qoploc2[recStep];
638 currentStepJacobian(4, 2) =
m_qopphi[recStep];
639 currentStepJacobian(4, 3) =
m_qoptheta[recStep];
640 currentStepJacobian(4, 4) =
m_qopqop[recStep];
641 }
642
643 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian);
644 ++recStep;
645
646
647
648 TransportJacobian diffMatrix(transportJacobian - currentStepJacobian);
649
650 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix);
651
652
653
654
661
668
671 m_phiphi[recStep] = diffMatrix(2, 2);
673 m_phiqop[recStep] = diffMatrix(2, 4);
675
682
685 m_qopphi[recStep] = diffMatrix(4, 2);
687 m_qopqop[recStep] = diffMatrix(4, 4);
689 ++recStep;
690
691
692 if (recStep > 1) {
693
695 1
e-50 ? -std::log10(std::abs(
m_loc1loc1[recStep - 1])) : 0.;
697 1
e-50 ? -std::log10(std::abs(
m_loc1loc2[recStep - 1])) : 0.;
699 1
e-50 ? -std::log10(std::abs(
m_loc1phi[recStep - 1])) : 0.;
702 1])) : 0.;
704 1
e-50 ? -std::log10(std::abs(
m_loc1qop[recStep - 1])) : 0.;
706
708 1
e-50 ? -std::log10(std::abs(
m_loc2loc1[recStep - 1])) : 0.;
710 1
e-50 ? -std::log10(std::abs(
m_loc2loc2[recStep - 1])) : 0.;
712 1
e-50 ? -std::log10(std::abs(
m_loc2phi[recStep - 1])) : 0.;
714 1
e-50 ? -std::log10(std::abs(
m_loc2theta[recStep - 1])) : 0.;
716 1
e-50 ? -std::log10(std::abs(
m_loc2qop[recStep - 1])) : 0.;
718
720 1
e-50 ? -std::log10(std::abs(
m_philoc1[recStep - 1])) : 0.;
722 1
e-50 ? -std::log10(std::abs(
m_philoc2[recStep - 1])) : 0.;
724 1
e-50 ? -std::log10(std::abs(
m_phiphi[recStep - 1])) : 0.;
726 1
e-50 ? -std::log10(std::abs(
m_phitheta[recStep - 1])) : 0.;
728 1
e-50 ? -std::log10(std::abs(
m_phiqop[recStep - 1])) : 0.;
730
732 1
e-50 ? -std::log10(std::abs(
m_thetaloc1[recStep - 1])) : 0.;
734 1
e-50 ? -std::log10(std::abs(
m_thetaloc2[recStep - 1])) : 0.;
736 1
e-50 ? -std::log10(std::abs(
m_thetaphi[recStep - 1])) : 0.;
738 1
e-50 ? -std::log10(std::abs(
m_thetatheta[recStep - 1])) : 0.;
740 1
e-50 ? -std::log10(std::abs(
m_thetaqop[recStep - 1])) : 0.;
742
744 1
e-50 ? -std::log10(std::abs(
m_qoploc1[recStep - 1])) : 0.;
746 1
e-50 ? -std::log10(std::abs(
m_qoploc2[recStep - 1])) : 0.;
748 1
e-50 ? -std::log10(std::abs(
m_qopphi[recStep - 1])) : 0.;
751 1])) : 0.;
753 1
e-50 ? -std::log10(std::abs(
m_qopqop[recStep - 1])) : 0.;
755 }
756 ++recStep;
757
758
759
760
761
763 std::abs((transportJacobian) (0, 0)) > 1
e-50 ? diffMatrix(0, 0) / ((transportJacobian) (0, 0)) : 0.;
765 std::abs((transportJacobian) (0, 1)) > 1
e-50 ? diffMatrix(0, 1) / ((transportJacobian) (0, 1)) : 0.;
767 std::abs((transportJacobian) (0, 2)) > 1
e-50 ? diffMatrix(0, 2) / ((transportJacobian) (0, 2)) : 0.;
769 std::abs((transportJacobian) (0, 3)) > 1
e-50 ? diffMatrix(0, 3) / ((transportJacobian) (0, 3)) : 0.;
771 std::abs((transportJacobian) (0, 4)) > 1
e-50 ? diffMatrix(0, 4) / ((transportJacobian) (0, 4)) : 0.;
773
775 std::abs((transportJacobian) (1, 0)) > 1
e-50 ? diffMatrix(1, 0) / ((transportJacobian) (1, 0)) : 0.;
777 std::abs((transportJacobian) (1, 1)) > 1
e-50 ? diffMatrix(1, 1) / ((transportJacobian) (1, 1)) : 0.;
779 std::abs((transportJacobian) (1, 2)) > 1
e-50 ? diffMatrix(1, 2) / ((transportJacobian) (1, 2)) : 0.;
781 std::abs((transportJacobian) (1, 3)) > 1
e-50 ? diffMatrix(1, 3) / ((transportJacobian) (1, 3)) : 0.;
783 std::abs((transportJacobian) (1, 4)) > 1
e-50 ? diffMatrix(1, 4) / ((transportJacobian) (1, 4)) : 0.;
785
787 std::abs((transportJacobian) (2, 0)) > 1
e-50 ? diffMatrix(2, 0) / ((transportJacobian) (2, 0)) : 0.;
789 std::abs((transportJacobian) (2, 1)) > 1
e-50 ? diffMatrix(2, 1) / ((transportJacobian) (2, 1)) : 0.;
791 std::abs((transportJacobian) (2, 2)) > 1
e-50 ? diffMatrix(2, 2) / ((transportJacobian) (2, 2)) : 0.;
793 std::abs((transportJacobian) (2, 3)) > 1
e-50 ? diffMatrix(2, 3) / ((transportJacobian) (2, 3)) : 0.;
795 std::abs((transportJacobian) (2, 4)) > 1
e-50 ? diffMatrix(2, 4) / ((transportJacobian) (2, 4)) : 0.;
797
799 std::abs((transportJacobian) (3, 0)) > 1
e-50 ? diffMatrix(3, 0) / ((transportJacobian) (3, 0)) : 0.;
801 std::abs((transportJacobian) (3, 1)) > 1
e-50 ? diffMatrix(3, 1) / ((transportJacobian) (3, 1)) : 0.;
803 std::abs((transportJacobian) (3, 2)) > 1
e-50 ? diffMatrix(3, 2) / ((transportJacobian) (3, 2)) : 0.;
805 std::abs((transportJacobian) (3, 3)) > 1
e-50 ? diffMatrix(3, 3) / ((transportJacobian) (3, 3)) : 0.;
807 std::abs((transportJacobian) (3, 4)) > 1
e-50 ? diffMatrix(3, 4) / ((transportJacobian) (3, 4)) : 0.;
809
811 std::abs((transportJacobian) (4, 0)) > 1
e-50 ? diffMatrix(4, 0) / ((transportJacobian) (4, 0)) : 0.;
813 std::abs((transportJacobian) (4, 1)) > 1
e-50 ? diffMatrix(4, 1) / ((transportJacobian) (4, 1)) : 0.;
815 std::abs((transportJacobian) (4, 2)) > 1
e-50 ? diffMatrix(4, 2) / ((transportJacobian) (4, 2)) : 0.;
817 std::abs((transportJacobian) (4, 3)) > 1
e-50 ? diffMatrix(4, 3) / ((transportJacobian) (4, 3)) : 0.;
819 std::abs((transportJacobian) (4, 4)) > 1
e-50 ? diffMatrix(4, 4) / ((transportJacobian) (4, 4)) : 0.;
821 ++recStep;
822
823
824
826 1
e-50 ? -std::log10(std::abs(
m_loc1loc1[recStep - 1])) : 0.;
828 1
e-50 ? -std::log10(std::abs(
m_loc1loc2[recStep - 1])) : 0.;
831 1
e-50 ? -std::log10(std::abs(
m_loc1theta[recStep - 1])) : 0.;
834
836 1
e-50 ? -std::log10(std::abs(
m_loc2loc1[recStep - 1])) : 0.;
838 1
e-50 ? -std::log10(std::abs(
m_loc2loc2[recStep - 1])) : 0.;
840 1
e-50 ? -std::log10(std::abs(
m_loc2phi[recStep - 1])) : 0.;
843 1])) : 0.;
845 1
e-50 ? -std::log10(std::abs(
m_loc2qop[recStep - 1])) : 0.;
847
849 1
e-50 ? -std::log10(std::abs(
m_philoc1[recStep - 1])) : 0.;
851 1
e-50 ? -std::log10(std::abs(
m_philoc2[recStep - 1])) : 0.;
853 1
e-50 ? -std::log10(std::abs(
m_phiphi[recStep - 1])) : 0.;
855 1
e-50 ? -std::log10(std::abs(
m_phitheta[recStep - 1])) : 0.;
857 1
e-50 ? -std::log10(std::abs(
m_phiqop[recStep - 1])) : 0.;
859
862 1])) : 0.;
865 1])) : 0.;
867 1
e-50 ? -std::log10(std::abs(
m_thetaphi[recStep - 1])) : 0.;
869 1
e-50 ? -std::log10(std::abs(
m_thetatheta[recStep - 1])) : 0.;
871 1
e-50 ? -std::log10(std::abs(
m_thetaqop[recStep - 1])) : 0.;
873
875 1
e-50 ? -std::log10(std::abs(
m_qoploc1[recStep - 1])) : 0.;
877 1
e-50 ? -std::log10(std::abs(
m_qoploc2[recStep - 1])) : 0.;
880 1
e-50 ? -std::log10(std::abs(
m_qoptheta[recStep - 1])) : 0.;
883 ++recStep;
884
887 }
888
889
890 return StatusCode::SUCCESS;
891}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_VERBOSE(x,...)
double charge(const T &p)
Eigen::Affine3d Transform3D
#define AmgMatrix(rows, cols)
float m_phisteps[RIDDLERSSTEPS]
DoubleProperty m_maximumR
DoubleProperty m_minimumR
To create the first extimations.
float m_phiqop[RIDDLERSSTEPS]
float m_qopphi[RIDDLERSSTEPS]
float m_loc1theta[RIDDLERSSTEPS]
float m_loc2theta[RIDDLERSSTEPS]
static double parabolicInterpolation(double y0, double y1, double y2, double x0, double x1, double x2)
Langrange-parabolic interpolation.
TTree * m_validationTree
Root Validation Tree.
float m_thetaloc1[RIDDLERSSTEPS]
DoubleArrayProperty m_angularVariations
float m_loc1loc1[RIDDLERSSTEPS]
PublicToolHandle< IPropagator > m_propagator
member variables for algorithm properties:
float m_loc1qop[RIDDLERSSTEPS]
float m_qoptheta[RIDDLERSSTEPS]
float m_qopqop[RIDDLERSSTEPS]
DoubleArrayProperty m_localVariations
variations
float m_loc2steps[RIDDLERSSTEPS]
float m_loc1loc2[RIDDLERSSTEPS]
float m_thetaloc2[RIDDLERSSTEPS]
float m_loc2qop[RIDDLERSSTEPS]
float m_phiphi[RIDDLERSSTEPS]
float m_phitheta[RIDDLERSSTEPS]
float m_philoc2[RIDDLERSSTEPS]
float m_philoc1[RIDDLERSSTEPS]
float m_loc2loc2[RIDDLERSSTEPS]
float m_loc2phi[RIDDLERSSTEPS]
float m_qoploc1[RIDDLERSSTEPS]
static Amg::Transform3D createTransform(double x, double y, double z, double phi=0., double theta=0., double alphaZ=0.)
private helper method to create a HepTransform
float m_qoploc2[RIDDLERSSTEPS]
float m_thetaqop[RIDDLERSSTEPS]
DoubleProperty m_sigmaLoc
The smearing.
float m_thetaphi[RIDDLERSSTEPS]
DoubleArrayProperty m_qOpVariations
float m_qopsteps[RIDDLERSSTEPS]
float m_loc1steps[RIDDLERSSTEPS]
float m_thetasteps[RIDDLERSSTEPS]
float m_loc1phi[RIDDLERSSTEPS]
float m_thetatheta[RIDDLERSSTEPS]
BooleanProperty m_useAlignedSurfaces
float m_loc2loc1[RIDDLERSSTEPS]
Eigen::Matrix< double, Eigen::Dynamic, 1 > VectorX
Dynamic Vector - dynamic allocation.
@ loc2
generic first and second local coordinate
ParametersT< TrackParametersDim, Charged, PlaneSurface > AtaPlane