138{
139 const EventContext& ctx = Gaudi::Hive::currentContext();
140
144
145
146
147
148
151
155
156
159 surfacePhi *= (
m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
160 double startX = startR*
cos(surfacePhi);
161 double startY = startR*
sin(surfacePhi);
163
164
166 alphaZ *= (
m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
167
168
170 startY,
171 startZ,
173 alphaZ),
174 10e3,10e3);
175
176
178 covMat.setZero();
179
180
186 startSurface,
187 covMat);
188
190
191
192
194
195
196
197 Trk::CylinderSurface estimationCylinder(Amg::
Transform3D(), estimationR, 10e10);
198
199 ATH_MSG_VERBOSE(
"Cylinder to be intersected : " << estimationCylinder );
200
201 auto estimationParameters =
m_propagator->propagateParameters(ctx,
202 startParameters,
203 estimationCylinder,
205 false,
207 if (!estimationParameters) {
208 ATH_MSG_VERBOSE(
"Estimation of intersection did not work - skip event !" );
209 return StatusCode::SUCCESS;
210 }
211
213
214 const Amg::Vector3D& estimatedPosition = estimationParameters->position();
215
216 double estimationX = estimatedPosition.x();
217 double estimationY = estimatedPosition.y();
218 double estimationZ = estimatedPosition.z();
219
220 double estimationPhi = estimatedPosition.phi();
221 double estimationTheta = estimatedPosition.theta();
222
223
224
226 rotateTrans *= (
m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
227
229
231
232 Amg::Vector3D radialVector(estimatedPosition.x(), estimatedPosition.y(), 0.);
235
236 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
237
239 surfaceRotation.col(0) = surfaceXdirection;
240 surfaceRotation.col(1) = surfaceYdirection;
241 surfaceRotation.col(2) = surfaceZdirection;
244 } else
246 estimationY,
247 estimationZ,
248 estimationPhi,
249 estimationTheta,
250 rotateTrans);
251
252
253
254 Trk::PlaneSurface destinationSurface(surfaceTransform,10e5 , 10e5);
255
256
257
258 std::optional<Trk::TransportJacobian> optTransportJacobian{};
259 AmgMatrix(5,5) testMatrix; testMatrix.setZero();
260 Trk::TransportJacobian currentStepJacobian(testMatrix);
261 double pathLimit = -1.;
262
264 startParameters,
265 destinationSurface,
267 false,
269 optTransportJacobian,
270 pathLimit);
271
272
273 if (trackParameters && optTransportJacobian){
274
275 unsigned int recStep = 0;
276 const auto& transportJacobian = (*optTransportJacobian);
277
279
280
281
282 m_loc1loc1[recStep] = (transportJacobian)(0,0);
283 m_loc1loc2[recStep] = (transportJacobian)(0,1);
284 m_loc1phi[recStep] = (transportJacobian)(0,2);
286 m_loc1qop[recStep] = (transportJacobian)(0,4);
288
289 m_loc2loc1[recStep] = (transportJacobian)(1,0);
290 m_loc2loc2[recStep] = (transportJacobian)(1,1);
291 m_loc2phi[recStep] = (transportJacobian)(1,2);
293 m_loc2qop[recStep] = (transportJacobian)(1,4);
295
296 m_philoc1[recStep] = (transportJacobian)(2,0);
297 m_philoc2[recStep] = (transportJacobian)(2,1);
298 m_phiphi[recStep] = (transportJacobian)(2,2);
299 m_phitheta[recStep] = (transportJacobian)(2,3);
300 m_phiqop[recStep] = (transportJacobian)(2,4);
302
305 m_thetaphi[recStep] = (transportJacobian)(3,2);
307 m_thetaqop[recStep] = (transportJacobian)(3,4);
309
310 m_qoploc1[recStep] = (transportJacobian)(4,0);
311 m_qoploc2[recStep] = (transportJacobian)(4,1);
312 m_qopphi[recStep] = (transportJacobian)(4,2);
313 m_qoptheta[recStep] = (transportJacobian)(4,3);
314 m_qopqop[recStep] = (transportJacobian)(4,4);
316
317 ++recStep;
318
319
320
322
324
325
328
331
334
337
340
341
342 auto endLoc1Minus =
m_propagator->propagateParameters(ctx,
343 startLoc1Minus,
344 destinationSurface,
346 false,
348
349
350 auto endLoc1Plus =
m_propagator->propagateParameters(ctx,
351 startLoc1Plus,
352 destinationSurface,
354 false,
356
357 auto endLoc2Minus =
m_propagator->propagateParameters(ctx,
358 startLoc2Minus,
359 destinationSurface,
361 false,
363
364 auto endLoc2Plus =
m_propagator->propagateParameters(ctx,
365 startLoc2Plus,
366 destinationSurface,
368 false,
370
371 auto endPhiMinus =
m_propagator->propagateParameters(ctx,
372 startPhiMinus,
373 destinationSurface,
375 false,
377
378 auto endPhiPlus =
m_propagator->propagateParameters(ctx,
379 startPhiPlus,
380 destinationSurface,
382 false,
384
385 auto endThetaMinus =
m_propagator->propagateParameters(ctx,
386 startThetaMinus,
387 destinationSurface,
389 false,
391
392 auto endThetaPlus =
m_propagator->propagateParameters(ctx,
393 startThetaPlus,
394 destinationSurface,
396 false,
398
399 auto endQopMinus =
m_propagator->propagateParameters(ctx,
400 startQopMinus,
401 destinationSurface,
403 false,
405
406 auto endQopPlus =
m_propagator->propagateParameters(ctx,
407 startQopPlus,
408 destinationSurface,
410 false,
412 if (endLoc1Minus
413 && endLoc1Plus
414 && endLoc2Minus
415 && endLoc2Plus
416 && endPhiMinus
417 && endPhiPlus
418 && endThetaMinus
419 && endThetaPlus
420 && endQopMinus
421 && endQopPlus){
422
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);
443 Amg::VectorX endThetaDiff(endThetaPlusPar-endThetaMinusPar);
445
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
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
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
490
493 m_thetaphi[recStep] = currentStepJacobian(3,2);
495 m_thetaqop[recStep] = currentStepJacobian(3,4);
497
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
532
544
556
568
580
581 currentStepJacobian(0,0)=
m_loc1loc1[recStep];
582 currentStepJacobian(0,1)=
m_loc1loc2[recStep];
583 currentStepJacobian(0,2)=
m_loc1phi[recStep];
585 currentStepJacobian(0,4)=
m_loc1qop[recStep];
586
587 currentStepJacobian(1,0)=
m_loc2loc1[recStep];
588 currentStepJacobian(1,1)=
m_loc2loc2[recStep];
589 currentStepJacobian(1,2)=
m_loc2phi[recStep];
591 currentStepJacobian(1,4)=
m_loc2qop[recStep];
592
593 currentStepJacobian(2,0)=
m_philoc1[recStep];
594 currentStepJacobian(2,1)=
m_philoc2[recStep];
595 currentStepJacobian(2,2)=
m_phiphi[recStep];
596 currentStepJacobian(2,3)=
m_phitheta[recStep];
597 currentStepJacobian(2,4)=
m_phiqop[recStep];
598
601 currentStepJacobian(3,2)=
m_thetaphi[recStep];
603 currentStepJacobian(3,4)=
m_thetaqop[recStep];
604
605 currentStepJacobian(4,0)=
m_qoploc1[recStep];
606 currentStepJacobian(4,1)=
m_qoploc2[recStep];
607 currentStepJacobian(4,2)=
m_qopphi[recStep];
608 currentStepJacobian(4,3)=
m_qoptheta[recStep];
609 currentStepJacobian(4,4)=
m_qopqop[recStep];
610
611 }
612
613 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian );
614 ++recStep;
615
616
617
618 TransportJacobian diffMatrix(transportJacobian-currentStepJacobian);
619
620 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix );
621
622
623
624
631
638
641 m_phiphi[recStep] = diffMatrix(2,2);
643 m_phiqop[recStep] = diffMatrix(2,4);
645
652
655 m_qopphi[recStep] = diffMatrix(4,2);
657 m_qopqop[recStep] = diffMatrix(4,4);
659 ++recStep;
660
661
662 if (recStep > 1){
663
670
677
684
691
698 }
699 ++recStep;
700
701
702
703
704
705 m_loc1loc1[recStep] = std::abs((transportJacobian)(0,0)) > 1
e-50 ? diffMatrix(0,0)/((transportJacobian)(0,0)) : 0.;
706 m_loc1loc2[recStep] = std::abs((transportJacobian)(0,1)) > 1
e-50 ? diffMatrix(0,1)/((transportJacobian)(0,1)) : 0.;
707 m_loc1phi[recStep] = std::abs((transportJacobian)(0,2)) > 1
e-50 ? diffMatrix(0,2)/((transportJacobian)(0,2)) : 0.;
708 m_loc1theta[recStep] = std::abs((transportJacobian)(0,3)) > 1
e-50 ? diffMatrix(0,3)/((transportJacobian)(0,3)) : 0.;
709 m_loc1qop[recStep] = std::abs((transportJacobian)(0,4)) > 1
e-50 ? diffMatrix(0,4)/((transportJacobian)(0,4)) : 0.;
711
712 m_loc2loc1[recStep] = std::abs((transportJacobian)(1,0)) > 1
e-50 ? diffMatrix(1,0)/((transportJacobian)(1,0)) : 0.;
713 m_loc2loc2[recStep] = std::abs((transportJacobian)(1,1)) > 1
e-50 ? diffMatrix(1,1)/((transportJacobian)(1,1)) : 0.;
714 m_loc2phi[recStep] = std::abs((transportJacobian)(1,2)) > 1
e-50 ? diffMatrix(1,2)/((transportJacobian)(1,2)) : 0.;
715 m_loc2theta[recStep] = std::abs((transportJacobian)(1,3)) > 1
e-50 ? diffMatrix(1,3)/((transportJacobian)(1,3)) : 0.;
716 m_loc2qop[recStep] = std::abs((transportJacobian)(1,4)) > 1
e-50 ? diffMatrix(1,4)/((transportJacobian)(1,4)) : 0.;
718
719 m_philoc1[recStep] = std::abs((transportJacobian)(2,0)) > 1
e-50 ? diffMatrix(2,0)/((transportJacobian)(2,0)) : 0.;
720 m_philoc2[recStep] = std::abs((transportJacobian)(2,1)) > 1
e-50 ? diffMatrix(2,1)/((transportJacobian)(2,1)) : 0.;
721 m_phiphi[recStep] = std::abs((transportJacobian)(2,2)) > 1
e-50 ? diffMatrix(2,2)/((transportJacobian)(2,2)) : 0.;
722 m_phitheta[recStep] = std::abs((transportJacobian)(2,3)) > 1
e-50 ? diffMatrix(2,3)/((transportJacobian)(2,3)) : 0.;
723 m_phiqop[recStep] = std::abs((transportJacobian)(2,4)) > 1
e-50 ? diffMatrix(2,4)/((transportJacobian)(2,4)) : 0.;
725
726 m_thetaloc1[recStep] = std::abs((transportJacobian)(3,0)) > 1
e-50 ? diffMatrix(3,0)/((transportJacobian)(3,0)) : 0.;
727 m_thetaloc2[recStep] = std::abs((transportJacobian)(3,1)) > 1
e-50 ? diffMatrix(3,1)/((transportJacobian)(3,1)) : 0.;
728 m_thetaphi[recStep] = std::abs((transportJacobian)(3,2)) > 1
e-50 ? diffMatrix(3,2)/((transportJacobian)(3,2)) : 0.;
729 m_thetatheta[recStep] = std::abs((transportJacobian)(3,3)) > 1
e-50 ? diffMatrix(3,3)/((transportJacobian)(3,3)) : 0.;
730 m_thetaqop[recStep] = std::abs((transportJacobian)(3,4)) > 1
e-50 ? diffMatrix(3,4)/((transportJacobian)(3,4)) : 0.;
732
733 m_qoploc1[recStep] = std::abs((transportJacobian)(4,0)) > 1
e-50 ? diffMatrix(4,0)/((transportJacobian)(4,0)) : 0.;
734 m_qoploc2[recStep] = std::abs((transportJacobian)(4,1)) > 1
e-50 ? diffMatrix(4,1)/((transportJacobian)(4,1)) : 0.;
735 m_qopphi[recStep] = std::abs((transportJacobian)(4,2)) > 1
e-50 ? diffMatrix(4,2)/((transportJacobian)(4,2)) : 0.;
736 m_qoptheta[recStep] = std::abs((transportJacobian)(4,3)) > 1
e-50 ? diffMatrix(4,3)/((transportJacobian)(4,3)) : 0.;
737 m_qopqop[recStep] = std::abs((transportJacobian)(4,4)) > 1
e-50 ? diffMatrix(4,4)/((transportJacobian)(4,4)) : 0.;
739 ++recStep;
740
741
742
749
756
763
770
777 ++recStep;
778
781 }
782
783
784 return StatusCode::SUCCESS;
785}
Scalar eta() const
pseudorapidity method
#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