18 return StatusCode::SUCCESS;
27 return StatusCode::SUCCESS;
39 auto it_rdoColl = rdoContainer->
begin();
40 auto lastRdoColl = rdoContainer->
end();
42 for (; it_rdoColl != lastRdoColl; ++it_rdoColl) {
ATH_CHECK(this->
decodeCsc(*it_rdoColl, wh_cscDigit.
ptr(), collection, oldId)); }
44 return StatusCode::SUCCESS;
51 const double samplingTime = rdoColl->
rate();
52 const unsigned int numSamples = rdoColl->
numSamples();
67 for (
int j = 0; j <
width; ++j) {
69 std::vector<uint16_t> samples;
70 const bool extractSamples =
data->samples(j, numSamples, samples);
71 if (!extractSamples) {
72 ATH_MSG_WARNING(
"Unable to extract samples for strip " << j <<
" Online Cluster width = " <<
width
73 <<
" for number of Samples = " << numSamples <<
" continuing ...");
76 std::vector<float> charges;
77 const bool adctocharge =
m_cscCalibTool->adcToCharge(samples,
data->hashId(), charges);
80 unsigned int samplingPhase = 0;
81 const int errorfindCharge =
m_cscCalibTool->findCharge(samplingTime, samplingPhase, charges,
charge, time);
84 if (!adctocharge || !errorfindCharge) {
86 <<
"CSC Digit not build ... "
87 <<
" or charge finding failed "
92 const int theCharge =
static_cast<int>(
charge);
95 << newDigit->
charge() <<
" " <<
charge <<
" time= " << time);
97 for (uint16_t i = 0; i < samples.size(); ++i) {
ATH_MSG_DEBUG(
"CSC RDO->Digit: " << samples[i]); }
99 if (
m_idHelperSvc->cscIdHelper().get_hash(stationId, coll_hash, &cscContext)) {
101 <<
"context begin_index = " << cscContext.
begin_index()
102 <<
" context end_index = " << cscContext.
end_index() <<
" the identifier is ");
106 if (oldId != stationId) {
108 if (
nullptr == coll) {
111 collection = newCollection;
112 if (cscContainer->
addCollection(newCollection, coll_hash).isFailure()) {
113 ATH_MSG_WARNING(
"Couldn't record CscDigitCollection with key=" << coll_hash <<
" in StoreGate!");
118 collection = oldCollection;
126 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
double charge(const T &p)
char data[hepevt_bytes_allocation_ATLAS]
#define ATLAS_THREAD_SAFE
An algorithm that can be simultaneously executed in multiple threads.
Use IdentifiableContainer with CscDigitCollection.
int charge() const
Return the charge.
Collection of CSC Raw Hits, arranged according to CSC Detector Elements Author: Ketevi A.
uint16_t numSamples() const
uint8_t rate() const
the rate could be 25 or 50 ns
This container provides access to collections of CSC RDOs and a mechanism for recording them.
Class to hold the electronic output for a single CSC readout channel: n sampling ADC data + the addre...
ToolHandle< Muon::ICSC_RDO_Decoder > m_cscRdoDecoderTool
virtual StatusCode execute(const EventContext &ctx) const override final
CscRdoToCscDigit(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< CscRawDataContainer > m_cscRdoKey
ToolHandle< ICscCalibTool > m_cscCalibTool
StatusCode decodeCsc(const CscRawDataCollection *, CscDigitContainer *, CscDigitCollection *&, Identifier &) const
virtual StatusCode initialize() override final
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
SG::WriteHandleKey< CscDigitContainer > m_cscDigitKey
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
size_type begin_index() const
size_type end_index() const
const_iterator end() const
return const_iterator for end of container
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
size_t size() const
Duplicate of fullSize for backwards compatability.
virtual StatusCode addCollection(const T *coll, IdentifierHash hashId) override final
insert collection into container with id hash if IDC should not take ownership of collection,...
const_iterator begin() const
return const_iterator for first entry
This is a "hash" representation of an Identifier.
void show() const
Print out in hex form.
Identifier identify() const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.