ATLAS Offline Software
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 //
10 #include "L1TopoEvent/TOBArray.h"
12 #include "L1TopoEvent/GenericTOB.h"
13 #include <algorithm>
14 
15 REGISTER_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 
MuonNoSort.h
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::DataArrayImpl< MuonTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
TCS::MuonNoSort::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: MuonNoSort.cxx:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
TCS::DataArrayImpl::end
iterator end()
Definition: DataArrayImpl.h:43
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::MuonTOBArray
Definition: MuonTOBArray.h:19
TCS::MuonNoSort::initialize
virtual TCS::StatusCode initialize() override
Definition: MuonNoSort.cxx:28
TOBArray.h
TCS::MuonNoSort::~MuonNoSort
virtual ~MuonNoSort()
Definition: MuonNoSort.cxx:25
TCS::TOBArray
Definition: TOBArray.h:24
merge.output
output
Definition: merge.py:17
TCS::GenericTOB
Definition: GenericTOB.h:35
REGISTER_ALG_TCS
#define REGISTER_ALG_TCS(CLASS)
Definition: AlgFactory.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS::DataArrayImpl::begin
iterator begin()
Definition: DataArrayImpl.h:40
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::MuonNoSort
Definition: MuonNoSort.h:19
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
MuonTOBArray.h