ATLAS Offline Software
Loading...
Searching...
No Matches
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
12#include <algorithm>
13#include <cmath>
14
15using std::sqrt;
16
17REGISTER_ALG_TCS(METSortingAlg)
18
19
20// constructor
22 defineParameter( "MinEta", 0);
23 defineParameter( "MaxEta", 31);
24}
25
26// destructor
28
29
32 p_MaxEta = parameter("MinEta").value();
33 p_MinEta = parameter("MaxEta").value();
35}
36
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
53}
54
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
const Parameter & parameter(const std::string &parameterName) const
const std::string & name() const
void defineParameter(const std::string &name, TCS::parType_t value)
virtual StatusCode initialize()
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
METSortingAlg(const std::string &name)
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
STL namespace.