10#include <google/profiler.h>
18#include "Identifier/Identifier.h"
23#include "GaudiKernel/ITHistSvc.h"
71 std::string profile_file =
"cpu.prof";
73 ProfilerStart(profile_file.c_str());
76 return StatusCode::SUCCESS;
91 return StatusCode::SUCCESS;
101 return StatusCode::FAILURE;
108 return StatusCode::FAILURE;
118 ATH_MSG_DEBUG(
"This event has " << tracks->size() <<
" tracks." );
119 for (
const auto *track : *tracks) {
126 const Trk::Perigee* perigee = track->perigeeParameters();
134 <<
" pT = " <<
m_track_pt/CLHEP::GeV <<
" CLHEP::GeV" <<
"\n"
139 <<
" theta = " << perigee->parameters()[
Trk::theta] <<
"\n"
140 <<
" qOverP = " << perigee->parameters()[
Trk::qOverP] );
149 ATH_MSG_DEBUG(
" This track has " << track_states->
size() <<
" track states on surface." );
151 ATH_MSG_ERROR(
" This track has null track states on surface." );
156 for (
const auto *trackState : *track_states) {
170 bool passed_track_preselection =
180 if (!passed_track_preselection) {
188 for (
const auto *trackState : *track_states ) {
202 for (
const auto *hole : *holes) {
216 ATH_MSG_ERROR(
"fill_hole_data returned an invalid det type: " << hole_det);
219 ATH_MSG_WARNING(
" hole finder returned a TrackStateOnSurface not of type Hole.");
231 return StatusCode::FAILURE;
247 return StatusCode::SUCCESS;
256#ifdef ANP_CPU_PROFILER
261 return StatusCode::SUCCESS;
394 if (!track_parameters) {
452 m_hit_HL.push_back( (det == 3)&&(trtcircle !=
nullptr) ? trtcircle->
highLevel() : -1 );
455 std::unique_ptr<Trk::TrackParameters> unbiased_track_parameters =
461 m_hit_ub_locR.push_back( det == 3 && unbiased_track_parameters ? unbiased_track_parameters->parameters()[
Trk::locR] : -1 );
462 m_hit_ub_x.push_back( unbiased_track_parameters ? unbiased_track_parameters->position().x() : -1 );
463 m_hit_ub_y.push_back( unbiased_track_parameters ? unbiased_track_parameters->position().y() : -1 );
464 m_hit_ub_z.push_back( unbiased_track_parameters ? unbiased_track_parameters->position().z() : -1 );
467 int is_tube_hit = -1;
468 if (measurement && (det == 3) ) {
473 m_hit_tube_hit.push_back( (det == 3)&&(measurement !=
nullptr) ? is_tube_hit : -1);
485 if (!track_parameters) {
486 ATH_MSG_ERROR(
"fill_hole_data(hole): null track_parameters");
528 float locR = track_parameters->parameters()[
Trk::locR];
531 float locR_error = 0.0;
536 const AmgSymMatrix(5)* merr = track_parameters->covariance();
540 ATH_MSG_ERROR(
"Track parameters have no covariance attached.");
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ALWAYS(x)
#define ATH_MSG_WARNING(x)
#define AmgSymMatrix(dim)
Abstract interface to information on straws electronic grouping.
Handle class for reading from StoreGate.
This is an Identifier helper class for the TRT subdetector.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
size_type size() const noexcept
Returns the number of elements in the collection.
Specific class to represent the pixel measurements.
Specific class to represent the SCT measurements.
Represents 'corrected' measurements from the TRT (for example, corrected for wire sag).
bool highLevel() const
returns true if the high level threshold was passed
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
unsigned int m_lumi_block
std::vector< float > m_hit_ub_z
std::vector< int > m_hit_pad
std::vector< float > m_hit_z
std::vector< int > m_hit_straw
StringProperty m_stream_name
unsigned int m_event_number
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
IntegerProperty m_min_trt_hits
unsigned int m_num_events
std::vector< float > m_hole_center_x
std::vector< float > m_hole_center_y
std::vector< int > m_hit_det
std::vector< float > m_hole_z
std::vector< float > m_hole_x
std::vector< float > m_hit_ub_y
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
int fill_hole_data(const Trk::TrackStateOnSurface &hole)
FloatProperty m_max_abs_d0
std::vector< int > m_hit_bec
IntegerProperty m_min_sct_hits
std::vector< float > m_hole_locR
StringProperty m_required_trigger
std::vector< int > m_hit_HL
std::vector< float > m_hit_center_y
std::vector< int > m_hole_strawlayer
std::vector< float > m_hit_y
std::vector< float > m_hole_locR_error
ServiceHandle< ITHistSvc > m_hist_svc
std::vector< float > m_hit_center_x
unsigned int m_run_number
StringProperty m_tree_name
std::vector< int > m_hit_layer
std::vector< int > m_hit_phi
std::vector< float > m_hit_R
FloatProperty m_max_abs_z0
std::vector< int > m_hole_det
std::vector< int > m_hit_strawlayer
std::vector< float > m_hit_locR
IntegerProperty m_min_pixel_hits
std::vector< int > m_hole_chip
std::vector< int > m_hole_phi
int fill_hit_data(const Trk::TrackStateOnSurface &hit)
PublicToolHandle< Trk::IUpdator > m_updator
TRTStrawEfficiency(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< int > m_hole_layer
std::vector< int > m_hit_tube_hit
unsigned int m_num_tracks
std::vector< float > m_hole_center_z
ToolHandle< Trk::ITrackHoleSearchTool > m_trt_hole_finder
FloatProperty m_max_abs_eta
unsigned int m_num_preselected_tracks
PublicToolHandle< Trig::ITrigDecisionTool > m_trigDec
std::vector< int > m_hole_straw
std::vector< float > m_hole_y
std::vector< int > m_hit_chip
SG::ReadHandleKey< TrackCollection > m_tracksKey
std::vector< int > m_hole_pad
std::vector< float > m_hit_x
std::vector< float > m_hit_ub_locR
std::vector< float > m_hit_center_z
std::vector< int > m_hole_bec
std::vector< float > m_hit_ub_x
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.
double eta() const
Access method for pseudorapidity - from momentum.
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.
double pT() const
Access method for transverse momentum.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
const Amg::Vector3D & center() const
Returns the center position of the Surface.
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
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
@ Hole
A hole on the track - this is defined in the following way.
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 ...
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
ParametersBase< TrackParametersDim, Charged > TrackParameters