Skip to content

Commit 8254eb0

Browse files
committed
Add one more nesting level for the test for issue #8428
1 parent b5dc6af commit 8254eb0

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

root/tree/evolution/split/execCreateFileFullObjRule.cxx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ class Holder {
2626
Middle mid;
2727
};
2828

29+
struct Momentum {
30+
SomeVector pp;
31+
double ee = 5;
32+
};
33+
2934
struct StepPointMC {
3035
SomeVector position;
3136
SomeVector postPosition;
32-
SomeVector momentum;
37+
Momentum momentum;
3338
SomeVector postMomentum;
3439
};
3540

@@ -40,6 +45,7 @@ struct StepPointVector {
4045
#ifdef __ROOTCLING__
4146
#pragma link C++ options=version(11) class SomeVector+;
4247
#pragma link C++ class Middle+;
48+
#pragma link C++ class Momentum+;
4349
#pragma link C++ class Holder+;
4450
#pragma link C++ class VecHolder+;
4551
#pragma link C++ class StepPointMC+;
@@ -66,7 +72,8 @@ void writefile(int splitlevel = 9)
6672
std::vector<StepPointMC> stepvec;
6773
mc.position = SomeVector{1.25, 2.5, 5, 1};
6874
mc.postPosition = SomeVector{2.5, 5, 10, 2};
69-
mc.momentum = SomeVector{3.75, 7.5, 15, 3};
75+
mc.momentum.pp = SomeVector{3.75, 7.5, 15, 3};
76+
mc.momentum.ee = 66;
7077
mc.postMomentum = SomeVector{5, 10, 20, 4};
7178
step.vec.push_back(mc);
7279
mc.postMomentum = SomeVector{15, 20, 30, 5};

root/tree/evolution/split/execReadFileFullObjRule.cxx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ class Holder {
2828
Middle mid;
2929
};
3030

31+
struct Momentum {
32+
SomeVector pp;
33+
double ee = -1;
34+
};
35+
3136
struct StepPointMC {
3237
SomeVector position;
3338
SomeVector postPosition;
34-
SomeVector momentum;
39+
Momentum momentum;
3540
SomeVector postMomentum;
3641
};
3742

@@ -43,6 +48,7 @@ struct StepPointVector {
4348
#ifdef __ROOTCLING__
4449
#pragma link C++ options=version(12) class SomeVector+;
4550
#pragma link C++ class Middle+;
51+
#pragma link C++ class Momentum+;
4652
#pragma link C++ class Holder+;
4753
#pragma link C++ class VecHolder+;
4854
#pragma link C++ class StepPointMC+;
@@ -90,10 +96,12 @@ std::ostream &operator<<(std::ostream &os, const StepPointMC &s)
9096
for(auto &d : s.postPosition.data)
9197
format(os) << d << ", ";
9298
format(os) << s.postPosition.h;
93-
os << "}\nmomentum: {";
94-
for(auto &d : s.momentum.data)
99+
os << "}\nmomentum: {{";
100+
for(auto &d : s.momentum.pp.data)
95101
format(os) << d << ", ";
96-
format(os) << s.momentum.h;
102+
format(os) << s.momentum.pp.h;
103+
os << "}, ";
104+
format(os) << s.momentum.ee;
97105
os << "}\npostMomentum: {";
98106
for(auto &d : s.postMomentum.data)
99107
format(os) << d << ", ";
@@ -122,7 +130,7 @@ int check(const StepPointMC &step, std::vector<std::vector<double>> values)
122130
{
123131
int result = check(step.position, values[0]);
124132
result = check(step.position, values[1]) + result;
125-
result = check(step.momentum, values[2]) + result;
133+
result = check(step.momentum.pp, values[2]) + result;
126134
result = check(step.postMomentum, values[3]) + result;
127135
//fprintf(stderr, "result = %d\n", result);
128136
return result;

root/tree/evolution/split/execReadFileFullObjRule.ref

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ Read Vector:
2222
Read SetPointMC vector:
2323
position: { 1.25, 2.50, 5.00, 1.00}
2424
postPosition: { 2.50, 5.00, 10.00, 2.00}
25-
momentum: { 3.75, 7.50, 15.00, 3.00}
25+
momentum: {{ 3.75, 7.50, 15.00, 3.00}, 66.00}
2626
postMomentum: { 5.00, 10.00, 20.00, 4.00}
2727
Read SetPointMC vector without dot:
2828
position: { 1.25, 2.50, 5.00, 1.00}
2929
postPosition: { 2.50, 5.00, 10.00, 2.00}
30-
momentum: { 3.75, 7.50, 15.00, 3.00}
30+
momentum: {{ 3.75, 7.50, 15.00, 3.00}, 66.00}
3131
postMomentum: { 5.00, 10.00, 20.00, 4.00}
3232
Read SetPointMC direct vector:
3333
position: { 1.25, 2.50, 5.00, 1.00}
3434
postPosition: { 2.50, 5.00, 10.00, 2.00}
35-
momentum: { 3.75, 7.50, 15.00, 3.00}
35+
momentum: {{ 3.75, 7.50, 15.00, 3.00}, 66.00}
3636
postMomentum: {15.00, 20.00, 30.00, 5.00}
3737
Read SetPointMC direct vector without dot:
3838
position: { 1.25, 2.50, 5.00, 1.00}
3939
postPosition: { 2.50, 5.00, 10.00, 2.00}
40-
momentum: { 3.75, 7.50, 15.00, 3.00}
40+
momentum: {{ 3.75, 7.50, 15.00, 3.00}, 66.00}
4141
postMomentum: {15.00, 20.00, 30.00, 5.00}
4242
(int) 0

0 commit comments

Comments
 (0)