Commit 6a0df09b authored by Jens Kroeger's avatar Jens Kroeger
Browse files

AnalysisEfficiency: improved how matrix is initialized with zeros

parent 7d7b867e
...@@ -156,13 +156,10 @@ void AnalysisEfficiency::initialise() { ...@@ -156,13 +156,10 @@ void AnalysisEfficiency::initialise() {
hPosDiffPrevTrack_noAssocCluster->GetYaxis()->SetTitle("row difference (non-matched track - prev track) [px]"); hPosDiffPrevTrack_noAssocCluster->GetYaxis()->SetTitle("row difference (non-matched track - prev track) [px]");
// initialize matrix with hit timestamps to all 0: // initialize matrix with hit timestamps to all 0:
std::vector<double> v_row; auto nRows = static_cast<size_t>(m_detector->nPixels().Y());
for(int irow = 0; irow < m_detector->nPixels().Y(); irow++) { // create vector will zeros of length <nRows> auto nCols = static_cast<size_t>(m_detector->nPixels().X());
v_row.push_back(0); std::vector<double> v_row(nRows, 0.); // create vector will zeros of length <nRows>
} prev_hit_ts.assign(nCols, v_row); // use vector v_row to construct matrix
for(int icol = 0; icol < m_detector->nPixels().X(); icol++) { // push back to prev_hits_ts <nCols> times
prev_hit_ts.push_back(v_row);
}
} }
StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) { StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment