ATLAS Offline Software
TileDigitsCollection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TileDigitsCollection_H
6 #define TileDigitsCollection_H
7 
8 #include "TileEvent/TileDigits.h"
10 
11 // STL include
12 #include <vector>
13 
14 // Lang include
15 #include <inttypes.h>
16 
17 class TileDigitsCollection : public TileRawDataCollection<TileDigits>
18 {
19  friend class TileDigitsContainerCnv;
20 public:
21 
23  typedef MyBase::ID ID;
25 
27  : MyBase(id,ownPolicy), m_FragSize(0), m_FragBCID(0) { m_FragExtraWords.resize(2); }
28  // Alternate constructor for use with ConstDataVector.
30  : MyBase(id,ownPolicy), m_FragSize(0), m_FragBCID(0) { m_FragExtraWords.resize(2); }
32  : MyBase(ownPolicy), m_FragSize(0), m_FragBCID(0) { m_FragExtraWords.resize(2); }
33 
35  uint32_t lvl1Id, uint32_t lvl1Type, uint32_t detEvType, uint32_t rodBCID,
36  const std::vector<uint32_t>& fragChipCRCWords, const std::vector<uint32_t>& fragChipCRCWordsHIGH,
37  const std::vector<uint32_t>& fragChipHeaderWords, const std::vector<uint32_t>& fragChipHeaderWordsHIGH,
38  const std::vector<uint32_t>& fragExtraWords, uint32_t fragSize, uint32_t fragBCID)
39  : MyBase(id, ownPolicy, lvl1Id, lvl1Type, detEvType, rodBCID),
40  m_FragChipCRCWords(fragChipCRCWords), m_FragChipCRCWordsHIGH(fragChipCRCWordsHIGH),
41  m_FragChipHeaderWords(fragChipHeaderWords), m_FragChipHeaderWordsHIGH(fragChipHeaderWordsHIGH),
42  m_FragExtraWords(fragExtraWords), m_FragSize(fragSize), m_FragBCID(fragBCID) {}
43 
50 
57 
59 
63  void clear ();
64 
69  bool isCalibMode() const { return (size() == 96); }
79  inline uint32_t getFragSize() const { return m_FragSize; }
84  void setFragExtraWords(const std::vector<uint32_t> & extra) {
86  if (extra.size() < 2) m_FragExtraWords.resize(2);
87  }
88  void setFragExtraWords(std::vector<uint32_t> && extra) {
89  m_FragExtraWords = std::move(extra);
90  if (m_FragExtraWords.size() < 2) m_FragExtraWords.resize(2);
91  }
96  inline const std::vector<uint32_t>& getFragExtraWords() const { return m_FragExtraWords; }
97  inline uint32_t getFragExtraWord(unsigned int i) const {
98  if (i<m_FragExtraWords.size()) return m_FragExtraWords[i]; else return 0; }
103  inline uint32_t getFragDMUMask() const { return m_FragExtraWords[0]; }
108  inline uint32_t getFragCRC() const { return m_FragExtraWords[1]; }
118  inline uint32_t getFragBCID() const { return (m_FragBCID & 0xFFFF); }
119  inline uint32_t getFragStatus() const { return (m_FragBCID >> 16); }
120 
126  void setFragChipHeaderWords(const std::vector<uint32_t>& chipHWords) {
127  m_FragChipHeaderWords = chipHWords;
128  }
129  void setFragChipHeaderWords(std::vector<uint32_t>&& chipHWords) {
130  m_FragChipHeaderWords = std::move(chipHWords);
131  }
135  void setFragChipHeaderWordsHigh(const std::vector<uint32_t>& chipHWordsH) {
136  m_FragChipHeaderWordsHIGH = chipHWordsH;
137  }
138  void setFragChipHeaderWordsHigh(std::vector<uint32_t>&& chipHWordsH) {
139  m_FragChipHeaderWordsHIGH = std::move(chipHWordsH);
140  }
141 
142 
148  inline const std::vector<uint32_t>& getFragChipHeaderWords() const {
149  return m_FragChipHeaderWords;
150  }
154  const std::vector<uint32_t>& getFragChipHeaderWordsHigh() const {
156  }
157 
163  void setFragChipCRCWords(const std::vector<uint32_t>& chipCRCWords) {
164  m_FragChipCRCWords = chipCRCWords;
165  }
166  void setFragChipCRCWords(std::vector<uint32_t>&& chipCRCWords) {
167  m_FragChipCRCWords = std::move(chipCRCWords);
168  }
169 
170 
174  void setFragChipCRCWordsHigh(const std::vector<uint32_t>& chipCRCWordsH) {
175  m_FragChipCRCWordsHIGH = chipCRCWordsH;
176  }
177  void setFragChipCRCWordsHigh(std::vector<uint32_t>&& chipCRCWordsH) {
178  m_FragChipCRCWordsHIGH = std::move(chipCRCWordsH);
179  }
180 
186  inline const std::vector<uint32_t>& getFragChipCRCWords() const {
187  return m_FragChipCRCWords;
188  }
192  inline const std::vector<uint32_t>& getFragChipCRCWordsHigh() const {
193  return m_FragChipCRCWordsHIGH;
194  }
195 
196  void printExtra() const;
197  void printExtra(std::ostream& os) const;
198 
199 
200 private:
205  std::vector<uint32_t> m_FragChipCRCWords;
209  std::vector<uint32_t> m_FragChipCRCWordsHIGH;
214  std::vector<uint32_t> m_FragChipHeaderWords;
219  std::vector<uint32_t> m_FragChipHeaderWordsHIGH;
220 
226  std::vector<uint32_t> m_FragExtraWords;
235 };
236 
238 
239 #endif
240 
TileDigitsCollection::getFragExtraWords
const std::vector< uint32_t > & getFragExtraWords() const
Get Frag extra words for this collection.
Definition: TileDigitsCollection.h:96
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TileDigitsCollection::m_FragChipHeaderWords
std::vector< uint32_t > m_FragChipHeaderWords
Header words from Frag data, one word for each chip LOW gain if calib mode.
Definition: TileDigitsCollection.h:214
TileDigitsCollection::setFragChipHeaderWords
void setFragChipHeaderWords(const std::vector< uint32_t > &chipHWords)
Set chip header words for this collection If calib mode, this must be LOW gain headers.
Definition: TileDigitsCollection.h:126
TileDigitsCollection::ID
MyBase::ID ID
Definition: TileDigitsCollection.h:23
TileDigitsCollection::m_FragChipCRCWordsHIGH
std::vector< uint32_t > m_FragChipCRCWordsHIGH
CRC words from Frag data, HIGH gain if in calib mode.
Definition: TileDigitsCollection.h:209
TileDigitsCollection::getFragChipCRCWordsHigh
const std::vector< uint32_t > & getFragChipCRCWordsHigh() const
High gain CRC.
Definition: TileDigitsCollection.h:192
TileDigitsCollection::setFragChipCRCWordsHigh
void setFragChipCRCWordsHigh(std::vector< uint32_t > &&chipCRCWordsH)
Definition: TileDigitsCollection.h:177
TileDigitsCollection::setFragExtraWords
void setFragExtraWords(const std::vector< uint32_t > &extra)
Set vector of extra words for this collection.
Definition: TileDigitsCollection.h:84
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileDigitsCollection::setFragSize
void setFragSize(uint32_t s)
Set Frag size.
Definition: TileDigitsCollection.h:74
TileDigitsCollection::setFragChipHeaderWordsHigh
void setFragChipHeaderWordsHigh(std::vector< uint32_t > &&chipHWordsH)
Definition: TileDigitsCollection.h:138
TileDigitsCollection::isCalibMode
bool isCalibMode() const
Check if this Collection holds data from calibration mode.
Definition: TileDigitsCollection.h:69
TileDigitsContainerCnv
Definition: TileDigitsContainerCnv.h:16
TileRawDataCollection< TileDigits >::ID
int ID
Definition: TileRawDataCollection.h:43
TileRawDataCollection.h
TileDigitsCollection::printExtra
void printExtra() const
Definition: TileDigitsCollection.cxx:47
SG::OwnershipPolicy
OwnershipPolicy
describes the possible element ownership policies (see e.g. DataVector)
Definition: OwnershipPolicy.h:16
TileDigitsCollection::getFragChipCRCWords
const std::vector< uint32_t > & getFragChipCRCWords() const
Get chip CRC words for collection If calib mode, LOW gain CRC.
Definition: TileDigitsCollection.h:186
TileDigitsCollection::m_FragSize
uint32_t m_FragSize
Size of drawer fragment.
Definition: TileDigitsCollection.h:230
TileDigitsCollection::getFragExtraWord
uint32_t getFragExtraWord(unsigned int i) const
Definition: TileDigitsCollection.h:97
TileDigitsCollection::getFragDMUMask
uint32_t getFragDMUMask() const
Get Frag DMU mask for this collection.
Definition: TileDigitsCollection.h:103
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
TileDigitsCollection::getFragSize
uint32_t getFragSize() const
Get Frag size.
Definition: TileDigitsCollection.h:79
TileDigitsCollection::TileDigitsCollection
TileDigitsCollection(SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Definition: TileDigitsCollection.h:31
TileDigitsCollection::m_FragBCID
uint32_t m_FragBCID
BCID.
Definition: TileDigitsCollection.h:234
TileDigitsCollection::TElement
TileDigits TElement
Definition: TileDigitsCollection.h:24
TileRawDataCollection
Definition: TileRawDataCollection.h:37
TileDigitsCollection::m_FragChipCRCWords
std::vector< uint32_t > m_FragChipCRCWords
CRC words from Frag data, one word for each chip LOW gain if calib mode.
Definition: TileDigitsCollection.h:205
TileDigitsCollection::TileDigitsCollection
TileDigitsCollection(ID id, SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS)
Definition: TileDigitsCollection.h:26
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TileDigitsCollection::setFragChipCRCWords
void setFragChipCRCWords(std::vector< uint32_t > &&chipCRCWords)
Definition: TileDigitsCollection.h:166
TileDigitsCollection::clear
void clear()
Clear everything for next event.
Definition: TileDigitsCollection.cxx:79
TileDigitsCollection::~TileDigitsCollection
~TileDigitsCollection()
Definition: TileDigitsCollection.h:58
python.handimod.extra
int extra
Definition: handimod.py:522
TileDigitsCollection::setFragChipHeaderWordsHigh
void setFragChipHeaderWordsHigh(const std::vector< uint32_t > &chipHWordsH)
Header words in calib mode.
Definition: TileDigitsCollection.h:135
TileDigitsCollection::getFragCRC
uint32_t getFragCRC() const
Set CRC word for collection.
Definition: TileDigitsCollection.h:108
TileDigitsCollection
Definition: TileDigitsCollection.h:18
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
TileDigitsCollection::TileDigitsCollection
TileDigitsCollection(SG::OwnershipPolicy ownPolicy, ID id, uint32_t lvl1Id, uint32_t lvl1Type, uint32_t detEvType, uint32_t rodBCID, const std::vector< uint32_t > &fragChipCRCWords, const std::vector< uint32_t > &fragChipCRCWordsHIGH, const std::vector< uint32_t > &fragChipHeaderWords, const std::vector< uint32_t > &fragChipHeaderWordsHIGH, const std::vector< uint32_t > &fragExtraWords, uint32_t fragSize, uint32_t fragBCID)
Definition: TileDigitsCollection.h:34
TileDigits
Definition: TileDigits.h:30
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
TileDigitsCollection::setFragBCID
void setFragBCID(uint32_t bcid)
Set BCID.
Definition: TileDigitsCollection.h:113
TileDigitsCollection::getFragBCID
uint32_t getFragBCID() const
Get BCID.
Definition: TileDigitsCollection.h:118
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TileDigitsCollection::setFragChipCRCWordsHigh
void setFragChipCRCWordsHigh(const std::vector< uint32_t > &chipCRCWordsH)
High gain CRC.
Definition: TileDigitsCollection.h:174
TileDigitsCollection::setFragChipCRCWords
void setFragChipCRCWords(const std::vector< uint32_t > &chipCRCWords)
Set chip CRC words for collection If calib mode, this is LOW gain CRC.
Definition: TileDigitsCollection.h:163
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TileDigitsCollection::setFragChipHeaderWords
void setFragChipHeaderWords(std::vector< uint32_t > &&chipHWords)
Definition: TileDigitsCollection.h:129
DataVector< TileDigits >::ownPolicy
SG::OwnershipPolicy ownPolicy() const
Return the ownership policy setting for this container.
TileDigitsCollection::getFragStatus
uint32_t getFragStatus() const
Definition: TileDigitsCollection.h:119
TileDigitsCollection::TileDigitsCollection
TileDigitsCollection(TileDigitsCollection &&other)=default
Move constructor.
TileDigitsCollection::getFragChipHeaderWordsHigh
const std::vector< uint32_t > & getFragChipHeaderWordsHigh() const
High gain headers.
Definition: TileDigitsCollection.h:154
TileDigitsCollection::TileDigitsCollection
TileDigitsCollection(SG::OwnershipPolicy ownPolicy, ID id)
Definition: TileDigitsCollection.h:29
TileDigitsCollection::getFragChipHeaderWords
const std::vector< uint32_t > & getFragChipHeaderWords() const
Get chip headers for this collcetion If calib mode, this is LOW gain headers.
Definition: TileDigitsCollection.h:148
TileDigits.h
DataVector< TileDigits >::size
size_type size() const noexcept
Returns the number of elements in the collection.
TileDigitsCollection::m_FragExtraWords
std::vector< uint32_t > m_FragExtraWords
all extra words from the trailer of the drawer fragment first two words are always DMU Mask and CRC w...
Definition: TileDigitsCollection.h:226
TileDigitsCollection::setFragExtraWords
void setFragExtraWords(std::vector< uint32_t > &&extra)
Definition: TileDigitsCollection.h:88
TileDigitsCollection::MyBase
TileRawDataCollection< TileDigits > MyBase
Definition: TileDigitsCollection.h:22
TileDigitsCollection::m_FragChipHeaderWordsHIGH
std::vector< uint32_t > m_FragChipHeaderWordsHIGH
Header words from Frag data, one word for each chip HIGH gain if calib mode.
Definition: TileDigitsCollection.h:219