MCP_Skimmer.h
Go to the documentation of this file.
1 #ifndef MCP_SKIMMER_H
2 #define MCP_SKIMMER_H 1
3 
4 #include <string>
5 
6 #include "TFile.h"
7 #include "TTree.h"
8 
9 #include "Utils.h"
10 
12 {
13 public:
14 
15  /* Default Constructor */
16  MCP_Skimmer();
17 
18  /* Constructor */
19  MCP_Skimmer(std::string infilename, std::string outfilename);
20 
21  /* Default Copy Constructor */
22  MCP_Skimmer(const MCP_Skimmer &) = default;
23 
24  /* Destructor */
25  ~MCP_Skimmer();
26 
27  /* Method to skim the MCPs from the TFile */
28  void SkimMCParticle();
29 
30  /* Method to book the output TFile */
31  bool BookTFile();
32 
33  /* Method to fill the TTree */
34  void FillTTree();
35 
36  /* Method to write the TTree */
37  void WriteTTree();
38 
39  /* Method to close the TFile */
40  void CloseTFile();
41 
42  /* Method to clear the event variables */
43  void ClearVectors();
44 
45  /* Set debug flag */
46  void SetDebug(bool debug) { _debug = debug; }
47 
48 protected:
49 
50 private:
51  TFile* _intfile;
52  TFile* _skimfile;
53  TTree* _skimtree;
54  TTree* _inttree;
55  bool _debug;
59 
60  int _Event;
61  int _SubRun;
62  int _Run;
63 
64  std::vector<float> _MC_Q2;
65  std::vector<float> _MC_W;
66  std::vector<float> _MC_Y;
67  std::vector<float> _MC_X;
68  std::vector<float> _MC_Theta;
69  std::vector<float> _MC_T;
70  std::vector<float> _MCVertX;
71  std::vector<float> _MCVertY;
72  std::vector<float> _MCVertZ;
73  std::vector<float> _MCNuPx;
74  std::vector<float> _MCNuPy;
75  std::vector<float> _MCNuPz;
76  std::vector<int> _NType;
77  std::vector<int> _CCNC;
78  std::vector<int> _Mode;
79  std::vector<int> _Gint;
80  std::vector<int> _TgtPDG;
81  std::vector<int> _GT_T;
82  std::vector<int> _InterT;
83  std::vector<float> _Weight;
84 
85  std::vector<int> _PDG;
86  std::vector<int> _Mother;
87  std::vector<int> _PDGMother;
88  std::vector<int> _MCPTrkID;
89  std::vector<float> _MCPTime;
90  std::vector<float> _MCPStartX;
91  std::vector<float> _MCPStartY;
92  std::vector<float> _MCPStartZ;
93  std::vector<float> _MCPStartPX;
94  std::vector<float> _MCPStartPY;
95  std::vector<float> _MCPStartPZ;
96  std::vector<std::string> _MCPProc;
97  std::vector<std::string> _MCPEndProc;
98  std::vector<float> _MCPEndX;
99  std::vector<float> _MCPEndY;
100  std::vector<float> _MCPEndZ;
101  std::vector<float> _TrajMCPX;
102  std::vector<float> _TrajMCPY;
103  std::vector<float> _TrajMCPZ;
104  std::vector<int> _TrajMCPTrajIndex;
105 
106  //vector of pdg values where we should keep the daughter
107  std::vector<int> daughtersToKeep = {22, 111, 310, 13, 211, 321};
108 };
109 
110 #endif /* MCP_SKIMMER_H */
TTree * _skimtree
Definition: MCP_Skimmer.h:53
std::vector< std::string > _MCPProc
Definition: MCP_Skimmer.h:96
std::vector< float > _MCPStartX
Definition: MCP_Skimmer.h:90
std::vector< float > _MCPEndZ
Definition: MCP_Skimmer.h:100
std::vector< int > _GT_T
Definition: MCP_Skimmer.h:81
std::vector< float > _MCPStartZ
Definition: MCP_Skimmer.h:92
std::vector< int > _Gint
Definition: MCP_Skimmer.h:79
void ClearVectors()
Definition: MCP_Skimmer.cpp:28
TTree * _inttree
Definition: MCP_Skimmer.h:54
std::vector< float > _Weight
Definition: MCP_Skimmer.h:83
std::string string
Definition: nybbler.cc:12
std::vector< float > _MCPStartPZ
Definition: MCP_Skimmer.h:95
void WriteTTree()
void CloseTFile()
void SetDebug(bool debug)
Definition: MCP_Skimmer.h:46
void FillTTree()
std::vector< float > _MCNuPy
Definition: MCP_Skimmer.h:74
std::vector< float > _TrajMCPY
Definition: MCP_Skimmer.h:102
std::vector< int > _MCPTrkID
Definition: MCP_Skimmer.h:88
std::vector< float > _MCPTime
Definition: MCP_Skimmer.h:89
std::vector< float > _MCPStartY
Definition: MCP_Skimmer.h:91
std::vector< float > _MCVertY
Definition: MCP_Skimmer.h:71
std::vector< float > _TrajMCPX
Definition: MCP_Skimmer.h:101
std::vector< int > _TrajMCPTrajIndex
Definition: MCP_Skimmer.h:104
std::vector< float > _TrajMCPZ
Definition: MCP_Skimmer.h:103
std::vector< float > _MCPEndX
Definition: MCP_Skimmer.h:98
std::vector< float > _MC_Y
Definition: MCP_Skimmer.h:66
std::vector< float > _MCPEndY
Definition: MCP_Skimmer.h:99
std::vector< int > _Mode
Definition: MCP_Skimmer.h:78
std::vector< int > daughtersToKeep
Definition: MCP_Skimmer.h:107
std::vector< float > _MC_T
Definition: MCP_Skimmer.h:69
std::vector< float > _MCPStartPX
Definition: MCP_Skimmer.h:93
bool BookTFile()
void SkimMCParticle()
Definition: MCP_Skimmer.cpp:73
std::vector< int > _InterT
Definition: MCP_Skimmer.h:82
std::vector< std::string > _MCPEndProc
Definition: MCP_Skimmer.h:97
TFile * _skimfile
Definition: MCP_Skimmer.h:52
std::vector< int > _NType
Definition: MCP_Skimmer.h:76
TFile * _intfile
Definition: MCP_Skimmer.h:51
std::vector< float > _MC_W
Definition: MCP_Skimmer.h:65
std::vector< int > _TgtPDG
Definition: MCP_Skimmer.h:80
std::vector< float > _MCVertX
Definition: MCP_Skimmer.h:70
std::string _outfile
Definition: MCP_Skimmer.h:58
Utils * _util
Definition: MCP_Skimmer.h:56
std::vector< int > _PDG
Definition: MCP_Skimmer.h:85
std::vector< int > _Mother
Definition: MCP_Skimmer.h:86
std::vector< float > _MC_X
Definition: MCP_Skimmer.h:67
std::vector< float > _MC_Theta
Definition: MCP_Skimmer.h:68
Definition: Utils.h:7
std::vector< float > _MCNuPz
Definition: MCP_Skimmer.h:75
std::vector< int > _PDGMother
Definition: MCP_Skimmer.h:87
std::vector< float > _MC_Q2
Definition: MCP_Skimmer.h:64
std::vector< float > _MCVertZ
Definition: MCP_Skimmer.h:72
std::vector< float > _MCNuPx
Definition: MCP_Skimmer.h:73
std::vector< float > _MCPStartPY
Definition: MCP_Skimmer.h:94
std::string _infile
Definition: MCP_Skimmer.h:57
std::vector< int > _CCNC
Definition: MCP_Skimmer.h:77