ATLAS Offline Software
MuonSelect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 // MuonSelect.cxx
5 // TopoCore
6 // Created by Joerg Stelzer, V Sorin 2014.
7 // algorithm to make abbreviated muon lists
8 // updated in 20/09/2021 to use flags selection
9 
11 #include "L1TopoEvent/TOBArray.h"
13 #include "L1TopoEvent/GenericTOB.h"
14 #include <algorithm>
15 
16 REGISTER_ALG_TCS(MuonSelect)
17 
18 // constructor
20  defineParameter( "InputWidth", 32 ); // for FW
21  defineParameter( "InputWidth1stStage", 16 ); // for FW
22  defineParameter( "OutputWidth", 6 );
23  defineParameter( "MinEta", 0 );
24  defineParameter( "MaxEta", 196 );
25  defineParameter( "MinEtTGC", 0 );
26  defineParameter( "MinEtRPC", 0 );
27  defineParameter( "InnerCoinCut", 0 );
28  defineParameter( "FullStationCut", 0 );
29  defineParameter( "GoodMFieldCut", 0 );
30  defineParameter( "MinET", 0 );
31 }
32 
33 
34 // destructor
36 
37 
40  m_numberOfMuons = parameter("OutputWidth").value();
41  m_minEta = parameter("MinEta").value();
42  m_maxEta = parameter("MaxEta").value();
43  m_MinEtTGC = parameter("MinEtTGC").value();
44  m_MinEtRPC = parameter("MinEtRPC").value();
45  m_InnerCoinCut = parameter("InnerCoinCut").value();
46  m_FullStationCut = parameter("FullStationCut").value();
47  m_GoodMFieldCut = parameter("GoodMFieldCut").value();
48  m_et = parameter("MinET").value();
49 
51 }
52 
53 
56 
57  const MuonTOBArray & muons = dynamic_cast<const MuonTOBArray&>(input);
58 
59  // fill output array with GenericTOB built from clusters
60  for(MuonTOBArray::const_iterator muon = muons.begin(); muon!= muons.end(); ++muon ) {
61 
62  // Tmp, to be removed after new menu is implemented
63  if( parType_t((*muon)->Et()) <= m_et ) continue; // ET cut
64 
65  // Apply the relevant cut to the right kind of muon
66  if( (parType_t((*muon)->Et()) <= m_MinEtTGC && parType_t((*muon)->isTGC())) ||
67  (parType_t((*muon)->Et()) <= m_MinEtRPC && (!parType_t((*muon)->isTGC()))) ) continue; // ET cut
68 
69  // eta cut
70  if (parType_t(std::abs((*muon)-> eta())) < m_minEta) continue;
71  if (parType_t(std::abs((*muon)-> eta())) > m_maxEta) continue;
72 
73  // Apply flag selection only for TGC muons. The flag selection is applied only if the corresponding parameter from the menu is 1.
74  if ( parType_t((*muon)->isTGC()) )
75  {
76  if(m_InnerCoinCut == 1 && ( ! ((int)parType_t((*muon)->innerCoin()) == (int)m_InnerCoinCut ) ) ) continue;
77  if(m_FullStationCut == 1 && ( ! ((int)parType_t((*muon)->bw2or3()) == (int)m_FullStationCut ) ) ) continue;
78  if(m_GoodMFieldCut == 1 && ( ! ((int)parType_t((*muon)->goodMF()) == (int)m_GoodMFieldCut ) ) ) continue;
79  }
80 
81  const GenericTOB gtob(**muon);
82  output.push_back( gtob );
83  }
84 
85  // keep only max number of muons
86  if( m_numberOfMuons > 0) {
87 
88  if (output.size()> m_numberOfMuons) {setOverflow(true);}
89 
90  while( output.size()> m_numberOfMuons ) {
91  output.pop_back();
92  }
93  }
95 }
96 
97 
TCS::MuonSelect::~MuonSelect
virtual ~MuonSelect()
Definition: MuonSelect.cxx:35
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
TCS::StatusCode::SUCCESS
@ SUCCESS
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:17
TCS::parType_t
uint32_t parType_t
Definition: Parameter.h:22
TCS::DataArrayImpl< MuonTOB >::const_iterator
data_t::const_iterator const_iterator
Definition: DataArrayImpl.h:18
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TCS::MuonSelect::sort
virtual TCS::StatusCode sort(const InputTOBArray &input, TOBArray &output) override final
Definition: MuonSelect.cxx:55
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
TOBArray.h
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
MuonSelect.h
TCS
Definition: Global/GlobalSimulation/src/IO/Decision.h:18
TCS::MuonSelect
Definition: MuonSelect.h:19
TCS::MuonSelect::initialize
virtual TCS::StatusCode initialize() override
Definition: MuonSelect.cxx:39
TCS::StatusCode
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/L1TopoCommon/StatusCode.h:15
MuonTOBArray.h