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