ATLAS Offline Software
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
JetNoSort.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
// JetNoSort.cxx
5
// TopoCore
6
// Created by Veronica Sorin on 14/8/14.
7
// Algorithm to generate ALL lists of JETs TOBs
8
//
9
#include "
L1TopoAlgorithms/JetNoSort.h
"
10
#include "
L1TopoEvent/TOBArray.h
"
11
#include "
L1TopoEvent/JetTOBArray.h
"
12
#include "
L1TopoEvent/GenericTOB.h
"
13
#include <algorithm>
14
15
REGISTER_ALG_TCS
(JetNoSort)
16
17
18
// constructor
19
TCS
::
JetNoSort
::
JetNoSort
(
const
std
::
string
&
name
) :
20
SortingAlg
(
name
)
21
{
22
defineParameter
(
"InputWidth"
, 64 );
// for FW
23
defineParameter
(
"OutputWidth"
, 64 );
24
defineParameter
(
"JetSize"
, 2 );
25
m_jetsize
=
JetTOB::JS1
;
26
}
27
28
29
TCS::JetNoSort::~JetNoSort
()
30
{}
31
32
TCS::StatusCode
33
TCS::JetNoSort::initialize
() {
34
m_numberOfJets
=
parameter
(
"OutputWidth"
).value();
35
m_jsize
=
parameter
(
"JetSize"
).value();
36
return
TCS::StatusCode::SUCCESS
;
37
}
38
39
40
41
42
TCS::StatusCode
43
TCS::JetNoSort::sort
(
const
InputTOBArray
& input,
TOBArray
& output) {
44
const
JetTOBArray
& jets =
dynamic_cast<
const
JetTOBArray
&
>
(input);
45
// because fw seems to have a differnt notation, for now 2 means JS1 8x8
46
m_jetsize
=
m_jsize
==2?
JetTOB::JS1
:
JetTOB::JS2
;
47
48
// fill output array with GenericTOBs builds from jets
49
for
(
JetTOBArray::const_iterator
cl = jets.begin(); cl!= jets.end(); ++cl ) {
50
51
output.push_back(
GenericTOB
(**cl,
m_jetsize
) );
52
}
53
54
55
// keep only max number of jets
56
int
par =
m_numberOfJets
;
57
unsigned
int
maxNumberOfJets = std::clamp(par, 0, std::abs(par));
58
if
(maxNumberOfJets>0) {
59
while
( output.size()> maxNumberOfJets ) {
60
output.pop_back();
61
}
62
}
63
return
TCS::StatusCode::SUCCESS
;
64
}
65
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
GenericTOB.h
JetNoSort.h
JetTOBArray.h
TOBArray.h
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< JetTOB >::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::JetNoSort::m_numberOfJets
parType_t m_numberOfJets
Definition
JetNoSort.h:33
TCS::JetNoSort::initialize
virtual TCS::StatusCode initialize()
Definition
JetNoSort.cxx:33
TCS::JetNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition
JetNoSort.cxx:43
TCS::JetNoSort::m_jsize
parType_t m_jsize
Definition
JetNoSort.h:34
TCS::JetNoSort::m_jetsize
JetTOB::JetSize m_jetsize
Definition
JetNoSort.h:39
TCS::JetNoSort::JetNoSort
JetNoSort(const std::string &name)
Definition
JetNoSort.cxx:19
TCS::JetNoSort::~JetNoSort
virtual ~JetNoSort()
Definition
JetNoSort.cxx:29
TCS::JetTOBArray
Definition
JetTOBArray.h:21
TCS::JetTOB::JS1
@ JS1
Definition
JetTOB.h:21
TCS::JetTOB::JS2
@ JS2
Definition
JetTOB.h:21
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
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.14.0