ATLAS Offline Software
Loading...
Searching...
No Matches
SCT_RodDecoder::SharedData Struct Reference

Struct to hold data shared in methods used in fillCollection method. More...

Collaboration diagram for SCT_RodDecoder::SharedData:

Classes

struct  Hasher

Public Member Functions

 SharedData ()
void reset ()
void setOld ()
void setSaved (const bool isOld, const int code)
bool isSaved (const bool isOld)
bool isStripValid () const
bool isOldStripValid () const
void setStripInvalid ()
void setCollection (const SCT_ID *sctID, const IdentifierHash &waferHash, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, SCT_RodDecoderErrorsHelper &errs)

Public Attributes

bool condensedMode {true}
int strip {INVALID_STRIP}
int groupSize {0}
int timeBin {0}
IdentifierHash linkIDHash
Identifier collID
int errors {0}
CacheHelper cache {}
std::vector< int > errorHit
int side {-1}
int oldSide {-1}
int oldStrip {INVALID_STRIP}
int linkNumber {0}
std::array< bool, N_STRIPS_PER_SIDE *N_SIDESsaved {}
bool foundMissingLinkHeaderError {false}
std::unordered_set< IdentifierHashfoundHashes
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, HasherrdoCollMap
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, HasherwriteHandleMap
bool foundHeader {false}

Static Public Attributes

static constexpr int INVALID_STRIP = N_STRIPS_PER_SIDE

Detailed Description

Struct to hold data shared in methods used in fillCollection method.

Definition at line 129 of file SCT_RodDecoder.h.

Constructor & Destructor Documentation

◆ SharedData()

SCT_RodDecoder::SharedData::SharedData ( )
inline

Definition at line 162 of file SCT_RodDecoder.h.

162 {
163 writeHandleMap.reserve( 72);
164 rdoCollMap.reserve( 72 );
165 }
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher > writeHandleMap
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, Hasher > rdoCollMap

Member Function Documentation

◆ isOldStripValid()

bool SCT_RodDecoder::SharedData::isOldStripValid ( ) const
inline

Definition at line 202 of file SCT_RodDecoder.h.

202 {
203 return static_cast<unsigned int>(oldStrip) < N_STRIPS_PER_SIDE;
204 }

◆ isSaved()

bool SCT_RodDecoder::SharedData::isSaved ( const bool isOld)
inline

Definition at line 189 of file SCT_RodDecoder.h.

189 {
190 if (isOld) {
191 unsigned int idx = static_cast<std::size_t>(oldSide*N_STRIPS_PER_SIDE + oldStrip);
192 return idx < saved.size() ? saved[idx] : true;
193 }
194 else {
195 const unsigned int idx = static_cast<unsigned int>(side*N_STRIPS_PER_SIDE + strip);
196 return idx < saved.size() ? saved[idx] : true;
197 }
198 }
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved

◆ isStripValid()

bool SCT_RodDecoder::SharedData::isStripValid ( ) const
inline

Definition at line 199 of file SCT_RodDecoder.h.

199 {
200 return static_cast<unsigned int>(strip) < N_STRIPS_PER_SIDE;
201 }

◆ reset()

void SCT_RodDecoder::SharedData::reset ( )
inline

Definition at line 167 of file SCT_RodDecoder.h.

167 {
170 oldSide = -1;
171 groupSize = 0;
172 errors = 0;
173 saved.fill(false);
174 errorHit.clear();
175 };
std::vector< int > errorHit
static constexpr int INVALID_STRIP

◆ setCollection()

void SCT_RodDecoder::SharedData::setCollection ( const SCT_ID * sctID,
const IdentifierHash & waferHash,
SCT_RDO_Container & rdoIDCont,
DataPool< SCT3_RawData > * dataItemsPool,
SCT_RodDecoderErrorsHelper & errs )
inline

Definition at line 208 of file SCT_RodDecoder.h.

212 {
213 linkIDHash = waferHash;
214 collID = sctID->wafer_id(linkIDHash);
215 foundHashes.insert(linkIDHash);
216 if (rdoCollMap.count(linkIDHash)==0) { // The collection is not in the local map.
217 writeHandleMap.insert(std::pair<IdentifierHash, SCT_RDO_Container::IDC_WriteHandle>(linkIDHash, rdoIDCont.getWriteHandle(linkIDHash)));
218 if (writeHandleMap[linkIDHash].alreadyPresent()) { // The collection is already in the container.
219 rdoCollMap[linkIDHash] = nullptr;
220 writeHandleMap.erase(linkIDHash); // lock is released
221 }
222 else { // Create a new collection for linkIDHash
223 std::unique_ptr<SCT_RDO_Collection> rdoColl{std::make_unique<SCT_RDO_Collection>(linkIDHash)};
224 rdoColl->setIdentifier(collID);
225 if(dataItemsPool){
226 //pool will own
227 rdoColl->clear(SG::VIEW_ELEMENTS);
228 }
229 rdoCollMap[linkIDHash] = std::move(rdoColl);
230 errs.noerror(linkIDHash); // make sure the error information is filled for this hash
231 }
232 }
233 }
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition SCT_ID.h:459
void noerror(const IdentifierHash id)
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
std::unordered_set< IdentifierHash > foundHashes

◆ setOld()

void SCT_RodDecoder::SharedData::setOld ( )
inline

Definition at line 176 of file SCT_RodDecoder.h.

176 {
177 oldStrip = strip;
178 oldSide = side;
179 groupSize = 0;
180 }

◆ setSaved()

void SCT_RodDecoder::SharedData::setSaved ( const bool isOld,
const int code )
inline

Definition at line 181 of file SCT_RodDecoder.h.

181 {
182 if (isOld) {
184 }
185 else {
187 }
188 }

◆ setStripInvalid()

void SCT_RodDecoder::SharedData::setStripInvalid ( )
inline

Definition at line 205 of file SCT_RodDecoder.h.

205 {
207 }

Member Data Documentation

◆ cache

CacheHelper SCT_RodDecoder::SharedData::cache {}

Definition at line 141 of file SCT_RodDecoder.h.

141{}; // For the trigger

◆ collID

Identifier SCT_RodDecoder::SharedData::collID

Definition at line 139 of file SCT_RodDecoder.h.

◆ condensedMode

bool SCT_RodDecoder::SharedData::condensedMode {true}

Definition at line 132 of file SCT_RodDecoder.h.

132{true}; // Condensed mode or Expanded mode for each link if superCondensedMode is false

◆ errorHit

std::vector<int> SCT_RodDecoder::SharedData::errorHit

Definition at line 142 of file SCT_RodDecoder.h.

◆ errors

int SCT_RodDecoder::SharedData::errors {0}

Definition at line 140 of file SCT_RodDecoder.h.

140{0}; // Encodes the errors on the header (bit 4: error in condensed mode 1st hit, bit 5: error in condensed mode 2nd hit)

◆ foundHashes

std::unordered_set<IdentifierHash> SCT_RodDecoder::SharedData::foundHashes

Definition at line 153 of file SCT_RodDecoder.h.

◆ foundHeader

bool SCT_RodDecoder::SharedData::foundHeader {false}

Definition at line 160 of file SCT_RodDecoder.h.

160{false};

◆ foundMissingLinkHeaderError

bool SCT_RodDecoder::SharedData::foundMissingLinkHeaderError {false}

Definition at line 152 of file SCT_RodDecoder.h.

152{false};

◆ groupSize

int SCT_RodDecoder::SharedData::groupSize {0}

Definition at line 136 of file SCT_RodDecoder.h.

136{0};

◆ INVALID_STRIP

int SCT_RodDecoder::SharedData::INVALID_STRIP = N_STRIPS_PER_SIDE
staticconstexpr

Definition at line 130 of file SCT_RodDecoder.h.

◆ linkIDHash

IdentifierHash SCT_RodDecoder::SharedData::linkIDHash

Definition at line 138 of file SCT_RodDecoder.h.

◆ linkNumber

int SCT_RodDecoder::SharedData::linkNumber {0}

Definition at line 147 of file SCT_RodDecoder.h.

147{0}; // Determined from header and may be changed for links using Rx redundancy

◆ oldSide

int SCT_RodDecoder::SharedData::oldSide {-1}

Definition at line 145 of file SCT_RodDecoder.h.

145{-1};

◆ oldStrip

int SCT_RodDecoder::SharedData::oldStrip {INVALID_STRIP}

Definition at line 146 of file SCT_RodDecoder.h.

◆ rdoCollMap

std::unordered_map<IdentifierHash, std::unique_ptr<SCT_RDO_Collection>, Hasher> SCT_RodDecoder::SharedData::rdoCollMap

Definition at line 157 of file SCT_RodDecoder.h.

◆ saved

std::array<bool, N_STRIPS_PER_SIDE*N_SIDES> SCT_RodDecoder::SharedData::saved {}

Definition at line 149 of file SCT_RodDecoder.h.

149{};//defaults to false

◆ side

int SCT_RodDecoder::SharedData::side {-1}

Definition at line 144 of file SCT_RodDecoder.h.

144{-1};

◆ strip

int SCT_RodDecoder::SharedData::strip {INVALID_STRIP}

Definition at line 135 of file SCT_RodDecoder.h.

◆ timeBin

int SCT_RodDecoder::SharedData::timeBin {0}

Definition at line 137 of file SCT_RodDecoder.h.

137{0};

◆ writeHandleMap

std::unordered_map<IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher> SCT_RodDecoder::SharedData::writeHandleMap

Definition at line 158 of file SCT_RodDecoder.h.


The documentation for this struct was generated from the following file: