ATLAS Offline Software
FPGATrackSimMatrixReductionAlgo.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 #ifndef FPGATrackSimMatrixReductionAlgo_h
4 #define FPGATrackSimMatrixReductionAlgo_h
5 
24 #include "GaudiKernel/ITHistSvc.h"
28 
29 class TTree;
30 
31 #include <string>
32 #include <vector>
33 
34 
36 {
37  public:
38 
39  FPGATrackSimMatrixReductionAlgo (const std::string& name, ISvcLocator* pSvcLocator);
40  virtual ~FPGATrackSimMatrixReductionAlgo() = default;
41  StatusCode initialize() override;
42  StatusCode finalize() override;
43  // Execute does not do anything for this alg. This class does not process events, everything is done in init and finalize
44  StatusCode execute() override;
45 
46  private:
47 
49  // Handles
50 
51  ServiceHandle<IFPGATrackSimMappingSvc> m_FPGATrackSimMapping {this, "FPGATrackSimMappingSvc","FPGATrackSimMappingSvc"};
52  ServiceHandle<ITHistSvc> m_tHistSvc {this, "THistSvc","THistSvc"};
53  FPGATrackSimPlaneMap const * m_pmap_1st = nullptr;
54  FPGATrackSimPlaneMap const * m_pmap_2nd = nullptr;
55 
57  // Configuration
58  Gaudi::Property<bool> m_allregion {this, "allregion", false,"Run all regions?"};
59  Gaudi::Property<std::string> m_filePath {this, "LayerChange_path", "default filepath"};
60  Gaudi::Property<int> m_region {this, "region", 0, "Region to run"};
61  Gaudi::Property<int> m_nRegions {this, "nbank", 96, "Number of regions and thus banks to create"};
62 
63  int m_region_start = 0;
64  int m_region_end = 0;
65 
67  // Data
68 
69  std::vector<AccumulateMap> m_sector_cum; // 1st stage accumulate maps, size nRegion.
70 
72  // Helper Functions
73 
75  std::pair<std::vector<size_t>, std::vector<size_t>> matchStages();
76  std::pair<std::vector<module_t>, FPGATrackSimMatrixAccumulator> reduce(
77  std::vector<module_t> const & modules_2nd, FPGATrackSimMatrixAccumulator const & acc_2nd,
78  std::vector<size_t> const & layers_1st_to_2nd, std::vector<size_t> const & coords_1st_to_2nd);
79  void extract_1stStage(TFile *file);
80 };
81 
82 
83 
84 
85 #endif // FPGATrackSimMatrixReductionAlgo_h
86 
FPGATrackSimMatrixReductionAlgo::m_pmap_2nd
FPGATrackSimPlaneMap const * m_pmap_2nd
Definition: FPGATrackSimMatrixReductionAlgo.h:54
IFPGATrackSimMappingSvc.h
FPGATrackSimMatrixReductionAlgo::m_tHistSvc
ServiceHandle< ITHistSvc > m_tHistSvc
Definition: FPGATrackSimMatrixReductionAlgo.h:52
FPGATrackSimMatrixReductionAlgo::extract_1stStage
void extract_1stStage(TFile *file)
Definition: FPGATrackSimMatrixReductionAlgo.cxx:228
FPGATrackSimMatrixReductionAlgo::m_nRegions
Gaudi::Property< int > m_nRegions
Definition: FPGATrackSimMatrixReductionAlgo.h:61
FPGATrackSimMatrixReductionAlgo
Definition: FPGATrackSimMatrixReductionAlgo.h:36
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
FPGATrackSimMatrixReductionAlgo::m_filePath
Gaudi::Property< std::string > m_filePath
Definition: FPGATrackSimMatrixReductionAlgo.h:59
FPGATrackSimMatrixReductionAlgo::finalize
StatusCode finalize() override
Definition: FPGATrackSimMatrixReductionAlgo.cxx:260
AthAlgorithm.h
FPGATrackSimMatrixReductionAlgo::matchStages
std::pair< std::vector< size_t >, std::vector< size_t > > matchStages()
Definition: FPGATrackSimMatrixReductionAlgo.cxx:135
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
FPGATrackSimMatrixAccumulator
Definition: FPGATrackSimMatrixAccumulator.h:36
file
TFile * file
Definition: tile_monitor.h:29
FPGATrackSimMatrixReductionAlgo::FPGATrackSimMatrixReductionAlgo
FPGATrackSimMatrixReductionAlgo(const std::string &name, ISvcLocator *pSvcLocator)
Definition: FPGATrackSimMatrixReductionAlgo.cxx:25
FPGATrackSimMatrixReductionAlgo::m_region
Gaudi::Property< int > m_region
Definition: FPGATrackSimMatrixReductionAlgo.h:60
FPGATrackSimMatrixReductionAlgo::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimMatrixReductionAlgo.h:51
FPGATrackSimMatrixReductionAlgo::m_allregion
Gaudi::Property< bool > m_allregion
Definition: FPGATrackSimMatrixReductionAlgo.h:58
AthAlgorithm
Definition: AthAlgorithm.h:47
FPGATrackSimPlaneMap
Definition: FPGATrackSimPlaneMap.h:62
FPGATrackSimMatrixAccumulator.h
Helper struct for accumulating sector information for matrix generation.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
FPGATrackSimMatrixReductionAlgo::execute
StatusCode execute() override
Definition: FPGATrackSimMatrixReductionAlgo.cxx:249
FPGATrackSimMatrixReductionAlgo::m_region_start
int m_region_start
Definition: FPGATrackSimMatrixReductionAlgo.h:63
FPGATrackSimMatrixReductionAlgo::~FPGATrackSimMatrixReductionAlgo
virtual ~FPGATrackSimMatrixReductionAlgo()=default
FPGATrackSimMatrixReductionAlgo::m_pmap_1st
FPGATrackSimPlaneMap const * m_pmap_1st
Definition: FPGATrackSimMatrixReductionAlgo.h:53
FPGATrackSimMatrixReductionAlgo::m_sector_cum
std::vector< AccumulateMap > m_sector_cum
Definition: FPGATrackSimMatrixReductionAlgo.h:69
FPGATrackSimMatrixReductionAlgo::initialize
StatusCode initialize() override
Definition: FPGATrackSimMatrixReductionAlgo.cxx:30
FPGATrackSimMatrixReductionAlgo::m_region_end
int m_region_end
Definition: FPGATrackSimMatrixReductionAlgo.h:64
FPGATrackSimMatrixReductionAlgo::copySliceTree
StatusCode copySliceTree(TFile *file)
Definition: FPGATrackSimMatrixReductionAlgo.cxx:62
ServiceHandle< IFPGATrackSimMappingSvc >