ATLAS Offline Software
MuonHoughHitContainer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 void MuonHoughHitContainer::addHit(const std::shared_ptr<MuonHoughHit>& hit) {
9  if (hit->getId() == -1) { hit->setId(size()); }
10  m_hit.push_back(hit);
11 }
12 
13 void MuonHoughHitContainer::removeHit(unsigned int hitno) {
14  if (hitno >= m_hit.size()) { throw std::runtime_error("MuonHoughHitContainer::range error!"); }
15 
16  m_hit.erase(m_hit.begin() + hitno);
17 }
18 
20  int rpchitno = 0;
21  for (unsigned int i = 0; i < m_hit.size(); i++) { rpchitno += getDetectorId(i) == MuonHough::RPC; }
22  return rpchitno;
23 }
24 
26  int mdthitno = 0;
27  for (unsigned int i = 0; i < m_hit.size(); i++) { mdthitno += getDetectorId(i) == MuonHough::MDT; }
28  return mdthitno;
29 }
30 
32  int rpchitno = 0;
33  for (unsigned int i = 0; i < m_hit.size(); i++) { rpchitno += getDetectorId(i) == MuonHough::RPC && !getMeasuresPhi(i); }
34  return rpchitno;
35 }
36 
38  int cschitno = 0;
39  for (unsigned int i = 0; i < m_hit.size(); i++) { cschitno += getDetectorId(i) == MuonHough::CSC; }
40  return cschitno;
41 }
42 
44  int tgchitno = 0;
45  for (unsigned int i = 0; i < m_hit.size(); i++) { tgchitno += getDetectorId(i) == MuonHough::TGC; }
46  return tgchitno;
47 }
MuonHough::CSC
@ CSC
Definition: MuonHoughHit.h:17
MuonHoughHitContainer::getMeasuresPhi
bool getMeasuresPhi(unsigned int hitno) const
returns if hit hitno measures phi
Definition: MuonHoughHitContainer.h:109
MuonHoughHitContainer::m_hit
std::vector< std::shared_ptr< MuonHoughHit > > m_hit
vector of hits in container
Definition: MuonHoughHitContainer.h:86
MuonHoughHit::setId
void setId(int id)
set id
Definition: MuonHoughHit.h:178
MuonHoughHitContainer::addHit
void addHit(const std::shared_ptr< MuonHoughHit > &hit)
add hit to container
Definition: MuonHoughHitContainer.cxx:8
MuonHoughHitContainer::getRPCetahitno
int getRPCetahitno() const
returns number of rpc eta hits in container
Definition: MuonHoughHitContainer.cxx:31
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonHoughHitContainer::size
unsigned int size() const
returns size of hitcontainer
Definition: MuonHoughHitContainer.h:104
MuonHoughHitContainer.h
MuonHoughHitContainer::getRPChitno
int getRPChitno() const
returns number of rpc hits in container
Definition: MuonHoughHitContainer.cxx:19
MuonHough::RPC
@ RPC
Definition: MuonHoughHit.h:17
MuonHoughHitContainer::getDetectorId
MuonHough::DetectorTechnology getDetectorId(unsigned int hitno) const
returns detectortechnology of hit hitno
Definition: MuonHoughHitContainer.h:107
MuonHough::TGC
@ TGC
Definition: MuonHoughHit.h:17
MuonHoughHitContainer::getTGChitno
int getTGChitno() const
returns number of tgc hits in container
Definition: MuonHoughHitContainer.cxx:43
MuonHoughHitContainer::getMDThitno
int getMDThitno() const
returns number of mdt hits in container
Definition: MuonHoughHitContainer.cxx:25
MuonHoughHitContainer::removeHit
void removeHit(unsigned int hitno)
remove hit from container
Definition: MuonHoughHitContainer.cxx:13
MuonHoughHitContainer::getCSChitno
int getCSChitno() const
returns number of csc hits in container
Definition: MuonHoughHitContainer.cxx:37
MuonHough::MDT
@ MDT
Definition: MuonHoughHit.h:17
MuonHoughHit::getId
int getId() const
returns id
Definition: MuonHoughHit.h:156