ATLAS Offline Software
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
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  }

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  }

◆ 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.

160  {
163  oldSide = -1;
164  groupSize = 0;
165  errors = 0;
166  saved.fill(false);
167  errorHit.clear();
168  };

◆ 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  }

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ foundMissingLinkHeaderError

bool ITkStripsRodDecoder::SharedData::foundMissingLinkHeaderError {false}

Definition at line 145 of file ITkStripsRodDecoder.h.

◆ groupSize

int ITkStripsRodDecoder::SharedData::groupSize {0}

Definition at line 129 of file ITkStripsRodDecoder.h.

◆ INVALID_STRIP

constexpr 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.

◆ oldSide

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

Definition at line 138 of file ITkStripsRodDecoder.h.

◆ 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.

◆ side

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

Definition at line 137 of file ITkStripsRodDecoder.h.

◆ 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.

◆ 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:
IdentifiableContainerMT::getWriteHandle
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
Definition: IdentifiableContainerMT.h:248
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
ITkStripsRodDecoder::SharedData::oldStrip
int oldStrip
Definition: ITkStripsRodDecoder.h:139
ITkStripsRodDecoder::SharedData::oldSide
int oldSide
Definition: ITkStripsRodDecoder.h:138
ITkStripsRodDecoder::SharedData::errorHit
std::vector< int > errorHit
Definition: ITkStripsRodDecoder.h:135
ITkStripsRodDecoder::SharedData::side
int side
Definition: ITkStripsRodDecoder.h:137
histSizes.code
code
Definition: histSizes.py:129
ITkStripsRodDecoder::SharedData::saved
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved
Definition: ITkStripsRodDecoder.h:142
ITkStripsRodDecoder::SharedData::INVALID_STRIP
static constexpr int INVALID_STRIP
Definition: ITkStripsRodDecoder.h:123
ITkStripsRodDecoder::N_STRIPS_PER_SIDE
@ N_STRIPS_PER_SIDE
Definition: ITkStripsRodDecoder.h:118
ITkStripsRodDecoder::SharedData::strip
int strip
Definition: ITkStripsRodDecoder.h:128
ITkStripsRodDecoder::SharedData::errors
int errors
Definition: ITkStripsRodDecoder.h:133
ITkStripsRodDecoder::SharedData::rdoCollMap
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, Hasher > rdoCollMap
Definition: ITkStripsRodDecoder.h:150
ITkStripsRodDecoder::SharedData::linkIDHash
IdentifierHash linkIDHash
Definition: ITkStripsRodDecoder.h:131
ITkStripsRodDecoder::SharedData::writeHandleMap
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher > writeHandleMap
Definition: ITkStripsRodDecoder.h:151
ITkStripsRodDecoder::SharedData::collID
Identifier collID
Definition: ITkStripsRodDecoder.h:132
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
ITkStripsRodDecoder::SharedData::foundHashes
std::unordered_set< IdentifierHash > foundHashes
Definition: ITkStripsRodDecoder.h:146
SCT_ID::wafer_id
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:464
SCT_RodDecoderErrorsHelper::noerror
void noerror(const IdentifierHash id)
Definition: ITkStripsRodDecoder.h:47
ITkStripsRodDecoder::SharedData::groupSize
int groupSize
Definition: ITkStripsRodDecoder.h:129