Belle II Software
development
Helpers.h
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
#pragma once
9
10
11
namespace
Belle2
{
16
22
template
<
class
T>
23
void
checkResizeClear
(std::vector<T>& vectorToCheck, uint limit)
24
{
25
26
if
(vectorToCheck.capacity() > limit) {
27
B2DEBUG(29,
"Capacity of vector too large, create fresh vector and swap."
);
28
std::vector<T> tmp;
29
std::swap(vectorToCheck, tmp);
30
tmp.clear();
31
}
32
vectorToCheck.clear();
33
vectorToCheck.reserve(limit / 4);
34
}
35
37
}
Belle2::checkResizeClear
void checkResizeClear(std::vector< T > &vectorToCheck, uint limit)
Check capacity of a vector and create a fresh one if capacity too large If the capacity of a std::vec...
Definition
Helpers.h:23
Belle2
Abstract base class for different kinds of events.
Definition
MillepedeAlgorithm.h:17
tracking
ckf
general
utilities
include
Helpers.h
Generated on Mon Sep 1 2025 02:57:56 for Belle II Software by
1.13.2