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

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

Collaboration diagram for ITkStripsRodDecoder::SharedData:

Classes

struct  Hasher

Public Member Functions

 SharedData ()
void reset ()
void setSaved (const int code)
bool isSaved ()
bool isStripValid () 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 linkNumber {0}
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved {}
bool foundMissingLinkHeaderError {false}
std::unordered_set< IdentifierHash > foundHashes
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, Hasher > rdoCollMap
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher > writeHandleMap
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 122 of file ITkStripsRodDecoder.h.

Constructor & Destructor Documentation

◆ SharedData()

ITkStripsRodDecoder::SharedData::SharedData ( )
inline

Definition at line 153 of file ITkStripsRodDecoder.h.

153 {
154 writeHandleMap.reserve( 72);
155 rdoCollMap.reserve( 72 );
156 }
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

◆ isSaved()

bool ITkStripsRodDecoder::SharedData::isSaved ( )
inline

Definition at line 168 of file ITkStripsRodDecoder.h.

168 {
169 unsigned int idx = static_cast<std::size_t>(side*N_STRIPS_PER_SIDE + strip);
170 return idx < saved.size() ? saved[idx] : true;
171 }
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved

◆ isStripValid()

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

Definition at line 172 of file ITkStripsRodDecoder.h.

172 {
173 return static_cast<unsigned int>(strip) < N_STRIPS_PER_SIDE;
174 }

◆ reset()

void ITkStripsRodDecoder::SharedData::reset ( )
inline

Definition at line 158 of file ITkStripsRodDecoder.h.

◆ setCollection()

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

Definition at line 178 of file ITkStripsRodDecoder.h.

182 {
183 linkIDHash = waferHash;
184 collID = sctID->wafer_id(linkIDHash);
185 foundHashes.insert(linkIDHash);
186 if (rdoCollMap.count(linkIDHash)==0) { // The collection is not in the local map.
187 writeHandleMap.insert(std::pair<IdentifierHash, SCT_RDO_Container::IDC_WriteHandle>(linkIDHash, rdoIDCont.getWriteHandle(linkIDHash)));
188 if (writeHandleMap[linkIDHash].alreadyPresent()) { // The collection is already in the container.
189 rdoCollMap[linkIDHash] = nullptr;
190 writeHandleMap.erase(linkIDHash); // lock is released
191 }
192 else { // Create a new collection for linkIDHash
193 std::unique_ptr<SCT_RDO_Collection> rdoColl{std::make_unique<SCT_RDO_Collection>(linkIDHash)};
194 rdoColl->setIdentifier(collID);
195 if(dataItemsPool){
196 //pool will own
197 rdoColl->clear(SG::VIEW_ELEMENTS);
198 }
199 rdoCollMap[linkIDHash] = std::move(rdoColl);
200 errs.noerror(linkIDHash); // make sure the error information is filled for this hash
201 }
202 }
203 }
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

◆ setSaved()

void ITkStripsRodDecoder::SharedData::setSaved ( const int code)
inline

Definition at line 165 of file ITkStripsRodDecoder.h.

165 {
167 }

◆ setStripInvalid()

void ITkStripsRodDecoder::SharedData::setStripInvalid ( )
inline

Definition at line 175 of file ITkStripsRodDecoder.h.

175 {
177 }

Member Data Documentation

◆ cache

CacheHelper ITkStripsRodDecoder::SharedData::cache {}

Definition at line 134 of file ITkStripsRodDecoder.h.

134{}; // For the trigger

◆ collID

Identifier ITkStripsRodDecoder::SharedData::collID

Definition at line 132 of file ITkStripsRodDecoder.h.

◆ condensedMode

bool ITkStripsRodDecoder::SharedData::condensedMode {true}

Definition at line 125 of file ITkStripsRodDecoder.h.

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

◆ errorHit

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

Definition at line 135 of file ITkStripsRodDecoder.h.

◆ errors

int ITkStripsRodDecoder::SharedData::errors {0}

Definition at line 133 of file ITkStripsRodDecoder.h.

133{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> ITkStripsRodDecoder::SharedData::foundHashes

Definition at line 144 of file ITkStripsRodDecoder.h.

◆ foundHeader

bool ITkStripsRodDecoder::SharedData::foundHeader {false}

Definition at line 151 of file ITkStripsRodDecoder.h.

151{false};

◆ foundMissingLinkHeaderError

bool ITkStripsRodDecoder::SharedData::foundMissingLinkHeaderError {false}

Definition at line 143 of file ITkStripsRodDecoder.h.

143{false};

◆ groupSize

int ITkStripsRodDecoder::SharedData::groupSize {0}

Definition at line 129 of file ITkStripsRodDecoder.h.

129{0};

◆ INVALID_STRIP

int ITkStripsRodDecoder::SharedData::INVALID_STRIP = N_STRIPS_PER_SIDE
staticconstexpr

Definition at line 123 of file ITkStripsRodDecoder.h.

◆ linkIDHash

IdentifierHash ITkStripsRodDecoder::SharedData::linkIDHash

Definition at line 131 of file ITkStripsRodDecoder.h.

◆ linkNumber

int ITkStripsRodDecoder::SharedData::linkNumber {0}

Definition at line 138 of file ITkStripsRodDecoder.h.

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

◆ rdoCollMap

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

Definition at line 148 of file ITkStripsRodDecoder.h.

◆ saved

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

Definition at line 140 of file ITkStripsRodDecoder.h.

140{};//defaults to false

◆ side

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

Definition at line 137 of file ITkStripsRodDecoder.h.

137{-1};

◆ strip

int ITkStripsRodDecoder::SharedData::strip {INVALID_STRIP}

Definition at line 128 of file ITkStripsRodDecoder.h.

◆ timeBin

int ITkStripsRodDecoder::SharedData::timeBin {0}

Definition at line 130 of file ITkStripsRodDecoder.h.

130{0};

◆ writeHandleMap

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

Definition at line 149 of file ITkStripsRodDecoder.h.


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