ATLAS Offline Software
Loading...
Searching...
No Matches
jLJetNoSort.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4// jLJetNoSort.cxx
5// TopoCore
6// Algorithm to generate ALL lists of jLJet TOBs
7
12#include <algorithm>
13
14REGISTER_ALG_TCS(jLJetNoSort)
15
16
17// constructor
20{
21 defineParameter( "InputWidth", 64 ); // for FW
22 defineParameter( "OutputWidth", 64 );
23}
24
25
28
34
35
36
37
40 const jLJetTOBArray & jets = dynamic_cast<const jLJetTOBArray&>(input);
41
42 // fill output array with GenericTOBs builds from jets
43 for(jLJetTOBArray::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_numberOfjLJets ;
50 unsigned int maxNumberOfjLJets = std::clamp(par, 0, std::abs(par));
51 if(maxNumberOfjLJets>0) {
52 while( output.size()> maxNumberOfjLJets ) {
53 output.pop_back();
54 }
55 }
57}
58
#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)
data_t::const_iterator const_iterator
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
virtual TCS::StatusCode initialize() override
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
jLJetNoSort(const std::string &name)
parType_t m_numberOfjLJets
Definition jLJetNoSort.h:32
virtual ~jLJetNoSort()
STL namespace.