 |
ATLAS Offline Software
|
#include <MmRdoToPrepDataToolMT.h>
Definition at line 23 of file MmRdoToPrepDataToolMT.h.
◆ ~MmRdoToPrepDataToolMT()
virtual Muon::MmRdoToPrepDataToolMT::~MmRdoToPrepDataToolMT |
( |
| ) |
|
|
virtualdefault |
◆ decode() [1/2]
StatusCode Muon::MmRdoToPrepDataToolMT::decode |
( |
const EventContext & |
ctx, |
|
|
const std::vector< IdentifierHash > & |
idVect |
|
) |
| const |
|
overridevirtual |
Decode method - declared in Muon::IMuonRdoToPrepDataTool.
Definition at line 266 of file MmRdoToPrepDataToolMT.cxx.
270 ATH_MSG_DEBUG(
"Size of the RDO container to be decoded: " << idVect.size());
274 if (!mmPrepDataContainer) {
275 return StatusCode::FAILURE;
282 ATH_CHECK(outputContainer.record(std::make_unique<xAOD::MMClusterContainer>(),
283 std::make_unique<xAOD::MMClusterAuxContainer>()));
284 xAODContainer = outputContainer.ptr();
289 return StatusCode::SUCCESS;
◆ decode() [2/2]
StatusCode Muon::MmRdoToPrepDataToolMT::decode |
( |
const EventContext & |
ctx, |
|
|
const std::vector< uint32_t > & |
robIds |
|
) |
| const |
|
overridevirtual |
◆ getRdoContainer()
◆ initialize()
StatusCode Muon::MmRdoToPrepDataToolMT::initialize |
( |
| ) |
|
|
overridevirtual |
◆ processCollection()
reconstruct the clusters
Definition at line 39 of file MmRdoToPrepDataToolMT.cxx.
44 ATH_MSG_DEBUG(
" ***************** Start of process MM Collection");
49 const IdentifierHash
hash = rdoColl->identifierHash();
52 if (!idsToDecode.empty() and
std::find(idsToDecode.begin(), idsToDecode.end(),
53 hash) == idsToDecode.end()) {
55 return StatusCode::SUCCESS;
62 ATH_MSG_DEBUG(
"In processCollection: collection already contained in the MM PrepData container");
63 return StatusCode::SUCCESS;
70 if (
lock.OnlineAndPresentInAnotherView()) {
71 ATH_MSG_DEBUG(
"In processCollection: collection already available in the MM PrepData container (via cache)");
72 return StatusCode::SUCCESS;
74 auto prdColl = std::make_unique<MMPrepDataCollection>(
hash);
79 if (id_helper.
get_id(
hash, moduleId, &context) != 0) {
83 prdColl->setIdentifier(moduleId);
88 if (!MuonDetMgr.isValid()) {
89 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
90 return StatusCode::FAILURE;
93 std::vector<MMPrepData> MMprds;
95 for (
const MM_RawData* rdo : *rdoColl) {
103 std::vector<Identifier> rdoList;
106 rdoList.push_back(prdId);
128 if (calibStrip.
charge < 0) {
129 if (!hitNegativeCharge || msgLvl(
MSG::DEBUG)) {
130 ATH_MSG_DEBUG(
"One MM RDO or more, such as one with pdo = "<< rdo->charge()
131 <<
" counts, corresponds to a negative charge ("<< calibStrip.
charge <<
"). Skipping these RDOs");
132 hitNegativeCharge =
true;
147 ATH_MSG_DEBUG(
" MM detector surface direction phi "<< gdir.phi() <<
" global radius hit " << globalPos.perp()
148 <<
" phi pos " << globalPos.phi() <<
" global z "<< globalPos.z());
154 localPos.x() += calibStrip.
dx;
158 auto mpd = std::make_unique<MMPrepData>(prdId,
hash,
159 std::move(localPos), std::move(rdoList), std::move(
cov),
164 prdColl->push_back(std::move(mpd));
172 MMPrepData mpd(prdId,
hash, std::move(localPos), std::move(rdoList),
177 mpd.setHashAndIndex(
hash, 0);
179 MMprds.push_back(std::move(mpd));
184 std::vector<std::unique_ptr<MMPrepData>>
clusters;
189 for (std::unique_ptr<MMPrepData>& prdN :
clusters) {
190 prdN->setHashAndIndex(prdColl->identifyHash(), prdColl->size());
191 prdColl->push_back(std::move(prdN));
197 std::vector<const MMPrepData*> sortMe{prdColl->begin(), prdColl->end()};
198 std::ranges::sort(sortMe, IdentifierByDetElSorter{
m_idHelperSvc.get()});
199 for (
const MMPrepData* prd : sortMe) {
201 cluster->setIdentifier(prd->identify().get_compact());
202 cluster->setMeasurement(
m_idHelperSvc->detElementHash(prd->identify()),
205 cluster->setGasGap(id_helper.
gasGap(prd->identify()));
206 cluster->setChannelNumber(id_helper.
channel(prd->identify()));
207 cluster->setTime(prd->time());
208 cluster->setCharge(prd->charge());
209 cluster->setDriftDist(prd->driftDist());
210 cluster->setAngle(prd->angle());
211 cluster->setChiSqProb(prd->chisqProb());
212 cluster->setAuthor(prd->author());
213 cluster->setQuality(prd->quality());
214 cluster->setStripNumbers(prd->stripNumbers());
215 cluster->setStripTimes(prd->stripTimes());
216 cluster->setStripCharges(prd->stripCharges());
217 cluster->setStripDriftDist(prd->stripDriftDist());
218 cluster->setStripDriftErrors(prd->stripDriftErrors());
225 return StatusCode::SUCCESS;
◆ processRDOContainer()
Definition at line 240 of file MmRdoToPrepDataToolMT.cxx.
250 for (
const MM_RawDataCollection* rdoColl : *rdoContainer) {
252 if (rdoColl->empty()){
255 ATH_MSG_DEBUG(
"New RDO collection with " << rdoColl->size() <<
"MM Hits");
257 if (
processCollection(ctx, mmPrepDataContainer, xAODContainer, idsToDecode, rdoColl).isFailure()) {
259 "processCsm returns a bad StatusCode - keep going for new data "
260 "collections in this event");
◆ provideEmptyContainer()
StatusCode Muon::MmRdoToPrepDataToolMT::provideEmptyContainer |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
Definition at line 297 of file MmRdoToPrepDataToolMT.cxx.
300 ATH_CHECK(writeHandle.record(std::make_unique<xAOD::MMClusterContainer>(),
301 std::make_unique<xAOD::MMClusterAuxContainer>()));
305 : StatusCode::FAILURE;
◆ setupMM_PrepDataContainer()
Definition at line 309 of file MmRdoToPrepDataToolMT.cxx.
315 handle.record(std::make_unique<MMPrepDataContainer>(
318 if (
status.isFailure() || !handle.isValid()) {
320 "Could not record container of MicroMega PrepData Container at "
332 if (
status.isFailure() || !handle.isValid()) {
334 "Could not record container of MM PrepData Container using cache "
◆ setupxAODPrepDataContainer()
◆ m_calibTool
ToolHandle<INSWCalibTool> Muon::MmRdoToPrepDataToolMT::m_calibTool {this, "NSWCalibTool", ""} |
|
protected |
◆ m_clusterBuilderTool
Initial value:{
this, "ClusterBuilderTool",
"Muon::SimpleMMClusterBuilderTool/SimpleMMClusterBuilderTool"}
Definition at line 78 of file MmRdoToPrepDataToolMT.h.
◆ m_idHelperSvc
Initial value:{
this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 63 of file MmRdoToPrepDataToolMT.h.
◆ m_merge
Gaudi::Property<bool> Muon::MmRdoToPrepDataToolMT::m_merge {this, "MergePrds", true} |
|
protected |
◆ m_muDetMgrKey
Initial value:{
this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}
Definition at line 59 of file MmRdoToPrepDataToolMT.h.
◆ m_readKey
◆ m_singleStripChargeCut
Gaudi::Property<float> Muon::MmRdoToPrepDataToolMT::m_singleStripChargeCut |
|
protected |
◆ m_updateKey
Initial value:{
this, "PrdCacheKey", "",
"Optional external cache for the MM PRD container"}
This is the key for the cache for the MM PRD containers, can be empty.
Definition at line 73 of file MmRdoToPrepDataToolMT.h.
◆ m_writeKey
Initial value:{
this, "OutputCollection", "MM_Measurements"}
MdtPrepRawData containers.
Definition at line 67 of file MmRdoToPrepDataToolMT.h.
◆ m_xAODKey
Initial value:{
this, "xAODKey", "",
"If empty, do not produce xAOD, otherwise this is the key of the output "
"xAOD MDT PRD container"}
Definition at line 88 of file MmRdoToPrepDataToolMT.h.
The documentation for this class was generated from the following files:
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position – local or global If the strip number is outside the range of valid strips,...
virtual bool globalToLocal(const Amg::Vector3D &glob, const Amg::Vector3D &mom, Amg::Vector2D &loc) const override final
Specified for PlaneSurface: GlobalToLocal method without dynamic memory allocation - boolean checks i...
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
friend class IDC_WriteHandle
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override
Create compact id from hash id (return == 0 for OK)
std::string find(const std::string &s)
return a remapped string
IDC_WriteHandle getWriteHandle(IdentifierHash hash)
Eigen::Matrix< double, 2, 1 > Vector2D
MuonPrepDataContainerT< MMPrepData > MMPrepDataContainer
const Amg::Vector3D & center() const
Returns the center position of the Surface.
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
int multilayer(const Identifier &id) const
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
represents the three-dimensional global direction with respect to a planar surface frame.
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
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,...
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
#define ATH_MSG_WARNING(x)
IdContext module_context() const
id for module
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Eigen::Matrix< float, N, N > MeasMatrix
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...