ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
D3PDMaker
CaloSysD3PDMaker
src
TileCellDigitAssociationTool.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: TileCellDigitAssociationTool.cxx
7
* Author: Stephen Cole <stephen.cole@cern.ch>
8
*
9
* Created on October 31, 2011, 11:23 AM
10
*/
11
12
#include "GaudiKernel/MsgStream.h"
13
#include "
AthenaBaseComps/AthAlgorithm.h
"
14
#include "
TileIdentifier/TileHWID.h
"
15
#include "
TileEvent/TileDigits.h
"
16
#include "
TileEvent/TileCell.h
"
17
18
#include "
TileCellDigitAssociationTool.h
"
19
20
using namespace
std
;
21
22
namespace
D3PD
{
23
24
TileCellDigitAssociationTool::TileCellDigitAssociationTool
(
const
string
&
type
,
25
const
string
& name,
const
IInterface* parent) :
26
Base
(
type
,name,parent),
27
m_digitGetter
(
type
,name,parent),
28
m_tilehwid
(0),
29
m_nDigitReturned
(0)
30
{
31
declareProperty(
"TileDigitsSGKey"
,
m_tileDigitKey
=
"TileDigitsFlt"
);
32
}
33
34
35
TileCellDigitAssociationTool::~TileCellDigitAssociationTool
() {
36
}
37
38
StatusCode
TileCellDigitAssociationTool::initialize
()
39
{
40
CHECK
(
m_digitGetter
.initialize()) ;
41
CHECK
(
m_digitGetter
.setProperty(
"SGKey"
,
m_tileDigitKey
) );
42
CHECK
( detStore()->retrieve(
m_tilehwid
) );
43
return
StatusCode::SUCCESS;
44
}
45
46
StatusCode
TileCellDigitAssociationTool::reset
(
const
CaloCell
& p){
47
m_nDigitReturned
=0;
48
49
CHECK
(
m_digitGetter
.reset(
false
) );
50
51
const
CaloCell
* cell=&p;
52
const
TileCell
* tilecell =
dynamic_cast<
const
TileCell
*
>
(cell);
53
if
(!tilecell){
54
MsgStream log(msgSvc(), name());
55
log << MSG::ERROR
56
<<
"Passed CaloCell is not a TileCell"
<<
endmsg
;
57
return
StatusCode::FAILURE;
58
}
59
const
CaloDetDescrElement
* caloDDE = tilecell->
caloDDE
();
60
long
gain1 = tilecell->
gain1
();
61
long
gain2 = tilecell->
gain2
();
62
IdentifierHash
hash1 = caloDDE->
onl1
();
63
IdentifierHash
hash2 = caloDDE->
onl2
();
64
if
(hash1 !=
TileHWID::NOT_VALID_HASH
) {
65
m_adcId1
=
m_tilehwid
->adc_id(hash1,gain1);
66
}
67
else
{
68
MsgStream log(msgSvc(), name());
69
log<<MSG::DEBUG<<
"TileCellDigitAssociationTool: Invalid hash on gain1"
<<
70
endmsg
;
71
m_adcId1
.clear();
72
}
73
74
if
(hash2 !=
TileHWID::NOT_VALID_HASH
) {
75
m_adcId2
=
m_tilehwid
->adc_id(hash2,gain2);
76
}
77
else
{
78
MsgStream log(msgSvc(), name());
79
log<<MSG::DEBUG<<
"TileCellDigitAssociationTool: Invalid hash on gain2"
<<
80
endmsg
;
81
m_adcId2
.clear();
82
}
83
84
return
StatusCode::SUCCESS;
85
}
86
87
const
TileDigits
*
TileCellDigitAssociationTool::next
(){
88
if
(
m_nDigitReturned
>1)
return
0;
89
90
const
TileDigits
* tiledigit=
91
(
const
TileDigits
*)
m_digitGetter
.nextUntyped();
92
while
(tiledigit){
93
HWIdentifier
rId=tiledigit->
adc_HWID
();
94
if
(
m_adcId1
.is_valid()){
95
if
(
m_adcId1
==rId){
96
++
m_nDigitReturned
;
97
m_adcId1
.clear();
98
return
tiledigit;
99
}
100
}
101
if
(
m_adcId2
.is_valid()){
102
if
(
m_adcId2
==rId){
103
++
m_nDigitReturned
;
104
m_adcId2
.clear();
105
return
tiledigit;
106
}
107
}
108
tiledigit=(
const
TileDigits
*)
m_digitGetter
.nextUntyped();
109
}
110
111
return
0;
112
}
113
114
115
}
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
TileCellDigitAssociationTool.h
TileCell.h
TileDigits.h
TileHWID.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::TileCellDigitAssociationTool::m_adcId2
HWIdentifier m_adcId2
Definition
TileCellDigitAssociationTool.h:62
D3PD::TileCellDigitAssociationTool::initialize
StatusCode initialize()
Definition
TileCellDigitAssociationTool.cxx:38
D3PD::TileCellDigitAssociationTool::~TileCellDigitAssociationTool
virtual ~TileCellDigitAssociationTool()
Definition
TileCellDigitAssociationTool.cxx:35
D3PD::TileCellDigitAssociationTool::next
virtual const TileDigits * next()
Return a pointer to the next element in the association.
Definition
TileCellDigitAssociationTool.cxx:87
D3PD::TileCellDigitAssociationTool::m_digitGetter
Getter m_digitGetter
Definition
TileCellDigitAssociationTool.h:59
D3PD::TileCellDigitAssociationTool::m_nDigitReturned
int m_nDigitReturned
Definition
TileCellDigitAssociationTool.h:63
D3PD::TileCellDigitAssociationTool::m_tileDigitKey
std::string m_tileDigitKey
Definition
TileCellDigitAssociationTool.h:60
D3PD::TileCellDigitAssociationTool::TileCellDigitAssociationTool
TileCellDigitAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition
TileCellDigitAssociationTool.cxx:24
D3PD::TileCellDigitAssociationTool::m_tilehwid
const TileHWID * m_tilehwid
Definition
TileCellDigitAssociationTool.h:61
D3PD::TileCellDigitAssociationTool::Base
MultiAssociationTool< CaloCell, TileDigits > Base
Definition
TileCellDigitAssociationTool.h:29
D3PD::TileCellDigitAssociationTool::m_adcId1
HWIdentifier m_adcId1
Definition
TileCellDigitAssociationTool.h:62
D3PD::TileCellDigitAssociationTool::reset
virtual StatusCode reset(const CaloCell &p)
Return the target object.
Definition
TileCellDigitAssociationTool.cxx:46
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
TileDigits
Definition
TileDigits.h:30
TileHWID::NOT_VALID_HASH
@ NOT_VALID_HASH
Definition
TileHWID.h:314
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