ATLAS Offline Software
Loading...
Searching...
No Matches
PixelRawContByteStreamTool Class Reference

#include <PixelRawContByteStreamTool.h>

Inheritance diagram for PixelRawContByteStreamTool:
Collaboration diagram for PixelRawContByteStreamTool:

Public Member Functions

 PixelRawContByteStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~PixelRawContByteStreamTool ()
virtual StatusCode initialize () override
virtual StatusCode finalize () override
StatusCode convert (PixelRDO_Container *cont) const
void fillROD (std::vector< uint32_t > &v32rod, std::vector< const PixelRDORawData * > RDOs, int BCs_per_LVL1ID) const
void packIBLcondensed (std::vector< uint32_t > &v32rod, std::vector< uint32_t > &vRows, std::vector< uint32_t > &vCols, std::vector< int > &vTots) const
void packIBLCondensed (std::vector< uint32_t > &v32rod, const std::vector< const PixelRDORawData * > &rdos_sameIBL_offlineId)
uint32_t packLinkHeader (uint32_t module, uint32_t bcid, uint32_t lvl1id, uint32_t lvl1idskip, uint32_t errors) const
uint32_t packLinkHeader_IBL (uint32_t module, uint32_t bcid, uint32_t lvl1id, uint32_t feFlag) const
uint32_t packRawDataWord (uint32_t FE, uint32_t row, uint32_t column, uint32_t ToT) const
uint32_t packRawDataWord_IBL (uint32_t row, uint32_t column, int ToT, uint32_t nLink) const
uint32_t packLinkTrailer (uint32_t errors) const
uint32_t packLinkTrailer_IBL (uint32_t FEonSLink, bool timeOutErrorBit, bool condensedModeBit, bool linkMasked) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< IByteStreamCnvSvcm_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
ServiceHandle< InDetDD::IPixelReadoutManagerm_pixelReadout { this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
const PixelIDm_PixelID {}
const InDetDD::PixelDetectorManagerm_pixelManager {}
unsigned short m_RodBlockVersion {}
int m_BCs_per_LVL1ID {}
SG::ReadCondHandleKey< PixelCablingCondDatam_condCablingKey {this, "PixelCablingCondData", "PixelCablingCondData", "Pixel cabling key"}
SG::ReadCondHandleKey< PixelHitDiscCnfgDatam_condHitDiscCnfgKey {this, "PixelHitDiscCnfgData", "PixelHitDiscCnfgData", "Pixel FEI4 HitDiscConfig key"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 41 of file PixelRawContByteStreamTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ PixelRawContByteStreamTool()

PixelRawContByteStreamTool::PixelRawContByteStreamTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 27 of file PixelRawContByteStreamTool.cxx.

27 :
28 AthAlgTool(type,name,parent)
29{
30 declareInterface<PixelRawContByteStreamTool>(this);
31 declareProperty("RodBlockVersion",m_RodBlockVersion=0);
32 declareProperty("BCs_per_LVL1ID",m_BCs_per_LVL1ID=1);
33}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~PixelRawContByteStreamTool()

PixelRawContByteStreamTool::~PixelRawContByteStreamTool ( )
virtual

Definition at line 38 of file PixelRawContByteStreamTool.cxx.

38 {
39}

Member Function Documentation

◆ convert()

StatusCode PixelRawContByteStreamTool::convert ( PixelRDO_Container * cont) const

Definition at line 70 of file PixelRawContByteStreamTool.cxx.

70 {
71 FullEventAssembler<SrcIdMap>* fea = nullptr;
72 ATH_CHECK( m_byteStreamCnvSvc->getFullEventAssembler (fea,
73 "PixelRawCont") );
75
76 // set ROD Minor version
78 ATH_MSG_DEBUG("Setting ROD Minor Version Number to: " << m_RodBlockVersion);
79
80 //loop over the Pixel modules
82 PixelRDO_Container::const_iterator it_coll_end = cont->end();
83 ATH_MSG_DEBUG("Found " << cont->size() << " Pixel modules");
84
85 SG::ReadCondHandle<PixelCablingCondData> pixCabling(m_condCablingKey);
86 if (not pixCabling.isValid()){
87 ATH_MSG_ERROR("The pixel cabling could not be retrieved in PixelRawContByteStreamTool::convert");
88 return StatusCode::FAILURE;
89 }
90 for( ; it_coll!=it_coll_end;++it_coll) {
91 const InDetRawDataCollection<PixelRDORawData>* coll = (*it_coll) ;
92
93 // get OfflineId and RODID
94 if (coll != nullptr){
95 Identifier offlineId = coll->identify();
96 uint32_t rodId = pixCabling->find_entry_offrob(offlineId);
97 if (rodId<1) {
98 ATH_MSG_ERROR("Didn't found ROBID for OfflineID: 0x" << std::hex << offlineId << std::dec);
99 }
100
101 // loop over the HITS
104
105 std::vector<const PixelRDORawData*> RDOs;
106 for(; it_b!=it_e; ++it_b){ RDOs.push_back((*it_b)); }
107
108 theROD = fea->getRodData(rodId);
109 fillROD( *theROD, RDOs, m_BCs_per_LVL1ID);
110
111 }
112 else {
113 ATH_MSG_WARNING("IDC contains NULLpointer to collection, skipping collection");
114 }
115 }
116 return StatusCode::SUCCESS;
117}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
const_iterator end() const
return const_iterator for end of container
size_t size() const
Duplicate of fullSize for backwards compatability.
const_iterator begin() const
return const_iterator for first entry
virtual Identifier identify() const override final
void fillROD(std::vector< uint32_t > &v32rod, std::vector< const PixelRDORawData * > RDOs, int BCs_per_LVL1ID) const
ServiceHandle< IByteStreamCnvSvc > m_byteStreamCnvSvc
SG::ReadCondHandleKey< PixelCablingCondData > m_condCablingKey
setEventNumber uint32_t

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ fillROD()

void PixelRawContByteStreamTool::fillROD ( std::vector< uint32_t > & v32rod,
std::vector< const PixelRDORawData * > RDOs,
int BCs_per_LVL1ID ) const

Definition at line 130 of file PixelRawContByteStreamTool.cxx.

130 {
131 ATH_MSG_DEBUG("#####################################################################################");
132 ATH_MSG_DEBUG("Entering PixelRodEncoder");
133
134 // Loop over the Hits in a ROD
135 std::vector<const PixelRDORawData*>::iterator rdo_it = RDOs.begin();
136 std::vector<const PixelRDORawData*>::iterator rdo_it_end = RDOs.end();
137
138 bool is_ibl_present = false;
139
140 const InDetDD::SiNumerology& pixSiNum = m_pixelManager->numerology();
141 is_ibl_present = (pixSiNum.numLayers() == 4);
142 ATH_MSG_DEBUG("is_ibl_present = " << is_ibl_present);
143 ATH_MSG_DEBUG("pixSiNum.numLayers() = " << pixSiNum.numLayers());
144
145 bool is_ibl_module = false;
146 bool is_dbm_module = false;
147 ATH_MSG_DEBUG("in fillROD with " << BCs_per_LVL1ID << " LVL1As");
148 ATH_MSG_DEBUG("Dimension of the RDO vector: " << RDOs.size());
149
150 int hitDiscCnfg = 2;
151
152 SG::ReadCondHandle<PixelCablingCondData> pixCabling(m_condCablingKey);
153 std::unique_ptr<SG::ReadCondHandle<PixelHitDiscCnfgData> > pixHitDiscCnfg;
154
155 // ordering of the elements of the RDOs vector by offlineId, n5
156 if (rdo_it != rdo_it_end) {
157 OrderInitialRdos orderInitialRdos(m_pixelReadout, m_PixelID, pixCabling);
158 std::sort(rdo_it, rdo_it_end, orderInitialRdos);
159 }
160 // end of ordering of the elements of the RDOs vector by offlineId, n5
161 // NOW the RDOs should be ordered following (1) the offlineId, (2) the FE number
162
163 rdo_it = RDOs.begin();
164 if (rdo_it!=rdo_it_end) {
165 const PixelRDORawData* rawdata;
166 Identifier offlineId;
167 Identifier prev_offlineId(0x0);
168 Identifier pixelId;
169 bool timing_error = false;
170 bool condensedMode = false;
171 bool linkMasked = false;
172 uint32_t linknumber(0);
173 uint32_t FE(0);
174 uint32_t sLink(0);
175 uint32_t n5(0);
176 uint32_t prev_n5(0);
177
178 int last_BCID = 0; // needed for encoding of timing information
179 while (rdo_it!=rdo_it_end) {
180 ATH_MSG_DEBUG("Inside cycle on the rdo_it");
181
182 rawdata = (*rdo_it);
183 pixelId = rawdata->identify();
184 offlineId = m_PixelID->wafer_id(pixelId);
185
186 uint32_t robId = pixCabling->find_entry_offrob(offlineId);
187 uint64_t onlineId = pixCabling->find_entry_offon(offlineId); // (32bit) working on modules, not on single pixels
188
189 linknumber = (onlineId >> 24) & 0xFFFF;
190
191 // All these functions below are methods of the class PixelRDORawData, InnerDetector/InDetRawEvent/InDetRawData
192 int TOT = rawdata->getToT(); // it returns a 8 bits "word"
193 int BCID = rawdata->getBCID();
194 int LVL1ID = rawdata->getLVL1ID();
195 int LVL1A = rawdata->getLVL1A();
196
197 if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_PLANAR || m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_3D) {
198 is_ibl_module = true;
199 }
200 if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::DBM) {
201 is_dbm_module = true;
202 }
203
204 ATH_MSG_DEBUG(" ********************* robId retrieved: 0x" << std::hex << robId << std::dec);
205 ATH_MSG_DEBUG("offlineId retrieved: " << offlineId);
206 ATH_MSG_DEBUG("onlineId retrieved: 0x" << std::hex << onlineId << ", linknumber retrieved: 0x" << linknumber << std::dec
207 << ", ToT: " << TOT << ", BCID: " << BCID << ", LVL1ID: " << LVL1ID << ", LVL1A: " << LVL1A);
208 ATH_MSG_DEBUG("Is IBL = " << is_ibl_module << " or is DBM = " << is_dbm_module);
209
210 //*************************************************************************************************
211 // ************************************* PIXEL CASE *****************************************
212 //*************************************************************************************************
213 if (!(is_ibl_module||is_dbm_module)) {
214 ATH_MSG_DEBUG("This is the PixelCase of the PixelRodEncoder");
215 //----------------------------------------------------------------------------------------------
216 //- Fill the data
217 //----------------------------------------------------------------------------------------------
218 if (prev_offlineId!=offlineId) {
219 int fake_BCID;
220 timing_error = false;
221 if (BCs_per_LVL1ID<LVL1A) { // That must not happen, if LVL1A > BCs_per_LVL1ID, BCs_perLVL1ID is wrongly set in the joboptions
222 ATH_MSG_DEBUG("LVL1A > BCs_per_LVL1ID, timing corrupt, ignoring timing." << " Set BCs per LVL1ID: " << BCs_per_LVL1ID);
223 timing_error = true;
224 }
225 if (prev_offlineId!=0x0) {
226 v32rod.push_back(packLinkTrailer(0x0));
227 ATH_MSG_DEBUG("Pixel module trailer");
228 ATH_MSG_DEBUG(" ------------------------------------------------------------------------------------------");
229
230 //------------------------------------------------------------------------------------
231 //- Write empty Header/Trailer pairs after the level1 accept
232 //------------------------------------------------------------------------------------
233 fake_BCID = last_BCID;
234 int max_BCID = fake_BCID+BCs_per_LVL1ID-LVL1A-1;
235
236 while ((fake_BCID<max_BCID) && !timing_error) {
237 fake_BCID++;
238 v32rod.push_back(packLinkHeader(linknumber, fake_BCID, LVL1ID, (LVL1ID>>4), 0x0));
239 v32rod.push_back(packLinkTrailer(0x0));
240 ATH_MSG_DEBUG("(after) empty Pixel Module header/trailer pair written for BCID " << fake_BCID);
241 } // end while cycle "while ((fake_BCID < max_BCID) && !timing_error)"
242 } // end if "if (prev_offlineId != 0x0) "
243
244 //--------------------------------------------------------------------------------------
245 //- Write empty Header/Trailer pairs before the level1 accept
246 //--------------------------------------------------------------------------------------
247 fake_BCID = BCID-LVL1A;
248
249 while ((fake_BCID<BCID) && !timing_error) {
250 v32rod.push_back(packLinkHeader(linknumber, fake_BCID, LVL1ID, (LVL1ID>>4), 0x0));
251 v32rod.push_back(packLinkTrailer(0x0));
252 ATH_MSG_DEBUG("(before) empty Pixel Module header/trailer pair written for BCID " << fake_BCID);
253 fake_BCID++;
254 } // end while cycle "while ((fake_BCID < BCID) && !timing_error)"
255
256 v32rod.push_back(packLinkHeader(linknumber, BCID, LVL1ID, (LVL1ID>>4), 0x0));
257 ATH_MSG_DEBUG("Pixel module header");
258 } // end if "if (prev_offlineId != offlineId) "
259
260 //--------------------------------------------------------------------------------------
261 //- Write RawDataWord
262 //--------------------------------------------------------------------------------------
263 FE = m_pixelReadout->getFE(pixelId, offlineId);
264 uint32_t row = m_pixelReadout->getRow(pixelId, offlineId);
265 uint32_t column = m_pixelReadout->getColumn(pixelId, offlineId);
266 v32rod.push_back(packRawDataWord(FE, row, column, TOT));
267
268 // The following was used for running a validation scrip and making validation plots
269#ifdef PLOTS
270 int eta_i = m_PixelID->eta_index(pixelId);
271 int phi_i = m_PixelID->phi_index(pixelId);
272 std::cout << "[PlotB]: " << robId << " " << eta_i << " " << phi_i << " " << TOT << std::endl;
273 std::cout << "[PlotC]: " << robId << " " << column << " " << row << " " << TOT << std::endl;
274
275 std::cout << "[VAL] " << std::hex << pixelId << " 0x" << robId << " 0x" << onlineId // << " " << offlineId
276 << std::dec << " " << m_PixelID->eta_module(pixelId) << " " << m_PixelID->phi_module(pixelId)
277 << " " << m_PixelID->eta_index(pixelId) << " " << m_PixelID->phi_index(pixelId) << std::endl;
278#endif
279
280 ++rdo_it;
281 last_BCID = BCID;
282
283 ATH_MSG_DEBUG("Found hit in PIXEL with PixelID: 0x" << std::hex << pixelId << std::dec << " FE: " << FE << " Row: " << row << " Column: " << column
284 << " TOT: " << TOT << " BCID: " << BCID << " LVL1ID: " << LVL1ID << " LVL1A: " << LVL1A);
285 ATH_MSG_DEBUG("Encoded Pixel OfflineID: 0x" << std::hex << offlineId << " OnlineID: 0x" << onlineId << " -> Linknumber: 0x" << linknumber << std::dec);
286
287 prev_offlineId = offlineId;
288 } // end Pixel Case
289 //*************************************************************************************************
290 // ************************************* IBL CASE *****************************************
291 //*************************************************************************************************
292 else {
293 ATH_MSG_DEBUG("Inside the IBL/DBM case of the PixelRodEncoder");
294
295 uint32_t linkNum = (onlineId>>24) & 0xFFFF;
296 unsigned int localFE = m_pixelReadout->getFE(pixelId, m_PixelID->wafer_id(pixelId));
297 FE = (linkNum>>(localFE*8)) & 0xF;
298
299 sLink = onlineId & 0xF; // extract the LSB 4 bits from the onlineId
300 if (sLink > 0x3) {
301 ATH_MSG_WARNING("The SLink is not in the correct range [0,3]. This is due to the non-correct onlineId/ROBID definition. Skipping this RDO");
302 continue; // skipping this rdo, because it gives wrong onlineID (and, possibly, other pieces of information are wrong too)
303 }
304 n5 = ((sLink & 0x3)<<3) | (FE & 0x7); // this variable contains the 5 "nnnnn" bits, the 2 MSB ones representing the copy of the S-Link number (0 to 3) and the 2 LSBs representing the FE number over the S-Link
305 ATH_MSG_DEBUG("FE (w.r.t. SLink) = 0x" << std::hex << FE << " sLink: 0x" << sLink << " => n5: 0x" << n5 << std::dec);
306
307 if (!pixHitDiscCnfg) {
308 pixHitDiscCnfg = std::make_unique<SG::ReadCondHandle<PixelHitDiscCnfgData> >(m_condHitDiscCnfgKey);
309 }
310 if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_PLANAR || m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::DBM) {
311 hitDiscCnfg = (*pixHitDiscCnfg)->getHitDiscCnfgPL();
312 }
313 else if (m_pixelReadout->getModuleType(offlineId) == InDetDD::PixelModuleType::IBL_3D) {
314 hitDiscCnfg = (*pixHitDiscCnfg)->getHitDiscCnfg3D();
315 }
316
317 //----------------------------------------------------------------------------------------------
318 //- Fill the data
319 //----------------------------------------------------------------------------------------------
320 ATH_MSG_DEBUG("(prev_offlineId != offlineId) = " << (prev_offlineId != offlineId) << " (prev_n5 != n5) = " << (prev_n5 != n5) << " ");
321 ATH_MSG_DEBUG("prev_offlineId = " << prev_offlineId);
322
323 if ((prev_offlineId!=offlineId) || (prev_n5!=n5)) {
324 int fake_BCID;
325 timing_error = false;
326 if (BCs_per_LVL1ID < LVL1A) { // That must not happen, if LVL1A > BCs_per_LVL1ID, BCs_perLVL1ID is wrongly set in the joboptions
327 ATH_MSG_DEBUG("LVL1A > BCs_per_LVL1ID, timing corrupt, ignoring timing." << " Set BCs per LVL1ID: " << BCs_per_LVL1ID);
328 timing_error = true;
329 }
330
331 if (prev_offlineId != 0x0) {
332 v32rod.push_back(packLinkTrailer_IBL(prev_n5, timing_error, condensedMode, linkMasked)); // Trailer for IBL
333 condensedMode = false;
334 ATH_MSG_DEBUG("IBL Module trailer (because prev_offlineId != 0x0)");
335
336 //------------------------------------------------------------------------------------
337 //- Write empty Header/Trailer pairs after the level1 accept
338 //------------------------------------------------------------------------------------
339 fake_BCID = last_BCID;
340 int max_BCID = fake_BCID+BCs_per_LVL1ID-LVL1A-1;
341
342 while ((fake_BCID < max_BCID) && !timing_error) {
343 fake_BCID++;
344 v32rod.push_back(packLinkHeader_IBL(n5, fake_BCID, LVL1ID, 0x0)); // Header for IBL
345 v32rod.push_back(packLinkTrailer_IBL(n5, timing_error, condensedMode, linkMasked)); // Trailer for IBL
346
347 ATH_MSG_DEBUG("(after) empty IBL Module header/trailer pair written for BCID " << fake_BCID);
348 } // end while cycle "while ((fake_BCID < max_BCID) && !timing_error)"
349 } // end if "if (prev_offlineId != 0x0) "
350
351 //--------------------------------------------------------------------------------------
352 //- Write empty Header/Trailer pairs before the level1 accept
353 //--------------------------------------------------------------------------------------
354 fake_BCID = BCID-LVL1A;
355
356 while ((fake_BCID<BCID) && !timing_error) {
357 v32rod.push_back(packLinkHeader_IBL(n5, fake_BCID, LVL1ID, 0x0)); // Header for IBL
358 v32rod.push_back(packLinkTrailer_IBL(n5, timing_error, condensedMode, linkMasked)); // Trailer for IBL
359 ATH_MSG_DEBUG("(before) empty IBL Module header/trailer pair written for BCID " << fake_BCID);
360 fake_BCID++;
361 } // end while cycle "while ((fake_BCID < BCID) && !timing_error)"
362
363 v32rod.push_back(packLinkHeader_IBL(n5, BCID, LVL1ID, 0x0)); // Header for IBL
364 ATH_MSG_DEBUG("IBL Module header");
365 } // end if "if (prev_offlineId != offlineId) "
366
367 //--------------------------------------------------------------------------------------
368 //- Write RawData word
369 //--------------------------------------------------------------------------------------
370 std::vector<const PixelRDORawData*> rdos_sameIBL_offlineId; // vector containing all the rdos with the same offlineId => belonging to the same IBL FE-I4 chip
371
372 // This loop fills the rdo_sameIBL_offlineId vector with all the RDOs that have the same offlineId and same FEw.r.t.SLink => all RDOs coming from the same FE
373 for (; (rdo_it!=rdo_it_end) && ((((m_pixelReadout->getModuleType((*rdo_it)->identify())==InDetDD::PixelModuleType::IBL_PLANAR)
374 || (m_pixelReadout->getModuleType((*rdo_it)->identify())==InDetDD::PixelModuleType::IBL_3D)) && is_ibl_module)
375 || (m_pixelReadout->getModuleType((*rdo_it)->identify())==InDetDD::PixelModuleType::DBM && is_dbm_module)); ++rdo_it) {
376
377 Identifier pixelId_probe = (*rdo_it)->identify();
378 Identifier offlineId_probe = m_PixelID->wafer_id(pixelId_probe);
379
380 uint32_t linkNum = (onlineId>>24) & 0xFFFF;
381 unsigned int localFE = m_pixelReadout->getFE(pixelId_probe, offlineId_probe);
382 uint32_t fe_probe = (linkNum>>(localFE*8)) & 0xF;
383
384
385 ATH_MSG_DEBUG("offlineId: " << offlineId << " offlineId_probe: " << offlineId_probe << ", fe: " << FE << " fe_probe: " << fe_probe);
386
387 if ((offlineId_probe == offlineId) && (FE == fe_probe)) {
388 ATH_MSG_DEBUG("=======> IN ");
389 rdos_sameIBL_offlineId.push_back((*rdo_it));
390 }
391 else {
392 ATH_MSG_DEBUG("=======> OUT.");
393 break;
394 }
395 }
396
397 std::vector<const PixelRDORawData*>::iterator rdo_same_it = rdos_sameIBL_offlineId.begin();
398 std::vector<const PixelRDORawData*>::iterator rdo_same_it_end = rdos_sameIBL_offlineId.end();
399
400#ifdef PIXEL_DEBUG
401 //check: list of all the rdos with same offlineId, listing also the column, the row and the Tot
402 for (; rdo_same_it != rdo_same_it_end; ++rdo_same_it) {
403 Identifier pixelId_probe = (*rdo_same_it)->identify();
404 uint32_t col = m_pixelReadout->getColumn(pixelId_probe, offlineId); // offlineId of rdos in rdos_sameIBL_offlineId vector are, of course, all equal
405 uint32_t row = m_pixelReadout->getRow(pixelId_probe, offlineId);
406 int tot = (*rdo_same_it)->getToT();
407 ATH_MSG_DEBUG("col: " << col << " (0x" << std::hex << col << std::dec << ")\trow: "<< row << " (0x" << std::hex << row << std::dec << ")\ttot: " << tot << "(0x" <<std::hex << tot << std::dec << ")");
408 }
409
410 rdo_same_it = rdos_sameIBL_offlineId.begin();
411 rdo_same_it_end = rdos_sameIBL_offlineId.end();
412#endif
413
414 // Order the RDOs within the vector rdos_sameIBL_offlineId, following the ordering rules of orderRdos
415 OrderRdos orderRdos(offlineId, m_pixelReadout);
416 std::sort(rdo_same_it, rdo_same_it_end, orderRdos);
417
418 //check:
419#ifdef PIXEL_DEBUG
420 rdo_same_it = rdos_sameIBL_offlineId.begin();
421 rdo_same_it_end = rdos_sameIBL_offlineId.end();
422
423 ATH_MSG_DEBUG("Re-ordered RDOs with Same offlineId:");
424 for (; rdo_same_it != rdo_same_it_end; ++rdo_same_it) {
425 Identifier pixelId_probe = (*rdo_same_it)->identify();
426 uint32_t col = m_pixelReadout->getColumn(pixelId_probe, offlineId);
427 uint32_t row = m_pixelReadout->getRow(pixelId_probe, offlineId);
428 int tot = (*rdo_same_it)->getToT();
429 int eta_i = m_PixelID->eta_index(pixelId_probe);
430 int phi_i = m_PixelID->phi_index(pixelId_probe);
431 int eta_m = m_PixelID->eta_module(pixelId_probe);
432 int phi_m = m_PixelID->phi_module(pixelId_probe);
433 ATH_MSG_DEBUG("pixelId: " << pixelId_probe << ", eta_i: " << eta_i << ", phi_i: " << phi_i << ", eta_m: " << eta_m << ", phi_m: ");
434 ATH_MSG_DEBUG("col: 0x" << std::hex << col << std::dec << ", row: 0x" <<std::hex << row << std::dec << ", tot = 0x" << std::hex << tot << std::dec);
435 }
436 ATH_MSG_DEBUG("rdos_sameIBL_offlineId.size() = " << rdos_sameIBL_offlineId.size());
437#endif
438#ifdef PLOTS
439 rdo_same_it = rdos_sameIBL_offlineId.begin();
440 rdo_same_it_end = rdos_sameIBL_offlineId.end();
441 for (; rdo_same_it != rdo_same_it_end; ++rdo_same_it) {
442 Identifier pixelId_probe = (*rdo_same_it)->identify();
443 uint32_t col = m_pixelReadout->getColumn(pixelId_probe, offlineId);
444 uint32_t row = m_pixelReadout->getRow(pixelId_probe, offlineId);
445 int tot = (*rdo_same_it)->getToT();
446 int eta_i = m_PixelID->eta_index(pixelId_probe);
447 int phi_i = m_PixelID->phi_index(pixelId_probe);
448 std::cout << "[Plot2]: " << robId << " " << eta_i << " " << phi_i << " " << tot << std::endl;
449 std::cout << "[Plot3]: " << robId << " " << col << " " << row << " " << tot << std::endl;
450 }
451#endif
452
454 // look for adjacent cell that can allow the "compression" of the two hit info in one:
455 // instead of having two hits (= 2 columns, 2 rows and 2 tots), in fact,
456 // if two adjacent pixels ([col, row] and [col, row+1]) have fired (respectively tot([col, row]) and tot([col, (row+1)])
457 // then
458 // the row in the hit will be the row with lower number, the column in the hit will be the common column number
459 // and the tot will be = (tot [(col, row)] << 4) | tot[(col, row+1)]
461
462 std::vector <uint32_t> vRows;
463 std::vector <uint32_t> vCols;
464 std::vector <int> vTots;
465 bool doubleHit = false;
466 static const uint32_t rowsPerFE = 336;// FIXME: this is a hardcoded variable, would be better to get it from somewhere
467
468 rdo_same_it = rdos_sameIBL_offlineId.begin();
469 rdo_same_it_end = rdos_sameIBL_offlineId.end();
470
471 std::vector<const PixelRDORawData*>::iterator rdo_test_it = rdos_sameIBL_offlineId.begin();
472 ATH_MSG_DEBUG("Looking for adjacent pixels and saving col, row and tot information.");
473
474 for (; rdo_same_it!=rdo_same_it_end; ++rdo_same_it) {
475 doubleHit = false;
476 Identifier pixelId_probe = (*rdo_same_it)->identify();
477 uint32_t col0 = m_pixelReadout->getColumn(pixelId_probe, offlineId);
478 uint32_t row0 = m_pixelReadout->getRow(pixelId_probe, offlineId);
479 int totInHitWord (0);
480#ifdef PLOTS
481 std::cout << "[VAL] " << std::hex << pixelId_probe << " 0x" << robId << " 0x" << onlineId // << " " << offlineId
482 << std::dec << " " << m_PixelID->eta_module(pixelId_probe) << " " << m_PixelID->phi_module(pixelId_probe)
483 << " " << m_PixelID->eta_index(pixelId_probe) << " " << m_PixelID->phi_index(pixelId_probe) << std::endl;
484#endif
485
486 if (row0==rowsPerFE) {
487 ATH_MSG_DEBUG("Hit in the last row (== 336) of the IBL FE.");
488 }
489 else {
490 if ((rdo_same_it+1)!=rdo_same_it_end) {
491 rdo_test_it = rdo_same_it + 1;
492 Identifier pixelId_probe = (*rdo_test_it)->identify();
493 uint32_t col1 = m_pixelReadout->getColumn(pixelId_probe, offlineId);
494 uint32_t row1 = m_pixelReadout->getRow(pixelId_probe, offlineId);
495#ifdef PLOTS
496 std::cout << "[VAL] " << std::hex << pixelId_probe << " 0x" << robId << " 0x" << onlineId // << " " << offlineId
497 << std::dec << " " << m_PixelID->eta_module(pixelId_probe) << " " << m_PixelID->phi_module(pixelId_probe)
498 << " " << m_PixelID->eta_index(pixelId_probe) << " " << m_PixelID->phi_index(pixelId_probe) << std::endl;
499#endif
500
501 ATH_MSG_DEBUG("Comparing rdo[i] = " << (*rdo_same_it) << " with rdo[i+1] = " << (*rdo_test_it));
502 ATH_MSG_DEBUG(" col0 = 0x" << std::hex << col0 << " col1 = 0x" << col1 << " row0 = 0x" << row0 << "\t row1 = 0x" << row1 << std::dec);
503
504 if ((col1==col0) && (row1==(row0+1))) {
505 doubleHit = true;
506 ATH_MSG_DEBUG("Two adjacent hits found");
507
508 int tot0 = (*rdo_same_it)->getToT();
509 int tot1 = (*rdo_test_it)->getToT();
510
511 // Adjust ToT according to hitdisccnfg setting
512 if (hitDiscCnfg==2 && tot0==16) { tot0=2; }
513 if (hitDiscCnfg==2 && tot1==16) { tot1=2; }
514
515 int overflow = 14;
516 if (hitDiscCnfg==1) { overflow=15; }
517 if (hitDiscCnfg==2) { overflow=16; }
518
519 if (tot0>overflow) { tot0=overflow; }
520 if (tot1>overflow) { tot1=overflow; }
521
522 totInHitWord = (tot0<<4) | tot1;
523
524 ATH_MSG_DEBUG("doubleHit = " << std::boolalpha << doubleHit << std::noboolalpha << " ===> (col0 == col1) : 0x" << std::hex << col0 << " = 0x" << col1
525 << "; (row0 = row1 - 1) : 0x" << row0 << " => 0x" << row1 <<"; (tot0) : 0x" << tot0 << ", (tot1) : 0x" << tot1 << " => totInHitWord: 0x" << totInHitWord << std::dec);
526 ++rdo_same_it;
527 } // end if "(col1==col0) && (row1 == (row0+1))"
528 } // end if "(rdo_same_it + 1) != rdo_same_it_end"
529 else {
530 ATH_MSG_DEBUG("last rdo with same Offline Id");
531 } // end if it's the last rdo with same offlineId
532 } // end if "row0 == rowsPerFE" (== 336)
533
534 if (!doubleHit) {
535 int tot0 = (*rdo_same_it)->getToT();
536
537 // Adjust ToT according to hitdisccnfg setting
538 if (hitDiscCnfg==2 && tot0==16) { tot0=2; }
539
540 int overflow = 14;
541 if (hitDiscCnfg==1) { overflow=15; }
542 if (hitDiscCnfg==2) { overflow=16; }
543 if (tot0>overflow) { tot0=overflow; }
544
545 totInHitWord = (tot0<<4) | 0x0;
546
547 ATH_MSG_DEBUG("doubleHit = " << std::boolalpha << doubleHit << std::noboolalpha << " ===> col0: 0x" << std::hex << col0 << std::dec << "; row0: 0x" << std::hex << row0 << std::dec << " totInHitWord: 0x" << std::hex << totInHitWord << std::dec);
548 }
549 vCols.push_back(col0);
550 vRows.push_back(row0);
551 vTots.push_back(totInHitWord);
552 } // end loop over the rdos with the same offlineId
553
554 //check:
555#ifdef PIXEL_DEBUG
556 ATH_MSG_DEBUG("CHECKs over the vectors storing columns, rows, ToTs of IBL/DBM hits:");
557 ATH_MSG_DEBUG(" vCols: ");
558 std::vector<uint32_t>::iterator vCols_it = vCols.begin();
559 std::vector<uint32_t>::iterator vCols_it_end = vCols.end();
560 for (; vCols_it != vCols_it_end; ++vCols_it) {
561 ATH_MSG_DEBUG("0x" << std::hex << *vCols_it << std::dec << " ");
562 }
563 ATH_MSG_DEBUG("vRows: ");
564 std::vector<uint32_t>::iterator vRows_it = vRows.begin();
565 std::vector<uint32_t>::iterator vRows_it_end = vRows.end();
566 for (; vRows_it != vRows_it_end; ++vRows_it) {
567 ATH_MSG_DEBUG("0x" << std::hex << *vRows_it << std::dec <<" ");
568 }
569 ATH_MSG_DEBUG("vTots: ");
570 std::vector<int>::iterator vTots_it = vTots.begin();
571 std::vector<int>::iterator vTots_it_end = vTots.end();
572 for (; vTots_it != vTots_it_end; ++vTots_it) {
573 ATH_MSG_DEBUG("0x" << std::hex << *vTots_it << std::dec << " ");
574 }
575 ATH_MSG_DEBUG("rdos_sameIBL_offlineId.size() = " << rdos_sameIBL_offlineId.size() << " vRows.size() = " << vRows.size() << " vCols.size() = " << vCols.size() << " vTots.size() = " << vTots.size());
576#endif
577
578 //Packing of the IBL hits
579 if (vRows.size() >= 5) {
580 ATH_MSG_DEBUG("5 (or more) IBL hits have been consequently found. They can be written as condensed hits");
581 while (vRows.size()>=5) {
582 packIBLcondensed(v32rod, vRows, vCols, vTots);
583 condensedMode= true;
584 }
585 }
586 if (vRows.size()!=0) { // packing remaining non-condensed IBL hit words
587 // int cycleCounter(0);
588 for (; vRows.size() != 0; ) {
589 v32rod.push_back(packRawDataWord_IBL(vRows.at(0), vCols.at(0), vTots.at(0), n5));
590 vRows.erase(vRows.begin());
591 vCols.erase(vCols.begin());
592 vTots.erase(vTots.begin());
593 }
594 }
595 last_BCID = BCID;
596
597 ATH_MSG_DEBUG("Encoded IBL OfflineID: " << std::hex << offlineId << " OnlineID: 0x" << onlineId << std::dec);
598
599 prev_offlineId = offlineId;
600 prev_n5 = n5;
601 // prev_FE = FE;
602 } // end of the IBL case
603 } // end WHILE cycle " while (rdo_it!=rdo_it_end) "
604
605 if (is_ibl_module || is_dbm_module) {
606 v32rod.push_back(packLinkTrailer_IBL(n5, timing_error, condensedMode, linkMasked));
607 condensedMode = false;
608 ATH_MSG_DEBUG("Module IBL/DBM trailer (at end of the loop)");
609 }
610 else {
611 v32rod.push_back(packLinkTrailer(0x0));
612 ATH_MSG_DEBUG("Pixel module trailer");
613 }
614 } // end if "if (rdo_it != rdo_it_end)"
615 else {
616 ATH_MSG_DEBUG("rdo_it == rdo_it_end");
617 }
618 return;
619}
int numLayers() const
Number of layers.
virtual Identifier identify() const override final
virtual int getToT() const =0
virtual int getBCID() const =0
virtual int getLVL1ID() const =0
virtual int getLVL1A() const =0
uint32_t packLinkHeader_IBL(uint32_t module, uint32_t bcid, uint32_t lvl1id, uint32_t feFlag) const
const InDetDD::PixelDetectorManager * m_pixelManager
uint32_t packRawDataWord(uint32_t FE, uint32_t row, uint32_t column, uint32_t ToT) const
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
uint32_t packLinkHeader(uint32_t module, uint32_t bcid, uint32_t lvl1id, uint32_t lvl1idskip, uint32_t errors) const
uint32_t packLinkTrailer(uint32_t errors) const
void packIBLcondensed(std::vector< uint32_t > &v32rod, std::vector< uint32_t > &vRows, std::vector< uint32_t > &vCols, std::vector< int > &vTots) const
uint32_t packRawDataWord_IBL(uint32_t row, uint32_t column, int ToT, uint32_t nLink) const
uint32_t packLinkTrailer_IBL(uint32_t FEonSLink, bool timeOutErrorBit, bool condensedModeBit, bool linkMasked) const
SG::ReadCondHandleKey< PixelHitDiscCnfgData > m_condHitDiscCnfgKey
row
Appending html table to final .html summary file.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ finalize()

StatusCode PixelRawContByteStreamTool::finalize ( )
overridevirtual

Definition at line 63 of file PixelRawContByteStreamTool.cxx.

63 {
64 return StatusCode::SUCCESS;
65}

◆ initialize()

StatusCode PixelRawContByteStreamTool::initialize ( )
overridevirtual

Definition at line 44 of file PixelRawContByteStreamTool.cxx.

44 {
45
46 ATH_CHECK(m_pixelReadout.retrieve());
47
48 ATH_CHECK(detStore()->retrieve(m_PixelID, "PixelID"));
49
51
52 ATH_CHECK(m_condCablingKey.initialize());
53 ATH_CHECK(m_condHitDiscCnfgKey.initialize());
54
55 ATH_CHECK( m_byteStreamCnvSvc.retrieve() );
56
57 return StatusCode::SUCCESS;
58}
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & PixelRawContByteStreamTool::interfaceID ( )
static

Definition at line 121 of file PixelRawContByteStreamTool.cxx.

121 {
123}
static const InterfaceID IID_IPixelRawContByteStreamTool("PixelRawContByteStreamTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ packIBLCondensed()

void PixelRawContByteStreamTool::packIBLCondensed ( std::vector< uint32_t > & v32rod,
const std::vector< const PixelRDORawData * > & rdos_sameIBL_offlineId )

◆ packIBLcondensed()

void PixelRawContByteStreamTool::packIBLcondensed ( std::vector< uint32_t > & v32rod,
std::vector< uint32_t > & vRows,
std::vector< uint32_t > & vCols,
std::vector< int > & vTots ) const

Definition at line 726 of file PixelRawContByteStreamTool.cxx.

726 {
727 unsigned int condWord[nCondensedWords];
728 condWord[0] = PRB_FIRSTHITCONDENSEDWORD | vRows[0] | (vCols[0] << skipRow) | (vTots[0] << (skipRow + skipCol) | ((vRows[1] & mask5) << (skipRow + skipCol + skipTOT)));
729
730 condWord[1] = PRB_MIDDLEHITCONDENSEDWORD | (vRows[1] >> skip5) | (vCols[1] << skip4) | (vTots[1] << (skip4 + skipCol)) | (vRows[2] << (skip4+skipCol+skipTOT)) | ((vCols[2] & mask3) << (skip4+skipCol+skipTOT+skipRow));
731
732 condWord[2] = PRB_MIDDLEHITCONDENSEDWORD | (vCols[2] >> skip3) | (vTots[2] << skip4) | (vRows[3] << (skip4+skipTOT)) | (vCols[3] << (skip4+skipTOT+skipRow)) | ((vTots[3] & mask3) << (skip4+skipTOT+skipRow+skipCol));
733
734 condWord[3] = PRB_DATAMASK | (vTots[3] >> skip3) | (vRows[4] << skip5) | (vCols[4] << (skip5+skipRow)) | (vTots[4] << (skip5+skipRow+skipCol));
735
736 for (int j(0); j < 4; ++j) {
737 v32rod.push_back(condWord[j]); // Filling the ROD vector here
738#ifdef PLOTS
739 std::cout << "[Plot1]:0x " << std::hex << condWord[j] << std::dec << std::endl;
740 std::cout << "[Plot1]:(dec) " << condWord[j] << std::endl;
741#endif
742 }
743
744 vRows.erase (vRows.begin(), vRows.begin() + 5);
745 vCols.erase (vCols.begin(), vCols.begin() + 5);
746 vTots.erase (vTots.begin(), vTots.begin() + 5);
747 return;
748}
static const uint32_t skipRow
static const uint32_t skip5
static const uint32_t mask3
static const uint32_t skip3
static const int nCondensedWords
static const uint32_t PRB_DATAMASK
static const uint32_t PRB_MIDDLEHITCONDENSEDWORD
static const uint32_t skip4
static const uint32_t skipTOT
static const uint32_t PRB_FIRSTHITCONDENSEDWORD
static const uint32_t skipCol
static const uint32_t mask5

◆ packLinkHeader()

uint32_t PixelRawContByteStreamTool::packLinkHeader ( uint32_t module,
uint32_t bcid,
uint32_t lvl1id,
uint32_t lvl1idskip,
uint32_t errors ) const

Definition at line 625 of file PixelRawContByteStreamTool.cxx.

625 {
626 lvl1idskip = 0; // FIXME LVL1IDskip hardcoded as 0
627 uint32_t result = 0;
629#ifdef PLOTS
630 std::cout << "[PlotA]:0x " << std::hex << result << std::dec << std::endl;
631 std::cout << "[PlotA]:(dec) " << result << std::endl;
632#endif
633 return result;
634}
static const uint32_t PRB_L1IDSKIPmask
static const uint32_t PRB_L1IDmask
static const uint32_t PRB_LINKHEADER
static const uint32_t PRB_BCIDmask
static const uint32_t PRB_BCIDskip
static const uint32_t PRB_L1IDskip
static const uint32_t PRB_HEADERERRORSmask
static const uint32_t PRB_L1IDSKIPskip
static const uint32_t PRB_HEADERERRORSskip
static const uint32_t PRB_MODULEskip
static const uint32_t PRB_MODULEmask
setEventNumber setTimeStamp bcid

◆ packLinkHeader_IBL()

uint32_t PixelRawContByteStreamTool::packLinkHeader_IBL ( uint32_t module,
uint32_t bcid,
uint32_t lvl1id,
uint32_t feFlag ) const

Definition at line 641 of file PixelRawContByteStreamTool.cxx.

641 {
642 uint32_t result = 0;
643 result = PRB_LINKHEADER | ((bcid & PRB_BCIDmask_IBL) << PRB_BCIDskip_IBL) | ((lvl1id & PRB_L1IDmask_IBL) << PRB_L1IDskip_IBL) | ((module & PRB_MODULEmask_IBL) << PRB_MODULEskip_IBL) | ((feFlag & PRB_FeI4BFLAGmask_IBL) << PRB_FeI4BFLAGskip_IBL);
644#ifdef PIXEL_DEBUG
645 // std::cout << "IBL HEADER: linkNum (=n): 0x" << std::hex << module << std::dec << ", bcid: " << bcid << ", lvl1id: " << lvl1id << ", feFlag: " << feFlag << "====> Result: 0x" << std::hex << result << std::dec << std::endl;
646#endif
647#ifdef PLOTS
648 std::cout << "[Plot1]:0x " << std::hex << result << std::dec << std::endl;
649 std::cout << "[Plot1]:(dec) " << result << std::endl;
650#endif
651 return result;
652}
static const uint32_t PRB_BCIDskip_IBL
static const uint32_t PRB_L1IDmask_IBL
static const uint32_t PRB_BCIDmask_IBL
static const uint32_t PRB_L1IDskip_IBL

◆ packLinkTrailer()

uint32_t PixelRawContByteStreamTool::packLinkTrailer ( uint32_t errors) const

Definition at line 689 of file PixelRawContByteStreamTool.cxx.

689 {
691#ifdef PLOTS
692 std::cout << "[PlotA]:0x " << std::hex << result << std::dec << std::endl;
693 std::cout << "[PlotA]:(dec) " << result << std::endl;
694#endif
695 return result;
696}
static const uint32_t PRB_TRAILERERRORSskip
static const uint32_t PRB_TRAILERERRORSmask
static const uint32_t PRB_LINKTRAILER

◆ packLinkTrailer_IBL()

uint32_t PixelRawContByteStreamTool::packLinkTrailer_IBL ( uint32_t FEonSLink,
bool timeOutErrorBit,
bool condensedModeBit,
bool linkMasked ) const

Definition at line 702 of file PixelRawContByteStreamTool.cxx.

702 {
703 // return PRB_LINKTRAILER |((timeOutErrorBit & PRB_TIMEOUTERRORmask_IBL) << PRB_TIMEOUTERRORskip_IBL) | ((condensedModeBit & PRB_CONDENSEDMODEmask_IBL) << PRB_CONDENSEDMODEskip_IBL) | ((linkMasked & PRB_LINKMASKEDmask_IBL) << PRB_LINKMASKEDskip_IBL) | ((linknum & PRB_LINKNUMTRAILERmask_IBL) << PRB_LINKNUMTRAILERskip_IBL);
705 result = PRB_LINKTRAILER | (timeOutErrorBit << PRB_TIMEOUTERRORskip_IBL) | (condensedModeBit << PRB_CONDENSEDMODEskip_IBL) | (linkMasked << PRB_LINKMASKEDskip_IBL) | ((linknum & PRB_LINKNUMTRAILERmask_IBL) << PRB_LINKNUMTRAILERskip_IBL);
706#ifdef PIXEL_DEBUG
707 // std::cout << "IBL TRAILER: linknum = 0x" << std::hex << linknum << ", timeOutErrorBit: 0x" << timeOutErrorBit << ", condensedModeBit: 0x" << condensedModeBit << ", linkMasked: 0x" << linkMasked << ", ===> Result: 0x" << result << std::dec << std::endl;
708#endif
709#ifdef PLOTS
710 std::cout << "[Plot1]:0x " << std::hex << result << std::dec << std::endl;
711 std::cout << "[Plot1]:(dec) " << result << std::endl;
712#endif
713 return result;
714}
static const uint32_t PRB_LINKNUMTRAILERmask_IBL
static const uint32_t PRB_CONDENSEDMODEskip_IBL
static const uint32_t PRB_LINKNUMTRAILERskip_IBL
static const uint32_t PRB_LINKMASKEDskip_IBL
static const uint32_t PRB_TIMEOUTERRORskip_IBL

◆ packRawDataWord()

uint32_t PixelRawContByteStreamTool::packRawDataWord ( uint32_t FE,
uint32_t row,
uint32_t column,
uint32_t ToT ) const

Definition at line 674 of file PixelRawContByteStreamTool.cxx.

674 {
675
676 uint32_t result = 0;
677 result = PRB_DATAWORD | ((row & PRB_ROWmask) << PRB_ROWskip) | ((column & PRB_COLUMNmask) << PRB_COLUMNskip) | ((ToT & PRB_TOTmask) << PRB_TOTskip) | ((FE & PRB_FEmask) << PRB_FEskip);
678#ifdef PLOTS
679 std::cout << "[PlotA]:0x " << std::hex << result << std::dec << std::endl;
680 std::cout << "[PlotA]:(dec) " << result << std::endl;
681#endif
682 return result;
683}
static const uint32_t PRB_TOTskip
static const uint32_t PRB_FEskip
static const uint32_t PRB_ROWmask
static const uint32_t PRB_DATAWORD
static const uint32_t PRB_COLUMNmask
static const uint32_t PRB_TOTmask
static const uint32_t PRB_FEmask
static const uint32_t PRB_COLUMNskip
static const uint32_t PRB_ROWskip

◆ packRawDataWord_IBL()

uint32_t PixelRawContByteStreamTool::packRawDataWord_IBL ( uint32_t row,
uint32_t column,
int ToT,
uint32_t nLink ) const

Definition at line 658 of file PixelRawContByteStreamTool.cxx.

658 {
659 uint32_t result = 0;
661#ifdef PIXEL_DEBUG
662 // std::cout << "IBL NON-CONDENSED HIT: nLink: 0x" << std::hex << nLink << ", row: 0x" << row << ", col: 0x" << column << ", tot: 0x" << ToT << " ===> encoded IBL word: 0x" << result << std::dec << std::endl;
663#endif
664#ifdef PLOTS
665 std::cout << "[Plot1]:0x " << std::hex << result << std::dec << std::endl;
666 std::cout << "[Plot1]:(dec) " << result << std::endl;
667#endif
668 return result;
669}
static const uint32_t PRB_ROWskip_IBL
static const uint32_t PRB_ROWmask_IBL
static const uint32_t PRB_COLUMNskip_IBL
static const uint32_t PRB_LINKNUMHITskip_IBL
static const uint32_t PRB_COLUMNmask_IBL
static const uint32_t PRB_LINKNUMHITmask_IBL

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_BCs_per_LVL1ID

int PixelRawContByteStreamTool::m_BCs_per_LVL1ID {}
private

Definition at line 80 of file PixelRawContByteStreamTool.h.

80{};

◆ m_byteStreamCnvSvc

ServiceHandle<IByteStreamCnvSvc> PixelRawContByteStreamTool::m_byteStreamCnvSvc { this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" }
private

Definition at line 69 of file PixelRawContByteStreamTool.h.

70{ this, "ByteStreamCnvSvc", "ByteStreamCnvSvc" };

◆ m_condCablingKey

SG::ReadCondHandleKey<PixelCablingCondData> PixelRawContByteStreamTool::m_condCablingKey {this, "PixelCablingCondData", "PixelCablingCondData", "Pixel cabling key"}
private

Definition at line 82 of file PixelRawContByteStreamTool.h.

83{this, "PixelCablingCondData", "PixelCablingCondData", "Pixel cabling key"};

◆ m_condHitDiscCnfgKey

SG::ReadCondHandleKey<PixelHitDiscCnfgData> PixelRawContByteStreamTool::m_condHitDiscCnfgKey {this, "PixelHitDiscCnfgData", "PixelHitDiscCnfgData", "Pixel FEI4 HitDiscConfig key"}
private

Definition at line 85 of file PixelRawContByteStreamTool.h.

86{this, "PixelHitDiscCnfgData", "PixelHitDiscCnfgData", "Pixel FEI4 HitDiscConfig key"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_PixelID

const PixelID* PixelRawContByteStreamTool::m_PixelID {}
private

Definition at line 75 of file PixelRawContByteStreamTool.h.

75{};

◆ m_pixelManager

const InDetDD::PixelDetectorManager* PixelRawContByteStreamTool::m_pixelManager {}
private

Definition at line 77 of file PixelRawContByteStreamTool.h.

77{};

◆ m_pixelReadout

ServiceHandle<InDetDD::IPixelReadoutManager> PixelRawContByteStreamTool::m_pixelReadout { this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" }
private

Definition at line 72 of file PixelRawContByteStreamTool.h.

73{ this, "PixelReadoutManager", "PixelReadoutManager", "Pixel readout manager" };

◆ m_RodBlockVersion

unsigned short PixelRawContByteStreamTool::m_RodBlockVersion {}
private

Definition at line 79 of file PixelRawContByteStreamTool.h.

79{};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: