TTTT Analysis  0.1
dataset.hpp
1 #ifndef dataset_hpp
2 #define dataset_hpp
3 #include <iostream>
4 #include "value.hpp"
5 #include "container.hpp"
6 
7 namespace filval{
8 class DataSet{
9  private:
10  void summary(){
11  GenValue::summary();
12  }
13  protected:
14  ContainerSet containers;
15  virtual bool load_next() = 0;
16  virtual int get_events() = 0;
17  virtual int get_current_event() = 0;
18  public:
19  void process(){
20  int events, current_event;
21  summary();
22  events = get_events();
23  std::cout << std::endl;
24  while( load_next() ){
25  current_event = get_current_event();
26  std::cout << "\rprocessing event: " << current_event+1 << "/" << events << std::flush;
27  GenValue::reset();
28  for(auto con : containers){
29  /* std::cout << std::endl << "Filling container: " << con.first; */
30  con.second->fill();
31  }
32  /* std::cout << std::endl; */
33  }
34  std::cout << " Finished!" << std::endl;
35  }
36 
37  void add_container(GenContainer *container){
38  containers[container->get_name()] = container;
39  }
40  GenContainer* get_container(std::string container_name){
41  return containers.at(container_name);
42  }
43 };
44 }
45 #endif // dataset_hpp
The namespace containing all filval classes and functions.
Definition: container.hpp:7
Definition: container.hpp:8
Definition: dataset.hpp:8