Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BCALSelector.C
Go to the documentation of this file.
1 #define BCALSelector_cxx
2 // The class definition in BCALSelector.h has been generated automatically
3 // by the ROOT utility TTree::MakeSelector(). This class is derived
4 // from the ROOT class TSelector. For more information on the TSelector
5 // framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual.
6 
7 // The following methods are defined in this file:
8 // Begin(): called every time a loop on the tree starts,
9 // a convenient place to create your histograms.
10 // SlaveBegin(): called after Begin(), when on PROOF called only on the
11 // slave servers.
12 // Process(): called for each event, in this function you decide what
13 // to read and fill your histograms.
14 // SlaveTerminate: called at the end of the loop on the tree, when on PROOF
15 // called only on the slave servers.
16 // Terminate(): called at the end of the loop on the tree,
17 // a convenient place to draw/fit your histograms.
18 //
19 // To use this file, try the following session on your Tree T:
20 //
21 // Root > T->Process("BCALSelector.C")
22 // Root > T->Process("BCALSelector.C","some options")
23 // Root > T->Process("BCALSelector.C+")
24 //
25 
26 #include "BCALSelector.h"
27 #include <TH2.h>
28 #include <TStyle.h>
29 
30 
31 void BCALSelector::Begin(TTree * /*tree*/)
32 {
33  // The Begin() function is called at the start of the query.
34  // When running with PROOF Begin() is only called on the client.
35  // The tree argument is deprecated (on PROOF 0 is passed).
36 
37  TString option = GetOption();
38 
39  dOutputFile = new TFile("dh_BCALMCComparisonHists.root", "RECREATE");
40 
41 // float locRMin = 64.0, locRMax = 67.0; //pre depth correction
42  float locRMin = 65.0, locRMax = 75.0;
43  float locPhiMin = -3.2, locPhiMax = 3.2;
44  float locZMin = 0.0, locZMax = 430.0;
45  float locEMin = 0.0, locEMax = 9.1;
46  float locTMin = 2.0, locTMax = 15.0;
47 
48 // float locDeltaRMin = -2.0, locDeltaRMax = 12.0; //pre depth correction
49  float locDeltaRMin = -4.0, locDeltaRMax = 4.0;
50  float locDeltaPhiMin = -0.05, locDeltaPhiMax = 0.05;
51  float locDeltaZMin = -12.0, locDeltaZMax = 12.0;
52  float locDeltaEMin = -1.0, locDeltaEMax = 1.0;
53  float locDeltaTMin = -2.0, locDeltaTMax = 2.0;
54 
55  dPluginHist_BCAL_PathLengthCorrection = new TH2F("dPluginHist_BCAL_PathLengthCorrection", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);Path Length Correction (cm)", 100, locEMin, locEMax, 100, -1.0, 25.0);
56  dPluginHist_BCAL_PathLengthCorrectionPostEVsZ = new TH2F("dPluginHist_BCAL_PathLengthCorrectionPostEVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);Path Length Correction (cm)", 400, locZMin, locZMax, 400, -30.0, 10.0);
57 
58  //DeltaR Dependence
59  dPluginHist_BCAL_DeltaRVsR = new TH2F("dPluginHist_BCAL_DeltaRVsR", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured R (cm);BCAL Shower #DeltaR (cm)", 200, locRMin, locRMax, 200, locDeltaRMin, locDeltaRMax);
60  dPluginHist_BCAL_DeltaRVsPhi = new TH2F("dPluginHist_BCAL_DeltaRVsPhi", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured #phi (rad);BCAL Shower #DeltaR (cm)", 100, locPhiMin, locPhiMax, 100, locDeltaRMin, locDeltaRMax);
61  dPluginHist_BCAL_DeltaRVsZ = new TH2F("dPluginHist_BCAL_DeltaRVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #DeltaR (cm)", 100, locZMin, locZMax, 100, locDeltaRMin, locDeltaRMax);
62  dPluginHist_BCAL_DeltaRVsE = new TH2F("dPluginHist_BCAL_DeltaRVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #DeltaR (cm)", 100, locEMin, locEMax, 100, locDeltaRMin, locDeltaRMax);
63  dPluginHist_BCAL_DeltaRVsT = new TH2F("dPluginHist_BCAL_DeltaRVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #DeltaR (cm)", 100, locTMin, locTMax, 100, locDeltaRMin, locDeltaRMax);
64 
65  //DeltaPhi Dependence
66  dPluginHist_BCAL_DeltaPhiVsR = new TH2F("dPluginHist_BCAL_DeltaPhiVsR", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured R (cm);BCAL Shower #Delta#Phi (rad)", 100, locRMin, locRMax, 100, locDeltaPhiMin, locDeltaPhiMax);
67  dPluginHist_BCAL_DeltaPhiVsPhi = new TH2F("dPluginHist_BCAL_DeltaPhiVsPhi", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured #phi (rad);BCAL Shower #Delta#Phi (rad)", 100, locPhiMin, locPhiMax, 400, locDeltaPhiMin, locDeltaPhiMax);
68  dPluginHist_BCAL_DeltaPhiVsZ = new TH2F("dPluginHist_BCAL_DeltaPhiVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #Delta#Phi (rad)", 100, locZMin, locZMax, 100, locDeltaPhiMin, locDeltaPhiMax);
69  dPluginHist_BCAL_DeltaPhiVsE = new TH2F("dPluginHist_BCAL_DeltaPhiVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #Delta#Phi (rad)", 100, locEMin, locEMax, 100, locDeltaPhiMin, locDeltaPhiMax);
70  dPluginHist_BCAL_DeltaPhiVsT = new TH2F("dPluginHist_BCAL_DeltaPhiVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #Delta#Phi (rad)", 100, locTMin, locTMax, 100, locDeltaPhiMin, locDeltaPhiMax);
71 
72  //DeltaZ Dependence
73  dPluginHist_BCAL_DeltaZVsR = new TH2F("dPluginHist_BCAL_DeltaZVsR", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured R (cm);BCAL Shower #DeltaZ (cm)", 100, locRMin, locRMax, 100, locDeltaZMin, locDeltaZMax);
74  dPluginHist_BCAL_DeltaZVsPhi = new TH2F("dPluginHist_BCAL_DeltaZVsPhi", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured #phi (rad);BCAL Shower #DeltaZ (cm)", 100, locPhiMin, locPhiMax, 100, locDeltaZMin, locDeltaZMax);
75  dPluginHist_BCAL_DeltaZVsZ = new TH2F("dPluginHist_BCAL_DeltaZVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #DeltaZ (cm)", 400, locZMin, locZMax, 400, locDeltaZMin, locDeltaZMax);
76  dPluginHist_BCAL_DeltaZVsE = new TH2F("dPluginHist_BCAL_DeltaZVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #DeltaZ (cm)", 100, locEMin, locEMax, 100, locDeltaZMin, locDeltaZMax);
77  dPluginHist_BCAL_DeltaZVsT = new TH2F("dPluginHist_BCAL_DeltaZVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #DeltaZ (cm)", 100, locTMin, locTMax, 100, locDeltaZMin, locDeltaZMax);
78 
79  //DeltaE Dependence
80  dPluginHist_BCAL_DeltaEVsR = new TH2F("dPluginHist_BCAL_DeltaEVsR", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured R (cm);BCAL Shower #DeltaE (GeV)", 100, locRMin, locRMax, 100, locDeltaEMin, locDeltaEMax);
81  dPluginHist_BCAL_DeltaEVsPhi = new TH2F("dPluginHist_BCAL_DeltaEVsPhi", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured #phi (rad);BCAL Shower #DeltaE (GeV)", 100, locPhiMin, locPhiMax, 100, locDeltaEMin, locDeltaEMax);
82  dPluginHist_BCAL_DeltaEVsZ = new TH2F("dPluginHist_BCAL_DeltaEVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #DeltaE (GeV)", 100, locZMin, locZMax, 100, locDeltaEMin, locDeltaEMax);
83  dPluginHist_BCAL_DeltaEVsE = new TH2F("dPluginHist_BCAL_DeltaEVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #DeltaE (GeV)", 400, locEMin, locEMax, 400, locDeltaEMin, locDeltaEMax);
84  dPluginHist_BCAL_DeltaEVsT = new TH2F("dPluginHist_BCAL_DeltaEVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #DeltaE (GeV)", 100, locTMin, locTMax, 100, locDeltaEMin, locDeltaEMax);
85 
86  //DeltaT Dependence
87  dPluginHist_BCAL_DeltaTVsR = new TH2F("dPluginHist_BCAL_DeltaTVsR", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured R (cm);BCAL Shower #DeltaT (ns)", 100, locRMin, locRMax, 400, locDeltaTMin, locDeltaTMax);
88  dPluginHist_BCAL_DeltaTVsPhi = new TH2F("dPluginHist_BCAL_DeltaTVsPhi", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured #phi (rad);BCAL Shower #DeltaT (ns)", 100, locPhiMin, locPhiMax, 400, locDeltaTMin, locDeltaTMax);
89  dPluginHist_BCAL_DeltaTVsZ = new TH2F("dPluginHist_BCAL_DeltaTVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #DeltaT (ns)", 100, locZMin, locZMax, 400, locDeltaTMin, locDeltaTMax);
90  dPluginHist_BCAL_DeltaTVsE = new TH2F("dPluginHist_BCAL_DeltaTVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #DeltaT (ns)", 100, locEMin, locEMax, 400, locDeltaTMin, locDeltaTMax);
91  dPluginHist_BCAL_DeltaTVsT = new TH2F("dPluginHist_BCAL_DeltaTVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #DeltaT (ns)", 100, locTMin, locTMax, 400, locDeltaTMin, locDeltaTMax);
92 
93  //Common Dependence
94  dPluginHist_BCAL_DeltaRVsDeltaPhi = new TH2F("dPluginHist_BCAL_DeltaRVsDeltaPhi", "Simulation Reconstructed Uncertainty Study;BCAL Shower #Delta#phi (rad);BCAL Shower #DeltaR (cm)", 100, locDeltaPhiMin, locDeltaPhiMax, 100, locDeltaRMin, locDeltaRMax);
95  dPluginHist_BCAL_DeltaRVsDeltaZ = new TH2F("dPluginHist_BCAL_DeltaRVsDeltaZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaZ (cm);BCAL Shower #DeltaR (cm)", 100, locDeltaZMin, locDeltaZMax, 100, locDeltaRMin, locDeltaRMax);
96  dPluginHist_BCAL_DeltaRVsDeltaE = new TH2F("dPluginHist_BCAL_DeltaRVsDeltaE", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaE (GeV);BCAL Shower #DeltaR (cm)", 100, locDeltaEMin, locDeltaEMax, 100, locDeltaRMin, locDeltaRMax);
97  dPluginHist_BCAL_DeltaRVsDeltaT = new TH2F("dPluginHist_BCAL_DeltaRVsDeltaT", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaT (ns);BCAL Shower #DeltaR (cm)", 100, locDeltaTMin, locDeltaTMax, 100, locDeltaRMin, locDeltaRMax);
98  dPluginHist_BCAL_DeltaPhiVsDeltaZ = new TH2F("dPluginHist_BCAL_DeltaPhiVsDeltaZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaZ (cm);BCAL Shower #Delta#phi (rad)", 100, locDeltaZMin, locDeltaZMax, 100, locDeltaPhiMin, locDeltaPhiMax);
99  dPluginHist_BCAL_DeltaPhiVsDeltaE = new TH2F("dPluginHist_BCAL_DeltaPhiVsDeltaE", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaE (GeV);BCAL Shower #Delta#phi (rad)", 100, locDeltaEMin, locDeltaEMax, 100, locDeltaPhiMin, locDeltaPhiMax);
100  dPluginHist_BCAL_DeltaPhiVsDeltaT = new TH2F("dPluginHist_BCAL_DeltaPhiVsDeltaT", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaT (ns);BCAL Shower #Delta#phi (rad)", 100, locDeltaTMin, locDeltaTMax, 100, locDeltaPhiMin, locDeltaPhiMax);
101  dPluginHist_BCAL_DeltaZVsDeltaE = new TH2F("dPluginHist_BCAL_DeltaZVsDeltaE", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaE (GeV);BCAL Shower #DeltaZ (cm)", 100, locDeltaEMin, locDeltaEMax, 100, locDeltaZMin, locDeltaZMax);
102  dPluginHist_BCAL_DeltaZVsDeltaT = new TH2F("dPluginHist_BCAL_DeltaZVsDeltaT", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaT (ns);BCAL Shower #DeltaZ (cm)", 100, locDeltaTMin, locDeltaTMax, 100, locDeltaZMin, locDeltaZMax);
103  dPluginHist_BCAL_DeltaEVsDeltaT = new TH2F("dPluginHist_BCAL_DeltaEVsDeltaT", "Simulation Reconstructed Uncertainty Study;BCAL Shower #DeltaT (ns);BCAL Shower #DeltaE (GeV)", 100, locDeltaTMin, locDeltaTMax, 100, locDeltaEMin, locDeltaEMax);
104 
105  float locXMin = -75.0, locXMax = 75.0;
106  float locYMin = -75.0, locYMax = 75.0;
107 
108  float locShowerSigmaXMin = 0.2, locShowerSigmaXMax = 1.0;
109  float locShowerSigmaYMin = 0.2, locShowerSigmaYMax = 1.0;
110  float locShowerSigmaZMin = 0.1, locShowerSigmaZMax = 1.1;
111  float locShowerSigmaEMin = 0.0, locShowerSigmaEMax = 0.0;
112  float locShowerSigmaTMin = 0.0, locShowerSigmaTMax = 2.0;
113 
114  //ShowerSigmaX Dependence
115  dPluginHist_BCAL_ShowerSigmaXVsX = new TH2F("dPluginHist_BCAL_ShowerSigmaXVsX", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured X (cm);BCAL Shower #sigma X (cm)", 100, locXMin, locXMax, 400, locShowerSigmaXMin, locShowerSigmaXMax);
116  dPluginHist_BCAL_ShowerSigmaXVsY = new TH2F("dPluginHist_BCAL_ShowerSigmaXVsY", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Y (cm);BCAL Shower #sigma X (cm)", 100, locYMin, locYMax, 400, locShowerSigmaXMin, locShowerSigmaXMax);
117  dPluginHist_BCAL_ShowerSigmaXVsZ = new TH2F("dPluginHist_BCAL_ShowerSigmaXVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #sigma X (cm)", 100, locZMin, locZMax, 400, locShowerSigmaXMin, locShowerSigmaXMax);
118  dPluginHist_BCAL_ShowerSigmaXVsE = new TH2F("dPluginHist_BCAL_ShowerSigmaXVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #sigma X (cm)", 100, locEMin, locEMax, 400, locShowerSigmaXMin, locShowerSigmaXMax);
119  dPluginHist_BCAL_ShowerSigmaXVsT = new TH2F("dPluginHist_BCAL_ShowerSigmaXVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #sigma X (cm)", 100, locTMin, locTMax, 400, locShowerSigmaXMin, locShowerSigmaXMax);
120 
121  //ShowerSigmaY Dependence
122  dPluginHist_BCAL_ShowerSigmaYVsX = new TH2F("dPluginHist_BCAL_ShowerSigmaYVsX", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured X (cm);BCAL Shower #sigma Y (cm)", 100, locXMin, locXMax, 400, locShowerSigmaYMin, locShowerSigmaYMax);
123  dPluginHist_BCAL_ShowerSigmaYVsY = new TH2F("dPluginHist_BCAL_ShowerSigmaYVsY", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Y (cm);BCAL Shower #sigma Y (cm)", 100, locYMin, locYMax, 400, locShowerSigmaYMin, locShowerSigmaYMax);
124  dPluginHist_BCAL_ShowerSigmaYVsZ = new TH2F("dPluginHist_BCAL_ShowerSigmaYVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #sigma Y (cm)", 100, locZMin, locZMax, 400, locShowerSigmaYMin, locShowerSigmaYMax);
125  dPluginHist_BCAL_ShowerSigmaYVsE = new TH2F("dPluginHist_BCAL_ShowerSigmaYVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #sigma Y (cm)", 100, locEMin, locEMax, 400, locShowerSigmaYMin, locShowerSigmaYMax);
126  dPluginHist_BCAL_ShowerSigmaYVsT = new TH2F("dPluginHist_BCAL_ShowerSigmaYVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #sigma Y (cm)", 100, locTMin, locTMax, 400, locShowerSigmaYMin, locShowerSigmaYMax);
127 
128  //ShowerSigmaZ Dependence
129  dPluginHist_BCAL_ShowerSigmaZVsX = new TH2F("dPluginHist_BCAL_ShowerSigmaZVsX", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured X (cm);BCAL Shower #sigma Z (cm)", 100, locXMin, locXMax, 400, locShowerSigmaZMin, locShowerSigmaZMax);
130  dPluginHist_BCAL_ShowerSigmaZVsY = new TH2F("dPluginHist_BCAL_ShowerSigmaZVsY", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Y (cm);BCAL Shower #sigma Z (cm)", 100, locYMin, locYMax, 400, locShowerSigmaZMin, locShowerSigmaZMax);
131  dPluginHist_BCAL_ShowerSigmaZVsZ = new TH2F("dPluginHist_BCAL_ShowerSigmaZVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #sigma Z (cm)", 100, locZMin, locZMax, 400, locShowerSigmaZMin, locShowerSigmaZMax);
132  dPluginHist_BCAL_ShowerSigmaZVsE = new TH2F("dPluginHist_BCAL_ShowerSigmaZVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #sigma Z (cm)", 100, locEMin, locEMax, 400, locShowerSigmaZMin, locShowerSigmaZMax);
133  dPluginHist_BCAL_ShowerSigmaZVsT = new TH2F("dPluginHist_BCAL_ShowerSigmaZVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #sigma Z (cm)", 100, locTMin, locTMax, 400, locShowerSigmaZMin, locShowerSigmaZMax);
134 
135  //ShowerSigmaE Dependence
136  dPluginHist_BCAL_ShowerSigmaEVsX = new TH2F("dPluginHist_BCAL_ShowerSigmaEVsX", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured X (cm);BCAL Shower #sigma E (GeV)", 100, locXMin, locXMax, 100, locShowerSigmaEMin, locShowerSigmaEMax);
137  dPluginHist_BCAL_ShowerSigmaEVsY = new TH2F("dPluginHist_BCAL_ShowerSigmaEVsY", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Y (cm);BCAL Shower #sigma E (GeV)", 100, locYMin, locYMax, 100, locShowerSigmaEMin, locShowerSigmaEMax);
138  dPluginHist_BCAL_ShowerSigmaEVsZ = new TH2F("dPluginHist_BCAL_ShowerSigmaEVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #sigma E (GeV)", 100, locZMin, locZMax, 100, locShowerSigmaEMin, locShowerSigmaEMax);
139  dPluginHist_BCAL_ShowerSigmaEVsE = new TH2F("dPluginHist_BCAL_ShowerSigmaEVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #sigma E (GeV)", 400, locEMin, locEMax, 400, locShowerSigmaEMin, locShowerSigmaEMax);
140  dPluginHist_BCAL_ShowerSigmaEVsT = new TH2F("dPluginHist_BCAL_ShowerSigmaEVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #sigma E (GeV)", 100, locTMin, locTMax, 100, locShowerSigmaEMin, locShowerSigmaEMax);
141 
142  //ShowerSigmaT Dependence
143  dPluginHist_BCAL_ShowerSigmaTVsX = new TH2F("dPluginHist_BCAL_ShowerSigmaTVsX", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured X (cm);BCAL Shower #sigma T (ns)", 100, locXMin, locXMax, 100, locShowerSigmaTMin, locShowerSigmaTMax);
144  dPluginHist_BCAL_ShowerSigmaTVsY = new TH2F("dPluginHist_BCAL_ShowerSigmaTVsY", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Y (cm);BCAL Shower #sigma T (ns)", 100, locYMin, locYMax, 100, locShowerSigmaTMin, locShowerSigmaTMax);
145  dPluginHist_BCAL_ShowerSigmaTVsZ = new TH2F("dPluginHist_BCAL_ShowerSigmaTVsZ", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured Z (cm);BCAL Shower #sigma T (ns)", 100, locZMin, locZMax, 100, locShowerSigmaTMin, locShowerSigmaTMax);
146  dPluginHist_BCAL_ShowerSigmaTVsE = new TH2F("dPluginHist_BCAL_ShowerSigmaTVsE", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured E (GeV);BCAL Shower #sigma T (ns)", 100, locEMin, locEMax, 100, locShowerSigmaTMin, locShowerSigmaTMax);
147  dPluginHist_BCAL_ShowerSigmaTVsT = new TH2F("dPluginHist_BCAL_ShowerSigmaTVsT", "Simulation Reconstructed Uncertainty Study;BCAL Shower Measured T (ns);BCAL Shower #sigma T (ns)", 400, locTMin, locTMax, 400, locShowerSigmaTMin, locShowerSigmaTMax);
148 
149 }
150 
151 void BCALSelector::SlaveBegin(TTree * /*tree*/)
152 {
153  // The SlaveBegin() function is called after the Begin() function.
154  // When running with PROOF SlaveBegin() is called on each slave server.
155  // The tree argument is deprecated (on PROOF 0 is passed).
156 
157  TString option = GetOption();
158 
159 }
160 
161 Bool_t BCALSelector::Process(Long64_t entry)
162 {
163  // The Process() function is called for each entry in the tree (or possibly
164  // keyed object in the case of PROOF) to be processed. The entry argument
165  // specifies which entry in the currently loaded tree is to be processed.
166  // It can be passed to either BCALSelector::GetEntry() or TBranch::GetEntry()
167  // to read either all or the required parts of the data. When processing
168  // keyed objects with PROOF, the object is already loaded and is available
169  // via the fObject pointer.
170  //
171  // This function should contain the "body" of the analysis. It can contain
172  // simple or elaborate selection criteria, run algorithms on the data
173  // of the event and typically fill histograms.
174  //
175  // The processing can be stopped by calling Abort().
176  //
177  // Use fStatus to set the return value of TTree::Process().
178  //
179  // The return value is currently not used.
180 
181  GetEntry(entry);
182  if((entry % 1000) == 0)
183  cout << "entry = " << entry << endl;
184 
185  //Path Length Correction
187  float locPathLengthCorrectionPostE = dPathLengthCorrection - Calc_BCALPathLengthCorrection(dTrueE);
188  dPluginHist_BCAL_PathLengthCorrectionPostEVsZ->Fill(dTrueZ, locPathLengthCorrectionPostE); //add (NOT subtract) the result of this fit to the path length
189 
190  bool locVsMeasuredFlag = true; //if true, swap true/meas
191  if(locVsMeasuredFlag == true){
192  //delta = meas - true
193  dTrueR += dDeltaR;
194  dTruePhi += dDeltaPhi;
195  dTrueZ += dDeltaZ;
196  dTrueE += dDeltaE;
197  dTrueT += dDeltaT;
198  }
199 
200  //DeltaR Dependence
206 
207  //DeltaPhi Dependence
213 
214  //DeltaZ Dependence
220 
221  //DeltaE Dependence
227 
228  //DeltaT Dependence
234 
235  //Common Dependence
246 
247  float dTrueX = dTrueR*cos(dTruePhi);
248  float dTrueY = dTrueR*sin(dTruePhi);;
249 
250  //ShowerSigmaX Dependence
256 
257  //ShowerSigmaY Dependence
263 
264  //ShowerSigmaZ Dependence
270 
271  //ShowerSigmaE Dependence
277 
278  //ShowerSigmaT Dependence
284 
285 
286  return kTRUE;
287 }
288 
290 {
291  // The SlaveTerminate() function is called after all entries or objects
292  // have been processed. When running with PROOF SlaveTerminate() is called
293  // on each slave server.
294 
295 }
296 
298 {
299  // The Terminate() function is the last function to be called during
300  // a query. It always runs on the client, it can be used to present
301  // the results graphically or save the results to file.
302 
303  dOutputFile->Write();
304 }
305 
307  if(locEnergy >= 1.0){
308  TF1 locFunction("df_BCAL_DepthCorrection", "[0] + [1]*x + [2]*exp([3]*x)", 0.0, 9.0);
309  locFunction.SetParameters(9.95659, 0.142382, -2.9869, -0.56881);
310  return locFunction.Eval(locEnergy);
311  }
312  TF1 locFunction("df_BCAL_DepthCorrection_LowE", "[0] + [1]*x + [2]*x*x", 0.0, 1.0);
313  locFunction.SetParameters(4.89141, 5.98362, -2.56308);
314  return locFunction.Eval(locEnergy);
315 }
316 
TH2F * dPluginHist_BCAL_ShowerSigmaEVsY
Definition: BCALSelector.h:138
TH2F * dPluginHist_BCAL_ShowerSigmaTVsT
Definition: BCALSelector.h:148
TH2F * dPluginHist_BCAL_DeltaPhiVsT
Definition: BCALSelector.h:80
TH2F * dPluginHist_BCAL_DeltaRVsPhi
Definition: BCALSelector.h:70
TH2F * dPluginHist_BCAL_ShowerSigmaXVsY
Definition: BCALSelector.h:117
TH2F * dPluginHist_BCAL_ShowerSigmaXVsZ
Definition: BCALSelector.h:118
TH2F * dPluginHist_BCAL_ShowerSigmaZVsZ
Definition: BCALSelector.h:132
Float_t dDeltaZ
Definition: BCALSelector.h:32
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Definition: BCALSelector.h:159
TH2F * dPluginHist_BCAL_DeltaRVsDeltaZ
Definition: BCALSelector.h:105
TH2F * dPluginHist_BCAL_ShowerSigmaXVsE
Definition: BCALSelector.h:119
virtual Bool_t Process(Long64_t entry)
Definition: BCALSelector.C:161
TH2F * dPluginHist_BCAL_ShowerSigmaTVsE
Definition: BCALSelector.h:147
TH2F * dPluginHist_BCAL_DeltaPhiVsE
Definition: BCALSelector.h:79
TH2F * dPluginHist_BCAL_DeltaEVsE
Definition: BCALSelector.h:93
virtual void SlaveBegin(TTree *tree)
Definition: BCALSelector.C:151
TH2F * dPluginHist_BCAL_DeltaPhiVsR
Definition: BCALSelector.h:76
TH2F * dPluginHist_BCAL_DeltaRVsDeltaE
Definition: BCALSelector.h:106
Float_t dShowerUncertaintyE
Definition: BCALSelector.h:40
Float_t dDeltaPhi
Definition: BCALSelector.h:33
TH2F * dPluginHist_BCAL_ShowerSigmaTVsY
Definition: BCALSelector.h:145
Float_t dPathLengthCorrection
Definition: BCALSelector.h:41
TH2F * dPluginHist_BCAL_DeltaTVsZ
Definition: BCALSelector.h:99
TH2F * dPluginHist_BCAL_DeltaRVsR
Definition: BCALSelector.h:69
TH2F * dPluginHist_BCAL_DeltaRVsDeltaT
Definition: BCALSelector.h:107
TH2F * dPluginHist_BCAL_ShowerSigmaYVsZ
Definition: BCALSelector.h:125
TH2F * dPluginHist_BCAL_DeltaEVsPhi
Definition: BCALSelector.h:91
TH2F * dPluginHist_BCAL_DeltaTVsT
Definition: BCALSelector.h:101
virtual void Begin(TTree *tree)
Definition: BCALSelector.C:31
TH2F * dPluginHist_BCAL_ShowerSigmaEVsZ
Definition: BCALSelector.h:139
TH2F * dPluginHist_BCAL_DeltaEVsR
Definition: BCALSelector.h:90
TH2F * dPluginHist_BCAL_DeltaPhiVsDeltaT
Definition: BCALSelector.h:110
Float_t dDeltaT
Definition: BCALSelector.h:35
Float_t dShowerUncertaintyY
Definition: BCALSelector.h:37
TH2F * dPluginHist_BCAL_DeltaZVsPhi
Definition: BCALSelector.h:84
TH2F * dPluginHist_BCAL_DeltaTVsE
Definition: BCALSelector.h:100
TH2F * dPluginHist_BCAL_DeltaRVsT
Definition: BCALSelector.h:73
TH2F * dPluginHist_BCAL_DeltaZVsR
Definition: BCALSelector.h:83
TH2F * dPluginHist_BCAL_ShowerSigmaTVsZ
Definition: BCALSelector.h:146
TH2F * dPluginHist_BCAL_ShowerSigmaTVsX
Definition: BCALSelector.h:144
virtual void SlaveTerminate()
Definition: BCALSelector.C:289
TH2F * dPluginHist_BCAL_DeltaRVsDeltaPhi
Definition: BCALSelector.h:104
TH2F * dPluginHist_BCAL_PathLengthCorrection
Definition: BCALSelector.h:65
Float_t dTruePhi
Definition: BCALSelector.h:28
TH2F * dPluginHist_BCAL_ShowerSigmaYVsY
Definition: BCALSelector.h:124
Float_t dTrueR
Definition: BCALSelector.h:26
Float_t dShowerUncertaintyZ
Definition: BCALSelector.h:38
TH2F * dPluginHist_BCAL_DeltaEVsT
Definition: BCALSelector.h:94
TH2F * dPluginHist_BCAL_ShowerSigmaYVsT
Definition: BCALSelector.h:127
TH2F * dPluginHist_BCAL_ShowerSigmaZVsE
Definition: BCALSelector.h:133
TH2F * dPluginHist_BCAL_ShowerSigmaEVsX
Definition: BCALSelector.h:137
TH2F * dPluginHist_BCAL_ShowerSigmaXVsX
Definition: BCALSelector.h:116
TH2F * dPluginHist_BCAL_DeltaPhiVsDeltaE
Definition: BCALSelector.h:109
TH2F * dPluginHist_BCAL_DeltaZVsE
Definition: BCALSelector.h:86
TH2F * dPluginHist_BCAL_DeltaRVsE
Definition: BCALSelector.h:72
Float_t dShowerUncertaintyT
Definition: BCALSelector.h:39
Float_t dTrueZ
Definition: BCALSelector.h:27
virtual void Terminate()
Definition: BCALSelector.C:297
TH2F * dPluginHist_BCAL_ShowerSigmaEVsE
Definition: BCALSelector.h:140
float Calc_BCALPathLengthCorrection(float locEnergy)
Definition: BCALSelector.C:306
TH2F * dPluginHist_BCAL_ShowerSigmaZVsY
Definition: BCALSelector.h:131
Float_t dTrueT
Definition: BCALSelector.h:30
double sin(double)
TH2F * dPluginHist_BCAL_DeltaEVsDeltaT
Definition: BCALSelector.h:113
TH2F * dPluginHist_BCAL_ShowerSigmaZVsT
Definition: BCALSelector.h:134
TFile * dOutputFile
Definition: BCALSelector.h:63
TH2F * dPluginHist_BCAL_DeltaZVsT
Definition: BCALSelector.h:87
TH2F * dPluginHist_BCAL_ShowerSigmaXVsT
Definition: BCALSelector.h:120
TH2F * dPluginHist_BCAL_DeltaPhiVsPhi
Definition: BCALSelector.h:77
TH2F * dPluginHist_BCAL_ShowerSigmaYVsX
Definition: BCALSelector.h:123
TH2F * dPluginHist_BCAL_DeltaZVsZ
Definition: BCALSelector.h:85
TH2F * dPluginHist_BCAL_DeltaEVsZ
Definition: BCALSelector.h:92
TH2F * dPluginHist_BCAL_ShowerSigmaYVsE
Definition: BCALSelector.h:126
Float_t dTrueE
Definition: BCALSelector.h:29
TH2F * dPluginHist_BCAL_DeltaPhiVsDeltaZ
Definition: BCALSelector.h:108
TH2F * dPluginHist_BCAL_DeltaTVsPhi
Definition: BCALSelector.h:98
Float_t dDeltaE
Definition: BCALSelector.h:34
TH2F * dPluginHist_BCAL_ShowerSigmaEVsT
Definition: BCALSelector.h:141
TH2F * dPluginHist_BCAL_PathLengthCorrectionPostEVsZ
Definition: BCALSelector.h:66
TH2F * dPluginHist_BCAL_DeltaZVsDeltaT
Definition: BCALSelector.h:112
Float_t dDeltaR
Definition: BCALSelector.h:31
TH2F * dPluginHist_BCAL_DeltaPhiVsZ
Definition: BCALSelector.h:78
TH2F * dPluginHist_BCAL_DeltaTVsR
Definition: BCALSelector.h:97
Float_t dShowerUncertaintyX
Definition: BCALSelector.h:36
TH2F * dPluginHist_BCAL_DeltaZVsDeltaE
Definition: BCALSelector.h:111
TH2F * dPluginHist_BCAL_DeltaRVsZ
Definition: BCALSelector.h:71
TH2F * dPluginHist_BCAL_ShowerSigmaZVsX
Definition: BCALSelector.h:130