ATLAS Offline Software
Loading...
Searching...
No Matches
MuCalStreamerTool.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 TRIGL2MUONSA_MUCALSTREAMERTOOL_H
6#define TRIGL2MUONSA_MUCALSTREAMERTOOL_H
7
9#include "GaudiKernel/ServiceHandle.h"
10
11#include "MdtData.h"
12#include "RpcData.h"
13#include "TgcData.h"
14#include "TrackData.h"
15#include "MuCalCircClient.h"
22#include "xAODTrigger/MuonRoI.h"
25
26#include <fstream>
27#include <string>
28#include <vector>
29
30// --------------------------------------------------------------------------------
31// --------------------------------------------------------------------------------
32
33namespace LVL1 {
34 class RecMuonRoI;
35}
36
38 class MdtCalibFragment;
39 class RpcCalibFragment;
40 class TgcCalibFragment;
41}
42
43class RpcPad;
45
46inline unsigned bcBitmap(uint16_t bcTag) {
47 return (bcTag == 1 ? 4 :
48 ((bcTag == 0 || bcTag == 2) ? 2 :
49 (bcTag == 3 ? 1 : 0)));
50}
51
52namespace TrigL2MuonSA {
53
55 {
56 public:
57
58 MuCalStreamerTool(const std::string& type,
59 const std::string& name,
60 const IInterface* parent);
61
62 virtual StatusCode initialize() override;
63
64 const std::string& instanceName() const {return m_algInstanceName;}
65 void setInstanceName(const std::string& name) { m_algInstanceName = name; }
66
67 // set the properties
68 void setBufferName(const std::string& buffName) {m_calBufferName=buffName;}
69
70 // initialize the stream
71 StatusCode openStream(int calBufferSize);
72
73 //
74 // finalize and close the stream
75 StatusCode closeStream();
76
77 bool isStreamOpen();
78
79 //
80 // create the fragment corresponding to an roi
81 StatusCode createRoiFragment(const xAOD::MuonRoI* roi,
82 TrigL2MuonSA::TrackPattern& trackPattern,
83 TrigL2MuonSA::MdtHits& mdtHits,
84 TrigL2MuonSA::RpcHits& rpcHits,
85 TrigL2MuonSA::TgcHits& tgcHits,
86 std::vector<uint32_t>& localBuffer, // Add localBuffer parameter
87 bool doDataScouting,
88 const EventContext& ctx) const;
89
90 private:
91
92 Gaudi::Property< bool > m_writeToFile { this, "WriteToFile", false, "" };
93 SG::ReadHandleKey<TgcRdoContainer> m_tgcRdoKey{this, "TgcRdoContainer", "TGCRDO", "Tgc RDO Input"};
94 SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{ this, "EventInfoKey", "EventInfo", "" };
95 SG::ReadHandleKey<RpcPadContainer> m_rpcPadKey{this, "RpcPadContainerKey", "RPCPAD", "RpcPad container fro MuCalStreamerTool"};
96
97 // name of the calibration buffer or of the
98 // output file
99 std::string m_calBufferName;
100 std::string m_algInstanceName;
101
102 // output file
103 std::ofstream m_outputFile;
104
105 // the region selector
106
107 ToolHandle<IRegSelTool> m_regSel_MDT{this, "RegSel_MDT", "RegSelTool/RegSelTool_MDT", "MDT Region Selector Tool"};
108 ToolHandle<IRegSelTool> m_regSel_TGC{this, "RegSel_TGC", "RegSelTool/RegSelTool_TGC", "TGC Region Selector Tool"};
109
110 SG::ReadCondHandleKey<RpcCablingCondData> m_readKey{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
111
112 // create the MDT fragment
113 StatusCode createMdtFragment(TrigL2MuonSA::MdtHits& mdtHits,
114 LVL2_MUON_CALIBRATION::MdtCalibFragment& mdtFragment, float phi) const;
115
116 // create the RPC fragment
117 StatusCode createRpcFragment(const xAOD::MuonRoI* roi,
118 LVL2_MUON_CALIBRATION::RpcCalibFragment& rpcFragment, const EventContext& ctx) const;
119
120 // create the TGC fragment
121 StatusCode createTgcFragment(std::vector<uint32_t>& tgcRobIdList,
122 LVL2_MUON_CALIBRATION::TgcCalibFragment& tgcFragment, const EventContext& ctx) const;
123
125
126 };
127
128} // namespace TrigL2MuonSA
129
130#endif //
Scalar phi() const
phi method
unsigned bcBitmap(uint16_t bcTag)
Property holding a SG store/key/clid from which a ReadHandle is made.
unsigned bcTag(unsigned bcBitMap)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
This class defines the reconstructed Muon ROI.
Definition RecMuonRoI.h:60
Property holding a SG store/key/clid from which a ReadHandle is made.
StatusCode createTgcFragment(std::vector< uint32_t > &tgcRobIdList, LVL2_MUON_CALIBRATION::TgcCalibFragment &tgcFragment, const EventContext &ctx) const
ToolHandle< IRegSelTool > m_regSel_MDT
void setBufferName(const std::string &buffName)
StatusCode createMdtFragment(TrigL2MuonSA::MdtHits &mdtHits, LVL2_MUON_CALIBRATION::MdtCalibFragment &mdtFragment, float phi) const
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
void setInstanceName(const std::string &name)
StatusCode createRpcFragment(const xAOD::MuonRoI *roi, LVL2_MUON_CALIBRATION::RpcCalibFragment &rpcFragment, const EventContext &ctx) const
SG::ReadCondHandleKey< RpcCablingCondData > m_readKey
MuCalStreamerTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< bool > m_writeToFile
ToolHandle< IRegSelTool > m_regSel_TGC
virtual StatusCode initialize() override
SG::ReadHandleKey< TgcRdoContainer > m_tgcRdoKey
StatusCode openStream(int calBufferSize)
StatusCode createRoiFragment(const xAOD::MuonRoI *roi, TrigL2MuonSA::TrackPattern &trackPattern, TrigL2MuonSA::MdtHits &mdtHits, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::TgcHits &tgcHits, std::vector< uint32_t > &localBuffer, bool doDataScouting, const EventContext &ctx) const
SG::ReadHandleKey< RpcPadContainer > m_rpcPadKey
TrigL2MuonSA::MuCalCircClient * m_circ
const std::string & instanceName() const
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
std::vector< MdtHitData > MdtHits
Definition MdtData.h:56
std::vector< RpcHitData > RpcHits
Definition RpcData.h:57
std::vector< TgcHitData > TgcHits
Definition TgcData.h:43
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15