ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
CaloSysD3PDMaker
src
TileDigitFillerTool.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
/*
6
* File: TileDigitFillerTool.cxx
7
* Author: Stephen Cole <scole@niu.edu>
8
*
9
* Created on February 22, 2011, 4:06 PM
10
*/
11
12
#include "
TileDigitFillerTool.h
"
13
#include "
TileIdentifier/TileHWID.h
"
14
#include "
CaloIdentifier/TileID.h
"
15
#include "GaudiKernel/ISvcLocator.h"
16
#include "GaudiKernel/StatusCode.h"
17
#include "GaudiKernel/MsgStream.h"
18
#include "
StoreGate/StoreGateSvc.h
"
19
#include "
AthenaKernel/errorcheck.h
"
20
21
22
namespace
D3PD
{
23
24
TileDigitFillerTool::TileDigitFillerTool
(
const
std::string&
type
,
25
const
std::string& name,
26
const
IInterface* parent):
27
BlockFillerTool
<
TileDigits
>(
type
,name,parent),
28
m_tileid
(0),
29
m_tilehwid
(0)
30
{
31
declareProperty(
"SaveOfflineInfo"
,
m_SaveOffId
=
false
);
32
declareProperty(
"SaveHardwareInfo"
,
m_SaveHWid
=
true
);
33
34
m_section
= 0;
35
m_side
= 0;
36
m_tower
= 0;
37
TileDigitFillerTool::book
().ignore();
// Avoid coverity warnings
38
}
39
40
44
StatusCode
TileDigitFillerTool::initialize
()
45
{
46
CHECK
( detStore()->retrieve(
m_tileid
) );
47
CHECK
( detStore()->retrieve(
m_tilehwid
) );
48
return
StatusCode::SUCCESS;
49
}
50
51
52
53
StatusCode
TileDigitFillerTool::book
(){
54
if
(
m_SaveHWid
){
55
CHECK
(
addVariable
(
"ros"
,
m_ros
));
56
CHECK
(
addVariable
(
"drawer"
,
m_drawer
));
57
CHECK
(
addVariable
(
"channel"
,
m_channel
));
58
CHECK
(
addVariable
(
"gain"
,
m_gain
));
59
CHECK
(
addVariable
(
"samples"
,
m_samples
));
60
}
61
62
if
(
m_SaveOffId
){
63
CHECK
(
addVariable
(
"section"
,
m_section
));
64
CHECK
(
addVariable
(
"side"
,
m_side
));
65
CHECK
(
addVariable
(
"tower"
,
m_tower
));
66
}
67
return
StatusCode::SUCCESS;
68
}
69
70
StatusCode
TileDigitFillerTool::fill
(
const
TileDigits
& p){
71
const
TileDigits
* tileD=&p;
72
HWIdentifier
hwid=tileD->
adc_HWID
();
73
74
if
(
m_SaveHWid
){
75
*
m_ros
=(char)
m_tilehwid
->ros(hwid);
76
*
m_drawer
=(char)
m_tilehwid
->drawer(hwid);
77
*
m_channel
=(char)
m_tilehwid
->channel(hwid);
78
*
m_gain
=(char)
m_tilehwid
->adc(hwid);
79
80
const
std::vector<float>& Samples=tileD->
samples
();
81
m_samples
->assign (Samples.begin(), Samples.end());
82
}
83
84
if
(
m_SaveOffId
){
85
Identifier
digID=tileD->
adc_ID
();
86
if
(digID.
is_valid
()) {
87
*
m_section
= (char)
m_tileid
->section(digID);
88
*
m_side
= (char)
m_tileid
->side(digID);
89
*
m_tower
= (char)
m_tileid
->tower(digID);
90
}
else
{
91
*
m_section
= std::numeric_limits<char>::min();
92
*
m_side
= std::numeric_limits<char>::min();
93
*
m_tower
= std::numeric_limits<char>::min();
94
}
95
}
96
97
return
StatusCode::SUCCESS;
98
}
99
100
}
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
StoreGateSvc.h
TileDigitFillerTool.h
TileHWID.h
TileID.h
D3PD::BlockFillerTool< TileDigits >::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::TileDigitFillerTool::TileDigitFillerTool
TileDigitFillerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
TileDigitFillerTool.cxx:24
D3PD::TileDigitFillerTool::book
virtual StatusCode book()
Declare tuple variables.
Definition
TileDigitFillerTool.cxx:53
D3PD::TileDigitFillerTool::m_SaveOffId
bool m_SaveOffId
Definition
TileDigitFillerTool.h:60
D3PD::TileDigitFillerTool::m_drawer
char * m_drawer
Definition
TileDigitFillerTool.h:67
D3PD::TileDigitFillerTool::m_side
char * m_side
Definition
TileDigitFillerTool.h:63
D3PD::TileDigitFillerTool::m_tilehwid
const TileHWID * m_tilehwid
Definition
TileDigitFillerTool.h:57
D3PD::TileDigitFillerTool::m_tileid
const TileID * m_tileid
Definition
TileDigitFillerTool.h:56
D3PD::TileDigitFillerTool::fill
virtual StatusCode fill(const TileDigits &p)
Fill one block — type-safe version.
Definition
TileDigitFillerTool.cxx:70
D3PD::TileDigitFillerTool::m_samples
std::vector< short > * m_samples
Definition
TileDigitFillerTool.h:70
D3PD::TileDigitFillerTool::m_section
char * m_section
Definition
TileDigitFillerTool.h:62
D3PD::TileDigitFillerTool::initialize
virtual StatusCode initialize()
Standard Gaudi initialize method.
Definition
TileDigitFillerTool.cxx:44
D3PD::TileDigitFillerTool::m_tower
char * m_tower
Definition
TileDigitFillerTool.h:64
D3PD::TileDigitFillerTool::m_ros
char * m_ros
Definition
TileDigitFillerTool.h:66
D3PD::TileDigitFillerTool::m_gain
char * m_gain
Definition
TileDigitFillerTool.h:69
D3PD::TileDigitFillerTool::m_SaveHWid
bool m_SaveHWid
Definition
TileDigitFillerTool.h:59
D3PD::TileDigitFillerTool::m_channel
char * m_channel
Definition
TileDigitFillerTool.h:68
HWIdentifier
Definition
HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
TileDigits
Definition
TileDigits.h:30
TileDigits::samples
const std::vector< float > & samples() const
Definition
TileDigits.h:58
TileRawData::adc_ID
Identifier adc_ID(void) const
Definition
TileRawData.cxx:53
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition
TileRawData.h:53
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
Identifier
Definition
IdentifierFieldParser.cxx:14
type
Generated on
for ATLAS Offline Software by
1.17.0