-
Notifications
You must be signed in to change notification settings - Fork 1
/
MCSUnfolding.h
117 lines (94 loc) · 2.91 KB
/
MCSUnfolding.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include <stdlib.h>
#include <string>
#include <vector>
// This is what we are here for
#include "RooUnfold.h"
#include "RooUnfoldResponse.h"
#include "RooUnfoldBayes.h"
// Standard ROOT stuff
#include "TCanvas.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TFile.h"
#include "TTree.h"
#include "TChain.h"
#include "TGraph.h"
#include "TFileInfo.h"
#include "TSystem.h"
#include "TString.h"
// Read directly from the MAUS data structure.
#include "src/common_cpp/DataStructure/TOFEvent.hh"
#include "src/common_cpp/DataStructure/SciFiEvent.hh"
#include "src/common_cpp/DataStructure/SciFiTrack.hh"
#include "src/common_cpp/DataStructure/SciFiTrackPoint.hh"
#include "src/common_cpp/DataStructure/SciFiSpacePoint.hh"
#include "src/common_cpp/DataStructure/KLEvent.hh"
#include "src/common_cpp/DataStructure/CkovEvent.hh"
#include "src/common_cpp/DataStructure/EMREvent.hh"
#include "src/common_cpp/DataStructure/MCEvent.hh"
#include "src/common_cpp/DataStructure/VirtualHit.hh"
#include "src/common_cpp/DataStructure/Primary.hh"
#include "src/common_cpp/DataStructure/Spill.hh"
#include "src/common_cpp/DataStructure/Data.hh"
#include "src/common_cpp/JsonCppStreamer/IRStream.hh"
// And my own home brew object collection.
#include "Collection.h"
class MCSAnalysis {
public:
MCSAnalysis(std::string tree, std::string mctree, std::string outname);
~MCSAnalysis() {};
void Write();
TFileInfo* GetFileInfo(){ return fileinfo;}
TChain* GetTree(){ return chain; }
TChain* GetMCTree(){ return mcchain; }
TChain* GetMCEmptyTree(){ return mcemptychain; }
void Execute();
void dataSelection();
void generateMCSResponse();
void DoUnfolding();
private:
int jUS, jDS, kUS, kDS;
long double TOF_lower_limit;
long double TOF_upper_limit;
double meanp;
double sigmap;
double USrefplaneZ;
double DSrefplaneZ;
int USrefplaneI;
int DSrefplaneI;
Collection _USset;
Collection _DSset;
RooUnfoldResponse resp_thetaX;
RooUnfoldResponse resp_thetaY;
RooUnfoldResponse resp_thetaScatt;
int USabsPlaneI;
int DSabsPlaneI;
// Chain containing only the data of interest (not necessarily MC).
TChain* chain;
// Training tree containing the response to the volume of interest
TChain* mcchain;
TFileInfo* fileinfo;
MAUS::TOFEvent* tofevent;
MAUS::SciFiEvent* scifievent;
MAUS::KLEvent* klevent;
MAUS::CkovEvent* ckovevent;
MAUS::EMREvent* emrevent;
MAUS::MCEvent* mcevent;
MAUS::Primary* primary;
MAUS::SpecialVirtualHitArray* sphitarray;
TFile* outfile;
TH1D* tof10;
TH1D* tof10_sel;
TH1D* tof21;
t
TH1D* tof21_sel;
TH1D* calc_mom;
bool MatchUSDS();
bool PIDSelection();
double MomentumFromTOF();
void findVirtualPlanes();
void FillMCSResponse(bool event_ok, Vars& US, Vars& DS, Vars& USMC, Vars& DSMC);
void FillVarsVirtual(Vars& tmpvar, int j);
void FillCollectionSciFi(Collection& Set, int j, int k);
void FillVarsSciFi(Vars& tmpvar, int j, int k);
};