ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonReconstruction
MuonTrackMakers
MuonTrackMakerTools
MuonTrackSteeringTools
src
MuonTrackSteeringStrategy.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUON_MUONTRACKSTEERINGSTRATEGY_H
6
#define MUON_MUONTRACKSTEERINGSTRATEGY_H
7
8
#include <bitset>
9
#include <iostream>
10
#include <string>
11
#include <vector>
12
13
#include "GaudiKernel/MsgStream.h"
14
#include "
MuonStationIndex/MuonStationIndex.h
"
15
16
namespace
Muon
{
17
class
MuonTrackSteeringStrategy
{
18
public
:
19
enum
Option
{
20
CutSeedsOnTracks
= 0x0,
21
CombineSegInStation
= 0x1,
22
DynamicSeeding
= 0x2,
23
PreferOutsideIn
= 0x3,
24
AllowOneSharedHit
= 0x4,
25
DoRefinement
= 0x5,
26
DoAmbiSolving
= 0x6,
27
BarrelEndcapFilter
= 0x7,
28
Last
= 0x8
29
};
30
31
MuonTrackSteeringStrategy
(
const
std::string & name,
const
std::bitset<Last> & bits,
32
std::vector<std::vector<MuonStationIndex::ChIndex> >& path, std::vector<unsigned int>& seedOrder) :
33
m_name
(name),
m_bits
(bits),
m_path
(path),
m_seeds
(seedOrder) {}
34
36
MuonTrackSteeringStrategy
(
const
std::string & name, std::vector<std::string> & options,
37
std::vector<std::vector<MuonStationIndex::ChIndex> >& path) :
38
m_name
(name),
m_path
(path) {
39
for
(
unsigned
int
i = 0; i <
Last
; ++i)
m_bits
.set(i, 0);
40
for
(
unsigned
int
i = 0; i < options.size(); ++i)
setOption
(options[i],
true
);
41
}
42
43
MuonTrackSteeringStrategy
(
const
std::string & name, std::vector<std::string> & options,
44
std::vector<std::vector<MuonStationIndex::ChIndex> >& path, std::vector<unsigned int>& seedOrder) :
45
m_name
(name),
m_path
(path),
m_seeds
(seedOrder) {
46
for
(
unsigned
int
i = 0; i <
Last
; ++i)
m_bits
.set(i, 0);
47
for
(
unsigned
int
i = 0; i < options.size(); ++i)
setOption
(options[i],
true
);
48
}
49
50
void
setOption
(Option,
bool
value);
51
void
setOption
(
const
std::string&,
bool
value);
52
bool
option
(Option)
const
;
53
const
std::bitset<Last>&
allOptions
()
const
{
return
m_bits
; }
54
55
// Set methods
56
void
setCh
(
const
std::vector<MuonStationIndex::ChIndex>& val,
const
unsigned
int
layer);
57
void
setCh
(
const
std::vector<std::vector<MuonStationIndex::ChIndex> >& val) {
m_path
= val; }
58
59
// Get methods
60
const
std::vector<std::vector<MuonStationIndex::ChIndex> >&
getAll
()
const
{
return
m_path
; }
61
const
std::vector<MuonStationIndex::ChIndex>&
getCh
(
const
unsigned
int
)
const
;
62
63
// for the name
64
const
std::string&
getName
()
const
{
return
m_name
; }
65
void
setName
(
const
std::string& name) {
m_name
= name; }
66
67
const
std::vector<unsigned int>&
seeds
()
const
{
return
m_seeds
; }
68
void
setSeeds
(
const
std::vector<unsigned int>& val) {
m_seeds
= val; }
69
70
private
:
71
std::string
m_name
;
72
std::bitset<Last>
m_bits
;
73
std::vector<std::vector<MuonStationIndex::ChIndex> >
m_path
;
74
std::vector<unsigned int>
m_seeds
;
75
};
76
}
// namespace Muon
77
78
inline
void
Muon::MuonTrackSteeringStrategy::setOption
(
const
std::string& opt,
bool
value) {
79
if
(opt ==
"CutSeedsOnTracks"
)
80
setOption
(
CutSeedsOnTracks
, value);
81
else
if
(opt ==
"CombineSegInStation"
)
82
setOption
(
CombineSegInStation
, value);
83
else
if
(opt ==
"DynamicSeeding"
)
84
setOption
(
DynamicSeeding
, value);
85
else
if
(opt ==
"PreferOutsideIn"
)
86
setOption
(
PreferOutsideIn
, value);
87
else
if
(opt ==
"AllowOneSharedHit"
)
88
setOption
(
AllowOneSharedHit
, value);
89
else
if
(opt ==
"DoRefinement"
)
90
setOption
(
DoRefinement
, value);
91
else
if
(opt ==
"DoAmbiSolving"
)
92
setOption
(
DoAmbiSolving
, value);
93
else
if
(opt ==
"BarrelEndcapFilter"
)
94
setOption
(
BarrelEndcapFilter
, value);
95
else
{
96
// Attempt to interpret the string as a seed sequence
97
std::vector<unsigned int>
seeds
;
98
bool
success =
true
;
99
for
(
unsigned
int
i = 0; i < opt.size() && success; ++i) {
100
int
holder = int(opt[i]) - 48;
101
if
(holder < 0 || holder > 9)
102
success =
false
;
103
else
104
seeds
.push_back(holder);
105
}
106
if
(success)
setSeeds
(
seeds
);
107
}
108
}
109
110
inline
void
Muon::MuonTrackSteeringStrategy::setOption
(
const
Option
opt,
bool
value) {
111
if
(opt ==
Last
)
return
;
112
m_bits
[opt] = value;
113
}
114
115
inline
void
Muon::MuonTrackSteeringStrategy::setCh
(
const
std::vector<MuonStationIndex::ChIndex>& val,
const
unsigned
int
layer) {
116
if
(layer <
m_path
.size())
117
m_path
[layer] = val;
118
else
{
// assume the user knows what he or she is doing
119
m_path
.resize(layer + 1);
120
m_path
[layer] = val;
121
}
122
}
123
124
inline
const
std::vector<Muon::MuonStationIndex::ChIndex>&
Muon::MuonTrackSteeringStrategy::getCh
(
const
unsigned
int
layer = 0)
const
{
125
if
(layer >=
m_path
.size()) {
126
throw
std::range_error(
"MuonTrackSteering a path beyond the possible paths is chosen"
);
127
}
128
return
m_path
[layer];
129
}
130
131
inline
bool
Muon::MuonTrackSteeringStrategy::option
(
Muon::MuonTrackSteeringStrategy::Option
op)
const
{
132
return
m_bits
[
static_cast<
unsigned
int
>
(op)];
133
}
134
135
inline
std::ostream&
operator<<
(std::ostream& sl,
const
Muon::MuonTrackSteeringStrategy
& mtss) {
136
sl <<
"MuonTrackSteeringStrategy "
<< mtss.
getName
() <<
" with options: "
<< mtss.
allOptions
() <<
" with seeds"
;
137
if
(mtss.
seeds
().size()) {
138
for
(
unsigned
int
i = 0; i < mtss.
seeds
().
size
(); ++i) { sl <<
" "
<< mtss.
seeds
()[i]; }
139
}
else
140
sl <<
" <none>"
;
141
sl <<
" and chambers are: "
<< std::endl;
142
for
(
unsigned
int
i = 0; i < mtss.
getAll
().
size
(); ++i) {
143
sl <<
"\t Step "
<< i <<
" : ( "
;
144
for
(
unsigned
int
j = 0; j < mtss.
getCh
(i).
size
() - 1; ++j) {
145
sl <<
Muon::MuonStationIndex::chName
(mtss.
getCh
(i)[j]) <<
" , "
;
146
}
147
if
(mtss.
getCh
(i).size()) {
148
sl <<
Muon::MuonStationIndex::chName
(mtss.
getCh
(i)[mtss.
getCh
(i).size() - 1]);
149
}
150
sl <<
" ) "
<< std::endl;
151
}
152
return
sl;
153
}
154
155
inline
MsgStream&
operator<<
(MsgStream& sl,
const
Muon::MuonTrackSteeringStrategy
& mtss) {
156
sl <<
"MuonTrackSteeringStrategy "
<< mtss.
getName
() <<
" with options: "
<< mtss.
allOptions
() <<
" with seeds"
;
157
if
(mtss.
seeds
().size()) {
158
for
(
unsigned
int
i = 0; i < mtss.
seeds
().
size
(); ++i) { sl <<
" "
<< mtss.
seeds
()[i]; }
159
}
else
160
sl <<
" <none>"
;
161
sl <<
" and chambers are: "
<< std::endl;
162
for
(
unsigned
int
i = 0; i < mtss.
getAll
().
size
(); ++i) {
163
sl <<
"\t Step "
<< i <<
" : ( "
;
164
for
(
unsigned
int
j = 0; j < mtss.
getCh
(i).
size
() - 1; ++j) {
165
sl <<
Muon::MuonStationIndex::chName
(mtss.
getCh
(i)[j]) <<
" , "
;
166
}
167
if
(mtss.
getCh
(i).size()) {
168
sl <<
Muon::MuonStationIndex::chName
(mtss.
getCh
(i)[mtss.
getCh
(i).size() - 1]);
169
}
170
sl <<
" ) "
<< std::endl;
171
}
172
return
sl;
173
}
174
175
#endif
MuonStationIndex.h
size
size_t size() const
Number of registered mappings.
Muon::MuonTrackSteeringStrategy
Definition
MuonTrackSteeringStrategy.h:17
Muon::MuonTrackSteeringStrategy::allOptions
const std::bitset< Last > & allOptions() const
Definition
MuonTrackSteeringStrategy.h:53
Muon::MuonTrackSteeringStrategy::setOption
void setOption(Option, bool value)
Definition
MuonTrackSteeringStrategy.h:110
Muon::MuonTrackSteeringStrategy::MuonTrackSteeringStrategy
MuonTrackSteeringStrategy(const std::string &name, std::vector< std::string > &options, std::vector< std::vector< MuonStationIndex::ChIndex > > &path, std::vector< unsigned int > &seedOrder)
Definition
MuonTrackSteeringStrategy.h:43
Muon::MuonTrackSteeringStrategy::Option
Option
Definition
MuonTrackSteeringStrategy.h:19
Muon::MuonTrackSteeringStrategy::AllowOneSharedHit
@ AllowOneSharedHit
Definition
MuonTrackSteeringStrategy.h:24
Muon::MuonTrackSteeringStrategy::DoAmbiSolving
@ DoAmbiSolving
Definition
MuonTrackSteeringStrategy.h:26
Muon::MuonTrackSteeringStrategy::DoRefinement
@ DoRefinement
Definition
MuonTrackSteeringStrategy.h:25
Muon::MuonTrackSteeringStrategy::CutSeedsOnTracks
@ CutSeedsOnTracks
Definition
MuonTrackSteeringStrategy.h:20
Muon::MuonTrackSteeringStrategy::DynamicSeeding
@ DynamicSeeding
Definition
MuonTrackSteeringStrategy.h:22
Muon::MuonTrackSteeringStrategy::BarrelEndcapFilter
@ BarrelEndcapFilter
Definition
MuonTrackSteeringStrategy.h:27
Muon::MuonTrackSteeringStrategy::PreferOutsideIn
@ PreferOutsideIn
Definition
MuonTrackSteeringStrategy.h:23
Muon::MuonTrackSteeringStrategy::Last
@ Last
Definition
MuonTrackSteeringStrategy.h:28
Muon::MuonTrackSteeringStrategy::CombineSegInStation
@ CombineSegInStation
Definition
MuonTrackSteeringStrategy.h:21
Muon::MuonTrackSteeringStrategy::m_seeds
std::vector< unsigned int > m_seeds
Definition
MuonTrackSteeringStrategy.h:74
Muon::MuonTrackSteeringStrategy::m_path
std::vector< std::vector< MuonStationIndex::ChIndex > > m_path
Definition
MuonTrackSteeringStrategy.h:73
Muon::MuonTrackSteeringStrategy::m_bits
std::bitset< Last > m_bits
List of all of the options available.
Definition
MuonTrackSteeringStrategy.h:72
Muon::MuonTrackSteeringStrategy::option
bool option(Option) const
Definition
MuonTrackSteeringStrategy.h:131
Muon::MuonTrackSteeringStrategy::MuonTrackSteeringStrategy
MuonTrackSteeringStrategy(const std::string &name, std::vector< std::string > &options, std::vector< std::vector< MuonStationIndex::ChIndex > > &path)
Constructor that assumes the seed order could come as part of the options.
Definition
MuonTrackSteeringStrategy.h:36
Muon::MuonTrackSteeringStrategy::getCh
const std::vector< MuonStationIndex::ChIndex > & getCh(const unsigned int) const
Definition
MuonTrackSteeringStrategy.h:124
Muon::MuonTrackSteeringStrategy::getAll
const std::vector< std::vector< MuonStationIndex::ChIndex > > & getAll() const
Definition
MuonTrackSteeringStrategy.h:60
Muon::MuonTrackSteeringStrategy::MuonTrackSteeringStrategy
MuonTrackSteeringStrategy(const std::string &name, const std::bitset< Last > &bits, std::vector< std::vector< MuonStationIndex::ChIndex > > &path, std::vector< unsigned int > &seedOrder)
Definition
MuonTrackSteeringStrategy.h:31
Muon::MuonTrackSteeringStrategy::setCh
void setCh(const std::vector< std::vector< MuonStationIndex::ChIndex > > &val)
Definition
MuonTrackSteeringStrategy.h:57
Muon::MuonTrackSteeringStrategy::getName
const std::string & getName() const
Definition
MuonTrackSteeringStrategy.h:64
Muon::MuonTrackSteeringStrategy::setName
void setName(const std::string &name)
Definition
MuonTrackSteeringStrategy.h:65
Muon::MuonTrackSteeringStrategy::setCh
void setCh(const std::vector< MuonStationIndex::ChIndex > &val, const unsigned int layer)
Definition
MuonTrackSteeringStrategy.h:115
Muon::MuonTrackSteeringStrategy::m_name
std::string m_name
Definition
MuonTrackSteeringStrategy.h:71
Muon::MuonTrackSteeringStrategy::setSeeds
void setSeeds(const std::vector< unsigned int > &val)
Definition
MuonTrackSteeringStrategy.h:68
Muon::MuonTrackSteeringStrategy::seeds
const std::vector< unsigned int > & seeds() const
Definition
MuonTrackSteeringStrategy.h:67
Muon::MuonStationIndex::chName
const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition
MuonStationIndex.cxx:120
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
Muon::operator<<
std::ostream & operator<<(std::ostream &ostr, const Muon::HedgehogBoard &board)
Definition
HedgehogBoard.cxx:11
Generated on
for ATLAS Offline Software by
1.17.0