20 m_acc(nLayers, nCoords),
27 tree->SetBranchAddress(
"sectorID",
m_acc.FTK_modules.data());
30 tree->SetBranchAddress(
"tmpC", &
m_acc.pars.qOverPt);
31 tree->SetBranchAddress(
"tmpD", &
m_acc.pars.d0);
32 tree->SetBranchAddress(
"tmpPhi", &
m_acc.pars.phi);
33 tree->SetBranchAddress(
"tmpCoto", &
m_acc.pars.eta);
34 tree->SetBranchAddress(
"tmpZ", &
m_acc.pars.z0);
36 tree->SetBranchAddress(
"Vec",
m_acc.hit_coords.data());
37 tree->SetBranchAddress(
"VecG",
m_acc.hit_coordsG.data());
38 tree->SetBranchAddress(
"tmpxC",
m_acc.hit_x_QoP.data());
39 tree->SetBranchAddress(
"tmpxGC",
m_acc.hit_xG_HIP.data());
40 tree->SetBranchAddress(
"tmpxD",
m_acc.hit_x_d0.data());
41 tree->SetBranchAddress(
"tmpxPhi",
m_acc.hit_x_phi.data());
42 tree->SetBranchAddress(
"tmpxCoto",
m_acc.hit_x_eta.data());
43 tree->SetBranchAddress(
"tmpxGCoto",
m_acc.hit_xG_eta.data());
44 tree->SetBranchAddress(
"tmpxZ",
m_acc.hit_x_z0.data());
45 tree->SetBranchAddress(
"tmpcovx",
m_acc.covariance.data());
46 tree->SetBranchAddress(
"tmpcovxG",
m_acc.covarianceG.data());
50 tree->SetBranchAddress(
"tmpintd0", &
m_pd0);
51 tree->SetBranchAddress(
"tmpintz0", &
m_pz0);
60 m_acc.track_bins.clear();
95 while (reader.nextEntry())
96 accumulate(
map, reader.getModules(), reader.getAccumulator());
113 while (reader.nextEntry())
114 matrices.push_back({ reader.getModules(), reader.getAccumulator() });
146 m_tree->Branch(
"sectorID", &anInt,
"sectorID[nplanes]/I");
147 m_tree->Branch(
"hashID", &anInt,
"hashID[nplanes]/I");
149 m_tree->Branch(
"tmpC", &aDouble,
"tmpC/D");
150 m_tree->Branch(
"tmpD", &aDouble,
"tmpD/D");
151 m_tree->Branch(
"tmpPhi", &aDouble,
"tmpPhi/D");
152 m_tree->Branch(
"tmpCoto", &aDouble,
"tmpCoto/D");
153 m_tree->Branch(
"tmpZ", &aDouble,
"tmpZ/D");
155 m_tree->Branch(
"Vec", &aFloat,
"Vec[ndim]/F");
156 m_tree->Branch(
"VecG", &aFloat,
"VecG[ndim]/F");
157 m_tree->Branch(
"tmpxC", &aDouble,
"tmpxC[ndim]/D");
158 m_tree->Branch(
"tmpxGC", &aDouble,
"tmpxGC[ndim]/D");
159 m_tree->Branch(
"tmpxD", &aDouble,
"tmpxD[ndim]/D");
160 m_tree->Branch(
"tmpxPhi", &aDouble,
"tmpxPhi[ndim]/D");
161 m_tree->Branch(
"tmpxCoto", &aDouble,
"tmpxCoto[ndim]/D");
162 m_tree->Branch(
"tmpxGCoto", &aDouble,
"tmpxGCoto[ndim]/D");
163 m_tree->Branch(
"tmpxZ", &aDouble,
"tmpxZ[ndim]/D");
164 m_tree->Branch(
"tmpcovx", &aDouble,
"tmpcovx[ndim2]/D");
165 m_tree->Branch(
"tmpcovxG", &aDouble,
"tmpcovxG[ndim2]/D");
178 m_tree->SetBranchAddress(
"sectorID", acc.FTK_modules.data());
179 m_tree->SetBranchAddress(
"hashID", modules.data());
181 m_tree->SetBranchAddress(
"tmpC", &acc.pars.qOverPt);
182 m_tree->SetBranchAddress(
"tmpD", &acc.pars.d0);
183 m_tree->SetBranchAddress(
"tmpPhi", &acc.pars.phi);
184 m_tree->SetBranchAddress(
"tmpCoto", &acc.pars.eta);
185 m_tree->SetBranchAddress(
"tmpZ", &acc.pars.z0);
187 m_tree->SetBranchAddress(
"Vec", acc.hit_coords.data());
188 m_tree->SetBranchAddress(
"VecG", acc.hit_coordsG.data());
189 m_tree->SetBranchAddress(
"tmpxC", acc.hit_x_QoP.data());
190 m_tree->SetBranchAddress(
"tmpxGC", acc.hit_xG_HIP.data());
191 m_tree->SetBranchAddress(
"tmpxD", acc.hit_x_d0.data());
192 m_tree->SetBranchAddress(
"tmpxPhi", acc.hit_x_phi.data());
193 m_tree->SetBranchAddress(
"tmpxCoto", acc.hit_x_eta.data());
194 m_tree->SetBranchAddress(
"tmpxGCoto", acc.hit_xG_eta.data());
195 m_tree->SetBranchAddress(
"tmpxZ", acc.hit_x_z0.data());
196 m_tree->SetBranchAddress(
"tmpcovx", acc.covariance.data());
197 m_tree->SetBranchAddress(
"tmpcovxG", acc.covarianceG.data());
212 m_coverage =
static_cast<float>(acc.track_bins.size());
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
std::unordered_map< std::vector< module_t >, FPGATrackSimMatrixAccumulator, container_hash< std::vector< module_t > > > AccumulateMap
void readTree(AccumulateMap &map, TTree *tree, size_t nLayers, size_t nCoords)
Reads a matrix tree, accumulating its entries into a map.
void fillTree(AccumulateMap &map, TTree *tree, int nLayers, int nCoords)
Writes the contents of an AccumulateMap into the supplied tree (one entry per sector).
Classes to read/write matrix files event by event.
static const std::vector< std::string > bins
TGraphErrors * GetEntries(TH2F *histo)
FPGATrackSimMatrixAccumulator m_acc
std::vector< short > * m_pz0
std::vector< module_t > m_modules
FPGATrackSimMatrixReader(TTree *tree, size_t nLayers, size_t nCoords)
std::vector< short > m_bins_QoP
std::vector< short > m_bins_phi
std::vector< short > * m_pphi
std::vector< short > m_bins_eta
std::vector< short > m_bins_z0
std::vector< short > * m_peta
std::vector< short > m_bins_d0
std::vector< short > * m_pQoP
std::vector< short > * m_pd0
void readEntry(size_t entry)
std::vector< short > m_bins_d0
std::vector< short > m_bins_eta
std::vector< short > m_bins_z0
std::vector< short > * m_peta
std::vector< short > m_bins_phi
FPGATrackSimMatrixWriter(TTree *tree, int nLayers, int nCoords)
std::vector< short > * m_pz0
std::vector< short > m_bins_QoP
std::vector< short > * m_pd0
std::vector< short > * m_pphi
std::vector< short > * m_pQoP
size_t fill(std::vector< module_t > modules, FPGATrackSimMatrixAccumulator &acc)