![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "Identifier/Identifier.h"
9 #include "GaudiKernel/GaudiException.h"
20 void writeTwoBits(std::vector<unsigned char>&
vec,
const unsigned idx,
const unsigned char val) {
21 const auto qr=std::div(
idx,4);
22 const unsigned char maskval=(
val&0x3) << 2*qr.rem;
23 vec[qr.quot]|=maskval;
27 unsigned char readTwoBits(
const std::vector<unsigned char>&
vec,
const unsigned idx) {
28 const auto qr=std::div(
idx,4);
29 const unsigned char&
v=
vec[qr.quot];
30 return (
v>>2*qr.rem) & 0x3;
38 m_idSCHelper(idSCHelper),
53 const unsigned nMaxChannels=4*(pers->
m_gain.size());
64 std::vector<short>::const_iterator samplesIt=pers->
m_samples.begin();
65 for(
unsigned idx=0;
idx<nMaxChannels;
idx++) {
69 std::vector<short>::const_iterator samplesIt_e=samplesIt+pers->
m_nSamples;
70 std::vector<short>
samples(samplesIt,samplesIt_e);
75 samplesIt = samplesIt_e;
85 const unsigned int nChannels=trans->
size();
97 std::string containerName =
proxy->name();
98 if (containerName.find(
"SC")==std::string::npos) {
110 pers->
m_gain.assign(hashMax/4,0);
114 std::vector<const LArDigit*> digitsvsHash(hashMax,
nullptr);
115 for (
const LArDigit* transDigit : *trans) {
118 log << MSG::ERROR <<
"Encountered LArDigit Container with varying numbers of ADC samples" <<
endmsg;
119 throw GaudiException(
"Encountered LArDigit Container with varying numbers of ADC samples",
120 "LArDigitContainerCnv_p3",StatusCode::FAILURE);
122 digitsvsHash[
h]=transDigit;
127 std::vector<const LArDigit*>::const_iterator
it=digitsvsHash.begin();
128 std::vector<const LArDigit*>::const_iterator it_e=digitsvsHash.end();
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
virtual void transToPers(const LArDigitContainer *trans, LArDigitContainer_p3 *pers, MsgStream &log) const override
JetConstituentVector::iterator iterator
IdentifierHash channel_Hash(HWIdentifier channelId) const
Create channel_hash from channel_Id.
void reserve(unsigned int size)
Set the desired capacity.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
const std::vector< short > & samples() const
std::vector< size_t > vec
const LArOnlineID_Base * m_idSCHelper
virtual void persToTrans(const LArDigitContainer_p3 *pers, LArDigitContainer *trans, MsgStream &log) const override
The Athena Transient Store API.
Liquid Argon digit base class.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
LArDigitContainerCnv_p3(const LArOnlineID_Base *idHelper, const LArOnlineID_Base *idSCHelper, const StoreGateSvc *m_storeGateSvc)
std::vector< unsigned char > m_gain
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
void clear()
Erase all the elements in the collection.
Helper for the Liquid Argon Calorimeter cell identifiers.
virtual SG::DataProxy * proxy(const void *const pTransient) const override final
get proxy for a given data object address in memory
size_type channelHashMax(void) const
Define channel hash tables max size.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CaloGain::CaloGain gain() const
const LArOnlineID_Base * m_idHelper
a typed memory pool that saves time spent allocation small object. This is typically used by containe...
Container class for LArDigit.
std::vector< short > m_samples
const StoreGateSvc * m_storeGateSvc
size_type size() const noexcept
Returns the number of elements in the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.