ATLAS Offline Software
Loading...
Searching...
No Matches
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"
9#include "GaudiKernel/SystemOfUnits.h"
10
11#include <iostream>
12
14 double radius,
15 double phi,
16 int side)
17 : m_name(name),
19 m_phi(phi),
21{}
22
23
25 int simType,
26 const std::string & simTypeString,
27 const std::string & locationType,
28 const std::string & actualType)
34{}
35
36
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
49
50
51void
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
88const std::vector<const FSIDetails *> &
89FSIHelper::fsiVector(int iWheel) const
90{
91 return m_wheelLocMapConst[iWheel];
92}
Definition of the abstract IRDBRecord interface.
const FSILocation * m_location
std::string m_actualType
std::string m_locType
const std::string & locationType() const
int simType() const
const std::string & simTypeString() const
FSIDetails(const FSILocation *location, int simType, const std::string &simTypeString, const std::string &locationType, const std::string &actualType)
const FSILocation & location() const
std::string m_simTypeStr
const std::string & actualType() const
std::vector< std::vector< const FSIDetails * > > m_wheelLocMapConst
FSIHelper(SCT_DataBase *rdb)
SCT_DataBase * m_rdb
const std::vector< const FSIDetails * > & fsiVector(int wheel) const
std::vector< std::vector< std::unique_ptr< FSIDetails > > > m_wheelLocMap
std::map< std::string, std::unique_ptr< FSILocation > > m_locationTypes
double m_radius
FSILocation(const std::string &name, double radius, double phi, int side)
double phi() const
double radius() const
std::string m_name
int side() const
const std::string & name() const
Definition index.py:1