ATLAS Offline Software
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 
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
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 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::METSortingAlg::initialize
virtual StatusCode initialize()
Definition: METSortingAlg.cxx:31
TCS::MetTOBArray
Definition: MetTOBArray.h:14
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::TOBArray
Definition: TOBArray.h:24
TCS::METSortingAlg
Definition: METSortingAlg.h:19
merge.output
output
Definition: merge.py:17
TCS::GenericTOB
Definition: GenericTOB.h:35
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TCS::SortingAlg
Definition: SortingAlg.h:18
TCS::METSortingAlg::~METSortingAlg
virtual ~METSortingAlg()
Definition: METSortingAlg.cxx:27
GenericTOB.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
METSortingAlg.h
MetTOBArray.h
Exception.h
TCS::METSortingAlg::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: METSortingAlg.cxx:38
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15