7 vector<DetGroup>&&
one, vector<DetGroup>&& two, std::vector<DetGroup>&
result,
int firstIndex,
int firstCrossed) {
8 if (
one.empty() && two.empty())
13 if (firstIndex == firstCrossed)
14 incrementAndDoubleSize(result);
16 doubleIndexSize(result);
17 }
else if (two.empty()) {
19 if (firstIndex == firstCrossed)
20 doubleIndexSize(result);
22 incrementAndDoubleSize(result);
24 if (firstIndex == firstCrossed)
32 result.reserve(
one.size() + two.size());
34 int indSize1 =
one.front().indexSize();
35 int indSize2 = two.front().indexSize();
37 for (
auto&& dg :
one) {
39 result.back().setIndexSize(indSize1 + indSize2);
41 for (
auto&& dg : two) {
43 result.back().incrementIndex(indSize1);
48 for (
auto&& ig : gvec) {
49 int gSize = ig.indexSize();
50 int index = ig.index();
52 for (vector<DetGroup>::iterator
ires = result.begin();
ires != result.end();
ires++) {
53 int resSize =
ires->indexSize();
54 if (gSize != resSize) {
55 LogDebug(
"TkDetLayers") <<
"DetGroupMerger::addSameLevel called with groups of different index sizes";
59 int resIndex =
ires->index();
60 if (index == resIndex) {
61 ires->insert(
ires->end(), ig.begin(), ig.end());
64 }
else if (index < resIndex) {
66 result.insert(
ires, ig);
72 result.insert(result.end(), ig);
77 int indSize = vec.front().indexSize();
78 for (vector<DetGroup>::iterator
i = vec.begin();
i != vec.end();
i++) {
79 i->setIndexSize(2 * indSize);
84 int indSize = vec.front().indexSize();
85 for (vector<DetGroup>::iterator
i = vec.begin();
i != vec.end();
i++) {
86 i->incrementIndex(indSize);
static void incrementAndDoubleSize(std::vector< DetGroup > &vec)
static void mergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result)
static void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
static void doubleIndexSize(std::vector< DetGroup > &vec)
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)