ATLAS Offline Software
Loading...
Searching...
No Matches
MuonNoSort.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4// MuonNoSort.cxx
5// TopoCore
6// Created by Joerg Stelzer, V Sorin 2014.
7// algorithm to make sorted muon lists
8//
13#include <algorithm>
14
15REGISTER_ALG_TCS(MuonNoSort)
16
17// constructor
19 defineParameter( "InputWidth", 32 ); // for FW
20 defineParameter( "OutputWidth", 6 );
21}
22
23
24// destructor
26
29 m_numberOfMuons = parameter("InputWidth").value();
30
32}
33
34
37
38 const MuonTOBArray & muons = dynamic_cast<const MuonTOBArray&>(input);
39
40 // fill output array with GenericTOB built from clusters
41 for(MuonTOBArray::const_iterator muon = muons.begin(); muon!= muons.end(); ++muon ) {
42
43 const GenericTOB gtob(**muon);
44 output.push_back( gtob );
45 }
46
47 // keep only max number of clusters
48 if( m_numberOfMuons > 0) {
49 while( output.size()> m_numberOfMuons ) {
50 output.pop_back();
51 }
52 }
54}
55
#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_numberOfMuons
Definition MuonNoSort.h:34
virtual TCS::StatusCode initialize() override
MuonNoSort(const std::string &name)
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
virtual ~MuonNoSort()
SortingAlg(const std::string &name)
Definition SortingAlg.h:21
STL namespace.