11#include "Identifier/Identifier.h"
22 ,
const std::string& n
38 declareInterface<IInDetAlignHitQualSelTool>(
this) ;
54 StatusCode
sc = AlgTool::initialize() ;
55 if(
sc.isFailure() )
return sc ;
62 return StatusCode::SUCCESS ;
68 return AlgTool::finalize() ;
72 ATH_MSG_DEBUG(
"** getGoodHit ** Dealing with a new tsos ** START ** " ) ;
74 if( tsos ==
nullptr ) {
79 ATH_MSG_DEBUG(
"not a hit, cast to MeasurementBase will fail, so reject" ) ;
87 if( measBase ==
nullptr) {
88 ATH_MSG_DEBUG(
"tsos->measurementOnTrack() returned 0 pointer" ) ;
93 if(
hit ==
nullptr ) {
94 ATH_MSG_DEBUG(
"dynamic_cast <const Trk::RIO_OnTrack*>( measBase ) returned 0 pointer" ) ;
99 if( prd ==
nullptr ) {
106 const vector<Identifier> &idVec = prd->
rdoList() ;
115 if( trkPar ==
nullptr ) {
121 if( detEle ==
nullptr ) {
122 ATH_MSG_WARNING(
"hit cast to SiDetectorElement returned 0 pointer" ) ;
125 if( !
isGoodAngle( trkPar, detEle ) )
return nullptr ;
130 bool isSiliconHit =
false;
131 bool isPixelHit =
false;
132 bool isIBLHit =
false;
134 if( tsos ==
nullptr ) {
139 ATH_MSG_DEBUG(
"not a hit, cast to MeasurementBase will fail --> keep it anyway" ) ;
148 if( measBase ==
nullptr) {
149 ATH_MSG_DEBUG(
"tsos->measurementOnTrack() returned 0 pointer" ) ;
154 if(
hit ==
nullptr ) {
155 ATH_MSG_DEBUG(
"dynamic_cast <const Trk::RIO_OnTrack*>( measBase ) returned 0 pointer" ) ;
160 if( prd ==
nullptr ) {
176 if (
m_pixelid->layer_disk(hitId) == 0 &&
m_pixelid->barrel_ec(hitId) == 0 ) {isIBLHit =
true; isPixelHit =
false;}
180 ATH_MSG_DEBUG(
"This is not a silicon hit. Keep it as good" ) ;
186 ATH_MSG_INFO(
"this is an IBL hit --> user wants to drop it" ) ;
192 ATH_MSG_INFO(
"this is a pixel hit --> user wants to drop it" ) ;
198 if (isSiliconHit &&
m_sctID->is_sct(hitId)) {
199 ATH_MSG_INFO(
"this is a SCT hit --> user wants to drop it" ) ;
205 const vector<Identifier> &idVec = prd->
rdoList() ;
215 if( trkPar ==
nullptr ) {
222 if( detEle ==
nullptr ) {
223 ATH_MSG_WARNING(
"hit cast to SiDetectorElement returned 0 pointer" ) ;
226 if( !
isGoodAngle( trkPar, detEle ) )
return false ;
234 if( tsos ==
nullptr ) {
244 if( trkPar ==
nullptr ) {
249 tsos->
trackParameters()->associatedSurface().associatedDetectorElement() ) ;
250 if( detEle ==
nullptr ) {
251 ATH_MSG_WARNING(
"hole cast to SiDetectorElement returned 0 pointer" ) ;
254 if( !
isGoodAngle( trkPar, detEle ) )
return false ;
261 if( cluster ==
nullptr ) {
262 ATH_MSG_WARNING(
"dynamic_cast<const InDet::SiCluster*>( prd ) failed!" ) ;
274 int clusterSize = idVec.size() ;
285 for(
unsigned int i=0, i_max=idVec.size() ; i!=i_max ; ++i ) {
286 if(
m_sctID->is_sct(idVec[i]) ) {
287 int stripId =
m_sctID->strip(idVec[i]) ;
288 if( stripId == 0 || stripId == 767 ) {
289 ATH_MSG_DEBUG(
" SCT strip " << i <<
" with id " << stripId <<
" is an edge channel " ) ;
292 if( stripId < 0 || stripId > 767 ) {
297 int pixelIdPhi =
m_pixelid->phi_index(idVec[i]) ;
298 int pixelIdEta =
m_pixelid->eta_index(idVec[i]) ;
299 if( pixelIdPhi == 0 || pixelIdPhi == 327 || pixelIdEta == 0 || pixelIdEta == 143 ) {
300 ATH_MSG_DEBUG(
" pixel hit " << i <<
" with idPhi " << pixelIdPhi <<
" and idEta " << pixelIdEta <<
" is an edge channel " ) ;
303 if( pixelIdPhi < 0 || pixelIdPhi > 327 || pixelIdEta < 0 || pixelIdEta > 143 ) {
314 const double trkIncidAngle =
incidAngle( trkPar, detEle ) ;
329 double trkDotPhi = trkDir.dot( detElePhi ) ;
330 double trkDotNormal = trkDir.dot( detEleNormal ) ;
331 double trkIncidAngle = atan( trkDotPhi/trkDotNormal ) ;
333 return trkIncidAngle ;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
This is an Identifier helper class for the SCT subdetector.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
Class to hold geometrical description of a silicon detector element.
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
const Amg::Vector3D & phiAxis() const
bool gangedPixel() const
return the flag of this cluster containing a gangedPixel
This class is the pure abstract base class for all fittable tracking measurements.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Class to handle RIO On Tracks ROT) for InDet and Muons, it inherits from the common MeasurementBase.
represents the track state (measurement, material, fit parameters and quality) at a surface.
const MeasurementBase * measurementOnTrack() const
returns MeasurementBase const overload
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.
Eigen::Matrix< double, 3, 1 > Vector3D
ParametersBase< TrackParametersDim, Charged > TrackParameters