ATLAS Offline Software
TrackSummaryModule.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include <format>
7 using namespace MuonR4;
8 using namespace Muon::MuonStationIndex;
9 
10 namespace MuonValR4{
11 
14  inline std::string nameBr(Category cat, Status status,
15  LayerIndex layer, bool isSmall) {
16  std::string lName = layerName(layer);
17  lName[0] = std::tolower(lName[0]);
18  return std::format("{:}{:}{:}{:}",
19  lName, (isSmall ? "Small" :"Large"),
21  (status == Status::OnTrack ? std::string{"Hits"}
22  : HitSummary::toString(status) +"s"));
23  }
24 
26  const std::string& collName,
27  Category cat, Status status,
28  LayerIndex layer, bool isSmall):
30  std::format("{:}_{:}",
31  collName, nameBr(cat, status, layer, isSmall))),
32  m_cat{cat}, m_status{status}, m_layer{layer}, m_isSmall{isSmall}{}
35  }
36 
37 
39  const std::string& collName,
40  const MuonR4::ITrackSummaryTool* summaryTool):
41  MuonTesterBranch{parent, " track summary " + collName},
42  m_summaryTool{summaryTool} {
43  for (const auto layer : {LayerIndex::Inner, LayerIndex::Middle,
44  LayerIndex::Outer, LayerIndex::Extended}) {
47  if ( (layer == LayerIndex::BarrelExtended || layer == LayerIndex::Extended) &&
48  (cat != Category::Precision)){
49  continue;
50  }
51  for (const auto status : {Status::OnTrack, Status::Outlier, Status::Hole}) {
52  for (const bool small : {false, true}) {
53  if (layer == LayerIndex::BarrelExtended && !small){
54  continue;
55  }
56  m_values.emplace_back(std::make_shared<TrackSummaryValueBranch>(parent.tree(), collName,
57  cat, status, layer,
58  small));
59  }
60  }
61  }
62  }
63  for (const auto& br : m_values){
64  parent.addBranch(br);
65  }
66  }
67  bool TrackSummaryModule::fill(const EventContext& /*ctx*/) {
68  return true;
69  }
71  return true;
72  }
73 
74  void TrackSummaryModule::push_back(const EventContext& ctx, const ConstTrack_t track) {
76  }
77  void TrackSummaryModule::push_back(const EventContext& ctx, const MsTrackSeed& seed) {
78  push_back(m_summaryTool->makeSummary(ctx, seed));
79  }
81  for(const auto& br : m_values){
82  br->push_back(summary);
83  }
84  }
85 }
MuonR4::ITrackSummaryTool
Interface tool to calculate the hit summary of tracks & track seeds in the MuonSpectrometer.
Definition: MuonSpectrometer/MuonPhaseII/MuonRecToolInterfacesR4/MuonRecToolInterfacesR4/ITrackSummaryTool.h:24
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition: MuonStationIndex.h:38
MuonR4::HitSummary::HitCategory::TriggerPhi
@ TriggerPhi
Trigger eta hits (Tgc, Rpc)
MuonValR4::TrackSummaryModule::m_values
std::vector< ValuePtr_t > m_values
Definition: TrackSummaryModule.h:66
MuonValR4::TrackSummaryValueBranch::m_cat
Category m_cat
Definition: TrackSummaryModule.h:39
Muon::MuonStationIndex::LayerIndex::Outer
@ Outer
MuonValR4::TrackSummaryValueBranch::push_back
void push_back(const MuonR4::HitSummary &summary)
push back the assigned hit summary value
Definition: TrackSummaryModule.cxx:33
vtune_athena.format
format
Definition: vtune_athena.py:14
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:553
Muon::MuonStationIndex
Definition: MuonStationIndex.h:13
MuonR4::MsTrackSeed
Definition: MsTrackSeed.h:18
MuonVal::MuonTesterBranch
Definition: MuonTesterBranch.h:21
MuonR4::HitSummary::HitCategory::Precision
@ Precision
tree
TChain * tree
Definition: tile_monitor.h:30
Muon::MuonStationIndex::LayerIndex::Inner
@ Inner
MuonValR4::TrackSummaryModule::fill
bool fill(const EventContext &ctx) override
Clears vector in cases that it has not been updated in this event Returns false if the vector has not...
Definition: TrackSummaryModule.cxx:67
MuonVal::VectorBranch
Definition: VectorBranch.h:14
MuonValR4::TrackSummaryModule::ConstTrack_t
MuonR4::ITrackSummaryTool::ConstTrack_t ConstTrack_t
Definition: TrackSummaryModule.h:57
MuonValR4::nameBr
std::string nameBr(Category cat, Status status, LayerIndex layer, bool isSmall)
Definition: TrackSummaryModule.cxx:14
TrackSummaryModule.h
MuonValR4::TrackSummaryModule::init
bool init() override
Initialized the Branch.
Definition: TrackSummaryModule.cxx:70
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonR4::HitSummary::Status::OnTrack
@ OnTrack
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
tolower
void tolower(std::string &s)
Definition: AthenaSummarySvc.cxx:108
MuonValR4::TrackSummaryModule::TrackSummaryModule
TrackSummaryModule(MuonVal::MuonTesterTree &parent, const std::string &collName, const MuonR4::ITrackSummaryTool *summaryTool)
Constructor.
Definition: TrackSummaryModule.cxx:38
test_pyathena.parent
parent
Definition: test_pyathena.py:15
MuonR4::HitSummary::HitCategory
HitCategory
Category of the hit.
Definition: HitSummary.h:28
MuonValR4::TrackSummaryModule::m_summaryTool
const MuonR4::ITrackSummaryTool * m_summaryTool
Definition: TrackSummaryModule.h:67
MuonR4::ITrackSummaryTool::makeSummary
virtual HitSummary makeSummary(const EventContext &ctx, const ConstTrack_t trackProxy) const =0
Creates a summary from the passed track.
MuonR4::HitSummary::toString
static std::string toString(const HitCategory c)
Converts the hit category to a string.
Definition: HitSummary.cxx:16
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition: IPatternVisualizationTool.h:23
MuonR4::HitSummary::Status::Hole
@ Hole
Added to the trajectory but rejected.
MuonValR4::TrackSummaryValueBranch::m_layer
LayerIndex m_layer
Definition: TrackSummaryModule.h:41
Muon::MuonStationIndex::layerName
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
Definition: MuonStationIndex.cxx:153
MuonR4
This header ties the generic definitions in this package.
Definition: HoughEventData.h:16
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition: MuonTesterBranch.cxx:38
Muon::MuonStationIndex::LayerIndex::Middle
@ Middle
MuonR4::HitSummary::Status::Outlier
@ Outlier
Added to the trajectory & contributing to the fit.
MuonR4::HitSummary::Status
Status
Contribution to the track fit.
Definition: HitSummary.h:35
MuonR4::HitSummary
Summary struct to hold the hit counts on the track per MS layer.
Definition: HitSummary.h:21
merge.status
status
Definition: merge.py:16
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
MuonValR4::TrackSummaryModule::push_back
void push_back(const EventContext &ctx, const ConstTrack_t track)
Definition: TrackSummaryModule.cxx:74
MuonValR4::TrackSummaryValueBranch::TrackSummaryValueBranch
TrackSummaryValueBranch(TTree *tree, const std::string &collName, Category cat, Status status, LayerIndex layer, bool isSmall)
Constructor taking the reference to the tree & the summary values together with an overall collection...
Definition: TrackSummaryModule.cxx:25
MuonR4::HitSummary::HitCategory::TriggerEta
@ TriggerEta
Precision hits (Mdt, NSW) on track.
MuonValR4::TrackSummaryValueBranch::m_status
Status m_status
Definition: TrackSummaryModule.h:40
Muon::MuonStationIndex::isSmall
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
MuonValR4::TrackSummaryValueBranch::m_isSmall
bool m_isSmall
Definition: TrackSummaryModule.h:42
PlotCalibFromCool.br
br
Definition: PlotCalibFromCool.py:355
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65