19 #include "GaudiKernel/ITHistSvc.h"
33 delete m_magFieldProperties;
47 if (!m_useCustomField)
57 m_gaussDist =
new Rndm::Numbers(randSvc(), Rndm::Gauss(0.,1.));
58 m_flatDist =
new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
62 m_validationTree =
new TTree(m_validationTreeName.value().c_str(),
63 m_validationTreeDescription.value().c_str());
66 m_validationTree->Branch(
"RiddersSteps", &m_steps,
"steps/I");
68 m_validationTree->Branch(
"Loc1Loc1", m_loc1loc1,
"loc1loc1[steps]/F");
69 m_validationTree->Branch(
"Loc1Loc2", m_loc1loc2,
"loc1loc2[steps]/F");
70 m_validationTree->Branch(
"Loc1Phi", m_loc1phi,
"loc1phi[steps]/F");
71 m_validationTree->Branch(
"Loc1Theta", m_loc1theta,
"loc1theta[steps]/F");
72 m_validationTree->Branch(
"Loc1qOp", m_loc1qop,
"loc1qop[steps]/F");
73 m_validationTree->Branch(
"Loc1Steps", m_loc1steps,
"loc1steps[steps]/F");
75 m_validationTree->Branch(
"Loc2Loc1", m_loc2loc1,
"loc2loc1[steps]/F");
76 m_validationTree->Branch(
"Loc2Loc2", m_loc2loc2,
"loc2loc2[steps]/F");
77 m_validationTree->Branch(
"Loc2Phi", m_loc2phi,
"loc2phi[steps]/F");
78 m_validationTree->Branch(
"Loc2Theta", m_loc2theta,
"loc2theta[steps]/F");
79 m_validationTree->Branch(
"Loc2qOp", m_loc2qop,
"loc2qop[steps]/F");
80 m_validationTree->Branch(
"Loc2Steps", m_loc2steps,
"loc2steps[steps]/F");
82 m_validationTree->Branch(
"PhiLoc1", m_philoc1,
"philoc1[steps]/F");
83 m_validationTree->Branch(
"PhiLoc2", m_philoc2 ,
"philoc2[steps]/F");
84 m_validationTree->Branch(
"PhiPhi", m_phiphi,
"phiphi[steps]/F");
85 m_validationTree->Branch(
"PhiTheta", m_phitheta,
"phitheta[steps]/F");
86 m_validationTree->Branch(
"PhiqOp", m_phiqop,
"phiqop[steps]/F");
87 m_validationTree->Branch(
"PhiSteps", m_phisteps,
"phisteps[steps]/F");
89 m_validationTree->Branch(
"ThetaLoc1", m_thetaloc1,
"thetaloc1[steps]/F");
90 m_validationTree->Branch(
"ThetaLoc2", m_thetaloc2,
"thetaloc2[steps]/F");
91 m_validationTree->Branch(
"ThetaPhi", m_thetaphi,
"thetaphi[steps]/F");
92 m_validationTree->Branch(
"ThetaTheta", m_thetatheta,
"thetatheta[steps]/F");
93 m_validationTree->Branch(
"ThetaqOp", m_thetaqop,
"thetaqop[steps]/F");
94 m_validationTree->Branch(
"ThetaSteps", m_thetasteps,
"thetasteps[steps]/F");
96 m_validationTree->Branch(
"QopLoc1", m_qoploc1,
"qoploc1[steps]/F");
97 m_validationTree->Branch(
"QopLoc2", m_qoploc2,
"qoploc2[steps]/F");
98 m_validationTree->Branch(
"QopPhi", m_qopphi,
"qopphi[steps]/F");
99 m_validationTree->Branch(
"QopTheta", m_qoptheta,
"qoptheta[steps]/F");
100 m_validationTree->Branch(
"QopqOp", m_qopqop,
"qopqop[steps]/F");
101 m_validationTree->Branch(
"QopSteps", m_qopsteps,
"qopsteps[steps]/F");
104 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
106 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
107 delete m_validationTree; m_validationTree =
nullptr;
109 if ((tHistSvc->regTree(m_validationTreeFolder, m_validationTree)).isFailure()) {
110 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
111 delete m_validationTree; m_validationTree =
nullptr;
114 if (m_localVariations.empty())
115 m_localVariations = {0.01, 0.001, 0.0001};
117 if (m_angularVariations.empty())
118 m_angularVariations = {0.01, 0.001, 0.0001};
120 if (m_qOpVariations.empty())
121 m_qOpVariations = {0.0001, 0.00001, 0.000001};
124 return StatusCode::SUCCESS;
132 return StatusCode::SUCCESS;
139 const EventContext& ctx = Gaudi::Hive::currentContext();
141 double p = m_minP + m_flatDist->shoot()*(m_maxP-m_minP);
142 double charge = (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
149 double loc1 = m_sigmaLoc * m_gaussDist->shoot();
150 double loc2 = m_sigmaLoc * m_gaussDist->shoot();
152 double phi = m_minPhi + m_maxPhi * m_flatDist->shoot();
153 double eta = m_minEta + m_flatDist->shoot()*(m_maxEta-m_minEta);
157 double startR = std::abs(m_sigmaR * m_gaussDist->shoot());
158 double surfacePhi =
M_PI * m_flatDist->shoot();
159 surfacePhi *= (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
160 double startX = startR*
cos(surfacePhi);
161 double startY = startR*
sin(surfacePhi);
162 double startZ = m_sigmaLoc * m_gaussDist->shoot();
165 double alphaZ =
M_PI * m_flatDist->shoot();
166 alphaZ *= (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
193 double estimationR = m_minimumR + (m_maximumR-m_minimumR) * m_flatDist->shoot();
199 ATH_MSG_VERBOSE(
"Cylinder to be intersected : " << estimationCylinder );
201 auto estimationParameters = m_propagator->propagateParameters(ctx,
206 *m_magFieldProperties);
207 if (!estimationParameters) {
208 ATH_MSG_VERBOSE(
"Estimation of intersection did not work - skip event !" );
209 return StatusCode::SUCCESS;
214 const Amg::Vector3D& estimatedPosition = estimationParameters->position();
216 double estimationX = estimatedPosition.x();
217 double estimationY = estimatedPosition.y();
218 double estimationZ = estimatedPosition.z();
220 double estimationPhi = estimatedPosition.phi();
221 double estimationTheta = estimatedPosition.theta();
225 double rotateTrans =
M_PI * m_flatDist->shoot();
226 rotateTrans *= (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
230 if (m_useAlignedSurfaces){
232 Amg::Vector3D radialVector(estimatedPosition.x(), estimatedPosition.y(), 0.);
236 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
239 surfaceRotation.col(0) = surfaceXdirection;
240 surfaceRotation.col(1) = surfaceYdirection;
241 surfaceRotation.col(2) = surfaceZdirection;
245 surfaceTransform = createTransform(estimationX,
258 std::optional<Trk::TransportJacobian> optTransportJacobian{};
259 AmgMatrix(5,5) testMatrix; testMatrix.setZero();
261 double pathLimit = -1.;
263 auto trackParameters = m_propagator->propagate(ctx,
268 *m_magFieldProperties,
269 optTransportJacobian,
273 if (trackParameters && optTransportJacobian){
275 unsigned int recStep = 0;
276 const auto& transportJacobian = (*optTransportJacobian);
282 m_loc1loc1[recStep] = (transportJacobian)(0,0);
283 m_loc1loc2[recStep] = (transportJacobian)(0,1);
284 m_loc1phi[recStep] = (transportJacobian)(0,2);
285 m_loc1theta[recStep] = (transportJacobian)(0,3);
286 m_loc1qop[recStep] = (transportJacobian)(0,4);
287 m_loc1steps[recStep] = 0.;
289 m_loc2loc1[recStep] = (transportJacobian)(1,0);
290 m_loc2loc2[recStep] = (transportJacobian)(1,1);
291 m_loc2phi[recStep] = (transportJacobian)(1,2);
292 m_loc2theta[recStep] = (transportJacobian)(1,3);
293 m_loc2qop[recStep] = (transportJacobian)(1,4);
294 m_loc2steps[recStep] = 0.;
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);
301 m_phisteps[recStep] = 0.;
303 m_thetaloc1[recStep] = (transportJacobian)(3,0);
304 m_thetaloc2[recStep] = (transportJacobian)(3,1);
305 m_thetaphi[recStep] = (transportJacobian)(3,2);
306 m_thetatheta[recStep] = (transportJacobian)(3,3);
307 m_thetaqop[recStep] = (transportJacobian)(3,4);
308 m_thetasteps[recStep] = 0.;
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);
315 m_qopsteps[recStep] = 0.;
321 for (
unsigned int istep = 0; istep < m_localVariations.size(); ++istep){
342 auto endLoc1Minus = m_propagator->propagateParameters(ctx,
347 *m_magFieldProperties);
350 auto endLoc1Plus = m_propagator->propagateParameters(ctx,
355 *m_magFieldProperties);
357 auto endLoc2Minus = m_propagator->propagateParameters(ctx,
362 *m_magFieldProperties);
364 auto endLoc2Plus = m_propagator->propagateParameters(ctx,
369 *m_magFieldProperties);
371 auto endPhiMinus = m_propagator->propagateParameters(ctx,
376 *m_magFieldProperties);
378 auto endPhiPlus = m_propagator->propagateParameters(ctx,
383 *m_magFieldProperties);
385 auto endThetaMinus = m_propagator->propagateParameters(ctx,
390 *m_magFieldProperties);
392 auto endThetaPlus = m_propagator->propagateParameters(ctx,
397 *m_magFieldProperties);
399 auto endQopMinus = m_propagator->propagateParameters(ctx,
404 *m_magFieldProperties);
406 auto endQopPlus = m_propagator->propagateParameters(ctx,
411 *m_magFieldProperties);
424 const Amg::VectorX& endLoc1MinusPar = endLoc1Minus->parameters();
425 const Amg::VectorX& endLoc1PlusPar = endLoc1Plus->parameters();
427 const Amg::VectorX& endLoc2MinusPar = endLoc2Minus->parameters();
428 const Amg::VectorX& endLoc2PlusPar = endLoc2Plus->parameters();
430 const Amg::VectorX& endPhiMinusPar = endPhiMinus->parameters();
431 const Amg::VectorX& endPhiPlusPar = endPhiPlus->parameters();
433 const Amg::VectorX& endThetaMinusPar = endThetaMinus->parameters();
434 const Amg::VectorX& endThetaPlusPar = endThetaPlus->parameters();
436 const Amg::VectorX& endQopMinusPar = endQopMinus->parameters();
437 const Amg::VectorX& endQopPlusPar = endQopPlus->parameters();
440 Amg::VectorX endLoc1Diff(endLoc1PlusPar-endLoc1MinusPar);
441 Amg::VectorX endLoc2Diff(endLoc2PlusPar-endLoc2MinusPar);
443 Amg::VectorX endThetaDiff(endThetaPlusPar-endThetaMinusPar);
446 currentStepJacobian(0,0) = endLoc1Diff[0]/(2.*m_localVariations[istep]);
447 currentStepJacobian(0,1) = endLoc2Diff[0]/(2.*m_localVariations[istep]);
448 currentStepJacobian(0,2) = endPhiDiff[0]/(2.*m_angularVariations[istep]);
449 currentStepJacobian(0,3) = endThetaDiff[0]/(2.*m_angularVariations[istep]);
450 currentStepJacobian(0,4) = endQopDiff[0]/(2.*m_qOpVariations[istep]);
452 m_loc1loc1[recStep] = currentStepJacobian(0,0);
453 m_loc1loc2[recStep] = currentStepJacobian(0,1);
454 m_loc1phi[recStep] = currentStepJacobian(0,2);
455 m_loc1theta[recStep] = currentStepJacobian(0,3);
456 m_loc1qop[recStep] = currentStepJacobian(0,4);
457 m_loc1steps[recStep] = m_localVariations[istep];
459 currentStepJacobian(1,0) = endLoc1Diff[1]/(2.*m_localVariations[istep]);
460 currentStepJacobian(1,1) = endLoc2Diff[1]/(2.*m_localVariations[istep]);
461 currentStepJacobian(1,2) = endPhiDiff[1]/(2.*m_angularVariations[istep]);
462 currentStepJacobian(1,3) = endThetaDiff[1]/(2.*m_angularVariations[istep]);
463 currentStepJacobian(1,4) = endQopDiff[1]/(2.*m_qOpVariations[istep]);
465 m_loc2loc1[recStep] = currentStepJacobian(1,0);
466 m_loc2loc2[recStep] = currentStepJacobian(1,1);
467 m_loc2phi[recStep] = currentStepJacobian(1,2);
468 m_loc2theta[recStep] = currentStepJacobian(1,3);
469 m_loc2qop[recStep] = currentStepJacobian(1,4);
470 m_loc2steps[recStep] = m_localVariations[istep];
472 currentStepJacobian(2,0) = endLoc1Diff[2]/(2.*m_localVariations[istep]);
473 currentStepJacobian(2,1) = endLoc2Diff[2]/(2.*m_localVariations[istep]);
474 currentStepJacobian(2,2) = endPhiDiff[2]/(2.*m_angularVariations[istep]);
475 currentStepJacobian(2,3) = endThetaDiff[2]/(2.*m_angularVariations[istep]);
476 currentStepJacobian(2,4) = endQopDiff[2]/(2.*m_qOpVariations[istep]);
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);
483 m_phisteps[recStep] = m_angularVariations[istep];
485 currentStepJacobian(3,0) = endLoc1Diff[3]/(2.*m_localVariations[istep]);
486 currentStepJacobian(3,1) = endLoc2Diff[3]/(2.*m_localVariations[istep]);
487 currentStepJacobian(3,2) = endPhiDiff[3]/(2.*m_angularVariations[istep]);
488 currentStepJacobian(3,3) = endThetaDiff[3]/(2.*m_angularVariations[istep]);
489 currentStepJacobian(3,4) = endQopDiff[3]/(2.*m_qOpVariations[istep]);
491 m_thetaloc1[recStep] = currentStepJacobian(3,0);
492 m_thetaloc2[recStep] = currentStepJacobian(3,1);
493 m_thetaphi[recStep] = currentStepJacobian(3,2);
494 m_thetatheta[recStep] = currentStepJacobian(3,3);
495 m_thetaqop[recStep] = currentStepJacobian(3,4);
496 m_thetasteps[recStep] = m_angularVariations[istep];
498 currentStepJacobian(4,0) = endLoc1Diff[4]/(2.*m_localVariations[istep]);
499 currentStepJacobian(4,1) = endLoc2Diff[4]/(2.*m_localVariations[istep]);
500 currentStepJacobian(4,2) = endPhiDiff[4]/(2.*m_angularVariations[istep]);
501 currentStepJacobian(4,3) = endThetaDiff[4]/(2.*m_angularVariations[istep]);
502 currentStepJacobian(4,4) = endQopDiff[4]/(2.*m_qOpVariations[istep]);
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);
509 m_qopsteps[recStep] = m_qOpVariations[istep];
511 ATH_MSG_DEBUG(
"Current TransportJacobian : " << currentStepJacobian );
521 m_loc1loc1[recStep] = parabolicInterpolation(m_loc1loc1[recStep-1],m_loc1loc1[recStep-2],m_loc1loc1[recStep-3],
522 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
523 m_loc1loc2[recStep] = parabolicInterpolation(m_loc1loc2[recStep-1],m_loc1loc2[recStep-2],m_loc1loc2[recStep-3],
524 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
525 m_loc1phi[recStep] = parabolicInterpolation(m_loc1phi[recStep-1],m_loc1phi[recStep-2],m_loc1phi[recStep-3],
526 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
527 m_loc1theta[recStep] = parabolicInterpolation(m_loc1theta[recStep-1],m_loc1theta[recStep-2],m_loc1theta[recStep-3],
528 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
529 m_loc1qop[recStep] = parabolicInterpolation(m_loc1qop[recStep-1],m_loc1qop[recStep-2],m_loc1qop[recStep-3],
530 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
531 m_loc1steps[recStep] = 1;
533 m_loc2loc1[recStep] = parabolicInterpolation(m_loc2loc1[recStep-1],m_loc2loc1[recStep-2],m_loc2loc1[recStep-3],
534 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
535 m_loc2loc2[recStep] = parabolicInterpolation(m_loc2loc2[recStep-1],m_loc2loc2[recStep-2],m_loc2loc2[recStep-3],
536 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
537 m_loc2phi[recStep] = parabolicInterpolation(m_loc2phi[recStep-1],m_loc2phi[recStep-2],m_loc2phi[recStep-3],
538 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
539 m_loc2theta[recStep] = parabolicInterpolation(m_loc2theta[recStep-1],m_loc2theta[recStep-2],m_loc2theta[recStep-3],
540 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
541 m_loc2qop[recStep] = parabolicInterpolation(m_loc2qop[recStep-1],m_loc2qop[recStep-2],m_loc2qop[recStep-3],
542 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
543 m_loc2steps[recStep] = 1;
545 m_philoc1[recStep] = parabolicInterpolation(m_philoc1[recStep-1],m_philoc1[recStep-2],m_philoc1[recStep-3],
546 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
547 m_philoc2[recStep] = parabolicInterpolation(m_philoc2[recStep-1],m_philoc2[recStep-2],m_philoc2[recStep-3],
548 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
549 m_phiphi[recStep] = parabolicInterpolation(m_phiphi[recStep-1],m_phiphi[recStep-2],m_phiphi[recStep-3],
550 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
551 m_phitheta[recStep] = parabolicInterpolation(m_phitheta[recStep-1],m_phitheta[recStep-2],m_phitheta[recStep-3],
552 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
553 m_phiqop[recStep] = parabolicInterpolation(m_phiqop[recStep-1],m_phiqop[recStep-2],m_phiqop[recStep-3],
554 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
555 m_phisteps[recStep] = 1;
557 m_thetaloc1[recStep] = parabolicInterpolation(m_thetaloc1[recStep-1],m_thetaloc1[recStep-2],m_thetaloc1[recStep-3],
558 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
559 m_thetaloc2[recStep] = parabolicInterpolation(m_thetaloc2[recStep-1],m_thetaloc2[recStep-2],m_thetaloc2[recStep-3],
560 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
561 m_thetaphi[recStep] = parabolicInterpolation(m_thetaphi[recStep-1],m_thetaphi[recStep-2],m_thetaphi[recStep-3],
562 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
563 m_thetatheta[recStep] = parabolicInterpolation(m_thetatheta[recStep-1],m_thetatheta[recStep-2],m_thetatheta[recStep-3],
564 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
565 m_thetaqop[recStep] = parabolicInterpolation(m_thetaqop[recStep-1],m_thetaqop[recStep-2],m_thetaqop[recStep-3],
566 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
567 m_thetasteps[recStep] = 1;
569 m_qoploc1[recStep] = parabolicInterpolation(m_qoploc1[recStep-1],m_qoploc1[recStep-2],m_qoploc1[recStep-3],
570 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
571 m_qoploc2[recStep] = parabolicInterpolation(m_qoploc2[recStep-1],m_qoploc2[recStep-2],m_qoploc2[recStep-3],
572 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
573 m_qopphi[recStep] = parabolicInterpolation(m_qopphi[recStep-1],m_qopphi[recStep-2],m_qopphi[recStep-3],
574 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
575 m_qoptheta[recStep] = parabolicInterpolation(m_qoptheta[recStep-1],m_qoptheta[recStep-2],m_qoptheta[recStep-3],
576 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
577 m_qopqop[recStep] = parabolicInterpolation(m_qopqop[recStep-1],m_qopqop[recStep-2],m_qopqop[recStep-3],
578 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
579 m_qopsteps[recStep] = 1;
581 currentStepJacobian(0,0)= m_loc1loc1[recStep];
582 currentStepJacobian(0,1)= m_loc1loc2[recStep];
583 currentStepJacobian(0,2)= m_loc1phi[recStep];
584 currentStepJacobian(0,3)= m_loc1theta[recStep];
585 currentStepJacobian(0,4)= m_loc1qop[recStep];
587 currentStepJacobian(1,0)= m_loc2loc1[recStep];
588 currentStepJacobian(1,1)= m_loc2loc2[recStep];
589 currentStepJacobian(1,2)= m_loc2phi[recStep];
590 currentStepJacobian(1,3)= m_loc2theta[recStep];
591 currentStepJacobian(1,4)= m_loc2qop[recStep];
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];
599 currentStepJacobian(3,0)= m_thetaloc1[recStep];
600 currentStepJacobian(3,1)= m_thetaloc2[recStep];
601 currentStepJacobian(3,2)= m_thetaphi[recStep];
602 currentStepJacobian(3,3)= m_thetatheta[recStep];
603 currentStepJacobian(3,4)= m_thetaqop[recStep];
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];
613 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian );
620 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix );
625 m_loc1loc1[recStep] = diffMatrix(0,0);
626 m_loc1loc2[recStep] = diffMatrix(0,1);
627 m_loc1phi[recStep] = diffMatrix(0,2);
628 m_loc1theta[recStep] = diffMatrix(0,3);
629 m_loc1qop[recStep] = diffMatrix(0,4);
630 m_loc1steps[recStep] = 2;
632 m_loc2loc1[recStep] = diffMatrix(1,0);
633 m_loc2loc2[recStep] = diffMatrix(1,1);
634 m_loc2phi[recStep] = diffMatrix(1,2);
635 m_loc2theta[recStep] = diffMatrix(1,3);
636 m_loc2qop[recStep] = diffMatrix(1,4);
637 m_loc2steps[recStep] = 2;
639 m_philoc1[recStep] = diffMatrix(2,0);
640 m_philoc2[recStep] = diffMatrix(2,1);
641 m_phiphi[recStep] = diffMatrix(2,2);
642 m_phitheta[recStep] = diffMatrix(2,3);
643 m_phiqop[recStep] = diffMatrix(2,4);
644 m_phisteps[recStep] = 2;
646 m_thetaloc1[recStep] = diffMatrix(3,0);
647 m_thetaloc2[recStep] = diffMatrix(3,1);
648 m_thetaphi[recStep] = diffMatrix(3,2);
649 m_thetatheta[recStep] = diffMatrix(3,3);
650 m_thetaqop[recStep] = diffMatrix(3,4);
651 m_thetasteps[recStep] = 2;
653 m_qoploc1[recStep] = diffMatrix(4,0);
654 m_qoploc2[recStep] = diffMatrix(4,1);
655 m_qopphi[recStep] = diffMatrix(4,2);
656 m_qoptheta[recStep] = diffMatrix(4,3);
657 m_qopqop[recStep] = diffMatrix(4,4);
658 m_qopsteps[recStep] = 2;
664 m_loc1loc1[recStep] = std::abs(m_loc1loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc1[recStep-1] )) : 0.;
665 m_loc1loc2[recStep] = std::abs(m_loc1loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc2[recStep-1] )) : 0.;
666 m_loc1phi[recStep] = std::abs(m_loc1phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1phi[recStep-1] )) : 0.;
667 m_loc1theta[recStep] = std::abs(m_loc1theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1theta[recStep-1])) : 0.;
668 m_loc1qop[recStep] = std::abs(m_loc1qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1qop[recStep-1] )) : 0.;
669 m_loc1steps[recStep] = 3;
671 m_loc2loc1[recStep] = std::abs(m_loc2loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc1[recStep-1] )) : 0.;
672 m_loc2loc2[recStep] = std::abs(m_loc2loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc2[recStep-1] )) : 0.;
673 m_loc2phi[recStep] = std::abs(m_loc2phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2phi[recStep-1] )) : 0.;
674 m_loc2theta[recStep] = std::abs(m_loc2theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2theta[recStep-1])) : 0.;
675 m_loc2qop[recStep] = std::abs(m_loc2qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2qop[recStep-1] )) : 0.;
676 m_loc2steps[recStep] = 3;
678 m_philoc1[recStep] = std::abs(m_philoc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc1[recStep-1] )) : 0.;
679 m_philoc2[recStep] = std::abs(m_philoc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc2[recStep-1] )) : 0.;
680 m_phiphi[recStep] = std::abs(m_phiphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiphi[recStep-1] )) : 0.;
681 m_phitheta[recStep] = std::abs(m_phitheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phitheta[recStep-1])) : 0.;
682 m_phiqop[recStep] = std::abs(m_phiqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiqop[recStep-1] )) : 0.;
683 m_phisteps[recStep] = 3;
685 m_thetaloc1[recStep] = std::abs(m_thetaloc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc1[recStep-1] )) : 0.;
686 m_thetaloc2[recStep] = std::abs(m_thetaloc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc2[recStep-1] )) : 0.;
687 m_thetaphi[recStep] = std::abs(m_thetaphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaphi[recStep-1] )) : 0.;
688 m_thetatheta[recStep] = std::abs(m_thetatheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetatheta[recStep-1])) : 0.;
689 m_thetaqop[recStep] = std::abs(m_thetaqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaqop[recStep-1] )) : 0.;
690 m_thetasteps[recStep] = 3;
692 m_qoploc1[recStep] = std::abs(m_qoploc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qoploc1[recStep-1] )) : 0.;
693 m_qoploc2[recStep] = std::abs(m_qoploc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qoploc2[recStep-1] )) : 0.;
694 m_qopphi[recStep] = std::abs(m_qopphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qopphi[recStep-1] )) : 0.;
695 m_qoptheta[recStep] = std::abs(m_qoptheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qoptheta[recStep-1])) : 0.;
696 m_qopqop[recStep] = std::abs(m_qopqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qopqop[recStep-1] )) : 0.;
697 m_qopsteps[recStep] = 3;
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.;
710 m_loc1steps[recStep] = 4;
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.;
717 m_loc2steps[recStep] = 4;
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.;
724 m_phisteps[recStep] = 4;
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.;
731 m_thetasteps[recStep] = 4;
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.;
738 m_qopsteps[recStep] = 4;
743 m_loc1loc1[recStep] = std::abs(m_loc1loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc1[recStep-1] )) : 0.;
744 m_loc1loc2[recStep] = std::abs(m_loc1loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc2[recStep-1] )) : 0.;
745 m_loc1phi[recStep] = std::abs(m_loc1phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1phi[recStep-1] )) : 0.;
746 m_loc1theta[recStep] = std::abs(m_loc1theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1theta[recStep-1])) : 0.;
747 m_loc1qop[recStep] = std::abs(m_loc1qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1qop[recStep-1] )) : 0.;
748 m_loc1steps[recStep] = 5;
750 m_loc2loc1[recStep] = std::abs(m_loc2loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc1[recStep-1] )) : 0.;
751 m_loc2loc2[recStep] = std::abs(m_loc2loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc2[recStep-1] )) : 0.;
752 m_loc2phi[recStep] = std::abs(m_loc2phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2phi[recStep-1] )) : 0.;
753 m_loc2theta[recStep] = std::abs(m_loc2theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2theta[recStep-1])) : 0.;
754 m_loc2qop[recStep] = std::abs(m_loc2qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2qop[recStep-1] )) : 0.;
755 m_loc2steps[recStep] = 5;
757 m_philoc1[recStep] = std::abs(m_philoc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc1[recStep-1] )) : 0.;
758 m_philoc2[recStep] = std::abs(m_philoc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc2[recStep-1] )) : 0.;
759 m_phiphi[recStep] = std::abs(m_phiphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiphi[recStep-1] )) : 0.;
760 m_phitheta[recStep] = std::abs(m_phitheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phitheta[recStep-1])) : 0.;
761 m_phiqop[recStep] = std::abs(m_phiqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiqop[recStep-1] )) : 0.;
762 m_phisteps[recStep] = 5;
764 m_thetaloc1[recStep] = std::abs(m_thetaloc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc1[recStep-1] )) : 0.;
765 m_thetaloc2[recStep] = std::abs(m_thetaloc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc2[recStep-1] )) : 0.;
766 m_thetaphi[recStep] = std::abs(m_thetaphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaphi[recStep-1] )) : 0.;
767 m_thetatheta[recStep] = std::abs(m_thetatheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetatheta[recStep-1])) : 0.;
768 m_thetaqop[recStep] = std::abs(m_thetaqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaqop[recStep-1] )) : 0.;
769 m_thetasteps[recStep] = 5;
771 m_qoploc1[recStep] = std::abs(m_qoploc1[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qoploc1[recStep-1] ) ): 0.;
772 m_qoploc2[recStep] = std::abs(m_qoploc2[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qoploc2[recStep-1] ) ): 0.;
773 m_qopphi[recStep] = std::abs(m_qopphi[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qopphi[recStep-1] ) ): 0.;
774 m_qoptheta[recStep] = std::abs(m_qoptheta[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qoptheta[recStep-1]) ): 0.;
775 m_qopqop[recStep] = std::abs(m_qopqop[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qopqop[recStep-1] ) ): 0.;
776 m_qopsteps[recStep] = 5;
780 m_validationTree->Fill();
784 return StatusCode::SUCCESS;
804 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
807 surfaceRotation.col(0) = surfaceXdirection;
808 surfaceRotation.col(1) = surfaceYdirection;
809 surfaceRotation.col(2) = surfaceZdirection;
819 double x0,
double x1,
double x2)
822 double Z1 = x0*
x2*
y1;
823 double Z2 = x0*
x1*
y2;
824 double N0 = (x0-
x1)*(x0-
x2);
827 return Z0/N0 + Z1/
N1 + Z2/
N2;