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