ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
FPGATrackSimMatrixReductionAlgo Class Reference

#include <FPGATrackSimMatrixReductionAlgo.h>

Inheritance diagram for FPGATrackSimMatrixReductionAlgo:
Collaboration diagram for FPGATrackSimMatrixReductionAlgo:

Public Member Functions

 FPGATrackSimMatrixReductionAlgo (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~FPGATrackSimMatrixReductionAlgo ()=default
 
StatusCode initialize () override
 
StatusCode finalize () override
 
StatusCode execute () override
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode copySliceTree (TFile *file)
 
std::pair< std::vector< size_t >, std::vector< size_t > > matchStages ()
 
std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulatorreduce (std::vector< module_t > const &modules_2nd, FPGATrackSimMatrixAccumulator const &acc_2nd, std::vector< size_t > const &layers_1st_to_2nd, std::vector< size_t > const &coords_1st_to_2nd)
 
void extract_1stStage (TFile *file)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< IFPGATrackSimMappingSvcm_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"}
 
ServiceHandle< ITHistSvc > m_tHistSvc {this, "THistSvc","THistSvc"}
 
FPGATrackSimPlaneMap constm_pmap_1st = nullptr
 
FPGATrackSimPlaneMap constm_pmap_2nd = nullptr
 
Gaudi::Property< bool > m_allregion {this, "allregion", false,"Run all regions?"}
 
Gaudi::Property< std::string > m_filePath {this, "LayerChange_path", "default filepath"}
 
Gaudi::Property< int > m_region {this, "region", 0, "Region to run"}
 
Gaudi::Property< int > m_nRegions {this, "nbank", 96, "Number of regions and thus banks to create"}
 
int m_region_start = 0
 
int m_region_end = 0
 
std::vector< AccumulateMapm_sector_cum
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 35 of file FPGATrackSimMatrixReductionAlgo.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ FPGATrackSimMatrixReductionAlgo()

FPGATrackSimMatrixReductionAlgo::FPGATrackSimMatrixReductionAlgo ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 25 of file FPGATrackSimMatrixReductionAlgo.cxx.

25  :
26  AthAlgorithm(name, pSvcLocator)
27 {
28 }

◆ ~FPGATrackSimMatrixReductionAlgo()

virtual FPGATrackSimMatrixReductionAlgo::~FPGATrackSimMatrixReductionAlgo ( )
virtualdefault

Member Function Documentation

◆ copySliceTree()

StatusCode FPGATrackSimMatrixReductionAlgo::copySliceTree ( TFile *  file)
private

Definition at line 62 of file FPGATrackSimMatrixReductionAlgo.cxx.

63 {
64  // Is there a better way to do this? Idk how the interface to tHistSvc works
68 
69  // Read old tree
70  TTree *old_tree = (TTree*)file->Get("slice");
71  old_tree->SetBranchAddress("c_max", &max.qOverPt);
72  old_tree->SetBranchAddress("c_min", &min.qOverPt);
73  old_tree->SetBranchAddress("c_slices", &nBins.qOverPt);
74 
75  old_tree->SetBranchAddress("phi_max", &max.phi);
76  old_tree->SetBranchAddress("phi_min", &min.phi);
77  old_tree->SetBranchAddress("phi_slices", &nBins.phi);
78 
79  old_tree->SetBranchAddress("d0_max", &max.d0);
80  old_tree->SetBranchAddress("d0_min", &min.d0);
81  old_tree->SetBranchAddress("d0_slices", &nBins.d0);
82 
83  old_tree->SetBranchAddress("z0_max", &max.z0);
84  old_tree->SetBranchAddress("z0_min", &min.z0);
85  old_tree->SetBranchAddress("z0_slices", &nBins.z0);
86 
87  old_tree->SetBranchAddress("eta_max", &max.eta);
88  old_tree->SetBranchAddress("eta_min", &min.eta);
89  old_tree->SetBranchAddress("eta_slices", &nBins.eta);
90 
91  old_tree->GetEntry(0);
92 
93  // Write new tree
94  TTree *new_tree = new TTree("slice", "Slice boundaries");
95  ATH_CHECK(m_tHistSvc->regTree("/TRIGFPGATrackSimMATRIX1STSTAGEOUT/slice", new_tree));
96 
97  new_tree->Branch("c_max", &max.qOverPt);
98  new_tree->Branch("c_min", &min.qOverPt);
99  new_tree->Branch("c_slices", &nBins.qOverPt);
100 
101  new_tree->Branch("phi_max", &max.phi);
102  new_tree->Branch("phi_min", &min.phi);
103  new_tree->Branch("phi_slices", &nBins.phi);
104 
105  new_tree->Branch("d0_max", &max.d0);
106  new_tree->Branch("d0_min", &min.d0);
107  new_tree->Branch("d0_slices", &nBins.d0);
108 
109  new_tree->Branch("z0_max", &max.z0);
110  new_tree->Branch("z0_min", &min.z0);
111  new_tree->Branch("z0_slices", &nBins.z0);
112 
113  new_tree->Branch("eta_max", &max.eta);
114  new_tree->Branch("eta_min", &min.eta);
115  new_tree->Branch("eta_slices", &nBins.eta);
116 
117  new_tree->Fill();
118 
119  return StatusCode::SUCCESS;
120 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode FPGATrackSimMatrixReductionAlgo::execute ( )
override

Definition at line 249 of file FPGATrackSimMatrixReductionAlgo.cxx.

250 {
251  // Do nothing; this class does not process events. The main algorithm is
252  // called in initialize() and finalize().
253  return StatusCode::SUCCESS;
254 }

◆ extract_1stStage()

void FPGATrackSimMatrixReductionAlgo::extract_1stStage ( TFile *  file)
private

Definition at line 228 of file FPGATrackSimMatrixReductionAlgo.cxx.

229 {
230  auto matched_layers_coords = matchStages();
231  // Read 2nd stage info from file
232  TTree *tree_2nd = (TTree*)file->Get(Form("am0"));
234 
235  // Create 1st stage matrix and modules, and accumulate into m_sector_cum
236  while (reader.nextEntry())
237  {
238  auto sector_acc = reduce(reader.getModules(), reader.getAccumulator(), matched_layers_coords.first, matched_layers_coords.second);
239  ::accumulate(m_sector_cum[0], sector_acc.first, sector_acc.second);
240  }
241 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode FPGATrackSimMatrixReductionAlgo::finalize ( )
override

Definition at line 260 of file FPGATrackSimMatrixReductionAlgo.cxx.

261 {
262  {
263  // Create the tree
264  std::stringstream name;
265  std::stringstream title;
266  name << "am0";
267  title << "Ambank 0" << " parameters";
268  TTree* tree = new TTree(name.str().c_str(), title.str().c_str());
269  ATH_CHECK(m_tHistSvc->regTree(Form("/TRIGFPGATrackSimMATRIX1STSTAGEOUT/%s",tree->GetName()), tree));
270 
271  // Fill the tree
273  }
274 
275  ATH_CHECK(m_tHistSvc->finalize());
276  return StatusCode::SUCCESS;
277 }

◆ initialize()

StatusCode FPGATrackSimMatrixReductionAlgo::initialize ( )
override

Definition at line 30 of file FPGATrackSimMatrixReductionAlgo.cxx.

31 {
32  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
33  ATH_CHECK(m_tHistSvc.retrieve());
34 
35  m_pmap_1st = m_FPGATrackSimMapping->PlaneMap_1st();
36  m_pmap_2nd = m_FPGATrackSimMapping->PlaneMap_2nd();
37 
38  // Setup the boundaries for the merge
39  if (m_allregion)
40  {
41  m_region_start = 0;
43  }
44  else
45  {
47  m_region_end = m_region + 1;
48  }
49  m_sector_cum.resize(m_nRegions);
50 
51  ATH_MSG_INFO("Reading " << m_filePath);
52  TFile *file = TFile::Open(m_filePath.value().c_str(), "");
54 
55  // Main execution function
57 
58  return StatusCode::SUCCESS;
59 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ matchStages()

std::pair< std::vector< size_t >, std::vector< size_t > > FPGATrackSimMatrixReductionAlgo::matchStages ( )
private

ultimately we may want a function to get inversion for each specific layer, aka getInversion(ls_2nd.layer), so this is a placeholder;

Definition at line 135 of file FPGATrackSimMatrixReductionAlgo.cxx.

136 {
137  size_t iCoord_1st = 0;
138 
139  std::vector<size_t> layers_1st_to_2nd(m_pmap_1st->getNLogiLayers());
140  std::vector<size_t> coords_1st_to_2nd(m_pmap_1st->getNCoords());
141 
142  for (unsigned layer_1st = 0; layer_1st < m_pmap_1st->getNLogiLayers(); layer_1st++)
143  {
144  LayerInfo const & info_1st = m_pmap_1st->getLayerInfo(layer_1st, 0);
145  // all sections in stage 1 should also be in stage 2, so can just use 0 to retrieve info
146  LayerSection const & ls_2nd = m_pmap_2nd->getLayerSection(info_1st);
147 
148  int inversion(0);
149  layers_1st_to_2nd[layer_1st] = ls_2nd.layer + inversion;
150  for (size_t iDim = 0; iDim < m_pmap_1st->getDim(layer_1st); iDim++)
151  {
152  coords_1st_to_2nd[iCoord_1st] = m_pmap_2nd->getCoordOffset(ls_2nd.layer) + iDim + inversion;
153  iCoord_1st++;
154  }
155  }
156 
157  assert(iCoord_1st == m_pmap_1st->getNCoords());
158  return { layers_1st_to_2nd, coords_1st_to_2nd };
159 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ reduce()

std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > FPGATrackSimMatrixReductionAlgo::reduce ( std::vector< module_t > const modules_2nd,
FPGATrackSimMatrixAccumulator const acc_2nd,
std::vector< size_t > const layers_1st_to_2nd,
std::vector< size_t > const coords_1st_to_2nd 
)
private

Definition at line 180 of file FPGATrackSimMatrixReductionAlgo.cxx.

183 {
184  std::vector<module_t> modules_1st(m_pmap_1st->getNLogiLayers()); // First stage sector definition (to be filled)
185  FPGATrackSimMatrixAccumulator acc_1st(m_pmap_1st->getNLogiLayers(), m_pmap_1st->getNCoords()); // First stage accumulator (to be filled)
186 
187  acc_1st.pars = acc_2nd.pars;
188  acc_1st.track_bins = acc_2nd.track_bins;
189 
190  // For each first stage layer, copy relavant info from matching second stage layer
191  for (size_t layer_1st = 0; layer_1st < m_pmap_1st->getNLogiLayers(); layer_1st++)
192  {
193  size_t layer_2nd = layers_1st_to_2nd[layer_1st];
194  modules_1st[layer_1st] = modules_2nd[layer_2nd];
195  acc_1st.FTK_modules[layer_1st] = acc_2nd.FTK_modules[layer_2nd];
196  }
197 
198  // Copy coordinates from matching second stage coordinate
199  for (size_t iCoord_1st = 0; iCoord_1st < m_pmap_1st->getNCoords(); iCoord_1st++)
200  {
201  size_t iCoord_2nd = coords_1st_to_2nd[iCoord_1st];
202 
203  acc_1st.hit_coords[iCoord_1st] = acc_2nd.hit_coords[iCoord_2nd];
204  acc_1st.hit_x_QoP [iCoord_1st] = acc_2nd.hit_x_QoP [iCoord_2nd];
205  acc_1st.hit_x_d0 [iCoord_1st] = acc_2nd.hit_x_d0 [iCoord_2nd];
206  acc_1st.hit_x_z0 [iCoord_1st] = acc_2nd.hit_x_z0 [iCoord_2nd];
207  acc_1st.hit_x_eta [iCoord_1st] = acc_2nd.hit_x_eta [iCoord_2nd];
208  acc_1st.hit_x_phi [iCoord_1st] = acc_2nd.hit_x_phi [iCoord_2nd];
209 
210  // Covariance calculation. This requires a second loop through layers/coordinates,
211  // so postfix those variables with _j, as in (i,j). Only need triangular matrix
212  // so start loop at iCoord_1st.
213  for (size_t iCoord_1st_j = iCoord_1st; iCoord_1st_j < m_pmap_1st->getNCoords(); iCoord_1st_j++)
214  {
215  size_t iCoord_2nd_j = coords_1st_to_2nd[iCoord_1st_j];
216  acc_1st.covariance[iCoord_1st * m_pmap_1st->getNCoords() + iCoord_1st_j] =
217  acc_2nd.covariance[iCoord_2nd * m_pmap_2nd->getNCoords() + iCoord_2nd_j];
218  }
219  }
220 
221  return { modules_1st, acc_1st };
222 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_allregion

Gaudi::Property<bool> FPGATrackSimMatrixReductionAlgo::m_allregion {this, "allregion", false,"Run all regions?"}
private

Definition at line 58 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_filePath

Gaudi::Property<std::string> FPGATrackSimMatrixReductionAlgo::m_filePath {this, "LayerChange_path", "default filepath"}
private

Definition at line 59 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_FPGATrackSimMapping

ServiceHandle<IFPGATrackSimMappingSvc> FPGATrackSimMatrixReductionAlgo::m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"}
private

Definition at line 51 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_nRegions

Gaudi::Property<int> FPGATrackSimMatrixReductionAlgo::m_nRegions {this, "nbank", 96, "Number of regions and thus banks to create"}
private

Definition at line 61 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_pmap_1st

FPGATrackSimPlaneMap const* FPGATrackSimMatrixReductionAlgo::m_pmap_1st = nullptr
private

Definition at line 53 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_pmap_2nd

FPGATrackSimPlaneMap const* FPGATrackSimMatrixReductionAlgo::m_pmap_2nd = nullptr
private

Definition at line 54 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_region

Gaudi::Property<int> FPGATrackSimMatrixReductionAlgo::m_region {this, "region", 0, "Region to run"}
private

Definition at line 60 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_region_end

int FPGATrackSimMatrixReductionAlgo::m_region_end = 0
private

Definition at line 64 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_region_start

int FPGATrackSimMatrixReductionAlgo::m_region_start = 0
private

Definition at line 63 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_sector_cum

std::vector<AccumulateMap> FPGATrackSimMatrixReductionAlgo::m_sector_cum
private

Definition at line 69 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_tHistSvc

ServiceHandle<ITHistSvc> FPGATrackSimMatrixReductionAlgo::m_tHistSvc {this, "THistSvc","THistSvc"}
private

Definition at line 52 of file FPGATrackSimMatrixReductionAlgo.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
FPGATrackSimMatrixReductionAlgo::m_pmap_2nd
FPGATrackSimPlaneMap const * m_pmap_2nd
Definition: FPGATrackSimMatrixReductionAlgo.h:54
FPGATrackSimPlaneMap::getNLogiLayers
uint32_t getNLogiLayers() const
Definition: FPGATrackSimPlaneMap.h:78
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
max
#define max(a, b)
Definition: cfImp.cxx:41
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
FPGATrackSimMatrixReductionAlgo::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
Definition: FPGATrackSimMatrixReductionAlgo.h:52
tree
TChain * tree
Definition: tile_monitor.h:30
FPGATrackSimMatrixReductionAlgo::extract_1stStage
void extract_1stStage(TFile *file)
Definition: FPGATrackSimMatrixReductionAlgo.cxx:228
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
FPGATrackSimPlaneMap::getNCoords
uint32_t getNCoords() const
Definition: FPGATrackSimPlaneMap.h:79
FPGATrackSimMatrixReductionAlgo::m_nRegions
Gaudi::Property< int > m_nRegions
Definition: FPGATrackSimMatrixReductionAlgo.h:61
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
FPGATrackSimPlaneMap::getLayerSection
const LayerSection & getLayerSection(SiliconTech siTech, DetectorZone zone, uint32_t physLayer) const
Definition: FPGATrackSimPlaneMap.h:120
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
FPGATrackSimMatrixReductionAlgo::reduce
std::pair< std::vector< module_t >, FPGATrackSimMatrixAccumulator > reduce(std::vector< module_t > const &modules_2nd, FPGATrackSimMatrixAccumulator const &acc_2nd, std::vector< size_t > const &layers_1st_to_2nd, std::vector< size_t > const &coords_1st_to_2nd)
Definition: FPGATrackSimMatrixReductionAlgo.cxx:180
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
FPGATrackSimPlaneMap::getDim
uint32_t getDim(size_t logiLayer) const
Definition: FPGATrackSimPlaneMap.h:81
FPGATrackSimMatrixReductionAlgo::m_filePath
Gaudi::Property< std::string > m_filePath
Definition: FPGATrackSimMatrixReductionAlgo.h:59
FPGATrackSimPlaneMap::getCoordOffset
uint32_t getCoordOffset(size_t logiLayer) const
Definition: FPGATrackSimPlaneMap.h:95
fillTree
void fillTree(AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).
Definition: FPGATrackSimMatrixIO.cxx:225
FPGATrackSimMatrixReductionAlgo::matchStages
std::pair< std::vector< size_t >, std::vector< size_t > > matchStages()
Definition: FPGATrackSimMatrixReductionAlgo.cxx:135
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimMatrixAccumulator
Definition: FPGATrackSimMatrixAccumulator.h:36
covarianceTool.title
title
Definition: covarianceTool.py:542
file
TFile * file
Definition: tile_monitor.h:29
FPGATrackSimPlaneMap::getLayerInfo
const LayerInfo & getLayerInfo(uint32_t layer, uint32_t section) const
Definition: FPGATrackSimPlaneMap.h:107
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimMatrixReductionAlgo::m_region
Gaudi::Property< int > m_region
Definition: FPGATrackSimMatrixReductionAlgo.h:60
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
FPGATrackSimMatrixReader
Definition: FPGATrackSimMatrixIO.h:41
FPGATrackSimMatrixReductionAlgo::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimMatrixReductionAlgo.h:51
LayerSection
Definition: FPGATrackSimPlaneMap.h:40
FPGATrackSimMatrixReductionAlgo::m_allregion
Gaudi::Property< bool > m_allregion
Definition: FPGATrackSimMatrixReductionAlgo.h:58
min
#define min(a, b)
Definition: cfImp.cxx:40
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FPGATrackSimMatrixReductionAlgo::m_region_start
int m_region_start
Definition: FPGATrackSimMatrixReductionAlgo.h:63
LayerInfo
Definition: FPGATrackSimPlaneMap.h:52
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
LayerSection::layer
int layer
Definition: FPGATrackSimPlaneMap.h:41
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FPGATrackSimMatrixReductionAlgo::m_pmap_1st
FPGATrackSimPlaneMap const * m_pmap_1st
Definition: FPGATrackSimMatrixReductionAlgo.h:53
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
FPGATrackSimMatrixReductionAlgo::m_sector_cum
std::vector< AccumulateMap > m_sector_cum
Definition: FPGATrackSimMatrixReductionAlgo.h:69
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
collisions.reader
reader
read the goodrunslist xml file(s)
Definition: collisions.py:22
FPGATrackSimTrackParsI
Definition: FPGATrackSimTrackPars.h:56
FPGATrackSimMatrixReductionAlgo::m_region_end
int m_region_end
Definition: FPGATrackSimMatrixReductionAlgo.h:64
FPGATrackSimMatrixReductionAlgo::copySliceTree
StatusCode copySliceTree(TFile *file)
Definition: FPGATrackSimMatrixReductionAlgo.cxx:62
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >