1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | #include "DCustomAction_p2pi_unusedHists.h" |
9 | |
10 | void DCustomAction_p2pi_unusedHists::Initialize(JEventLoop* locEventLoop) |
11 | { |
12 | |
13 | |
14 | const DParticleID* locParticleID = NULL__null; |
15 | locEventLoop->GetSingle(locParticleID); |
16 | dParticleID = locParticleID; |
17 | |
18 | vector<const DFCALGeometry*> locFCALGeometry; |
19 | locEventLoop->Get(locFCALGeometry); |
20 | dFCALGeometry = locFCALGeometry[0]; |
21 | |
22 | japp->RootWriteLock(); |
23 | { |
24 | |
25 | |
26 | CreateAndChangeTo_ActionDirectory(); |
27 | |
28 | dNShowerBCAL_FCAL = GetOrCreate_Histogram<TH2I>("NShowerBCAL_FCAL", "Number of non-matched showers; FCAL; BCAL", 10, 0, 10, 10, 0, 10); |
29 | dHistMap_FCALShowerDeltaR_P = GetOrCreate_Histogram<TH2I>("FCALShowerDeltaR_P", "Unused FCAL showers #DeltaR vs momentum; momentum; #DeltaR", 120, 0., 6., 200, 0, 50); |
30 | dHistMap_FCALShowerDeltaR_Theta = GetOrCreate_Histogram<TH2I>("FCALShowerDeltaR_Theta", "Unused FCAL showers #DeltaR vs #theta; #theta; #DeltaR", 150, 0, 15, 200, 0, 50); |
31 | dHistMap_FCALShowerDeltaD_P = GetOrCreate_Histogram<TH2I>("FCALShowerDeltaD_P", "Unused FCAL showers #DeltaD vs momentum; momentum; #DeltaR", 120, 0., 6., 200, 0, 50); |
32 | dHistMap_FCALShowerDeltaD_Theta = GetOrCreate_Histogram<TH2I>("FCALShowerDeltaD_Theta", "Unused FCAL showers #DeltaD vs #theta; #theta; #DeltaD", 150, 0, 15, 200, 0, 50); |
33 | dHistMap_FCALShowerDeltaD_DeltaT = GetOrCreate_Histogram<TH2I>("FCALShowerDeltaD_DeltaT", "Unused FCAL showers #DeltaD vs #Deltat; #Deltat; #DeltaD", 200, -100., 100., 200, 0, 50); |
34 | |
35 | dHistMap_BCALShowerDeltaPhi_DeltaZ = GetOrCreate_Histogram<TH2I>("BCALShowerDeltaPhi_DeltaZ", "Unused BCAL showers #Delta#phi vs #DeltaZ; #DeltaZ; #Delta#phi", 200, -50, 50, 360, -180, 180); |
36 | dHistMap_BCALShowerDeltaPhi_P = GetOrCreate_Histogram<TH2I>("BCALShowerDeltaPhi_P", "Unused BCAL showers #Delta#phi vs momentum; momentum; #Delta#phi", 120, 0., 6., 360, -180, 180); |
37 | dHistMap_BCALShowerDeltaPhi_Theta = GetOrCreate_Histogram<TH2I>("BCALShowerDeltaPhi_Theta", "Unused BCAL showers #Delta#phi vs #theta; #theta; #Delta#phi", 150, 0, 150, 360, -180, 180); |
38 | dHistMap_BCALShowerDeltaPhi_DeltaT = GetOrCreate_Histogram<TH2I>("BCALShowerDeltaPhi_DeltaT", "Unused BCAL showers #Delta#phi vs #Deltat; #Deltat; #Delta$phi", 200, -100., 100., 360, -180, 180); |
39 | dHistMap_BCALShowerDeltaZ_DeltaT = GetOrCreate_Histogram<TH2I>("BCALShowerDeltaZ_DeltaT", "Unused FCAL showers #DeltaZ vs #Deltat; #Deltat; #DeltaZ", 200, -100., 100., 200, -50, 50); |
40 | |
41 | int nbins = 100; |
42 | h1_deltaX = GetOrCreate_Histogram<TH1I>("h1_deltaX", "Fcal X - Track X", nbins,-25,25); |
43 | h1_deltaY = GetOrCreate_Histogram<TH1I>("h1_deltaY", "Fcal Y - Track Y", nbins,-25,25); |
44 | h1_Efcal = GetOrCreate_Histogram<TH1I>("h1_Efcal", "Hit energy", nbins,0,4); |
45 | h1_tfcal = GetOrCreate_Histogram<TH1I>("h1_tfcal", "Hit time", 250,-25,225); |
46 | |
47 | h1_N9 = GetOrCreate_Histogram<TH1I>("h1_N9", "Hit N9", 25, 0, 25); |
48 | h1_E9 = GetOrCreate_Histogram<TH1I>("h1_E9", "Energy E9 (GeV)", nbins, 0, 2); |
49 | h1_t9 = GetOrCreate_Histogram<TH1I>("h1_t9", "Time t9 (ns)", 250, -25, 225); |
50 | h1_t9sigma = GetOrCreate_Histogram<TH1I>("h1_t9sigma", "Time t9sigma",nbins,0,10); |
51 | |
52 | h1_N1 = GetOrCreate_Histogram<TH1I>("h1_N1", "Hit N1", 25, 0, 25); |
53 | h1_E1 = GetOrCreate_Histogram<TH1I>("h1_E1", "Energy E1 (GeV)", nbins, 0, 2); |
54 | h1_t1 = GetOrCreate_Histogram<TH1I>("h1_t1", "Time t1 (ns)", 250, -25, 225); |
55 | h1_t1sigma = GetOrCreate_Histogram<TH1I>("h1_t1sigma", "Time t1sigma",nbins,0,10); |
56 | |
57 | h2_YvsX9 = GetOrCreate_Histogram<TH2I>("h2_YvsX9", "Hit position Y vs X, E9",240,-120,120,240,-120,120); |
58 | h2_dEdx9_vsp= GetOrCreate_Histogram<TH2I>("h2_dEdx9_vsp", "Track dEdx9 vs p",nbins,0,4,nbins,0,10); |
59 | h2_E9vsp= GetOrCreate_Histogram<TH2I>("h2_E9vsp", "E9 vs p",nbins,0,4,nbins,0,4); |
60 | h2_dEdxvsE9= GetOrCreate_Histogram<TH2I>("h2_dEdxvsE9", "dEdx vs E9 energy",nbins,0,4,nbins,0,4); |
61 | h2_E9_vsTheta= GetOrCreate_Histogram<TH2I>("h2_E9_vsTheta", "E9 vs Theta",90,0,30,nbins,0,4); |
62 | h2_E9_vsPhi= GetOrCreate_Histogram<TH2I>("h2_E9_vsPhi", "E9 vs Phi",90,-180,180,nbins,0,4); |
63 | |
64 | h2_YvsX1 = GetOrCreate_Histogram<TH2I>("h2_YvsX1", "Hit position Y vs X, E1",240,-120,120,240,-120,120); |
65 | h2_dEdx1_vsp = GetOrCreate_Histogram<TH2I>("h2_dEdx1_vsp", "Track dEdx1 vs p",nbins,0,4,nbins,0,10); |
66 | h2_E1vsp = GetOrCreate_Histogram<TH2I>("h2_E1vsp", "E1 vs p",nbins,0,4,nbins,0,4); |
67 | h2_dEdxvsE1 = GetOrCreate_Histogram<TH2I>("h2_dEdxvsE1", "dEdx vs E1 energy",nbins,0,4,nbins,0,4); |
68 | h2_E1_vsTheta = GetOrCreate_Histogram<TH2I>("h2_E1_vsTheta", "E1 vs Theta",90,0,30,nbins,0,4); |
69 | h2_E1_vsPhi = GetOrCreate_Histogram<TH2I>("h2_E1_vsPhi", "E1 vs Phi",90,-180,180,nbins,0,4); |
70 | h2_E1vsRlocal = GetOrCreate_Histogram<TH2I>("h2_E1vsRlocal", "E1 vs Rtrk rel to Block center (cm)",nbins,0,5,nbins,0,4); |
71 | h2_YvsXcheck = GetOrCreate_Histogram<TH2I>("h2_E1vsRlocal", "E1 vs Rtrk rel to Block center (cm)",nbins,0,5,nbins,0,4); |
72 | |
73 | TString locHistName; |
74 | TString locHistTitle; |
75 | TString match[2] = {"Match",""}; |
76 | map<int, TString> charge; |
77 | charge[-1] = "Neg"; charge[+1] = "Pos"; |
78 | |
79 | for(int locDummy = 0; locDummy < 2; locDummy++) { |
80 | bool locMatch = (locDummy == 0); |
81 | |
82 | for(int locCharge = -1; locCharge < 2; locCharge+=2) { |
83 | locHistName = "TrackNhits_Theta" + match[locDummy] + charge[locCharge]; |
84 | locHistTitle = "Number of hits on track vs #theta: " + match[locDummy] + charge[locCharge]; |
85 | locHistTitle += "; #theta; # DOF"; |
86 | dHistMap_TrackNhits_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90, 0., 90., 35, 0, 35); |
87 | |
88 | locHistName = "TrackNhitsCDC_Theta" + match[locDummy] + charge[locCharge]; |
89 | locHistTitle = "Number of CDC ring hits on track vs #theta: " + match[locDummy] + charge[locCharge]; |
90 | locHistTitle += "; #theta; # CDC ring hits"; |
91 | dHistMap_TrackNhitsCDC_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90, 0., 90., 35, 0, 35); |
92 | |
93 | locHistName = "TrackNhitsFDC_Theta" + match[locDummy] + charge[locCharge]; |
94 | locHistTitle = "Number of FDC plane hits on track vs #theta: " + match[locDummy] + charge[locCharge]; |
95 | locHistTitle += "; #theta; # FDC plane hits"; |
96 | dHistMap_TrackNhitsFDC_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90, 0., 90., 35, 0, 35); |
97 | |
98 | locHistName = "TrackNhitsFDCVsCDC_Theta13_16" + match[locDummy] + charge[locCharge]; |
99 | locHistTitle = "Number of FDC plane hits vs CDC ring hits (13<#theta<16): " + match[locDummy] + charge[locCharge]; |
100 | locHistTitle += "; # CDC ring hits; # FDC plane hits"; |
101 | dHistMap_TrackNhitsFDCVsCDC_Theta13_16[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 35, 0, 35, 35, 0, 35); |
102 | |
103 | locHistName = "TrackNhitsFDCVsCDC_Theta16_20" + match[locDummy] + charge[locCharge]; |
104 | locHistTitle = "Number of FDC plane hits vs CDC ring hits (16<#theta<20): " + match[locDummy] + charge[locCharge]; |
105 | locHistTitle += "; # CDC ring hits; # FDC plane hits"; |
106 | dHistMap_TrackNhitsFDCVsCDC_Theta16_20[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 35, 0, 35, 35, 0, 35); |
107 | |
108 | locHistName = "TrackChiSq_Theta" + match[locDummy] + charge[locCharge]; |
109 | locHistTitle = "FOM for track #chi^{2} vs #theta: " + match[locDummy] + charge[locCharge]; |
110 | locHistTitle += "; #theta; #chi^{2}"; |
111 | dHistMap_TrackChiSq_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90, 0., 90., 500, 0., 100.); |
112 | |
113 | locHistName = "TrackFOM_Theta" + match[locDummy] + charge[locCharge]; |
114 | locHistTitle = "FOM for track fit vs #theta: " + match[locDummy] + charge[locCharge]; |
115 | locHistTitle += "; #theta; FOM"; |
116 | dHistMap_TrackFOM_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90, 0., 90., 1000, 0., 1.); |
117 | |
118 | locHistName = "TrackP_Theta" + match[locDummy] + charge[locCharge]; |
119 | locHistTitle = "P vs #theta: " + match[locDummy] + charge[locCharge]; |
120 | locHistTitle += "; #theta; momentum"; |
121 | dHistMap_TrackP_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90, 0., 90., 120, 0., 3.); |
122 | |
123 | locHistName = "TrackPOCAXY" + match[locDummy] + charge[locCharge]; |
124 | locHistTitle = "POCA to beamline Y vs X: " + match[locDummy] + charge[locCharge]; |
125 | locHistTitle += "; POCA X; POCAY"; |
126 | dHistMap_TrackPOCAXY[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 200, -20., 20., 200, -20., 20.); |
127 | |
128 | locHistName = "TrackPOCAZ" + match[locDummy] + charge[locCharge]; |
129 | locHistTitle = "POCA to beamline Z: " + match[locDummy] + charge[locCharge]; |
130 | locHistTitle += "; POCA Z"; |
131 | dHistMap_TrackPOCAZ[locMatch][locCharge] = GetOrCreate_Histogram<TH1I>(locHistName.Data(), locHistTitle.Data(), 500, 0., 250.); |
132 | |
133 | locHistName = "TrackCDCHitRadius_NHits" + match[locDummy] + charge[locCharge]; |
134 | locHistTitle = "CDC Hit radius vs # hits: " + match[locDummy] + charge[locCharge]; |
135 | locHistTitle += "; # hits; CDC Hit Radius"; |
136 | dHistMap_TrackCDCHitRadius_Nhits[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 50, 0, 50, 50, 0, 50); |
137 | |
138 | locHistName = "HighNDFTrackCDCHitRadius_PT" + match[locDummy] + charge[locCharge]; |
139 | locHistTitle = "High NDF tracks CDC Hit radius vs P_{T}: " + match[locDummy] + charge[locCharge]; |
140 | locHistTitle += "; P_{T} (GeV); CDC Hit Radius"; |
141 | dHistMap_HighNDFTrackCDCHitRadius_PT[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 120, 0., 3., 50, 0, 50); |
142 | |
143 | locHistName = "LowNDFTrackCDCHitRadius_PT" + match[locDummy] + charge[locCharge]; |
144 | locHistTitle = "Low NDF tracks CDC Hit radius vs P_{T}: " + match[locDummy] + charge[locCharge]; |
145 | locHistTitle += "; P_{T} (GeV); CDC Hit Radius"; |
146 | dHistMap_LowNDFTrackCDCHitRadius_PT[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 120, 0., 3., 50, 0, 50); |
147 | |
148 | locHistName = "LowNDFTrackP_VertZ" + match[locDummy] + charge[locCharge]; |
149 | locHistTitle = "Low NDF tracks P vs vertex Z: " + match[locDummy] + charge[locCharge]; |
150 | locHistTitle += "; Vertex Z (cm); momentum"; |
151 | dHistMap_LowNDFTrackP_VertZ[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 500, 0., 250., 120, 0., 3.); |
152 | |
153 | locHistName = "LowNDFTrackPT_Phi" + match[locDummy] + charge[locCharge]; |
154 | locHistTitle = "Low NDF tracks P_{T} vs #phi: " + match[locDummy] + charge[locCharge]; |
155 | locHistTitle += "; #phi; transverse momentum"; |
156 | dHistMap_LowNDFTrackPT_Phi[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 360., -180., 180., 120, 0., 3.); |
157 | |
158 | locHistName = "TrackMCHitFraction_Theta" + match[locDummy] + charge[locCharge]; |
159 | locHistTitle = "Track MC Hit Fraction vs #theta: " + match[locDummy] + charge[locCharge]; |
160 | locHistTitle += "; #theta; MC Hit Fraction"; |
161 | dHistMap_TrackMCHitFraction_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90., 0., 90., 100, 0., 1.); |
162 | |
163 | locHistName = "TrackMCMomRes_Theta" + match[locDummy] + charge[locCharge]; |
164 | locHistTitle = "Track MC Momentum Resolution vs #theta: " + match[locDummy] + charge[locCharge]; |
165 | locHistTitle += "; #theta; MC Momentum Resolution #Delta p/p"; |
166 | dHistMap_TrackMCMomRes_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90., 0., 90., 100, -0.4, 0.4); |
167 | |
168 | locHistName = "TrackMCThetaRes_Theta" + match[locDummy] + charge[locCharge]; |
169 | locHistTitle = "Track MC Theta Resolution vs #theta: " + match[locDummy] + charge[locCharge]; |
170 | locHistTitle += "; #theta; MC Theta Resolution #Delta#theta (degrees)"; |
171 | dHistMap_TrackMCThetaRes_Theta[locMatch][locCharge] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 90., 0., 90., 100, -5, 5); |
172 | } |
173 | |
174 | vector<DetectorSystem_t> locDetectorSystems; |
175 | locDetectorSystems.push_back(SYS_FCAL); locDetectorSystems.push_back(SYS_BCAL); |
176 | for(size_t loc_i = 0; loc_i < locDetectorSystems.size(); ++loc_i) |
177 | { |
178 | DetectorSystem_t locSystem = locDetectorSystems[loc_i]; |
179 | TString locSystemName = (locSystem == SYS_FCAL) ? "FCAL" : "BCAL"; |
180 | double thetaMax = (locSystem == SYS_FCAL) ? 15. : 150.; |
181 | |
182 | locHistName = "ShowerEnergy_Theta" + match[locDummy] + locSystemName; |
183 | locHistTitle = "Shower Energy vs #theta: " + match[locDummy] + locSystemName; |
184 | locHistTitle += ";#theta; Energy"; |
185 | dHistMap_ShowerEnergy_Theta[locMatch][locSystem] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 100., 0., 5.); |
186 | |
187 | locHistName = "ShowerPhi_Theta" + match[locDummy] + locSystemName; |
188 | locHistTitle = "Shower #phi vs #theta: " + match[locDummy] + locSystemName; |
189 | locHistTitle += ";#theta; #phi"; |
190 | dHistMap_ShowerPhi_Theta[locMatch][locSystem] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 360., -180., 180.); |
191 | |
192 | locHistName = "ShowerNClusters" + match[locDummy] + locSystemName; |
193 | locHistTitle = "Number of clusters in shower: " + match[locDummy] + locSystemName; |
194 | dHistMap_ShowerNclusters[locMatch][locSystem] = GetOrCreate_Histogram<TH1I>(locHistName.Data(), locHistTitle.Data(), 15, 0, 15); |
195 | |
196 | locHistName = "ShowerNHits" + match[locDummy] + locSystemName; |
197 | locHistTitle = "Number of hits in shower: " + match[locDummy] + locSystemName; |
198 | dHistMap_ShowerNhits[locMatch][locSystem] = GetOrCreate_Histogram<TH1I>(locHistName.Data(), locHistTitle.Data(), 15, 0, 15); |
199 | |
200 | locHistName = "ShowerMaxEnergy_NHits" + match[locDummy] + locSystemName; |
201 | locHistTitle = "E_{max}/E_{tot} vs number of hits in shower: " + match[locDummy] + locSystemName; |
202 | dHistMap_ShowerMaxEnergy_Nhits[locMatch][locSystem] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 15, 0, 15, 500, 0., 1.); |
203 | |
204 | locHistName = "ShowerDeltaT_NHits" + match[locDummy] + locSystemName; |
205 | locHistTitle = "t_{shower} - t_{#gamma} vs number of hits in shower: " + match[locDummy] + locSystemName; |
206 | dHistMap_ShowerDeltaT_Nhits[locMatch][locSystem] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 15, 0, 15, 200, -100., 100.); |
207 | |
208 | locHistName = "ShowerDeltaT_E" + match[locDummy] + locSystemName; |
209 | locHistTitle = "t_{shower} - t_{#gamma} vs shower energy: " + match[locDummy] + locSystemName; |
210 | dHistMap_ShowerDeltaT_E[locMatch][locSystem] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 100., 0., 5., 200, -100., 100.); |
211 | |
212 | locHistName = "ShowerE_Theta" + match[locDummy] + locSystemName; |
213 | locHistTitle = "t_{shower} - t_{#gamma} vs shower #theta: " + match[locDummy] + locSystemName; |
214 | dHistMap_ShowerE_Theta[locMatch][locSystem] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 120., 0., 6.); |
215 | |
216 | if(locSystem == SYS_BCAL){ |
217 | locHistName = "ShowerNcell" + match[locDummy] + locSystemName; |
218 | locHistTitle = "Number of points in shower: " + match[locDummy] + locSystemName; |
219 | dHistMap_BCALShowerNcell[locMatch] = GetOrCreate_Histogram<TH1I>(locHistName.Data(), locHistTitle.Data(), 15, 0, 15); |
220 | |
221 | locHistName = "Layer1Energy_Theta" + match[locDummy] + locSystemName; |
222 | locHistTitle = "Shower Layer 1 Energy vs #theta: " + match[locDummy] + locSystemName; |
223 | locHistTitle += ";#theta; Energy Layer 1"; |
224 | dHistMap_Layer1Energy_Theta[locMatch] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 500., 0., 1.); |
225 | |
226 | locHistName = "Layer2Energy_Theta" + match[locDummy] + locSystemName; |
227 | locHistTitle = "Shower Layer 2 Energy vs #theta: " + match[locDummy] + locSystemName; |
228 | locHistTitle += ";#theta; Energy Layer 2"; |
229 | dHistMap_Layer2Energy_Theta[locMatch] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 500., 0., 1.); |
230 | |
231 | locHistName = "Layer3Energy_Theta" + match[locDummy] + locSystemName; |
232 | locHistTitle = "Shower Layer 3 Energy vs #theta: " + match[locDummy] + locSystemName; |
233 | locHistTitle += ";#theta; Energy Layer 3"; |
234 | dHistMap_Layer3Energy_Theta[locMatch] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 500., 0., 1.); |
235 | |
236 | locHistName = "Layer4Energy_Theta" + match[locDummy] + locSystemName; |
237 | locHistTitle = "Shower Layer 4 Energy vs #theta: " + match[locDummy] + locSystemName; |
238 | locHistTitle += ";#theta; Energy Layer 4"; |
239 | dHistMap_Layer4Energy_Theta[locMatch] = GetOrCreate_Histogram<TH2I>(locHistName.Data(), locHistTitle.Data(), 150, 0., thetaMax, 500., 0., 1.); |
240 | } |
241 | } |
242 | } |
243 | } |
244 | japp->RootUnLock(); |
245 | } |
246 | |
247 | bool DCustomAction_p2pi_unusedHists::Perform_Action(JEventLoop* locEventLoop, const DParticleCombo* locParticleCombo) |
248 | { |
249 | |
250 | |
251 | const DParticleComboStep* locParticleComboStep = locParticleCombo->Get_ParticleComboStep(0); |
252 | |
253 | |
254 | const DKinematicData* locBeamPhoton = NULL__null; |
255 | deque<const DKinematicData*> locParticles; |
256 | if(!Get_UseKinFitResultsFlag()) { |
257 | locBeamPhoton = locParticleComboStep->Get_InitialParticle_Measured(); |
258 | locParticleComboStep->Get_FinalParticles_Measured(locParticles); |
259 | } |
260 | else { |
261 | locBeamPhoton = locParticleComboStep->Get_InitialParticle(); |
262 | locParticleComboStep->Get_FinalParticles(locParticles); |
263 | } |
264 | double locBeamPhotonTime = locBeamPhoton->time(); |
265 | |
266 | |
267 | const DDetectorMatches* locDetectorMatches = NULL__null; |
268 | locEventLoop->GetSingle(locDetectorMatches); |
269 | |
270 | |
271 | vector<const DMCThrownMatching*> locMCThrownMatchingVector; |
272 | locEventLoop->Get(locMCThrownMatchingVector); |
273 | vector<const DMCThrown*> locMCThrowns; |
274 | locEventLoop->Get(locMCThrowns); |
275 | |
276 | |
277 | vector<const DChargedTrack*> locChargedTracks; |
278 | locEventLoop->Get(locChargedTracks); |
279 | vector<const DNeutralShower*> locNeutralShowers; |
280 | locEventLoop->Get(locNeutralShowers); |
281 | vector<const DFCALShower*> locFCALShowers; |
282 | locEventLoop->Get(locFCALShowers); |
283 | vector<const DBCALShower*> locBCALShowers; |
284 | locEventLoop->Get(locBCALShowers); |
285 | |
286 | vector<const DChargedTrack*> locUnusedChargedTracks; |
287 | vector<const DNeutralShower*> locUnusedNeutralShowers; |
288 | |
289 | |
290 | for(size_t loc_j = 0; loc_j < locChargedTracks.size(); ++loc_j) { |
291 | int nMatched = 0; |
292 | |
293 | double locMatchFOM; |
294 | const DMCThrown* locMCThrown = NULL__null; |
295 | if(!locMCThrowns.empty()) |
296 | locMCThrown = locMCThrownMatchingVector[0]->Get_MatchingMCThrown(locChargedTracks[loc_j], locMatchFOM); |
297 | |
298 | |
299 | for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i) { |
300 | |
301 | const DChargedTrack* locChargedTrack = static_cast<const DChargedTrack*>(locParticleComboStep->Get_FinalParticle_SourceObject(loc_i)); |
302 | if(locChargedTrack == NULL__null) continue; |
303 | |
304 | const DChargedTrackHypothesis* locChargedTrackHypothesis = locChargedTrack->Get_BestFOM(); |
305 | if(locChargedTracks[loc_j]->Get_BestFOM()->candidateid == locChargedTrackHypothesis->candidateid) { |
306 | nMatched++; |
307 | FillTrack(locEventLoop, locChargedTracks[loc_j], true, locMCThrown); |
308 | } |
309 | } |
310 | |
311 | |
312 | if(nMatched==0) { |
313 | locUnusedChargedTracks.push_back(locChargedTracks[loc_j]); |
314 | FillTrack(locEventLoop, locChargedTracks[loc_j], false, locMCThrown); |
315 | } |
316 | } |
317 | |
318 | |
319 | for(size_t loc_j = 0; loc_j < locBCALShowers.size(); ++loc_j) { |
320 | |
321 | |
322 | for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i) { |
323 | |
324 | const DChargedTrack* locChargedTrack = static_cast<const DChargedTrack*>(locParticleComboStep->Get_FinalParticle_SourceObject(loc_i)); |
325 | if(locChargedTrack == NULL__null) continue; |
326 | |
327 | const DChargedTrackHypothesis* locChargedTrackHypothesis = locChargedTrack->Get_BestFOM(); |
328 | const DTrackTimeBased* locTrackTimeBased = NULL__null; |
329 | locChargedTrackHypothesis->GetSingleT(locTrackTimeBased); |
330 | const DReferenceTrajectory* rt = locTrackTimeBased->rt; |
331 | if(rt == NULL__null) continue; |
332 | |
333 | const DBCALShower *locBCALShower = locBCALShowers[loc_j]; |
334 | DVector3 bcal_pos(locBCALShower->x, locBCALShower->y, locBCALShower->z); |
335 | |
336 | double locFlightTime = 9.9E9, locPathLength = 9.9E9, locFlightTimeVariance = 9.9E9; |
337 | rt->DistToRTwithTime(bcal_pos, &locPathLength, &locFlightTime, &locFlightTimeVariance, SYS_BCAL); |
338 | |
339 | DVector3 proj_pos = rt->GetLastDOCAPoint(); |
340 | if(proj_pos.Perp() < 65.0) |
341 | continue; |
342 | |
343 | double dz = bcal_pos.z() - proj_pos.z(); |
344 | double dphi = bcal_pos.Phi() - proj_pos.Phi(); |
345 | while(dphi > TMath::Pi()) |
346 | dphi -= 2*TMath::Pi(); |
347 | while(dphi < -1.*TMath::Pi()) |
348 | dphi += 2*TMath::Pi(); |
349 | |
350 | double locDeltaT = locBCALShowers[loc_j]->t - locBeamPhotonTime; |
351 | |
352 | japp->RootWriteLock(); |
353 | { |
354 | dHistMap_BCALShowerDeltaPhi_DeltaZ->Fill(dz, dphi*180./TMath::Pi()); |
355 | dHistMap_BCALShowerDeltaPhi_P->Fill(locTrackTimeBased->momentum().Mag(), dphi*180./TMath::Pi()); |
356 | dHistMap_BCALShowerDeltaPhi_Theta->Fill(locTrackTimeBased->momentum().Theta()*180./TMath::Pi(), dphi*180./TMath::Pi()); |
357 | dHistMap_BCALShowerDeltaPhi_DeltaT->Fill(locDeltaT, dphi*180./TMath::Pi()); |
358 | dHistMap_BCALShowerDeltaZ_DeltaT->Fill(locDeltaT, dz); |
359 | } |
360 | japp->RootUnLock(); |
361 | |
362 | DBCALShowerMatchParams locBCALShowerMatchParams; |
363 | bool foundBCAL = dParticleID->Get_BestBCALMatchParams(locTrackTimeBased, locDetectorMatches, locBCALShowerMatchParams); |
364 | if(foundBCAL){ |
365 | if(locBCALShowerMatchParams.dBCALShower == locBCALShower) { |
366 | DNeutralShower* locNeutralShower = new DNeutralShower(); |
367 | locNeutralShower->dDetectorSystem = SYS_BCAL; |
368 | locNeutralShower->dEnergy = locBCALShowers[loc_j]->E; |
369 | locNeutralShower->dSpacetimeVertex.SetXYZT(locBCALShowers[loc_j]->x, locBCALShowers[loc_j]->y, locBCALShowers[loc_j]->z, locBCALShowers[loc_j]->t); |
370 | locNeutralShower->AddAssociatedObject(locBCALShowers[loc_j]); |
371 | double locFlightTime = locBCALShowerMatchParams.dFlightTime; |
372 | FillShower(locNeutralShower, true, locBeamPhotonTime, locFlightTime); |
373 | delete locNeutralShower; |
374 | } |
375 | } |
376 | } |
377 | } |
378 | |
379 | for(size_t loc_j = 0; loc_j < locFCALShowers.size(); ++loc_j) { |
380 | |
381 | |
382 | for(size_t loc_i = 0; loc_i < locParticles.size(); ++loc_i) { |
383 | |
384 | const DChargedTrack* locChargedTrack = static_cast<const DChargedTrack*>(locParticleComboStep->Get_FinalParticle_SourceObject(loc_i)); |
385 | if(locChargedTrack == NULL__null) continue; |
386 | |
387 | const DChargedTrackHypothesis* locChargedTrackHypothesis = locChargedTrack->Get_BestFOM(); |
388 | const DTrackTimeBased* locTrackTimeBased = NULL__null; |
389 | locChargedTrackHypothesis->GetSingleT(locTrackTimeBased); |
390 | const DReferenceTrajectory* rt = locTrackTimeBased->rt; |
391 | if(rt == NULL__null) continue; |
392 | |
393 | const DFCALShower *locFCALShower = locFCALShowers[loc_j]; |
394 | DVector3 fcal_pos = locFCALShower->getPosition(); |
395 | DVector3 norm(0.0, 0.0, 1.0); |
396 | DVector3 proj_pos, proj_mom; |
397 | double locPathLength = 9.9E9, locFlightTime = 9.9E9, locFlightTimeVariance = 9.9e9; |
398 | if(rt->GetIntersectionWithPlane(fcal_pos, norm, proj_pos, proj_mom, &locPathLength, &locFlightTime, &locFlightTimeVariance, SYS_FCAL) != NOERROR) |
399 | continue; |
400 | |
401 | double dd = (fcal_pos - proj_pos).Mag(); |
402 | double dr = (fcal_pos - proj_pos).Perp(); |
403 | double dphi = fcal_pos.Phi() - proj_pos.Phi(); |
404 | while(dphi > TMath::Pi()) |
405 | dphi -= 2*TMath::Pi(); |
406 | while(dphi < -1.*TMath::Pi()) |
407 | dphi += 2*TMath::Pi(); |
408 | |
409 | double locDeltaT = locFCALShowers[loc_j]->getTime() - locBeamPhotonTime; |
410 | |
411 | japp->RootWriteLock(); |
412 | { |
413 | dHistMap_FCALShowerDeltaR_P->Fill(locTrackTimeBased->momentum().Mag(), dr); |
414 | dHistMap_FCALShowerDeltaR_Theta->Fill(locTrackTimeBased->momentum().Theta()*180./TMath::Pi(), dr); |
415 | dHistMap_FCALShowerDeltaD_P->Fill(locTrackTimeBased->momentum().Mag(), dd); |
416 | dHistMap_FCALShowerDeltaD_Theta->Fill(locTrackTimeBased->momentum().Theta()*180./TMath::Pi(), dd); |
417 | dHistMap_FCALShowerDeltaD_DeltaT->Fill(locDeltaT, dd); |
418 | } |
419 | japp->RootUnLock(); |
420 | |
421 | DFCALShowerMatchParams locFCALShowerMatchParams; |
422 | bool foundFCAL = dParticleID->Get_BestFCALMatchParams(locTrackTimeBased, locDetectorMatches, locFCALShowerMatchParams); |
423 | if(foundFCAL){ |
424 | if(locFCALShowerMatchParams.dFCALShower == locFCALShower) { |
425 | DNeutralShower* locNeutralShower = new DNeutralShower(); |
426 | locNeutralShower->dDetectorSystem = SYS_FCAL; |
427 | locNeutralShower->dEnergy = locFCALShowers[loc_j]->getEnergy(); |
428 | locNeutralShower->dSpacetimeVertex.SetVect(locFCALShowers[loc_j]->getPosition()); |
429 | locNeutralShower->dSpacetimeVertex.SetT(locFCALShowers[loc_j]->getTime()); |
430 | locNeutralShower->AddAssociatedObject(locFCALShowers[loc_j]); |
431 | double locFlightTime = locFCALShowerMatchParams.dFlightTime; |
432 | FillShower(locNeutralShower, true, locBeamPhotonTime, locFlightTime); |
433 | delete locNeutralShower; |
434 | } |
435 | } |
436 | } |
437 | } |
438 | |
439 | int nUnmatchedFCAL = 0; |
440 | int nUnmatchedBCAL = 0; |
441 | |
442 | |
443 | |
444 | |
445 | for(size_t loc_j = 0; loc_j < locNeutralShowers.size(); ++loc_j) { |
446 | locUnusedNeutralShowers.push_back(locNeutralShowers[loc_j]); |
447 | double locFlightTime = locNeutralShowers[loc_j]->dSpacetimeVertex.Vect().Mag()/SPEED_OF_LIGHT29.9792; |
448 | FillShower(locNeutralShowers[loc_j], false, locBeamPhotonTime, locFlightTime); |
449 | |
450 | if(locNeutralShowers[loc_j]->dDetectorSystem == SYS_FCAL) { |
451 | nUnmatchedFCAL++; |
452 | } |
453 | if(locNeutralShowers[loc_j]->dDetectorSystem == SYS_BCAL) { |
454 | nUnmatchedBCAL++; |
455 | } |
456 | } |
457 | |
458 | japp->RootWriteLock(); |
459 | { |
460 | dNShowerBCAL_FCAL->Fill(nUnmatchedFCAL, nUnmatchedBCAL); |
461 | } |
462 | japp->RootUnLock(); |
463 | |
464 | return true; |
465 | } |
466 | |
467 | |
468 | void DCustomAction_p2pi_unusedHists::FillTrack(JEventLoop* locEventLoop, const DChargedTrack* locChargedTrack, bool locMatch, const DMCThrown* locMCThrown) |
469 | { |
470 | |
471 | const DChargedTrackHypothesis* locChargedTrackHypothesis = locChargedTrack->Get_BestFOM(); |
472 | int locCharge = locChargedTrackHypothesis->charge(); |
473 | |
474 | const DTrackTimeBased* locTrackTimeBased = NULL__null; |
475 | locChargedTrackHypothesis->GetSingleT(locTrackTimeBased); |
476 | |
477 | double nHits = locTrackTimeBased->Ndof + 5.; |
478 | double locTheta = locTrackTimeBased->momentum().Theta()*180/TMath::Pi(); |
479 | |
480 | set<int> locCDCRings; |
481 | dParticleID->Get_CDCRings(locTrackTimeBased->dCDCRings, locCDCRings); |
482 | |
483 | set<int> locFDCPlanes; |
484 | dParticleID->Get_FDCPlanes(locTrackTimeBased->dFDCPlanes, locFDCPlanes); |
485 | |
486 | double locHitFraction = locTrackTimeBased->dNumHitsMatchedToThrown/nHits; |
487 | double locMomentumRes = -999; |
488 | double locThetaRes = -999; |
489 | if(locMCThrown) { |
490 | locMomentumRes = (locTrackTimeBased->momentum().Mag() - locMCThrown->momentum().Mag())/locMCThrown->momentum().Mag(); |
491 | locThetaRes = (locTrackTimeBased->momentum().Theta() - locMCThrown->momentum().Theta())*180./TMath::Pi(); |
492 | } |
493 | |
494 | japp->RootWriteLock(); |
495 | { |
496 | dHistMap_TrackNhits_Theta[locMatch][locCharge]->Fill(locTheta, nHits); |
497 | dHistMap_TrackNhitsCDC_Theta[locMatch][locCharge]->Fill(locTheta, locCDCRings.size()); |
498 | dHistMap_TrackNhitsFDC_Theta[locMatch][locCharge]->Fill(locTheta, locFDCPlanes.size()); |
499 | if(locTheta>13. && locTheta<16.) |
500 | dHistMap_TrackNhitsFDCVsCDC_Theta13_16[locMatch][locCharge]->Fill(locCDCRings.size(), locFDCPlanes.size()); |
501 | if(locTheta>16. && locTheta<20.) |
502 | dHistMap_TrackNhitsFDCVsCDC_Theta16_20[locMatch][locCharge]->Fill(locCDCRings.size(), locFDCPlanes.size()); |
503 | dHistMap_TrackChiSq_Theta[locMatch][locCharge]->Fill(locTheta, locTrackTimeBased->chisq); |
504 | dHistMap_TrackFOM_Theta[locMatch][locCharge]->Fill(locTheta, locTrackTimeBased->FOM); |
505 | dHistMap_TrackP_Theta[locMatch][locCharge]->Fill(locTheta, locTrackTimeBased->momentum().Mag()); |
506 | dHistMap_TrackPOCAXY[locMatch][locCharge]->Fill(locTrackTimeBased->position().X(), locTrackTimeBased->position().Y()); |
507 | dHistMap_TrackPOCAZ[locMatch][locCharge]->Fill(locTrackTimeBased->position().Z()); |
508 | |
509 | dHistMap_TrackMCHitFraction_Theta[locMatch][locCharge]->Fill(locTrackTimeBased->momentum().Theta()*180.0/TMath::Pi(), locHitFraction); |
510 | if(locMCThrown) { |
511 | dHistMap_TrackMCMomRes_Theta[locMatch][locCharge]->Fill(locTheta, locMomentumRes); |
512 | dHistMap_TrackMCThetaRes_Theta[locMatch][locCharge]->Fill(locTheta, locThetaRes); |
513 | } |
514 | |
515 | for(set<int>::iterator locIterator = locFDCPlanes.begin(); locIterator != locFDCPlanes.end(); ++locIterator) { |
516 | |
517 | } |
518 | |
519 | |
520 | if(locTrackTimeBased->momentum().Theta()*180./TMath::Pi() > 30.){ |
521 | for(set<int>::iterator locIterator = locCDCRings.begin(); locIterator != locCDCRings.end(); ++locIterator) { |
522 | dHistMap_TrackCDCHitRadius_Nhits[locMatch][locCharge]->Fill(nHits, *locIterator); |
523 | if(nHits < 20) dHistMap_LowNDFTrackCDCHitRadius_PT[locMatch][locCharge]->Fill(locTrackTimeBased->momentum().Perp(), *locIterator); |
524 | else dHistMap_HighNDFTrackCDCHitRadius_PT[locMatch][locCharge]->Fill(locTrackTimeBased->momentum().Perp(), *locIterator); |
525 | } |
526 | |
527 | if(nHits < 20){ |
528 | dHistMap_LowNDFTrackP_VertZ[locMatch][locCharge]->Fill(locTrackTimeBased->position().Z(), locTrackTimeBased->momentum().Mag()); |
529 | dHistMap_LowNDFTrackPT_Phi[locMatch][locCharge]->Fill(locTrackTimeBased->momentum().Phi()*180/TMath::Pi(), locTrackTimeBased->momentum().Perp()); |
530 | } |
531 | } |
532 | } |
533 | japp->RootUnLock(); |
534 | |
535 | if(!locMatch) return; |
536 | |
537 | |
538 | Double_t zfcal=625; |
539 | DVector3 fcal_origin(0.0,0.0,zfcal); |
540 | DVector3 fcal_normal(0.0,0.0,1.0); |
541 | DVector3 trkpos(0.0,0.0,0.0); |
542 | DVector3 proj_mom(0.0,0.0,0.0); |
543 | double theta = locTrackTimeBased->momentum().Theta()*180./TMath::Pi(); |
544 | double phi = locTrackTimeBased->momentum().Phi()*180./TMath::Pi(); |
545 | double p = locTrackTimeBased->momentum().Mag(); |
546 | double dEdx = locTrackTimeBased->dEdx()*1e6; |
547 | |
548 | vector<const DFCALHit*> fcalhits; |
549 | locEventLoop->Get(fcalhits); |
550 | if(fcalhits.empty()) return; |
551 | |
552 | if (locTrackTimeBased->rt->GetIntersectionWithPlane(fcal_origin,fcal_normal,trkpos,proj_mom,NULL__null,NULL__null,NULL__null,SYS_FCAL)==NOERROR){ |
553 | double trkposX = trkpos.X(); |
554 | double trkposY = trkpos.Y(); |
555 | int trkrow = dFCALGeometry->row((float)trkposY); |
556 | int trkcol = dFCALGeometry->column((float)trkposX); |
557 | |
558 | |
559 | |
560 | double E9=0; |
561 | double E9peak=0; |
562 | double x9=0; |
563 | double y9=0; |
564 | double t9=0; |
565 | double t9sq=0; |
566 | double t9sigma=0; |
567 | int N9=0; |
568 | int Delta_block=1; |
569 | double dX_E1=-1000; |
570 | double dY_E1=-1000; |
571 | |
572 | int row_offset = 0; |
573 | int col_offset = 0; |
574 | trkrow += row_offset; |
575 | trkcol += col_offset; |
576 | |
577 | for (unsigned int j=0; j < fcalhits.size(); ++j) { |
578 | int row = fcalhits[j]->row; |
579 | int col = fcalhits[j]->column; |
580 | double x = fcalhits[j]->x; |
581 | double y = fcalhits[j]->y; |
582 | double Efcal = fcalhits[j]->E; |
583 | double tfcal= fcalhits[j]->t; |
584 | double intOverPeak = fcalhits[j]->intOverPeak; |
585 | |
586 | |
587 | int drow = abs(row - trkrow); |
588 | int dcol = abs(col - trkcol); |
589 | |
590 | h1_deltaX->Fill(x - trkposX); |
591 | h1_deltaY->Fill(y - trkposY); |
592 | h1_Efcal->Fill(Efcal); |
593 | h1_tfcal->Fill(tfcal); |
594 | |
595 | |
596 | if (drow<=Delta_block && dcol<=Delta_block && (tfcal>-15 && tfcal<50) && (intOverPeak>2.5 && intOverPeak<9)) { |
597 | E9 += Efcal; |
598 | E9peak += Efcal*6/intOverPeak; |
599 | x9 += x; |
600 | y9 += y; |
601 | t9 += tfcal; |
602 | t9sq += tfcal*tfcal; |
603 | N9 += 1; |
604 | |
605 | dX_E1 = x - trkposX; |
606 | dY_E1 = y - trkposY; |
607 | } |
608 | |
609 | } |
610 | |
611 | x9 = N9>0? x9/N9 : 0; |
| Value stored to 'x9' is never read |
612 | y9 = N9>0? y9/N9 : 0; |
613 | t9 = N9>0? t9/N9 : 0; |
614 | t9sigma = N9>0? sqrt(t9sq/N9 - t9*t9): 0; |
615 | |
616 | japp->RootWriteLock(); |
617 | { |
618 | if (N9>0) { |
619 | h1_N9->Fill(N9); |
620 | h1_E9->Fill(E9); |
621 | h1_t9->Fill(t9); |
622 | h1_t9sigma->Fill(t9sigma); |
623 | h2_YvsX9->Fill(trkposX,trkposY); |
624 | h2_dEdx9_vsp->Fill(p,dEdx); |
625 | h2_E9vsp->Fill(p,E9); |
626 | h2_dEdxvsE9->Fill(E9,dEdx); |
627 | h2_E9_vsTheta->Fill(theta,E9); |
628 | h2_E9_vsPhi->Fill(phi,E9); |
629 | } |
630 | if (N9==1) { |
631 | h1_N1->Fill(N9); |
632 | h1_E1->Fill(E9); |
633 | h1_t1->Fill(t9); |
634 | h1_t1sigma->Fill(t9sigma); |
635 | h2_YvsX1->Fill(trkposX,trkposY); |
636 | h2_dEdx1_vsp->Fill(p,dEdx); |
637 | h2_E1vsp->Fill(p,E9); |
638 | h2_dEdxvsE1->Fill(E9,dEdx); |
639 | h2_E1_vsTheta->Fill(theta,E9); |
640 | h2_E1_vsPhi->Fill(phi,E9); |
641 | double Rlocal = sqrt(dX_E1*dX_E1 + dY_E1*dY_E1); |
642 | h2_E1vsRlocal->Fill(Rlocal,E9); |
643 | h2_YvsXcheck->Fill(dX_E1,dY_E1); |
644 | } |
645 | } |
646 | japp->RootUnLock(); |
647 | } |
648 | |
649 | return; |
650 | } |
651 | |
652 | |
653 | void DCustomAction_p2pi_unusedHists::FillShower(const DNeutralShower* locNeutralShower, bool locMatch, double locBeamPhotonTime, double locFlightTime) |
654 | { |
655 | |
656 | int nClusters = 0; |
657 | int nHits = 0; |
658 | |
659 | double layerE[4] = {0., 0., 0., 0.}; |
660 | |
661 | double locEnergy = locNeutralShower->dEnergy; |
662 | DVector3 locPosition = locNeutralShower->dSpacetimeVertex.Vect(); |
663 | double locDeltaT = locNeutralShower->dSpacetimeVertex.T() - locFlightTime - locBeamPhotonTime; |
664 | |
665 | double locEnergyCluster = 0.; |
666 | double locMaxEnergyCluster = 0.; |
667 | |
668 | DetectorSystem_t locSystem = locNeutralShower->dDetectorSystem; |
669 | if(locSystem == SYS_FCAL) { |
670 | |
671 | const DFCALShower* locFCALShower = NULL__null; |
672 | locNeutralShower->GetSingleT(locFCALShower); |
673 | |
674 | vector<const DFCALCluster*> locFCALClusters; |
675 | locFCALShower->Get(locFCALClusters); |
676 | nClusters = locFCALClusters.size(); |
677 | |
678 | |
679 | for(unsigned int i=0; i<locFCALClusters.size(); i++){ |
680 | const vector<DFCALCluster::DFCALClusterHit_t> locFCALHits = locFCALClusters[i]->GetHits(); |
681 | |
682 | locEnergyCluster = locFCALClusters[i]->getEnergy(); |
683 | locMaxEnergyCluster = locFCALClusters[i]->getEmax(); |
684 | |
685 | for(unsigned int j=0; j<locFCALHits.size(); j++){ |
686 | |
687 | nHits++; |
688 | } |
689 | } |
690 | } |
691 | if(locSystem == SYS_BCAL) { |
692 | |
693 | const DBCALShower* locBCALShower = NULL__null; |
694 | locNeutralShower->GetSingleT(locBCALShower); |
695 | |
696 | japp->RootWriteLock(); |
697 | { |
698 | dHistMap_BCALShowerNcell[locMatch]->Fill(locBCALShower->N_cell); |
699 | } |
700 | japp->RootUnLock(); |
701 | |
702 | vector<const DBCALCluster*> locBCALClusters; |
703 | locBCALShower->Get(locBCALClusters); |
704 | nClusters = locBCALClusters.size(); |
705 | |
706 | |
707 | for(unsigned int i=0; i<locBCALClusters.size(); i++){ |
708 | vector<const DBCALPoint*> locBCALPoints; |
709 | locBCALClusters[i]->Get(locBCALPoints); |
710 | |
711 | locEnergyCluster = locBCALClusters[i]->E(); |
712 | if(locBCALPoints.size() == 1) locMaxEnergyCluster = locBCALClusters[i]->E(); |
713 | |
714 | for(unsigned int j=0; j<locBCALPoints.size(); j++){ |
715 | const DBCALPoint *point = locBCALPoints[j]; |
716 | nHits++; |
717 | |
718 | if(point->E() > locMaxEnergyCluster) |
719 | locMaxEnergyCluster = point->E(); |
720 | |
721 | layerE[point->layer()-1] += point->E(); |
722 | } |
723 | } |
724 | } |
725 | |
726 | japp->RootWriteLock(); |
727 | { |
728 | dHistMap_ShowerEnergy_Theta[locMatch][locSystem]->Fill(locPosition.Theta()*180./TMath::Pi(), locEnergy); |
729 | dHistMap_ShowerPhi_Theta[locMatch][locSystem]->Fill(locPosition.Theta()*180./TMath::Pi(), locPosition.Phi()*180./TMath::Pi()); |
730 | dHistMap_ShowerNclusters[locMatch][locSystem]->Fill(nClusters); |
731 | dHistMap_ShowerNhits[locMatch][locSystem]->Fill(nHits); |
732 | |
733 | dHistMap_ShowerMaxEnergy_Nhits[locMatch][locSystem]->Fill(nHits, locMaxEnergyCluster/locEnergyCluster); |
734 | dHistMap_ShowerDeltaT_Nhits[locMatch][locSystem]->Fill(nHits, locDeltaT); |
735 | dHistMap_ShowerDeltaT_E[locMatch][locSystem]->Fill(locEnergy, locDeltaT); |
736 | if(locDeltaT > -5. && locDeltaT < 5. && locSystem == SYS_FCAL) |
737 | dHistMap_ShowerE_Theta[locMatch][locSystem]->Fill(locPosition.Theta()*180./TMath::Pi(), locEnergy); |
738 | if(locDeltaT > -5. && locDeltaT < 5. && locSystem == SYS_BCAL) |
739 | dHistMap_ShowerE_Theta[locMatch][locSystem]->Fill(locPosition.Theta()*180./TMath::Pi(), locEnergy); |
740 | |
741 | if(locSystem == SYS_BCAL) { |
742 | dHistMap_Layer1Energy_Theta[locMatch]->Fill(locPosition.Theta()*180./TMath::Pi(), layerE[0]/locEnergy); |
743 | dHistMap_Layer2Energy_Theta[locMatch]->Fill(locPosition.Theta()*180./TMath::Pi(), layerE[1]/locEnergy); |
744 | dHistMap_Layer3Energy_Theta[locMatch]->Fill(locPosition.Theta()*180./TMath::Pi(), layerE[2]/locEnergy); |
745 | dHistMap_Layer4Energy_Theta[locMatch]->Fill(locPosition.Theta()*180./TMath::Pi(), layerE[3]/locEnergy); |
746 | } |
747 | |
748 | } |
749 | japp->RootUnLock(); |
750 | |
751 | return; |
752 | } |