24 #include "GaudiKernel/ITHistSvc.h"
25 #include "GaudiKernel/SystemOfUnits.h"
33 m_propagator(
"Trk::RungeKuttaPropagator/RungeKuttaPropagator"),
34 m_useCustomField(true),
35 m_useAlignedSurfaces(true),
37 m_magFieldProperties(nullptr),
49 m_angularVariations(),
51 m_validationTree(nullptr),
52 m_validationTreeName(
"RiddersTree"),
53 m_validationTreeDescription(
"Output of the RiddersAlgorithm"),
54 m_validationTreeFolder(
"/val/RiddersAlgorithm"),
96 declareProperty(
"Propagator" , m_propagator);
97 declareProperty(
"CustomFieldValue" , m_fieldValue);
98 declareProperty(
"UseCustomMagneticField" , m_useCustomField);
99 declareProperty(
"UseAlignedSurfaces" , m_useAlignedSurfaces);
102 declareProperty(
"ValidationTreeName", m_validationTreeName);
103 declareProperty(
"ValidationTreeDescription", m_validationTreeDescription);
104 declareProperty(
"ValidationTreeFolder", m_validationTreeFolder);
106 declareProperty(
"StartPerigeeSigmaLoc" , m_sigmaLoc);
107 declareProperty(
"StartPerigeeMinPhi" , m_minPhi);
108 declareProperty(
"StartPerigeeMaxPhi" , m_maxPhi);
109 declareProperty(
"StartPerigeeMinEta" , m_minEta);
110 declareProperty(
"StartPerigeeMaxEta" , m_maxEta);
111 declareProperty(
"StartPerigeeMinP" , m_minP);
112 declareProperty(
"StartPerigeeMaxP" , m_maxP);
114 declareProperty(
"TargetSurfaceMinR" , m_minimumR);
115 declareProperty(
"TargetSurfaceMaxR" , m_maximumR);
117 declareProperty(
"LocalVariations" , m_localVariations);
118 declareProperty(
"AngularVariations" , m_angularVariations);
119 declareProperty(
"QopVariations" , m_qOpVariations);
131 delete m_magFieldProperties;
143 if (m_propagator.retrieve().isFailure()) {
144 ATH_MSG_FATAL(
"Could not retrieve Tool " << m_propagator <<
". Exiting." );
145 return StatusCode::FAILURE;
149 if (!m_useCustomField)
159 m_gaussDist =
new Rndm::Numbers(randSvc(), Rndm::Gauss(0.,1.));
160 m_flatDist =
new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
164 m_validationTree =
new TTree(m_validationTreeName.c_str(), m_validationTreeDescription.c_str());
167 m_validationTree->Branch(
"RiddersSteps", &m_steps,
"steps/I");
169 m_validationTree->Branch(
"Loc1Loc1", m_loc1loc1,
"loc1loc1[steps]/F");
170 m_validationTree->Branch(
"Loc1Loc2", m_loc1loc2,
"loc1loc2[steps]/F");
171 m_validationTree->Branch(
"Loc1Phi", m_loc1phi,
"loc1phi[steps]/F");
172 m_validationTree->Branch(
"Loc1Theta", m_loc1theta,
"loc1theta[steps]/F");
173 m_validationTree->Branch(
"Loc1qOp", m_loc1qop,
"loc1qop[steps]/F");
174 m_validationTree->Branch(
"Loc1Steps", m_loc1steps,
"loc1steps[steps]/F");
176 m_validationTree->Branch(
"Loc2Loc1", m_loc2loc1,
"loc2loc1[steps]/F");
177 m_validationTree->Branch(
"Loc2Loc2", m_loc2loc2,
"loc2loc2[steps]/F");
178 m_validationTree->Branch(
"Loc2Phi", m_loc2phi,
"loc2phi[steps]/F");
179 m_validationTree->Branch(
"Loc2Theta", m_loc2theta,
"loc2theta[steps]/F");
180 m_validationTree->Branch(
"Loc2qOp", m_loc2qop,
"loc2qop[steps]/F");
181 m_validationTree->Branch(
"Loc2Steps", m_loc2steps,
"loc2steps[steps]/F");
183 m_validationTree->Branch(
"PhiLoc1", m_philoc1,
"philoc1[steps]/F");
184 m_validationTree->Branch(
"PhiLoc2", m_philoc2 ,
"philoc2[steps]/F");
185 m_validationTree->Branch(
"PhiPhi", m_phiphi,
"phiphi[steps]/F");
186 m_validationTree->Branch(
"PhiTheta", m_phitheta,
"phitheta[steps]/F");
187 m_validationTree->Branch(
"PhiqOp", m_phiqop,
"phiqop[steps]/F");
188 m_validationTree->Branch(
"PhiSteps", m_phisteps,
"phisteps[steps]/F");
190 m_validationTree->Branch(
"ThetaLoc1", m_thetaloc1,
"thetaloc1[steps]/F");
191 m_validationTree->Branch(
"ThetaLoc2", m_thetaloc2,
"thetaloc2[steps]/F");
192 m_validationTree->Branch(
"ThetaPhi", m_thetaphi,
"thetaphi[steps]/F");
193 m_validationTree->Branch(
"ThetaTheta", m_thetatheta,
"thetatheta[steps]/F");
194 m_validationTree->Branch(
"ThetaqOp", m_thetaqop,
"thetaqop[steps]/F");
195 m_validationTree->Branch(
"ThetaSteps", m_thetasteps,
"thetasteps[steps]/F");
197 m_validationTree->Branch(
"QopLoc1", m_qoploc1,
"qoploc1[steps]/F");
198 m_validationTree->Branch(
"QopLoc2", m_qoploc2,
"qoploc2[steps]/F");
199 m_validationTree->Branch(
"QopPhi", m_qopphi,
"qopphi[steps]/F");
200 m_validationTree->Branch(
"QopTheta", m_qoptheta,
"qoptheta[steps]/F");
201 m_validationTree->Branch(
"QopqOp", m_qopqop,
"qopqop[steps]/F");
202 m_validationTree->Branch(
"QopSteps", m_qopsteps,
"qopsteps[steps]/F");
205 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
207 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
208 delete m_validationTree; m_validationTree =
nullptr;
210 if ((tHistSvc->regTree(m_validationTreeFolder, m_validationTree)).isFailure()) {
211 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
212 delete m_validationTree; m_validationTree =
nullptr;
215 if (m_localVariations.empty()){
216 m_localVariations.push_back(0.01);
217 m_localVariations.push_back(0.001);
218 m_localVariations.push_back(0.0001);
221 if (m_angularVariations.empty()){
222 m_angularVariations.push_back(0.01);
223 m_angularVariations.push_back(0.001);
224 m_angularVariations.push_back(0.0001);
227 if (m_qOpVariations.empty()){
228 m_qOpVariations.push_back(0.0001);
229 m_qOpVariations.push_back(0.00001);
230 m_qOpVariations.push_back(0.000001);
234 return StatusCode::SUCCESS;
242 return StatusCode::SUCCESS;
249 const EventContext& ctx = Gaudi::Hive::currentContext();
251 double p = m_minP + m_flatDist->shoot()*(m_maxP-m_minP);
252 double charge = (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
259 double loc1 = m_sigmaLoc * m_gaussDist->shoot();
260 double loc2 = m_sigmaLoc * m_gaussDist->shoot();
262 double phi = m_minPhi + m_maxPhi * m_flatDist->shoot();
263 double eta = m_minEta + m_flatDist->shoot()*(m_maxEta-m_minEta);
267 double startR = std::abs(m_sigmaR * m_gaussDist->shoot());
268 double surfacePhi =
M_PI * m_flatDist->shoot();
269 surfacePhi *= (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
270 double startX = startR*
cos(surfacePhi);
271 double startY = startR*
sin(surfacePhi);
272 double startZ = m_sigmaLoc * m_gaussDist->shoot();
275 double alphaZ =
M_PI * m_flatDist->shoot();
276 alphaZ *= (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
303 double estimationR = m_minimumR + (m_maximumR-m_minimumR) * m_flatDist->shoot();
309 ATH_MSG_VERBOSE(
"Cylinder to be intersected : " << estimationCylinder );
311 auto estimationParameters = m_propagator->propagateParameters(ctx,
316 *m_magFieldProperties);
317 if (!estimationParameters) {
318 ATH_MSG_VERBOSE(
"Estimation of intersection did not work - skip event !" );
319 return StatusCode::SUCCESS;
324 const Amg::Vector3D& estimatedPosition = estimationParameters->position();
326 double estimationX = estimatedPosition.x();
327 double estimationY = estimatedPosition.y();
328 double estimationZ = estimatedPosition.z();
330 double estimationPhi = estimatedPosition.phi();
331 double estimationTheta = estimatedPosition.theta();
335 double rotateTrans =
M_PI * m_flatDist->shoot();
336 rotateTrans *= (m_flatDist->shoot() > 0.5 ) ? -1. : 1.;
340 if (m_useAlignedSurfaces){
342 Amg::Vector3D radialVector(estimatedPosition.x(), estimatedPosition.y(), 0.);
346 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
349 surfaceRotation.col(0) = surfaceXdirection;
350 surfaceRotation.col(1) = surfaceYdirection;
351 surfaceRotation.col(2) = surfaceZdirection;
355 surfaceTransform = createTransform(estimationX,
368 std::optional<Trk::TransportJacobian> optTransportJacobian{};
369 AmgMatrix(5,5) testMatrix; testMatrix.setZero();
371 double pathLimit = -1.;
373 auto trackParameters = m_propagator->propagate(ctx,
378 *m_magFieldProperties,
379 optTransportJacobian,
383 if (trackParameters && optTransportJacobian){
385 unsigned int recStep = 0;
386 const auto& transportJacobian = (*optTransportJacobian);
392 m_loc1loc1[recStep] = (transportJacobian)(0,0);
393 m_loc1loc2[recStep] = (transportJacobian)(0,1);
394 m_loc1phi[recStep] = (transportJacobian)(0,2);
395 m_loc1theta[recStep] = (transportJacobian)(0,3);
396 m_loc1qop[recStep] = (transportJacobian)(0,4);
397 m_loc1steps[recStep] = 0.;
399 m_loc2loc1[recStep] = (transportJacobian)(1,0);
400 m_loc2loc2[recStep] = (transportJacobian)(1,1);
401 m_loc2phi[recStep] = (transportJacobian)(1,2);
402 m_loc2theta[recStep] = (transportJacobian)(1,3);
403 m_loc2qop[recStep] = (transportJacobian)(1,4);
404 m_loc2steps[recStep] = 0.;
406 m_philoc1[recStep] = (transportJacobian)(2,0);
407 m_philoc2[recStep] = (transportJacobian)(2,1);
408 m_phiphi[recStep] = (transportJacobian)(2,2);
409 m_phitheta[recStep] = (transportJacobian)(2,3);
410 m_phiqop[recStep] = (transportJacobian)(2,4);
411 m_phisteps[recStep] = 0.;
413 m_thetaloc1[recStep] = (transportJacobian)(3,0);
414 m_thetaloc2[recStep] = (transportJacobian)(3,1);
415 m_thetaphi[recStep] = (transportJacobian)(3,2);
416 m_thetatheta[recStep] = (transportJacobian)(3,3);
417 m_thetaqop[recStep] = (transportJacobian)(3,4);
418 m_thetasteps[recStep] = 0.;
420 m_qoploc1[recStep] = (transportJacobian)(4,0);
421 m_qoploc2[recStep] = (transportJacobian)(4,1);
422 m_qopphi[recStep] = (transportJacobian)(4,2);
423 m_qoptheta[recStep] = (transportJacobian)(4,3);
424 m_qopqop[recStep] = (transportJacobian)(4,4);
425 m_qopsteps[recStep] = 0.;
431 for (
unsigned int istep = 0; istep < m_localVariations.size(); ++istep){
452 auto endLoc1Minus = m_propagator->propagateParameters(ctx,
457 *m_magFieldProperties);
460 auto endLoc1Plus = m_propagator->propagateParameters(ctx,
465 *m_magFieldProperties);
467 auto endLoc2Minus = m_propagator->propagateParameters(ctx,
472 *m_magFieldProperties);
474 auto endLoc2Plus = m_propagator->propagateParameters(ctx,
479 *m_magFieldProperties);
481 auto endPhiMinus = m_propagator->propagateParameters(ctx,
486 *m_magFieldProperties);
488 auto endPhiPlus = m_propagator->propagateParameters(ctx,
493 *m_magFieldProperties);
495 auto endThetaMinus = m_propagator->propagateParameters(ctx,
500 *m_magFieldProperties);
502 auto endThetaPlus = m_propagator->propagateParameters(ctx,
507 *m_magFieldProperties);
509 auto endQopMinus = m_propagator->propagateParameters(ctx,
514 *m_magFieldProperties);
516 auto endQopPlus = m_propagator->propagateParameters(ctx,
521 *m_magFieldProperties);
534 const Amg::VectorX& endLoc1MinusPar = endLoc1Minus->parameters();
535 const Amg::VectorX& endLoc1PlusPar = endLoc1Plus->parameters();
537 const Amg::VectorX& endLoc2MinusPar = endLoc2Minus->parameters();
538 const Amg::VectorX& endLoc2PlusPar = endLoc2Plus->parameters();
540 const Amg::VectorX& endPhiMinusPar = endPhiMinus->parameters();
541 const Amg::VectorX& endPhiPlusPar = endPhiPlus->parameters();
543 const Amg::VectorX& endThetaMinusPar = endThetaMinus->parameters();
544 const Amg::VectorX& endThetaPlusPar = endThetaPlus->parameters();
546 const Amg::VectorX& endQopMinusPar = endQopMinus->parameters();
547 const Amg::VectorX& endQopPlusPar = endQopPlus->parameters();
550 Amg::VectorX endLoc1Diff(endLoc1PlusPar-endLoc1MinusPar);
551 Amg::VectorX endLoc2Diff(endLoc2PlusPar-endLoc2MinusPar);
553 Amg::VectorX endThetaDiff(endThetaPlusPar-endThetaMinusPar);
556 currentStepJacobian(0,0) = endLoc1Diff[0]/(2.*m_localVariations[istep]);
557 currentStepJacobian(0,1) = endLoc2Diff[0]/(2.*m_localVariations[istep]);
558 currentStepJacobian(0,2) = endPhiDiff[0]/(2.*m_angularVariations[istep]);
559 currentStepJacobian(0,3) = endThetaDiff[0]/(2.*m_angularVariations[istep]);
560 currentStepJacobian(0,4) = endQopDiff[0]/(2.*m_qOpVariations[istep]);
562 m_loc1loc1[recStep] = currentStepJacobian(0,0);
563 m_loc1loc2[recStep] = currentStepJacobian(0,1);
564 m_loc1phi[recStep] = currentStepJacobian(0,2);
565 m_loc1theta[recStep] = currentStepJacobian(0,3);
566 m_loc1qop[recStep] = currentStepJacobian(0,4);
567 m_loc1steps[recStep] = m_localVariations[istep];
569 currentStepJacobian(1,0) = endLoc1Diff[1]/(2.*m_localVariations[istep]);
570 currentStepJacobian(1,1) = endLoc2Diff[1]/(2.*m_localVariations[istep]);
571 currentStepJacobian(1,2) = endPhiDiff[1]/(2.*m_angularVariations[istep]);
572 currentStepJacobian(1,3) = endThetaDiff[1]/(2.*m_angularVariations[istep]);
573 currentStepJacobian(1,4) = endQopDiff[1]/(2.*m_qOpVariations[istep]);
575 m_loc2loc1[recStep] = currentStepJacobian(1,0);
576 m_loc2loc2[recStep] = currentStepJacobian(1,1);
577 m_loc2phi[recStep] = currentStepJacobian(1,2);
578 m_loc2theta[recStep] = currentStepJacobian(1,3);
579 m_loc2qop[recStep] = currentStepJacobian(1,4);
580 m_loc2steps[recStep] = m_localVariations[istep];
582 currentStepJacobian(2,0) = endLoc1Diff[2]/(2.*m_localVariations[istep]);
583 currentStepJacobian(2,1) = endLoc2Diff[2]/(2.*m_localVariations[istep]);
584 currentStepJacobian(2,2) = endPhiDiff[2]/(2.*m_angularVariations[istep]);
585 currentStepJacobian(2,3) = endThetaDiff[2]/(2.*m_angularVariations[istep]);
586 currentStepJacobian(2,4) = endQopDiff[2]/(2.*m_qOpVariations[istep]);
588 m_philoc1[recStep] = currentStepJacobian(2,0);
589 m_philoc2[recStep] = currentStepJacobian(2,1);
590 m_phiphi[recStep] = currentStepJacobian(2,2);
591 m_phitheta[recStep] = currentStepJacobian(2,3);
592 m_phiqop[recStep] = currentStepJacobian(2,4);
593 m_phisteps[recStep] = m_angularVariations[istep];
595 currentStepJacobian(3,0) = endLoc1Diff[3]/(2.*m_localVariations[istep]);
596 currentStepJacobian(3,1) = endLoc2Diff[3]/(2.*m_localVariations[istep]);
597 currentStepJacobian(3,2) = endPhiDiff[3]/(2.*m_angularVariations[istep]);
598 currentStepJacobian(3,3) = endThetaDiff[3]/(2.*m_angularVariations[istep]);
599 currentStepJacobian(3,4) = endQopDiff[3]/(2.*m_qOpVariations[istep]);
601 m_thetaloc1[recStep] = currentStepJacobian(3,0);
602 m_thetaloc2[recStep] = currentStepJacobian(3,1);
603 m_thetaphi[recStep] = currentStepJacobian(3,2);
604 m_thetatheta[recStep] = currentStepJacobian(3,3);
605 m_thetaqop[recStep] = currentStepJacobian(3,4);
606 m_thetasteps[recStep] = m_angularVariations[istep];
608 currentStepJacobian(4,0) = endLoc1Diff[4]/(2.*m_localVariations[istep]);
609 currentStepJacobian(4,1) = endLoc2Diff[4]/(2.*m_localVariations[istep]);
610 currentStepJacobian(4,2) = endPhiDiff[4]/(2.*m_angularVariations[istep]);
611 currentStepJacobian(4,3) = endThetaDiff[4]/(2.*m_angularVariations[istep]);
612 currentStepJacobian(4,4) = endQopDiff[4]/(2.*m_qOpVariations[istep]);
614 m_qoploc1[recStep] = currentStepJacobian(4,0);
615 m_qoploc2[recStep] = currentStepJacobian(4,1);
616 m_qopphi[recStep] = currentStepJacobian(4,2);
617 m_qoptheta[recStep] = currentStepJacobian(4,3);
618 m_qopqop[recStep] = currentStepJacobian(4,4);
619 m_qopsteps[recStep] = m_qOpVariations[istep];
621 ATH_MSG_DEBUG(
"Current TransportJacobian : " << currentStepJacobian );
631 m_loc1loc1[recStep] = parabolicInterpolation(m_loc1loc1[recStep-1],m_loc1loc1[recStep-2],m_loc1loc1[recStep-3],
632 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
633 m_loc1loc2[recStep] = parabolicInterpolation(m_loc1loc2[recStep-1],m_loc1loc2[recStep-2],m_loc1loc2[recStep-3],
634 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
635 m_loc1phi[recStep] = parabolicInterpolation(m_loc1phi[recStep-1],m_loc1phi[recStep-2],m_loc1phi[recStep-3],
636 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
637 m_loc1theta[recStep] = parabolicInterpolation(m_loc1theta[recStep-1],m_loc1theta[recStep-2],m_loc1theta[recStep-3],
638 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
639 m_loc1qop[recStep] = parabolicInterpolation(m_loc1qop[recStep-1],m_loc1qop[recStep-2],m_loc1qop[recStep-3],
640 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
641 m_loc1steps[recStep] = 1;
643 m_loc2loc1[recStep] = parabolicInterpolation(m_loc2loc1[recStep-1],m_loc2loc1[recStep-2],m_loc2loc1[recStep-3],
644 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
645 m_loc2loc2[recStep] = parabolicInterpolation(m_loc2loc2[recStep-1],m_loc2loc2[recStep-2],m_loc2loc2[recStep-3],
646 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
647 m_loc2phi[recStep] = parabolicInterpolation(m_loc2phi[recStep-1],m_loc2phi[recStep-2],m_loc2phi[recStep-3],
648 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
649 m_loc2theta[recStep] = parabolicInterpolation(m_loc2theta[recStep-1],m_loc2theta[recStep-2],m_loc2theta[recStep-3],
650 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
651 m_loc2qop[recStep] = parabolicInterpolation(m_loc2qop[recStep-1],m_loc2qop[recStep-2],m_loc2qop[recStep-3],
652 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
653 m_loc2steps[recStep] = 1;
655 m_philoc1[recStep] = parabolicInterpolation(m_philoc1[recStep-1],m_philoc1[recStep-2],m_philoc1[recStep-3],
656 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
657 m_philoc2[recStep] = parabolicInterpolation(m_philoc2[recStep-1],m_philoc2[recStep-2],m_philoc2[recStep-3],
658 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
659 m_phiphi[recStep] = parabolicInterpolation(m_phiphi[recStep-1],m_phiphi[recStep-2],m_phiphi[recStep-3],
660 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
661 m_phitheta[recStep] = parabolicInterpolation(m_phitheta[recStep-1],m_phitheta[recStep-2],m_phitheta[recStep-3],
662 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
663 m_phiqop[recStep] = parabolicInterpolation(m_phiqop[recStep-1],m_phiqop[recStep-2],m_phiqop[recStep-3],
664 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
665 m_phisteps[recStep] = 1;
667 m_thetaloc1[recStep] = parabolicInterpolation(m_thetaloc1[recStep-1],m_thetaloc1[recStep-2],m_thetaloc1[recStep-3],
668 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
669 m_thetaloc2[recStep] = parabolicInterpolation(m_thetaloc2[recStep-1],m_thetaloc2[recStep-2],m_thetaloc2[recStep-3],
670 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
671 m_thetaphi[recStep] = parabolicInterpolation(m_thetaphi[recStep-1],m_thetaphi[recStep-2],m_thetaphi[recStep-3],
672 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
673 m_thetatheta[recStep] = parabolicInterpolation(m_thetatheta[recStep-1],m_thetatheta[recStep-2],m_thetatheta[recStep-3],
674 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
675 m_thetaqop[recStep] = parabolicInterpolation(m_thetaqop[recStep-1],m_thetaqop[recStep-2],m_thetaqop[recStep-3],
676 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
677 m_thetasteps[recStep] = 1;
679 m_qoploc1[recStep] = parabolicInterpolation(m_qoploc1[recStep-1],m_qoploc1[recStep-2],m_qoploc1[recStep-3],
680 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
681 m_qoploc2[recStep] = parabolicInterpolation(m_qoploc2[recStep-1],m_qoploc2[recStep-2],m_qoploc2[recStep-3],
682 m_localVariations[2], m_localVariations[1], m_localVariations[0]);
683 m_qopphi[recStep] = parabolicInterpolation(m_qopphi[recStep-1],m_qopphi[recStep-2],m_qopphi[recStep-3],
684 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
685 m_qoptheta[recStep] = parabolicInterpolation(m_qoptheta[recStep-1],m_qoptheta[recStep-2],m_qoptheta[recStep-3],
686 m_angularVariations[2], m_angularVariations[1], m_angularVariations[0]);
687 m_qopqop[recStep] = parabolicInterpolation(m_qopqop[recStep-1],m_qopqop[recStep-2],m_qopqop[recStep-3],
688 m_qOpVariations[2], m_qOpVariations[1], m_qOpVariations[0]);
689 m_qopsteps[recStep] = 1;
691 currentStepJacobian(0,0)= m_loc1loc1[recStep];
692 currentStepJacobian(0,1)= m_loc1loc2[recStep];
693 currentStepJacobian(0,2)= m_loc1phi[recStep];
694 currentStepJacobian(0,3)= m_loc1theta[recStep];
695 currentStepJacobian(0,4)= m_loc1qop[recStep];
697 currentStepJacobian(1,0)= m_loc2loc1[recStep];
698 currentStepJacobian(1,1)= m_loc2loc2[recStep];
699 currentStepJacobian(1,2)= m_loc2phi[recStep];
700 currentStepJacobian(1,3)= m_loc2theta[recStep];
701 currentStepJacobian(1,4)= m_loc2qop[recStep];
703 currentStepJacobian(2,0)= m_philoc1[recStep];
704 currentStepJacobian(2,1)= m_philoc2[recStep];
705 currentStepJacobian(2,2)= m_phiphi[recStep];
706 currentStepJacobian(2,3)= m_phitheta[recStep];
707 currentStepJacobian(2,4)= m_phiqop[recStep];
709 currentStepJacobian(3,0)= m_thetaloc1[recStep];
710 currentStepJacobian(3,1)= m_thetaloc2[recStep];
711 currentStepJacobian(3,2)= m_thetaphi[recStep];
712 currentStepJacobian(3,3)= m_thetatheta[recStep];
713 currentStepJacobian(3,4)= m_thetaqop[recStep];
715 currentStepJacobian(4,0)= m_qoploc1[recStep];
716 currentStepJacobian(4,1)= m_qoploc2[recStep];
717 currentStepJacobian(4,2)= m_qopphi[recStep];
718 currentStepJacobian(4,3)= m_qoptheta[recStep];
719 currentStepJacobian(4,4)= m_qopqop[recStep];
723 ATH_MSG_DEBUG(
"Interpolated TransportJacobian : " << currentStepJacobian );
730 ATH_MSG_VERBOSE(
"Absolute Differences of the TransportJacobian : " << diffMatrix );
735 m_loc1loc1[recStep] = diffMatrix(0,0);
736 m_loc1loc2[recStep] = diffMatrix(0,1);
737 m_loc1phi[recStep] = diffMatrix(0,2);
738 m_loc1theta[recStep] = diffMatrix(0,3);
739 m_loc1qop[recStep] = diffMatrix(0,4);
740 m_loc1steps[recStep] = 2;
742 m_loc2loc1[recStep] = diffMatrix(1,0);
743 m_loc2loc2[recStep] = diffMatrix(1,1);
744 m_loc2phi[recStep] = diffMatrix(1,2);
745 m_loc2theta[recStep] = diffMatrix(1,3);
746 m_loc2qop[recStep] = diffMatrix(1,4);
747 m_loc2steps[recStep] = 2;
749 m_philoc1[recStep] = diffMatrix(2,0);
750 m_philoc2[recStep] = diffMatrix(2,1);
751 m_phiphi[recStep] = diffMatrix(2,2);
752 m_phitheta[recStep] = diffMatrix(2,3);
753 m_phiqop[recStep] = diffMatrix(2,4);
754 m_phisteps[recStep] = 2;
756 m_thetaloc1[recStep] = diffMatrix(3,0);
757 m_thetaloc2[recStep] = diffMatrix(3,1);
758 m_thetaphi[recStep] = diffMatrix(3,2);
759 m_thetatheta[recStep] = diffMatrix(3,3);
760 m_thetaqop[recStep] = diffMatrix(3,4);
761 m_thetasteps[recStep] = 2;
763 m_qoploc1[recStep] = diffMatrix(4,0);
764 m_qoploc2[recStep] = diffMatrix(4,1);
765 m_qopphi[recStep] = diffMatrix(4,2);
766 m_qoptheta[recStep] = diffMatrix(4,3);
767 m_qopqop[recStep] = diffMatrix(4,4);
768 m_qopsteps[recStep] = 2;
774 m_loc1loc1[recStep] = std::abs(m_loc1loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc1[recStep-1] )) : 0.;
775 m_loc1loc2[recStep] = std::abs(m_loc1loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc2[recStep-1] )) : 0.;
776 m_loc1phi[recStep] = std::abs(m_loc1phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1phi[recStep-1] )) : 0.;
777 m_loc1theta[recStep] = std::abs(m_loc1theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1theta[recStep-1])) : 0.;
778 m_loc1qop[recStep] = std::abs(m_loc1qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1qop[recStep-1] )) : 0.;
779 m_loc1steps[recStep] = 3;
781 m_loc2loc1[recStep] = std::abs(m_loc2loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc1[recStep-1] )) : 0.;
782 m_loc2loc2[recStep] = std::abs(m_loc2loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc2[recStep-1] )) : 0.;
783 m_loc2phi[recStep] = std::abs(m_loc2phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2phi[recStep-1] )) : 0.;
784 m_loc2theta[recStep] = std::abs(m_loc2theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2theta[recStep-1])) : 0.;
785 m_loc2qop[recStep] = std::abs(m_loc2qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2qop[recStep-1] )) : 0.;
786 m_loc2steps[recStep] = 3;
788 m_philoc1[recStep] = std::abs(m_philoc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc1[recStep-1] )) : 0.;
789 m_philoc2[recStep] = std::abs(m_philoc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc2[recStep-1] )) : 0.;
790 m_phiphi[recStep] = std::abs(m_phiphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiphi[recStep-1] )) : 0.;
791 m_phitheta[recStep] = std::abs(m_phitheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phitheta[recStep-1])) : 0.;
792 m_phiqop[recStep] = std::abs(m_phiqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiqop[recStep-1] )) : 0.;
793 m_phisteps[recStep] = 3;
795 m_thetaloc1[recStep] = std::abs(m_thetaloc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc1[recStep-1] )) : 0.;
796 m_thetaloc2[recStep] = std::abs(m_thetaloc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc2[recStep-1] )) : 0.;
797 m_thetaphi[recStep] = std::abs(m_thetaphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaphi[recStep-1] )) : 0.;
798 m_thetatheta[recStep] = std::abs(m_thetatheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetatheta[recStep-1])) : 0.;
799 m_thetaqop[recStep] = std::abs(m_thetaqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaqop[recStep-1] )) : 0.;
800 m_thetasteps[recStep] = 3;
802 m_qoploc1[recStep] = std::abs(m_qoploc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qoploc1[recStep-1] )) : 0.;
803 m_qoploc2[recStep] = std::abs(m_qoploc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qoploc2[recStep-1] )) : 0.;
804 m_qopphi[recStep] = std::abs(m_qopphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qopphi[recStep-1] )) : 0.;
805 m_qoptheta[recStep] = std::abs(m_qoptheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qoptheta[recStep-1])) : 0.;
806 m_qopqop[recStep] = std::abs(m_qopqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_qopqop[recStep-1] )) : 0.;
807 m_qopsteps[recStep] = 3;
815 m_loc1loc1[recStep] = std::abs((transportJacobian)(0,0)) > 1
e-50 ? diffMatrix(0,0)/((transportJacobian)(0,0)) : 0.;
816 m_loc1loc2[recStep] = std::abs((transportJacobian)(0,1)) > 1
e-50 ? diffMatrix(0,1)/((transportJacobian)(0,1)) : 0.;
817 m_loc1phi[recStep] = std::abs((transportJacobian)(0,2)) > 1
e-50 ? diffMatrix(0,2)/((transportJacobian)(0,2)) : 0.;
818 m_loc1theta[recStep] = std::abs((transportJacobian)(0,3)) > 1
e-50 ? diffMatrix(0,3)/((transportJacobian)(0,3)) : 0.;
819 m_loc1qop[recStep] = std::abs((transportJacobian)(0,4)) > 1
e-50 ? diffMatrix(0,4)/((transportJacobian)(0,4)) : 0.;
820 m_loc1steps[recStep] = 4;
822 m_loc2loc1[recStep] = std::abs((transportJacobian)(1,0)) > 1
e-50 ? diffMatrix(1,0)/((transportJacobian)(1,0)) : 0.;
823 m_loc2loc2[recStep] = std::abs((transportJacobian)(1,1)) > 1
e-50 ? diffMatrix(1,1)/((transportJacobian)(1,1)) : 0.;
824 m_loc2phi[recStep] = std::abs((transportJacobian)(1,2)) > 1
e-50 ? diffMatrix(1,2)/((transportJacobian)(1,2)) : 0.;
825 m_loc2theta[recStep] = std::abs((transportJacobian)(1,3)) > 1
e-50 ? diffMatrix(1,3)/((transportJacobian)(1,3)) : 0.;
826 m_loc2qop[recStep] = std::abs((transportJacobian)(1,4)) > 1
e-50 ? diffMatrix(1,4)/((transportJacobian)(1,4)) : 0.;
827 m_loc2steps[recStep] = 4;
829 m_philoc1[recStep] = std::abs((transportJacobian)(2,0)) > 1
e-50 ? diffMatrix(2,0)/((transportJacobian)(2,0)) : 0.;
830 m_philoc2[recStep] = std::abs((transportJacobian)(2,1)) > 1
e-50 ? diffMatrix(2,1)/((transportJacobian)(2,1)) : 0.;
831 m_phiphi[recStep] = std::abs((transportJacobian)(2,2)) > 1
e-50 ? diffMatrix(2,2)/((transportJacobian)(2,2)) : 0.;
832 m_phitheta[recStep] = std::abs((transportJacobian)(2,3)) > 1
e-50 ? diffMatrix(2,3)/((transportJacobian)(2,3)) : 0.;
833 m_phiqop[recStep] = std::abs((transportJacobian)(2,4)) > 1
e-50 ? diffMatrix(2,4)/((transportJacobian)(2,4)) : 0.;
834 m_phisteps[recStep] = 4;
836 m_thetaloc1[recStep] = std::abs((transportJacobian)(3,0)) > 1
e-50 ? diffMatrix(3,0)/((transportJacobian)(3,0)) : 0.;
837 m_thetaloc2[recStep] = std::abs((transportJacobian)(3,1)) > 1
e-50 ? diffMatrix(3,1)/((transportJacobian)(3,1)) : 0.;
838 m_thetaphi[recStep] = std::abs((transportJacobian)(3,2)) > 1
e-50 ? diffMatrix(3,2)/((transportJacobian)(3,2)) : 0.;
839 m_thetatheta[recStep] = std::abs((transportJacobian)(3,3)) > 1
e-50 ? diffMatrix(3,3)/((transportJacobian)(3,3)) : 0.;
840 m_thetaqop[recStep] = std::abs((transportJacobian)(3,4)) > 1
e-50 ? diffMatrix(3,4)/((transportJacobian)(3,4)) : 0.;
841 m_thetasteps[recStep] = 4;
843 m_qoploc1[recStep] = std::abs((transportJacobian)(4,0)) > 1
e-50 ? diffMatrix(4,0)/((transportJacobian)(4,0)) : 0.;
844 m_qoploc2[recStep] = std::abs((transportJacobian)(4,1)) > 1
e-50 ? diffMatrix(4,1)/((transportJacobian)(4,1)) : 0.;
845 m_qopphi[recStep] = std::abs((transportJacobian)(4,2)) > 1
e-50 ? diffMatrix(4,2)/((transportJacobian)(4,2)) : 0.;
846 m_qoptheta[recStep] = std::abs((transportJacobian)(4,3)) > 1
e-50 ? diffMatrix(4,3)/((transportJacobian)(4,3)) : 0.;
847 m_qopqop[recStep] = std::abs((transportJacobian)(4,4)) > 1
e-50 ? diffMatrix(4,4)/((transportJacobian)(4,4)) : 0.;
848 m_qopsteps[recStep] = 4;
853 m_loc1loc1[recStep] = std::abs(m_loc1loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc1[recStep-1] )) : 0.;
854 m_loc1loc2[recStep] = std::abs(m_loc1loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1loc2[recStep-1] )) : 0.;
855 m_loc1phi[recStep] = std::abs(m_loc1phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1phi[recStep-1] )) : 0.;
856 m_loc1theta[recStep] = std::abs(m_loc1theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1theta[recStep-1])) : 0.;
857 m_loc1qop[recStep] = std::abs(m_loc1qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc1qop[recStep-1] )) : 0.;
858 m_loc1steps[recStep] = 5;
860 m_loc2loc1[recStep] = std::abs(m_loc2loc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc1[recStep-1] )) : 0.;
861 m_loc2loc2[recStep] = std::abs(m_loc2loc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2loc2[recStep-1] )) : 0.;
862 m_loc2phi[recStep] = std::abs(m_loc2phi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2phi[recStep-1] )) : 0.;
863 m_loc2theta[recStep] = std::abs(m_loc2theta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2theta[recStep-1])) : 0.;
864 m_loc2qop[recStep] = std::abs(m_loc2qop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_loc2qop[recStep-1] )) : 0.;
865 m_loc2steps[recStep] = 5;
867 m_philoc1[recStep] = std::abs(m_philoc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc1[recStep-1] )) : 0.;
868 m_philoc2[recStep] = std::abs(m_philoc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_philoc2[recStep-1] )) : 0.;
869 m_phiphi[recStep] = std::abs(m_phiphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiphi[recStep-1] )) : 0.;
870 m_phitheta[recStep] = std::abs(m_phitheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phitheta[recStep-1])) : 0.;
871 m_phiqop[recStep] = std::abs(m_phiqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_phiqop[recStep-1] )) : 0.;
872 m_phisteps[recStep] = 5;
874 m_thetaloc1[recStep] = std::abs(m_thetaloc1[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc1[recStep-1] )) : 0.;
875 m_thetaloc2[recStep] = std::abs(m_thetaloc2[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaloc2[recStep-1] )) : 0.;
876 m_thetaphi[recStep] = std::abs(m_thetaphi[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaphi[recStep-1] )) : 0.;
877 m_thetatheta[recStep] = std::abs(m_thetatheta[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetatheta[recStep-1])) : 0.;
878 m_thetaqop[recStep] = std::abs(m_thetaqop[recStep-1] ) > 1
e-50 ? -std::log10(std::abs(m_thetaqop[recStep-1] )) : 0.;
879 m_thetasteps[recStep] = 5;
881 m_qoploc1[recStep] = std::abs(m_qoploc1[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qoploc1[recStep-1] ) ): 0.;
882 m_qoploc2[recStep] = std::abs(m_qoploc2[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qoploc2[recStep-1] ) ): 0.;
883 m_qopphi[recStep] = std::abs(m_qopphi[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qopphi[recStep-1] ) ): 0.;
884 m_qoptheta[recStep] = std::abs(m_qoptheta[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qoptheta[recStep-1]) ): 0.;
885 m_qopqop[recStep] = std::abs(m_qopqop[recStep-1] ) > 1
e-50 ? -std::log10( std::abs(m_qopqop[recStep-1] ) ): 0.;
886 m_qopsteps[recStep] = 5;
890 m_validationTree->Fill();
894 return StatusCode::SUCCESS;
914 Amg::Vector3D surfaceXdirection(surfaceYdirection.cross(surfaceZdirection));
917 surfaceRotation.col(0) = surfaceXdirection;
918 surfaceRotation.col(1) = surfaceYdirection;
919 surfaceRotation.col(2) = surfaceZdirection;
929 double x0,
double x1,
double x2)
932 double Z1 = x0*
x2*
y1;
933 double Z2 = x0*
x1*
y2;
934 double N0 = (x0-
x1)*(x0-
x2);
937 return Z0/N0 + Z1/
N1 + Z2/
N2;