ATLAS Offline Software
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 
10 #include "L1TopoCommon/Exception.h"
11 #include "L1TopoEvent/TOBArray.h"
13 #include "L1TopoEvent/GenericTOB.h"
14 #include <algorithm>
15 
16 REGISTER_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 
34 }
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 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::DataArrayImpl< MetTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TCS::MetTOBArray
Definition: MetTOBArray.h:14
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TCS::DataArrayImpl::end
iterator end()
Definition: DataArrayImpl.h:43
TCS::METNoSort
Definition: METNoSort.h:19
TCS::METNoSort::~METNoSort
virtual ~METNoSort()
Definition: METNoSort.cxx:28
METNoSort.h
TCS::METNoSort::initialize
virtual StatusCode initialize()
Definition: METNoSort.cxx:32
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TOBArray.h
TCS_EXCEPTION
#define TCS_EXCEPTION(MSG)
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/Exception.h:14
TCS::TOBArray
Definition: TOBArray.h:24
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:228
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::METNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: METNoSort.cxx:37
MetTOBArray.h
Exception.h
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15