ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigT1
L1Topo
L1TopoAlgorithms
Root
METSortingAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
// file: METSortingAlg.cxx
5
// author: Joerg Stelzer
6
// creation: 27/08/14.
7
8
#include "
L1TopoAlgorithms/METSortingAlg.h
"
9
#include "
L1TopoCommon/Exception.h
"
10
#include "
L1TopoEvent/MetTOBArray.h
"
11
#include "
L1TopoEvent/GenericTOB.h
"
12
#include <algorithm>
13
#include <cmath>
14
15
using
std::sqrt;
16
17
REGISTER_ALG_TCS
(METSortingAlg)
18
19
20
// constructor
21
TCS
::
METSortingAlg
::
METSortingAlg
(
const
std
::
string
&
name
) :
SortingAlg
(
name
) {
22
defineParameter
(
"MinEta"
, 0);
23
defineParameter
(
"MaxEta"
, 31);
24
}
25
26
// destructor
27
TCS::METSortingAlg::~METSortingAlg
() {}
28
29
30
TCS::StatusCode
31
TCS::METSortingAlg::initialize
() {
32
p_MaxEta
=
parameter
(
"MinEta"
).value();
33
p_MinEta
=
parameter
(
"MaxEta"
).value();
34
return
TCS::StatusCode::SUCCESS
;
35
}
36
37
TCS::StatusCode
38
TCS::METSortingAlg::sort
(
const
InputTOBArray
& input,
TOBArray
& output) {
39
40
if
(input.size()!=1) {
41
TCS_EXCEPTION
(
"MET sort alg expects exactly single MET TOB, got "
<< input.size());
42
}
43
44
const
MetTOBArray
& mets =
dynamic_cast<
const
MetTOBArray
&
>
(input);
45
int
missingET = sqrt(mets[0].Ex()*mets[0].Ex() + mets[0].Ey() * mets[0].Ey());
46
47
output.push_back(
GenericTOB
( missingET, 0, 0 ) );
48
49
// later we will add the Kalman MET here and add it to the output list
50
// algorithms working with MET will have to modify their input check
51
52
return
TCS::StatusCode::SUCCESS
;
53
}
54
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition
AlgFactory.h:62
GenericTOB.h
METSortingAlg.h
MetTOBArray.h
Exception.h
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition
Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:15
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::GenericTOB
Definition
GenericTOB.h:35
TCS::InputTOBArray
Definition
InputTOBArray.h:15
TCS::METSortingAlg::p_MaxEta
parType_t p_MaxEta
Definition
METSortingAlg.h:35
TCS::METSortingAlg::initialize
virtual StatusCode initialize()
Definition
METSortingAlg.cxx:31
TCS::METSortingAlg::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition
METSortingAlg.cxx:38
TCS::METSortingAlg::METSortingAlg
METSortingAlg(const std::string &name)
Definition
METSortingAlg.cxx:21
TCS::METSortingAlg::~METSortingAlg
virtual ~METSortingAlg()
Definition
METSortingAlg.cxx:27
TCS::METSortingAlg::p_MinEta
parType_t p_MinEta
Definition
METSortingAlg.h:34
TCS::MetTOBArray
Definition
MetTOBArray.h:14
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
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0