ATLAS Offline Software
Loading...
Searching...
No Matches
JetNoSort.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4// JetNoSort.cxx
5// TopoCore
6// Created by Veronica Sorin on 14/8/14.
7// Algorithm to generate ALL lists of JETs TOBs
8//
13#include <algorithm>
14
15REGISTER_ALG_TCS(JetNoSort)
16
17
18// constructor
21{
22 defineParameter( "InputWidth", 64 ); // for FW
23 defineParameter( "OutputWidth", 64 );
24 defineParameter( "JetSize", 2 );
26}
27
28
31
34 m_numberOfJets = parameter("OutputWidth").value();
35 m_jsize = parameter("JetSize").value();
37}
38
39
40
41
44 const JetTOBArray & jets = dynamic_cast<const JetTOBArray&>(input);
45 // because fw seems to have a differnt notation, for now 2 means JS1 8x8
47
48 // fill output array with GenericTOBs builds from jets
49 for(JetTOBArray::const_iterator cl = jets.begin(); cl!= jets.end(); ++cl ) {
50
51 output.push_back( GenericTOB(**cl, m_jetsize) );
52 }
53
54
55 // keep only max number of jets
56 int par = m_numberOfJets ;
57 unsigned int maxNumberOfJets = std::clamp(par, 0, std::abs(par));
58 if(maxNumberOfJets>0) {
59 while( output.size()> maxNumberOfJets ) {
60 output.pop_back();
61 }
62 }
64}
65
#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
parType_t m_numberOfJets
Definition JetNoSort.h:33
virtual TCS::StatusCode initialize()
Definition JetNoSort.cxx:33
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition JetNoSort.cxx:43
parType_t m_jsize
Definition JetNoSort.h:34
JetTOB::JetSize m_jetsize
Definition JetNoSort.h:39
JetNoSort(const std::string &name)
Definition JetNoSort.cxx:19
virtual ~JetNoSort()
Definition JetNoSort.cxx:29
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
STL namespace.