Skip to content

Commit

Permalink
test: std::vector<HistosDAG>, vector of objects rather than of poin…
Browse files Browse the repository at this point in the history
…ters
  • Loading branch information
c-dilks committed Dec 28, 2023
1 parent eaba00e commit 175643b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions macro/ci/comparator.C
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,14 @@ void comparator(
// - `P0` stores the first infile's DAG, which will be used for execution
// - Dext will store the additional DAGs from other infiles
PostProcessor *P0;
HistosDAG *D;
std::vector<TObject*> test_vector;
// std::vector<HistosDAG*> Dext; // additional DAGs
std::vector<HistosDAG> Dext; // additional DAGs

/*
// get DAGs and binning
for(auto [title,infile] : infiles) {
D = new HistosDAG();
D->BuildFromFile(infile);
auto xBins = D->GetBinSet(gx);
auto yBins = D->GetBinSet(gy);
HistosDAG D;
D.BuildFromFile(infile);
auto xBins = D.GetBinSet(gx);
auto yBins = D.GetBinSet(gy);
if(first) {
first = false;
P0 = new PostProcessor(infile->GetName(),outfile);
Expand Down Expand Up @@ -147,8 +144,8 @@ void comparator(
printf(" bx, by = %d, %d\n",bx,by);
try {
histosArrList.at(0).at(bx).at(by) = H; // first, insert the Histos* of D0
for(auto De : Dext) { // then insert the Histos* of each DAG in Dext
histosArrList.at(++pc).at(bx).at(by) = De->GetPayloadData(NP,true); // "true", since `NP` is not owned by `P0->Op()`
for(auto& De : Dext) { // then insert the Histos* of each DAG in Dext
histosArrList.at(++pc).at(bx).at(by) = De.GetPayloadData(NP,true); // "true", since `NP` is not owned by `P0->Op()`
}
}
catch(const std::out_of_range &e) {
Expand All @@ -174,5 +171,4 @@ void comparator(
P0->Op()->Payload(fillHistosArr);
P0->Execute();
P0->Finish();
*/
};

0 comments on commit 175643b

Please sign in to comment.