-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAveragePromptLocation.h
More file actions
148 lines (132 loc) · 3.2 KB
/
Copy pathAveragePromptLocation.h
File metadata and controls
148 lines (132 loc) · 3.2 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#include <array>
#include <fstream>
#include <iostream>
#include <string>
#include "TCanvas.h"
#include "TError.h"
#include "TF1.h"
#include "TFile.h"
#include "TH1F.h"
#include "TLeaf.h"
#include "TTree.h"
#include "TVector2.h"
#include "TVector3.h"
#include "TVectorD.h"
#define pi 3.14159265358979323846
// Invariables
int const xBins = 12;
int const yBins = 9;
int const zBins = 301; // Number of bins for our histograms
int const totalSimLines = 100;
float const zHistogramMax = 150.5; // Maximum value of bin for histogram
float const segmentWidth = 145.7; // Distance between segment centers in mm
float const atmosphericScaling = 1.00025443769309; // Atmosphering scaling coefficient for background subtraction
char const* dataPath = "/home/shay/Documents/PROSPECTData/MC_Data/DS_SEER_MC_HighStats/Period_%s/Period_%s.txt";
char const* dataFileName
= "/home/shay/Documents/PROSPECTData/MC_Data/DS_SEER_MC_HighStats/Period_%s/%s/AD1_IBD_2022_DS_SEER.root";
char const* perfSimPath = "/home/shay/Documents/PROSPECTData/MC_Data/PerfectSimulation/SimFileGoodRunsList.txt";
char const* perfSimFileName = "/home/shay/Documents/PROSPECTData/MC_Data/PerfectSimulation/%s/Jun_Perfect_IBD_2020.root";
// Variables
int lineCounter = 0;
int correlatedxCounts = 0, accidentalxCounts = 0;
int correlatedyCounts = 0, accidentalyCounts = 0;
int correlatedzCounts = 0, accidentalzCounts = 0;
double livetimeOff = 0, livetimeOn = 0;
enum Directions
{
X = 0,
Y,
Z,
DirectionSize
};
enum Signals
{
CorrelatedReactorOn = 0,
CorrelatedReactorOff,
AccidentalReactorOn,
AccidentalReactorOff,
TotalDifference,
SignalSize
};
struct TreeValues
{
double Esmear;
double nCaptTime;
double xRx;
int promptSegment;
int delayedSegment;
int direction;
int period;
double promptPosition;
double delayedPosition;
bool reactorOn;
};
std::string DatasetToString(int num)
{
std::string name;
switch (num)
{
case 0:
name = "Data";
break;
case 1:
name = "Data Unbiased";
break;
case 2:
name = "Simulation";
break;
case 3:
name = "Simulation Unbiased";
break;
case 4:
name = "True";
break;
default:
name = "Data";
}
return name;
}
std::string SignalToString(int num)
{
std::string name;
switch (num)
{
case 0:
name = "Correlated Reactor On";
break;
case 1:
name = "Correlated Reactor Off";
break;
case 2:
name = "Accidental Reactor On";
break;
case 3:
name = "Accidental Reactor Off";
break;
case 4:
name = "Total Difference";
break;
default:
name = "Total Difference";
}
return name;
}
std::string AxisToString(int num)
{
std::string name;
switch (num)
{
case 0:
name = "x";
break;
case 1:
name = "y";
break;
case 2:
name = "z";
break;
default:
name = "x";
}
return name;
}