ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace 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
53inline 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
60inline 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
68inline const std::vector< std::pair < Identifier, float > >& ChamberT0s::getAllT0s() const {
69 return m_t0s;
70}
71
72}
73
74CLASS_DEF( Muon::ChamberT0s , 42363316 , 1 )
75
76#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Stores links between chambers and the reconstructed T0.
Definition ChamberT0s.h:17
std::vector< std::pair< Identifier, float > > m_t0s
Definition ChamberT0s.h:50
bool haveChamber(const Identifier &id) const
Returns true if we have the T0 for this chamber?
Definition ChamberT0s.h:53
static constexpr float ChamberUnknown
Value returned by ChamberT0s::getT0(...) when chamber is not known to ChamberT0s.
Definition ChamberT0s.h:20
const std::vector< std::pair< Identifier, float > > & getAllT0s() const
Returns entire list of T0s.
Definition ChamberT0s.h:68
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
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.