ATLAS Offline Software
Loading...
Searching...
No Matches
METNoSort.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4// METNoSort.cxx
5// author: Joerg Stelzer
6// creation: 27/08/14.
7// modify V Sorin, algorithm to calculate MET and convert in genericTOB
8
14#include <algorithm>
15
16REGISTER_ALG_TCS(METNoSort)
17
18
19// constructor
21
22 defineParameter( "InputWidth", 2 ); // for FW
23 defineParameter( "OutputWidth", 2 ); // for FW
24
25}
26
27// destructor
29
30
35
38
39 if(input.size()!=1) {
40 TCS_EXCEPTION("MET sort alg expects exactly single MET TOB, got " << input.size());
41 }
42
43 const MetTOBArray & mets = dynamic_cast<const MetTOBArray&>(input);
44// int missingET = sqrt(mets[0].Ex()*mets[0].Ex() + mets[0].Ey() * mets[0].Ey());
45// int metphi = round(10*atan2(mets[0].Ey(),mets[0].Ex()));
46
47 for(MetTOBArray::const_iterator cl = mets.begin(); cl!= mets.end(); ++cl ) {
48
49 output.push_back( GenericTOB(**cl) );
50 }
51
52// output.push_back( GenericTOB( &mets[0] ));
53
54
56}
57
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
const std::string & name() const
void defineParameter(const std::string &name, TCS::parType_t value)
data_t::const_iterator const_iterator
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition METNoSort.cxx:37
virtual ~METNoSort()
Definition METNoSort.cxx:28
virtual StatusCode initialize()
Definition METNoSort.cxx:32
METNoSort(const std::string &name)
Definition METNoSort.cxx:20
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
STL namespace.