ATLAS Offline Software
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 
33 namespace LVL1 {
34  class RecMuonRoI;
35 }
36 
38  class MdtCalibFragment;
39  class RpcCalibFragment;
40  class TgcCalibFragment;
41 }
42 
43 class RpcPad;
44 class ROBDataProviderSvc;
45 
46 inline unsigned bcBitmap(uint16_t bcTag) {
47  return (bcTag == 1 ? 4 :
48  ((bcTag == 0 || bcTag == 2) ? 2 :
49  (bcTag == 3 ? 1 : 0)));
50 }
51 
52 namespace 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  std::vector<int>* getLocalBuffer() {return &m_localBuffer;}
71  int getLocalBufferSize() const {return m_localBuffer.size();}
72  /* void clearLocalBuffer(); */
73 
74  //
75  // initialize the stream
76  StatusCode openStream(int calBufferSize);
77 
78  //
79  // finalize and close the stream
81 
82  bool isStreamOpen();
83 
84  //
85  // create the fragment corresponding to an roi
87  TrigL2MuonSA::TrackPattern& trackPattern,
88  TrigL2MuonSA::MdtHits& mdtHits,
89  TrigL2MuonSA::RpcHits& rpcHits,
90  TrigL2MuonSA::TgcHits& tgcHits,
91  //int calBufferSize,
92  bool doDataScouting,
93  bool& updateTriggerElement, const EventContext& ctx) const;
94 
95  private:
96 
97  Gaudi::Property< bool > m_writeToFile { this, "WriteToFile", false, "" };
98  SG::ReadHandleKey<TgcRdoContainer> m_tgcRdoKey{this, "TgcRdoContainer", "TGCRDO", "Tgc RDO Input"};
99  SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey{ this, "EventInfoKey", "EventInfo", "" };
100  SG::ReadHandleKey<RpcPadContainer> m_rpcPadKey{this, "RpcPadContainerKey", "RPCPAD", "RpcPad container fro MuCalStreamerTool"};
101 
102  // name of the calibration buffer or of the
103  // output file
104  std::string m_calBufferName;
105  std::string m_algInstanceName;
106 
107  // output file
108  std::ofstream m_outputFile;
109 
110 
111 
112  // the region selector
113 
114  ToolHandle<IRegSelTool> m_regSel_MDT{this, "RegSel_MDT", "RegSelTool/RegSelTool_MDT", "MDT Region Selector Tool"};
115  ToolHandle<IRegSelTool> m_regSel_TGC{this, "RegSel_TGC", "RegSelTool/RegSelTool_TGC", "TGC Region Selector Tool"};
116 
117 
118 
119  SG::ReadCondHandleKey<RpcCablingCondData> m_readKey{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
120 
121 
122 
123  // local buffer for the TrigComposite object
125  std::vector<int> m_localBuffer;
126 
127  //
128  // create the MDT fragment
130  LVL2_MUON_CALIBRATION::MdtCalibFragment& mdtFragment, float phi) const;
131 
132  //
133  // create the RPC fragment
135  LVL2_MUON_CALIBRATION::RpcCalibFragment& rpcFragment, const EventContext& ctx) const;
136 
137  //
138  // create the TGC fragment
139  StatusCode createTgcFragment(std::vector<uint32_t>& tgcRobIdList,
140  LVL2_MUON_CALIBRATION::TgcCalibFragment& tgcFragment) const;
141 
142 
143 
145 
146  };
147 
148 } // namespace TrigL2MuonSA
149 
150 #endif //
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
IRegSelTool.h
TrigL2MuonSA::MuCalCircClient
Definition: MuCalCircClient.h:28
TrigL2MuonSA::MuCalStreamerTool::closeStream
StatusCode closeStream()
Definition: MuCalStreamerTool.cxx:85
TrigL2MuonSA::RpcHits
std::vector< RpcHitData > RpcHits
Definition: RpcData.h:57
LVL2_MUON_CALIBRATION
Definition: MuCalStreamerTool.h:37
TrigL2MuonSA::MuCalStreamerTool::createRpcFragment
StatusCode createRpcFragment(const xAOD::MuonRoI *roi, LVL2_MUON_CALIBRATION::RpcCalibFragment &rpcFragment, const EventContext &ctx) const
Definition: MuCalStreamerTool.cxx:283
TrigL2MuonSA::MuCalStreamerTool::initialize
virtual StatusCode initialize() override
Definition: MuCalStreamerTool.cxx:30
MdtData.h
IMuonRawDataProviderTool.h
TrigL2MuonSA::MdtHits
std::vector< MdtHitData > MdtHits
Definition: MdtData.h:57
TrigL2MuonSA::TgcHits
std::vector< TgcHitData > TgcHits
Definition: TgcData.h:43
TrigL2MuonSA::MuCalStreamerTool::getLocalBufferSize
int getLocalBufferSize() const
Definition: MuCalStreamerTool.h:71
TrackData.h
SG::ReadHandleKey< TgcRdoContainer >
TrigL2MuonSA::MuCalStreamerTool::openStream
StatusCode openStream(int calBufferSize)
Definition: MuCalStreamerTool.cxx:54
LVL1
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...
Definition: ICMMCPHitsCnvTool.h:18
RpcData.h
TrigL2MuonSA::TrackPattern
Definition: TrackData.h:16
TrigL2MuonSA::MuCalStreamerTool::m_circ
TrigL2MuonSA::MuCalCircClient * m_circ
Definition: MuCalStreamerTool.h:144
TrigL2MuonSA::MuCalStreamerTool::createRoiFragment
StatusCode createRoiFragment(const xAOD::MuonRoI *roi, TrigL2MuonSA::TrackPattern &trackPattern, TrigL2MuonSA::MdtHits &mdtHits, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::TgcHits &tgcHits, bool doDataScouting, bool &updateTriggerElement, const EventContext &ctx) const
Definition: MuCalStreamerTool.cxx:111
TrigL2MuonSA::MuCalStreamerTool::createTgcFragment
StatusCode createTgcFragment(std::vector< uint32_t > &tgcRobIdList, LVL2_MUON_CALIBRATION::TgcCalibFragment &tgcFragment) const
Definition: MuCalStreamerTool.cxx:368
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TrigL2MuonSA::MuCalStreamerTool::m_calBufferName
std::string m_calBufferName
Definition: MuCalStreamerTool.h:104
TrigL2MuonSA::MuCalStreamerTool::setBufferName
void setBufferName(const std::string &buffName)
Definition: MuCalStreamerTool.h:68
TrigL2MuonSA::MuCalStreamerTool::m_tgcRdoKey
SG::ReadHandleKey< TgcRdoContainer > m_tgcRdoKey
Definition: MuCalStreamerTool.h:98
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
xAOD::MuonRoI_v1
Class describing a LVL1 muon region of interest.
Definition: MuonRoI_v1.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::MuCalStreamerTool::m_readKey
SG::ReadCondHandleKey< RpcCablingCondData > m_readKey
Definition: MuCalStreamerTool.h:119
TrigL2MuonSA::MuCalStreamerTool
Definition: MuCalStreamerTool.h:55
TgcRdoContainer.h
ReadCondHandleKey.h
TrigL2MuonSA::MuCalStreamerTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: MuCalStreamerTool.h:99
ROBDataProviderSvc
Definition: ROBDataProviderSvc.h:37
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuCalCircClient.h
TgcData.h
RpcPad
Definition: RpcPad.h:21
EventInfo.h
TrigL2MuonSA::MuCalStreamerTool::setInstanceName
void setInstanceName(const std::string &name)
Definition: MuCalStreamerTool.h:65
bcBitmap
unsigned bcBitmap(uint16_t bcTag)
Definition: MuCalStreamerTool.h:46
SG::ReadCondHandleKey< RpcCablingCondData >
TrigL2MuonSA::MuCalStreamerTool::m_regSel_MDT
ToolHandle< IRegSelTool > m_regSel_MDT
Definition: MuCalStreamerTool.h:114
RpcCablingCondData.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonRoI.h
bcTag
unsigned bcTag(unsigned bcBitMap)
Definition: TgcByteStreamData.h:359
TrigL2MuonSA::MuCalStreamerTool::m_writeToFile
Gaudi::Property< bool > m_writeToFile
Definition: MuCalStreamerTool.h:97
TrigL2MuonSA::MuCalStreamerTool::MuCalStreamerTool
MuCalStreamerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MuCalStreamerTool.cxx:20
TrigL2MuonSA::MuCalStreamerTool::m_outputFile
std::ofstream m_outputFile
Definition: MuCalStreamerTool.h:108
RpcPadContainer.h
AthAlgTool
Definition: AthAlgTool.h:26
TrigL2MuonSA::MuCalStreamerTool::isStreamOpen
bool isStreamOpen()
Definition: MuCalStreamerTool.cxx:105
TrigL2MuonSA::MuCalStreamerTool::m_localBufferSize
int m_localBufferSize
Definition: MuCalStreamerTool.h:124
TrigL2MuonSA::MuCalStreamerTool::m_algInstanceName
std::string m_algInstanceName
Definition: MuCalStreamerTool.h:105
TrigL2MuonSA::MuCalStreamerTool::getLocalBuffer
std::vector< int > * getLocalBuffer()
Definition: MuCalStreamerTool.h:70
TrigL2MuonSA::MuCalStreamerTool::m_regSel_TGC
ToolHandle< IRegSelTool > m_regSel_TGC
Definition: MuCalStreamerTool.h:115
TrigL2MuonSA::MuCalStreamerTool::m_rpcPadKey
SG::ReadHandleKey< RpcPadContainer > m_rpcPadKey
Definition: MuCalStreamerTool.h:100
TrigL2MuonSA::MuCalStreamerTool::m_localBuffer
std::vector< int > m_localBuffer
Definition: MuCalStreamerTool.h:125
TrigL2MuonSA::MuCalStreamerTool::instanceName
const std::string & instanceName() const
Definition: MuCalStreamerTool.h:64
TrigL2MuonSA::MuCalStreamerTool::createMdtFragment
StatusCode createMdtFragment(TrigL2MuonSA::MdtHits &mdtHits, LVL2_MUON_CALIBRATION::MdtCalibFragment &mdtFragment, float phi) const
Definition: MuCalStreamerTool.cxx:241
TrigL2MuonSA
Definition: AlignmentBarrelLUT.h:13