ATLAS Offline Software
Loading...
Searching...
No Matches
NRPC_RawDataProviderTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONRPCCNVTOOLS_MUONNRPCRAWDATAPROVIDERTOOL_H
6#define MUONRPCCNVTOOLS_MUONNRPCRAWDATAPROVIDERTOOL_H
7
8#include <set>
9
12#include "GaudiKernel/ServiceHandle.h"
13#include "GaudiKernel/ToolHandle.h"
18#include "eformat/Issue.h"
19#include "eformat/SourceIdentifier.h"
20
22
23
25// Each ROB contains 6 e-links -> each e-link collects data from 3 TDCs (18 TDCs per ROB)
26// 1 ROB -> 1 Sector of BIS78
27//
28// Bytestream definitions (32 bits words)
29// word1 -> Number of words from e-link (3 TDCs): 6 (for empty) + 1 per hit
30// word2 -> e-link ID
31// word3 -> BCID
32// word4 -> L1ID + Counter from event counter reset
33// word5 -> hits (1 per word)
34// (...)
35// word(N-1) -> Trailer a0 + counters of hits in BCID+0, BCID+1, BCID+2
36// word(N) -> counters of hits in BCID+3, BCID+4, BCID+5, BCID+6
37//
38//-------------------------------------------------------------------------------------------
39//
40// -- BCID decoding (word3)
41// -- some inversions needed as follows, each letter represents 4 bits:
42// word: ab|cd|ef|gh
43// correct word: gh|ef|cd|ab
44// BCID: g|he|fc|da (last 4 bits "b" not used)
45//
46//
47// -- HITS decoding (word5 and following, when non empty)
48// -- some inversions needed as follows, each letter represents 4 bits:
49// word: ab|cd|ef|gh
50// correct word: gh|ef|cd|ab
51// TDC: gh
52// Channel: ef
53// Time over threshold: cd * 0.4 = ToT (ns)
54// BCID-hit: a (last 4 bits of real BCID of the hit, may be different from the nominal BCID)
55// time: b * 1.6 = time (ns)
56//
58
59
60namespace Muon {
61
62 class NRPC_RawDataProviderTool : public extends<AthAlgTool, IMuonRawDataProviderTool> {
63 public:
64 using base_class::base_class;
66 virtual ~NRPC_RawDataProviderTool() = default;
67
69 virtual StatusCode initialize() override;
70
72 virtual StatusCode convert(const EventContext& ctx) const override;
73 virtual StatusCode convert(const std::vector<IdentifierHash>& HashVec,
74 const EventContext& ctx) const override;
75 virtual StatusCode convert(const std::vector<uint32_t>& robIds,
76 const EventContext& ctx) const override;
78 virtual StatusCode convertIntoContainer(const ROBFragmentList& vecRobs,
79 const EventContext& ctx) const;
80
81 virtual StatusCode fillCollections(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment& robFrag, xAOD::NRPCRDOContainer& rdoIdc) const;
82
83 private:
85
86 SG::WriteHandleKey<xAOD::NRPCRDOContainer> m_rdoContainerKey{this, "NrpcRdoKey", "NRPCRDO", "WriteHandleKey for Output AOD::NRPCRDOContainer"};
87
88 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
89
90 // Rob Data Provider handle
91 ServiceHandle<IROBDataProviderSvc> m_robDataProvider{this, "ROBDataProviderSvc", "ROBDataProviderSvc"};
92
93 SG::ReadCondHandleKey<RpcCablingMap> m_readKey{this, "ReadKey", "MuonNRPC_CablingMap", "Key of MuonNRPC_CablingMap"};
94 };
95} // namespace Muon
96
97#endif
virtual StatusCode convert(const ROBFragmentList &) const
virtual StatusCode initialize() override
standard Athena-Algorithm method
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
virtual StatusCode fillCollections(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, xAOD::NRPCRDOContainer &rdoIdc) const
SG::WriteHandleKey< xAOD::NRPCRDOContainer > m_rdoContainerKey
virtual StatusCode convert() const
the new ones
OFFLINE_FRAGMENTS_NAMESPACE::PointerType BS
virtual ~NRPC_RawDataProviderTool()=default
default destructor
SG::ReadCondHandleKey< RpcCablingMap > m_readKey
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
virtual StatusCode convertIntoContainer(const ROBFragmentList &vecRobs, const EventContext &ctx) const
Convert method.
Property holding a SG store/key/clid from which a WriteHandle is made.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
const DataType * PointerType
Definition RawEvent.h:25
eformat::ROBFragment< PointerType > ROBFragment
Definition RawEvent.h:27
NRPCRDOContainer_v1 NRPCRDOContainer
Define the version of the NRPC RDO container.