ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
Root
MDTPRDVariables.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDTest/MDTPRDVariables.h
"
6
7
#include "
AthenaBaseComps/AthMsgStreamMacros.h
"
8
#include "
GeoPrimitives/GeoPrimitivesToStringConverter.h
"
9
#include "
MuonReadoutGeometry/MdtReadoutElement.h
"
10
#include "
EventPrimitives/EventPrimitivesHelpers.h
"
11
namespace
MuonPRDTest
{
12
MDTPRDVariables::MDTPRDVariables
(
MuonTesterTree
&
tree
,
const
std::string& container_name, MSG::Level msglvl) :
13
PrdTesterModule
(
tree
,
"PRD_MDT"
, msglvl),
m_key
{container_name} {}
14
bool
MDTPRDVariables::declare_keys
() {
return
declare_dependency
(
m_key
); }
15
16
bool
MDTPRDVariables::fill
(
const
EventContext& ctx) {
17
ATH_MSG_DEBUG
(
"do fillMDTPRDVariables()"
);
18
19
SG::ReadHandle<Muon::MdtPrepDataContainer>
mdtprdContainer{
m_key
, ctx};
20
if
(!mdtprdContainer.
isValid
()) {
21
ATH_MSG_FATAL
(
"Failed to retrieve prd container "
<<
m_key
.fullKey());
22
return
false
;
23
}
24
25
ATH_MSG_DEBUG
(
"retrieved MDT PRD Container with size "
<< mdtprdContainer->size());
26
27
unsigned
int
n_PRD{0};
28
for
(
const
Muon::MdtPrepDataCollection
* coll : *mdtprdContainer ) {
29
for
(
const
Muon::MdtPrepData
* prd: *coll) {
30
31
m_MDT_PRD_id
.push_back(prd->identify());
32
m_MDT_PRD_globalPos
.push_back(prd->globalPosition());
33
m_MDT_PRD_radius
.push_back(prd->localPosition().x());
34
m_MDT_PRD_error
.push_back(
Amg::error
(prd->localCovariance(),
Trk::locX
));
35
m_MDT_PRD_adc
.push_back(prd->adc());
36
m_MDT_PRD_tdc
.push_back(prd->tdc());
37
m_MDT_PRD_status
.push_back(prd->status());
38
39
++n_PRD;
40
}
41
}
42
m_MDT_nPRD
= n_PRD;
43
ATH_MSG_DEBUG
(
" finished fillMDTPRDVariables()"
);
44
return
true
;
45
}
46
}
AthMsgStreamMacros.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EventPrimitivesHelpers.h
GeoPrimitivesToStringConverter.h
MDTPRDVariables.h
MdtReadoutElement.h
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_error
VectorBranch< float > & m_MDT_PRD_error
Definition
MDTPRDVariables.h:30
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_id
MdtIdentifierBranch m_MDT_PRD_id
Definition
MDTPRDVariables.h:29
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_adc
VectorBranch< int > & m_MDT_PRD_adc
Definition
MDTPRDVariables.h:31
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_globalPos
ThreeVectorBranch m_MDT_PRD_globalPos
Definition
MDTPRDVariables.h:27
MuonPRDTest::MDTPRDVariables::m_key
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_key
Definition
MDTPRDVariables.h:24
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_status
VectorBranch< int > & m_MDT_PRD_status
Definition
MDTPRDVariables.h:33
MuonPRDTest::MDTPRDVariables::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
MDTPRDVariables.cxx:16
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_radius
VectorBranch< double > & m_MDT_PRD_radius
Definition
MDTPRDVariables.h:28
MuonPRDTest::MDTPRDVariables::m_MDT_nPRD
ScalarBranch< unsigned int > & m_MDT_nPRD
Definition
MDTPRDVariables.h:25
MuonPRDTest::MDTPRDVariables::declare_keys
bool declare_keys() override final
Definition
MDTPRDVariables.cxx:14
MuonPRDTest::MDTPRDVariables::m_MDT_PRD_tdc
VectorBranch< int > & m_MDT_PRD_tdc
Definition
MDTPRDVariables.h:32
MuonPRDTest::MDTPRDVariables::MDTPRDVariables
MDTPRDVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition
MDTPRDVariables.cxx:12
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
Muon::MdtPrepData
Class to represent measurements from the Monitored Drift Tubes.
Definition
MdtPrepData.h:33
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition
EventPrimitivesHelpers.h:40
MuonPRDTest
Definition
MuonHitTesterAlg.h:15
Muon::MdtPrepDataCollection
MuonPrepDataCollection< MdtPrepData > MdtPrepDataCollection
Definition
MuonPrepDataCollection.h:106
Trk::locX
@ locX
Definition
ParamDefs.h:37
Generated on
for ATLAS Offline Software by
1.17.0