ATLAS Offline Software
MuonAbbreviated.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 // MuonAbbreviated.cxx
5 // TopoCore
6 // Created by Joerg Stelzer on 11/10/12.
7 
9 #include "L1TopoEvent/TOBArray.h"
11 #include "L1TopoEvent/GenericTOB.h"
12 #include <algorithm>
13 
14 REGISTER_ALG_TCS(MuonAbbreviated)
15 
16 // constructor
18  defineParameter( "NumberOfMuons", 0 );
19  defineParameter( "MinEta", 0 );
20  defineParameter( "MaxEta", 49);
21 }
22 
23 
24 // destructor
26 
29  m_numberOfMuons = parameter("NumberOfMuons").value();
30  m_minEta = parameter("MinEta").value();
31  m_maxEta = parameter("MaxEta").value();
32  TRG_MSG_INFO("NumberOfMuons : " << m_numberOfMuons);
33  TRG_MSG_INFO("MinEta : " << m_minEta);
34  TRG_MSG_INFO("MaxEta : " << m_maxEta);
36 }
37 
38 
41 
42  const MuonTOBArray & muons = dynamic_cast<const MuonTOBArray&>(input);
43 
44  // fill output array with GenericTOB buildt from clusters
45  //for(MuonTOBArray::const_iterator cl = muons.begin(); cl!= muons.end(); ++cl ) {
46  for(const MuonTOB* muon : muons ) {
47  const GenericTOB gtob(*muon);
48 
49  parType_t muonAbsEta = (parType_t) std::abs( muon->eta() );
50 
51  // eta cut
52  bool passEta = (muonAbsEta >= m_minEta) && (muonAbsEta <= m_maxEta);
53 
54  TRG_MSG_DEBUG("Muon with Et=" << muon->Et() << " and abs(eta)=" << muonAbsEta << " --> " << (passEta?"pass":"fail") );
55 
56  if ( ! passEta ) continue;
57 
58  output.push_back( gtob );
59  }
60 
61  // keep only max number of clusters
62  if( m_numberOfMuons > 0) {
63  while( output.size()> m_numberOfMuons ) {
64  output.pop_back();
65  }
66  }
68 }
69 
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::MuonTOB
Definition: MuonTOB.h:14
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::MuonAbbreviated
Definition: MuonAbbreviated.h:19
TCS::MuonAbbreviated::initialize
virtual TCS::StatusCode initialize()
Definition: MuonAbbreviated.cxx:28
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
TCS::MuonAbbreviated::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output)
Definition: MuonAbbreviated.cxx:40
TCS::MuonAbbreviated::~MuonAbbreviated
virtual ~MuonAbbreviated()
Definition: MuonAbbreviated.cxx:25
TCS::InputTOBArray
Definition: InputTOBArray.h:15
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
TCS::MuonTOBArray
Definition: MuonTOBArray.h:19
TOBArray.h
TCS::TOBArray
Definition: TOBArray.h:24
TRG_MSG_INFO
#define TRG_MSG_INFO(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:27
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:195
TCS::SortingAlg
Definition: SortingAlg.h:18
GenericTOB.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
MuonAbbreviated.h
TRG_MSG_DEBUG
#define TRG_MSG_DEBUG(x)
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStreamMacros.h:25
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
MuonTOBArray.h