ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonPRDTest
Root
TGCSDOVariables.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonPRDTest/TGCSDOVariables.h
"
6
namespace
MuonPRDTest
{
7
TgcSDOVariables::TgcSDOVariables
(
MuonTesterTree
&
tree
,
const
std::string& container_name, MSG::Level msglvl) :
8
PrdTesterModule
(
tree
,
"TGC_SDO"
, msglvl),
m_key
{container_name} {}
9
10
bool
TgcSDOVariables::declare_keys
() {
return
declare_dependency
(
m_key
); }
11
12
bool
TgcSDOVariables::fill
(
const
EventContext& ctx) {
13
ATH_MSG_DEBUG
(
"do fill TgcSDOVariable()"
);
14
SG::ReadHandle<MuonSimDataCollection>
tgcSdoContainer{
m_key
, ctx};
15
if
(!tgcSdoContainer.
isValid
()) {
16
ATH_MSG_FATAL
(
"Failed to retrieve digit container "
<<
m_key
.fullKey());
17
return
false
;
18
}
19
unsigned
int
n_sdo{0};
20
for
(
const
auto
& coll : *tgcSdoContainer) {
21
const
Identifier
&
id
= coll.first;
22
const
MuonSimData
& tgc_sdo = coll.second;
23
m_tgc_sdo_id
.push_back(
id
);
24
m_tgc_sdo_globaltime
.push_back(tgc_sdo.
getTime
());
25
m_tgc_sdo_word
.push_back(tgc_sdo.
word
());
26
27
ATH_MSG_DEBUG
(
"TGC SDO: "
<<
idHelperSvc
()->toString(
id
));
28
29
ATH_MSG_DEBUG
(
"Get the truth deposits from the SDO."
);
30
std::vector<MuonSimData::Deposit> deposits;
31
tgc_sdo.
deposits
(deposits);
32
m_TGC_dig_globalPos
.push_back(tgc_sdo.
globalPosition
());
33
34
// use the information of the first deposit
35
int
barcode = deposits[0].first.barcode();
36
double
MuonMCdata_firstentry = deposits[0].second.firstEntry();
37
double
MuonMCdata_secondentry = deposits[0].second.secondEntry();
38
39
ATH_MSG_DEBUG
(
"TGC SDO barcode="
<< barcode);
40
ATH_MSG_DEBUG
(
"TGC SDO localPosX="
<< std::setw(9) << std::setprecision(2) << MuonMCdata_firstentry
41
<<
", localPosY="
<< std::setw(9) << std::setprecision(2) << MuonMCdata_secondentry);
42
43
m_tgc_sdo_barcode
.push_back(barcode);
44
m_tgc_sdo_localPosX
.push_back(MuonMCdata_firstentry);
45
m_tgc_sdo_localPosY
.push_back(MuonMCdata_secondentry);
46
++n_sdo;
47
}
48
m_tgc_nsdo
= n_sdo;
49
50
ATH_MSG_DEBUG
(
"Processed "
<< n_sdo <<
" TGC SDOs"
);
51
return
true
;
52
}
53
}
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TGCSDOVariables.h
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::TgcSDOVariables::m_TGC_dig_globalPos
ThreeVectorBranch m_TGC_dig_globalPos
Definition
TGCSDOVariables.h:30
MuonPRDTest::TgcSDOVariables::m_tgc_sdo_localPosY
VectorBranch< float > & m_tgc_sdo_localPosY
Definition
TGCSDOVariables.h:32
MuonPRDTest::TgcSDOVariables::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
TGCSDOVariables.cxx:12
MuonPRDTest::TgcSDOVariables::m_tgc_nsdo
ScalarBranch< unsigned int > & m_tgc_nsdo
Definition
TGCSDOVariables.h:24
MuonPRDTest::TgcSDOVariables::declare_keys
bool declare_keys() override final
Definition
TGCSDOVariables.cxx:10
MuonPRDTest::TgcSDOVariables::m_tgc_sdo_word
VectorBranch< int > & m_tgc_sdo_word
Definition
TGCSDOVariables.h:26
MuonPRDTest::TgcSDOVariables::m_tgc_sdo_barcode
VectorBranch< int > & m_tgc_sdo_barcode
Definition
TGCSDOVariables.h:27
MuonPRDTest::TgcSDOVariables::m_key
SG::ReadHandleKey< MuonSimDataCollection > m_key
Definition
TGCSDOVariables.h:22
MuonPRDTest::TgcSDOVariables::m_tgc_sdo_localPosX
VectorBranch< float > & m_tgc_sdo_localPosX
Definition
TGCSDOVariables.h:31
MuonPRDTest::TgcSDOVariables::m_tgc_sdo_id
TgcIdentifierBranch m_tgc_sdo_id
Definition
TGCSDOVariables.h:25
MuonPRDTest::TgcSDOVariables::TgcSDOVariables
TgcSDOVariables(MuonTesterTree &tree, const std::string &container_name, MSG::Level msglvl)
Definition
TGCSDOVariables.cxx:7
MuonPRDTest::TgcSDOVariables::m_tgc_sdo_globaltime
VectorBranch< float > & m_tgc_sdo_globaltime
Definition
TGCSDOVariables.h:28
MuonSimData
Definition
MuonSimData.h:62
MuonSimData::word
int word() const
Definition
MuonSimData.h:89
MuonSimData::deposits
void deposits(std::vector< Deposit > &deposits) const
Definition
MuonSimData.h:99
MuonSimData::globalPosition
const Amg::Vector3D globalPosition() const
Definition
MuonSimData.h:113
MuonSimData::getTime
float getTime() const
Definition
MuonSimData.h:124
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?
Identifier
Definition
IdentifierFieldParser.cxx:14
MuonPRDTest
Definition
MuonHitTesterAlg.h:15
Generated on
for ATLAS Offline Software by
1.17.0