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 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 122 of file ITkStripsRodDecoder.h.

Constructor & Destructor Documentation

◆ SharedData()

ITkStripsRodDecoder::SharedData::SharedData ( )
inline

Definition at line 155 of file ITkStripsRodDecoder.h.

155 {
156 writeHandleMap.reserve( 72);
157 rdoCollMap.reserve( 72 );
158 }
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 ITkStripsRodDecoder::SharedData::isOldStripValid ( ) const
inline

Definition at line 195 of file ITkStripsRodDecoder.h.

195 {
196 return static_cast<unsigned int>(oldStrip) < N_STRIPS_PER_SIDE;
197 }

◆ isSaved()

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

Definition at line 182 of file ITkStripsRodDecoder.h.

182 {
183 if (isOld) {
184 unsigned int idx = static_cast<std::size_t>(oldSide*N_STRIPS_PER_SIDE + oldStrip);
185 return idx < saved.size() ? saved[idx] : true;
186 }
187 else {
188 const unsigned int idx = static_cast<unsigned int>(side*N_STRIPS_PER_SIDE + strip);
189 return idx < saved.size() ? saved[idx] : true;
190 }
191 }
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved

◆ isStripValid()

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

Definition at line 192 of file ITkStripsRodDecoder.h.

192 {
193 return static_cast<unsigned int>(strip) < N_STRIPS_PER_SIDE;
194 }

◆ reset()

void ITkStripsRodDecoder::SharedData::reset ( )
inline

Definition at line 160 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 201 of file ITkStripsRodDecoder.h.

205 {
206 linkIDHash = waferHash;
207 collID = sctID->wafer_id(linkIDHash);
208 foundHashes.insert(linkIDHash);
209 if (rdoCollMap.count(linkIDHash)==0) { // The collection is not in the local map.
210 writeHandleMap.insert(std::pair<IdentifierHash, SCT_RDO_Container::IDC_WriteHandle>(linkIDHash, rdoIDCont.getWriteHandle(linkIDHash)));
211 if (writeHandleMap[linkIDHash].alreadyPresent()) { // The collection is already in the container.
212 rdoCollMap[linkIDHash] = nullptr;
213 writeHandleMap.erase(linkIDHash); // lock is released
214 }
215 else { // Create a new collection for linkIDHash
216 std::unique_ptr<SCT_RDO_Collection> rdoColl{std::make_unique<SCT_RDO_Collection>(linkIDHash)};
217 rdoColl->setIdentifier(collID);
218 if(dataItemsPool){
219 //pool will own
220 rdoColl->clear(SG::VIEW_ELEMENTS);
221 }
222 rdoCollMap[linkIDHash] = std::move(rdoColl);
223 errs.noerror(linkIDHash); // make sure the error information is filled for this hash
224 }
225 }
226 }
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 ITkStripsRodDecoder::SharedData::setOld ( )
inline

Definition at line 169 of file ITkStripsRodDecoder.h.

169 {
170 oldStrip = strip;
171 oldSide = side;
172 groupSize = 0;
173 }

◆ setSaved()

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

Definition at line 174 of file ITkStripsRodDecoder.h.

174 {
175 if (isOld) {
177 }
178 else {
180 }
181 }

◆ setStripInvalid()

void ITkStripsRodDecoder::SharedData::setStripInvalid ( )
inline

Definition at line 198 of file ITkStripsRodDecoder.h.

198 {
200 }

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 146 of file ITkStripsRodDecoder.h.

◆ foundHeader

bool ITkStripsRodDecoder::SharedData::foundHeader {false}

Definition at line 153 of file ITkStripsRodDecoder.h.

153{false};

◆ foundMissingLinkHeaderError

bool ITkStripsRodDecoder::SharedData::foundMissingLinkHeaderError {false}

Definition at line 145 of file ITkStripsRodDecoder.h.

145{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 140 of file ITkStripsRodDecoder.h.

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

◆ oldSide

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

Definition at line 138 of file ITkStripsRodDecoder.h.

138{-1};

◆ oldStrip

int ITkStripsRodDecoder::SharedData::oldStrip {INVALID_STRIP}

Definition at line 139 of file ITkStripsRodDecoder.h.

◆ rdoCollMap

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

Definition at line 150 of file ITkStripsRodDecoder.h.

◆ saved

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

Definition at line 142 of file ITkStripsRodDecoder.h.

142{};//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 151 of file ITkStripsRodDecoder.h.


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