Why the result is different with df001_introduction?


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: 6.30
Platform: win10
Compiler: vc++


df0001.cpp (1.1 KB)


Hi,

Thanks for the intriguing post!
I add in the loop @mczurylo who can perhaps shed light.
I tend to exclude bugs in RDF.

Could you please share with us the exact version of ROOT you are using?

Best,
Danilo

6.30.04

Hi @songshusen,

it is a simple typo in your code - you’ve changed the filter from < 5. in original tutorial to < 10. in your version (line 31 in your cpp).

Cheers,
Marta

I have copy the tutorial and no changed, the result is differet too.
You can run my code to affirm.


df001.cpp (7.9 KB)

Hi @songshusen,

I cannot reproduce your problem - for me both results are the same. I am using version 6.30.04 on a Macbook. Which OS are you using and how have you installed ROOT?

What I do step by step is:

1. g++ -o test df001.cpp `root-config --cflags --libs` 
2. ./test
OUTPUT: 
2 entries passed all filters
5 entries passed the string filter
The mean is always included between the min and the max: 1 <= 2 <= 3
Selected b1 entries
0 1 2 3 4 
The type of b1Vec is vector<double>
Filled h 5 times, mean: 2
Filled h with 5 entries
Events passing cutb1: 5
Events passing cutb1b2: 2
Events passing both: 2
8
8
Entry: 0 Slot: 0
Entry: 1 Slot: 0
Entry: 2 Slot: 0
Entry: 3 Slot: 0
Entry: 4 Slot: 0
Entry: 5 Slot: 0
Entry: 6 Slot: 0
Entry: 7 Slot: 0
Entry: 8 Slot: 0
Entry: 9 Slot: 0

and when I run the tutorial:

1. root df001_introduction.C
OUTPUT: 
2 entries passed all filters
5 entries passed the string filter
The mean is always included between the min and the max: 1 <= 2 <= 3
Selected b1 entries
0 1 2 3 4 
The type of b1Vec is vector<double>
Filled h 5 times, mean: 2
Filled h with 5 entries
Events passing cutb1: 5
Events passing cutb1b2: 2
Events passing both: 2
8
8
Entry: 0 Slot: 0
Entry: 1 Slot: 0
Entry: 2 Slot: 0
Entry: 3 Slot: 0
Entry: 4 Slot: 0
Entry: 5 Slot: 0
Entry: 6 Slot: 0
Entry: 7 Slot: 0
Entry: 8 Slot: 0
Entry: 9 Slot: 0

Cheers,
Marta

I am using version 6.30.04.
My OS is windows 10.
I download the win64 exe to install.
root_v6.30.04.win64.vc17.exe

Thanks for the information @songshusen!

@bellenot could you please try to reproduce this problem on Windows?

Cheers,
Marta

I can reproduce the problem with ROOT master on Windows:

Processing df001.cpp...
1 entries passed all filters
4 entries passed the string filter
The mean is always included between the min and the max: 2 <= 2 <= 2
Selected b1 entries
1 2 3 4
The type of b1Vec is vector<double>
Filled h 4 times, mean: 2.5
Filled h with 5 entries
Events passing cutb1: 4
Events passing cutb1b2: 1
Events passing both: 1
8
8
Entry: 0 Slot: 0
Entry: 1 Slot: 0
Entry: 2 Slot: 0
Entry: 3 Slot: 0
Entry: 4 Slot: 0
Entry: 5 Slot: 0
Entry: 6 Slot: 0
Entry: 7 Slot: 0
Entry: 8 Slot: 0
Entry: 9 Slot: 0

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.