ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
MuonSelect.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
// MuonSelect.cxx
5
// TopoCore
6
// Created by Joerg Stelzer, V Sorin 2014.
7
// algorithm to make abbreviated muon lists
8
// updated in 20/09/2021 to use flags selection
9
10
#include "
L1TopoAlgorithms/MuonSelect.h
"
11
#include "
L1TopoEvent/TOBArray.h
"
12
#include "
L1TopoEvent/MuonTOBArray.h
"
13
#include "
L1TopoEvent/GenericTOB.h
"
14
#include <algorithm>
15
16
REGISTER_ALG_TCS
(MuonSelect)
17
18
// constructor
19
TCS
::
MuonSelect
::
MuonSelect
(
const
std
::
string
&
name
) :
SortingAlg
(
name
) {
20
defineParameter
(
"InputWidth"
, 32 );
// for FW
21
defineParameter
(
"InputWidth1stStage"
, 16 );
// for FW
22
defineParameter
(
"OutputWidth"
, 6 );
23
defineParameter
(
"MinEta"
, 0 );
24
defineParameter
(
"MaxEta"
, 196 );
25
defineParameter
(
"MinEtTGC"
, 0 );
26
defineParameter
(
"MinEtRPC"
, 0 );
27
defineParameter
(
"InnerCoinCut"
, 0 );
28
defineParameter
(
"FullStationCut"
, 0 );
29
defineParameter
(
"GoodMFieldCut"
, 0 );
30
defineParameter
(
"MinET"
, 0 );
31
}
32
33
34
// destructor
35
TCS::MuonSelect::~MuonSelect
() {}
36
37
38
TCS::StatusCode
39
TCS::MuonSelect::initialize
() {
40
m_numberOfMuons
=
parameter
(
"OutputWidth"
).value();
41
m_minEta
=
parameter
(
"MinEta"
).value();
42
m_maxEta
=
parameter
(
"MaxEta"
).value();
43
m_MinEtTGC
=
parameter
(
"MinEtTGC"
).value();
44
m_MinEtRPC
=
parameter
(
"MinEtRPC"
).value();
45
m_InnerCoinCut
=
parameter
(
"InnerCoinCut"
).value();
46
m_FullStationCut
=
parameter
(
"FullStationCut"
).value();
47
m_GoodMFieldCut
=
parameter
(
"GoodMFieldCut"
).value();
48
m_et
=
parameter
(
"MinET"
).value();
49
50
return
TCS::StatusCode::SUCCESS
;
51
}
52
53
54
TCS::StatusCode
55
TCS::MuonSelect::sort
(
const
InputTOBArray
& input,
TOBArray
& output) {
56
57
const
MuonTOBArray
& muons =
dynamic_cast<
const
MuonTOBArray
&
>
(input);
58
59
// fill output array with GenericTOB built from clusters
60
for
(
MuonTOBArray::const_iterator
muon = muons.
begin
(); muon!= muons.
end
(); ++muon ) {
61
62
// Tmp, to be removed after new menu is implemented
63
if
(
parType_t
((*muon)->Et()) <=
m_et
)
continue
;
// ET cut
64
65
// Apply the relevant cut to the right kind of muon
66
if
( (
parType_t
((*muon)->Et()) <=
m_MinEtTGC
&&
parType_t
((*muon)->isTGC())) ||
67
(
parType_t
((*muon)->Et()) <=
m_MinEtRPC
&& (!
parType_t
((*muon)->isTGC()))) )
continue
;
// ET cut
68
69
// eta cut
70
if
(
parType_t
(std::abs((*muon)->
eta
())) <
m_minEta
)
continue
;
71
if
(
parType_t
(std::abs((*muon)->
eta
())) >
m_maxEta
)
continue
;
72
73
// Apply flag selection only for TGC muons. The flag selection is applied only if the corresponding parameter from the menu is 1.
74
if
(
parType_t
((*muon)->isTGC()) )
75
{
76
if
(
m_InnerCoinCut
== 1 && ( ! ((
int
)
parType_t
((*muon)->innerCoin()) == (
int
)
m_InnerCoinCut
) ) )
continue
;
77
if
(
m_FullStationCut
== 1 && ( ! ((
int
)
parType_t
((*muon)->bw2or3()) == (
int
)
m_FullStationCut
) ) )
continue
;
78
if
(
m_GoodMFieldCut
== 1 && ( ! ((
int
)
parType_t
((*muon)->goodMF()) == (
int
)
m_GoodMFieldCut
) ) )
continue
;
79
}
80
81
const
GenericTOB
gtob(**muon);
82
output.push_back( gtob );
83
}
84
85
// keep only max number of muons
86
if
(
m_numberOfMuons
> 0) {
87
88
if
(output.size()>
m_numberOfMuons
) {
setOverflow
(
true
);}
89
90
while
( output.size()>
m_numberOfMuons
) {
91
output.pop_back();
92
}
93
}
94
return
TCS::StatusCode::SUCCESS
;
95
}
96
97
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
GenericTOB.h
MuonSelect.h
MuonTOBArray.h
TOBArray.h
TCS::ConfigurableAlg::name
const std::string & name() const
Definition
ConfigurableAlg.h:49
TCS::ConfigurableAlg::parameter
const Parameter & parameter(std::string_view parameterName) const
Definition
ConfigurableAlg.cxx:245
TCS::ConfigurableAlg::defineParameter
void defineParameter(std::string_view name, TCS::parType_t value)
Definition
ConfigurableAlg.cxx:203
TCS::DataArrayImpl::begin
iterator begin()
Definition
DataArrayImpl.h:40
TCS::DataArrayImpl< MuonTOB >::const_iterator
data_t::const_iterator const_iterator
Definition
DataArrayImpl.h:18
TCS::DataArrayImpl::end
iterator end()
Definition
DataArrayImpl.h:43
TCS::GenericTOB
Definition
GenericTOB.h:35
TCS::InputTOBArray
Definition
InputTOBArray.h:15
TCS::MuonSelect::m_MinEtRPC
parType_t m_MinEtRPC
Definition
MuonSelect.h:38
TCS::MuonSelect::m_MinEtTGC
parType_t m_MinEtTGC
Definition
MuonSelect.h:37
TCS::MuonSelect::m_et
parType_t m_et
Definition
MuonSelect.h:44
TCS::MuonSelect::m_FullStationCut
parType_t m_FullStationCut
Definition
MuonSelect.h:41
TCS::MuonSelect::m_minEta
parType_t m_minEta
Definition
MuonSelect.h:35
TCS::MuonSelect::MuonSelect
MuonSelect(const std::string &name)
Definition
MuonSelect.cxx:19
TCS::MuonSelect::m_numberOfMuons
parType_t m_numberOfMuons
Definition
MuonSelect.h:34
TCS::MuonSelect::m_maxEta
parType_t m_maxEta
Definition
MuonSelect.h:36
TCS::MuonSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition
MuonSelect.cxx:55
TCS::MuonSelect::m_InnerCoinCut
parType_t m_InnerCoinCut
Definition
MuonSelect.h:40
TCS::MuonSelect::~MuonSelect
virtual ~MuonSelect()
Definition
MuonSelect.cxx:35
TCS::MuonSelect::initialize
virtual TCS::StatusCode initialize() override
Definition
MuonSelect.cxx:39
TCS::MuonSelect::m_GoodMFieldCut
parType_t m_GoodMFieldCut
Definition
MuonSelect.h:42
TCS::MuonTOBArray
Definition
MuonTOBArray.h:19
TCS::SortingAlg::setOverflow
SortingAlg & setOverflow(const bool v)
setter, to propagate bit from input event
Definition
SortingAlg.h:37
TCS::SortingAlg::SortingAlg
SortingAlg(const std::string &name)
Definition
SortingAlg.h:21
TCS::StatusCode
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::TOBArray
Definition
TOBArray.h:24
const
TCS
Definition
AnomalyDetectionBDT.h:18
TCS::parType_t
uint32_t parType_t
Definition
Parameter.h:23
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0