|
ATLAS Offline Software
|
This class is only used in a single-thread mode as CscRdoToCscPrepDataToolMT has the equivalent functions defined for a thread-safe setup.
More...
#include <CscRdoToCscPrepDataToolMT.h>
|
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > | m_muDetMgrKey |
|
ServiceHandle< Muon::IMuonIdHelperSvc > | m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"} |
|
SG::WriteHandleKey< Muon::CscStripPrepDataContainer > | m_outputCollectionKey |
| CscStripPrepRawData containers. More...
|
|
SG::ReadHandleKey< CscRawDataContainer > | m_rdoContainerKey {this, "RDOContainer", "CSCRDO", "CscRawDataContainer to retrieve"} |
|
SG::UpdateHandleKey< CscStripPrepDataCollection_Cache > | m_prdContainerCacheKey |
| This is the key for the cache for the CSC PRD containers, can be empty. More...
|
|
ToolHandle< ICscCalibTool > | m_cscCalibTool {this, "CscCalibTool", "CscCalibTool/CscCalibTool"} |
| CSC Calibration tools. More...
|
|
ToolHandle< ICSC_RDO_Decoder > | m_cscRdoDecoderTool {this, "CscRdoDecoderTool", "Muon::CscRDO_Decoder/CscRDO_Decoder"} |
|
ServiceHandle< CSCcablingSvc > | m_cabling {this, "CablingSvc", "CSCcablingSvc"} |
|
Gaudi::Property< int > | m_cscOffset {this, "CSCHashIdOffset", 22000} |
| Identifier hash offset. More...
|
|
Gaudi::Property< bool > | m_decodeData {this, "DecodeData", true} |
| toggle on/off the decoding of CSC RDO into CscStripPrepData More...
|
|
This class is only used in a single-thread mode as CscRdoToCscPrepDataToolMT has the equivalent functions defined for a thread-safe setup.
Definition at line 39 of file CscRdoToCscPrepDataToolMT.h.
◆ CscRdoToCscPrepDataToolMT()
CscRdoToCscPrepDataToolMT::CscRdoToCscPrepDataToolMT |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~CscRdoToCscPrepDataToolMT()
virtual Muon::CscRdoToCscPrepDataToolMT::~CscRdoToCscPrepDataToolMT |
( |
| ) |
|
|
virtualdefault |
◆ decode() [1/2]
StatusCode CscRdoToCscPrepDataToolMT::decode |
( |
const EventContext & |
ctx, |
|
|
const std::vector< IdentifierHash > & |
givenIdhs |
|
) |
| const |
|
overridevirtual |
Recording the PRD container in StoreGate
Definition at line 63 of file CscRdoToCscPrepDataToolMT.cxx.
65 unsigned int sizeVectorRequested = givenIdhs.size();
66 ATH_MSG_DEBUG(
"decode for " << sizeVectorRequested <<
" offline collections called");
75 ATH_CHECK(outputHandle.record(std::make_unique<Muon::CscStripPrepDataContainer>(
m_idHelperSvc->cscIdHelper().module_hash_max())));
82 return StatusCode::FAILURE;
84 ATH_CHECK(outputHandle.record(std::make_unique<Muon::CscStripPrepDataContainer>(
update.ptr())));
96 if (!rdoContainerHandle.isValid()) {
98 return StatusCode::SUCCESS;
105 if (sizeVectorRequested) {
107 for (
unsigned int i = 0;
i < sizeVectorRequested; ++
i) {
109 ATH_MSG_ERROR(
"Unable to decode CSC RDO " <<
i <<
"th into CSC PrepRawData");
110 return StatusCode::FAILURE;
117 return StatusCode::FAILURE;
121 return StatusCode::SUCCESS;
◆ decode() [2/2]
StatusCode CscRdoToCscPrepDataToolMT::decode |
( |
const EventContext & |
ctx, |
|
|
const std::vector< uint32_t > & |
robIDs |
|
) |
| const |
|
overridevirtual |
◆ decodeImpl() [1/2]
new CscPrepRawData
Definition at line 288 of file CscRdoToCscPrepDataToolMT.cxx.
299 <<
"Decoding CSC RDO into CSC PrepRawData is switched off");
300 return StatusCode::SUCCESS;
304 collection_iterator rdoColl = rdoContainer->
begin();
305 collection_iterator lastRdoColl = rdoContainer->
end();
306 std::vector<float> charges;
308 std::vector<uint16_t> samples;
311 IdentifierHash cscHashId;
312 for (; rdoColl != lastRdoColl; ++rdoColl) {
313 if (!(*rdoColl)->empty()) {
314 ATH_MSG_DEBUG(
" Number of RawData in this rdo " << (*rdoColl)->size());
317 unsigned int samplingTime = cscCollection->
rate();
318 unsigned int numSamples = cscCollection->
numSamples();
321 if (
int(samplingTime) !=
int(
m_cscCalibTool->getSamplingTime())) {
322 ATH_MSG_WARNING(
" CSC sampling time from Collection is NOT consistant to calibTool parameter!!!!!!! ");
331 ATH_MSG_DEBUG(
"CSC RDO ID " << (*rdoColl)->identify() <<
" with hashID " << (*rdoColl)->identifyHash());
334 if (
m_idHelperSvc->cscIdHelper().get_hash(stationId, cscHashId, &cscContext)) {
336 <<
"context begin_index = " << cscContext.
begin_index()
337 <<
" context end_index = " << cscContext.
end_index() <<
" the identifier is ");
341 ATH_MSG_DEBUG(
"Create CSC PRD Collection with hash " << cscHashId);
342 std::unique_ptr<CscStripPrepDataCollection> collection =
nullptr;
345 ATH_MSG_DEBUG(
"CSC PRD collection already exist with collection hash = " << cscHashId <<
" collection filling is skipped!");
348 ATH_MSG_DEBUG(
"CSC PRD collection does not exist - creating a new one with hash = " << cscHashId);
349 collection = std::make_unique<CscStripPrepDataCollection>(cscHashId);
354 for (; itD != itD_e; ++itD) {
360 ATH_MSG_DEBUG(
"DecodeAll*Size of online cluster in this RawData: "
361 <<
" Width = " <<
width <<
" Samples = " << totalSamples <<
" stationId : " << stationId
362 <<
" hashOffset : " << hashOffset);
364 for (
unsigned int j = 0; j <
width; ++j) {
372 <<
" Skipping channel ");
377 <<
"> inconsistent with the geometry of detector element <"
382 float timeOfFirstSample = 0.0;
383 bool extractSamples =
data->samples(j, numSamples, samples);
384 if (!extractSamples) {
385 ATH_MSG_WARNING(
"Unable to extract samples for strip " << j <<
" Online Cluster width = " <<
width
386 <<
" for number of Samples = " << numSamples
387 <<
" continuing ...");
391 IdentifierHash stripHash;
398 m_idHelperSvc->cscIdHelper().get_id(stripHash, channelIdFromHash, &cscContext);
400 bool adctocharge =
m_cscCalibTool->adcToCharge(samples, stripHash, charges);
403 <<
"CSC PrepData not build ... skipping ");
406 if (samples.size() >= 4)
409 <<
m_idHelperSvc->cscIdHelper().show_to_string(channelIdFromHash) <<
" " << samples[0] <<
" "
410 << samples[1] <<
" " << samples[2] <<
" " << samples[3] <<
" Charges: "
411 <<
" " << charges[0] <<
" " << charges[1] <<
" " << charges[2] <<
" " << charges[3]);
412 if (
m_idHelperSvc->cscIdHelper().get_hash(stationId, cscHashId, &cscContext)) {
414 <<
"context begin_index = " << cscContext.
begin_index()
415 <<
" context end_index = " << cscContext.
end_index() <<
" the identifier is ");
420 bool IsThisStripDecoded = 0;
425 IsThisStripDecoded = 1;
429 if (IsThisStripDecoded)
continue;
437 double errPos = stripWidth / sqrt(12.0);
440 covariance.setIdentity();
441 covariance *= errPos * errPos;
442 auto errClusterPos =
Amg::
MatrixX(covariance);
446 descriptor, charges, timeOfFirstSample, samplingTime);
448 if (samplingPhase) newPrepData->set_samplingPhase();
449 newPrepData->setHashAndIndex(collection->identifyHash(), collection->
size());
450 collection->push_back(newPrepData);
454 StatusCode status_lock = lock.addOrDelete(std::move(collection));
455 if (status_lock.isFailure()) {
456 ATH_MSG_ERROR(
"Could not insert CscStripPrepdataCollection into CscStripPrepdataContainer...");
457 return StatusCode::FAILURE;
461 return StatusCode::SUCCESS;
◆ decodeImpl() [2/2]
create the CSC RDO decoder
new CscStripPrepRawData
Definition at line 124 of file CscRdoToCscPrepDataToolMT.cxx.
133 ATH_MSG_DEBUG(
"Stored empty container; Decoding CSC RDO into CSC PrepRawData is switched off");
134 return StatusCode::SUCCESS;
140 return StatusCode::SUCCESS;
148 m_cabling->hash2CollectionId(givenHashId, idColl);
150 if (
nullptr == rawCollection) {
151 ATH_MSG_DEBUG(
"Specific CSC RDO collection retrieving failed for collection hash = " << idColl);
152 return StatusCode::SUCCESS;
157 if (rawCollection->
empty())
return StatusCode::SUCCESS;
160 IdentifierHash cscHashId;
162 unsigned int samplingTime = rawCollection->
rate();
163 unsigned int numSamples = rawCollection->
numSamples();
165 std::vector<float> charges;
167 std::vector<uint16_t> samples;
170 if (
int(samplingTime) !=
int(
m_cscCalibTool->getSamplingTime())) {
171 ATH_MSG_WARNING(
" CSC sampling time from Collection is NOT consistant to calibTool parameter!!!!!!! ");
184 if (
m_idHelperSvc->cscIdHelper().get_hash(stationId, cscHashId, &cscContext)) {
186 <<
"context begin_index = " << cscContext.
begin_index() <<
" context end_index = " << cscContext.
end_index()
187 <<
" the identifier is ");
190 ATH_MSG_DEBUG(
"Create CSC PRD Collection with hash " << cscHashId <<
" (givenHashId is " << givenHashId <<
")");
191 std::unique_ptr<CscStripPrepDataCollection> collection =
nullptr;
195 ATH_MSG_DEBUG(
"CSC PRD collection already exist with collection hash = " << cscHashId <<
" collection filling is skipped!");
196 return StatusCode::SUCCESS;
198 ATH_MSG_DEBUG(
"CSC PRD collection does not exist - creating a new one with hash = " << cscHashId);
199 collection = std::make_unique<CscStripPrepDataCollection>(cscHashId);
203 for (; itD != itD_e; ++itD) {
210 <<
" Width = " <<
width <<
" Samples = " << totalSamples <<
" stationId : " << stationId
211 <<
" hashOffset : " << hashOffset);
213 for (
unsigned int j = 0; j <
width; ++j) {
221 <<
" Skipping channel ");
226 <<
"> inconsistent with the geometry of detector element <"
231 float timeOfFirstSample = 0.0;
232 bool extractSamples =
data->samples(j, numSamples, samples);
233 if (!extractSamples) {
234 ATH_MSG_WARNING(
"Unable to extract samples for strip " << j <<
" Online Cluster width = " <<
width
235 <<
" for number of Samples = " << numSamples <<
" continuing ...");
239 IdentifierHash stripHash;
245 bool adctocharge =
m_cscCalibTool->adcToCharge(samples, stripHash, charges);
248 <<
"CSC PrepData not build ... skipping ");
251 if (samples.size() >= 4)
253 <<
" " << samples[2] <<
" " << samples[3] <<
" Charges: "
254 <<
" " << charges[0] <<
" " << charges[1] <<
" " << charges[2] <<
" " << charges[3]);
262 double errPos = stripWidth / sqrt(12.0);
265 covariance.setIdentity();
266 covariance *= errPos * errPos;
271 charges, timeOfFirstSample, samplingTime);
273 if (samplingPhase) newPrepData->set_samplingPhase();
274 newPrepData->setHashAndIndex(collection->identifyHash(), collection->
size());
275 collection->push_back(newPrepData);
279 StatusCode status_lock = lock.addOrDelete(std::move(collection));
280 if (status_lock.isFailure()) {
281 ATH_MSG_ERROR(
"Could not insert CscStripPrepdataCollection into CscStripPrepdataContainer...");
282 return StatusCode::FAILURE;
284 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CscRdoToCscPrepDataToolMT::initialize |
( |
| ) |
|
|
overridevirtual |
◆ provideEmptyContainer()
StatusCode CscRdoToCscPrepDataToolMT::provideEmptyContainer |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Recording the PRD container in StoreGate
Definition at line 42 of file CscRdoToCscPrepDataToolMT.cxx.
49 ATH_CHECK(outputHandle.record(std::make_unique<Muon::CscStripPrepDataContainer>(
m_idHelperSvc->cscIdHelper().module_hash_max())));
56 return StatusCode::FAILURE;
58 ATH_CHECK(outputHandle.record(std::make_unique<Muon::CscStripPrepDataContainer>(
update.ptr())));
61 return StatusCode::SUCCESS;
◆ m_cabling
◆ m_cscCalibTool
◆ m_cscOffset
Gaudi::Property<int> Muon::CscRdoToCscPrepDataToolMT::m_cscOffset {this, "CSCHashIdOffset", 22000} |
|
protected |
◆ m_cscRdoDecoderTool
◆ m_decodeData
Gaudi::Property<bool> Muon::CscRdoToCscPrepDataToolMT::m_decodeData {this, "DecodeData", true} |
|
protected |
◆ m_idHelperSvc
◆ m_muDetMgrKey
Initial value:{this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}
Definition at line 59 of file CscRdoToCscPrepDataToolMT.h.
◆ m_outputCollectionKey
Initial value:{this, "OutputCollection", "CSC_Measurements",
"Muon::CscStripPrepDataContainer to record"}
CscStripPrepRawData containers.
Definition at line 65 of file CscRdoToCscPrepDataToolMT.h.
◆ m_prdContainerCacheKey
Initial value:{this, "CscStripPrdContainerCacheKey", "" ,
"Optional external cache for the CSC RDO container"}
This is the key for the cache for the CSC PRD containers, can be empty.
Definition at line 71 of file CscRdoToCscPrepDataToolMT.h.
◆ m_rdoContainerKey
The documentation for this class was generated from the following files:
char data[hepevt_bytes_allocation_ATLAS]
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Const iterator class for DataVector/DataList.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
uint16_t identify() const
access methods
virtual bool containsId(const Identifier &id) const override
Eigen::Matrix< double, 2, 1 > Vector2D
size_type end_index() const
size_t size() const
Duplicate of fullSize for backwards compatability.
double xCoordinateInTrackingFrame(const Identifier &id) const
bool samplingPhase() const
virtual void setIdentifier(Identifier id)
#define AmgSymMatrix(dim)
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Class representing the raw data of one CSC strip (for clusters look at Muon::CscPrepData).
size_type begin_index() const
IdentifierHash identifyHash() const
Returns the OFFLINE identifier hash for this collection.
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
::StatusCode StatusCode
StatusCode definition for legacy code.
const_iterator end() const
return const_iterator for end of container
const_iterator begin() const
return const_iterator for first entry
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Collection of CSC Raw Hits, arranged according to CSC Detector Elements Author: Ketevi A.
uint16_t numSamples() const
Identifier identify() const
return the identifier
Definition of ATLAS Math & Geometry primitives (Amg)
StatusCode initialize(bool used=true)
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
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,...
Class to hold the electronic output for a single CSC readout channel: n sampling ADC data + the addre...
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
This container provides access to collections of CSC RDOs and a mechanism for recording them.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
uint8_t rate() const
the rate could be 25 or 50 ns
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
double cathodeReadoutPitch(int chLayer, int measuresPhi) const