ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimMatrixMergeAlgo.h
Go to the documentation of this file.
1// Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSimMatrixMergeAlgo_h
4#define FPGATrackSimMatrixMergeAlgo_h
5
18
19
20#include "GaudiKernel/ITHistSvc.h"
23
24#include "TTree.h"
25#include "TH1I.h"
26#include "TH1F.h"
27
28#include <string>
29#include <vector>
30
31class ITHistSvc;
32
33
35{
36 public:
37 FPGATrackSimMatrixMergeAlgo(const std::string& name, ISvcLocator* pSvcLocator);
38 virtual ~FPGATrackSimMatrixMergeAlgo() = default;
39 StatusCode initialize() override;
40 // Execute does not do anything for this alg. This class does not process events, everything is done in init and finalize
41 StatusCode execute() override;
42 StatusCode finalize() override;
43
44 private:
45
47 // Objects
48
49 // Main logic. For each sector, store a struct that accumulates the track parameters, hit coordinates, etc.
50 std::vector<AccumulateMap> m_sector_cum; // Index by region
51
53 // Handles
54
55 ServiceHandle<ITHistSvc> m_tHistSvc{this,"THistSvc","THistSvc"};
56
58 // Configuration
59
60 Gaudi::Property<std::vector<std::string> > m_fpath {this, "file_path",{},"vector of files to merge"};
61 Gaudi::Property<bool> m_allregion {this, "allregion",false, "Run all regions?"};
62 Gaudi::Property<int> m_region {this, "region", 0, "Region to run"};
63 Gaudi::Property<int> m_nRegions {this, "nbank", 96, "Number of regions"};
64 Gaudi::Property<bool> m_Monitor {this, "Monitor", false, "flag to enable the monitor"};
65
66
68 int m_region_end = 0;
69
70 int m_nFiles = 0;
71 int m_nLayers = 0;
72 int m_nDim = 0;
73 int m_nDim2 = 0;
74
76 // Meta Data
77
78 // Histograms
79 TH1I* m_h_nSector = nullptr;
80 TH1I* m_h_nHit = nullptr;
81 TH1F* m_h_c = nullptr;
82 TH1F* m_h_d = nullptr;
83 TH1F* m_h_phi = nullptr;
84 TH1F* m_h_coto = nullptr;
85 TH1F* m_h_z = nullptr;
86
88 // Helper Functions
89
90 StatusCode bookHistograms();
91 StatusCode copySliceTree(TFile *file);
92 void readFiles();
93 void readTree(TTree *matrix_tree, int region);
94 std::vector<TTree*> createMatrixTrees();
95 void fillMatrixTrees(std::vector<TTree*> const & matrixTrees);
96};
97
98
99#endif // FPGATrackSimMatrixMergeAlgo_h
100
Classes to read/write matrix files event by event.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::vector< AccumulateMap > m_sector_cum
void readTree(TTree *matrix_tree, int region)
virtual ~FPGATrackSimMatrixMergeAlgo()=default
Gaudi::Property< std::vector< std::string > > m_fpath
void fillMatrixTrees(std::vector< TTree * > const &matrixTrees)
std::vector< TTree * > createMatrixTrees()
FPGATrackSimMatrixMergeAlgo(const std::string &name, ISvcLocator *pSvcLocator)
ServiceHandle< ITHistSvc > m_tHistSvc
TFile * file