ATLAS Offline Software
FPGATrackSimBankSvc.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 
4 #include "FPGATrackSimBankSvc.h"
5 
6 
8 // AthService Functions
10 
11 
12 FPGATrackSimBankSvc::FPGATrackSimBankSvc(const std::string& name, ISvcLocator*svc) :
13  base_class(name,svc),
14  m_FPGATrackSimMapping("FPGATrackSimMappingSvc", name)
15 {
16 }
17 
18 
19 
21 {
22  ATH_MSG_DEBUG("-------------- FPGATrackSimBankSvc -------------------");
23  ATH_MSG_DEBUG("BankType Map = " << m_bankTypes);
24  ATH_MSG_DEBUG("Number of 1st stage coordinates = " << m_ncoords_1st);
25  ATH_MSG_DEBUG("Number of 2nd stage coordinates = " << m_ncoords_2nd);
26  ATH_MSG_DEBUG("-------------------------------------------------");
27 
28  // resize this to the appropriate one and to be safe, set to nullptr to start
29  m_FitConstantBankNoGuess_1st.resize(m_FPGATrackSimMapping->PlaneMap_1st(0)->getNLogiLayers());
30  m_FitConstantBankNoGuess_2nd.resize(m_FPGATrackSimMapping->PlaneMap_2nd(0)->getNLogiLayers());
31  for (unsigned i = 0; i < m_FitConstantBankNoGuess_1st.size(); i++) m_FitConstantBankNoGuess_1st[i] = nullptr;
32  for (unsigned i = 0; i < m_FitConstantBankNoGuess_2nd.size(); i++) m_FitConstantBankNoGuess_2nd[i] = nullptr;
33 
34  return StatusCode::SUCCESS;
35 }
36 
37 
38 
40 // Load Functions
42 
44 {
45  if (missedPlane == -1)
46  m_FitConstantBank_1st = std::unique_ptr<FPGATrackSimFitConstantBank>(new FPGATrackSimFitConstantBank(m_FPGATrackSimMapping->PlaneMap_1st(0), m_ncoords_1st, m_path_constants_1st, true));
47  else
48  m_FitConstantBankNoGuess_1st[missedPlane] = std::unique_ptr<FPGATrackSimFitConstantBank> (new FPGATrackSimFitConstantBank(m_FPGATrackSimMapping->PlaneMap_1st(0), m_ncoords_1st, m_path_constants_1st_noguess[missedPlane], true, missedPlane)); // no check on the plane number
49 
50  return true;
51 }
52 
53 
55 {
56  if (missedPlane == -1)
57  m_FitConstantBank_2nd = std::make_unique<FPGATrackSimFitConstantBank> (m_FPGATrackSimMapping->PlaneMap_2nd(0), m_ncoords_2nd, m_path_constants_2nd, false);
58  else
59  m_FitConstantBankNoGuess_2nd[missedPlane] = std::make_unique<FPGATrackSimFitConstantBank> (m_FPGATrackSimMapping->PlaneMap_2nd(0), m_ncoords_2nd, m_path_constants_2nd_noguess[missedPlane], false, missedPlane); // no check on the plane number
60 
61  return true;
62 }
63 
64 
66 {
67  m_SectorBank_1st = std::unique_ptr<FPGATrackSimSectorBank> (new FPGATrackSimSectorBank(m_path_sectorbank_1st));
68  m_SectorBank_1st->storeQOverPtBinning(m_qOverPtBins, m_absQOverPtBinning);
69  return true;
70 }
71 
72 
74 {
75  m_SectorBank_2nd = std::unique_ptr<FPGATrackSimSectorBank> (new FPGATrackSimSectorBank(m_path_sectorbank_2nd));
76  m_SectorBank_2nd->storeQOverPtBinning(m_qOverPtBins, m_absQOverPtBinning);
77  return true;
78 }
79 
80 
82 {
83  m_SectorSlices = std::unique_ptr<FPGATrackSimSectorSlice> (new FPGATrackSimSectorSlice(m_path_sectorslices));
84  return true;
85 }
86 
87 
88 
89 
90 
92 // IFPGATrackSimBankSvc Functions
94 
95 
97 {
98  if (missedPlane == -1) {
99  // Don't need to check the return actually, will return nullptr anyways
101 
102  return m_FitConstantBank_1st.get();
103  }
104  else {
105  // Don't need to check the return actually, will return nullptr anyways
106  if (!m_FitConstantBankNoGuess_1st[missedPlane]) LoadFitConstantBank_1st(missedPlane);
107 
108  return m_FitConstantBankNoGuess_1st[missedPlane].get();
109  }
110 }
111 
112 
114 {
115  if (missedPlane == -1) {
116  // Don't need to check the return actually, will return nullptr anyways
118 
119  return m_FitConstantBank_2nd.get();
120  }
121  else {
122  // Don't need to check the return actually, will return nullptr anyways
123  if (!m_FitConstantBankNoGuess_2nd[missedPlane]) LoadFitConstantBank_2nd(missedPlane);
124 
125  return m_FitConstantBankNoGuess_2nd[missedPlane].get();
126  }
127 }
128 
129 
131 {
132  // Don't need to check the return actually, will return nullptr anyways
134  return m_SectorBank_1st.get();
135 }
136 
138 {
139  // Don't need to check the return actually, will return nullptr anyways
141 
142  return m_SectorBank_2nd.get();
143 }
144 
145 
147 {
148  // Don't need to check the return actually, will return nullptr anyways
150 
151  return m_SectorSlices.get();
152 }
FPGATrackSimBankSvc::SectorSlice
virtual const FPGATrackSimSectorSlice * SectorSlice() override
Definition: FPGATrackSimBankSvc.cxx:146
FPGATrackSimBankSvc::m_path_constants_1st_noguess
Gaudi::Property< std::vector< std::string > > m_path_constants_1st_noguess
Definition: FPGATrackSimBankSvc.h:48
FPGATrackSimBankSvc::LoadFitConstantBank_2nd
bool LoadFitConstantBank_2nd(int missedPlane=-1)
Definition: FPGATrackSimBankSvc.cxx:54
FPGATrackSimBankSvc::m_SectorBank_1st
std::unique_ptr< FPGATrackSimSectorBank > m_SectorBank_1st
Definition: FPGATrackSimBankSvc.h:62
FPGATrackSimBankSvc::m_path_constants_2nd
Gaudi::Property< std::string > m_path_constants_2nd
Definition: FPGATrackSimBankSvc.h:40
FPGATrackSimBankSvc::m_FitConstantBank_1st
std::unique_ptr< FPGATrackSimFitConstantBank > m_FitConstantBank_1st
Definition: FPGATrackSimBankSvc.h:58
FPGATrackSimBankSvc::SectorBank_2nd
virtual const FPGATrackSimSectorBank * SectorBank_2nd() override
Definition: FPGATrackSimBankSvc.cxx:137
FPGATrackSimBankSvc::LoadSectorSlice
bool LoadSectorSlice()
Definition: FPGATrackSimBankSvc.cxx:81
FPGATrackSimBankSvc::FitConstantBank_2nd
virtual const FPGATrackSimFitConstantBank * FitConstantBank_2nd(int missedPlane=-1) override
Definition: FPGATrackSimBankSvc.cxx:113
FPGATrackSimBankSvc::m_SectorSlices
std::unique_ptr< FPGATrackSimSectorSlice > m_SectorSlices
Definition: FPGATrackSimBankSvc.h:64
FPGATrackSimBankSvc::m_path_sectorslices
Gaudi::Property< std::string > m_path_sectorslices
Definition: FPGATrackSimBankSvc.h:43
FPGATrackSimBankSvc::m_ncoords_2nd
Gaudi::Property< int > m_ncoords_2nd
Definition: FPGATrackSimBankSvc.h:46
FPGATrackSimBankSvc::m_FitConstantBankNoGuess_2nd
std::vector< std::unique_ptr< FPGATrackSimFitConstantBank > > m_FitConstantBankNoGuess_2nd
Definition: FPGATrackSimBankSvc.h:61
FPGATrackSimBankSvc::m_SectorBank_2nd
std::unique_ptr< FPGATrackSimSectorBank > m_SectorBank_2nd
Definition: FPGATrackSimBankSvc.h:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
FPGATrackSimSectorSlice
Definition: FPGATrackSimSectorSlice.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FPGATrackSimBankSvc::m_FitConstantBankNoGuess_1st
std::vector< std::unique_ptr< FPGATrackSimFitConstantBank > > m_FitConstantBankNoGuess_1st
Definition: FPGATrackSimBankSvc.h:60
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
FPGATrackSimBankSvc::m_path_constants_2nd_noguess
Gaudi::Property< std::vector< std::string > > m_path_constants_2nd_noguess
Definition: FPGATrackSimBankSvc.h:49
FPGATrackSimSectorBank
Definition: FPGATrackSimSectorBank.h:32
FPGATrackSimBankSvc::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimBankSvc.h:53
FPGATrackSimBankSvc::m_path_constants_1st
Gaudi::Property< std::string > m_path_constants_1st
Definition: FPGATrackSimBankSvc.h:39
FPGATrackSimBankSvc::LoadSectorBank_2nd
bool LoadSectorBank_2nd()
Definition: FPGATrackSimBankSvc.cxx:73
FPGATrackSimBankSvc::m_ncoords_1st
Gaudi::Property< int > m_ncoords_1st
Definition: FPGATrackSimBankSvc.h:45
FPGATrackSimBankSvc::m_path_sectorbank_1st
Gaudi::Property< std::string > m_path_sectorbank_1st
Definition: FPGATrackSimBankSvc.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
FPGATrackSimFitConstantBank
Definition: FPGATrackSimFitConstantBank.h:24
FPGATrackSimBankSvc::FPGATrackSimBankSvc
FPGATrackSimBankSvc(const std::string &name, ISvcLocator *svc)
Definition: FPGATrackSimBankSvc.cxx:12
FPGATrackSimBankSvc::m_FitConstantBank_2nd
std::unique_ptr< FPGATrackSimFitConstantBank > m_FitConstantBank_2nd
Definition: FPGATrackSimBankSvc.h:59
FPGATrackSimBankSvc::m_bankTypes
Gaudi::Property< std::string > m_bankTypes
Definition: FPGATrackSimBankSvc.h:44
FPGATrackSimBankSvc::m_path_sectorbank_2nd
Gaudi::Property< std::string > m_path_sectorbank_2nd
Definition: FPGATrackSimBankSvc.h:42
FPGATrackSimBankSvc::FitConstantBank_1st
virtual const FPGATrackSimFitConstantBank * FitConstantBank_1st(int missedPlane=-1) override
Definition: FPGATrackSimBankSvc.cxx:96
FPGATrackSimBankSvc::m_qOverPtBins
Gaudi::Property< std::vector< double > > m_qOverPtBins
Definition: FPGATrackSimBankSvc.h:51
FPGATrackSimBankSvc::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimBankSvc.cxx:20
FPGATrackSimBankSvc::SectorBank_1st
virtual const FPGATrackSimSectorBank * SectorBank_1st() override
Definition: FPGATrackSimBankSvc.cxx:130
FPGATrackSimBankSvc::LoadFitConstantBank_1st
bool LoadFitConstantBank_1st(int missedPlane=-1)
Definition: FPGATrackSimBankSvc.cxx:43
FPGATrackSimBankSvc::LoadSectorBank_1st
bool LoadSectorBank_1st()
Definition: FPGATrackSimBankSvc.cxx:65
FPGATrackSimBankSvc.h
FPGATrackSimBankSvc::m_absQOverPtBinning
Gaudi::Property< bool > m_absQOverPtBinning
Definition: FPGATrackSimBankSvc.h:50