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

Better protection for float types in track summary and fix an issue with number of TRT dEdx hits

parent 329b1c9a
......@@ -132,6 +132,10 @@ enum SummaryType {
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};
// Troels.Petersen@cern.ch:
enum eProbabilityType {
eProbabilityComb = 0, //!< Electron probability from combining the below probabilities.
......
......@@ -1067,9 +1067,8 @@ TrackParticleCreatorTool::TrackParticleCreatorTool(const std::string& t, const s
if ( i >= Trk::numberOfMdtHits && i <= Trk::numberOfRpcEtaHits ) continue;
if ( i == Trk::numberOfCscUnspoiltEtaHits ) continue;
if ( i >= Trk::numberOfCscEtaHoles && i <= Trk::numberOfTgcPhiHoles ) continue;
if ( i >= offset && i < offset+Trk::numberOfeProbabilityTypes+1){
continue;
}
// skip values which are floats
if ( std::find(floatSummaryTypes.begin(), floatSummaryTypes.end(), i) != floatSummaryTypes.end() ) continue;
if ( i >= Trk::numberOfStgcEtaHits && i <= Trk::numberOfMmHoles) continue;
// coverity[mixed_enums]
if (i == Trk::numberOfTRTHitsUsedFordEdx ) continue;
......
......@@ -233,9 +233,9 @@ std::vector<float> eProbability = ITRT_ElectronPidTool::defaultElectronProbabili
information[numberOfTRTTubeHits] = 0;
information[numberOfTRTSharedHits] = 0;
// Troels.Petersen@cern.ch:
if (!m_eProbabilityTool.empty()) {
eProbability = m_eProbabilityTool->electronProbability(track);
information[Trk::numberOfTRTHitsUsedFordEdx] = static_cast<int>(eProbability[Trk::eProbabilityNumberOfTRTHitsUsedFordEdx]);
}
}
......@@ -313,7 +313,6 @@ std::vector<float> eProbability = ITRT_ElectronPidTool::defaultElectronProbabili
searchHolesStepWise(track,information, doHolesInDet, doHolesMuon);
}
information[Trk::numberOfTRTHitsUsedFordEdx] = eProbability[Trk::eProbabilityNumberOfTRTHitsUsedFordEdx];
ts.m_eProbability = eProbability;
ts.m_idHitPattern = hitPattern.to_ulong();
ts.m_dedx = dedx;
......
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