ATLAS Offline Software
gLJetNoSort.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // gLJetNoSort.cxx
5 // TopoCore
6 // Algorithm to generate ALL lists of gLJet TOBs
7 
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(gLJetNoSort)
15 
16 
17 // constructor
18 TCS::gLJetNoSort::gLJetNoSort(const std::string & name) :
20 {
21  defineParameter( "InputWidth", 64 ); // for FW
22  defineParameter( "OutputWidth", 64 );
23 }
24 
25 
27 {}
28 
31  m_numberOfgLJets = parameter("OutputWidth").value();
33 }
34 
35 
36 
37 
40  const gLJetTOBArray & jets = dynamic_cast<const gLJetTOBArray&>(input);
41 
42  // fill output array with GenericTOBs builds from jets
43  for(gLJetTOBArray::const_iterator jet = jets.begin(); jet!= jets.end(); ++jet ) {
44  output.push_back( GenericTOB(**jet) );
45  }
46 
47 
48  // keep only max number of jets
49  int par = m_numberOfgLJets ;
50  unsigned int maxNumberOfgLJets = std::clamp(par, 0, std::abs(par));
51  if(maxNumberOfgLJets>0) {
52  while( output.size()> maxNumberOfgLJets ) {
53  output.pop_back();
54  }
55  }
57 }
58 
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::DataArrayImpl< gLJetTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
gLJetNoSort.h
gLJetTOBArray.h
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::gLJetNoSort::initialize
virtual TCS::StatusCode initialize() override
Definition: gLJetNoSort.cxx:30
TOBArray.h
TCS::TOBArray
Definition: TOBArray.h:24
TCS::gLJetNoSort::~gLJetNoSort
virtual ~gLJetNoSort()
Definition: gLJetNoSort.cxx:26
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:221
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS::gLJetNoSort
Definition: gLJetNoSort.h:19
TCS::gLJetNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: gLJetNoSort.cxx:39
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
TCS::gLJetTOBArray
Definition: gLJetTOBArray.h:19
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15