HepMC3 event record library
testRoot300.cc
1 // -*- C++ -*-
2 //
3 // This file is part of HepMC
4 // Copyright (C) 2014-2019 The HepMC collaboration (see AUTHORS for details)
5 //
6 #include "HepMC3/GenEvent.h"
7 #include "HepMC3/ReaderRoot.h"
8 using namespace HepMC3;
9 int main()
10 {
11  ReaderRoot inputA("inputRoot300.root");
12  if(inputA.failed()) return 1;
13  int particles=0;
14  while( !inputA.failed() )
15  {
16  GenEvent evt(Units::GEV,Units::MM);
17  inputA.read_event(evt);
18  if( inputA.failed() ) {
19  printf("End of file reached. Exit.\n");
20  break;
21  }
22  particles+=evt.particles().size();
23  evt.clear();
24  }
25  inputA.close();
26  return (particles!=1200);
27 }
Definition of class ReaderRoot.
Stores event-related information.
Definition: GenEvent.h:41
int main(int argc, char **argv)
Definition of class GenEvent.
GenEvent I/O parsing and serialization for root files.
Definition: ReaderRoot.h:32