ATLAS Offline Software
Loading...
Searching...
No Matches
jEmNoSort.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4// jEmNoSort.cxx
5// TopoCore
6// Algorithm to generate ALL lists of jEm TOBs
7
12#include <algorithm>
13
14REGISTER_ALG_TCS(jEmNoSort)
15
16
17// constructor
20{
21 defineParameter( "InputWidth", 64 ); // for FW
22 defineParameter( "OutputWidth", 64 );
23 defineParameter( "IsoMin", 0 );
24 defineParameter( "Frac1Min", 0 );
25 defineParameter( "Frac2Min", 0 );
26}
27
28
31
34 m_numberOfjEms = parameter("OutputWidth").value();
35 m_iso = parameter("IsoMin").value();
36 m_frac1 = parameter("Frac1Cut").value();
37 m_frac2 = parameter("Frac2Cut").value();
39}
40
41
42
43
46 const jEmTOBArray & jets = dynamic_cast<const jEmTOBArray&>(input);
47
48 // fill output array with GenericTOBs builds from jets
49 for(jEmTOBArray::const_iterator jet = jets.begin(); jet!= jets.end(); ++jet ) {
50 // Isolation cuts
51 if ( !isocut(m_iso, (*jet)-> isolation()) ) continue;
52 if ( !isocut(m_frac1, (*jet)-> frac1()) ) continue;
53 if ( !isocut(m_frac2, (*jet)-> frac2()) ) continue;
54
55 output.push_back( GenericTOB(**jet) );
56 }
57
58
59 // keep only max number of jets
60 int par = m_numberOfjEms ;
61 unsigned int maxNumberOfjEms = std::clamp(par, 0, std::abs(par));
62 if(maxNumberOfjEms>0) {
63 while( output.size()> maxNumberOfjEms ) {
64 output.pop_back();
65 }
66 }
68}
69
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
const Parameter & parameter(const std::string &parameterName) const
const std::string & name() const
bool isocut(const std::string &threshold, const unsigned int bit) 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 ~jEmNoSort()
Definition jEmNoSort.cxx:29
parType_t m_numberOfjEms
Definition jEmNoSort.h:32
parType_t m_frac2
Definition jEmNoSort.h:35
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition jEmNoSort.cxx:45
parType_t m_frac1
Definition jEmNoSort.h:34
jEmNoSort(const std::string &name)
Definition jEmNoSort.cxx:18
virtual TCS::StatusCode initialize() override
Definition jEmNoSort.cxx:33
parType_t m_iso
Definition jEmNoSort.h:33
STL namespace.