Bug Summary

File:plugins/Calibration/FCAL_Pi0TOF/JEventProcessor_FCAL_Pi0TOF.cc
Location:line 194, column 12
Description:Value stored to 'xShower1' during its initialization is never read

Annotated Source Code

1// $Id$
2//
3// File: JEventProcessor_FCAL_Pi0TOF.cc
4// Created: Wed Aug 30 16:23:49 EDT 2017
5// Creator: mstaib (on Linux egbert 2.6.32-696.10.1.el6.x86_64 x86_64)
6//
7
8#include "JEventProcessor_FCAL_Pi0TOF.h"
9using namespace jana;
10
11
12// Routine used to create our JEventProcessor
13#include <JANA/JApplication.h>
14#include <JANA/JFactory.h>
15extern "C"{
16 void InitPlugin(JApplication *app){
17 InitJANAPlugin(app);
18 app->AddProcessor(new JEventProcessor_FCAL_Pi0TOF());
19 }
20} // "C"
21
22
23//------------------
24// JEventProcessor_FCAL_Pi0TOF (Constructor)
25//------------------
26JEventProcessor_FCAL_Pi0TOF::JEventProcessor_FCAL_Pi0TOF()
27{
28 DO_METHOD = 0;
29 USE_TRACKS = 0;
30
31 gPARMS->SetDefaultParameter( "FCAL_Pi0TOF:DO_METH0D", DO_METHOD );
32 gPARMS->SetDefaultParameter( "FCAL_Pi0TOF:USE_TRACKS", USE_TRACKS );
33
34 m_time_FCALRF_cut = 3.0;
35 m_time_FCALFCAL_cut = 5.0;
36
37 gPARMS->SetDefaultParameter( "FCAL_Pi0TOF:time_FCALRF_cut", m_time_FCALRF_cut );
38 gPARMS->SetDefaultParameter( "FCAL_Pi0TOF:time_FCALFCAL_cut", m_time_FCALFCAL_cut );
39
40 cout <<"DO_METHOD " << DO_METHOD << " USE_TRACKS " << USE_TRACKS << endl;
41}
42
43//------------------
44// ~JEventProcessor_FCAL_Pi0TOF (Destructor)
45//------------------
46JEventProcessor_FCAL_Pi0TOF::~JEventProcessor_FCAL_Pi0TOF()
47{
48
49}
50
51//------------------
52// init
53//------------------
54jerror_t JEventProcessor_FCAL_Pi0TOF::init(void)
55{
56 // This is called once at program startup.
57
58 gDirectory(ROOT::Internal::TDirectoryAtomicAdapter(TDirectory::CurrentDirectory
()))
->mkdir("FCAL_Pi0");
59 gDirectory(ROOT::Internal::TDirectoryAtomicAdapter(TDirectory::CurrentDirectory
()))
->cd("FCAL_Pi0");
60 hCurrentGainConstants = new TProfile("CurrentGainConstants", "Current Gain Constants", 2800, -0.5, 2799.5);
61 gDirectory(ROOT::Internal::TDirectoryAtomicAdapter(TDirectory::CurrentDirectory
()))
->cd("..");
62
63 return NOERROR;
64}
65
66//------------------
67// brun
68//------------------
69jerror_t JEventProcessor_FCAL_Pi0TOF::brun(JEventLoop *eventLoop, int32_t runnumber)
70{
71 // This is called whenever the run number changes
72
73 // Put the current gain constants into the output file
74 vector< double > raw_gains;
75 // This is called whenever the run number changes
76 eventLoop->GetCalib("/FCAL/gains", raw_gains);
77 for (unsigned int i=0; i<raw_gains.size(); i++){
78 hCurrentGainConstants->Fill(i,raw_gains[i]);
79 }
80 DGeometry* dgeom = NULL__null;
81 DApplication* dapp = dynamic_cast< DApplication* >(eventLoop->GetJApplication());
82 if (dapp) dgeom = dapp->GetDGeometry(runnumber);
83 if (dgeom) {
84 dgeom->GetTargetZ(m_targetZ);
85 } else {
86 cerr << "No geometry accessbile to ccal_timing monitoring plugin." << endl;
87 return RESOURCE_UNAVAILABLE;
88 }
89 jana::JCalibration *jcalib = japp->GetJCalibration(runnumber);
90 std::map<string, float> beam_spot;
91 jcalib->Get("PHOTON_BEAM/beam_spot", beam_spot);
92 m_beamSpotX = beam_spot.at("x");
93 m_beamSpotY = beam_spot.at("y");
94 return NOERROR;
95}
96
97//------------------
98// evnt
99//------------------
100jerror_t JEventProcessor_FCAL_Pi0TOF::evnt(JEventLoop *loop, uint64_t eventnumber)
101{
102 // This is called for every event. Use of common resources like writing
103 // to a file or filling a histogram should be mutex protected. Using
104 // loop->Get(...) to get reconstructed objects (and thereby activating the
105 // reconstruction algorithm) should be done outside of any mutex lock
106 // since multiple threads may call this method at the same time.
107 // Here's an example:
108 //
109 // vector<const MyDataClass*> mydataclasses;
110 // loop->Get(mydataclasses);
111 //
112 // japp->RootFillLock(this);
113 // ... fill historgrams or trees ...
114 // japp->RootFillUnLock(this);
115 vector<const DFCALGeometry*> fcalGeomVect;
116 loop->Get( fcalGeomVect );
117 if (fcalGeomVect.size() < 1)
118 return OBJECT_NOT_AVAILABLE;
119 const DFCALGeometry& fcalGeom = *(fcalGeomVect[0]);
120
121 vector<const DNeutralParticle *> neutralParticleVector;
122 loop->Get(neutralParticleVector);
123
124 vector<const DTOFPoint*> tof_points;
125 loop->Get(tof_points);
126
127 vector<const DVertex*> kinfitVertex;
128 loop->Get(kinfitVertex);
129
130 vector<const DL1Trigger *> locL1Triggers;
131 vector<const DBeamPhoton *> locBeamPhotons;
132 loop->Get(locL1Triggers);
133 loop->Get(locBeamPhotons);
134 /*
135 const DEventRFBunch * locEventRFBunches = NULL; try {
136 loop->GetSingle(locEventRFBunches, "CalorimeterOnly" );
137 } catch (...) {
138 return NOERROR;
139 }
140 double locRFTime = locEventRFBunches->dTime;
141 if(locEventRFBunches->dNumParticleVotes < 3 )
142 return NOERROR;
143 */
144 vector<const DEventRFBunch*> locEventRFBunches;
145 loop->Get(locEventRFBunches);
146 double locRFTime = locEventRFBunches.empty() ? 0.0 : locEventRFBunches[0]->dTime;
147
148 uint32_t locL1Trigger_fp = locL1Triggers.empty() ? 0.0 : locL1Triggers[0]->fp_trig_mask;
149 uint32_t locL1Trigger = locL1Triggers.empty() ? 0.0 : locL1Triggers[0]->trig_mask;
150
151 int trig_bit[33];
152 if (locL1Triggers.size() > 0) {
153 for (unsigned int bit = 0; bit < 32; bit ++) {
154 trig_bit[bit + 1] = (locL1Triggers[0]->trig_mask & (1 << bit)) ? 1 : 0;
155 if(trig_bit[bit + 1] == 1) //htrig_bit->Fill(Float_t(bit+1));
156 Fill1DHistogram("FCAL_Pi0HFA","","trig_bit",
157 Float_t(bit+1),
158 ";Trigger bit #;Count [a.u.]",
159 100, 0., 100.);
160
161 }
162 }
163
164 DVector3 vertex;
165 vertex.SetXYZ(m_beamSpotX, m_beamSpotY, m_targetZ);
166
167 //Use kinfit when available
168 double kinfitVertexX = m_beamSpotX;
169 double kinfitVertexY = m_beamSpotY;
170 double kinfitVertexZ = m_targetZ;
171
172 vector< const JObject* > locObjectsToSave;
173 if (USE_TRACKS == 0) {
174 for (unsigned int i = 0 ; i < kinfitVertex.size(); i++) {
175 kinfitVertexX = kinfitVertex[i]->dSpacetimeVertex.X();
176 kinfitVertexY = kinfitVertex[i]->dSpacetimeVertex.Y();
177 kinfitVertexZ = kinfitVertex[i]->dSpacetimeVertex.Z();
178 }
179 }
180
181 for (unsigned int i = 0; i < neutralParticleVector.size(); i++){
182 const DNeutralParticleHypothesis *photon1 = neutralParticleVector[i]->Get_Hypothesis(Gamma);
183 //bool bo_pho1 = true;
184 //if( photon1 == nullptr && (USE_TRACKS == 0 || USE_TRACKS == 2)) bo_pho1 = false;
185 if( photon1 == nullptr && (USE_TRACKS == 0 || USE_TRACKS == 2)) continue;
186 // Go into the FCAL shower and find the largest energy deposition
187 const DNeutralShower *shower1 = photon1->Get_NeutralShower();
188 if(shower1->dDetectorSystem != SYS_FCAL) continue;
189 DFCALShower *fcalShower1 = (DFCALShower *) shower1->dBCALFCALShower;
190 const DFCALCluster *fcalCluster1;
191 fcalShower1->GetSingle(fcalCluster1);
192 int ch1 = fcalCluster1->getChannelEmax();
193 double emax1 = fcalCluster1->getEmax();
194 double xShower1=fcalShower1->getPosition().X();
Value stored to 'xShower1' during its initialization is never read
195 double yShower1=fcalShower1->getPosition().Y();
196 double zShower1=fcalShower1->getPosition().Z();
197 double xShowerlog1=fcalShower1->getPosition_log().X();
198 double yShowerlog1=fcalShower1->getPosition_log().Y();
199 double zShowerlog1=fcalShower1->getPosition_log().Z();
200 xShower1 = xShowerlog1;
201 yShower1 = yShowerlog1;
202 zShower1 = zShowerlog1;
203 int row = fcalGeom.row(static_cast<float>(yShowerlog1));
204 int col = fcalGeom.column(static_cast<float>(xShowerlog1));
205 double x1 = xShower1 - kinfitVertexX;
206 double y1 = yShower1 - kinfitVertexY;
207 double z1 = zShower1 - kinfitVertexZ;
208 double xl1 = xShowerlog1 - kinfitVertexX;
209 double yl1 = yShowerlog1 - kinfitVertexY;
210 double zl1 = zShowerlog1 - kinfitVertexZ;
211 double radiusShower1=sqrt(pow(xShower1,2)+pow(yShower1,2));
212 double radiusShowerlog1=sqrt(pow(xShowerlog1,2)+pow(yShowerlog1,2));
213 double radius1 = fcalGeom.positionOnFace(ch1).Mod();
214 int ring1 = (int) (radius1 / (5 * k_cm));
215 int rings1 = (int) (radiusShower1 / (5 * k_cm));
216 int ringl1 = (int) (radiusShowerlog1 / (5 * k_cm));
217
218 double frac_ring_thres = frac_thres_1_to_5;
219 if (ring1 >= 6)
220 frac_ring_thres = frac_thres_6_to_23;
221 double frac_rings_thres = frac_thres_1_to_5;
222 if (rings1 >= 6)
223 frac_rings_thres = frac_thres_6_to_23;
224 double frac_ringl_thres = frac_thres_1_to_5;
225 if (ringl1 >= 6)
226 frac_ringl_thres = frac_thres_6_to_23;
227
228 double frac1 = fcalCluster1->getEmax()/fcalCluster1->getEnergy();
229 double Eclust1 = fcalCluster1->getEnergy();
230 double Ephoton1 = photon1->lorentzMomentum().E();
231 DVector3 vertex1(xl1, yl1, zl1);
232 double r1 = vertex1.Mag();
233 double t1 = fcalShower1->getTime() - (r1 / TMath::C() * 1e7);
234 double p1 = Ephoton1 ;
235 double p1x = p1 * sin(vertex1.Theta()) * cos(vertex1.Phi());
236 double p1y = p1 * sin(vertex1.Theta()) * sin(vertex1.Phi());
237 double p1z = p1 * cos(vertex1.Theta());
238 TLorentzVector photon1P4(p1x, p1y, p1z, p1);
239 double tdiff1 = t1 - locRFTime;
240
241 Fill2DHistogram("XY","","xy_all", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
242 Fill2DHistogram("CR","","xy_all", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
243 if (emax1 > 1.0) {
244 Fill2DHistogram("XY","","xy_1GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
245 Fill2DHistogram("CR","","xy_1GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
246 }
247 if (emax1 > 2.0) {
248 Fill2DHistogram("XY","","xy_2GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
249 Fill2DHistogram("CR","","xy_2GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
250 }
251 if (emax1 > 3.0) {
252 Fill2DHistogram("XY","","xy_3GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
253 Fill2DHistogram("CR","","xy_3GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
254 }
255 if (emax1 > 4.0) {
256 Fill2DHistogram("XY","","xy_4GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
257 Fill2DHistogram("CR","","xy_4GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
258 }
259 if (emax1 > 5.0) {
260 Fill2DHistogram("XY","","xy_5GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
261 Fill2DHistogram("CR","","xy_5GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
262 }
263 if (emax1 > 6.0) {
264 Fill2DHistogram("XY","","xy_6GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
265 Fill2DHistogram("CR","","xy_6GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
266 }
267 if (emax1 > 7.0) {
268 Fill2DHistogram("XY","","xy_7GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
269 Fill2DHistogram("CR","","xy_7GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
270 }
271 if (emax1 > 8.0) {
272 Fill2DHistogram("XY","","xy_8GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
273 Fill2DHistogram("CR","","xy_8GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
274 }
275 if (emax1 > 9.0) {
276 Fill2DHistogram("XY","","xy_9GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
277 Fill2DHistogram("CR","","xy_9GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
278 }
279 if (emax1 > 10.0) {
280 Fill2DHistogram("XY","","xy_10GeV", xl1, yl1, ";x [cm];y [cm];Counts", 500, -125., 125., 500, -125., 125.);
281 Fill2DHistogram("CR","","xy_10GeV", col - 29, row - 29, ";Column;Row;Counts", 59, -30, 30, 59, -30, 30);
282 }
283
284 Fill1DHistogram("FCAL_Pi0HFA","","tdiff1", tdiff1, ";t_{#gamma}^{1} - t_{RF} [ns];Count [a.u.]", 1000, -99., 99.);
285 Fill1DHistogram("FCAL_Pi0HFA","","E", Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
286 Fill1DHistogram("FCAL_Pi0HFA","","P", Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
287 Fill1DHistogram("FCAL_Pi0HFA","","Emax", emax1, ";E_{max};Count [a.u.]", 12000, 0., 12.);
288 Fill1DHistogram("FCAL_Pi0HFA","",Form("Emax_ring_%d", ring1), emax1, ";E_{max};Count [a.u.]", 12000, 0., 12.);
289 Fill1DHistogram("FCAL_Pi0HFA","",Form("E_ring_%d", ring1), Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
290 Fill1DHistogram("FCAL_Pi0HFA","",Form("P_ring_%d", ring1), Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
291 Fill1DHistogram("FCAL_Pi0HFA","",Form("E_rings_%d", rings1), Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
292 Fill1DHistogram("FCAL_Pi0HFA","",Form("P_rings_%d", rings1), Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
293 Fill1DHistogram("FCAL_Pi0HFA","",Form("E_ringl_%d", ringl1), Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
294 Fill1DHistogram("FCAL_Pi0HFA","",Form("P_ringl_%d", ringl1), Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
295 if(radiusShower1 < 108.4239 && radiusShower1 > 20.785){
296 Fill1DHistogram("FCAL_Pi0HFA","","E_cut", Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
297 Fill1DHistogram("FCAL_Pi0HFA","","P_cut", Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
298 }
299 if(radiusShowerlog1 < 108.4239 && radiusShowerlog1 > 20.785){
300 Fill1DHistogram("FCAL_Pi0HFA","","E_cutlog", Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
301 Fill1DHistogram("FCAL_Pi0HFA","","P_cutlog", Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
302 }
303
304 int tof_match1 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x1, y1, z1);
305 int ltof_match1 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x1, y1, z1);
306 for (vector< const DTOFPoint* >::const_iterator tof_p = tof_points.begin(); tof_p != tof_points.end(); tof_p++ ) {
307
308 double xtof = (*tof_p)->pos.X() - kinfitVertexX;
309 double ytof = (*tof_p)->pos.Y() - kinfitVertexY;
310 double ztof = (*tof_p)->pos.Z() - kinfitVertexZ;
311 double xltof = (*tof_p)->pos.X() - kinfitVertexX;
312 double yltof = (*tof_p)->pos.Y() - kinfitVertexY;
313 double zltof = (*tof_p)->pos.Z() - kinfitVertexZ;
314
315 //double rtof = sqrt(xtof*xtof + ytof*ytof + ztof*ztof );
316 //double ttof = (*tof_p)->t - (rtof/TMath::C());
317
318 xtof = xtof * (z1 / ztof);
319 ytof = ytof * (z1 / ztof);
320 xltof = xltof * (zl1 / zltof);
321 yltof = yltof * (zl1 / zltof);
322
323 int hbar = (*tof_p)->dHorizontalBar;
324 int hstat = (*tof_p)->dHorizontalBarStatus;
325 int vbar = (*tof_p)->dVerticalBar;
326 int vstat = (*tof_p)->dVerticalBarStatus;
327
328 double dx, dy;
329 if( hstat==3 && vstat==3 ) {
330 dx = x1 - xtof;
331 dy = y1 - ytof;
332 } else if( vstat==3 ) {
333 dx = x1 - bar2x(vbar)*(z1 / ztof);
334 dy = y1 - ytof;
335 } else if( hstat==3 ) {
336 dx = x1 - xtof;
337 dy = y1 - bar2x(hbar)*(z1 / ztof);
338 } else {
339 dx = x1 - bar2x(vbar)*(z1 / ztof);
340 dy = y1 - bar2x(hbar)*(z1 / ztof);
341 }
342
343 double dlx, dly;
344 if( hstat==3 && vstat==3 ) {
345 dlx = xl1 - xltof;
346 dly = yl1 - yltof;
347 } else if( vstat==3 ) {
348 dlx = xl1 - bar2x(vbar)*(zl1 / zltof);
349 dly = yl1 - yltof;
350 } else if( hstat==3 ) {
351 dlx = xl1 - xltof;
352 dly = yl1 - bar2x(hbar)*(zl1 / zltof);
353 } else {
354 dlx = xl1 - bar2x(vbar)*(zl1 / zltof);
355 dly = yl1 - bar2x(hbar)*(zl1 / zltof);
356 }
357
358
359 if( fabs(dx) < 6. && fabs(dy) < 6. ) {
360 //if( dt > -1. && dt < 3. ) tof_match = 1;
361 tof_match1 = 1;
362 }
363 if( fabs(dlx) < 6. && fabs(dly) < 6. ) {
364 //if( dt > -1. && dt < 3. ) tof_match = 1;
365 ltof_match1 = 1;
366 }
367 } // end DTOFPoint loop
368
369 for (unsigned int j = i + 1; j < neutralParticleVector.size(); j ++){
370 const DNeutralParticleHypothesis *photon2 = neutralParticleVector[j]->Get_Hypothesis(Gamma);
371 //bool bo_pho2 = true;
372 //if (photon2 == nullptr && (USE_TRACKS == 0 || USE_TRACKS == 2)) bo_pho2 = false;
373 if (photon2 == nullptr && (USE_TRACKS == 0 || USE_TRACKS == 2)) continue;
374 const DNeutralShower *shower2 = photon2->Get_NeutralShower();
375 if(shower2->dDetectorSystem != SYS_FCAL) continue;
376 DFCALShower *fcalShower2 = (DFCALShower *) shower2->dBCALFCALShower;
377 const DFCALCluster *fcalCluster2;
378 fcalShower2->GetSingle(fcalCluster2);
379 int ch2 = fcalCluster2->getChannelEmax();
380 double xShower2=fcalShower2->getPosition().X();
381 double yShower2=fcalShower2->getPosition().Y();
382 double zShower2=fcalShower1->getPosition().Z();
383 double xShowerlog2=fcalShower2->getPosition_log().X();
384 double yShowerlog2=fcalShower2->getPosition_log().Y();
385 double zShowerlog2=fcalShower2->getPosition_log().Z();
386 xShower2 = xShowerlog2;
387 yShower2 = yShowerlog2;
388 zShower2 = zShowerlog2;
389 double x2 = xShower2 - kinfitVertexX;
390 double y2 = yShower2 - kinfitVertexY;
391 double z2 = zShower2 - kinfitVertexZ;
392 double xl2 = xShowerlog2 - kinfitVertexX;
393 double yl2 = yShowerlog2 - kinfitVertexY;
394 double zl2 = zShowerlog2 - kinfitVertexZ;
395 double radiusShower2=sqrt(pow(xShower2,2)+pow(yShower2,2));
396 double radiusShowerlog2=sqrt(pow(xShowerlog2,2)+pow(yShowerlog2,2));
397 double radius2 = fcalGeom.positionOnFace(ch2).Mod();
398 int ring2 = (int) (radius2 / (5 * k_cm));
399 int rings2 = (int) (radiusShower2 / (5 * k_cm));
400 int ringl2 = (int) (radiusShowerlog2 / (5 * k_cm));
401
402 double frac_ring_thres = frac_thres_1_to_5;
403 if (ring2 >= 6)
404 frac_ring_thres = frac_thres_6_to_23;
405 double frac_rings_thres = frac_thres_1_to_5;
406 if (rings2 >= 6)
407 frac_rings_thres = frac_thres_6_to_23;
408 double frac_ringl_thres = frac_thres_1_to_5;
409 if (ringl2 >= 6)
410 frac_ringl_thres = frac_thres_6_to_23;
411
412 double frac2 = fcalCluster2->getEmax()/fcalCluster2->getEnergy();
413 double Eclust2 = fcalCluster2->getEnergy();
414 double Ephoton2 = photon2->lorentzMomentum().E();
415 DVector3 vertex2(xl2, yl2, zl2);
416 double r2 = vertex2.Mag();
417 double t2 = fcalShower2->getTime() - (r2 / TMath::C() * 1e7);
418 double p2 = Ephoton2;
419 double p2x = p2 * sin(vertex2.Theta()) * cos(vertex2.Phi());
420 double p2y = p2 * sin(vertex2.Theta()) * sin(vertex2.Phi());
421 double p2z = p2 * cos(vertex2.Theta());
422 TLorentzVector photon2P4(p2x, p2y, p2z, p2);
423 double tdiff2 = t2 - locRFTime;
424
425 Fill1DHistogram("FCAL_Pi0HFA","","tdiff2", tdiff2, ";t_{#gamma}^{2} - t_{RF} [ns];Count [a.u.]", 1000, -99., 99.);
426 double Eratio = Eclust1 / Eclust2;
427 bool bo_5p = false;
428 bool bo_10p = false;
429 bool bo_20p = false;
430 bool bo_30p = false;
431 if (0.95 <= Eratio && Eratio <= 1.05) bo_5p = true;
432 if (0.90 <= Eratio && Eratio <= 1.10) bo_10p = true;
433 if (0.80 <= Eratio && Eratio <= 1.20) bo_20p = true;
434 if (0.70 <= Eratio && Eratio <= 1.30) bo_30p = true;
435 double pi0Mass = (photon1->lorentzMomentum() + photon2->lorentzMomentum()).M();
436 double pi0Masslog = (photon1P4 + photon2P4).M();
437 pi0Mass = pi0Masslog;
438 double theta_pi0 = (photon1->lorentzMomentum() + photon2->lorentzMomentum()).Theta() * TMath::RadToDeg();
439 double pi0P = (photon1->lorentzMomentum() + photon2->lorentzMomentum()).P();
440 double theta_pi0log = (photon1P4 + photon2P4).Theta() * TMath::RadToDeg();
441 theta_pi0 = theta_pi0log;
442 double pi0E = (photon1P4 + photon2P4).E();
443 double pi0Plog = (photon1P4 + photon2P4).P();
444 pi0P = pi0Plog;
445 double avgE = 0.5*fcalCluster1->getEnergy() + 0.5*fcalCluster2->getEnergy();
446 DVector3 distance = vertex1 - vertex2;
447 double d = distance.Mag();
448 bool api0 = false;
449 bool aeta = false;
450 if (0.11 <= pi0Masslog && pi0Masslog <= 0.16) api0 = true;
451 if (0.51 <= pi0Masslog && pi0Masslog <= 0.58) aeta = true;
452
453 int tof_match2 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x2, y2, z2);
454 int ltof_match2 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x2, y2, z2);
455 for (vector< const DTOFPoint* >::const_iterator tof_p = tof_points.begin(); tof_p != tof_points.end(); tof_p++ ) {
456
457 double xtof = (*tof_p)->pos.X() - kinfitVertexX;
458 double ytof = (*tof_p)->pos.Y() - kinfitVertexY;
459 double ztof = (*tof_p)->pos.Z() - kinfitVertexZ;
460 double xltof = (*tof_p)->pos.X() - kinfitVertexX;
461 double yltof = (*tof_p)->pos.Y() - kinfitVertexY;
462 double zltof = (*tof_p)->pos.Z() - kinfitVertexZ;
463
464 //double rtof = sqrt(xtof*xtof + ytof*ytof + ztof*ztof );
465 //double ttof = (*tof_p)->t - (rtof/TMath::C());
466
467 xtof = xtof * (z2 / ztof);
468 ytof = ytof * (z2 / ztof);
469 xltof = xltof * (zl2 / zltof);
470 yltof = yltof * (zl2 / zltof);
471
472 int hbar = (*tof_p)->dHorizontalBar;
473 int hstat = (*tof_p)->dHorizontalBarStatus;
474 int vbar = (*tof_p)->dVerticalBar;
475 int vstat = (*tof_p)->dVerticalBarStatus;
476
477 double dx, dy;
478 if( hstat==3 && vstat==3 ) {
479 dx = x2 - xtof;
480 dy = y2 - ytof;
481 } else if( vstat==3 ) {
482 dx = x2 - bar2x(vbar)*(z2 / ztof);
483 dy = y2 - ytof;
484 } else if( hstat==3 ) {
485 dx = x2 - xtof;
486 dy = y2 - bar2x(hbar)*(z2 / ztof);
487 } else {
488 dx = x2 - bar2x(vbar)*(z2 / ztof);
489 dy = y2 - bar2x(hbar)*(z2 / ztof);
490 }
491
492 double dlx, dly;
493 if( hstat==3 && vstat==3 ) {
494 dlx = xl2 - xltof;
495 dly = yl2 - yltof;
496 } else if( vstat==3 ) {
497 dlx = xl2 - bar2x(vbar)*(zl2 / zltof);
498 dly = yl2 - yltof;
499 } else if( hstat==3 ) {
500 dlx = xl2 - xltof;
501 dly = yl2 - bar2x(hbar)*(zl2 / zltof);
502 } else {
503 dlx = xl2 - bar2x(vbar)*(zl2 / zltof);
504 dly = yl2 - bar2x(hbar)*(zl2 / zltof);
505 }
506
507 if( fabs(dx) < 6. && fabs(dy) < 6. ) {
508 //if( dt > -1. && dt < 3. ) tof_match = 1;
509 tof_match2 = 1;
510 }
511 if( fabs(dlx) < 6. && fabs(dly) < 6. ) {
512 //if( dt > -1. && dt < 3. ) tof_match = 1;
513 ltof_match2 = 1;
514 }
515 } // end DTOFPoint loop
516
517 if (((tof_match1 == 0 && tof_match2 == 0) || (ltof_match1 == 0 && ltof_match2 == 0)) &&
518 (fabs(tdiff1) < m_time_FCALRF_cut) && (fabs(tdiff2) < m_time_FCALRF_cut) &&
519 (fabs(t1-t2) < m_time_FCALFCAL_cut)) {
520
521 //if (bo_pho1 && bo_pho2) {
522 if (DO_METHOD == 0) {
523 Fill1DHistogram("FCAL_Pi0HFA","","Pi0Mass",
524 pi0Mass,
525 "#pi^{0} Mass; #pi^{0} Mass;",
526 500, 0.05, 0.7);
527 Fill1DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass_ring_%d", ring1),
528 pi0Mass,
529 "#pi^{0} Mass; #pi^{0} Mass;",
530 500, 0.05, 0.7);
531 Fill1DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass_ring_%d", ring2),
532 pi0Mass,
533 "#pi^{0} Mass; #pi^{0} Mass;",
534 500, 0.05, 0.7);
535 if (neutralParticleVector.size() == 2) {
536 Fill1DHistogram("FCAL_Pi0HFA","","Pi0Mass2g",
537 pi0Mass,
538 "#pi^{0} Mass; #pi^{0} Mass;",
539 500, 0.05, 0.7);
540 Fill1DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2g_ring_%d", ring1),
541 pi0Mass,
542 "#pi^{0} Mass; #pi^{0} Mass;",
543 500, 0.05, 0.7);
544 Fill1DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2g_ring_%d", ring2),
545 pi0Mass,
546 "#pi^{0} Mass; #pi^{0} Mass;",
547 500, 0.05, 0.7);
548 }
549 if(frac1 > frac_ring_thres){
550 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum",
551 ch1, pi0Mass,
552 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
553 2800, -0.5, 2799.5, 500, 0.05, 0.7);
554
555 if(radiusShower2<108.4239 && radiusShower2>20.785){
556 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_Fid",
557 ch1, pi0Mass,
558 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
559 2800, -0.5, 2799.5, 500, 0.05, 0.7);
560 if(radiusShower1<108.4239 && radiusShower1>20.785){
561 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_FidBoth",
562 ch1, pi0Mass,
563 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
564 2800, -0.5, 2799.5, 500, 0.05, 0.7);
565 }
566 }
567 if(radiusShower1<20.785 || radiusShower2<20.785){
568 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_InnerRing",
569 ch1, pi0Mass,
570 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
571 2800, -0.5, 2799.5, 500, 0.05, 0.7);
572 }
573
574 }
575 if(frac2 > frac_ring_thres){
576 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum",
577 ch2, pi0Mass,
578 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
579 2800, -0.5, 2799.5, 500, 0.05, 0.7);
580 if(radiusShower1<108.4239 && radiusShower1>20.785){
581 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_Fid",
582 ch2, pi0Mass,
583 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
584 2800, -0.5, 2799.5, 500, 0.05, 0.7);
585 if(radiusShower2<108.4239 && radiusShower2>20.785){
586 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_FidBoth",
587 ch2, pi0Mass,
588 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
589 2800, -0.5, 2799.5, 500, 0.05, 0.7);
590 }
591 }
592 if(radiusShower1<20.785 || radiusShower2<20.785){
593 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_InnerRing",
594 ch1, pi0Mass,
595 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
596 2800, -0.5, 2799.5, 500, 0.05, 0.7);
597 }
598
599 }
600 // Energy Weighted Pi0 Mass
601 for(auto hit : fcalCluster1->GetHits()){
602 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted",
603 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy(),
604 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
605 2800, -0.5, 2799.5, 500, 0.05, 0.7);
606 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared",
607 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()),
608 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
609 2800, -0.5, 2799.5, 500, 0.05, 0.7);
610 if(radiusShower2<108.4239 && radiusShower2>20.785){
611 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_Fid",
612 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy(),
613 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
614 2800, -0.5, 2799.5, 500, 0.05, 0.7);
615 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_Fid",
616 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()),
617 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
618 2800, -0.5, 2799.5, 500, 0.05, 0.7);
619 if(radiusShower1<108.4239 && radiusShower1>20.785){
620 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_FidBoth",
621 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy(),
622 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
623 2800, -0.5, 2799.5, 500, 0.05, 0.7);
624 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_FidBoth",
625 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()),
626 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
627 2800, -0.5, 2799.5, 500, 0.05, 0.7);
628 }
629 }
630
631 }
632
633 for(auto hit : fcalCluster2->GetHits()){
634 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted",
635 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy(),
636 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
637 2800, -0.5, 2799.5, 500, 0.05, 0.7);
638 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared",
639 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()),
640 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
641 2800, -0.5, 2799.5, 500, 0.05, 0.7);
642 if(radiusShower1<108.4239 && radiusShower1>20.785){
643 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_Fid",
644 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy(),
645 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
646 2800, -0.5, 2799.5, 500, 0.05, 0.7);
647 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_Fid",
648 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()),
649 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
650 2800, -0.5, 2799.5, 500, 0.05, 0.7);
651 if(radiusShower2<108.4239 && radiusShower2>20.785){
652 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_FidBoth",
653 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy(),
654 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
655 2800, -0.5, 2799.5, 500, 0.05, 0.7);
656 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_FidBoth",
657 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()),
658 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
659 2800, -0.5, 2799.5, 500, 0.05, 0.7);
660 }
661 }
662
663 }
664 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_ring_%d", ring1),
665 avgE, pi0Mass,
666 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
667 100, 0.0, 10.0, 500, 0.05, 0.7);
668 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_ring_%d", ring2),
669 avgE, pi0Mass,
670 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
671 100, 0.0, 10.0, 500, 0.05, 0.7);
672 if (bo_5p){
673 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_5_ring_%d", ring1),
674 avgE, pi0Mass,
675 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
676 100, 0.0, 10.0, 500, 0.05, 0.7);
677 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_5_ring_%d", ring2),
678 avgE, pi0Mass,
679 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
680 100, 0.0, 10.0, 500, 0.05, 0.7);
681 }
682 if (bo_10p){
683 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_10_ring_%d", ring1),
684 avgE, pi0Mass,
685 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
686 100, 0.0, 10.0, 500, 0.05, 0.7);
687 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_10_ring_%d", ring2),
688 avgE, pi0Mass,
689 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
690 100, 0.0, 10.0, 500, 0.05, 0.7);
691 }
692 if (bo_20p){
693 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_20_ring_%d", ring1),
694 avgE, pi0Mass,
695 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
696 100, 0.0, 10.0, 500, 0.05, 0.7);
697 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_20_ring_%d", ring2),
698 avgE, pi0Mass,
699 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
700 100, 0.0, 10.0, 500, 0.05, 0.7);
701 }
702 if (bo_30p){
703 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_30_ring_%d", ring1),
704 avgE, pi0Mass,
705 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
706 100, 0.0, 10.0, 500, 0.05, 0.7);
707 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0MassVsE_30_ring_%d", ring2),
708 avgE, pi0Mass,
709 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
710 100, 0.0, 10.0, 500, 0.05, 0.7);
711 }
712 if (neutralParticleVector.size() == 2) {
713 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_ring_%d", ring1),
714 avgE, pi0Mass,
715 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
716 100, 0.0, 10.0, 500, 0.05, 0.7);
717 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_ring_%d", ring2),
718 avgE, pi0Mass,
719 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
720 100, 0.0, 10.0, 500, 0.05, 0.7);
721 if (bo_5p){
722 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_5_ring_%d", ring1),
723 avgE, pi0Mass,
724 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
725 100, 0.0, 10.0, 500, 0.05, 0.7);
726 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_5_ring_%d", ring2),
727 avgE, pi0Mass,
728 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
729 100, 0.0, 10.0, 500, 0.05, 0.7);
730 }
731 if (bo_10p){
732 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_10_ring_%d", ring1),
733 avgE, pi0Mass,
734 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
735 100, 0.0, 10.0, 500, 0.05, 0.7);
736 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_10_ring_%d", ring2),
737 avgE, pi0Mass,
738 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
739 100, 0.0, 10.0, 500, 0.05, 0.7);
740 }
741 if (bo_20p){
742 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_20_ring_%d", ring1),
743 avgE, pi0Mass,
744 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
745 100, 0.0, 10.0, 500, 0.05, 0.7);
746 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_20_ring_%d", ring2),
747 avgE, pi0Mass,
748 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
749 100, 0.0, 10.0, 500, 0.05, 0.7);
750 }
751 if (bo_30p){
752 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_30_ring_%d", ring1),
753 avgE, pi0Mass,
754 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
755 100, 0.0, 10.0, 500, 0.05, 0.7);
756 Fill2DHistogram("FCAL_Pi0HFA","",Form("Pi0Mass2gVsE_30_ring_%d", ring2),
757 avgE, pi0Mass,
758 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
759 100, 0.0, 10.0, 500, 0.05, 0.7);
760 }
761 }
762 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.25){
763 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE",
764 avgE, pi0Mass,
765 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
766 100, 0.0, 10.0, 500, 0.05, 0.7);
767 if(radiusShower2<108.4239 && radiusShower2>20.785){
768 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_Fiducial",
769 avgE, pi0Mass,
770 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
771 100, 0.0, 10.0, 500, 0.05, 0.7);
772 if(radiusShower1<108.4239 && radiusShower1>20.785){
773 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_FiducialBoth",
774 avgE, pi0Mass,
775 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
776 100, 0.0, 10.0, 500, 0.05, 0.7);
777 }
778 }
779
780 }
781 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.5){
782 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_500",
783 avgE, pi0Mass,
784 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
785 100, 0.0, 10.0, 500, 0.05, 0.7);
786
787 if(radiusShower2<108.4239 && radiusShower2>20.785){
788 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_500_Fiducial",
789 avgE, pi0Mass,
790 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
791 100, 0.0, 10.0, 500, 0.05, 0.7);
792 if(radiusShower1<108.4239 && radiusShower1>20.785){
793 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_500_FiducialBoth",
794 avgE, pi0Mass,
795 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
796 100, 0.0, 10.0, 500, 0.05, 0.7);
797 }
798 }
799
800 }
801 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.1){
802 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_100",
803 avgE, pi0Mass,
804 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
805 100, 0.0, 10.0, 500, 0.05, 0.7);
806
807 if(radiusShower2<108.4239 && radiusShower2>20.785){
808 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_100_Fiducial",
809 avgE, pi0Mass,
810 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
811 100, 0.0, 10.0, 500, 0.05, 0.7);
812 if(radiusShower1<108.4239 && radiusShower1>20.785){
813 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_100_FiducialBoth",
814 avgE, pi0Mass,
815 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
816 100, 0.0, 10.0, 500, 0.05, 0.7);
817 }
818 }
819 }
820 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.05){
821 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_50",
822 avgE, pi0Mass,
823 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
824 100, 0.0, 10.0, 500, 0.05, 0.7);
825 if(radiusShower2<108.4239 && radiusShower2>20.785){
826 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_50_Fiducial",
827 avgE, pi0Mass,
828 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
829 100, 0.0, 10.0, 500, 0.05, 0.7);
830 if(radiusShower1<108.4239 && radiusShower1>20.785){
831 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_50_FiducialBoth",
832 avgE, pi0Mass,
833 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
834 100, 0.0, 10.0, 500, 0.05, 0.7);
835 }
836 }
837 }
838 }
839 //}
840
841 if (DO_METHOD == 1 || DO_METHOD == 2) {
842 for (unsigned int k = 0; k < (int) locBeamPhotons.size(); k ++) {
843
844 const DBeamPhoton *ebeam = locBeamPhotons[k];
845 //double eb = ebeam->lorentzMomentum().E();
846 double tb = ebeam->time();
847 double zb = ebeam->position().Z();
848 double eb = ebeam->lorentzMomentum().E();
849 double locDeltaTRF = tb - (locRFTime + (zb - m_targetZ) / 29.9792458);
850 Fill1DHistogram("FCAL_Pi0TOF","","TaggerTiming1", locDeltaTRF, ";t_{e^{-}} - t_{#gamma} [ns];Count [a.u.]", 500, -100., 100.);
851 //Fill2DWeightedHistogram("FCAL_Pi0TOF","","PhotonTiming1", t1 - t2, pi0Masslog, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100.);
852 //Fill2DWeightedHistogram("FCAL_Pi0TOF","","PhotonTiming1", t2 - t1, pi0Masslog, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100.);
853 double weight = 0;
854 if (fabs(locDeltaTRF) <= 2.004) {
855 weight = 1;
856 } else if ( ( -(2.004 + 3.0 * 4.008) <= locDeltaTRF && locDeltaTRF <= -(2.004 + 4.008) ) ||
857 ( (2.004 + 4.008) <= locDeltaTRF && locDeltaTRF <= (2.004 + 3.0 * 4.008) ) ) {
858 weight = -0.25;
859 } else {
860 continue;
861 }
862 double dE = eb - pi0E;
863 if (DO_METHOD == 1) {
864 if (tof_match1 == 0 && tof_match2 == 0) {
865
866 Fill1DHistogram("FCAL_Pi0TOF","","TaggerTiming2", locDeltaTRF, ";t_{e^{-}} - t_{#gamma} [ns];Count [a.u.]", 500, -100., 100.);
867 Fill2DWeightedHistogram("FCAL_Pi0TOF","","PhotonTiming1", t1 - t2, pi0Mass, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100., 500, 0.05, 0.7);
868 Fill2DWeightedHistogram("FCAL_Pi0TOF","","PhotonTiming1", t2 - t1, pi0Mass, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100., 500, 0.05, 0.7);
869
870 Fill1DWeightedHistogram("FCAL_Pi0TOF","","Pi0Mass",
871 pi0Mass, weight,
872 "#pi^{0} Mass; #pi^{0} Mass;",
873 500, 0.05, 0.7);
874
875 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_ring_%d", ring1),
876 pi0Mass, weight,
877 "#pi^{0} Mass; #pi^{0} Mass;",
878 500, 0.05, 0.7);
879 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_rings_%d", rings1),
880 pi0Mass, weight,
881 "#pi^{0} Mass; #pi^{0} Mass;",
882 500, 0.05, 0.7);
883 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_ring_%d", ring2),
884 pi0Mass, weight,
885 "#pi^{0} Mass; #pi^{0} Mass;",
886 500, 0.05, 0.7);
887 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_rings_%d", rings2),
888 pi0Mass, weight,
889 "#pi^{0} Mass; #pi^{0} Mass;",
890 500, 0.05, 0.7);
891
892 if (frac1 > frac_ring_thres)
893 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_th_ring_%d", ring1),
894 pi0Mass, weight,
895 "#pi^{0} Mass; #pi^{0} Mass;",
896 500, 0.05, 0.7);
897 if (frac1 > frac_rings_thres)
898 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_th_rings_%d", rings1),
899 pi0Mass, weight,
900 "#pi^{0} Mass; #pi^{0} Mass;",
901 500, 0.05, 0.7);
902 if (frac2 > frac_ring_thres)
903 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_th_ring_%d", ring2),
904 pi0Mass, weight,
905 "#pi^{0} Mass; #pi^{0} Mass;",
906 500, 0.05, 0.7);
907 if (frac2 > frac_rings_thres)
908 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_th_rings_%d", rings2),
909 pi0Mass, weight,
910 "#pi^{0} Mass; #pi^{0} Mass;",
911 500, 0.05, 0.7);
912
913
914 if (neutralParticleVector.size() == 2) {
915 Fill1DWeightedHistogram("FCAL_Pi0TOF","","Pi0Mass",
916 pi0Mass, weight,
917 "#pi^{0} Mass; #pi^{0} Mass;",
918 500, 0.05, 0.7);
919 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_ring_%d", ring1),
920 pi0Mass, weight,
921 "#pi^{0} Mass; #pi^{0} Mass;",
922 500, 0.05, 0.7);
923 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_rings_%d", rings1),
924 pi0Mass, weight,
925 "#pi^{0} Mass; #pi^{0} Mass;",
926 500, 0.05, 0.7);
927 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_ring_%d", ring2),
928 pi0Mass, weight,
929 "#pi^{0} Mass; #pi^{0} Mass;",
930 500, 0.05, 0.7);
931 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_rings_%d", rings2),
932 pi0Mass, weight,
933 "#pi^{0} Mass; #pi^{0} Mass;",
934 500, 0.05, 0.7);
935
936 if (frac1 > frac_ring_thres)
937 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_th_ring_%d", ring1),
938 pi0Mass, weight,
939 "#pi^{0} Mass; #pi^{0} Mass;",
940 500, 0.05, 0.7);
941 if (frac1 > frac_rings_thres)
942 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_th_rings_%d", rings1),
943 pi0Mass, weight,
944 "#pi^{0} Mass; #pi^{0} Mass;",
945 500, 0.05, 0.7);
946 if (frac2 > frac_ring_thres)
947 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_th_ring_%d", ring2),
948 pi0Mass, weight,
949 "#pi^{0} Mass; #pi^{0} Mass;",
950 500, 0.05, 0.7);
951 if (frac2 > frac_rings_thres)
952 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_th_rings_%d", rings2),
953 pi0Mass, weight,
954 "#pi^{0} Mass; #pi^{0} Mass;",
955 500, 0.05, 0.7);
956
957 }
958 if(frac1 > frac_rings_thres){
959 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum",
960 ch1, pi0Mass, weight,
961 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
962 2800, -0.5, 2799.5, 500, 0.05, 0.7);
963
964 if(radiusShower2<108.4239 && radiusShower2>20.785){
965 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_Fid",
966 ch1, pi0Mass, weight,
967 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
968 2800, -0.5, 2799.5, 500, 0.05, 0.7);
969 if(radiusShower1<108.4239 && radiusShower1>20.785){
970 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_FidBoth",
971 ch1, pi0Mass, weight,
972 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
973 2800, -0.5, 2799.5, 500, 0.05, 0.7);
974 }
975 }
976 if(radiusShower1<20.785 || radiusShower2<20.785){
977 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_InnerRing",
978 ch1, pi0Mass, weight,
979 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
980 2800, -0.5, 2799.5, 500, 0.05, 0.7);
981 }
982
983 }
984 if(frac2 > frac_rings_thres){
985 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum",
986 ch2, pi0Mass, weight,
987 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
988 2800, -0.5, 2799.5, 500, 0.05, 0.7);
989 if(radiusShower1<108.4239 && radiusShower1>20.785){
990 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_Fid",
991 ch2, pi0Mass, weight,
992 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
993 2800, -0.5, 2799.5, 500, 0.05, 0.7);
994 if(radiusShower2<108.4239 && radiusShower2>20.785){
995 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_FidBoth",
996 ch2, pi0Mass, weight,
997 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
998 2800, -0.5, 2799.5, 500, 0.05, 0.7);
999 }
1000 }
1001 if(radiusShower1<20.785 || radiusShower2<20.785){
1002 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_InnerRing",
1003 ch1, pi0Mass, weight,
1004 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1005 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1006 }
1007
1008 }
1009 // Energy Weighted Pi0 Mass
1010 for(auto hit : fcalCluster1->GetHits()){
1011 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted",
1012 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy() * weight,
1013 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1014 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1015 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared",
1016 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1017 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1018 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1019 if(radiusShower2<108.4239 && radiusShower2>20.785){
1020 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_Fid",
1021 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy() * weight,
1022 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1023 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1024 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_Fid",
1025 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1026 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1027 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1028 if(radiusShower1<108.4239 && radiusShower1>20.785){
1029 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_FidBoth",
1030 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy() * weight,
1031 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1032 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1033 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_FidBoth",
1034 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1035 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1036 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1037 }
1038 }
1039
1040 }
1041
1042 for(auto hit : fcalCluster2->GetHits()){
1043 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted",
1044 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy() * weight,
1045 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1046 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1047 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared",
1048 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1049 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1050 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1051 if(radiusShower1<108.4239 && radiusShower1>20.785){
1052 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_Fid",
1053 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy() * weight,
1054 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1055 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1056 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_Fid",
1057 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1058 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1059 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1060 if(radiusShower2<108.4239 && radiusShower2>20.785){
1061 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_FidBoth",
1062 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy() * weight,
1063 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1064 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1065 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_FidBoth",
1066 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1067 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1068 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1069 }
1070 }
1071
1072 }
1073
1074 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_ring_%d", ring1),
1075 Eclust1, pi0Mass, weight,
1076 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1077 100, 0.0, 10.0, 500, 0.05, 0.7);
1078 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_ring_%d", ring2),
1079 Eclust2, pi0Mass, weight,
1080 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1081 100, 0.0, 10.0, 500, 0.05, 0.7);
1082 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_rings_%d", rings1),
1083 Eclust1, pi0Mass, weight,
1084 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1085 100, 0.0, 10.0, 500, 0.05, 0.7);
1086 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_rings_%d", rings2),
1087 Eclust2, pi0Mass, weight,
1088 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1089 100, 0.0, 10.0, 500, 0.05, 0.7);
1090
1091 if (api0) {
1092 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_theta_%d", ring1),
1093 pi0P, theta_pi0, weight,
1094 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1095 100, 0.0, 10.0, 180, 0., 18.);
1096 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_theta_%d", ring2),
1097 pi0P, theta_pi0, weight,
1098 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1099 100, 0.0, 10.0, 180, 0., 18.);
1100 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_thetas_%d", rings1),
1101 pi0P, theta_pi0, weight,
1102 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1103 100, 0.0, 10.0, 180, 0., 18.);
1104 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_thetas_%d", rings2),
1105 pi0P, theta_pi0, weight,
1106 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1107 100, 0.0, 10.0, 180, 0., 18.);
1108 }
1109
1110 if (neutralParticleVector.size() == 2) {
1111 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_ring_%d", ring1),
1112 Eclust1, pi0Mass, weight,
1113 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1114 100, 0.0, 10.0, 500, 0.05, 0.7);
1115 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_ring_%d", ring2),
1116 Eclust2, pi0Mass, weight,
1117 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1118 100, 0.0, 10.0, 500, 0.05, 0.7);
1119 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_rings_%d", rings1),
1120 Eclust1, pi0Mass, weight,
1121 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1122 100, 0.0, 10.0, 500, 0.05, 0.7);
1123 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_rings_%d", rings2),
1124 Eclust2, pi0Mass, weight,
1125 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1126 100, 0.0, 10.0, 500, 0.05, 0.7);
1127 }
1128
1129 if (bo_5p){
1130 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_ring_%d", ring1),
1131 avgE, pi0Mass, weight,
1132 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1133 100, 0.0, 10.0, 500, 0.05, 0.7);
1134 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_ring_%d", ring2),
1135 avgE, pi0Mass, weight,
1136 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1137 100, 0.0, 10.0, 500, 0.05, 0.7);
1138 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_rings_%d", rings1),
1139 avgE, pi0Mass, weight,
1140 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1141 100, 0.0, 10.0, 500, 0.05, 0.7);
1142 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_rings_%d", rings2),
1143 avgE, pi0Mass, weight,
1144 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1145 100, 0.0, 10.0, 500, 0.05, 0.7);
1146 if (api0) {
1147 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_theta_%d", ring1),
1148 pi0P, theta_pi0, weight,
1149 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1150 100, 0.0, 10.0, 180, 0., 18.);
1151 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_theta_%d", ring2),
1152 pi0P, theta_pi0, weight,
1153 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1154 100, 0.0, 10.0, 180, 0., 18.);
1155 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_thetas_%d", rings1),
1156 pi0P, theta_pi0, weight,
1157 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1158 100, 0.0, 10.0, 180, 0., 18.);
1159 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_thetas_%d", rings2),
1160 pi0P, theta_pi0, weight,
1161 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1162 100, 0.0, 10.0, 180, 0., 18.);
1163 }
1164 if (neutralParticleVector.size() == 2) {
1165 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_ring_%d", ring1),
1166 avgE, pi0Mass, weight,
1167 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1168 100, 0.0, 10.0, 500, 0.05, 0.7);
1169 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_ring_%d", ring2),
1170 avgE, pi0Mass, weight,
1171 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1172 100, 0.0, 10.0, 500, 0.05, 0.7);
1173 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_rings_%d", rings1),
1174 avgE, pi0Mass, weight,
1175 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1176 100, 0.0, 10.0, 500, 0.05, 0.7);
1177 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_rings_%d", rings2),
1178 avgE, pi0Mass, weight,
1179 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1180 100, 0.0, 10.0, 500, 0.05, 0.7);
1181 }
1182
1183 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_5",
1184 avgE, pi0Mass, weight,
1185 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1186 100, 0.0, 10.0, 500, 0.05, 0.7);
1187 if(radiusShower2<108.4239 && radiusShower2>20.785){
1188 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_5_Fiducial",
1189 avgE, pi0Mass, weight,
1190 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1191 100, 0.0, 10.0, 500, 0.05, 0.7);
1192 if(radiusShower1<108.4239 && radiusShower1>20.785){
1193 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_5_FiducialBoth",
1194 avgE, pi0Mass, weight,
1195 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1196 100, 0.0, 10.0, 500, 0.05, 0.7);
1197 }
1198 }
1199
1200 }
1201 if (bo_10p){
1202 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_ring_%d", ring1),
1203 avgE, pi0Mass, weight,
1204 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1205 100, 0.0, 10.0, 500, 0.05, 0.7);
1206 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_ring_%d", ring2),
1207 avgE, pi0Mass, weight,
1208 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1209 100, 0.0, 10.0, 500, 0.05, 0.7);
1210 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_rings_%d", rings1),
1211 avgE, pi0Mass, weight,
1212 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1213 100, 0.0, 10.0, 500, 0.05, 0.7);
1214 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_rings_%d", rings2),
1215 avgE, pi0Mass, weight,
1216 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1217 100, 0.0, 10.0, 500, 0.05, 0.7);
1218 if (api0) {
1219 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_theta_%d", ring1),
1220 pi0P, theta_pi0, weight,
1221 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1222 100, 0.0, 10.0, 180, 0., 18.);
1223 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_theta_%d", ring2),
1224 pi0P, theta_pi0, weight,
1225 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1226 100, 0.0, 10.0, 180, 0., 18.);
1227 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_thetas_%d", rings1),
1228 pi0P, theta_pi0, weight,
1229 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1230 100, 0.0, 10.0, 180, 0., 18.);
1231 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_thetas_%d", rings2),
1232 pi0P, theta_pi0, weight,
1233 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1234 100, 0.0, 10.0, 180, 0., 18.);
1235 }
1236 if (neutralParticleVector.size() == 2) {
1237 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_ring_%d", ring1),
1238 avgE, pi0Mass, weight,
1239 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1240 100, 0.0, 10.0, 500, 0.05, 0.7);
1241 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_ring_%d", ring2),
1242 avgE, pi0Mass, weight,
1243 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1244 100, 0.0, 10.0, 500, 0.05, 0.7);
1245 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_rings_%d", rings1),
1246 avgE, pi0Mass, weight,
1247 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1248 100, 0.0, 10.0, 500, 0.05, 0.7);
1249 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_rings_%d", rings2),
1250 avgE, pi0Mass, weight,
1251 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1252 100, 0.0, 10.0, 500, 0.05, 0.7);
1253 }
1254 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_10",
1255 avgE, pi0Mass, weight,
1256 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1257 100, 0.0, 10.0, 500, 0.05, 0.7);
1258
1259 if(radiusShower2<108.4239 && radiusShower2>20.785){
1260 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_10_Fiducial",
1261 avgE, pi0Mass, weight,
1262 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1263 100, 0.0, 10.0, 500, 0.05, 0.7);
1264 if(radiusShower1<108.4239 && radiusShower1>20.785){
1265 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_10_FiducialBoth",
1266 avgE, pi0Mass, weight,
1267 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1268 100, 0.0, 10.0, 500, 0.05, 0.7);
1269 }
1270 }
1271
1272 }
1273 if (bo_20p){
1274 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_ring_%d", ring1),
1275 avgE, pi0Mass, weight,
1276 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1277 100, 0.0, 10.0, 500, 0.05, 0.7);
1278 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_ring_%d", ring2),
1279 avgE, pi0Mass, weight,
1280 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1281 100, 0.0, 10.0, 500, 0.05, 0.7);
1282 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_rings_%d", rings1),
1283 avgE, pi0Mass, weight,
1284 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1285 100, 0.0, 10.0, 500, 0.05, 0.7);
1286 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_rings_%d", rings2),
1287 avgE, pi0Mass, weight,
1288 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1289 100, 0.0, 10.0, 500, 0.05, 0.7);
1290 if (api0) {
1291 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_theta_%d", ring1),
1292 pi0P, theta_pi0, weight,
1293 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1294 100, 0.0, 10.0, 180, 0., 18.);
1295 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_theta_%d", ring2),
1296 pi0P, theta_pi0, weight,
1297 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1298 100, 0.0, 10.0, 180, 0., 18.);
1299 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_thetas_%d", rings1),
1300 pi0P, theta_pi0, weight,
1301 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1302 100, 0.0, 10.0, 180, 0., 18.);
1303 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_thetas_%d", rings2),
1304 pi0P, theta_pi0, weight,
1305 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1306 100, 0.0, 10.0, 180, 0., 18.);
1307 }
1308 if (neutralParticleVector.size() == 2) {
1309 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_ring_%d", ring1),
1310 avgE, pi0Mass, weight,
1311 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1312 100, 0.0, 10.0, 500, 0.05, 0.7);
1313 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_ring_%d", ring2),
1314 avgE, pi0Mass, weight,
1315 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1316 100, 0.0, 10.0, 500, 0.05, 0.7);
1317 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_rings_%d", rings1),
1318 avgE, pi0Mass, weight,
1319 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1320 100, 0.0, 10.0, 500, 0.05, 0.7);
1321 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_rings_%d", rings2),
1322 avgE, pi0Mass, weight,
1323 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1324 100, 0.0, 10.0, 500, 0.05, 0.7);
1325 }
1326 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_20",
1327 avgE, pi0Mass, weight,
1328 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1329 100, 0.0, 10.0, 500, 0.05, 0.7);
1330
1331 if(radiusShower2<108.4239 && radiusShower2>20.785){
1332 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_20_Fiducial",
1333 avgE, pi0Mass, weight,
1334 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1335 100, 0.0, 10.0, 500, 0.05, 0.7);
1336 if(radiusShower1<108.4239 && radiusShower1>20.785){
1337 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_20_FiducialBoth",
1338 avgE, pi0Mass, weight,
1339 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1340 100, 0.0, 10.0, 500, 0.05, 0.7);
1341 }
1342 }
1343 }
1344 if (bo_30p){
1345 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_ring_%d", ring1),
1346 avgE, pi0Mass, weight,
1347 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1348 100, 0.0, 10.0, 500, 0.05, 0.7);
1349 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_ring_%d", ring2),
1350 avgE, pi0Mass, weight,
1351 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1352 100, 0.0, 10.0, 500, 0.05, 0.7);
1353 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_rings_%d", rings1),
1354 avgE, pi0Mass, weight,
1355 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1356 100, 0.0, 10.0, 500, 0.05, 0.7);
1357 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_rings_%d", rings2),
1358 avgE, pi0Mass, weight,
1359 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1360 100, 0.0, 10.0, 500, 0.05, 0.7);
1361 if (api0) {
1362 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_theta_%d", ring1),
1363 pi0P, theta_pi0, weight,
1364 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1365 100, 0.0, 10.0, 180, 0., 18.);
1366 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_theta_%d", ring2),
1367 pi0P, theta_pi0, weight,
1368 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1369 100, 0.0, 10.0, 180, 0., 18.);
1370 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_thetas_%d", rings1),
1371 pi0P, theta_pi0, weight,
1372 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1373 100, 0.0, 10.0, 180, 0., 18.);
1374 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_thetas_%d", rings2),
1375 pi0P, theta_pi0, weight,
1376 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1377 100, 0.0, 10.0, 180, 0., 18.);
1378 }
1379 if (neutralParticleVector.size() == 2) {
1380 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_ring_%d", ring1),
1381 avgE, pi0Mass, weight,
1382 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1383 100, 0.0, 10.0, 500, 0.05, 0.7);
1384 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_ring_%d", ring2),
1385 avgE, pi0Mass, weight,
1386 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1387 100, 0.0, 10.0, 500, 0.05, 0.7);
1388 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_rings_%d", rings1),
1389 avgE, pi0Mass, weight,
1390 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1391 100, 0.0, 10.0, 500, 0.05, 0.7);
1392 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_rings_%d", rings2),
1393 avgE, pi0Mass, weight,
1394 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1395 100, 0.0, 10.0, 500, 0.05, 0.7);
1396 }
1397 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_30",
1398 avgE, pi0Mass, weight,
1399 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1400 100, 0.0, 10.0, 500, 0.05, 0.7);
1401 if(radiusShower2<108.4239 && radiusShower2>20.785){
1402 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_30_Fiducial",
1403 avgE, pi0Mass, weight,
1404 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1405 100, 0.0, 10.0, 500, 0.05, 0.7);
1406 if(radiusShower1<108.4239 && radiusShower1>20.785){
1407 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_30_FiducialBoth",
1408 avgE, pi0Mass, weight,
1409 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1410 100, 0.0, 10.0, 500, 0.05, 0.7);
1411 }
1412 }
1413 }
1414 }
1415 }
1416 if (DO_METHOD == 2) {
1417 if (ltof_match1 == 0 && ltof_match2 == 0) {
1418
1419 Fill1DHistogram("FCAL_Pi0log","","TaggerTiming1", locDeltaTRF, ";t_{e^{-}} - t_{#gamma} [ns];Count [a.u.]", 500, -100., 100.);
1420 Fill2DWeightedHistogram("FCAL_Pi0log","","PhotonTiming1", t1 - t2, pi0Masslog, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100., 500, 0.05, 0.7);
1421 Fill2DWeightedHistogram("FCAL_Pi0log","","PhotonTiming1", t2 - t1, pi0Masslog, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100., 500, 0.05, 0.7);
1422
1423 if (api0 && neutralParticleVector.size() == 2 && eb > 8.0) {
1424 Fill1DWeightedHistogram("FCAL_Pi0log","","DeltaE",
1425 dE, weight,
1426 ";E_{#gamma} - E_{#pi^{0}} [GeV];Count [a.u.]",
1427 1200, -2., 10.);
1428 if (ring1 > 1 && ring2 > 1) {
1429 Fill1DWeightedHistogram("FCAL_Pi0log","","DeltaE_ring",
1430 dE, weight,
1431 ";E_{#gamma} - E_{#pi^{0}} [GeV];Count [a.u.]",
1432 1200, -2., 10.);
1433 }
1434 }
1435
1436 if (api0)
1437 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi0Clusters",
1438 ring1, d, weight,
1439 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1440 30, 0, 30, 500, 0., 100.);
1441 if (aeta)
1442 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi0Clusters",
1443 ring1, d, weight,
1444 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1445 30, 0, 30, 500, 0., 100.);
1446
1447
1448
1449 Fill1DWeightedHistogram("FCAL_Pi0log","","Pi0Mass",
1450 pi0Masslog, weight,
1451 "#pi^{0} Mass; #pi^{0} Mass;",
1452 500, 0.05, 0.7);
1453 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ring_%d", ring1),
1454 pi0Masslog, weight,
1455 "#pi^{0} Mass; #pi^{0} Mass;",
1456 500, 0.05, 0.7);
1457 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ringl_%d", ringl1),
1458 pi0Masslog, weight,
1459 "#pi^{0} Mass; #pi^{0} Mass;",
1460 500, 0.05, 0.7);
1461 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ring_%d", ring2),
1462 pi0Masslog, weight,
1463 "#pi^{0} Mass; #pi^{0} Mass;",
1464 500, 0.05, 0.7);
1465 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ringl_%d", ringl2),
1466 pi0Masslog, weight,
1467 "#pi^{0} Mass; #pi^{0} Mass;",
1468 500, 0.05, 0.7);
1469
1470 if (frac1 > frac_ring_thres)
1471 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_th_ring_%d", ring1),
1472 pi0Mass, weight,
1473 "#pi^{0} Mass; #pi^{0} Mass;",
1474 500, 0.05, 0.7);
1475 if (frac1 > frac_ringl_thres)
1476 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_th_ringl_%d", rings1),
1477 pi0Mass, weight,
1478 "#pi^{0} Mass; #pi^{0} Mass;",
1479 500, 0.05, 0.7);
1480 if (frac2 > frac_ring_thres)
1481 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_th_ring_%d", ring2),
1482 pi0Mass, weight,
1483 "#pi^{0} Mass; #pi^{0} Mass;",
1484 500, 0.05, 0.7);
1485 if (frac2 > frac_ringl_thres)
1486 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_th_ringl_%d", rings2),
1487 pi0Mass, weight,
1488 "#pi^{0} Mass; #pi^{0} Mass;",
1489 500, 0.05, 0.7);
1490
1491 if (neutralParticleVector.size() == 2) {
1492 if (api0)
1493 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi02gClusters",
1494 ring1, d, weight,
1495 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1496 30, 0, 30, 500, 0., 100.);
1497 if (aeta)
1498 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi02gClusters",
1499 ring1, d, weight,
1500 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1501 30, 0, 30, 500, 0., 100.);
1502
1503 Fill1DWeightedHistogram("FCAL_Pi0log","","Pi0Mass",
1504 pi0Masslog, weight,
1505 "#pi^{0} Mass; #pi^{0} Mass;",
1506 500, 0.05, 0.7);
1507 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ring_%d", ring1),
1508 pi0Masslog, weight,
1509 "#pi^{0} Mass; #pi^{0} Mass;",
1510 500, 0.05, 0.7);
1511 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ringl_%d", ringl1),
1512 pi0Masslog, weight,
1513 "#pi^{0} Mass; #pi^{0} Mass;",
1514 500, 0.05, 0.7);
1515 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ring_%d", ring2),
1516 pi0Masslog, weight,
1517 "#pi^{0} Mass; #pi^{0} Mass;",
1518 500, 0.05, 0.7);
1519 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ringl_%d", ringl2),
1520 pi0Masslog, weight,
1521 "#pi^{0} Mass; #pi^{0} Mass;",
1522 500, 0.05, 0.7);
1523
1524 if (frac1 > frac_ring_thres)
1525 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_th_ring_%d", ring1),
1526 pi0Mass, weight,
1527 "#pi^{0} Mass; #pi^{0} Mass;",
1528 500, 0.05, 0.7);
1529 if (frac1 > frac_ringl_thres)
1530 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_th_ringl_%d", rings1),
1531 pi0Mass, weight,
1532 "#pi^{0} Mass; #pi^{0} Mass;",
1533 500, 0.05, 0.7);
1534 if (frac2 > frac_ring_thres)
1535 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_th_ring_%d", ring2),
1536 pi0Mass, weight,
1537 "#pi^{0} Mass; #pi^{0} Mass;",
1538 500, 0.05, 0.7);
1539 if (frac2 > frac_ringl_thres)
1540 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_th_ringl_%d", rings2),
1541 pi0Mass, weight,
1542 "#pi^{0} Mass; #pi^{0} Mass;",
1543 500, 0.05, 0.7);
1544 }
1545 if(frac1 > frac_ringl_thres){
1546 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum",
1547 ch1, pi0Masslog, weight,
1548 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1549 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1550
1551 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1552 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_Fid",
1553 ch1, pi0Masslog, weight,
1554 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1555 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1556 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1557 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_FidBoth",
1558 ch1, pi0Masslog, weight,
1559 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1560 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1561 }
1562 }
1563 if(radiusShowerlog1<20.785 || radiusShowerlog2<20.785){
1564 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_InnerRing",
1565 ch1, pi0Masslog, weight,
1566 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1567 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1568 }
1569
1570 }
1571 if(frac2 > frac_ringl_thres){
1572 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum",
1573 ch2, pi0Masslog, weight,
1574 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1575 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1576 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1577 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_Fid",
1578 ch2, pi0Masslog, weight,
1579 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1580 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1581 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1582 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_FidBoth",
1583 ch2, pi0Masslog, weight,
1584 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1585 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1586 }
1587 }
1588 if(radiusShowerlog1<20.785 || radiusShowerlog2<20.785){
1589 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_InnerRing",
1590 ch1, pi0Masslog, weight,
1591 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1592 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1593 }
1594
1595 }
1596 // Energy Weighted Pi0 Mass
1597 for(auto hit : fcalCluster1->GetHits()){
1598 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted",
1599 hit.ch, pi0Masslog, hit.E / fcalCluster1->getEnergy() * weight,
1600 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1601 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1602 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared",
1603 hit.ch, pi0Masslog, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1604 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1605 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1606 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1607 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_Fid",
1608 hit.ch, pi0Masslog, hit.E / fcalCluster1->getEnergy() * weight,
1609 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1610 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1611 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_Fid",
1612 hit.ch, pi0Masslog, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1613 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1614 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1615 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1616 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_FidBoth",
1617 hit.ch, pi0Masslog, hit.E / fcalCluster1->getEnergy() * weight,
1618 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1619 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1620 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_FidBoth",
1621 hit.ch, pi0Masslog, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1622 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1623 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1624 }
1625 }
1626
1627 }
1628
1629 for(auto hit : fcalCluster2->GetHits()){
1630 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted",
1631 hit.ch, pi0Masslog, hit.E / fcalCluster2->getEnergy() * weight,
1632 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1633 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1634 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared",
1635 hit.ch, pi0Masslog, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1636 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1637 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1638 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1639 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_Fid",
1640 hit.ch, pi0Masslog, hit.E / fcalCluster2->getEnergy() * weight,
1641 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1642 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1643 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_Fid",
1644 hit.ch, pi0Masslog, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1645 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1646 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1647 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1648 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_FidBoth",
1649 hit.ch, pi0Masslog, hit.E / fcalCluster2->getEnergy() * weight,
1650 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1651 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1652 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_FidBoth",
1653 hit.ch, pi0Masslog, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1654 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1655 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1656 }
1657 }
1658
1659 }
1660
1661 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ring_%d", ring1),
1662 Eclust1, pi0Masslog, weight,
1663 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1664 100, 0.0, 10.0, 500, 0.05, 0.7);
1665 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ring_%d", ring2),
1666 Eclust2, pi0Masslog, weight,
1667 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1668 100, 0.0, 10.0, 500, 0.05, 0.7);
1669 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ringl_%d", ringl1),
1670 Eclust1, pi0Masslog, weight,
1671 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1672 100, 0.0, 10.0, 500, 0.05, 0.7);
1673 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ringl_%d", ringl2),
1674 Eclust2, pi0Masslog, weight,
1675 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1676 100, 0.0, 10.0, 500, 0.05, 0.7);
1677 if (api0) {
1678 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_theta_%d", ring1),
1679 pi0Plog, theta_pi0log, weight,
1680 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1681 100, 0.0, 10.0, 180, 0., 18.);
1682 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_theta_%d", ring2),
1683 pi0Plog, theta_pi0log, weight,
1684 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1685 100, 0.0, 10.0, 180, 0., 18.);
1686 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_thetal_%d", ringl1),
1687 pi0Plog, theta_pi0log, weight,
1688 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1689 100, 0.0, 10.0, 180, 0., 18.);
1690 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_thetal_%d", ringl2),
1691 pi0Plog, theta_pi0log, weight,
1692 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1693 100, 0.0, 10.0, 180, 0., 18.);
1694 }
1695 if (neutralParticleVector.size() == 2) {
1696 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ring_%d", ring1),
1697 Eclust1, pi0Masslog, weight,
1698 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1699 100, 0.0, 10.0, 500, 0.05, 0.7);
1700 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ring_%d", ring2),
1701 Eclust2, pi0Masslog, weight,
1702 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1703 100, 0.0, 10.0, 500, 0.05, 0.7);
1704 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ringl_%d", ringl1),
1705 Eclust1, pi0Masslog, weight,
1706 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1707 100, 0.0, 10.0, 500, 0.05, 0.7);
1708 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ringl_%d", ringl2),
1709 Eclust2, pi0Masslog, weight,
1710 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1711 100, 0.0, 10.0, 500, 0.05, 0.7);
1712 }
1713
1714 if (bo_5p){
1715 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_ring_%d", ring1),
1716 avgE, pi0Masslog, weight,
1717 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1718 100, 0.0, 10.0, 500, 0.05, 0.7);
1719 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_ring_%d", ring2),
1720 avgE, pi0Masslog, weight,
1721 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1722 100, 0.0, 10.0, 500, 0.05, 0.7);
1723 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_ringl_%d", ringl1),
1724 avgE, pi0Masslog, weight,
1725 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1726 100, 0.0, 10.0, 500, 0.05, 0.7);
1727 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_ringl_%d", ringl2),
1728 avgE, pi0Masslog, weight,
1729 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1730 100, 0.0, 10.0, 500, 0.05, 0.7);
1731 if (api0) {
1732 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_theta_%d", ring1),
1733 pi0Plog, theta_pi0log, weight,
1734 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1735 100, 0.0, 10.0, 180, 0., 18.);
1736 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_theta_%d", ring2),
1737 pi0Plog, theta_pi0log, weight,
1738 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1739 100, 0.0, 10.0, 180, 0., 18.);
1740 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_thetal_%d", ringl1),
1741 pi0Plog, theta_pi0log, weight,
1742 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1743 100, 0.0, 10.0, 180, 0., 18.);
1744 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_thetal_%d", ringl2),
1745 pi0Plog, theta_pi0log, weight,
1746 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1747 100, 0.0, 10.0, 180, 0., 18.);
1748 }
1749 if (neutralParticleVector.size() == 2) {
1750 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ring_%d", ring1),
1751 avgE, pi0Masslog, weight,
1752 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1753 100, 0.0, 10.0, 500, 0.05, 0.7);
1754 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ring_%d", ring2),
1755 avgE, pi0Masslog, weight,
1756 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1757 100, 0.0, 10.0, 500, 0.05, 0.7);
1758 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ringl_%d", ringl1),
1759 avgE, pi0Masslog, weight,
1760 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1761 100, 0.0, 10.0, 500, 0.05, 0.7);
1762 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ringl_%d", ringl2),
1763 avgE, pi0Masslog, weight,
1764 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1765 100, 0.0, 10.0, 500, 0.05, 0.7);
1766 }
1767
1768 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_5",
1769 avgE, pi0Masslog, weight,
1770 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1771 100, 0.0, 10.0, 500, 0.05, 0.7);
1772 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1773 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_5_Fiducial",
1774 avgE, pi0Masslog, weight,
1775 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1776 100, 0.0, 10.0, 500, 0.05, 0.7);
1777 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1778 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_5_FiducialBoth",
1779 avgE, pi0Masslog, weight,
1780 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1781 100, 0.0, 10.0, 500, 0.05, 0.7);
1782 }
1783 }
1784
1785 }
1786 if (bo_10p){
1787 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ring_%d", ring1),
1788 avgE, pi0Masslog, weight,
1789 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1790 100, 0.0, 10.0, 500, 0.05, 0.7);
1791 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ring_%d", ring2),
1792 avgE, pi0Masslog, weight,
1793 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1794 100, 0.0, 10.0, 500, 0.05, 0.7);
1795 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ringl_%d", ringl1),
1796 avgE, pi0Masslog, weight,
1797 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1798 100, 0.0, 10.0, 500, 0.05, 0.7);
1799 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ringl_%d", ringl2),
1800 avgE, pi0Masslog, weight,
1801 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1802 100, 0.0, 10.0, 500, 0.05, 0.7);
1803 if (api0) {
1804 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_theta_%d", ring1),
1805 pi0Plog, theta_pi0log, weight,
1806 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1807 100, 0.0, 10.0, 180, 0., 18.);
1808 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_theta_%d", ring2),
1809 pi0Plog, theta_pi0log, weight,
1810 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1811 100, 0.0, 10.0, 180, 0., 18.);
1812 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_thetal_%d", ringl1),
1813 pi0Plog, theta_pi0log, weight,
1814 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1815 100, 0.0, 10.0, 180, 0., 18.);
1816 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_thetal_%d", ringl2),
1817 pi0Plog, theta_pi0log, weight,
1818 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1819 100, 0.0, 10.0, 180, 0., 18.);
1820 }
1821 if (neutralParticleVector.size() == 2) {
1822 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_10_ring_%d", ring1),
1823 avgE, pi0Masslog, weight,
1824 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1825 100, 0.0, 10.0, 500, 0.05, 0.7);
1826 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_10_ring_%d", ring2),
1827 avgE, pi0Masslog, weight,
1828 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1829 100, 0.0, 10.0, 500, 0.05, 0.7);
1830 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_10_ringl_%d", ringl1),
1831 avgE, pi0Masslog, weight,
1832 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1833 100, 0.0, 10.0, 500, 0.05, 0.7);
1834 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_10_ringl_%d", ringl2),
1835 avgE, pi0Masslog, weight,
1836 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1837 100, 0.0, 10.0, 500, 0.05, 0.7);
1838 }
1839 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_10",
1840 avgE, pi0Masslog, weight,
1841 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1842 100, 0.0, 10.0, 500, 0.05, 0.7);
1843
1844 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1845 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_10_Fiducial",
1846 avgE, pi0Masslog, weight,
1847 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1848 100, 0.0, 10.0, 500, 0.05, 0.7);
1849 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1850 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_10_FiducialBoth",
1851 avgE, pi0Masslog, weight,
1852 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1853 100, 0.0, 10.0, 500, 0.05, 0.7);
1854 }
1855 }
1856
1857 }
1858 if (bo_20p){
1859 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ring_%d", ring1),
1860 avgE, pi0Masslog, weight,
1861 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1862 100, 0.0, 10.0, 500, 0.05, 0.7);
1863 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ring_%d", ring2),
1864 avgE, pi0Masslog, weight,
1865 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1866 100, 0.0, 10.0, 500, 0.05, 0.7);
1867 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ringl_%d", ringl1),
1868 avgE, pi0Masslog, weight,
1869 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1870 100, 0.0, 10.0, 500, 0.05, 0.7);
1871 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ringl_%d", ringl2),
1872 avgE, pi0Masslog, weight,
1873 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1874 100, 0.0, 10.0, 500, 0.05, 0.7);
1875 if (api0) {
1876 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_theta_%d", ring1),
1877 pi0Plog, theta_pi0log, weight,
1878 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1879 100, 0.0, 10.0, 180, 0., 18.);
1880 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_theta_%d", ring2),
1881 pi0Plog, theta_pi0log, weight,
1882 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1883 100, 0.0, 10.0, 180, 0., 18.);
1884 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_thetal_%d", ringl1),
1885 pi0Plog, theta_pi0log, weight,
1886 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1887 100, 0.0, 10.0, 180, 0., 18.);
1888 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_thetal_%d", ringl2),
1889 pi0Plog, theta_pi0log, weight,
1890 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1891 100, 0.0, 10.0, 180, 0., 18.);
1892 }
1893 if (neutralParticleVector.size() == 2) {
1894 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ring_%d", ring1),
1895 avgE, pi0Masslog, weight,
1896 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1897 100, 0.0, 10.0, 500, 0.05, 0.7);
1898 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ring_%d", ring2),
1899 avgE, pi0Masslog, weight,
1900 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1901 100, 0.0, 10.0, 500, 0.05, 0.7);
1902 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ringl_%d", ringl1),
1903 avgE, pi0Masslog, weight,
1904 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1905 100, 0.0, 10.0, 500, 0.05, 0.7);
1906 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ringl_%d", ringl2),
1907 avgE, pi0Masslog, weight,
1908 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1909 100, 0.0, 10.0, 500, 0.05, 0.7);
1910 }
1911 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_20",
1912 avgE, pi0Masslog, weight,
1913 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1914 100, 0.0, 10.0, 500, 0.05, 0.7);
1915
1916 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1917 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_20_Fiducial",
1918 avgE, pi0Masslog, weight,
1919 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1920 100, 0.0, 10.0, 500, 0.05, 0.7);
1921 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1922 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_20_FiducialBoth",
1923 avgE, pi0Masslog, weight,
1924 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1925 100, 0.0, 10.0, 500, 0.05, 0.7);
1926 }
1927 }
1928 }
1929 if (bo_30p){
1930 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ring_%d", ring1),
1931 avgE, pi0Masslog, weight,
1932 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1933 100, 0.0, 10.0, 500, 0.05, 0.7);
1934 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ring_%d", ring2),
1935 avgE, pi0Masslog, weight,
1936 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1937 100, 0.0, 10.0, 500, 0.05, 0.7);
1938 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ringl_%d", ringl1),
1939 avgE, pi0Masslog, weight,
1940 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1941 100, 0.0, 10.0, 500, 0.05, 0.7);
1942 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ringl_%d", ringl2),
1943 avgE, pi0Masslog, weight,
1944 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1945 100, 0.0, 10.0, 500, 0.05, 0.7);
1946 if (api0) {
1947 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_theta_%d", ring1),
1948 pi0Plog, theta_pi0log, weight,
1949 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1950 100, 0.0, 10.0, 180, 0., 18.);
1951 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_theta_%d", ring2),
1952 pi0Plog, theta_pi0log, weight,
1953 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1954 100, 0.0, 10.0, 180, 0., 18.);
1955 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_thetal_%d", ringl1),
1956 pi0Plog, theta_pi0log, weight,
1957 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1958 100, 0.0, 10.0, 180, 0., 18.);
1959 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_thetal_%d", ringl2),
1960 pi0Plog, theta_pi0log, weight,
1961 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1962 100, 0.0, 10.0, 180, 0., 18.);
1963 }
1964 if (neutralParticleVector.size() == 2) {
1965 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ring_%d", ring1),
1966 avgE, pi0Masslog, weight,
1967 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1968 100, 0.0, 10.0, 500, 0.05, 0.7);
1969 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ring_%d", ring2),
1970 avgE, pi0Masslog, weight,
1971 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1972 100, 0.0, 10.0, 500, 0.05, 0.7);
1973 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ringl_%d", ringl1),
1974 avgE, pi0Masslog, weight,
1975 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1976 100, 0.0, 10.0, 500, 0.05, 0.7);
1977 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ringl_%d", ringl2),
1978 avgE, pi0Masslog, weight,
1979 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1980 100, 0.0, 10.0, 500, 0.05, 0.7);
1981 }
1982 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_30",
1983 avgE, pi0Masslog, weight,
1984 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1985 100, 0.0, 10.0, 500, 0.05, 0.7);
1986 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1987 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_30_Fiducial",
1988 avgE, pi0Masslog, weight,
1989 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1990 100, 0.0, 10.0, 500, 0.05, 0.7);
1991 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1992 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_30_FiducialBoth",
1993 avgE, pi0Masslog, weight,
1994 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1995 100, 0.0, 10.0, 500, 0.05, 0.7);
1996 }
1997 }
1998 }
1999 }
2000 }
2001 }
2002 }
2003 }
2004 }
2005 }
2006 return NOERROR;
2007}
2008
2009//------------------
2010// erun
2011//------------------
2012jerror_t JEventProcessor_FCAL_Pi0TOF::erun(void)
2013{
2014 // This is called whenever the run number changes, before it is
2015 // changed to give you a chance to clean up before processing
2016 // events from the next run number.
2017 return NOERROR;
2018}
2019
2020//------------------
2021// fini
2022//------------------
2023jerror_t JEventProcessor_FCAL_Pi0TOF::fini(void)
2024{
2025 // Called before program exit after event processing is finished.
2026 return NOERROR;
2027}
2028
2029
2030//--------------------------------------------
2031// Get TOF position from bar
2032//--------------------------------------------
2033double JEventProcessor_FCAL_Pi0TOF::bar2x(int bar) {
2034
2035 int ic = 2*bar - 45;
2036
2037 double pos;
2038 if( ic == 1 || ic == -1 ) pos = 3.0*(double)ic;
2039 else if( ic == 3 || ic == 5 ) pos = 1.5*(double)(ic+2);
2040 else if( ic == -3 || ic == -5 ) pos = 1.5*(double)(ic-2);
2041 else if( ic > 5 ) pos = 3.*(ic-2);
2042 else pos = 3.*(ic+2);
2043
2044 double x = 1.1*pos;
2045
2046 return x;
2047}
2048/*
2049int JEventProcessor_FCAL_Pi0TOF::TOF_Match(double kinVertexX, double kinVertexY, double kinVertexZ, double x, double y, double z) {
2050
2051 //----- Check for match between TOF and FCAL -----//
2052 int tof_match = 0;
2053 for (vector< const DTOFPoint* >::const_iterator tof_p = tof_points.begin(); tof_p != tof_points.end(); tof_p++ ) {
2054
2055 double xtof = (*tof_p)->pos.X() - kinVertexX;
2056 double ytof = (*tof_p)->pos.Y() - kinVertexY;
2057 double ztof = (*tof_p)->pos.Z() - kinVertexZ;
2058
2059 //double rtof = sqrt(xtof*xtof + ytof*ytof + ztof*ztof );
2060 //double ttof = (*tof_p)->t - (rtof/TMath::C());
2061
2062 xtof = xtof * (z / ztof);
2063 ytof = ytof * (z / ztof);
2064
2065 int hbar = (*tof_p)->dHorizontalBar;
2066 int hstat = (*tof_p)->dHorizontalBarStatus;
2067 int vbar = (*tof_p)->dVerticalBar;
2068 int vstat = (*tof_p)->dVerticalBarStatus;
2069
2070 double dx, dy;
2071 if( hstat==3 && vstat==3 ) {
2072 dx = x - xtof;
2073 dy = y - ytof;
2074 } else if( vstat==3 ) {
2075 dx = x - bar2x(vbar)*(z / ztof);
2076 dy = y - ytof;
2077 } else if( hstat==3 ) {
2078 dx = x - xtof;
2079 dy = y - bar2x(hbar)*(z / ztof);
2080 } else {
2081 dx = x - bar2x(vbar)*(z / ztof);
2082 dy = y - bar2x(hbar)*(z / ztof);
2083 }
2084
2085 if( fabs(dx) < 6. && fabs(dy) < 6. ) {
2086 //if( dt > -1. && dt < 3. ) tof_match = 1;
2087 tof_match = 1;
2088 }
2089 } // end DTOFPoint loop
2090
2091 return tof_match;
2092}
2093*/
2094
2095
2096