Skip to content
Snippets Groups Projects
Commit dbdb6a61 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'master-clean-MatProviderTool' into 'master'

Change a loop in TrkMaterialProviderToolto be a bit more conventional.

See merge request atlas/athena!39251
parents da5b7ade 4237a180
No related branches found
No related tags found
No related merge requests found
...@@ -405,63 +405,44 @@ void Trk::TrkMaterialProviderTool::getCaloMEOT(const Trk::Track& idTrack, const ...@@ -405,63 +405,44 @@ void Trk::TrkMaterialProviderTool::getCaloMEOT(const Trk::Track& idTrack, const
#endif #endif
// find last ID TSOS // find last ID TSOS
DataVector<const Trk::TrackStateOnSurface>::const_iterator lastIDwP = inputTSOS_ID->end(); DataVector<const Trk::TrackStateOnSurface>::const_reverse_iterator lastIDwP = inputTSOS_ID->rbegin();
DataVector<const Trk::TrackStateOnSurface>::const_iterator it = inputTSOS_ID->end()-1; for (auto it = inputTSOS_ID->rbegin(); it != inputTSOS_ID->rend(); ++it) {
DataVector<const Trk::TrackStateOnSurface>::const_iterator itFront = inputTSOS_ID->begin();
while(*it) {
if(this->getVolumeByGeo(*it)==1 && (*it)->trackParameters()) { if(this->getVolumeByGeo(*it)==1 && (*it)->trackParameters()) {
lastIDwP = it; lastIDwP = it;
break; break;
} }
if(it==itFront) break;
--it;
} }
// find first MS TSOS // find first MS TSOS
DataVector<const Trk::TrackStateOnSurface>::const_iterator firstMS = inputTSOS_MS->end(); DataVector<const Trk::TrackStateOnSurface>::const_iterator firstMS = inputTSOS_MS->end();
DataVector<const Trk::TrackStateOnSurface>::const_iterator firstMSwP = inputTSOS_MS->end(); DataVector<const Trk::TrackStateOnSurface>::const_iterator firstMSwP = inputTSOS_MS->end();
it = inputTSOS_MS->begin();
DataVector<const Trk::TrackStateOnSurface>::const_iterator itEnd = inputTSOS_MS->end(); DataVector<const Trk::TrackStateOnSurface>::const_iterator itEnd = inputTSOS_MS->end();
for(; it!=itEnd; ++it) { for(auto it = inputTSOS_MS->begin(); it!=itEnd ; ++it) {
if(this->getVolumeByGeo(*it)==3) {// && !(*it)->type(Trk::TrackStateOnSurface::Perigee)) { if(this->getVolumeByGeo(*it)==3) {// && !(*it)->type(Trk::TrackStateOnSurface::Perigee)) {
if(firstMS==itEnd) if(firstMS==itEnd)
firstMS = it; firstMS = it;
if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) { if((*it)->trackParameters() && (*it)->trackParameters()->covariance()) {
firstMSwP = it; firstMSwP = it;
break; break;
} }
} }
} }
if(lastIDwP == inputTSOS_ID->end()) { if(lastIDwP == inputTSOS_ID->rbegin()) {
ATH_MSG_WARNING("Unable to find last ID TSOS with Track Parameters"); ATH_MSG_WARNING("Unable to find last ID TSOS with Track Parameters");
ATH_MSG_WARNING("Unable to update Calorimeter TSOS"); ATH_MSG_WARNING("Unable to update Calorimeter TSOS");
/** deprecated outputLevel()
if(outputLevel() >= MSG::VERBOSE) {
for(auto m : *inputTSOS_ID)
printTSOS(m, "DEBUG-ID-TSOS");
}
**/
return; return;
} }
if(firstMS == inputTSOS_MS->end()) { if(firstMS == inputTSOS_MS->end()) {
ATH_MSG_WARNING("Unable to find first MS TSOS"); ATH_MSG_WARNING("Unable to find first MS TSOS");
ATH_MSG_WARNING("Unable to update Calorimeter TSOS"); ATH_MSG_WARNING("Unable to update Calorimeter TSOS");
/** deprecated outputLevel()
if(outputLevel() >= MSG::VERBOSE) {
for(auto m : *inputTSOS_MS)
printTSOS(m, "DEBUG-MS-TSOS");
}
**/
return; return;
} }
// check that first MS TSOS is not a PerigeeSurface // check that first MS TSOS is not a PerigeeSurface
//bool removeOoC = false;
DataVector<const Trk::TrackStateOnSurface>::const_iterator firstMSnotPerigee = firstMS; DataVector<const Trk::TrackStateOnSurface>::const_iterator firstMSnotPerigee = firstMS;
if( (*firstMS)->type(Trk::TrackStateOnSurface::Perigee) && (firstMS+1)!=inputTSOS_MS->end()) { if( (*firstMS)->type(Trk::TrackStateOnSurface::Perigee) && (firstMS+1)!=inputTSOS_MS->end()) {
firstMSnotPerigee=firstMS+1; firstMSnotPerigee=firstMS+1;
//removeOoC = true;
} }
#ifdef DEBUGON #ifdef DEBUGON
......
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