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

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  }

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

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

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

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

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

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

◆ foundMissingLinkHeaderError

bool SCT_RodDecoder::SharedData::foundMissingLinkHeaderError {false}

Definition at line 152 of file SCT_RodDecoder.h.

◆ groupSize

int SCT_RodDecoder::SharedData::groupSize {0}

Definition at line 136 of file SCT_RodDecoder.h.

◆ INVALID_STRIP

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

◆ oldSide

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

Definition at line 145 of file SCT_RodDecoder.h.

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

◆ side

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

Definition at line 144 of file SCT_RodDecoder.h.

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

◆ 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:
SCT_RodDecoder::N_STRIPS_PER_SIDE
@ N_STRIPS_PER_SIDE
Definition: SCT_RodDecoder.h:125
SCT_RodDecoder::SharedData::oldSide
int oldSide
Definition: SCT_RodDecoder.h:145
SCT_RodDecoder::SharedData::INVALID_STRIP
static constexpr int INVALID_STRIP
Definition: SCT_RodDecoder.h:130
IdentifiableContainerMT::getWriteHandle
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
Definition: IdentifiableContainerMT.h:251
SG::VIEW_ELEMENTS
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Definition: OwnershipPolicy.h:18
SCT_RodDecoder::SharedData::foundHashes
std::unordered_set< IdentifierHash > foundHashes
Definition: SCT_RodDecoder.h:153
SCT_RodDecoder::SharedData::linkIDHash
IdentifierHash linkIDHash
Definition: SCT_RodDecoder.h:138
SCT_RodDecoder::SharedData::side
int side
Definition: SCT_RodDecoder.h:144
SCT_RodDecoder::SharedData::oldStrip
int oldStrip
Definition: SCT_RodDecoder.h:146
SCT_RodDecoder::SharedData::saved
std::array< bool, N_STRIPS_PER_SIDE *N_SIDES > saved
Definition: SCT_RodDecoder.h:149
SCT_RodDecoder::SharedData::errors
int errors
Definition: SCT_RodDecoder.h:140
SCT_RodDecoder::SharedData::strip
int strip
Definition: SCT_RodDecoder.h:135
SCT_RodDecoder::SharedData::rdoCollMap
std::unordered_map< IdentifierHash, std::unique_ptr< SCT_RDO_Collection >, Hasher > rdoCollMap
Definition: SCT_RodDecoder.h:157
pmontree.code
code
Definition: pmontree.py:443
SCT_RodDecoder::SharedData::groupSize
int groupSize
Definition: SCT_RodDecoder.h:136
SCT_RodDecoder::SharedData::collID
Identifier collID
Definition: SCT_RodDecoder.h:139
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SCT_RodDecoder::SharedData::errorHit
std::vector< int > errorHit
Definition: SCT_RodDecoder.h:142
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_RodDecoder::SharedData::writeHandleMap
std::unordered_map< IdentifierHash, SCT_RDO_Container::IDC_WriteHandle, Hasher > writeHandleMap
Definition: SCT_RodDecoder.h:158
SCT_RodDecoderErrorsHelper::noerror
void noerror(const IdentifierHash id)
Definition: SCT_RodDecoder.h:50