ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetDetDescr
SCT_GeoModel
src
SCT_FSIHelper.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
#include "
SCT_FSIHelper.h
"
7
#include "
SCT_DataBase.h
"
8
#include "
RDBAccessSvc/IRDBRecord.h
"
9
#include "GaudiKernel/SystemOfUnits.h"
10
11
#include <iostream>
12
13
FSILocation:: FSILocation
(
const
std::string&
name
,
14
double
radius
,
15
double
phi
,
16
int
side
)
17
:
m_name
(
name
),
18
m_radius
(
radius
),
19
m_phi
(
phi
),
20
m_side
(
side
)
21
{}
22
23
24
FSIDetails::FSIDetails
(
const
FSILocation
*
location
,
25
int
simType
,
26
const
std::string &
simTypeString
,
27
const
std::string &
locationType
,
28
const
std::string &
actualType
)
29
:
m_location
(
location
),
30
m_simType
(
simType
),
31
m_simTypeStr
(
simTypeString
),
32
m_locType
(
locationType
),
33
m_actualType
(
actualType
)
34
{}
35
36
37
FSIHelper::FSIHelper
(
SCT_DataBase
* rdb)
38
:
m_rdb
(rdb)
39
{
40
int
numWheels =
m_rdb
->fwdGeneral()->getInt(
"NUMWHEELS"
);
41
m_wheelLocMap
.resize(numWheels);
42
m_wheelLocMapConst
.resize(numWheels);
43
fill
();
44
}
45
46
FSIHelper::~FSIHelper
()
47
{
48
}
49
50
51
void
52
FSIHelper::fill
()
53
{
54
// Loop through location types
55
for
(
int
iLocIndex = 0; iLocIndex <
m_rdb
->fwdFSILocationSize(); iLocIndex++) {
56
std::string locType =
m_rdb
->fwdFSILocation(iLocIndex)->getString(
"LOCTYPE"
);
57
double
radius =
m_rdb
->fwdFSILocation(iLocIndex)->getDouble(
"LOCR"
) * Gaudi::Units::mm;
58
double
rphi =
m_rdb
->fwdFSILocation(iLocIndex)->getDouble(
"LOCPHI"
) * Gaudi::Units::deg;
59
int
side =
m_rdb
->fwdFSILocation(iLocIndex)->getInt(
"SIDE"
);
60
m_locationTypes
[locType] = std::make_unique<FSILocation>(locType, radius, rphi, side);
61
}
62
63
// Loop through all fsi's
64
for
(
int
index
= 0;
index
<
m_rdb
->fwdFSISize();
index
++) {
65
unsigned
int
iWheel =
m_rdb
->fwdFSI(
index
)->getInt(
"WHEEL"
) - 1;
66
int
simType =
m_rdb
->fwdFSI(
index
)->getInt(
"SIMTYPE"
);
67
std::string simTypeString =
m_rdb
->fwdFSIType(simType)->getString(
"TYPENAME"
);
68
int
simTypeCheck =
m_rdb
->fwdFSIType(simType)->getInt(
"SIMTYPE"
);
69
std::string locationType =
m_rdb
->fwdFSI(
index
)->getString(
"LOCTYPE"
);
70
std::string actualType =
m_rdb
->fwdFSI(
index
)->getString(
"ACTUALTYPE"
);
71
72
if
(simTypeCheck != simType) std::cout <<
"Error in simType to index match in table SctFwdFSIType"
<< std::endl;
73
74
FSILocation
* location =
m_locationTypes
[locationType].get();
75
if
(!location) std::cout <<
"Error filling FSI information. No FSI of type "
<< locationType <<
" found"
<< std::endl;
76
std::unique_ptr<FSIDetails> fsi = std::make_unique<FSIDetails>(location, simType, simTypeString, locationType, actualType);
77
78
if
(iWheel >=
m_wheelLocMap
.size())
79
std::cout <<
"Error in FSIHelper: wheel number is out of range: "
<< iWheel << std::endl;
80
81
m_wheelLocMapConst
[iWheel].push_back(fsi.get());
82
m_wheelLocMap
[iWheel].push_back(std::move(fsi));
83
84
}
85
}
86
87
88
const
std::vector<const FSIDetails *> &
89
FSIHelper::fsiVector
(
int
iWheel)
const
90
{
91
return
m_wheelLocMapConst
[iWheel];
92
}
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
SCT_DataBase.h
SCT_FSIHelper.h
FSIDetails::m_location
const FSILocation * m_location
Definition
SCT_FSIHelper.h:52
FSIDetails::m_actualType
std::string m_actualType
Definition
SCT_FSIHelper.h:56
FSIDetails::m_locType
std::string m_locType
Definition
SCT_FSIHelper.h:55
FSIDetails::locationType
const std::string & locationType() const
Definition
SCT_FSIHelper.h:48
FSIDetails::simType
int simType() const
Definition
SCT_FSIHelper.h:46
FSIDetails::simTypeString
const std::string & simTypeString() const
Definition
SCT_FSIHelper.h:47
FSIDetails::FSIDetails
FSIDetails(const FSILocation *location, int simType, const std::string &simTypeString, const std::string &locationType, const std::string &actualType)
Definition
SCT_FSIHelper.cxx:24
FSIDetails::location
const FSILocation & location() const
Definition
SCT_FSIHelper.h:45
FSIDetails::m_simTypeStr
std::string m_simTypeStr
Definition
SCT_FSIHelper.h:54
FSIDetails::actualType
const std::string & actualType() const
Definition
SCT_FSIHelper.h:49
FSIDetails::m_simType
int m_simType
Definition
SCT_FSIHelper.h:53
FSIHelper::~FSIHelper
~FSIHelper()
Definition
SCT_FSIHelper.cxx:46
FSIHelper::m_wheelLocMapConst
std::vector< std::vector< const FSIDetails * > > m_wheelLocMapConst
Definition
SCT_FSIHelper.h:74
FSIHelper::FSIHelper
FSIHelper(SCT_DataBase *rdb)
Definition
SCT_FSIHelper.cxx:37
FSIHelper::m_rdb
SCT_DataBase * m_rdb
Definition
SCT_FSIHelper.h:77
FSIHelper::fsiVector
const std::vector< const FSIDetails * > & fsiVector(int wheel) const
Definition
SCT_FSIHelper.cxx:89
FSIHelper::fill
void fill()
Definition
SCT_FSIHelper.cxx:52
FSIHelper::m_wheelLocMap
std::vector< std::vector< std::unique_ptr< FSIDetails > > > m_wheelLocMap
Definition
SCT_FSIHelper.h:73
FSIHelper::m_locationTypes
std::map< std::string, std::unique_ptr< FSILocation > > m_locationTypes
Definition
SCT_FSIHelper.h:75
FSILocation
Definition
SCT_FSIHelper.h:16
FSILocation::m_radius
double m_radius
Definition
SCT_FSIHelper.h:31
FSILocation::FSILocation
FSILocation(const std::string &name, double radius, double phi, int side)
Definition
SCT_FSIHelper.cxx:13
FSILocation::phi
double phi() const
Definition
SCT_FSIHelper.h:25
FSILocation::m_side
int m_side
Definition
SCT_FSIHelper.h:33
FSILocation::radius
double radius() const
Definition
SCT_FSIHelper.h:24
FSILocation::m_name
std::string m_name
Definition
SCT_FSIHelper.h:30
FSILocation::side
int side() const
Definition
SCT_FSIHelper.h:26
FSILocation::name
const std::string & name() const
Definition
SCT_FSIHelper.h:23
FSILocation::m_phi
double m_phi
Definition
SCT_FSIHelper.h:32
SCT_DataBase
Definition
SCT_DataBase.h:17
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0