ATLAS Offline Software
ChamberT0s.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCHAMBERT0S_CHAMBERT0S_H
6 #define MUONCHAMBERT0S_CHAMBERT0S_H
7 
8 #include "Identifier/Identifier.h"
10 #include <algorithm>
11 
12 namespace Muon {
17  class ChamberT0s {
18  public:
20  static constexpr float ChamberUnknown = -99999.9;
21 
23 
24  ChamberT0s( const std::vector< std::pair < Identifier, float > >& t0s ) ;
25  ChamberT0s( std::vector< std::pair < Identifier, float > >&& t0s ) ;
26 
28 
30  bool haveChamber(const Identifier& id) const;
31 
42  float getT0( const Identifier& id) const;
43 
47  const std::vector< std::pair < Identifier, float > >& getAllT0s() const;
48 
49  private:
50  std::vector< std::pair < Identifier, float > > m_t0s;
51  };
52 
53 inline bool ChamberT0s::haveChamber(const Identifier& id) const {
54  std::vector< std::pair < Identifier, float > >::const_iterator it
55  = std::find_if(m_t0s.begin(), m_t0s.end(),
56  [&] (const auto& p) { return p.first == id; });
57  return (it!=m_t0s.end());
58 }
59 
60 inline float ChamberT0s::getT0(const Identifier& id) const {
61  std::vector< std::pair < Identifier, float > >::const_iterator it
62  = std::find_if(m_t0s.begin(), m_t0s.end(),
63  [&] (const auto& p) { return p.first == id; });
64  if (it==m_t0s.end()) return ChamberUnknown; // No such chamber known.
65  return (it->second);
66 }
67 
68 inline const std::vector< std::pair < Identifier, float > >& ChamberT0s::getAllT0s() const {
69  return m_t0s;
70 }
71 
72 }
73 
74 CLASS_DEF( Muon::ChamberT0s , 42363316 , 1 )
75 
76 #endif
Muon::ChamberT0s::m_t0s
std::vector< std::pair< Identifier, float > > m_t0s
Definition: ChamberT0s.h:50
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Muon::ChamberT0s::ChamberUnknown
static constexpr float ChamberUnknown
Value returned by ChamberT0s::getT0(...) when chamber is not known to ChamberT0s.
Definition: ChamberT0s.h:20
Muon::ChamberT0s
Stores links between chambers and the reconstructed T0.
Definition: ChamberT0s.h:17
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
Muon::ChamberT0s::ChamberT0s
ChamberT0s()
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
Muon::ChamberT0s::getAllT0s
const std::vector< std::pair< Identifier, float > > & getAllT0s() const
Returns entire list of T0s.
Definition: ChamberT0s.h:68
Muon::ChamberT0s::~ChamberT0s
~ChamberT0s()
Muon::ChamberT0s::haveChamber
bool haveChamber(const Identifier &id) const
Returns true if we have the T0 for this chamber?
Definition: ChamberT0s.h:53
Muon::ChamberT0s::getT0
float getT0(const Identifier &id) const
Returns the T0 for this chamber (or ChamberT0s::ChamberUnknown if the chamber is not in list)
Definition: ChamberT0s.h:60
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
CLASS_DEF.h
macros to associate a CLID to a type