![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
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() [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 47 of file MmRdoToPrepDataToolMT.cxx.
52 ATH_MSG_DEBUG(
" ***************** Start of process MM Collection");
56 if (rdoColl->
size() > 100)
62 if (!idsToDecode.empty() and
std::find(idsToDecode.begin(), idsToDecode.end(),
63 hash) == idsToDecode.end()) {
65 return StatusCode::SUCCESS;
72 ATH_MSG_DEBUG(
"In processCollection: collection already contained in the MM PrepData container");
73 return StatusCode::SUCCESS;
82 ATH_MSG_DEBUG(
"In processCollection: collection already available in the MM PrepData container (via cache)");
83 return StatusCode::SUCCESS;
85 auto prdColl = std::make_unique<MMPrepDataCollection>(
hash);
90 int getId = id_helper.
get_id(
hash, moduleId, &context);
96 prdColl->setIdentifier(moduleId);
105 "Null pointer to the read MuonDetectorManager conditions object");
106 return StatusCode::FAILURE;
110 xprd.setIdentifier(prd.identify().get_compact());
111 xprd.setMeasurement(
m_idHelperSvc->detElementHash(prd.identify()),
114 xprd.setGasGap(id_helper.
gasGap(prd.identify()));
115 xprd.setChannelNumber(id_helper.
channel(prd.identify()));
116 xprd.setTime(prd.time());
117 xprd.setCharge(prd.charge());
118 xprd.setDriftDist(prd.driftDist());
119 xprd.setAngle(prd.angle());
120 xprd.setChiSqProb(prd.chisqProb());
121 xprd.setAuthor(prd.author());
122 xprd.setQuality(prd.quality());
123 xprd.setStripNumbers(prd.stripNumbers());
124 xprd.setStripTimes(prd.stripTimes());
125 xprd.setStripCharges(prd.stripCharges());
126 xprd.setStripDriftDist(prd.stripDriftDist());
127 xprd.setStripDriftErrors(prd.stripDriftErrors());
130 std::vector<MMPrepData> MMprds;
135 const Identifier rdoId = rdo->identify();
138 << rdoId.get_compact() <<
" ("
140 <<
") is no MicroMega Identifier, continuing");
146 std::vector<Identifier> rdoList;
147 Identifier parentID = id_helper.
parentID(rdoId);
155 rdoList.push_back(prdId);
167 invalidLocalPos =
true;
180 if (calibStrip.
charge < 0) {
181 if (!hitNegativeCharge || msgLvl(
MSG::DEBUG)) {
184 <<
" counts, corresponds to a negative charge ("
185 << calibStrip.
charge <<
"). Skipping these RDOs");
186 hitNegativeCharge =
true;
198 << psurf.
center().y() <<
" z "
200 ATH_MSG_DEBUG(
" localPos x " << localPos.x() <<
" localPos y "
201 << localPos.y() <<
" lpos recalculated 0 "
202 << lpos[0] <<
" lpos y " << lpos[1]);
206 << gdir.phi() <<
" global radius hit " << globalPos.perp()
207 <<
" phi pos " << globalPos.phi() <<
" global z "
214 localPos.x() += calibStrip.
dx;
218 std::unique_ptr<MMPrepData> mpd = std::make_unique<MMPrepData>(
219 prdId,
hash, std::move(localPos), std::move(rdoList), std::move(
cov),
224 auto xprd = xAODContainer->
push_back(std::make_unique<xAOD::MMCluster>());
225 fillxAOD(*mpd, *xprd);
228 prdColl->push_back(std::move(mpd));
231 MMPrepData mpd(prdId,
hash, std::move(localPos), std::move(rdoList),
238 mpd.setHashAndIndex(
hash, 0);
240 MMprds.push_back(std::move(mpd));
245 std::vector<std::unique_ptr<Muon::MMPrepData>>
clusters;
251 for (std::unique_ptr<Muon::MMPrepData>& prdN :
clusters) {
252 prdN->setHashAndIndex(prdColl->identifyHash(), prdColl->size());
254 auto xprd = xAODContainer->
push_back(std::make_unique<xAOD::MMCluster>());
255 fillxAOD(*prdN, *xprd);
257 prdColl->push_back(std::move(prdN));
266 return StatusCode::SUCCESS;
◆ processRDOContainer()
Definition at line 281 of file MmRdoToPrepDataToolMT.cxx.
291 for (MM_RawDataContainer::const_iterator
it = rdoContainer->
begin();
292 it != rdoContainer->
end(); ++
it) {
294 const auto* rdoColl = *
it;
295 if (rdoColl->empty())
297 ATH_MSG_DEBUG(
"New RDO collection with " << rdoColl->size() <<
"MM Hits");
299 if (
processCollection(ctx, mmPrepDataContainer, xAODContainer, idsToDecode, rdoColl).isFailure()) {
301 "processCsm returns a bad StatusCode - keep going for new data "
302 "collections in this event");
◆ provideEmptyContainer()
StatusCode Muon::MmRdoToPrepDataToolMT::provideEmptyContainer |
( |
const EventContext & |
ctx | ) |
const |
|
overridevirtual |
◆ setupMM_PrepDataContainer()
Definition at line 343 of file MmRdoToPrepDataToolMT.cxx.
351 handle.record(std::make_unique<Muon::MMPrepDataContainer>(
354 if (
status.isFailure() || !handle.isValid()) {
356 "Could not record container of MicroMega PrepData Container at "
369 std::make_unique<Muon::MMPrepDataContainer>(
update.ptr()));
370 if (
status.isFailure() || !handle.isValid()) {
372 "Could not record container of MM PrepData Container using cache "
◆ setupxAODPrepDataContainer()
Definition at line 384 of file MmRdoToPrepDataToolMT.cxx.
389 .
record(std::make_unique<xAOD::MMClusterContainer>(),
390 std::make_unique<xAOD::MMClusterAuxContainer>())
393 "Recorded xAOD container with key: " << outputContainer.
key());
394 return outputContainer.
ptr();
◆ 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_mmPrepDataContainerKey
Initial value:{
this, "OutputCollection", "MM_Measurements"}
MdtPrepRawData containers.
Definition at line 68 of file MmRdoToPrepDataToolMT.h.
◆ m_muDetMgrKey
Initial value:{
this, "DetectorManagerKey", "MuonDetectorManager",
"Key of input MuonDetectorManager condition data"}
Definition at line 60 of file MmRdoToPrepDataToolMT.h.
◆ m_prdContainerCacheKey
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_rdoContainerKey
◆ m_singleStripChargeCut
Gaudi::Property<float> Muon::MmRdoToPrepDataToolMT::m_singleStripChargeCut |
|
protected |
◆ 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...
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Class to represent MM measurements.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
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
bool OnlineAndPresentInAnotherView()
This method is to avoid calling an expensive operation in the offline case.
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())
Temporary class to hold the MM RDO.
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
bool stripGlobalPosition(const Identifier &id, Amg::Vector3D &gpos) const
const_iterator end() const
return const_iterator for end of container
void globalToLocalDirection(const Amg::Vector3D &glodir, Trk::LocalDirection &locdir) const
This method transforms the global direction to a local direction wrt the plane.
const_iterator begin() const
return const_iterator for first entry
const IdentifierHash & identifierHash() const
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.
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
Identifier parentID(const Identifier &id) const
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 std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode addOrDelete(std::unique_ptr< T > ptr)
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
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
int gasGap(const Identifier &id) const override
get the hashes
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
#define ATH_MSG_WARNING(x)
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
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
void setAuthor(Author author)
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.
size_type size() const noexcept
Returns the number of elements in the collection.