84 declareInterface<ITrackValidationNtupleTool>(
this);
86 declareProperty(
"UseROTwithMaxAssgnProb",
m_useROTwithMaxAssgnProb =
true,
"In case of CompetingRIOsOnTrack: Use the ROT with maximum assignment probabilty to calculate residuals, etc or use mean measurement?");
87 declareProperty(
"IgnoreMissingTrackCovarianceForPulls",
m_ignoreMissTrkCov =
false,
"Do not warn, if track states do not have covariance matries when calculating pulls");
94 "List of Pixel validation tools");
142 return StatusCode::FAILURE;
146 StatusCode
sc(StatusCode::SUCCESS);
151 if (
sc.isFailure()) {
157 ATH_MSG_DEBUG (
"No Updator for unbiased track states given, use normal states!");
164 return StatusCode::FAILURE;
169 ToolHandleArray< Trk::IValidationNtupleHelperTool >::iterator itTools;
269 msg(MSG::INFO) <<
"No residual/pull calculator for general hit residuals configured."
271 msg(MSG::INFO) <<
"It is recommended to give R/P calculators to the det-specific tool"
272 <<
" handle lists then." <<
endmsg;
275 if (
sc.isFailure()) {
279 msg(MSG::INFO) <<
"Generic hit residuals&pulls will be calculated in one or both "
280 <<
"available local coordinates" <<
endmsg;
286 if (
sc.isFailure()) {
293 return StatusCode::SUCCESS;
321 return StatusCode::SUCCESS;
325 if (!
tree)
return StatusCode::FAILURE;
361 StatusCode
sc(StatusCode::SUCCESS);
362 ToolHandleArray< IValidationNtupleHelperTool >::iterator itTools;
369 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
379 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
389 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
399 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
409 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
419 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
429 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
438 msg(MSG::ERROR)<<
"The helper " << (*itTools) <<
" could not add its items" <<
endmsg;
442 return StatusCode::SUCCESS;
451 const unsigned int ) {
454 ATH_MSG_VERBOSE (
"in fillTrackData(trk, indx) filling info about track states");
466 if (trackStates ==
nullptr) {
467 msg(MSG::WARNING) <<
"current track does not have any TrackStateOnSurface vector, no data will be written for this track" <<
endmsg;
468 return StatusCode::FAILURE;
472 int stateIndexCounter=0;
473 for (
const auto *trackState : *trackStates) {
477 msg(MSG::WARNING) <<
"TrackStateOnSurface == Null" <<
endmsg;
488 msg(MSG::ERROR) <<
"measurementOnTrack == Null for a TrackStateOnSurface "
489 <<
"of type Measurement or Outlier" <<
endmsg;
490 return StatusCode::FAILURE;
506 if ( theParameters->covariance() ) {
508 unbiasedParameters =
m_updator->removeFromState( *theParameters,
511 if (unbiasedParameters) {
512 theParameters = unbiasedParameters;
518 if (std::abs(covTrk-covRot)<0.001*covRot) {
519 ATH_MSG_DEBUG(
"Track not overconstrained in local X (track_cov_x = "<<covTrk<<
" vs. meas_cov_x="<<covRot<<
" => do not calculate unbiased residual.");
520 }
else ATH_MSG_INFO (
"Could not get unbiased track parameters, use normal parameters");
521 }
else ATH_MSG_INFO (
"Could not get unbiased track parameters, use normal parameters");
526 msg(MSG::WARNING) <<
"TrackParameters contain no covariance: Unbiased track states can not be calculated (ie. pulls and residuals will be too small)" <<
endmsg;
536 ": detector technology identified as " << detectorType);
541 detectorType)).isFailure())
542 msg(MSG::WARNING) <<
"info about TrackState could not be written to ntuple" <<
endmsg;
547 stateIndexCounter)).isFailure())
548 msg(MSG::WARNING) <<
"Could not call helper Tool! " <<
endmsg;
550 delete unbiasedParameters;
558 std::unique_ptr<const Trk::TrackStates> holesOnTrack (
m_holeSearchTool->getHolesOnTrack(track, track.info().particleHypothesis()));
561 msg(MSG::WARNING) <<
"Got no holes on track" <<
endmsg;
562 return StatusCode::SUCCESS;
564 for (
const auto *it : *holesOnTrack) {
566 msg(MSG::WARNING) <<
"TrackStateOnSurface from hole search tool == Null" <<
endmsg;
570 msg(MSG::WARNING) <<
"info about TrackState (hole) could not be written to ntuple" <<
endmsg;
575 return StatusCode::SUCCESS;
585 ATH_MSG_WARNING (
"MeasurementVectorNtupleTool not meant to be used with TrackParticles.");
587 return StatusCode::SUCCESS;
629 std::vector< Trk::IValidationNtupleHelperTool* >::iterator toolIter;
635 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
644 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
653 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
662 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
671 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
680 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
689 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
698 msg(MSG::ERROR)<<
"The helper could not reset its ntuple variables" <<
endmsg;
708 return StatusCode::SUCCESS;
718 const bool& isOutlier,
719 const int& detectorType ) {
723 if (!isOutlier && trkParameters==
nullptr) {
727 msg(MSG::WARNING) <<
"TSoS (type: measurement) contains no TrackParameters: Residuals, etc. cannot be calculated" <<
endmsg;
728 msg(MSG::WARNING) <<
" This is possible for slimmed tracks; if residuals are needed choose another track collection" <<
endmsg;
729 msg(MSG::WARNING) <<
" (further warnings will be suppressed)" <<
endmsg;
745 std::optional<Trk::ResidualPull> residualPull
750 residualLocX = residualPull->residual()[
Trk::loc1];
751 if (residualPull->dimension() >= 2)
752 residualLocY = residualPull->residual()[
Trk::loc2];
754 pullLocX = residualPull->pull()[
Trk::loc1];
755 if (residualPull->dimension() >= 2)
756 pullLocY = residualPull->pull()[
Trk::loc2];
760 msg(MSG::WARNING) <<
"no covariance of the track parameters given, can not compute pull!" <<
endmsg;
761 msg(MSG::INFO) <<
"Detector type "<< detectorType
762 << (isOutlier?
" (flagged as outlier)" :
"(not an outlier)") <<
endmsg;
763 msg(MSG::INFO) <<
"you may want to use the jobOption 'IgnoreMissingTrackCovarianceForPulls' to calculate it anyhow." <<
endmsg;
764 msg(MSG::INFO) <<
"No further warnings will be given for this type of situation." <<
endmsg;
766 ATH_MSG_DEBUG (
"invalid pull due to missing COV at detector type " << detectorType
767 << (isOutlier?
" (flagged as outlier)." :
"."));
771 msg(MSG::WARNING) <<
"ResidualPullCalculator failed!" <<
endmsg;
780 return StatusCode::SUCCESS;
789 const bool& isOutlier,
790 const int& detectorType,
791 const int& nCurrentHit) {
816 std::vector< Trk::IValidationNtupleHelperTool* >::const_iterator toolIter;
817 std::vector< Trk::IValidationNtupleHelperTool* >::const_iterator toolIterEnd;
818 switch (detectorType) {
863 for (; toolIter!=toolIterEnd; ++toolIter) {
864 if (((*toolIter)->fillMeasurementData(measurementBaseOrROT, trkPar, detectorType, isOutlier)).isFailure()) {
866 msg(MSG::WARNING) <<
"sub-det helper tool did not succeed to fill data (further warnings for this tool will be suppressed)" <<
endmsg;
875 std::vector< Trk::IValidationNtupleHelperTool* >::const_iterator toolIter =
m_GeneralHelperTools.begin();
877 if (((*toolIter)->fillMeasurementData(measurement, trkPar, detectorType, isOutlier)).isFailure()) {
879 msg(MSG::WARNING) <<
"general helper tool did not succeed to fill general data" <<
endmsg;
886 return StatusCode::SUCCESS;
899 if (
id.is_valid() ) {
928 std::vector< Trk::IValidationNtupleHelperTool* >::const_iterator toolIter;
929 std::vector< Trk::IValidationNtupleHelperTool* >::const_iterator toolIterEnd;
930 switch (detectorType) {
961 for (; toolIter!=toolIterEnd; ++toolIter) {
962 if (((*toolIter)->fillHoleData(tsos, detectorType)).isFailure()) {
963 msg(MSG::WARNING) <<
"sub-det helper tool did not succeed to fill hole data" <<
endmsg;
970 std::vector< Trk::IValidationNtupleHelperTool* >::iterator toolIter =
m_GeneralHelperTools.begin();
972 if (((*toolIter)->fillHoleData(tsos, detectorType)).isFailure()) {
973 msg(MSG::WARNING) <<
"general helper tool did not succeed to fill general hole data" <<
endmsg;
977 return StatusCode::SUCCESS;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
MC particle associated with a reco track + the quality of match.
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
bool contains(ParamDefs par) const
The simple check for the clients whether the parameter is contained.
This class is the pure abstract base class for all fittable tracking measurements.
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
classifies a MeasurementBase into one of the known inherited flavours or one of the detector types fo...
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
@ Biased
RP with track state including the hit.
@ Unbiased
RP with track state that has measurement not included.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
represents the track state (measurement, material, fit parameters and quality) at a surface.
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
bool type(const TrackStateOnSurfaceType type) const
Use this method to find out if the TSoS is of a certain type: i.e.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
@ Hole
A hole on the track - this is defined in the following way.
MeasurementType
enum describing the flavour of MeasurementBase
DataVector< const Trk::TrackStateOnSurface > TrackStates
@ loc2
generic first and second local coordinate
ParametersBase< TrackParametersDim, Charged > TrackParameters