-
Notifications
You must be signed in to change notification settings - Fork 1
/
optimusPrime.h
190 lines (155 loc) · 4.9 KB
/
optimusPrime.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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#ifndef OPTIMUS_H
#define OPTIMUS_H
#define CINTMODE
#include "fqProcessedEvent.h"
#include "mcLargeArray.h"
#include "randomList.h"
#include "TH2FV.h"
#include "TMath.h"
#include "TFile.h"
#include "TChain.h"
#include "TGraph2D.h"
#include "TCanvas.h"
#include "eventSelectors.h"
#include "moreUncertainties.h"
#include "mcmcApply.h"
#include <exception>
#include "TTree.h"
#include "THStack.h"
#include "TRandom2.h"
#include "TPaveText.h"
#include "defineSmall.C"
#include "atmFitPars.h"
#include "stats.C"
#include "smartPlot.C"
#include "summaryPlots.h"
#include <iostream>
#include <algorithm>
#define PRINTSUMMARY
#define NFOMBINSMAX 100
double EnuBinningMuonTh23[] = {0.,2000.};
int EnuNBinsMuonTh23 = 1;
double EnuBinningMuondM2[] = {0.,600.,2000.};
int EnuNBinsMuondM2 = 2;
double EnuBinningElectron[] = {0.,1250.};
int EnuNBinsElectron = 1;
////////////////////////////////////////
// Class to choose FV optimal point
class optimusPrime{
public:
// constructor
optimusPrime(TChain* t2kmc,
int nevents,
const char* datadir,
const char* nuefile,
const char* numufil,
const char* nue1rpifile);
// vars
TChain* chmc; //< T2K MC events
fqProcessedEvent* mcevent; //< individual event values
int nevents; //< total number of events to use
randomList* eventlist; //< random sampling of events if we don't want to use all
mcLargeArray* fastevents; //< very large array for all T2K FC events
moreUncertainties* uncertaintyCalculator; //< can calculate addtional uncertainties from entering bg, ect.
// separate for each:
TString UncMapFileNameNuE;
TString UncMapFileNameNuMu;
TString UncMapFileNameNuE1RPi;
moreUncertainties* uncNuE;
moreUncertainties* uncNuE1RPi;
moreUncertainties* uncNuMu;
mcmcApply* modifier; //< applies atm fit pars to a given event
fqcutparams cutPars; //< cut parameters structure defined in eventSelectors.h
// TString mcmcParFileName;
TString cardFileName;
TString pltTag;
TString outDir;
summaryPlots* plots;
summaryPlots* plots1;
summaryPlots* plots2;
TPaveText* txtSummary;
// TRandom2* randy();
TH2FV* hFV;
TH2FV* hFVMask;
TH2FV* hFVMaskSg;
TH2FV* hFVMaskBg;
TH2FV* hDeltaSg;
TH2FV* hDeltaBg;
TH2FV* hDelta;
TGraph2D* grDelta;
TH2FV* hFVAvg;
TH2FV* hFVAll;
TH1D* hErecSeedNuMudM2;
TH1D* hErecSeedNuMuTh23;
TH1D* hErecSeedNuE;
TH1D* hErec[10];
TH2FV* hFVSummary[8];
TH1D* hSummary[20];
TH1D* hCurve;
TCanvas* multiPad;
TCanvas* canPad;
THStack* hs;
// set these to the appropriate attribute[] index
int indexPIDPar;
int indexPi0Par;
int indexPiPPar;
int indexRCPar;
int flgPrintSummary;
float DeltaSg;
float DeltaBg;
float Delta;
float Nevents;
float Power;
float Syst;
float NS;
float NB;
float Scale;
float SysScale;
int FOMType;
int AvgType;
int flgUseSpectrum;
int bestFOMbin;
int flgUseFloor;
int flgUseCCnQE;
float bestFOMvalue;
// methods
// masks
int flgUseMask;
float maskThresh;
TH2FV* hMask;
TH2FV* hMaskOne;
float smallVariation;
void fillFVHistoFast();
float calcFOMBinned(int nselection, float twcut, float wcut, int oscpar, int iplt = 1);
float calcFOM(float* pow, float* nev, float* sys, int nbin);
void calcFOMMap(float towallmax, float wallmax,int oscpar, int npts, int nselection);
float getOscPower(int nutype, int oscpar);
float getEventWeight(int iev);
float getOscPowerFast(int nutype, int ievent, int oscpar);
float getSystUncertainty(int iev,int nutype=14);
void fillArray();
void calcFVSummary(int oscpar, int nutype=14);
int passNuMuCuts(int iev);
int passNuECuts(int iev);
double calcDeltaNuMu(float tw1, float w1, float tw2, float w2);
void calcDeltaMapNuMu(float twbest, float wbest, float twmax, float wmax, int npts=15);
double calcDeltaNuE(float tw1, float w1, float tw2, float w2);
void calcDeltaMapNuE(float twbest, float wbest, float twmax, float wmax, int npts=15);
int isSmallDifference(float tw1, float w1, float tw2, float w2, int oscpar, int nselection);
// superseeds previous methods for applying numu or nue cuts to a modified event
int applyCutsToModifiedEvent(int iev);
/////////////////////////////////////////////////////////////////////////////////
void makeAllPlots(float twmax, float wmax, int oscpar, int npts,int nselection);
void compareCuts(float tw1, float w1, float tw2, float w2, int oscpar, int nselection);
void compareFOM(float tw1, float w1, float tw2, float w2, int oscpar, int nselection);
void showBreakdown();
void printCutDiff(int nselection);
void printCompare(const char* dir,float tw1, float w1, float tw2, float w2, int oscpar, int nselection);
void deleteHistos();
void initHistos(int nselection, int oscpar=0);
void setSeedHisogram(int nselection, TH1D* hseed, int oscpar=0);
void drawFOM(int nselection, int oscpar);
private:
int flgUseEventList;
};
#endif