13#include "GaudiKernel/TypeNameString.h"
42 ATH_MSG_FATAL(
"Failed to retrieve TRT Calibration DB Service!");
52 return StatusCode::SUCCESS;
65 const TRT_ID* TRTHelper =
nullptr;
66 StatusCode
sc =
detStore()->retrieve(TRTHelper,
"TRT_ID");
68 msg(MSG::ERROR) <<
"Unable to retrieve TRT ID Helper." <<
endmsg;
72 std::vector<double> EPforTracksWithBarrelHits;
76 if (MyTrackCollection.
isValid()) {
80 for (; trackIt != trackEnd; ++trackIt) {
81 int nTRTbarrelHits = 0;
87 if (!trtcirc)
continue;
89 if (abs(TRTHelper->
barrel_ec(
id)) != 1)
continue;
93 if (nTRTbarrelHits >= 10) {
95 if (tmpEP != 0.) EPforTracksWithBarrelHits.push_back(tmpEP);
98 if (nTRTbarrelHits > maxTRT) {
99 maxTRT = nTRTbarrelHits;
114 if (EPforTracksWithBarrelHits.size()) {
115 for (
unsigned int i = 0; i < EPforTracksWithBarrelHits.size(); i++)
m_phase += EPforTracksWithBarrelHits[i];
116 m_phase /= (double) (EPforTracksWithBarrelHits.size());
124 sc = StatusCode::SUCCESS;
130 return StatusCode::SUCCESS;
138 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
abstract base class for rt-relations
This is an Identifier helper class for the TRT subdetector.
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDetCosmicsEventPhase(const std::string &name, ISvcLocator *pSvcLocator)
ToolHandle< InDet::IInDetCosmicsEventPhaseTool > m_eventPhaseTool
ToolHandle< Trk::ITrackSummaryTool > m_trackSumTool
SG::WriteHandleKey< ComTime > m_writeKey_TRTPhase
ToolHandle< ITRT_CalDbTool > m_caldbtool
TRT Calibration DB tool.
SG::ReadHandleKeyArray< TrackCollection > m_readKey_tracks
Represents 'corrected' measurements from the TRT (for example, corrected for wire sag).
Property holding a SG store/key/clid from which a ReadHandle is made.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
This is an Identifier helper class for the TRT subdetector.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
This class is the pure abstract base class for all fittable tracking measurements.
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
Identifier identify() const
return the identifier -extends MeasurementBase
represents the track state (measurement, material, fit parameters and quality) at a surface.
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.