ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtCutHEIST.h
Go to the documentation of this file.
1 #ifndef ATCUTHEIST_H
2 #define ATCUTHEIST_H
3 
4 #include <TString.h>
5 #include <TTreeReader.h>
6 #include <TTreeReaderValue.h>
7 
8 #include <HTMcp.h>
9 #include <HTMusicIC.h>
10 
11 #include <map> // for map
12 #include <memory> // for shared_ptr
13 #include <string>
14 
15 class TFile;
16 class TTree;
17 class TCutG;
18 
23 class AtCutHEIST {
24 private:
25  // Tree and reader for HEIST
26  std::shared_ptr<TFile> fFile; //< File containing tree to read
27  TTreeReader fReader;
28  TTreeReaderValue<HTMusicIC> fMusic;
29  TTreeReaderValue<HTMcp> fUsMcp;
30  TTreeReaderValue<HTMcp> fDsMcp;
31 
32  std::shared_ptr<TFile> fCutFile; //< File all cuts availible
33  std::map<std::string, TCutG *> fSpecies;
34 
35  TFile *fOutFile{nullptr}; //< File to save cuts in
36 
37 public:
38  AtCutHEIST(TTree *tree, TString cutFile);
39  AtCutHEIST(TString treeFile, TString cutFile, TString treeName = "E12014");
40 
41  bool AddSpecies(std::string species);
42  void AddAllSpecies();
43  std::string GetSpecies();
44 
45  bool operator()();
46 
47  void SetSaveCuts(TFile *outFile) { fOutFile = outFile; }
48 
49 private:
50  double GetEnergy();
51  double GetToF();
52 };
53 #endif
AtCutHEIST::SetSaveCuts
void SetSaveCuts(TFile *outFile)
Definition: AtCutHEIST.h:47
AtCutHEIST::AddSpecies
bool AddSpecies(std::string species)
Add a species to accept in the cut.
Definition: AtCutHEIST.cxx:40
AtCutHEIST::GetSpecies
std::string GetSpecies()
Definition: AtCutHEIST.cxx:85
AtCutHEIST::AddAllSpecies
void AddAllSpecies()
Definition: AtCutHEIST.cxx:60
AtCutHEIST::operator()
bool operator()()
Definition: AtCutHEIST.cxx:67
AtCutHEIST::AtCutHEIST
AtCutHEIST(TTree *tree, TString cutFile)
Definition: AtCutHEIST.cxx:26
AtCutHEIST
Class for managing PID cuts from HEIST data. Follows the interface required to be passed as a reducti...
Definition: AtCutHEIST.h:23