ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
ClusterAbbreviated.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
// ClusterAbbreviated.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/ClusterAbbreviated.h
"
10
#include "
L1TopoEvent/TOBArray.h
"
11
#include "
L1TopoEvent/ClusterTOBArray.h
"
12
#include "
L1TopoEvent/GenericTOB.h
"
13
#include <algorithm>
14
15
REGISTER_ALG_TCS
(ClusterAbbreviated)
16
17
// constructor
18
TCS
::
ClusterAbbreviated
::
ClusterAbbreviated
(
const
std
::
string
&
name
) :
SortingAlg
(
name
) {
19
defineParameter
(
"NumberOfClusters"
, 0 );
20
defineParameter
(
"MinIsolation"
, 0);
21
defineParameter
(
"MinEta"
, 0 );
22
defineParameter
(
"MaxEta"
, 49);
23
}
24
25
26
// destructor
27
TCS::ClusterAbbreviated::~ClusterAbbreviated
() {}
28
29
TCS::StatusCode
30
TCS::ClusterAbbreviated::sort
(
const
InputTOBArray
& input,
TOBArray
& output) {
31
32
const
ClusterTOBArray
& clusters =
dynamic_cast<
const
ClusterTOBArray
&
>
(input);
33
34
// fill output array with GenericTOB buildt from clusters
35
for
(
ClusterTOBArray::const_iterator
cl = clusters.begin(); cl!= clusters.end(); ++cl ) {
36
const
GenericTOB
gtob(**cl);
37
38
// isolation cut
39
if
((*cl)->isolation() <
parameter
(
"MinIsolation"
).value())
continue
;
40
// eta cut
41
if
(
parType_t
(std::abs((*cl)->
eta
())) <
parameter
(
"MinEta"
).value())
continue
;
42
if
(
parType_t
(std::abs((*cl)->
eta
())) >
parameter
(
"MaxEta"
).value())
continue
;
43
44
output.push_back( gtob );
45
}
46
47
48
// keep only max number of clusters
49
int
par =
parameter
(
"NumberOfClusters"
).value();
50
unsigned
int
maxNumberOfClusters = std::clamp(par, 0, std::abs(par));
51
if
(maxNumberOfClusters>0) {
52
while
( output.size()> maxNumberOfClusters ) {
53
output.pop_back();
54
}
55
}
56
return
TCS::StatusCode::SUCCESS
;
57
}
58
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ClusterAbbreviated.h
ClusterTOBArray.h
GenericTOB.h
TOBArray.h
TCS::ClusterAbbreviated::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition
ClusterAbbreviated.cxx:30
TCS::ClusterAbbreviated::~ClusterAbbreviated
virtual ~ClusterAbbreviated()
Definition
ClusterAbbreviated.cxx:27
TCS::ClusterAbbreviated::ClusterAbbreviated
ClusterAbbreviated(const std::string &name)
Definition
ClusterAbbreviated.cxx:18
TCS::ClusterTOBArray
Definition
ClusterTOBArray.h:19
TCS::ConfigurableAlg::parameter
const Parameter & parameter(const std::string ¶meterName) const
Definition
ConfigurableAlg.cxx:243
TCS::ConfigurableAlg::name
const std::string & name() const
Definition
ConfigurableAlg.h:48
TCS::ConfigurableAlg::defineParameter
void defineParameter(const std::string &name, TCS::parType_t value)
Definition
ConfigurableAlg.cxx:201
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:16
TCS::parType_t
uint32_t parType_t
Definition
Parameter.h:22
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.14.0