Skip to content
Snippets Groups Projects

WIP: Modernize the Trk::TrackSummary class

1 unresolved thread
7 files
+ 405
199
Compare changes
  • Side-by-side
  • Inline
Files
7
@@ -371,15 +371,15 @@ void InDet::InDetTrackSummaryHelperTool::updateSharedHitCount(const Trk::Track &
const Trk::PRDtoTrackMap *prd_to_track_map,
Trk::TrackSummary& summary) const {
// loop over track states on surface and take pixel / sct to update the shared hit count
summary.m_information[Trk::numberOfPixelSharedHits] = 0;
summary.m_information[Trk::numberOfInnermostPixelLayerSharedHits] = 0;
summary.m_information[Trk::numberOfNextToInnermostPixelLayerSharedHits] = 0;
summary.m_information[Trk::numberOfSCTSharedHits] = 0;
summary.m_information[Trk::numberOfTRTSharedHits] = 0;
summary.set(Trk::numberOfPixelSharedHits, 0);
summary.set(Trk::numberOfInnermostPixelLayerSharedHits, 0);
summary.set(Trk::numberOfNextToInnermostPixelLayerSharedHits, 0);
summary.set(Trk::numberOfSCTSharedHits, 0);
summary.set(Trk::numberOfTRTSharedHits, 0);
if ( m_runningTIDE_Ambi ) {
summary.m_information[Trk::numberOfPixelSplitHits] = 0;
summary.m_information[Trk::numberOfInnermostLayerSplitHits] = 0;
summary.m_information[Trk::numberOfNextToInnermostLayerSplitHits] = 0;
summary.set(Trk::numberOfPixelSplitHits, 0);
summary.set(Trk::numberOfInnermostLayerSplitHits, 0);
summary.set(Trk::numberOfNextToInnermostLayerSplitHits, 0);
}
const DataVector<const Trk::MeasurementBase>* measurements = track.measurementsOnTrack();
@@ -403,10 +403,10 @@ void InDet::InDetTrackSummaryHelperTool::updateSharedHitCount(const Trk::Track &
if (pix) {
const InDet::PixelCluster* pixPrd = pix->prepRawData();
if (pixPrd and pixPrd->isSplit()) {
summary.m_information[Trk::numberOfPixelSplitHits]++;
summary.increment(Trk::numberOfPixelSplitHits);
hitIsSplit=true;
if ( m_pixelId->is_barrel(id) and m_pixelId->layer_disk(id)==0) summary.m_information[Trk::numberOfInnermostLayerSplitHits]++;
if ( m_pixelId->is_barrel(id) and m_pixelId->layer_disk(id)==1) summary.m_information[Trk::numberOfNextToInnermostLayerSplitHits]++;
if ( m_pixelId->is_barrel(id) and m_pixelId->layer_disk(id)==0) summary.increment(Trk::numberOfInnermostLayerSplitHits);
if ( m_pixelId->is_barrel(id) and m_pixelId->layer_disk(id)==1) summary.increment(Trk::numberOfNextToInnermostLayerSplitHits);
}
}
}
@@ -414,13 +414,13 @@ void InDet::InDetTrackSummaryHelperTool::updateSharedHitCount(const Trk::Track &
if ( not (m_runningTIDE_Ambi and hitIsSplit) ){
if (isShared(prd_to_track_map, m_assoTool, *(rot->prepRawData()))) {
ATH_MSG_DEBUG("shared Pixel hit found");
summary.m_information[Trk::numberOfPixelSharedHits]++;
summary.increment(Trk::numberOfPixelSharedHits);
if ( (m_pixelId->is_barrel(id) and m_pixelId->layer_disk(id)==0) ) {
ATH_MSG_DEBUG("--> shared Pixel hit is in Innermost Pixel layer");
summary.m_information[Trk::numberOfInnermostPixelLayerSharedHits]++;
summary.increment(Trk::numberOfInnermostPixelLayerSharedHits);
} else if ( (m_pixelId->is_barrel(id) and m_pixelId->layer_disk(id)==1) ) {
ATH_MSG_DEBUG("--> shared Pixel hit is in Next To Innermost Pixel layer");
summary.m_information[Trk::numberOfNextToInnermostPixelLayerSharedHits]++;
summary.increment(Trk::numberOfNextToInnermostPixelLayerSharedHits);
}
}
}
@@ -428,14 +428,14 @@ void InDet::InDetTrackSummaryHelperTool::updateSharedHitCount(const Trk::Track &
// used in more than one track ?
if ( isShared(prd_to_track_map, m_assoTool, *(rot->prepRawData())) ) {
ATH_MSG_DEBUG("shared SCT hit found");
summary.m_information[Trk::numberOfSCTSharedHits]++;
summary.increment(Trk::numberOfSCTSharedHits);
}
}
if (m_doSharedHitsTRT and m_useTRT and m_trtId->is_trt(id)) {
// used in more than one track ?
if ( isShared(prd_to_track_map, m_assoTool, *(rot->prepRawData())) ) {
ATH_MSG_DEBUG("shared TRT hit found");
summary.m_information[Trk::numberOfTRTSharedHits]++;
summary.increment(Trk::numberOfTRTSharedHits);
}
}
}
@@ -448,35 +448,35 @@ void InDet::InDetTrackSummaryHelperTool::updateExpectedHitInfo(const Trk::Track
if (m_usePixel and not m_testBLayerTool.empty() ) {
if ( summary.m_information[Trk::numberOfContribPixelLayers] == 0 ) {
if ( summary.get(Trk::numberOfContribPixelLayers) == 0 ) {
ATH_MSG_DEBUG("No pxiels on track, so wo do not expect a B-Layer hit !");
summary.m_information[Trk::expectInnermostPixelLayerHit] = 0;
summary.m_information[Trk::expectNextToInnermostPixelLayerHit] = 0;
summary.set(Trk::expectInnermostPixelLayerHit, 0);
summary.set(Trk::expectNextToInnermostPixelLayerHit, 0);
} else{
//innermost layer block
if (summary.m_information[Trk::numberOfInnermostPixelLayerHits] > 0){
if (summary.get(Trk::numberOfInnermostPixelLayerHits) > 0){
ATH_MSG_DEBUG("Innermost pixel Layer hit on track, so we expect a innermost pixel layer hit !");
summary.m_information[Trk::expectInnermostPixelLayerHit] = 1;
summary.set(Trk::expectInnermostPixelLayerHit, 1);
} else {
if (m_testBLayerTool->expectHitInInnermostPixelLayer(&track) ) {
ATH_MSG_DEBUG("expect Pixel Layer 0 hit !");
summary.m_information[Trk::expectInnermostPixelLayerHit] = 1;
summary.set(Trk::expectInnermostPixelLayerHit, 1);
} else {
ATH_MSG_DEBUG("do not expect Pixel Layer 0 hit !");
summary.m_information[Trk::expectInnermostPixelLayerHit] = 0;
summary.set(Trk::expectInnermostPixelLayerHit, 0);
}
}
//next to innermost block
if (summary.m_information[Trk::numberOfNextToInnermostPixelLayerHits] > 0){
summary.m_information[Trk::expectNextToInnermostPixelLayerHit] = 1;
if (summary.get(Trk::numberOfNextToInnermostPixelLayerHits) > 0){
summary.set(Trk::expectNextToInnermostPixelLayerHit, 1);
} else {
if (m_testBLayerTool->expectHitInNextToInnermostPixelLayer(&track) ) {
ATH_MSG_DEBUG("expect Pixel Layer 1 hit !");
summary.m_information[Trk::expectNextToInnermostPixelLayerHit] = 1;
summary.set(Trk::expectNextToInnermostPixelLayerHit, 1);
} else {
ATH_MSG_DEBUG("do not expect Pixel Layer 1 hit !");
summary.m_information[Trk::expectNextToInnermostPixelLayerHit] = 0;
summary.set(Trk::expectNextToInnermostPixelLayerHit, 0);
}
}
}
@@ -488,7 +488,7 @@ void InDet::InDetTrackSummaryHelperTool::updateExpectedHitInfo(const Trk::Track
void InDet::InDetTrackSummaryHelperTool::updateAdditionalInfo(Trk::TrackSummary& summary, std::vector<float>& eprob,
float& dedx, int& nclus, int& noverflowclus) const {
summary.m_eProbability = eprob;
summary.setElectronProbabilities(eprob);
summary.m_dedx = dedx;
summary.m_nhitsdedx = nclus;
summary.m_nhitsoverflowdedx = noverflowclus;
@@ -506,7 +506,6 @@ void InDet::InDetTrackSummaryHelperTool::addDetailedTrackSummary(const Trk::Tra
return;
}
ATH_MSG_DEBUG("Adding detailed indet track summary");
delete summary.m_indetTrackSummary;
Trk::InDetTrackSummary* indetTrackSummary = new Trk::InDetTrackSummary();
Trk::InDetTrackSummary& trackSummary = *indetTrackSummary;
if (m_usePixel and not m_pixeldedxtool.empty() and (track.perigeeParameters() or not track.trackParameters()->empty())) {
@@ -520,7 +519,7 @@ void InDet::InDetTrackSummaryHelperTool::addDetailedTrackSummary(const Trk::Tra
trackSummary.m_massdedx = m_pixeldedxtool->getMass(dedx, p, ngoodhits);
}
}
summary.m_indetTrackSummary = indetTrackSummary;
summary.m_indetTrackSummary.reset(indetTrackSummary);
}
// ====================================================================================================================
Loading