ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonValidation
MuonPRDTestR4
Root
TrackSummaryModule.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
MuonPRDTestR4/TrackSummaryModule.h
"
5
6
#include "
MuonTrackEvent/MsTrackSeed.h
"
7
8
#include <format>
9
using namespace
MuonR4
;
10
using namespace
Muon::MuonStationIndex
;
11
12
namespace
MuonValR4
{
13
14
using
Category
=
MuonR4::HitSummary::HitCategory
;
15
using
Status
=
MuonR4::HitSummary::Status
;
16
inline
std::string
nameBr
(
Category
cat,
Status
status,
17
LayerIndex
layer,
bool
isSmall
) {
18
std::string lName =
layerName
(layer);
19
lName[0] = std::tolower(lName[0]);
20
return
std::format(
"{:}{:}{:}{:}"
,
21
lName, (
isSmall
?
"Small"
:
"Large"
), cat,
22
(status == Status::OnTrack ? std::string{
"Hits"
}
23
:
HitSummary::toString
(status) +
"s"
));
24
}
25
26
TrackSummaryValueBranch::TrackSummaryValueBranch
(TTree*
tree
,
27
const
std::string& collName,
28
Category
cat,
Status
status,
29
LayerIndex
layer,
bool
isSmall
):
30
VectorBranch
<
std
::uint8_t>(
tree
,
31
std
::format(
"{:}_{:}"
,
32
collName,
nameBr
(cat, status, layer,
isSmall
))),
33
m_cat
{cat},
m_status
{status},
m_layer
{layer},
m_isSmall
{
isSmall
}{}
34
void
TrackSummaryValueBranch::push_back
(
const
MuonR4::HitSummary
& summary){
35
push_back
(summary.value(
m_cat
,
m_status
,
m_layer
,
m_isSmall
));
36
}
37
38
39
TrackSummaryModule::TrackSummaryModule
(
MuonVal::MuonTesterTree
&
parent
,
40
const
std::string& collName,
41
const
MuonR4::ITrackSummaryTool
* summaryTool):
42
MuonTesterBranch
{
parent
,
" track summary "
+ collName},
43
m_summaryTool
{summaryTool} {
44
for
(
const
auto
layer : {
LayerIndex::Inner
,
LayerIndex::Middle
,
45
LayerIndex::Outer
,
LayerIndex::Extended
}) {
46
for
(
const
auto
cat : {Category::Precision, Category::TriggerEta, Category::TriggerPhi}){
48
if
( (layer ==
LayerIndex::BarrelExtended
|| layer ==
LayerIndex::Extended
) &&
49
(cat != Category::Precision)){
50
continue
;
51
}
52
for
(
const
auto
status : {Status::OnTrack, Status::Outlier, Status::Hole}) {
53
for
(
const
bool
small : {
false
,
true
}) {
54
if
(layer ==
LayerIndex::BarrelExtended
&& !small){
55
continue
;
56
}
57
m_values
.emplace_back(std::make_shared<TrackSummaryValueBranch>(
parent
.tree(), collName,
58
cat, status, layer,
59
small));
60
}
61
}
62
}
63
}
64
for
(
const
auto
& br :
m_values
){
65
parent
.addBranch(br);
66
}
67
}
68
bool
TrackSummaryModule::fill
(
const
EventContext&
/*ctx*/
) {
69
return
true
;
70
}
71
bool
TrackSummaryModule::init
() {
72
return
true
;
73
}
74
75
void
TrackSummaryModule::push_back
(
const
EventContext& ctx,
const
ConstTrack_t
track) {
76
push_back
(
m_summaryTool
->makeSummary(ctx, track));
77
}
78
void
TrackSummaryModule::push_back
(
const
EventContext& ctx,
const
MsTrackSeed
& seed) {
79
push_back
(
m_summaryTool
->makeSummary(ctx, seed.segments()));
80
}
81
void
TrackSummaryModule::push_back
(
const
HitSummary
& summary) {
82
for
(
const
auto
& br :
m_values
){
83
br->push_back(summary);
84
}
85
}
86
}
MsTrackSeed.h
TrackSummaryModule.h
MuonR4::ITrackSummaryTool
Interface tool to calculate the hit summary of tracks & track seeds in the MuonSpectrometer.
Definition
MuonSpectrometer/MuonPhaseII/MuonRecToolInterfacesR4/MuonRecToolInterfacesR4/ITrackSummaryTool.h:31
MuonR4::MsTrackSeed
Definition
MsTrackSeed.h:22
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:68
MuonValR4::TrackSummaryModule::m_values
std::vector< ValuePtr_t > m_values
Definition
TrackSummaryModule.h:66
MuonValR4::TrackSummaryModule::push_back
void push_back(const EventContext &ctx, const ConstTrack_t track)
Definition
TrackSummaryModule.cxx:75
MuonValR4::TrackSummaryModule::TrackSummaryModule
TrackSummaryModule(MuonVal::MuonTesterTree &parent, const std::string &collName, const MuonR4::ITrackSummaryTool *summaryTool)
Constructor.
Definition
TrackSummaryModule.cxx:39
MuonValR4::TrackSummaryModule::ConstTrack_t
MuonR4::ITrackSummaryTool::ConstTrack_t ConstTrack_t
Definition
TrackSummaryModule.h:57
MuonValR4::TrackSummaryModule::init
bool init() override
Initialized the Branch.
Definition
TrackSummaryModule.cxx:71
MuonValR4::TrackSummaryModule::m_summaryTool
const MuonR4::ITrackSummaryTool * m_summaryTool
Definition
TrackSummaryModule.h:67
MuonValR4::TrackSummaryValueBranch::Category
MuonR4::HitSummary::HitCategory Category
Definition
TrackSummaryModule.h:18
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:26
MuonValR4::TrackSummaryValueBranch::m_isSmall
bool m_isSmall
Definition
TrackSummaryModule.h:42
MuonValR4::TrackSummaryValueBranch::LayerIndex
MuonR4::HitSummary::LayerIndex LayerIndex
Definition
TrackSummaryModule.h:20
MuonValR4::TrackSummaryValueBranch::m_layer
LayerIndex m_layer
Definition
TrackSummaryModule.h:41
MuonValR4::TrackSummaryValueBranch::m_cat
Category m_cat
Definition
TrackSummaryModule.h:39
MuonValR4::TrackSummaryValueBranch::m_status
Status m_status
Definition
TrackSummaryModule.h:40
MuonValR4::TrackSummaryValueBranch::Status
MuonR4::HitSummary::Status Status
Definition
TrackSummaryModule.h:19
MuonValR4::TrackSummaryValueBranch::push_back
void push_back(const MuonR4::HitSummary &summary)
push back the assigned hit summary value
Definition
TrackSummaryModule.cxx:34
MuonVal::MuonTesterBranch::MuonTesterBranch
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Definition
MuonTesterBranch.cxx:33
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition
MuonTesterBranch.cxx:38
MuonVal::VectorBranch< std::uint8_t >::tree
TTree * tree() override final
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
MuonVal::VectorBranch< std::uint8_t >::VectorBranch
VectorBranch(TTree *tree, const std::string &name)
MuonR4
This header ties the generic definitions in this package.
Definition
GlobalPattern.h:14
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition
SpacePointWriter.cxx:32
MuonValR4::nameBr
std::string nameBr(Category cat, Status status, LayerIndex layer, bool isSmall)
Definition
TrackSummaryModule.cxx:16
MuonValR4::Category
MuonR4::HitSummary::HitCategory Category
Definition
TrackSummaryModule.cxx:14
MuonValR4::Status
MuonR4::HitSummary::Status Status
Definition
TrackSummaryModule.cxx:15
Muon::MuonStationIndex
Definition
MuonStationIndex.h:14
Muon::MuonStationIndex::layerName
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
Definition
MuonStationIndex.cxx:154
Muon::MuonStationIndex::isSmall
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:39
Muon::MuonStationIndex::LayerIndex::BarrelExtended
@ BarrelExtended
EE.
Definition
MuonStationIndex.h:43
Muon::MuonStationIndex::LayerIndex::Inner
@ Inner
Definition
MuonStationIndex.h:41
Muon::MuonStationIndex::LayerIndex::Middle
@ Middle
Definition
MuonStationIndex.h:41
Muon::MuonStationIndex::LayerIndex::Outer
@ Outer
Definition
MuonStationIndex.h:41
Muon::MuonStationIndex::LayerIndex::Extended
@ Extended
Definition
MuonStationIndex.h:42
std
STL namespace.
MuonR4::HitSummary
Summary struct to hold the hit counts on the track per MS layer.
Definition
HitSummary.h:23
MuonR4::HitSummary::toString
static std::string toString(const HitCategory c)
Converts the hit category to a string.
Definition
HitSummary.cxx:16
MuonR4::HitSummary::HitCategory
HitCategory
Category of the hit.
Definition
HitSummary.h:30
MuonR4::HitSummary::Status
Status
Contribution to the track fit.
Definition
HitSummary.h:39
Generated on
for ATLAS Offline Software by
1.17.0