All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HistoList.cc
Go to the documentation of this file.
1 #include "HistoList.h"
2 #include "TH1.h"
3 #include "TDirectory.h"
4 
5 namespace ana {
6 
7  namespace SBNOsc {
8 
10  for (unsigned i = 0; i < fAllHistos.size(); i++) {
11  fLocations[i]->cd();
12  fAllHistos[i]->Write();
13  }
14 }
15 
16 void HistoList::Scale(double scale) {
17  for (TH1 *hist: fAllHistos) hist->Scale(scale);
18 }
19 
20 void HistoList::StoreHisto(TH1 *hist) {
21  fAllHistos.push_back(hist);
22  fLocations.push_back(gDirectory);
23 }
24 
25 void HistoList::Add(const HistoList &other) {
26  for (unsigned i = 0; i < fAllHistos.size(); i++) {
27  fAllHistos[i]->Add(other.fAllHistos[i]);
28  }
29 }
30 
31 void HistoList::Merge(const HistoList &merge) {
32  for (unsigned i = 0; i < merge.fAllHistos.size(); i++) {
33  fAllHistos.push_back(merge.fAllHistos[i]);
34  fLocations.push_back(merge.fLocations[i]);
35  }
36 }
37  }
38 }
std::vector< TH1 * > fAllHistos
Definition: HistoList.h:34
std::vector< TDirectory * > fLocations
Definition: HistoList.h:35
void Scale(double scale)
Definition: HistoList.cc:16
process_name opflashCryoW ana
void StoreHisto(TH1 *histo)
Definition: HistoList.cc:20
void Merge(const HistoList &merge)
Definition: HistoList.cc:31
void Add(const HistoList &other)
Definition: HistoList.cc:25