Trivial PHENIX analysis example
I used a utility which creates you a data file with 100 or so Events. Each event holds exactly (only) one packet with Id 1001.
# include <fileEventiterator.h>
int main(int argc, char *argv[])
cout << "Usage: " << argv[0] << " filename" << endl;
new fileEventiterator (argv[1], status);
cout << "Couldn't open input file " << argv[1] << endl;
while ( evt = it->getNextEvent() )
And that’s a scan utility which browses through the files and displays the events in there.
The highlighted lines are the essential ones which get you event objects from the file.
You are not exposed to all the mechanics of that process, you just use services provided by objects.
$ ./fileread file.evt | more
-- Event 1 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 2 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 3 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 4 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 5 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 6 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 7 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 8 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 9 Run: 198 length: 222 frames: 1 type: 1 (Data Event)
-- Event 10 Run: 198 length: 222 frames: 1 type: 1 (Data Event)