![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
24 #include "Identifier/Identifier.h"
30 #include "CLHEP/Units/SystemOfUnits.h"
31 #include "CLHEP/Geometry/Transform3D.h"
41 m_extrapolator(
"Trk::Extrapolator"),
42 m_conditions_svc(
"TRT_ConditionsSummarySvc",
name),
43 m_has_been_called(false),
45 m_trt_outer_surf(nullptr)
47 declareInterface<ITrackHoleSearchTool>(
this);
82 return StatusCode::SUCCESS;
90 return StatusCode::SUCCESS;
96 std::vector<int>& information ,
122 if (
track.perigeeParameters()) {
124 <<
" pT = " <<
track.perigeeParameters()->pT()/
CLHEP::GeV <<
" CLHEP::GeV\n"
125 <<
" eta = " <<
track.perigeeParameters()->eta() <<
"\n"
126 <<
" phi = " <<
track.perigeeParameters()->parameters()[
Trk::phi0] <<
"\n"
127 <<
" d0 = " <<
track.perigeeParameters()->parameters()[
Trk::d0] <<
"\n"
128 <<
" z0 = " <<
track.perigeeParameters()->parameters()[
Trk::z0] );
134 ATH_MSG_DEBUG(
" This track has " << track_states->
size() <<
" track states on surface." );
136 ATH_MSG_WARNING(
" This track has null track states on surface. Returning 0." );
140 if (track_states->
size() < 2) {
153 if (beginning_track_state == track_states->
end()) {
154 ATH_MSG_WARNING(
" beginning_track_state == track_states->end(). There must be no Si hits.\n"
155 <<
" Will try to begin at the first TRT hit." );
160 if (beginning_track_state == track_states->
end()) {
161 ATH_MSG_WARNING(
" beginning_track_state == track_states->end(). No where to extrapolate to. Returning 0." );
172 for (; track_state != track_states->
end(); ++track_state) {
175 ATH_MSG_VERBOSE(
" TrackStateOnSurface is not of type Trk::TrackStateOnSurface::Measurement." );
182 << end_parameters->
position().x() <<
", "
183 << end_parameters->
position().y() <<
", "
184 << end_parameters->
position().z() <<
"); (rho, eta, phi) = ("
185 << end_parameters->
position().perp() <<
", "
186 << end_parameters->
position().eta() <<
", "
187 << end_parameters->
position().phi() <<
")");
194 if (!start_parameters) {
195 start_parameters = end_parameters;
198 start_parameters = end_parameters;
208 ATH_MSG_DEBUG(
"There are " << trailing_hole_count <<
" trailing holes removed.");
209 for(
int i=0;
i < trailing_hole_count;
i++) {
225 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::getTrackWithHoles" );
236 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::getTrackWithHolesAndOutliers" );
259 std::vector<std::unique_ptr<Trk::TrackParameters> >
steps =
260 m_extrapolator->extrapolateStepwise(Gaudi::Hive::currentContext(),
266 ATH_MSG_DEBUG(
"extrapolateBetweenHits: extrapolateStepwise returned null");
270 for(std::vector<std::unique_ptr<Trk::TrackParameters> >::const_iterator
step =
steps.begin();
step !=
steps.end()-1; ++
step) {
272 const Trk::Surface& surf = (*step)->associatedSurface();
279 ATH_MSG_DEBUG(
"extrapolateBetweenHits: surf is not a TRT straw. Skipping.");
284 if(
id == previous_id) {
296 if(
id == 0xffffffff) {
297 ATH_MSG_DEBUG(
"extrapolateBetweenHits: id == 0xffffffff. Skipping.");
303 ATH_MSG_DEBUG(
"extrapolateBetweenHits: ConditionsSvc says this straw is bad. Skipping.");
326 ATH_MSG_WARNING(
"extrapolateBetweenHits: Track parameters failed to dynamic_cast< const Trk::MeasuredTrackParameters* >.");
343 ATH_MSG_WARNING(
"extrapolateBetweenHits: Surface failed to dynamic_cast to Trk::CylinderBounds. Skipping.");
349 ATH_MSG_DEBUG(
" HOLE Found! Identifier = " <<
id.getString() <<
" indicates:\n"
358 <<
" rho = " << (*step)->position().perp() );
360 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
373 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::dump_bad_straw_log" );
374 std::ofstream
out(
"TRT_ConditionsSummarySvc_bad_straws.log");
375 out <<
"# id barrel_ec phi_module layer_or_wheel straw_layer straw" << std::endl;
380 out <<
id.getString()
397 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::find_first_trt_hit" );
400 for(; track_state != track_states.
end(); ++track_state) {
403 ATH_MSG_VERBOSE(
" TrackStateOnSurface is not of type Trk::TrackStateOnSurface::Measurement." );
418 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::find_last_hit_before_trt" );
422 if(track_states.
size() < 2 || track_state == track_states.
begin()) {
423 return track_states.
end();
426 for(; track_state != track_states.
begin(); --track_state) {
433 return track_states.
end();
451 auto tsos = std::make_unique<Trk::TrackStates>();
452 for (
const auto *
it : *
track.trackStateOnSurfaces()) {
461 if (
track.trackStateOnSurfaces()->size() == tsos->size() &&
holes->empty()) {
466 track.fitQuality() ?
track.fitQuality()->uniqueClone() :
nullptr);
471 tsos->insert(tsos->end(),
holes->begin(),
holes->end());
476 perigee = (*(
track.trackStateOnSurfaces()->begin()))->trackParameters();
481 if (fabs(perigee->parameters()[
Trk::qOverP]) > 0.002) {
485 msg() <<
"sorting vector with stable_sort" <<
endmsg;
487 std::stable_sort(tsos->begin(), tsos->end(), CompFunc);
489 tsos->sort(CompFunc);
497 track.fitQuality() ?
track.fitQuality()->uniqueClone() :
nullptr);
def retrieve(aClass, aKey=None)
bool is_pixel(Identifier id) const
Const iterator class for DataVector/DataList.
int straw_max(const Identifier &id) const
bool is_sct(Identifier id) const
const Amg::Vector3D & position() const
Access method for the position.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
bool msgLvl(const MSG::Level lvl) const
bool is_trt(Identifier id) const
#define ATH_MSG_VERBOSE(x)
@ numberOfTRTHoles
number of TRT hits which pass the high threshold (only xenon counted) total number of TRT hits which ...
#define AmgSymMatrix(dim)
const_id_iterator straw_layer_end(void) const
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Class providing comparison function, or relational definition, for sorting MeasurementBase objects.
int straw(const Identifier &id) const
DataVector< const Trk::TrackStateOnSurface > TrackStates
@ Hole
A hole on the track - this is defined in the following way.
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int straw_layer(const Identifier &id) const
int layer_or_wheel(const Identifier &id) const
represents the track state (measurement, material, fit parameters and quality) at a surface.
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
int phi_module(const Identifier &id) const
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const Amg::Vector3D & momentum() const
Access method for the momentum.
#define ATH_MSG_WARNING(x)
const_id_iterator straw_layer_begin(void) const
Iterators over full set of straw_layer ids. Straw_layer ids are sorted.
size_type size() const noexcept
Returns the number of elements in the collection.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
double halflengthZ() const
This method returns the halflengthZ.
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: