ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
Root
MMDigitVariables.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDTest/MMDigitVariables.h
"
6
7
#include "
MuonReadoutGeometry/MMReadoutElement.h
"
8
9
namespace
MuonPRDTest
{
10
MMDigitVariables::MMDigitVariables
(
MuonTesterTree
&
tree
,
const
std::string& container_name, MSG::Level msglvl) :
11
PrdTesterModule
(
tree
,
"Digits_MM"
, msglvl),
m_key
{container_name} {}
12
13
bool
MMDigitVariables::declare_keys
() {
return
declare_dependency
(
m_key
); }
14
bool
MMDigitVariables::fill
(
const
EventContext& ctx) {
15
ATH_MSG_DEBUG
(
"do fillMMDigitHitVariables()"
);
16
const
MuonGM::MuonDetectorManager
* MuonDetMgr =
getDetMgr
(ctx);
17
if
(!MuonDetMgr) {
return
false
; }
18
SG::ReadHandle<MmDigitContainer>
MMDigitContainer{
m_key
, ctx};
19
if
(!MMDigitContainer.
isValid
()) {
20
ATH_MSG_FATAL
(
"Failed to retrieve digit container "
<<
m_key
.fullKey());
21
return
false
;
22
}
23
24
ATH_MSG_DEBUG
(
"retrieved MM Digit Container with size "
<< MMDigitContainer->digit_size());
25
26
if
(MMDigitContainer->size() == 0)
ATH_MSG_DEBUG
(
" MM Digit Container empty "
);
27
unsigned
int
n_digits{0};
28
for
(
const
MmDigitCollection
* coll : *MMDigitContainer) {
29
ATH_MSG_DEBUG
(
"processing collection with size "
<< coll->size());
30
for
(
const
MmDigit
* digit : *coll) {
31
Identifier
Id = digit->identify();
32
33
const
MuonGM::MMReadoutElement
* rdoEl = MuonDetMgr->
getMMReadoutElement
(Id);
34
if
(!rdoEl) {
35
ATH_MSG_ERROR
(
"MMDigitVariables::fillVariables() - Failed to retrieve MMReadoutElement for "
<<
idHelperSvc
()->mmIdHelper().print_to_string(Id).c_str());
36
return
false
;
37
}
38
m_NSWMM_dig_id
.push_back(Id);
39
40
Amg::Vector2D
cr_strip_pos{Amg::Vector2D::Zero()};
41
if
( !rdoEl->
stripPosition
(Id, cr_strip_pos) ) {
42
ATH_MSG_WARNING
(
"MMDigitVariables: failed to associate a valid local position for (chip response) strip n. "
43
<<
"; associated positions will be set to 0.0."
);
44
continue
;
45
}
46
m_NSWMM_dig_stripLpos
.push_back(cr_strip_pos);
47
// asking the detector element to transform this local to the global position
48
Amg::Vector3D
cr_strip_gpos(Amg::Vector3D::Zero());
49
rdoEl->
surface
(Id).
localToGlobal
(cr_strip_pos, Amg::Vector3D::Zero(), cr_strip_gpos);
50
m_NSWMM_dig_stripGpos
.push_back(cr_strip_gpos);
51
++n_digits;
52
}
53
}
54
m_NSWMM_nDigits
= n_digits;
55
ATH_MSG_DEBUG
(
" finished fillMMDigitVariables()"
);
56
return
true
;
57
}
58
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
MMDigitVariables.h
MMReadoutElement.h
MmDigitCollection
Definition
MmDigitCollection.h:18
MmDigit
Definition
MmDigit.h:20
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition
MMReadoutElement.h:25
MuonGM::MMReadoutElement::stripPosition
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,...
Definition
MMReadoutElement.h:206
MuonGM::MuonClusterReadoutElement::surface
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
Definition
MuonClusterReadoutElement.h:123
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:51
MuonGM::MuonDetectorManager::getMMReadoutElement
const MMReadoutElement * getMMReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition
MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:267
MuonPRDTest::MMDigitVariables::fill
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition
MMDigitVariables.cxx:14
MuonPRDTest::MMDigitVariables::m_NSWMM_dig_stripGpos
ThreeVectorBranch m_NSWMM_dig_stripGpos
Definition
MMDigitVariables.h:29
MuonPRDTest::MMDigitVariables::m_NSWMM_dig_id
MmIdentifierBranch m_NSWMM_dig_id
Definition
MMDigitVariables.h:30
MuonPRDTest::MMDigitVariables::m_NSWMM_nDigits
ScalarBranch< unsigned int > & m_NSWMM_nDigits
Definition
MMDigitVariables.h:25
MuonPRDTest::MMDigitVariables::declare_keys
bool declare_keys() override final
Definition
MMDigitVariables.cxx:13
MuonPRDTest::MMDigitVariables::m_NSWMM_dig_stripLpos
TwoVectorBranch m_NSWMM_dig_stripLpos
Definition
MMDigitVariables.h:28
MuonPRDTest::MMDigitVariables::MMDigitVariables
MMDigitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition
MMDigitVariables.cxx:10
MuonPRDTest::MMDigitVariables::m_key
SG::ReadHandleKey< MmDigitContainer > m_key
Definition
MMDigitVariables.h:24
MuonPRDTest::PrdTesterModule::getDetMgr
const MuonGM::MuonDetectorManager * getDetMgr(const EventContext &ctx) const
Definition
PrdTesterModule.cxx:16
MuonPRDTest::PrdTesterModule::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Definition
PrdTesterModule.cxx:15
MuonPRDTest::PrdTesterModule::PrdTesterModule
PrdTesterModule(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl)
Definition
PrdTesterModule.cxx:8
MuonVal::MuonTesterBranch::declare_dependency
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::PlaneSurface::localToGlobal
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
Definition
PlaneSurface.cxx:201
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition
GeoPrimitives.h:48
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonPRDTest
Definition
MuonHitTesterAlg.h:15
Generated on
for ATLAS Offline Software by
1.17.0