ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
ClusterSelect.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
// ClusterSelect.cxx
5
// TopoCore
6
// Created by V Sorin, Joerg Stelzer
7
// Algorithm to select the abbreviated list of clusters , no order is applied
8
//
9
#include "
L1TopoAlgorithms/ClusterSelect.h
"
10
#include "
L1TopoEvent/TOBArray.h
"
11
#include "
L1TopoEvent/ClusterTOBArray.h
"
12
#include "
L1TopoEvent/GenericTOB.h
"
13
#include <algorithm>
14
15
REGISTER_ALG_TCS
(ClusterSelect)
16
17
// constructor
18
TCS
::
ClusterSelect
::
ClusterSelect
(
const
std
::
string
&
name
) :
SortingAlg
(
name
) {
19
defineParameter
(
"InputWidth"
, 120 );
// for fw
20
defineParameter
(
"InputWidth1stStage"
, 30 );
// for fw
21
defineParameter
(
"OutputWidth"
, 6 );
22
defineParameter
(
"MinET"
, 0 );
23
defineParameter
(
"IsoMask"
, 0);
24
defineParameter
(
"MinEta"
, 0 );
25
defineParameter
(
"MaxEta"
, 63);
26
defineParameter
(
"DoIsoCut"
, 1);
27
}
28
29
30
// destructor
31
TCS::ClusterSelect::~ClusterSelect
() {}
32
33
TCS::StatusCode
34
TCS::ClusterSelect::initialize
() {
35
m_numberOfClusters
=
parameter
(
"OutputWidth"
).value();
36
m_et
=
parameter
(
"MinET"
).value();
37
m_iso
=
parameter
(
"IsoMask"
).value();
38
m_minEta
=
parameter
(
"MinEta"
).value();
39
m_maxEta
=
parameter
(
"MaxEta"
).value();
40
m_doIsoCut
=
parameter
(
"DoIsoCut"
).value();
41
return
TCS::StatusCode::SUCCESS
;
42
}
43
44
TCS::StatusCode
45
TCS::ClusterSelect::sort
(
const
InputTOBArray
& input,
TOBArray
& output) {
46
47
const
ClusterTOBArray
& clusters =
dynamic_cast<
const
ClusterTOBArray
&
>
(input);
48
49
// fill output array with GenericTOB buildt from clusters
50
for
(
ClusterTOBArray::const_iterator
cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
51
const
GenericTOB
gtob(**cl);
52
53
if
(
parType_t
((*cl)->Et()) <=
m_et
)
continue
;
// ET cut
54
// isolation cut
55
if
(
m_doIsoCut
&& (
m_iso
!= 0 )) {
56
if
((
parType_t
((*cl)->isolation()) &
m_iso
) !=
m_iso
)
continue
;
57
}
58
// eta cut
59
if
(
parType_t
(std::abs((*cl)->
eta
())) <
m_minEta
)
continue
;
60
if
(
parType_t
(std::abs((*cl)->
eta
())) >
m_maxEta
)
continue
;
61
62
output.push_back( gtob );
63
}
64
65
66
// keep only max number of clusters
67
int
par =
m_numberOfClusters
;
68
unsigned
int
maxNumberOfClusters = std::clamp(par, 0, std::abs(par));
69
if
(maxNumberOfClusters>0) {
70
71
if
(output.size()> maxNumberOfClusters) {
setOverflow
(
true
);}
72
73
while
( output.size()> maxNumberOfClusters ) {
74
output.pop_back();
75
}
76
}
77
return
TCS::StatusCode::SUCCESS
;
78
}
79
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ClusterSelect.h
ClusterTOBArray.h
GenericTOB.h
TOBArray.h
TCS::ClusterSelect::m_minEta
parType_t m_minEta
Definition
ClusterSelect.h:33
TCS::ClusterSelect::m_doIsoCut
parType_t m_doIsoCut
Definition
ClusterSelect.h:37
TCS::ClusterSelect::m_numberOfClusters
parType_t m_numberOfClusters
Definition
ClusterSelect.h:32
TCS::ClusterSelect::m_maxEta
parType_t m_maxEta
Definition
ClusterSelect.h:34
TCS::ClusterSelect::ClusterSelect
ClusterSelect(const std::string &name)
Definition
ClusterSelect.cxx:18
TCS::ClusterSelect::~ClusterSelect
virtual ~ClusterSelect()
Definition
ClusterSelect.cxx:31
TCS::ClusterSelect::m_iso
parType_t m_iso
Definition
ClusterSelect.h:36
TCS::ClusterSelect::m_et
parType_t m_et
Definition
ClusterSelect.h:35
TCS::ClusterSelect::initialize
virtual TCS::StatusCode initialize()
Definition
ClusterSelect.cxx:34
TCS::ClusterSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition
ClusterSelect.cxx:45
TCS::ClusterTOBArray
Definition
ClusterTOBArray.h:19
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< ClusterTOB >::const_iterator
data_t::const_iterator const_iterator
Definition
DataArrayImpl.h:18
TCS::GenericTOB
Definition
GenericTOB.h:35
TCS::InputTOBArray
Definition
InputTOBArray.h:15
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