ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArGeoModel
LArReadoutGeometry
src
FCALTile.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArReadoutGeometry/FCALTile.h
"
6
#include "
LArReadoutGeometry/FCALModule.h
"
7
#include "
LArReadoutGeometry/FCALDetectorManager.h
"
8
#include "
LArHV/FCALHVManager.h
"
9
#include "
LArHV/FCALHVModule.h
"
10
#include "
LArHV/FCALHVLine.h
"
11
#include "GaudiKernel/Bootstrap.h"
12
#include "GaudiKernel/ISvcLocator.h"
13
#include "
StoreGate/StoreGateSvc.h
"
14
15
FCALTile::FCALTile
(
const
FCALTile
&right)
16
:
m_module
(right.
m_module
),
m_tile
(right.
m_tile
)
17
{
18
}
19
20
FCALTile::FCALTile
(
const
FCALModule
*module,
FCALTile::TileConstIterator
tIterator)
21
:
m_module
(module),
m_tile
(tIterator)
22
{
23
}
24
25
26
FCALTile::~FCALTile
()
27
=
default
;
28
29
30
// cppcheck-suppress operatorEqVarError
31
FCALTile
&
FCALTile::operator=
(
const
FCALTile
&right)
32
{
33
if
(
this
!=&right) {
34
m_module
=right.
m_module
;
35
m_tile
=right.
m_tile
;
36
m_tube
.reset();
37
for
(
int
i = 0; i < 4; i++) {
38
m_line
[i].store (
nullptr
);
39
}
40
}
41
return
*
this
;
42
}
43
44
45
46
double
FCALTile::getX
()
const
47
{
48
return
(*m_tile).second.x();
49
}
50
51
double
FCALTile::getY
()
const
52
{
53
return
(*m_tile).second.y();
54
}
55
56
unsigned
int
FCALTile::getNumTubes
()
const
57
{
58
return
(*m_tile).second.ntubes();
59
}
60
61
int
FCALTile::getIndexI
()
const
62
{
63
return
((*m_tile).first & 0X00000FFFF );
64
}
65
66
int
FCALTile::getIndexJ
()
const
67
{
68
return
(((*m_tile).first & 0XFFFF0000 )>> 16);
69
}
70
71
unsigned
int
FCALTile::identify
()
const
72
{
73
return
(*m_tile).first;
74
}
75
76
const
FCALModule
*
FCALTile::getModule
()
const
{
77
return
m_module
;
78
}
79
80
81
unsigned
int
FCALTile::getNumHVLines
() {
82
return
4;
83
}
84
85
const
FCALHVLine
*
FCALTile::getHVLine
(
unsigned
int
i)
const
{
86
if
(!
m_line
[i].
get
()) {
87
88
for
(
unsigned
int
j=0;j<
getNumTubes
();j++) {
89
unsigned
int
index
=
getTube
(j)->getHVLine().getLineIndex();
90
if
(i==
index
) {
91
m_line
[i].set (&(
getTube
(j)->
getHVLine
()));
92
break
;
93
}
94
}
95
}
96
return
m_line
[i].get();
97
}
98
99
100
FCALTubeConstLink
FCALTile::getTube
(
unsigned
int
i)
const
{
101
102
if
(!
m_tube
.isValid()) {
103
104
std::vector<FCALTubeConstLink> tube;
105
106
SmartIF<StoreGateSvc> detStore{Gaudi::svcLocator()->service(
"DetectorStore"
)};
107
if
(!detStore.isValid()) {
108
throw
std::runtime_error(
"Error in FCALTile: cannot access DetectorStore (tube access)"
);
109
}
110
111
const
FCAL_ChannelMap
*channelMap;
112
if
(detStore->retrieve(channelMap)==StatusCode::FAILURE) {
113
throw
std::runtime_error(
"Error in FCALTile: cannot access Channel Map"
);
114
}
115
116
unsigned
int
moduleNumber =
m_module
->getModuleIndex();
// 1, 2, or 3.
117
unsigned
int
iSampling = moduleNumber-1;
// by convention.
118
unsigned
int
iSide =
m_module
->getEndcapIndex();
119
120
for
(
FCAL_ChannelMap::tubemap_const_iterator
t=channelMap->
tubemap_begin
(moduleNumber);t!=channelMap->
tubemap_end
(moduleNumber); ++t) {
121
if
((*t).second.get_tileName()==(*m_tile).first) {
122
std::string FeedThrough = (*t).second.getHVft();
123
124
std::string::size_type pos = FeedThrough.find(
'.'
);
125
if
(pos==std::string::npos) {
126
std::cout <<
"Big problem, feedthrough: "
<< FeedThrough << std::endl;
127
throw
std::runtime_error(
"Error parsing FCAL HV Feedthrough string (finding substring)"
);
128
}
129
130
std::string FeedMe=FeedThrough.substr(0,pos);
131
132
pos++;
133
std::string Line=FeedThrough.substr(pos);
134
135
std::istringstream FeedStream(FeedMe);
136
unsigned
int
feedNumber;
137
if
(!(FeedStream>>feedNumber)) {
138
throw
std::runtime_error(
"Error parsing FCAL HV Feedthrough string (parsing substring 1)"
);
139
}
140
141
std::istringstream LineStream(Line);
142
unsigned
int
lineNumber;
143
if
(!(LineStream>>lineNumber)) {
144
throw
std::runtime_error(
"Error parsing FCAL HV Feedthrough string (parsing substring 2)"
);
145
}
146
147
int
hv_moduleNumber=lineNumber/4;
148
if
(feedNumber==23) hv_moduleNumber+=8;
149
150
//std::cout << " feedNumber, lineNumber " << feedNumber << " " << lineNumber << std::endl;
151
152
const
FCALHVManager
& hvManager=
getModule
()->
getManager
()->
getHVManager
();
153
const
FCALHVModule
& hvMod = hvManager.
getHVModule
(iSide,hv_moduleNumber,iSampling);
154
unsigned
int
index
=0;
155
156
if
(lineNumber%4==0)
index
=0;
157
else
if
(lineNumber%4==1)
index
=3;
158
else
if
(lineNumber%4==2)
index
=1;
159
else
if
(lineNumber%4==3)
index
=2;
160
else
throw
std::runtime_error(
"Error in FCALTile: unrecognized HV Line"
);
161
162
const
FCALHVLine
& hvElec = hvMod.
getHVLine
(
index
);
163
164
FCALTubeConstLink
tubeLink(
new
FCALTube
(
this
, hvElec, (*t).second.x(),(*t).second.y()));
165
166
tube.push_back(tubeLink);
167
}
168
}
169
m_tube
.set (std::move (tube));
170
}
171
return
(*
m_tube
.ptr())[i];
172
}
FCALDetectorManager.h
FCALHVLine.h
FCALHVManager.h
FCALHVModule.h
FCALModule.h
FCALTile.h
FCALTubeConstLink
GeoIntrusivePtr< const FCALTube > FCALTubeConstLink
Definition
FCALTubeConstLink.h:9
StoreGateSvc.h
FCALDetectorManager::getHVManager
const FCALHVManager & getHVManager() const
Get the HV Manager:
Definition
FCALDetectorManager.cxx:88
FCALHVLine
Definition
FCALHVLine.h:15
FCALHVManager
This class provides direct access to information on the HV electrodes within the barrels.
Definition
FCALHVManager.h:35
FCALHVManager::getHVModule
const FCALHVModule & getHVModule(unsigned int iSide, unsigned int iSector, unsigned int iSampling) const
Definition
FCALHVManager.cxx:190
FCALHVModule
Describes one HV Module within the FCAL.
Definition
FCALHVModule.h:22
FCALHVModule::getHVLine
const FCALHVLine & getHVLine(unsigned int iLine) const
Definition
FCALHVModule.cxx:69
FCALModule
Definition
FCALModule.h:33
FCALModule::getManager
const FCALDetectorManager * getManager() const
Gets the manager.
Definition
FCALModule.h:170
FCALTile::m_tube
CxxUtils::CachedValue< std::vector< FCALTubeConstLink > > m_tube
Cache of tubes.
Definition
FCALTile.h:122
FCALTile::m_tile
TileConstIterator m_tile
Definition
FCALTile.h:112
FCALTile::identify
unsigned int identify() const
Returns the identifier of this tile (convention: comes from the FCAL Channel Map).
Definition
FCALTile.cxx:71
FCALTile::getIndexJ
int getIndexJ() const
Returns the index "J" of the tile.
Definition
FCALTile.cxx:66
FCALTile::getIndexI
int getIndexI() const
Returns the index "i" of the tile.
Definition
FCALTile.cxx:61
FCALTile::getNumHVLines
static unsigned int getNumHVLines()
Get num hvlines.
Definition
FCALTile.cxx:81
FCALTile::getTube
FCALTubeConstLink getTube(unsigned int i) const
Get a tube.
Definition
FCALTile.cxx:100
FCALTile::getHVLine
const FCALHVLine * getHVLine(unsigned int i) const
Get hvline.
Definition
FCALTile.cxx:85
FCALTile::getY
double getY() const
Gets the Y position of the Tile.
Definition
FCALTile.cxx:51
FCALTile::~FCALTile
~FCALTile()
Destructor.
FCALTile::m_line
CxxUtils::CachedPointer< const FCALHVLine > m_line[4]
Cache of subgaps.
Definition
FCALTile.h:117
FCALTile::FCALTile
FCALTile(const FCALTile &right)
Copy constructor.
Definition
FCALTile.cxx:15
FCALTile::TileConstIterator
FCAL_ChannelMap::tileMap_const_iterator TileConstIterator
Definition
FCALTile.h:28
FCALTile::getX
double getX() const
Gets the X Position of the Tile.
Definition
FCALTile.cxx:46
FCALTile::operator=
FCALTile & operator=(const FCALTile &right)
Assignment.
Definition
FCALTile.cxx:31
FCALTile::m_module
const FCALModule * m_module
Definition
FCALTile.h:111
FCALTile::getNumTubes
unsigned int getNumTubes() const
Gets the number of tubes in the tile.
Definition
FCALTile.cxx:56
FCALTile::getModule
const FCALModule * getModule() const
Get the Module.
Definition
FCALTile.cxx:76
FCALTube
This class represents an FCAL Tube.
Definition
FCALTube.h:20
FCAL_ChannelMap
This class contains the tube and tile maps for the FCAL A tile is of a set of FCAL tubes.
Definition
LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:34
FCAL_ChannelMap::tubemap_const_iterator
tubeMap_t::const_iterator tubemap_const_iterator
Definition
LArCalorimeter/LArGeoModel/LArReadoutGeometry/LArReadoutGeometry/FCAL_ChannelMap.h:71
FCAL_ChannelMap::tubemap_end
tubemap_const_iterator tubemap_end(int isam) const
Definition
LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:480
FCAL_ChannelMap::tubemap_begin
tubemap_const_iterator tubemap_begin(int isam) const
tubeMap access functions
Definition
LArCalorimeter/LArGeoModel/LArReadoutGeometry/src/FCAL_ChannelMap.cxx:472
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:132
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0