ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
CaloSysD3PDMaker
src
TowerFillerTool.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: TowerFillerTool.cxx
7
* Author: stephen
8
*
9
* Created on August 26, 2011, 1:36 PM
10
*/
11
12
#include "
TowerFillerTool.h
"
13
#include "
AthenaKernel/errorcheck.h
"
14
15
namespace
D3PD
{
16
17
TowerFillerTool::TowerFillerTool
(
const
std::string&
type
,
18
const
std::string& name,
19
const
IInterface* parent):
BlockFillerTool
<
CaloTower
>(
type
,name,parent)
20
{
21
m_SaveConstituents
=
false
;
22
declareProperty(
"SaveNCellConstituents"
,
m_SaveConstituents
=
true
);
23
TowerFillerTool::book
().ignore();
24
}
25
26
27
StatusCode
TowerFillerTool::book
(){
28
if
(
m_SaveConstituents
) {
29
CHECK
(
addVariable
(
"tower_nCaloCells"
,
m_nCaloCells
));
30
CHECK
(
addVariable
(
"tower_CellWeights"
,
m_cellWeights
));
31
CHECK
(
addVariable
(
"tower_statusWord"
,
m_statWord
));
32
}
33
else
{
34
CHECK
(
addVariable
(
"tower_pT"
,
m_pT
));
35
CHECK
(
addVariable
(
"tower_eta"
,
m_eta
));
36
CHECK
(
addVariable
(
"tower_phi"
,
m_phi
));
37
CHECK
(
addVariable
(
"tower_E"
,
m_E
));
38
}
39
return
StatusCode::SUCCESS;
40
}
41
42
43
44
StatusCode
TowerFillerTool::fill
(
const
CaloTower
& p){
45
if
(
m_SaveConstituents
){
46
*
m_nCaloCells
=p.getNumberOfCells();
47
*
m_statWord
=p.getRecoStatus().getStatusWord();
48
Navigable<CaloCellContainer,double>::object_iter
it=p.cell_begin();
49
for
(;it!=p.cell_end();++it){
50
double
weight=p.getCellWeight(it);
51
m_cellWeights
->push_back(weight);
52
}
53
}
54
else
{
55
*
m_pT
=p.pt();
56
*
m_eta
=p.eta();
57
*
m_phi
=p.phi();
58
*
m_E
=p.energy();
59
}
60
61
return
StatusCode::SUCCESS;
62
}
63
64
}
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TowerFillerTool.h
CaloTower
Data class for calorimeter cell towers.
Definition
Calorimeter/CaloEvent/CaloEvent/CaloTower.h:55
D3PD::BlockFillerTool< CaloTower >::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Definition
AddVariable.cxx:85
D3PD::BlockFillerTool
Type-safe wrapper for block filler tools.
Definition
BlockFillerTool.h:65
D3PD::TowerFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition
TowerFillerTool.cxx:27
D3PD::TowerFillerTool::m_nCaloCells
unsigned int * m_nCaloCells
Definition
TowerFillerTool.h:52
D3PD::TowerFillerTool::m_statWord
unsigned int * m_statWord
Definition
TowerFillerTool.h:54
D3PD::TowerFillerTool::fill
virtual StatusCode fill(const CaloTower &p)
Fill one block.
Definition
TowerFillerTool.cxx:44
D3PD::TowerFillerTool::m_phi
float * m_phi
Definition
TowerFillerTool.h:61
D3PD::TowerFillerTool::m_pT
float * m_pT
Definition
TowerFillerTool.h:57
D3PD::TowerFillerTool::TowerFillerTool
TowerFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TowerFillerTool.cxx:17
D3PD::TowerFillerTool::m_cellWeights
std::vector< float > * m_cellWeights
Definition
TowerFillerTool.h:50
D3PD::TowerFillerTool::m_E
float * m_E
Definition
TowerFillerTool.h:63
D3PD::TowerFillerTool::m_SaveConstituents
bool m_SaveConstituents
Definition
TowerFillerTool.h:47
D3PD::TowerFillerTool::m_eta
float * m_eta
Definition
TowerFillerTool.h:59
Navigable::object_iter
NavigableIterator< CONT, RPAR, COLL > object_iter
Definition
Navigable.h:159
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
type
Generated on
for ATLAS Offline Software by
1.17.0