ATLAS Offline Software
PhysicsAnalysis
D3PDMaker
TileD3PDMaker
src
TileAssocFillerTool.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
/*
6
* File: TileAssocTrackClusters.cxx
7
* Author: Carlos.Solans@cern.ch
8
* June 2014
9
* Implementation of a VoidBlockFillerTool
10
* PhysicsAnalysis/D3PDMaker/D3PDMakerUtils
11
*/
12
13
#include "
TileAssocFillerTool.h
"
14
15
using namespace
std;
16
using namespace
D3PD
;
17
18
//====================================================================
19
TileAssocFillerTool::TileAssocFillerTool(
const
string
&
type
,
const
string
&
name
,
const
IInterface*
parent
):
20
BlockFillerTool
<void>(
type
,
name
,
parent
){
21
//====================================================================
22
23
/* ContainerName string storegate key that contains the association to be writen to D3PD
24
* BrachName string name of the branch used for the association prepended with target and prefix
25
*/
26
declareProperty
(
"ContainerName"
,
m_containerName
=
"AssociationKey"
);
27
declareProperty
(
"BranchName"
,
m_branchName
=
"_index"
);
28
29
/* I have no idea what is this for */
30
TileAssocFillerTool::book
().ignore();
// Avoid coverity warnings
31
}
32
33
//=====================================================
34
StatusCode
TileAssocFillerTool::initialize
(){
35
//=====================================================
36
/* Initialize the tool by calling the parent */
37
CHECK
(
BlockFillerTool<void>::initialize
() );
38
39
/* Get storegate for later use */
40
CHECK
( service(
"StoreGateSvc"
,
m_storeGate
) );
41
42
/* Create the object that will contain the association */
43
m_container
=
new
ASSOCCONTAINER_CONSTRUCTOR
(0);
44
45
return
StatusCode::SUCCESS;
46
}
47
48
//=====================================================
49
StatusCode
TileAssocFillerTool::book
(){
50
//=====================================================
51
52
/* Register the association object in the D3PD */
53
CHECK
(
addVariable
(
m_branchName
,
m_container
));
54
55
return
StatusCode::SUCCESS;
56
}
57
58
//=====================================================================
59
StatusCode
TileAssocFillerTool::fill
(){
60
//=====================================================================
61
62
/* Get the association from storegate */
63
ASSOCCONTAINER
* cont;
64
CHECK
(
m_storeGate
->retrieve(cont,
m_containerName
));
65
66
/* Copy the association to the local variable for the D3PD */
67
m_container
->clear();
68
m_container
->resize(cont->size());
69
for
(
unsigned
int
i
=0;
i
< cont->size();
i
++){
70
//cppcheck-suppress containerOutOfBounds
71
m_container
->at(
i
).resize(cont->at(
i
).size());
72
for
(
unsigned
int
j=0; j< cont->at(
i
).
size
(); j++){
73
//cppcheck-suppress containerOutOfBounds
74
m_container
->at(
i
).at(j)=cont->at(
i
).at(j);
75
}
76
}
77
78
/* Association object will be written to the D3PD after this */
79
80
return
StatusCode::SUCCESS;
81
}
82
TileAssocFillerTool.h
ASSOCCONTAINER_CONSTRUCTOR
#define ASSOCCONTAINER_CONSTRUCTOR(size)
Definition:
TileAssocFillerTool.h:23
D3PD::TileAssocFillerTool::m_containerName
std::string m_containerName
Definition:
TileAssocFillerTool.h:39
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition:
AddVariable.cxx:85
D3PD::TileAssocFillerTool::m_storeGate
StoreGateSvc * m_storeGate
Definition:
TileAssocFillerTool.h:41
python.setupRTTAlg.size
int size
Definition:
setupRTTAlg.py:39
D3PD
Block filler tool for noisy FEB information.
Definition:
InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
D3PD::TileAssocFillerTool::book
virtual StatusCode book()
Definition:
TileAssocFillerTool.cxx:49
D3PD::TileAssocFillerTool::m_container
ASSOCCONTAINER * m_container
Definition:
TileAssocFillerTool.h:40
lumiFormat.i
int i
Definition:
lumiFormat.py:92
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition:
test_pyathena.py:15
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition:
BlockFillerTool.h:68
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition:
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::TileAssocFillerTool::m_branchName
std::string m_branchName
Definition:
TileAssocFillerTool.h:38
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:195
D3PD::TileAssocFillerTool::initialize
StatusCode initialize()
Definition:
TileAssocFillerTool.cxx:34
python.CaloScaleNoiseConfig.type
type
Definition:
CaloScaleNoiseConfig.py:78
declareProperty
#define declareProperty(n, p, h)
Definition:
BaseFakeBkgTool.cxx:15
D3PD::TileAssocFillerTool::fill
virtual StatusCode fill()
Fill one block — type-safe version.
Definition:
TileAssocFillerTool.cxx:59
ASSOCCONTAINER
std::vector< std::vector< int > > ASSOCCONTAINER
Definition:
TileAssocFillerTool.h:22
Generated on Thu Jul 4 2024 21:28:47 for ATLAS Offline Software by
1.8.18