ATLAS Offline Software
Loading...
Searching...
No Matches
ChamberT0s.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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#include <vector>
12#include <utility> //for std::pair
13
14namespace Muon {
19 class ChamberT0s {
20 public:
22 static constexpr float ChamberUnknown = -99999.9;
23
24 ChamberT0s() = default;
25
26 ChamberT0s( const std::vector< std::pair < Identifier, float > >& t0s );
27 ChamberT0s( std::vector< std::pair < Identifier, float > >&& t0s ) ;
28
29
31 bool haveChamber(const Identifier& id) const;
32
43 float getT0( const Identifier& id) const;
44
48 const std::vector< std::pair < Identifier, float > >& getAllT0s() const;
49
50 private:
51 std::vector< std::pair < Identifier, float > > m_t0s;
52 };
53
54inline bool ChamberT0s::haveChamber(const Identifier& id) const {
55 auto it = std::ranges::find(m_t0s, id, &std::pair<Identifier, float>::first);
56 return (it!=m_t0s.end());
57}
58
59inline float ChamberT0s::getT0(const Identifier& id) const {
60 auto it = std::ranges::find(m_t0s, id, &std::pair<Identifier, float>::first);
61 if (it==m_t0s.end()) return ChamberUnknown; // No such chamber known.
62 return (it->second);
63}
64
65inline const std::vector< std::pair < Identifier, float > >& ChamberT0s::getAllT0s() const {
66 return m_t0s;
67}
68
69}
70
71CLASS_DEF( Muon::ChamberT0s , 42363316 , 1 )
72
73#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:19
std::vector< std::pair< Identifier, float > > m_t0s
Definition ChamberT0s.h:51
bool haveChamber(const Identifier &id) const
Returns true if we have the T0 for this chamber?
Definition ChamberT0s.h:54
static constexpr float ChamberUnknown
Value returned by ChamberT0s::getT0(...) when chamber is not known to ChamberT0s.
Definition ChamberT0s.h:22
const std::vector< std::pair< Identifier, float > > & getAllT0s() const
Returns entire list of T0s.
Definition ChamberT0s.h:65
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:59
ChamberT0s()=default
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.