|
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"
42 declareInterface<ITrackHoleSearchTool>(
this);
63 return StatusCode::SUCCESS;
71 return StatusCode::SUCCESS;
77 std::vector<int>& information ,
103 if (
track.perigeeParameters()) {
105 <<
" pT = " <<
track.perigeeParameters()->pT()/
CLHEP::GeV <<
" CLHEP::GeV\n"
106 <<
" eta = " <<
track.perigeeParameters()->eta() <<
"\n"
107 <<
" phi = " <<
track.perigeeParameters()->parameters()[
Trk::phi0] <<
"\n"
108 <<
" d0 = " <<
track.perigeeParameters()->parameters()[
Trk::d0] <<
"\n"
109 <<
" z0 = " <<
track.perigeeParameters()->parameters()[
Trk::z0] );
115 ATH_MSG_DEBUG(
" This track has " << track_states->
size() <<
" track states on surface." );
117 ATH_MSG_WARNING(
" This track has null track states on surface. Returning 0." );
121 if (track_states->
size() < 2) {
134 if (beginning_track_state == track_states->
end()) {
135 ATH_MSG_WARNING(
" beginning_track_state == track_states->end(). There must be no Si hits.\n"
136 <<
" Will try to begin at the first TRT hit." );
141 if (beginning_track_state == track_states->
end()) {
142 ATH_MSG_WARNING(
" beginning_track_state == track_states->end(). No where to extrapolate to. Returning 0." );
153 for (; track_state != track_states->
end(); ++track_state) {
156 ATH_MSG_VERBOSE(
" TrackStateOnSurface is not of type Trk::TrackStateOnSurface::Measurement." );
163 << end_parameters->
position().x() <<
", "
164 << end_parameters->
position().y() <<
", "
165 << end_parameters->
position().z() <<
"); (rho, eta, phi) = ("
166 << end_parameters->
position().perp() <<
", "
167 << end_parameters->
position().eta() <<
", "
168 << end_parameters->
position().phi() <<
")");
175 if (!start_parameters) {
176 start_parameters = end_parameters;
179 start_parameters = end_parameters;
189 ATH_MSG_DEBUG(
"There are " << trailing_hole_count <<
" trailing holes removed.");
190 for(
int i=0;
i < trailing_hole_count;
i++) {
206 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::getTrackWithHoles" );
217 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::getTrackWithHolesAndOutliers" );
240 std::vector<std::unique_ptr<Trk::TrackParameters> >
steps =
241 m_extrapolator->extrapolateStepwise(Gaudi::Hive::currentContext(),
248 ATH_MSG_DEBUG(
"extrapolateBetweenHits: extrapolateStepwise returned null");
252 for(std::vector<std::unique_ptr<Trk::TrackParameters> >::const_iterator
step =
steps.begin();
step !=
steps.end()-1; ++
step) {
254 const Trk::Surface& surf = (*step)->associatedSurface();
261 ATH_MSG_DEBUG(
"extrapolateBetweenHits: surf is not a TRT straw. Skipping.");
266 if(
id == previous_id) {
278 if(
id == 0xffffffff) {
279 ATH_MSG_DEBUG(
"extrapolateBetweenHits: id == 0xffffffff. Skipping.");
285 ATH_MSG_DEBUG(
"extrapolateBetweenHits: ConditionsSvc says this straw is bad. Skipping.");
308 ATH_MSG_WARNING(
"extrapolateBetweenHits: Track parameters failed to dynamic_cast< const Trk::MeasuredTrackParameters* >.");
325 ATH_MSG_WARNING(
"extrapolateBetweenHits: Surface failed to dynamic_cast to Trk::CylinderBounds. Skipping.");
331 ATH_MSG_DEBUG(
" HOLE Found! Identifier = " <<
id.getString() <<
" indicates:\n"
340 <<
" rho = " << (*step)->position().perp() );
342 std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> typePattern;
355 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::dump_bad_straw_log" );
356 std::ofstream
out(
"TRT_ConditionsSummarySvc_bad_straws.log");
357 out <<
"# id barrel_ec phi_module layer_or_wheel straw_layer straw" << std::endl;
362 out <<
id.getString()
379 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::find_first_trt_hit" );
382 for(; track_state != track_states.
end(); ++track_state) {
385 ATH_MSG_VERBOSE(
" TrackStateOnSurface is not of type Trk::TrackStateOnSurface::Measurement." );
400 ATH_MSG_DEBUG(
"TRTTrackHoleSearchTool::find_last_hit_before_trt" );
404 if(track_states.
size() < 2 || track_state == track_states.
begin()) {
405 return track_states.
end();
408 for(; track_state != track_states.
begin(); --track_state) {
415 return track_states.
end();
433 auto tsos = std::make_unique<Trk::TrackStates>();
434 for (
const auto *
it : *
track.trackStateOnSurfaces()) {
443 if (
track.trackStateOnSurfaces()->size() == tsos->size() &&
holes->empty()) {
448 track.fitQuality() ?
track.fitQuality()->uniqueClone() :
nullptr);
453 tsos->insert(tsos->end(),
holes->begin(),
holes->end());
458 perigee = (*(
track.trackStateOnSurfaces()->begin()))->trackParameters();
463 if (fabs(perigee->parameters()[
Trk::qOverP]) > 0.002) {
467 msg() <<
"sorting vector with stable_sort" <<
endmsg;
469 std::stable_sort(tsos->begin(), tsos->end(), CompFunc);
471 tsos->sort(CompFunc);
479 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.
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: