Skip to content
Snippets Groups Projects
Commit a9f8179f authored by Goetz Gaycken's avatar Goetz Gaycken
Browse files

Remove deprecated members and accessors from the TrackSummary.

Also removed now unused interface from IExtendedTrackSummaryHelperTool.
parent cbcef483
No related branches found
No related tags found
No related merge requests found
Showing with 25 additions and 144 deletions
......@@ -186,35 +186,25 @@ enum SummaryType
// reserved: added to keep synchronisation with xAOD::TrackSummary in
// anticipation of the two being merged
//!< Electron probability from combining the below
//!< probabilities [float].
eProbabilityComb_res = 47,
//!< Electron probability from High Threshold (HT) information [float].
eProbabilityHT_res = 48,
//!< Electron probability from Time-Over-Threshold
//!< (ToT) information [float].
eProbabilityToT_res = 49,
//!< Electron probability from Brem fitting (DNA) [float].
eProbabilityBrem_res = 50,
//!< the dE/dx estimate, calculated using the pixel clusters [?]
pixeldEdx_res = 51,
//!< Electron probability from NN [float]
eProbabilityNN_res = 73,
//!< TRT track occupancy.
TRTTrackOccupancy_res = 74,
//!< dEdx from TRT ToT measurement.
TRTdEdx_res = 75,
// in the past used to store pixel and TRT PID information:
unused_eProbabilityComb_res = 47,
unused_eProbabilityHT_res = 48,
unused_eProbabilityToT_res = 49,
unused_eProbabilityBrem_res = 50,
unused_pixeldEdx_res = 51,
unused_eProbabilityNN_res = 73,
unused_TRTTrackOccupancy_res = 74,
unused_TRTdEdx_res = 75,
// -- numbers...
numberOfTrackSummaryTypes = 76
};
// summary types that are stored as float values
static const std::vector<unsigned int> floatSummaryTypes = {
eProbabilityComb_res, eProbabilityHT_res, eProbabilityToT_res,
eProbabilityBrem_res, pixeldEdx_res, eProbabilityNN_res,
TRTTrackOccupancy_res, TRTdEdx_res
static const std::vector<unsigned int> unusedSummaryTypes = {
unused_eProbabilityComb_res, unused_eProbabilityHT_res, unused_eProbabilityToT_res,
unused_eProbabilityBrem_res, unused_pixeldEdx_res, unused_eProbabilityNN_res,
unused_TRTTrackOccupancy_res, unused_TRTdEdx_res
};
// Troels.Petersen@cern.ch:
......@@ -320,11 +310,7 @@ public:
@param hitPattern this bitset should be filled using the DetectorType enum.
True indicates that a sub-detector was hit*/
TrackSummary(const std::vector<int>& information,
const std::vector<float>& eProbability,
std::bitset<numberOfDetectorTypes>& hitPattern,
float dedx = -1,
int nhitsuseddedx = -1,
int nhitsoverflowdedx = -1);
std::bitset<numberOfDetectorTypes>& hitPattern);
/** copy ctor*/
TrackSummary(const TrackSummary& rhs);
......@@ -351,22 +337,6 @@ public:
filling it yet)*/
int get(const SummaryType& type) const;
/** returns the probability information for the passed ProbabilityType.
@param type Use the provided enums to access it, i.e. by
summary.getPID(eProbabilityComb)
@return returns -1 if the enum is undefined (i.e. the information was not
available in the Track, or (more likely) Trk::TrkTrackSummaryTool is not
filling it yet)*/
// Troels.Petersen@cern.ch:
[[deprecated]] float getPID(const eProbabilityType& PIDtype) const;
/** returns the dE/dx estimate, calculated using the pixel clusters */
[[deprecated]] float getPixeldEdx() const;
[[deprecated]] int numberOfUsedHitsdEdx() const;
[[deprecated]] int numberOfOverflowHitsdEdx() const;
unsigned long getHitPattern() const;
/** returns true if the detector type 'type' is hit.
......@@ -399,17 +369,6 @@ private: // data members
/** vector containing the persistent summary information. */
std::vector<int> m_information;
/** vector containing the persistent summary information. */
// Troels.Petersen@cern.ch:
std::vector<float> m_eProbability;
/** contains the dE/dx information, calculated using the pixel clusters */
float m_dedx;
int m_nhitsdedx;
int m_nhitsoverflowdedx;
/**contains the 'hit pattern'*/
unsigned long m_idHitPattern;
......
......@@ -7,13 +7,6 @@ Trk::TrackSummary::get(const Trk::SummaryType& type) const
return m_information.at(type);
}
// Troels.Petersen@cern.ch:
inline float
Trk::TrackSummary::getPID(const Trk::eProbabilityType& PIDtype) const
{
return (PIDtype < m_eProbability.size() ? m_eProbability[PIDtype] : 0.);
}
inline bool
Trk::TrackSummary::update(Trk::SummaryType type, int new_value)
{
......@@ -24,24 +17,6 @@ Trk::TrackSummary::update(Trk::SummaryType type, int new_value)
return true;
}
inline float
Trk::TrackSummary::getPixeldEdx() const
{
return m_dedx;
}
inline int
Trk::TrackSummary::numberOfUsedHitsdEdx() const
{
return m_nhitsdedx;
}
inline int
Trk::TrackSummary::numberOfOverflowHitsdEdx() const
{
return m_nhitsoverflowdedx;
}
inline bool
Trk::TrackSummary::isHit(const Trk::DetectorType& type) const
{
......
......@@ -16,10 +16,6 @@ const int Trk::TrackSummary::SummaryTypeNotSet = -1;
Trk::TrackSummary::TrackSummary()
: m_information(numberOfTrackSummaryTypes, SummaryTypeNotSet)
, m_eProbability(Trk::eProbabilityDefault)
, m_dedx(-1)
, m_nhitsdedx(-1)
, m_nhitsoverflowdedx(-1)
, m_idHitPattern(0)
, m_muonTrackSummary(nullptr)
{
......@@ -29,16 +25,8 @@ Trk::TrackSummary::TrackSummary()
}
Trk::TrackSummary::TrackSummary(const std::vector<int>& information,
const std::vector<float>& eProbability,
std::bitset<numberOfDetectorTypes>& hitPattern,
float dedx,
int nhitsdedx,
int noverflowdedx)
std::bitset<numberOfDetectorTypes>& hitPattern)
: m_information(information)
, m_eProbability(eProbability)
, m_dedx(dedx)
, m_nhitsdedx(nhitsdedx)
, m_nhitsoverflowdedx(noverflowdedx)
, m_idHitPattern(hitPattern.to_ulong())
, m_muonTrackSummary(nullptr)
{
......@@ -49,10 +37,6 @@ Trk::TrackSummary::TrackSummary(const std::vector<int>& information,
Trk::TrackSummary::TrackSummary(const TrackSummary& rhs)
: m_information(rhs.m_information)
, m_eProbability(rhs.m_eProbability)
, m_dedx(rhs.m_dedx)
, m_nhitsdedx(rhs.m_nhitsdedx)
, m_nhitsoverflowdedx(rhs.m_nhitsoverflowdedx)
, m_idHitPattern(rhs.m_idHitPattern)
{
#ifndef NDEBUG
......
......@@ -10,8 +10,6 @@ void TrackSummaryCnv_p2::dbgPrint( const Trk::TrackSummary *t){
std::cout << "-------------------------------------------" <<std::endl;
std::cout << "m_idHitPattern:\t" << t->m_idHitPattern << std::endl;
std::cout << "m_dedx :\t" << t->m_dedx << std::endl;
std::cout << "m_nhitsdedx :\t" << t->m_nhitsdedx << std::endl;
std::cout << " std::vector m_information size: "<< t->m_information.size() <<std::endl;
for (std::vector<int>::const_iterator i=t->m_information.begin();i!=t->m_information.end();++i) std::cout<<"\t "<<(*i);
......
......@@ -882,9 +882,12 @@ void
TrackParticleCreatorTool::setTrackSummary(xAOD::TrackParticle& tp, const TrackSummary& summary) const
{
// ensure that xAOD TrackSummary and TrackSummary enums are in sync.
constexpr unsigned int xAodReferenceEnum = static_cast<unsigned int>(xAOD::pixeldEdx);
constexpr unsigned int TrkReferenceEnum = static_cast<unsigned int>(Trk::pixeldEdx_res);
static_assert(xAodReferenceEnum == TrkReferenceEnum, "Trk and xAOD enums differ in their indices");
constexpr unsigned int xAodReferenceEnum1 = static_cast<unsigned int>(xAOD::numberOfTRTXenonHits);
constexpr unsigned int TrkReferenceEnum1 = static_cast<unsigned int>(Trk::numberOfTRTXenonHits);
static_assert(xAodReferenceEnum1 == TrkReferenceEnum1, "Trk and xAOD enums differ in their indices");
constexpr unsigned int xAodReferenceEnum2 = static_cast<unsigned int>(xAOD::numberOfTRTSharedHits);
constexpr unsigned int TrkReferenceEnum2 = static_cast<unsigned int>(Trk::numberOfTRTSharedHits);
static_assert(xAodReferenceEnum2 == TrkReferenceEnum2, "Trk and xAOD enums differ in their indices");
for (unsigned int i = 0; i < Trk::numberOfTrackSummaryTypes; i++) {
// Only add values which are +ve (i.e., which were created)
......@@ -898,16 +901,12 @@ TrackParticleCreatorTool::setTrackSummary(xAOD::TrackParticle& tp, const TrackSu
continue;
}
// skip values which are floats
if (std::find(floatSummaryTypes.begin(), floatSummaryTypes.end(), i) != floatSummaryTypes.end()) {
if (std::find(unusedSummaryTypes.begin(), unusedSummaryTypes.end(), i) != unusedSummaryTypes.end()) {
continue;
}
if (i >= Trk::numberOfStgcEtaHits && i <= Trk::numberOfMmHoles) {
continue;
}
// coverity[mixed_enums]
if (i == Trk::numberOfTRTHitsUsedFordEdx) {
continue;
}
int value = summary.get(static_cast<Trk::SummaryType>(i));
uint8_t uvalue = static_cast<uint8_t>(value);
......
......@@ -99,12 +99,6 @@ namespace Trk {
const Trk::PRDtoTrackMap*,
Trk::TrackSummary&) const {};
virtual void updateAdditionalInfo(Trk::TrackSummary&,
std::vector<float>&,
float&,
int&,
int&) const {};
/*
* Implement the ITrackSummaryHelperTool part
* of the interface for the methods with the same
......
......@@ -201,10 +201,6 @@ private:
const Trk::PRDtoTrackMap* pPrdToTrackMap,
bool suppress_hole_search) const;
void updateAdditionalInfo(const Track& track,
TrackSummary& summary,
bool initialise_to_zero) const;
/** use this method to update a track. this means a tracksummary is created
for this track but not returned. the summary can then be obtained from the
track. Because it is taken from the track the ownership stays with the track
......
......@@ -53,13 +53,6 @@ TrackSummaryTool::updateSharedHitCount(Track& track) const
}
}
inline void
TrackSummaryTool::updateAdditionalInfo(const Track& track,
TrackSummary& summary) const
{
updateAdditionalInfo(track, summary, false);
}
inline void
TrackSummaryTool::updateAdditionalInfo(Track& track) const
{
......@@ -69,8 +62,7 @@ TrackSummaryTool::updateAdditionalInfo(Track& track) const
} else {
updateAdditionalInfo(
track,
*track.trackSummary(),
true); // @TODO set to false; true for backward compatibility
*track.trackSummary());
}
}
inline void
......
......@@ -203,10 +203,6 @@ Trk::TrackSummaryTool::fillSummary(const EventContext& ctx,
std::vector<int>& information = ts.m_information;
information.resize(std::min(information.size(),
static_cast<size_t>(numberOfTrackSummaryTypes)));
std::vector<float> eProbability = Trk::eProbabilityDefault;
float dedx = -1;
int nHitsUsed_dEdx = -1;
int nOverflowHits_dEdx = -1;
constexpr int toZero{ 0 };
if (!m_idTool.empty()) {
......@@ -251,10 +247,6 @@ Trk::TrackSummaryTool::fillSummary(const EventContext& ctx,
setTheseElements(information, atSctOrTrtIndices, toZero);
}
ts.m_dedx = dedx;
ts.m_nhitsdedx = nHitsUsed_dEdx;
ts.m_nhitsoverflowdedx = nOverflowHits_dEdx;
if (m_doSharedHits) {
// Shared hits counters set to 0
information[numberOfSCTSharedHits] = 0;
......@@ -356,20 +348,12 @@ Trk::TrackSummaryTool::updateSharedHitCount(
*/
void
Trk::TrackSummaryTool::updateAdditionalInfo(const Track& track,
TrackSummary& summary,
bool initialiseToZero) const
TrackSummary& summary) const
{
std::vector<float> eProbability = Trk::eProbabilityDefault;
const int initialValue(initialiseToZero ? 0 : -1);
float dedx = initialValue;
int nHitsUsed_dEdx = initialValue;
int nOverflowHits_dEdx = initialValue;
if (m_idTool) {
m_idTool->updateAdditionalInfo(
summary, eProbability, dedx, nHitsUsed_dEdx, nOverflowHits_dEdx);
m_idTool->updateExpectedHitInfo(track, summary);
} else {
ATH_MSG_INFO(
ATH_MSG_DEBUG(
"No updates attempted, as the SummaryHelperTool is not defined.");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment