susy_cfa  b611ccad937ea179f86a1f5663960264616c0a20
event_handler.cpp
Go to the documentation of this file.
1 // event_handler: main class for reduced tree production
2  //File generated with generate_small_tree.exe
3 
4 #include "event_handler.hpp"
5 
6 #include <typeinfo>
7 #include <string>
8 
9 #include "TString.h"
10 
11 #include "event_handler_base.hpp"
12 
13 #include "event_handler_quick.hpp"
14 using namespace std;
15 
16 #include "event_handler_base.hpp"
17 
18 #include "event_handler_quick.hpp"
19 event_handler::event_handler(const string &file_name, const string &type):
20  ehb(LookUpType(file_name, type)){
21 }
22 
23 void event_handler::ReduceTree(int num_entries, const TString &out_file_name, int num_total_entries){
24  ehb->ReduceTree(num_entries, out_file_name, num_total_entries);
25 }
26 
27 event_handler_base * event_handler::LookUpType(const string &file_name, const string &type){
28  if(type == "quick"){
29  return new event_handler_quick(file_name);
30  }else{
31  return NULL;
32  }
33 }
34 
36  return ehb->TotalEntries();
37 }
38 
40  return ehb->GetVersion();
41 }
42 
43 const std::string& event_handler::SampleName() const{
44  return ehb->SampleName();
45 }
46 
47 const std::string& event_handler::SampleName(const std::string &sample_name){
48  return ehb->SampleName(sample_name);
49 }
50 
51 void event_handler::SetFile(const std::string &file, bool is_8TeV){
52  ehb->SetFile(file, is_8TeV);
53 }
54 
55 void event_handler::AddFiles(const std::string &file){
56  ehb->AddFiles(file);
57 }
58 
60  if(ehb){
61  delete ehb;
62  ehb = NULL;
63  }
64 }
65 
const std::string & SampleName() const
Definition: cfa.cpp:31
static event_handler_base * LookUpType(const std::string &file_name, const std::string &type)
void AddFiles(const std::string &file)
Definition: cfa.cpp:44
long TotalEntries() const
STL namespace.
void SetFile(const std::string &file, bool is_8TeV=false)
const std::string & SampleName() const
virtual void ReduceTree(int num_entries, const TString &out_file_name, int num_total_entries)=0
event_handler_base * ehb
short GetVersion() const
Definition: cfa.cpp:27
void SetFile(const std::string &file, bool is_8TeV=false)
Definition: cfa.cpp:39
event_handler(const std::string &file_name, const std::string &type)
void AddFiles(const std::string &file)
short GetVersion() const
void ReduceTree(int num_entries, const TString &out_file_name, int num_total_entries)
long TotalEntries() const
Definition: cfa.cpp:19