ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
Root
TGCDigitVariables.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/TGCDigitVariables.h
"
6
7
#include "
MuonReadoutGeometry/TgcReadoutElement.h
"
8
namespace
MuonPRDTest
{
9
TgcDigitVariables::TgcDigitVariables
(
MuonTesterTree
&
tree
,
const
std::string& container_name, MSG::Level msglvl) :
10
PrdTesterModule
(
tree
,
"Digits_TGC"
, msglvl),
m_key
{container_name} {}
11
12
bool
TgcDigitVariables::fill
(
const
EventContext& ctx) {
13
ATH_MSG_DEBUG
(
"do fillTGCSimHitVariables()"
);
14
const
MuonGM::MuonDetectorManager
* MuonDetMgr =
getDetMgr
(ctx);
15
if
(!MuonDetMgr) {
return
false
; }
16
SG::ReadHandle<TgcDigitContainer>
TgcDigitContainer
{
m_key
, ctx};
17
if
(!
TgcDigitContainer
.isValid()) {
18
ATH_MSG_FATAL
(
"Failed to retrieve digit container "
<<
m_key
.fullKey());
19
return
false
;
20
}
21
22
ATH_MSG_DEBUG
(
"retrieved TGC Digit Container with size "
<<
TgcDigitContainer
->
digit_size
());
23
24
if
(
TgcDigitContainer
->
size
() == 0)
ATH_MSG_DEBUG
(
" TGC Digit Container empty "
);
25
unsigned
int
n_digits{0};
26
for
(
const
TgcDigitCollection
* coll : *
TgcDigitContainer
) {
27
ATH_MSG_DEBUG
(
"processing collection with size "
<< coll->size());
28
for
(
const
TgcDigit
* digit : *coll) {
29
Identifier
Id = digit->identify();
30
ATH_MSG_DEBUG
(
"TGC Digit Offline id: "
<<
idHelperSvc
()->toString(Id));
31
32
const
MuonGM::TgcReadoutElement
* rdoEl = MuonDetMgr->
getTgcReadoutElement
(Id);
33
if
(!rdoEl) {
34
ATH_MSG_ERROR
(
"TGCDigitVariables::fillVariables() - Failed to retrieve TGCReadoutElement for "
<<
idHelperSvc
()->tgcIdHelper().print_to_string(Id).c_str());
35
return
false
;
36
}
37
38
Amg::Vector3D
gpos{Amg::Vector3D::Zero()};
39
Amg::Vector2D
lpos{Amg::Vector2D::Zero()};
40
41
if
(!rdoEl->
stripPosition
(Id, lpos)) {
42
continue
;
43
}
44
rdoEl->
surface
(Id).
localToGlobal
(lpos, gpos, gpos);
45
m_TGC_dig_globalPos
.push_back(gpos);
46
m_TGC_dig_localPos
.push_back(lpos);
47
m_TGC_dig_bcId
.push_back(digit->bcTag());
48
m_TGC_dig_id
.push_back(Id);
49
++n_digits;
50
}
51
}
52
m_TGC_nDigits
= n_digits;
53
ATH_MSG_DEBUG
(
" finished fillTgcDigitVariables()"
);
54
return
true
;
55
}
56
bool
TgcDigitVariables::declare_keys
() {
return
declare_dependency
(
m_key
); }
57
}
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_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TgcReadoutElement.h
TGCDigitVariables.h
IdentifiableContainerMT::size
size_t size() const
Duplicate of fullSize for backwards compatability.
Definition
IdentifiableContainerMT.h:209
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::getTgcReadoutElement
const TgcReadoutElement * getTgcReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition
MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:259
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
MuonGM::TgcReadoutElement::stripPosition
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override
strip position If the strip number is outside the range of valid strips, the function will return fal...
Definition
MuonDetDescr/MuonReadoutGeometry/src/TgcReadoutElement.cxx:312
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
MuonPRDTest::TgcDigitVariables::m_TGC_dig_globalPos
ThreeVectorBranch m_TGC_dig_globalPos
Definition
TGCDigitVariables.h:25
MuonPRDTest::TgcDigitVariables::TgcDigitVariables
TgcDigitVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition
TGCDigitVariables.cxx:9
MuonPRDTest::TgcDigitVariables::m_TGC_nDigits
ScalarBranch< unsigned int > & m_TGC_nDigits
Definition
TGCDigitVariables.h:24
MuonPRDTest::TgcDigitVariables::m_TGC_dig_id
TgcIdentifierBranch m_TGC_dig_id
Definition
TGCDigitVariables.h:28
MuonPRDTest::TgcDigitVariables::m_TGC_dig_localPos
TwoVectorBranch m_TGC_dig_localPos
Definition
TGCDigitVariables.h:26
MuonPRDTest::TgcDigitVariables::m_TGC_dig_bcId
VectorBranch< uint8_t > & m_TGC_dig_bcId
Definition
TGCDigitVariables.h:27
MuonPRDTest::TgcDigitVariables::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
TGCDigitVariables.cxx:12
MuonPRDTest::TgcDigitVariables::declare_keys
bool declare_keys() override final
Definition
TGCDigitVariables.cxx:56
MuonPRDTest::TgcDigitVariables::m_key
SG::ReadHandleKey< TgcDigitContainer > m_key
Definition
TGCDigitVariables.h:23
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
TgcDigitCollection
Definition
TgcDigitCollection.h:17
TgcDigitContainer
Use IdentifiableContainer with TgcDigitCollection.
Definition
TgcDigitContainer.h:53
TgcDigitContainer::digit_size
size_type digit_size() const
Definition
TgcDigitContainer.cxx:57
TgcDigit
Definition
TgcDigit.h:21
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