ATLAS Offline Software
Loading...
Searching...
No Matches
JetAbbreviated.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4// JetAbbreviated.cxx
5// TopoCore
6// Created by Veronica Sorin on 14/8/14.
7
12#include <algorithm>
13
14REGISTER_ALG_TCS(JetAbbreviated)
15
16
17// constructor
20{
21 defineParameter( "NumberOfJets", 0 );
22 defineParameter( "JetSize", 0 );
23 defineParameter( "MinEta", 0 );
24 defineParameter( "MaxEta", 49);
26}
27
28
31
32
33
34
35
36
39 const JetTOBArray & jets = dynamic_cast<const JetTOBArray&>(input);
40 // because fw seems to have a differnt notation, for now 2 means JS1 8x8
41 m_jetsize = parameter("JetSize").value()==2?JetTOB::JS1:JetTOB::JS2;
42
43
44 // fill output array with GenericTOBs builds from jets
45 for(JetTOBArray::const_iterator cl = jets.begin(); cl!= jets.end(); ++cl ) {
46
47 if (parType_t(std::abs((*cl)-> eta())) < parameter("MinEta").value()) continue;
48 if (parType_t(std::abs((*cl)-> eta())) > parameter("MaxEta").value()) continue;
49
50 output.push_back( GenericTOB(**cl, m_jetsize) );
51 }
52
53
54 // keep only max number of jets
55 int par = parameter("NumberOfJets").value();
56 unsigned int maxNumberOfJets = std::clamp(par, 0, std::abs(par));
57 if(maxNumberOfJets>0) {
58 while( output.size()> maxNumberOfJets ) {
59 output.pop_back();
60 }
61 }
63}
64
#define REGISTER_ALG_TCS(CLASS)
Definition AlgFactory.h:62
Scalar eta() const
pseudorapidity method
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
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
JetAbbreviated(const std::string &name)
JetTOB::JetSize m_jetsize
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
uint32_t parType_t
Definition Parameter.h:22
STL namespace.