ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
CaloSysD3PDMaker
src
TileCellRawAssociationTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* File: TileCellRawAssociationTool.cxx
7
* Author: Stephen Cole <stephen.cole@cern.ch>
8
*
9
* Created on October 26, 2011, 11:08 AM
10
*/
11
12
#include "GaudiKernel/MsgStream.h"
13
#include "
AthenaBaseComps/AthAlgorithm.h
"
14
#include "
TileIdentifier/TileHWID.h
"
15
#include "
TileEvent/TileRawChannel.h
"
16
#include "
TileEvent/TileCell.h
"
17
18
#include "
TileCellRawAssociationTool.h
"
19
20
21
using namespace
std
;
22
23
namespace
D3PD
{
24
25
TileCellRawAssociationTool::TileCellRawAssociationTool
(
const
string
&
type
,
26
const
string
& name,
const
IInterface* parent) :
27
Base
(
type
,name,parent),
28
m_rawGetter
(
type
,name,parent),
29
m_tilehwid
(0),
30
m_nRawReturned
(0)
31
{
32
declareProperty(
"TileRawChannelSGKey"
,
m_tileRawKey
=
"TileRawChannelFlt"
);
33
34
}
35
36
TileCellRawAssociationTool::~TileCellRawAssociationTool
() {
37
}
38
39
StatusCode
TileCellRawAssociationTool::initialize
()
40
{
41
CHECK
(
m_rawGetter
.initialize() );
42
CHECK
(
m_rawGetter
.setProperty(
"SGKey"
,
m_tileRawKey
) );
43
CHECK
( detStore()->retrieve(
m_tilehwid
) );
44
return
StatusCode::SUCCESS;
45
}
46
47
StatusCode
TileCellRawAssociationTool::reset
(
const
CaloCell
& p){
48
m_nRawReturned
=0;
49
50
CHECK
(
m_rawGetter
.reset(
false
) );
51
52
const
CaloCell
* cell=&p;
53
const
TileCell
* tilecell =
dynamic_cast<
const
TileCell
*
>
(cell);
54
if
(!tilecell){
55
MsgStream log(msgSvc(), name());
56
log << MSG::ERROR
57
<<
"Passed CaloCell is not a TileCell"
<<
endmsg
;
58
return
StatusCode::FAILURE;
59
}
60
const
CaloDetDescrElement
* caloDDE = tilecell->
caloDDE
();
61
long
gain1 = tilecell->
gain1
();
62
long
gain2 = tilecell->
gain2
();
63
IdentifierHash
hash1 = caloDDE->
onl1
();
64
IdentifierHash
hash2 = caloDDE->
onl2
();
65
if
(hash1 !=
TileHWID::NOT_VALID_HASH
) {
66
m_adcId1
=
m_tilehwid
->adc_id(hash1,gain1);
67
}
68
else
{
69
MsgStream log(msgSvc(), name());
70
log<<MSG::DEBUG<<
"TileCellRawAssociationTool: Invalid hash on gain1"
<<
71
endmsg
;
72
m_adcId1
.clear();
73
}
74
75
if
(hash2 !=
TileHWID::NOT_VALID_HASH
) {
76
m_adcId2
=
m_tilehwid
->adc_id(hash2,gain2);
77
}
78
else
{
79
MsgStream log(msgSvc(), name());
80
log<<MSG::DEBUG<<
"TileCellRawAssociationTool: Invalid hash on gain2"
<<
81
endmsg
;
82
m_adcId2
.clear();
83
}
84
85
return
StatusCode::SUCCESS;
86
}
87
88
const
TileRawChannel
*
TileCellRawAssociationTool::next
(){
89
MsgStream log(msgSvc(), name());
90
log << MSG::DEBUG <<
" in TileCellRawAssociationTool::next()"
<<
91
endmsg
;
92
if
(
m_nRawReturned
>1)
return
0;
93
94
const
TileRawChannel
* tileraw=
95
(
const
TileRawChannel
*)
m_rawGetter
.nextUntyped();
96
while
(tileraw){
97
HWIdentifier
rId=tileraw->
adc_HWID
();
98
if
(
m_adcId1
.is_valid()){
99
if
(
m_adcId1
==rId){
100
++
m_nRawReturned
;
101
m_adcId1
.clear();
102
return
tileraw;
103
}
104
}
105
if
(
m_adcId2
.is_valid()){
106
if
(
m_adcId2
==rId){
107
++
m_nRawReturned
;
108
m_adcId2
.clear();
109
return
tileraw;
110
}
111
}
112
tileraw=(
const
TileRawChannel
*)
m_rawGetter
.nextUntyped();
113
}
114
115
log<<MSG::DEBUG<<
"TileCellRawAssociationTool: Found only "
<<
116
m_nRawReturned
<<
" associated raw channels."
<<
endmsg
;
117
return
0;
118
}
119
120
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
AthAlgorithm.h
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TileCellRawAssociationTool.h
TileCell.h
TileHWID.h
TileRawChannel.h
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition
CaloCell.h:321
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell.
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::onl2
IdentifierHash onl2() const
cell online identifier 2
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:408
CaloDetDescrElement::onl1
IdentifierHash onl1() const
cell online identifier 1
Definition
Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:404
D3PD::TileCellRawAssociationTool::m_adcId2
HWIdentifier m_adcId2
Definition
TileCellRawAssociationTool.h:64
D3PD::TileCellRawAssociationTool::m_adcId1
HWIdentifier m_adcId1
Definition
TileCellRawAssociationTool.h:64
D3PD::TileCellRawAssociationTool::initialize
StatusCode initialize()
Definition
TileCellRawAssociationTool.cxx:39
D3PD::TileCellRawAssociationTool::~TileCellRawAssociationTool
virtual ~TileCellRawAssociationTool()
Definition
TileCellRawAssociationTool.cxx:36
D3PD::TileCellRawAssociationTool::TileCellRawAssociationTool
TileCellRawAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
TileCellRawAssociationTool.cxx:25
D3PD::TileCellRawAssociationTool::Base
MultiAssociationTool< CaloCell, TileRawChannel > Base
Definition
TileCellRawAssociationTool.h:31
D3PD::TileCellRawAssociationTool::next
virtual const TileRawChannel * next()
Return a pointer to the next element in the association.
Definition
TileCellRawAssociationTool.cxx:88
D3PD::TileCellRawAssociationTool::reset
virtual StatusCode reset(const CaloCell &p)
Return the target object.
Definition
TileCellRawAssociationTool.cxx:47
D3PD::TileCellRawAssociationTool::m_tileRawKey
std::string m_tileRawKey
Definition
TileCellRawAssociationTool.h:62
D3PD::TileCellRawAssociationTool::m_nRawReturned
int m_nRawReturned
Definition
TileCellRawAssociationTool.h:65
D3PD::TileCellRawAssociationTool::m_tilehwid
const TileHWID * m_tilehwid
Definition
TileCellRawAssociationTool.h:63
D3PD::TileCellRawAssociationTool::m_rawGetter
Getter m_rawGetter
Definition
TileCellRawAssociationTool.h:61
HWIdentifier
Definition
HWIdentifier.h:13
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
TileCell
Definition
TileCell.h:57
TileCell::gain2
int gain2(void) const
get gain of second PMT
Definition
TileCell.cxx:175
TileCell::gain1
int gain1(void) const
get gain of first PMT
Definition
TileCell.cxx:168
TileHWID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition
TileHWID.h:314
TileRawChannel
Definition
TileRawChannel.h:35
TileRawData::adc_HWID
HWIdentifier adc_HWID(void) const
Definition
TileRawData.h:53
D3PD
Block filler tool for noisy FEB information.
Definition
CaloCellDetailsFillerTool.cxx:29
std
STL namespace.
type
Generated on
for ATLAS Offline Software by
1.17.0