Commit a174d25e authored by Christian Grefe's avatar Christian Grefe
Browse files

Avoid circular package dependencies

parent 0e813ec8
......@@ -135,7 +135,7 @@ StatusCode InDet::TRT_ElectronPidToolRun2::finalize()
std::vector<float> InDet::TRT_ElectronPidToolRun2::electronProbability_old(const Trk::Track& track)
{
// Simply return values without calculation
std::vector<float> PIDvalues = defaultElectronProbability();
std::vector<float> PIDvalues = Trk::eProbabilityDefault;
const Trk::TrackParameters* perigee = track.perigeeParameters();
if (!perigee) { return PIDvalues; }
return PIDvalues;
......@@ -167,7 +167,7 @@ InDet::TRT_ElectronPidToolRun2::electronProbability(const Trk::Track& track) con
}
// Initialize the vector with default PID values
std::vector<float> PIDvalues = defaultElectronProbability();
std::vector<float> PIDvalues = Trk::eProbabilityDefault;
// Check for perigee:
const Trk::TrackParameters* perigee = track.perigeeParameters();
......
......@@ -7,7 +7,7 @@ atlas_subdir( TrkTrackSummary )
atlas_add_library( TrkTrackSummary
src/*.cxx
PUBLIC_HEADERS TrkTrackSummary
LINK_LIBRARIES Identifier TrkToolInterfaces
LINK_LIBRARIES Identifier
PRIVATE_LINK_LIBRARIES GaudiKernel )
atlas_add_dictionary( TrkTrackSummaryDict
......
......@@ -149,6 +149,8 @@ static const std::vector<unsigned int> floatSummaryTypes = {eProbabilityComb_res
numberOfeProbabilityTypes = 8
};
static const std::vector<float> eProbabilityDefault(numberOfeProbabilityTypes, 0.5);
/** enumerates the various detector types currently accessible from the isHit() method.
\todo work out how to add muons to this*/
enum DetectorType {
......
......@@ -11,7 +11,6 @@
#include "TrkTrackSummary/TrackSummary.h"
#include "TrkTrackSummary/InDetTrackSummary.h"
#include "TrkTrackSummary/MuonTrackSummary.h"
#include "TrkToolInterfaces/ITRT_ElectronPidTool.h"
#include "GaudiKernel/MsgStream.h"
std::atomic<unsigned int> Trk::TrackSummary::s_numberOfInstantiations{0};
......@@ -20,7 +19,7 @@ const int Trk::TrackSummary::SummaryTypeNotSet=-1;
Trk::TrackSummary::TrackSummary()
:
m_information(numberOfTrackSummaryTypes, SummaryTypeNotSet),
m_eProbability(ITRT_ElectronPidTool::defaultElectronProbability()),
m_eProbability(Trk::eProbabilityDefault),
m_dedx(-1),
m_nhitsdedx(-1),
m_nhitsoverflowdedx(-1),
......@@ -106,7 +105,7 @@ Trk::TrackSummary& Trk::TrackSummary::operator+=(const TrackSummary& ts)
}
m_information[i]+= ts.m_information[i];
}
if (ts.m_eProbability != ITRT_ElectronPidTool::defaultElectronProbability()) {
if (ts.m_eProbability != Trk::eProbabilityDefault) {
m_eProbability = ts.m_eProbability;
}
if (m_dedx<0 && ts.m_dedx>=0) {
......
......@@ -45,19 +45,6 @@ namespace Trk {
virtual double probHT( const double p, const Trk::ParticleHypothesis hypothesis, const int HitPart, const int Layer, const int Strawlayer) const = 0;
virtual double probHTRun2( float pTrk, Trk::ParticleHypothesis hypothesis, int TrtPart, int GasType, int StrawLayer, float ZR, float rTrkWire, float Occupancy ) const = 0;
static std::vector<float> defaultElectronProbability() {
std::vector<float> PIDvalues(Trk::numberOfeProbabilityTypes);
PIDvalues[Trk::eProbabilityComb] = 0.5;
PIDvalues[Trk::eProbabilityHT] = 0.5;
PIDvalues[Trk::eProbabilityToT] = 0.5;
PIDvalues[Trk::eProbabilityBrem] = 0.5;
PIDvalues[Trk::eProbabilityNN] = 0.5;
PIDvalues[Trk::TRTTrackOccupancy] = 0.0;
PIDvalues[Trk::TRTdEdx] = 0.0;
PIDvalues[Trk::eProbabilityNumberOfTRTHitsUsedFordEdx] = 0.0;
return PIDvalues;
}
};
inline const InterfaceID& Trk::ITRT_ElectronPidTool::interfaceID()
......
......@@ -192,7 +192,7 @@ information.resize(std::min(information.size(),
static_cast<size_t>(numberOfTrackSummaryTypes)));
// Troels.Petersen@cern.ch:
std::vector<float> eProbability = ITRT_ElectronPidTool::defaultElectronProbability();
std::vector<float> eProbability = Trk::eProbabilityDefault;
float dedx = -1;
int nhitsuseddedx = -1;
......@@ -339,7 +339,7 @@ void Trk::TrackSummaryTool::updateSharedHitCount(const Track& track, const Trk::
void Trk::TrackSummaryTool::updateAdditionalInfo(const Track& track, TrackSummary &summary, bool initialise_to_zero) const
{
std::vector<float> eProbability = ITRT_ElectronPidTool::defaultElectronProbability();
std::vector<float> eProbability = Trk::eProbabilityDefault;
if (!m_eProbabilityTool.empty()) {
eProbability = m_eProbabilityTool->electronProbability(track);
int nHits = eProbability[Trk::eProbabilityNumberOfTRTHitsUsedFordEdx];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment