-
Notifications
You must be signed in to change notification settings - Fork 1
/
mcmcApply.h
105 lines (80 loc) · 2.78 KB
/
mcmcApply.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
#ifndef MCMCAPPLY_H
#define MCMCAPPLY_H
#include "atmFitPars.h"
#include "fqProcessedEvent.h"
#include "mcmcReader.h"
#include "mcLargeArray.h"
#include "eventSelectors.h"
///////////////////////////////////////////////////////////////
// Class to apply parameters from MCMC for toy MC experiments
//
// This class has a pointer the attributes of some MC event (mcEvent)
// This MC event should be a PROCESSED event (processed by preProcess)
//
// It also contains a pointer to an atmFitPars object (fitPars) as
// well as the MCMC cloud (mcmcPars)
//
// This class is useful for applying the parametesr in mcmcPars to the
// attribute[] array of a fitqun event, and then seeing if the event
// still passes the event selection cuts defined by "eventSelectors.h"
class mcmcApply{
public:
// constructor
mcmcApply(atmFitPars* fitpars, mcmcReader* mcmcpars);
// vars
atmFitPars* fitPars;
mcmcReader* mcmcPars;
fqProcessedEvent* mcEvent;
int indexPIDPar;
int indexPi0Par;
int indexPiPPar;
int indexRCPar;
// best fit pars
float bestFitPar[NMCMCPARS];
// flags
bool flgApplyXSecPar;
bool flgApplyFluxPar;
bool flgApplyNormPar;
bool flgApplyTest;
bool flgApplyAttSmearPar[NATTMAX];
bool flgApplyAttBiasPar[NATTMAX];
void setAttFlgs(int iatt, bool value){
flgApplyAttSmearPar[iatt]=value;
flgApplyAttBiasPar[iatt]=value;
}
void setAllAlphaFlags(bool value){
flgApplyXSecPar = value;
flgApplyFluxPar = value;
flgApplyNormPar = value;
return;
}
bool flgUseBestPar[NMCMCPARS];
bool flgGlobalUseBestPars;
// methods
void setFromMCMC();
void setAlphaFromMCMC();
void setBetaFromMCMC();
void setBestPars();
// modify the reconstructed fiTQun attributes
void applyPars(int nbin, int ncomponent, float attributeTmp[], int natt);
// get additional weights from xsec parameters, normalization, etc
float getXsecWeight(int mode, float enutrue);
// get additional weights from xsec parameters, normalization, etc
float getFluxWeight(float enutrue, int nutype);
// test weight for debugging etc
float getTestWeight(int nbin, int nsamp, int mode, float enutrue, int nutype=12);
// get additional weights from xsec parameters, normalization, etc
float getEvtWeight(int nbin, int nsamp, int mode, float enutrue, int nutype=12);
// reads in attributes from large array of MC points, then applies
// the mcmc shape parameters and re-evaluates the event selection cuts
// returns 1 for nue, 2 for numu, 0 for neither
int applyCutsToModifiedEvent(int iev, mcLargeArray* fastevents,bool modflg=true);
// calculate what the best fit (mean) parameters are
void findBestFitPars();
void setUseBestFitSystPars(bool value);
void setUseBestFitNormPars(bool value);
};
#ifdef CINTMODE
#include "mcmcApply.cxx"
#endif
#endif