ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FSIHelper Class Reference

#include <SCT_FSIHelper.h>

Collaboration diagram for FSIHelper:

Public Member Functions

 FSIHelper (SCT_DataBase *rdb)
 
 ~FSIHelper ()
 
const std::vector< const FSIDetails * > & fsiVector (int wheel) const
 

Private Member Functions

void fill ()
 

Private Attributes

std::vector< std::vector< std::unique_ptr< FSIDetails > > > m_wheelLocMap
 
std::vector< std::vector< const FSIDetails * > > m_wheelLocMapConst
 
std::map< std::string, std::unique_ptr< FSILocation > > m_locationTypes
 
SCT_DataBasem_rdb
 

Detailed Description

Definition at line 61 of file SCT_FSIHelper.h.

Constructor & Destructor Documentation

◆ FSIHelper()

FSIHelper::FSIHelper ( SCT_DataBase rdb)

Definition at line 37 of file SCT_FSIHelper.cxx.

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 }

◆ ~FSIHelper()

FSIHelper::~FSIHelper ( )

Definition at line 46 of file SCT_FSIHelper.cxx.

47 {
48 }

Member Function Documentation

◆ fill()

void FSIHelper::fill ( )
private

Definition at line 52 of file SCT_FSIHelper.cxx.

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 }

◆ fsiVector()

const std::vector< const FSIDetails * > & FSIHelper::fsiVector ( int  wheel) const

Definition at line 89 of file SCT_FSIHelper.cxx.

90 {
91  return m_wheelLocMapConst[iWheel];
92 }

Member Data Documentation

◆ m_locationTypes

std::map<std::string, std::unique_ptr<FSILocation> > FSIHelper::m_locationTypes
private

Definition at line 75 of file SCT_FSIHelper.h.

◆ m_rdb

SCT_DataBase* FSIHelper::m_rdb
private

Definition at line 77 of file SCT_FSIHelper.h.

◆ m_wheelLocMap

std::vector<std::vector<std::unique_ptr<FSIDetails> > > FSIHelper::m_wheelLocMap
private

Definition at line 73 of file SCT_FSIHelper.h.

◆ m_wheelLocMapConst

std::vector<std::vector<const FSIDetails *> > FSIHelper::m_wheelLocMapConst
private

Definition at line 74 of file SCT_FSIHelper.h.


The documentation for this class was generated from the following files:
IRDBRecord::getInt
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
SCT_DataBase::fwdGeneral
const IRDBRecord * fwdGeneral() const
Definition: SCT_DataBase.cxx:244
SCT_DataBase::fwdFSIType
const IRDBRecord * fwdFSIType(int i) const
Definition: SCT_DataBase.cxx:238
SCT_DataBase::fwdFSI
const IRDBRecord * fwdFSI(int i) const
Definition: SCT_DataBase.cxx:240
FSIHelper::m_locationTypes
std::map< std::string, std::unique_ptr< FSILocation > > m_locationTypes
Definition: SCT_FSIHelper.h:75
index
Definition: index.py:1
IRDBRecord::getString
virtual const std::string & getString(const std::string &fieldName) const =0
Get string field value.
FSIHelper::fill
void fill()
Definition: SCT_FSIHelper.cxx:52
deg
#define deg
Definition: SbPolyhedron.cxx:17
FSIHelper::m_wheelLocMapConst
std::vector< std::vector< const FSIDetails * > > m_wheelLocMapConst
Definition: SCT_FSIHelper.h:74
TRT::Hit::side
@ side
Definition: HitInfo.h:83
SCT_DataBase::fwdFSILocationSize
int fwdFSILocationSize() const
Definition: SCT_DataBase.cxx:237
FSIHelper::m_rdb
SCT_DataBase * m_rdb
Definition: SCT_FSIHelper.h:77
FSILocation
Definition: SCT_FSIHelper.h:16
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
FSIHelper::m_wheelLocMap
std::vector< std::vector< std::unique_ptr< FSIDetails > > > m_wheelLocMap
Definition: SCT_FSIHelper.h:73
SCT_DataBase::fwdFSISize
int fwdFSISize() const
Definition: SCT_DataBase.cxx:241
SCT_DataBase::fwdFSILocation
const IRDBRecord * fwdFSILocation(int i) const
Definition: SCT_DataBase.cxx:236
IRDBRecord::getDouble
virtual double getDouble(const std::string &fieldName) const =0
Get double field value.