|
ATLAS Offline Software
|
#include <MmRdoToPrepDataToolMT.h>
Definition at line 22 of file MmRdoToPrepDataToolMT.h.
◆ MmRdoToPrepDataToolMT()
Muon::MmRdoToPrepDataToolMT::MmRdoToPrepDataToolMT |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~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 268 of file MmRdoToPrepDataToolMT.cxx.
272 ATH_MSG_DEBUG(
"Size of the RDO container to be decoded: " << idVect.size());
276 if (!mmPrepDataContainer) {
277 return StatusCode::FAILURE;
282 ATH_CHECK(outputContainer.recordNonConst(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 44 of file MmRdoToPrepDataToolMT.cxx.
49 ATH_MSG_DEBUG(
" ***************** Start of process MM Collection");
54 const IdentifierHash
hash = rdoColl->identifierHash();
57 if (!idsToDecode.empty() and
std::find(idsToDecode.begin(), idsToDecode.end(),
58 hash) == idsToDecode.end()) {
60 return StatusCode::SUCCESS;
67 ATH_MSG_DEBUG(
"In processCollection: collection already contained in the MM PrepData container");
68 return StatusCode::SUCCESS;
75 if (lock.OnlineAndPresentInAnotherView()) {
76 ATH_MSG_DEBUG(
"In processCollection: collection already available in the MM PrepData container (via cache)");
77 return StatusCode::SUCCESS;
79 auto prdColl = std::make_unique<MMPrepDataCollection>(
hash);
84 if (id_helper.
get_id(
hash, moduleId, &context) != 0) {
88 prdColl->setIdentifier(moduleId);
93 if (!MuonDetMgr.isValid()) {
94 ATH_MSG_ERROR(
"Null pointer to the read MuonDetectorManager conditions object");
95 return StatusCode::FAILURE;
98 std::vector<MMPrepData> MMprds;
100 for (
const MM_RawData* rdo : *rdoColl) {
107 std::vector<Identifier> rdoList;
110 rdoList.push_back(prdId);
132 if (calibStrip.
charge < 0) {
133 if (!hitNegativeCharge || msgLvl(
MSG::DEBUG)) {
134 ATH_MSG_WARNING(
"One MM RDO or more, such as one with pdo = "<< rdo->charge()
135 <<
" counts, corresponds to a negative charge ("<< calibStrip.
charge <<
"). Skipping these RDOs");
136 hitNegativeCharge =
true;
151 ATH_MSG_DEBUG(
" MM detector surface direction phi "<< gdir.phi() <<
" global radius hit " << globalPos.perp()
152 <<
" phi pos " << globalPos.phi() <<
" global z "<< globalPos.z());
158 localPos.x() += calibStrip.
dx;
162 auto mpd = std::make_unique<MMPrepData>(prdId,
hash,
163 std::move(localPos), std::move(rdoList), std::move(
cov),
168 prdColl->push_back(std::move(mpd));
174 MMPrepData mpd(prdId,
hash, std::move(localPos), std::move(rdoList),
179 mpd.setHashAndIndex(
hash, 0);
181 MMprds.push_back(std::move(mpd));
186 std::vector<std::unique_ptr<MMPrepData>>
clusters;
191 for (std::unique_ptr<MMPrepData>& prdN :
clusters) {
192 prdN->setHashAndIndex(prdColl->identifyHash(), prdColl->size());
193 prdColl->push_back(std::move(prdN));
199 std::vector<const MMPrepData*> sortMe{prdColl->begin(), prdColl->end()};
200 std::ranges::sort(sortMe, IdentifierByDetElSorter{
m_idHelperSvc.get()});
201 for (
const MMPrepData* prd : sortMe) {
203 cluster->setIdentifier(prd->identify().get_compact());
204 cluster->setMeasurement(
m_idHelperSvc->detElementHash(prd->identify()),
207 cluster->setGasGap(id_helper.
gasGap(prd->identify()));
208 cluster->setChannelNumber(id_helper.
channel(prd->identify()));
209 cluster->setTime(prd->time());
210 cluster->setCharge(prd->charge());
211 cluster->setDriftDist(prd->driftDist());
212 cluster->setAngle(prd->angle());
213 cluster->setChiSqProb(prd->chisqProb());
214 cluster->setAuthor(prd->author());
215 cluster->setQuality(prd->quality());
216 cluster->setStripNumbers(prd->stripNumbers());
217 cluster->setStripTimes(prd->stripTimes());
218 cluster->setStripCharges(prd->stripCharges());
219 cluster->setStripDriftDist(prd->stripDriftDist());
220 cluster->setStripDriftErrors(prd->stripDriftErrors());
224 ATH_CHECK(lock.addOrDelete(std::move(prdColl)));
227 return StatusCode::SUCCESS;
◆ processRDOContainer()
Definition at line 242 of file MmRdoToPrepDataToolMT.cxx.
252 for (
const MM_RawDataCollection* rdoColl : *rdoContainer) {
254 if (rdoColl->empty()){
257 ATH_MSG_DEBUG(
"New RDO collection with " << rdoColl->size() <<
"MM Hits");
259 if (
processCollection(ctx, mmPrepDataContainer, xAODContainer, idsToDecode, rdoColl).isFailure()) {
261 "processCsm returns a bad StatusCode - keep going for new data "
262 "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 79 of file MmRdoToPrepDataToolMT.h.
◆ m_idHelperSvc
Initial value:{
this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
Definition at line 64 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 60 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 74 of file MmRdoToPrepDataToolMT.h.
◆ m_writeKey
Initial value:{
this, "OutputCollection", "MM_Measurements"}
MdtPrepRawData containers.
Definition at line 68 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 89 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...