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 
29  // resize this to the appropriate one and to be safe, set to nullptr to start
30  m_FitConstantBankNoGuess_1st.resize(m_FPGATrackSimMapping->PlaneMap_1st()->getNLogiLayers());
31  m_FitConstantBankNoGuess_2nd.resize(m_FPGATrackSimMapping->PlaneMap_2nd()->getNLogiLayers());
32  for (unsigned i = 0; i < m_FitConstantBankNoGuess_1st.size(); i++) m_FitConstantBankNoGuess_1st[i] = nullptr;
33  for (unsigned i = 0; i < m_FitConstantBankNoGuess_2nd.size(); i++) m_FitConstantBankNoGuess_2nd[i] = nullptr;
34 
35  return StatusCode::SUCCESS;
36 }
37 
38 
39 
41 // Load Functions
43 
45 {
46  if (missedPlane == -1)
47  m_FitConstantBank_1st = std::unique_ptr<FPGATrackSimFitConstantBank>(new FPGATrackSimFitConstantBank(m_FPGATrackSimMapping->PlaneMap_1st(), m_ncoords_1st, m_path_constants_1st, true));
48  else
49  m_FitConstantBankNoGuess_1st[missedPlane] = std::unique_ptr<FPGATrackSimFitConstantBank> (new FPGATrackSimFitConstantBank(m_FPGATrackSimMapping->PlaneMap_1st(), m_ncoords_1st, m_path_constants_1st_noguess[missedPlane], true, missedPlane)); // no check on the plane number
50 
51  return true;
52 }
53 
54 
56 {
57  if (missedPlane == -1)
58  m_FitConstantBank_2nd = std::unique_ptr<FPGATrackSimFitConstantBank> (new FPGATrackSimFitConstantBank(m_FPGATrackSimMapping->PlaneMap_2nd(), m_ncoords_2nd, m_path_constants_2nd, false));
59  else
60  m_FitConstantBankNoGuess_2nd[missedPlane] = std::unique_ptr<FPGATrackSimFitConstantBank> (new FPGATrackSimFitConstantBank(m_FPGATrackSimMapping->PlaneMap_2nd(), m_ncoords_2nd, m_path_constants_2nd_noguess[missedPlane], false, missedPlane)); // no check on the plane number
61 
62  return true;
63 }
64 
65 
67 {
68  m_SectorBank_1st = std::unique_ptr<FPGATrackSimSectorBank> (new FPGATrackSimSectorBank(m_path_sectorbank_1st));
69  m_SectorBank_1st->storeQOverPtBinning(m_qOverPtBins, m_absQOverPtBinning);
70  return true;
71 }
72 
73 
75 {
76  m_SectorBank_2nd = std::unique_ptr<FPGATrackSimSectorBank> (new FPGATrackSimSectorBank(m_path_sectorbank_2nd));
77  m_SectorBank_2nd->storeQOverPtBinning(m_qOverPtBins, m_absQOverPtBinning);
78  return true;
79 }
80 
81 
83 {
84  m_SectorSlices = std::unique_ptr<FPGATrackSimSectorSlice> (new FPGATrackSimSectorSlice(m_path_sectorslices));
85  return true;
86 }
87 
88 
89 
90 
91 
93 // IFPGATrackSimBankSvc Functions
95 
96 
98 {
99  if (missedPlane == -1) {
100  // Don't need to check the return actually, will return nullptr anyways
102 
103  return m_FitConstantBank_1st.get();
104  }
105  else {
106  // Don't need to check the return actually, will return nullptr anyways
107  if (!m_FitConstantBankNoGuess_1st[missedPlane]) LoadFitConstantBank_1st(missedPlane);
108 
109  return m_FitConstantBankNoGuess_1st[missedPlane].get();
110  }
111 }
112 
113 
115 {
116  if (missedPlane == -1) {
117  // Don't need to check the return actually, will return nullptr anyways
119 
120  return m_FitConstantBank_2nd.get();
121  }
122  else {
123  // Don't need to check the return actually, will return nullptr anyways
124  if (!m_FitConstantBankNoGuess_2nd[missedPlane]) LoadFitConstantBank_2nd(missedPlane);
125 
126  return m_FitConstantBankNoGuess_2nd[missedPlane].get();
127  }
128 }
129 
130 
132 {
133  // Don't need to check the return actually, will return nullptr anyways
135  return m_SectorBank_1st.get();
136 }
137 
139 {
140  // Don't need to check the return actually, will return nullptr anyways
142 
143  return m_SectorBank_2nd.get();
144 }
145 
146 
148 {
149  // Don't need to check the return actually, will return nullptr anyways
151 
152  return m_SectorSlices.get();
153 }
FPGATrackSimBankSvc::SectorSlice
virtual const FPGATrackSimSectorSlice * SectorSlice() override
Definition: FPGATrackSimBankSvc.cxx:147
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:55
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:138
FPGATrackSimBankSvc::LoadSectorSlice
bool LoadSectorSlice()
Definition: FPGATrackSimBankSvc.cxx:82
FPGATrackSimBankSvc::FitConstantBank_2nd
virtual const FPGATrackSimFitConstantBank * FitConstantBank_2nd(int missedPlane=-1) override
Definition: FPGATrackSimBankSvc.cxx:114
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:92
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:30
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:74
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:195
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:97
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:131
FPGATrackSimBankSvc::LoadFitConstantBank_1st
bool LoadFitConstantBank_1st(int missedPlane=-1)
Definition: FPGATrackSimBankSvc.cxx:44
FPGATrackSimBankSvc::LoadSectorBank_1st
bool LoadSectorBank_1st()
Definition: FPGATrackSimBankSvc.cxx:66
FPGATrackSimBankSvc.h
FPGATrackSimBankSvc::m_absQOverPtBinning
Gaudi::Property< bool > m_absQOverPtBinning
Definition: FPGATrackSimBankSvc.h:50