ATLAS Offline Software
Loading...
Searching...
No Matches
TBByteStreamCnvTool.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TESTBEAM_BYTESTREAMTOOL_H
8#define TESTBEAM_BYTESTREAMTOOL_H
9
10#include <stdint.h>
11#include <string>
12
15#include "EventInfo/EventInfo.h"
16#include "EventInfo/EventID.h"
19#include "TBEvent/TBTDC.h"
28#include "TBEvent/TBEventInfo.h"
32
34
35#include "eformat/SourceIdentifier.h"
36
38class LArOnlineID;
39
44
45
46
48public:
49
52 TBByteStreamCnvTool( const std::string& type, const std::string& name,
53 const IInterface* parent ) ;
54
55 static const InterfaceID& interfaceID( ) ;
56
57 virtual StatusCode initialize();
58 virtual StatusCode finalize();
59
60
61
62 StatusCode WriteFragment();
63 StatusCode ReadFragment(int unrec_code);
64 StatusCode ReadFragment(TBTDC*& tdc,const std::string& key);
65 StatusCode ReadFragment(TBTDCRawCont*& tdcrawCont,const std::string& key);
66 StatusCode ReadFragment(TBADCRawCont*& adcrawCont,const std::string& key);
67 StatusCode ReadFragment(TBBPCRawCont*& bpcrawCont,const std::string& key);
68 StatusCode ReadFragment(TBMWPCRawCont*& mwpcrawCont,const std::string& key);
69 StatusCode ReadFragment(TBTriggerPatternUnit*& trigpat,const std::string& key);
70 StatusCode ReadFragment(TBScintillatorRawCont*& scintrawCont,const std::string& key);
71 StatusCode ReadFragment(TBTailCatcherRaw*& tailcatchraw,const std::string& key);
72 StatusCode ReadFragment(TBEventInfo*& tbeventinfo,const std::string& key);
73 StatusCode ReadFragment(TBLArDigitContainer*& tblardigitcont,const std::string& key);
74 StatusCode ReadFragment(TBLArCalibDigitContainer*& tblarcalibdigitcont,const std::string& key);
75
76 StatusCode BuildRODBlock(std::vector<uint32_t>* theRODBlock);
77 StatusCode GetRODBlock(eformat::SubDetector subdet_id,
78 eformat::SubDetector subdet_rod_id=m_DontCheckRodSubDetID);
79
80 StatusCode H6BuildObjects(int unrec_code);
81 StatusCode H6RecordObjects(int unrec_code);
82 StatusCode H8BuildObjects(int unrec_code);
83
84
85
86
87private:
88
89 static const eformat::SubDetector m_DontCheckRodSubDetID; //==0xff
90
94 eformat::SubDetector m_subdet_id{};
95 std::vector<uint32_t> m_rodBlock; //For reading only : data fragment
97
98 // event fragments for writing
99 std::vector<uint32_t> * m_theRodBlock{};
101
102 bool m_H6run{};
103 bool m_H8run{};
105 bool m_dump{};
106 std::vector<std::string> m_keys;
108
109 // H6 SubFragment navigation :
113
116 if(m_subfrag_firstdata<int(m_rodBlock.size())){
119 return true;
120 }else return false;
121 }
122
124 {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"};
125
126 // pointers to raw objects :
138
139
140 // MiniROD members
141 std::vector<int> m_boards;
142 std::vector<int> m_samples;
143 std::vector<int> m_gains;
144 std::vector<int> m_febgain;
145 std::vector<int> m_firstsamples;
146 std::vector<short> m_arrayofsample[128][4]; // 128 channels, 4 possible gain mode
147 CaloGain::CaloGain m_arrayofgain[128][4]{}; // 128 channels.
148
149
151 switch(gain){
152 case 0:
154 case 1:
156 case 2:
158 default:
160 }
161 }
162
163
164
165 // Calibration runs :
166 bool m_isCalib{};
167 unsigned char m_calib_pattern[16]{};
168 uint16_t m_calib_dac{};
169 uint16_t m_calib_delay{};
170 bool m_calib_error{}; //m_calib_isPulsed{};
171
172
173 // Run - Event Info :
174
176 unsigned int m_run_num{};
178 std::string m_beam_part;
179 float m_cryoX{};
180 float m_cryoAngle{};
181 float m_tableY{};
182 std::string m_summary_path;
183
184
185
186 // H8 trigger word
187 unsigned int m_h8_triggword{};
188
189 // Word manipulation :
190 unsigned short firstword(unsigned int w){
191 return 65535 & w;
192 }
193 unsigned short secondword(unsigned int w){
194 return w >> 16;
195 }
196
197 unsigned short firstnbit(int n,unsigned short w){
198 unsigned short tmp=0;
199 for(unsigned short i=0;i<n;i++) tmp = tmp | (1<<i);
200 return (w & tmp);
201 }
202
203 bool testbit(int n,unsigned short w){
204 return (w & (1<<n));
205 }
206
207};
208
209#endif
210
211
212
213
214
215
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition EventID.h:35
Interface class for managing ROB for both online and offline.
"TBEvent/TBADCRawCont.h"
"TBEvent/TBBPCRawCont.h"
unsigned short secondword(unsigned int w)
CaloGain::CaloGain m_arrayofgain[128][4]
bool testbit(int n, unsigned short w)
const LArOnlineID * m_onlineHelper
std::vector< uint32_t > m_rodBlock
unsigned short firstword(unsigned int w)
std::vector< int > m_boards
StatusCode H6BuildObjects(int unrec_code)
std::vector< int > m_firstsamples
std::vector< uint32_t > * m_theRodBlock
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
ServiceHandle< IByteStreamEventAccess > m_ByteStreamEventAccess
StatusCode H8BuildObjects(int unrec_code)
TBMWPCRawCont * m_mwpcrawCont
TBByteStreamCnvTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
eformat::SubDetector m_subdet_id
ServiceHandle< IROBDataProviderSvc > m_rdpSvc
StatusCode BuildRODBlock(std::vector< uint32_t > *theRODBlock)
TBTailCatcherRaw * m_tailcatchraw
TBScintillatorRawCont * m_scintrawCont
std::vector< int > m_gains
CaloGain::CaloGain getCaloGain(int gain)
std::vector< int > m_febgain
std::vector< std::string > m_keys
static const eformat::SubDetector m_DontCheckRodSubDetID
TBLArCalibDigitContainer * m_tblarcalibdigitcont[4]
unsigned short firstnbit(int n, unsigned short w)
virtual StatusCode finalize()
unsigned char m_calib_pattern[16]
std::vector< short > m_arrayofsample[128][4]
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * m_theROB
std::vector< int > m_samples
static const InterfaceID & interfaceID()
StatusCode ReadFragment(int unrec_code)
TBTriggerPatternUnit * m_trigpat
virtual StatusCode initialize()
StatusCode GetRODBlock(eformat::SubDetector subdet_id, eformat::SubDetector subdet_rod_id=m_DontCheckRodSubDetID)
TBLArDigitContainer * m_tblardigitcont[4]
StatusCode H6RecordObjects(int unrec_code)
Liquid Argon Calibration Digit Container
"TBEvent/TBMWPCRawCont.h"
"TBEvent/TBScintillatorRawCont.h"
"TBEvent/TBTDCRawCont.h"
Definition TBTDC.h:17
@ LARMEDIUMGAIN
Definition CaloGain.h:18
@ LARLOWGAIN
Definition CaloGain.h:18
@ UNKNOWNGAIN
Definition CaloGain.h:20
@ LARHIGHGAIN
Definition CaloGain.h:18
eformat::write::ROBFragment ROBFragment
Definition RawEvent.h:33