Skip to content

Commit

Permalink
fix const correctness in lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
tevans committed Jan 22, 2024
1 parent 87a7da1 commit 4cc468c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ template <> std::tuple<std::vector<TH1D*>, THStack*> Projection::projInternal(co
for( unsigned j = 0 ; j != weights.size(); ++j ) hists[j]->Fill( pos, evt.weight() * weights[j] / evt.genPdf() );
}
std::sort( std::begin(hists), std::end(hists), [](auto& h1, auto& h2){ return h1->Integral() < h2->Integral() ; } );
double total = std::accumulate( std::begin(hists), std::end(hists), 0.0, [](double& t, auto& h){ return t + h->Integral() ; } );
double total = std::accumulate( std::begin(hists), std::end(hists), 0.0, [](const double& t, const auto& h){ return t + h->Integral() ; } );

if( norm_sum != -1 )
{
Expand Down

0 comments on commit 4cc468c

Please sign in to comment.