Bug Summary

File:plugins/Calibration/FCAL_Pi0TOF/JEventProcessor_FCAL_Pi0TOF.cc
Location:line 137, column 12
Description:Value stored to 'locL1Trigger' 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
29}
30
31//------------------
32// ~JEventProcessor_FCAL_Pi0TOF (Destructor)
33//------------------
34JEventProcessor_FCAL_Pi0TOF::~JEventProcessor_FCAL_Pi0TOF()
35{
36
37}
38
39//------------------
40// init
41//------------------
42jerror_t JEventProcessor_FCAL_Pi0TOF::init(void)
43{
44 // This is called once at program startup.
45
46 gDirectory(TDirectory::CurrentDirectory())->mkdir("FCAL_Pi0TOF");
47 gDirectory(TDirectory::CurrentDirectory())->cd("FCAL_Pi0TOF");
48 hCurrentGainConstants = new TProfile("CurrentGainConstants", "Current Gain Constants", 2800, -0.5, 2799.5);
49 gDirectory(TDirectory::CurrentDirectory())->cd("..");
50
51 return NOERROR;
52}
53
54//------------------
55// brun
56//------------------
57jerror_t JEventProcessor_FCAL_Pi0TOF::brun(JEventLoop *eventLoop, int32_t runnumber)
58{
59 // This is called whenever the run number changes
60
61 // Put the current gain constants into the output file
62 vector< double > raw_gains;
63 // This is called whenever the run number changes
64 eventLoop->GetCalib("/FCAL/gains", raw_gains);
65 for (unsigned int i=0; i<raw_gains.size(); i++){
66 hCurrentGainConstants->Fill(i,raw_gains[i]);
67 }
68 DGeometry* dgeom = NULL__null;
69 DApplication* dapp = dynamic_cast< DApplication* >(eventLoop->GetJApplication());
70 if (dapp) dgeom = dapp->GetDGeometry(runnumber);
71 if (dgeom) {
72 dgeom->GetTargetZ(m_targetZ);
73 } else {
74 cerr << "No geometry accessbile to ccal_timing monitoring plugin." << endl;
75 return RESOURCE_UNAVAILABLE;
76 }
77 jana::JCalibration *jcalib = japp->GetJCalibration(runnumber);
78 std::map<string, float> beam_spot;
79 jcalib->Get("PHOTON_BEAM/beam_spot", beam_spot);
80 m_beamSpotX = beam_spot.at("x");
81 m_beamSpotY = beam_spot.at("y");
82 return NOERROR;
83}
84
85//------------------
86// evnt
87//------------------
88jerror_t JEventProcessor_FCAL_Pi0TOF::evnt(JEventLoop *loop, uint64_t eventnumber)
89{
90 // This is called for every event. Use of common resources like writing
91 // to a file or filling a histogram should be mutex protected. Using
92 // loop->Get(...) to get reconstructed objects (and thereby activating the
93 // reconstruction algorithm) should be done outside of any mutex lock
94 // since multiple threads may call this method at the same time.
95 // Here's an example:
96 //
97 // vector<const MyDataClass*> mydataclasses;
98 // loop->Get(mydataclasses);
99 //
100 // japp->RootFillLock(this);
101 // ... fill historgrams or trees ...
102 // japp->RootFillUnLock(this);
103 vector<const DFCALGeometry*> fcalGeomVect;
104 loop->Get( fcalGeomVect );
105 if (fcalGeomVect.size() < 1)
106 return OBJECT_NOT_AVAILABLE;
107 const DFCALGeometry& fcalGeom = *(fcalGeomVect[0]);
108
109 vector<const DNeutralParticle *> neutralParticleVector;
110 loop->Get(neutralParticleVector);
111
112 vector<const DTOFPoint*> tof_points;
113 loop->Get(tof_points);
114
115 vector<const DVertex*> kinfitVertex;
116 loop->Get(kinfitVertex);
117
118 vector<const DL1Trigger *> locL1Triggers;
119 vector<const DBeamPhoton *> locBeamPhotons;
120 loop->Get(locL1Triggers);
121 loop->Get(locBeamPhotons);
122 /*
123 const DEventRFBunch * locEventRFBunches = NULL; try {
124 loop->GetSingle(locEventRFBunches, "CalorimeterOnly" );
125 } catch (...) {
126 return NOERROR;
127 }
128 double locRFTime = locEventRFBunches->dTime;
129 if(locEventRFBunches->dNumParticleVotes < 3 )
130 return NOERROR;
131 */
132 vector<const DEventRFBunch*> locEventRFBunches;
133 loop->Get(locEventRFBunches);
134 double locRFTime = locEventRFBunches.empty() ? 0.0 : locEventRFBunches[0]->dTime;
135
136 uint32_t locL1Trigger_fp = locL1Triggers.empty() ? 0.0 : locL1Triggers[0]->fp_trig_mask;
137 uint32_t locL1Trigger = locL1Triggers.empty() ? 0.0 : locL1Triggers[0]->trig_mask;
Value stored to 'locL1Trigger' during its initialization is never read
138
139 int trig_bit[33];
140 if (locL1Triggers.size() > 0) {
141 for (unsigned int bit = 0; bit < 32; bit ++) {
142 trig_bit[bit + 1] = (locL1Triggers[0]->trig_mask & (1 << bit)) ? 1 : 0;
143 if(trig_bit[bit + 1] == 1) //htrig_bit->Fill(Float_t(bit+1));
144 Fill1DHistogram("FCAL_Pi0HFA","","trig_bit",
145 Float_t(bit+1),
146 ";Trigger bit #;Count [a.u.]",
147 100, 0., 100.);
148
149 }
150 }
151
152 DVector3 vertex;
153 vertex.SetXYZ(m_beamSpotX, m_beamSpotY, m_targetZ);
154
155 //Use kinfit when available
156 double kinfitVertexX = m_beamSpotX;
157 double kinfitVertexY = m_beamSpotY;
158 double kinfitVertexZ = m_targetZ;
159 vector< const JObject* > locObjectsToSave;
160 for (unsigned int i = 0 ; i < kinfitVertex.size(); i++) {
161 kinfitVertexX = kinfitVertex[i]->dSpacetimeVertex.X();
162 kinfitVertexY = kinfitVertex[i]->dSpacetimeVertex.Y();
163 kinfitVertexZ = kinfitVertex[i]->dSpacetimeVertex.Z();
164 }
165
166 for (unsigned int i = 0; i < neutralParticleVector.size(); i++){
167 const DNeutralParticleHypothesis *photon1 = neutralParticleVector[i]->Get_Hypothesis(Gamma);
168 bool bo_pho1 = true;
169 if(photon1 == nullptr) bo_pho1 = false;
170 // Go into the FCAL shower and find the largest energy deposition
171 const DNeutralShower *shower1 = photon1->Get_NeutralShower();
172 if(shower1->dDetectorSystem != SYS_FCAL) continue;
173 DFCALShower *fcalShower1 = (DFCALShower *) shower1->dBCALFCALShower;
174 const DFCALCluster *fcalCluster1;
175 fcalShower1->GetSingle(fcalCluster1);
176 int ch1 = fcalCluster1->getChannelEmax();
177 double xShower1=fcalShower1->getPosition().X();
178 double yShower1=fcalShower1->getPosition().Y();
179 double zShower1=fcalShower1->getPosition().Z();
180 double xShowerlog1=fcalShower1->getPosition_log().X();
181 double yShowerlog1=fcalShower1->getPosition_log().Y();
182 double zShowerlog1=fcalShower1->getPosition_log().Z();
183 double x1 = xShower1 - kinfitVertexX;
184 double y1 = yShower1 - kinfitVertexY;
185 double z1 = zShower1 - kinfitVertexZ;
186 double xl1 = xShowerlog1 - kinfitVertexX;
187 double yl1 = yShowerlog1 - kinfitVertexY;
188 double zl1 = zShowerlog1 - kinfitVertexZ;
189 double radiusShower1=sqrt(pow(xShower1,2)+pow(yShower1,2));
190 double radiusShowerlog1=sqrt(pow(xShowerlog1,2)+pow(yShowerlog1,2));
191 double radius1 = fcalGeom.positionOnFace(ch1).Mod();
192 int ring1 = (int) (radius1 / (5 * k_cm));
193 int rings1 = (int) (radiusShower1 / (5 * k_cm));
194 int ringl1 = (int) (radiusShowerlog1 / (5 * k_cm));
195
196 double frac1 = fcalCluster1->getEmax()/fcalCluster1->getEnergy();
197 double Eclust1 = fcalCluster1->getEnergy();
198 double Ephoton1 = photon1->lorentzMomentum().E();
199 DVector3 vertex1(xl1, yl1, zl1);
200 double r1 = vertex1.Mag();
201 double t1 = fcalShower1->getTime() - (r1 / TMath::C() * 1e7);
202 double p1 = Ephoton1 ;
203 double p1x = p1 * sin(vertex1.Theta()) * cos(vertex1.Phi());
204 double p1y = p1 * sin(vertex1.Theta()) * sin(vertex1.Phi());
205 double p1z = p1 * cos(vertex1.Theta());
206 TLorentzVector photon1P4(p1x, p1y, p1z, p1);
207
208 Fill1DHistogram("FCAL_Pi0HFA","","E", Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
209 Fill1DHistogram("FCAL_Pi0HFA","","P", Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
210 Fill1DHistogram("FCAL_Pi0HFA","",Form("E_ring_%d", ring1), Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
211 Fill1DHistogram("FCAL_Pi0HFA","",Form("P_ring_%d", ring1), Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
212 Fill1DHistogram("FCAL_Pi0HFA","",Form("E_rings_%d", rings1), Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
213 Fill1DHistogram("FCAL_Pi0HFA","",Form("P_rings_%d", rings1), Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
214 Fill1DHistogram("FCAL_Pi0HFA","",Form("E_ringl_%d", ringl1), Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
215 Fill1DHistogram("FCAL_Pi0HFA","",Form("P_ringl_%d", ringl1), Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
216 if(radiusShower1 < 108.4239 && radiusShower1 > 20.785){
217 Fill1DHistogram("FCAL_Pi0HFA","","E_cut", Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
218 Fill1DHistogram("FCAL_Pi0HFA","","P_cut", Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
219 }
220 if(radiusShowerlog1 < 108.4239 && radiusShowerlog1 > 20.785){
221 Fill1DHistogram("FCAL_Pi0HFA","","E_cutlog", Eclust1, ";E_{cluster};Count [a.u.]", 12000, 0., 12.);
222 Fill1DHistogram("FCAL_Pi0HFA","","P_cutlog", Ephoton1, ";E_{#gamma};Count [a.u.]", 12000, 0., 12.);
223 }
224
225 int tof_match1 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x1, y1, z1);
226 int ltof_match1 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x1, y1, z1);
227 for (vector< const DTOFPoint* >::const_iterator tof_p = tof_points.begin(); tof_p != tof_points.end(); tof_p++ ) {
228
229 double xtof = (*tof_p)->pos.X() - kinfitVertexX;
230 double ytof = (*tof_p)->pos.Y() - kinfitVertexY;
231 double ztof = (*tof_p)->pos.Z() - kinfitVertexZ;
232 double xltof = (*tof_p)->pos.X() - kinfitVertexX;
233 double yltof = (*tof_p)->pos.Y() - kinfitVertexY;
234 double zltof = (*tof_p)->pos.Z() - kinfitVertexZ;
235
236 //double rtof = sqrt(xtof*xtof + ytof*ytof + ztof*ztof );
237 //double ttof = (*tof_p)->t - (rtof/TMath::C());
238
239 xtof = xtof * (z1 / ztof);
240 ytof = ytof * (z1 / ztof);
241 xltof = xltof * (zl1 / zltof);
242 yltof = yltof * (zl1 / zltof);
243
244 int hbar = (*tof_p)->dHorizontalBar;
245 int hstat = (*tof_p)->dHorizontalBarStatus;
246 int vbar = (*tof_p)->dVerticalBar;
247 int vstat = (*tof_p)->dVerticalBarStatus;
248
249 double dx, dy;
250 if( hstat==3 && vstat==3 ) {
251 dx = x1 - xtof;
252 dy = y1 - ytof;
253 } else if( vstat==3 ) {
254 dx = x1 - bar2x(vbar)*(z1 / ztof);
255 dy = y1 - ytof;
256 } else if( hstat==3 ) {
257 dx = x1 - xtof;
258 dy = y1 - bar2x(hbar)*(z1 / ztof);
259 } else {
260 dx = x1 - bar2x(vbar)*(z1 / ztof);
261 dy = y1 - bar2x(hbar)*(z1 / ztof);
262 }
263
264 double dlx, dly;
265 if( hstat==3 && vstat==3 ) {
266 dlx = xl1 - xltof;
267 dly = yl1 - yltof;
268 } else if( vstat==3 ) {
269 dlx = xl1 - bar2x(vbar)*(zl1 / zltof);
270 dly = yl1 - yltof;
271 } else if( hstat==3 ) {
272 dlx = xl1 - xltof;
273 dly = yl1 - bar2x(hbar)*(zl1 / zltof);
274 } else {
275 dlx = xl1 - bar2x(vbar)*(zl1 / zltof);
276 dly = yl1 - bar2x(hbar)*(zl1 / zltof);
277 }
278
279
280 if( fabs(dx) < 6. && fabs(dy) < 6. ) {
281 //if( dt > -1. && dt < 3. ) tof_match = 1;
282 tof_match1 = 1;
283 }
284 if( fabs(dlx) < 6. && fabs(dly) < 6. ) {
285 //if( dt > -1. && dt < 3. ) tof_match = 1;
286 ltof_match1 = 1;
287 }
288 } // end DTOFPoint loop
289
290 for (unsigned int j = i + 1; j < neutralParticleVector.size(); j ++){
291 const DNeutralParticleHypothesis *photon2 = neutralParticleVector[j]->Get_Hypothesis(Gamma);
292 bool bo_pho2 = true;
293 if(photon2 == nullptr) bo_pho2 = false;
294 const DNeutralShower *shower2 = photon2->Get_NeutralShower();
295 if(shower2->dDetectorSystem != SYS_FCAL) continue;
296 DFCALShower *fcalShower2 = (DFCALShower *) shower2->dBCALFCALShower;
297 const DFCALCluster *fcalCluster2;
298 fcalShower2->GetSingle(fcalCluster2);
299 int ch2 = fcalCluster2->getChannelEmax();
300 double xShower2=fcalShower2->getPosition().X();
301 double yShower2=fcalShower2->getPosition().Y();
302 double zShower2=fcalShower1->getPosition().Z();
303 double xShowerlog2=fcalShower2->getPosition_log().X();
304 double yShowerlog2=fcalShower2->getPosition_log().Y();
305 double zShowerlog2=fcalShower2->getPosition_log().Z();
306 double x2 = xShower2 - kinfitVertexX;
307 double y2 = yShower2 - kinfitVertexY;
308 double z2 = zShower2 - kinfitVertexZ;
309 double xl2 = xShowerlog2 - kinfitVertexX;
310 double yl2 = yShowerlog2 - kinfitVertexY;
311 double zl2 = zShowerlog2 - kinfitVertexZ;
312 double radiusShower2=sqrt(pow(xShower2,2)+pow(yShower2,2));
313 double radiusShowerlog2=sqrt(pow(xShowerlog2,2)+pow(yShowerlog2,2));
314 double radius2 = fcalGeom.positionOnFace(ch2).Mod();
315 int ring2 = (int) (radius2 / (5 * k_cm));
316 int rings2 = (int) (radiusShower2 / (5 * k_cm));
317 int ringl2 = (int) (radiusShowerlog2 / (5 * k_cm));
318
319 double frac2 = fcalCluster2->getEmax()/fcalCluster2->getEnergy();
320 double Eclust2 = fcalCluster2->getEnergy();
321 double Ephoton2 = photon2->lorentzMomentum().E();
322 DVector3 vertex2(xl2, yl2, zl2);
323 double r2 = vertex2.Mag();
324 double t2 = fcalShower2->getTime() - (r2 / TMath::C() * 1e7);
325 double p2 = Ephoton2;
326 double p2x = p2 * sin(vertex2.Theta()) * cos(vertex2.Phi());
327 double p2y = p2 * sin(vertex2.Theta()) * sin(vertex2.Phi());
328 double p2z = p2 * cos(vertex2.Theta());
329 TLorentzVector photon2P4(p2x, p2y, p2z, p2);
330
331
332 double Eratio = Eclust1 / Eclust2;
333 bool bo_5p = false;
334 bool bo_10p = false;
335 bool bo_20p = false;
336 bool bo_30p = false;
337 if (0.95 <= Eratio && Eratio <= 1.05) bo_5p = true;
338 if (0.90 <= Eratio && Eratio <= 1.10) bo_10p = true;
339 if (0.80 <= Eratio && Eratio <= 1.20) bo_20p = true;
340 if (0.70 <= Eratio && Eratio <= 1.30) bo_30p = true;
341 double pi0Mass = (photon1->lorentzMomentum() + photon2->lorentzMomentum()).M();
342 double pi0Masslog = (photon1P4 + photon2P4).M();
343 double avgE = 0.5*fcalCluster1->getEnergy() + 0.5*fcalCluster2->getEnergy();
344 DVector3 distance = vertex1 - vertex2;
345 double d = distance.Mag();
346 bool api0 = false;
347 bool aeta = false;
348 if (0.11 <= pi0Masslog && pi0Masslog <= 0.16) api0 = true;
349 if (0.51 <= pi0Masslog && pi0Masslog <= 0.58) aeta = true;
350
351 int tof_match2 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x2, y2, z2);
352 int ltof_match2 = 0;//TOF_Match(kinfitVertexX, kinfitVertexY, kinfitVertexZ, x2, y2, z2);
353 for (vector< const DTOFPoint* >::const_iterator tof_p = tof_points.begin(); tof_p != tof_points.end(); tof_p++ ) {
354
355 double xtof = (*tof_p)->pos.X() - kinfitVertexX;
356 double ytof = (*tof_p)->pos.Y() - kinfitVertexY;
357 double ztof = (*tof_p)->pos.Z() - kinfitVertexZ;
358 double xltof = (*tof_p)->pos.X() - kinfitVertexX;
359 double yltof = (*tof_p)->pos.Y() - kinfitVertexY;
360 double zltof = (*tof_p)->pos.Z() - kinfitVertexZ;
361
362 //double rtof = sqrt(xtof*xtof + ytof*ytof + ztof*ztof );
363 //double ttof = (*tof_p)->t - (rtof/TMath::C());
364
365 xtof = xtof * (z2 / ztof);
366 ytof = ytof * (z2 / ztof);
367 xltof = xltof * (zl2 / zltof);
368 yltof = yltof * (zl2 / zltof);
369
370 int hbar = (*tof_p)->dHorizontalBar;
371 int hstat = (*tof_p)->dHorizontalBarStatus;
372 int vbar = (*tof_p)->dVerticalBar;
373 int vstat = (*tof_p)->dVerticalBarStatus;
374
375 double dx, dy;
376 if( hstat==3 && vstat==3 ) {
377 dx = x2 - xtof;
378 dy = y2 - ytof;
379 } else if( vstat==3 ) {
380 dx = x2 - bar2x(vbar)*(z2 / ztof);
381 dy = y2 - ytof;
382 } else if( hstat==3 ) {
383 dx = x2 - xtof;
384 dy = y2 - bar2x(hbar)*(z2 / ztof);
385 } else {
386 dx = x2 - bar2x(vbar)*(z2 / ztof);
387 dy = y2 - bar2x(hbar)*(z2 / ztof);
388 }
389
390 double dlx, dly;
391 if( hstat==3 && vstat==3 ) {
392 dlx = xl2 - xltof;
393 dly = yl2 - yltof;
394 } else if( vstat==3 ) {
395 dlx = xl2 - bar2x(vbar)*(zl2 / zltof);
396 dly = yl2 - yltof;
397 } else if( hstat==3 ) {
398 dlx = xl2 - xltof;
399 dly = yl2 - bar2x(hbar)*(zl2 / zltof);
400 } else {
401 dlx = xl2 - bar2x(vbar)*(zl2 / zltof);
402 dly = yl2 - bar2x(hbar)*(zl2 / zltof);
403 }
404
405 if( fabs(dx) < 6. && fabs(dy) < 6. ) {
406 //if( dt > -1. && dt < 3. ) tof_match = 1;
407 tof_match2 = 1;
408 }
409 if( fabs(dlx) < 6. && fabs(dly) < 6. ) {
410 //if( dt > -1. && dt < 3. ) tof_match = 1;
411 ltof_match2 = 1;
412 }
413 } // end DTOFPoint loop
414
415 if ((tof_match1 == 0 && tof_match2 == 0) || (ltof_match1 == 0 && ltof_match2 == 0)) {
416
417 if (bo_pho1 && bo_pho2) {
418
419 Fill1DHistogram("FCAL_Pi0HFA","","Pi0Mass",
420 pi0Mass,
421 "#pi^{0} Mass; #pi^{0} Mass;",
422 500, 0.05, 0.7);
423
424 if(frac1 > 0.5){
425 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum",
426 ch1, pi0Mass,
427 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
428 2800, -0.5, 2799.5, 500, 0.05, 0.7);
429
430 if(radiusShower2<108.4239 && radiusShower2>20.785){
431 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_Fid",
432 ch1, pi0Mass,
433 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
434 2800, -0.5, 2799.5, 500, 0.05, 0.7);
435 if(radiusShower1<108.4239 && radiusShower1>20.785){
436 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_FidBoth",
437 ch1, pi0Mass,
438 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
439 2800, -0.5, 2799.5, 500, 0.05, 0.7);
440 }
441 }
442 if(radiusShower1<20.785 || radiusShower2<20.785){
443 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_InnerRing",
444 ch1, pi0Mass,
445 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
446 2800, -0.5, 2799.5, 500, 0.05, 0.7);
447 }
448
449 }
450 if(frac2 > 0.5){
451 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum",
452 ch2, pi0Mass,
453 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
454 2800, -0.5, 2799.5, 500, 0.05, 0.7);
455 if(radiusShower1<108.4239 && radiusShower1>20.785){
456 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_Fid",
457 ch2, pi0Mass,
458 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
459 2800, -0.5, 2799.5, 500, 0.05, 0.7);
460 if(radiusShower2<108.4239 && radiusShower2>20.785){
461 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_FidBoth",
462 ch2, pi0Mass,
463 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
464 2800, -0.5, 2799.5, 500, 0.05, 0.7);
465 }
466 }
467 if(radiusShower1<20.785 || radiusShower2<20.785){
468 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsChNum_InnerRing",
469 ch1, pi0Mass,
470 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
471 2800, -0.5, 2799.5, 500, 0.05, 0.7);
472 }
473
474 }
475 // Energy Weighted Pi0 Mass
476 for(auto hit : fcalCluster1->GetHits()){
477 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted",
478 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy(),
479 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
480 2800, -0.5, 2799.5, 500, 0.05, 0.7);
481 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared",
482 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()),
483 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
484 2800, -0.5, 2799.5, 500, 0.05, 0.7);
485 if(radiusShower2<108.4239 && radiusShower2>20.785){
486 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_Fid",
487 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy(),
488 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
489 2800, -0.5, 2799.5, 500, 0.05, 0.7);
490 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_Fid",
491 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()),
492 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
493 2800, -0.5, 2799.5, 500, 0.05, 0.7);
494 if(radiusShower1<108.4239 && radiusShower1>20.785){
495 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_FidBoth",
496 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy(),
497 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
498 2800, -0.5, 2799.5, 500, 0.05, 0.7);
499 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_FidBoth",
500 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()),
501 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
502 2800, -0.5, 2799.5, 500, 0.05, 0.7);
503 }
504 }
505
506 }
507
508 for(auto hit : fcalCluster2->GetHits()){
509 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted",
510 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy(),
511 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
512 2800, -0.5, 2799.5, 500, 0.05, 0.7);
513 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared",
514 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()),
515 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
516 2800, -0.5, 2799.5, 500, 0.05, 0.7);
517 if(radiusShower1<108.4239 && radiusShower1>20.785){
518 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_Fid",
519 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy(),
520 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
521 2800, -0.5, 2799.5, 500, 0.05, 0.7);
522 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_Fid",
523 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()),
524 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
525 2800, -0.5, 2799.5, 500, 0.05, 0.7);
526 if(radiusShower2<108.4239 && radiusShower2>20.785){
527 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeighted_FidBoth",
528 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy(),
529 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
530 2800, -0.5, 2799.5, 500, 0.05, 0.7);
531 Fill2DWeightedHistogram("FCAL_Pi0HFA","","Pi0MassVsChNumWeightedSquared_FidBoth",
532 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()),
533 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
534 2800, -0.5, 2799.5, 500, 0.05, 0.7);
535 }
536 }
537
538 }
539
540 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.25){
541 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE",
542 avgE, pi0Mass,
543 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
544 100, 0.0, 10.0, 500, 0.05, 0.7);
545 if(radiusShower2<108.4239 && radiusShower2>20.785){
546 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_Fiducial",
547 avgE, pi0Mass,
548 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
549 100, 0.0, 10.0, 500, 0.05, 0.7);
550 if(radiusShower1<108.4239 && radiusShower1>20.785){
551 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_FiducialBoth",
552 avgE, pi0Mass,
553 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
554 100, 0.0, 10.0, 500, 0.05, 0.7);
555 }
556 }
557
558 }
559 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.5){
560 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_500",
561 avgE, pi0Mass,
562 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
563 100, 0.0, 10.0, 500, 0.05, 0.7);
564
565 if(radiusShower2<108.4239 && radiusShower2>20.785){
566 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_500_Fiducial",
567 avgE, pi0Mass,
568 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
569 100, 0.0, 10.0, 500, 0.05, 0.7);
570 if(radiusShower1<108.4239 && radiusShower1>20.785){
571 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_500_FiducialBoth",
572 avgE, pi0Mass,
573 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
574 100, 0.0, 10.0, 500, 0.05, 0.7);
575 }
576 }
577
578 }
579 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.1){
580 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_100",
581 avgE, pi0Mass,
582 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
583 100, 0.0, 10.0, 500, 0.05, 0.7);
584
585 if(radiusShower2<108.4239 && radiusShower2>20.785){
586 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_100_Fiducial",
587 avgE, pi0Mass,
588 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
589 100, 0.0, 10.0, 500, 0.05, 0.7);
590 if(radiusShower1<108.4239 && radiusShower1>20.785){
591 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_100_FiducialBoth",
592 avgE, pi0Mass,
593 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
594 100, 0.0, 10.0, 500, 0.05, 0.7);
595 }
596 }
597 }
598 if (fabs(fcalCluster1->getEnergy() - fcalCluster2->getEnergy()) < 0.05){
599 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_50",
600 avgE, pi0Mass,
601 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
602 100, 0.0, 10.0, 500, 0.05, 0.7);
603 if(radiusShower2<108.4239 && radiusShower2>20.785){
604 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_50_Fiducial",
605 avgE, pi0Mass,
606 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
607 100, 0.0, 10.0, 500, 0.05, 0.7);
608 if(radiusShower1<108.4239 && radiusShower1>20.785){
609 Fill2DHistogram("FCAL_Pi0HFA","","Pi0MassVsE_50_FiducialBoth",
610 avgE, pi0Mass,
611 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
612 100, 0.0, 10.0, 500, 0.05, 0.7);
613 }
614 }
615 }
616 }
617
618 for (unsigned int k = 0; k < (int) locBeamPhotons.size(); k ++) {
619
620 const DBeamPhoton *ebeam = locBeamPhotons[k];
621 //double eb = ebeam->lorentzMomentum().E();
622 double tb = ebeam->time();
623 double zb = ebeam->position().Z();
624
625 double locDeltaTRF = tb - (locRFTime + (zb - m_targetZ) / 29.9792458);
626 Fill1DHistogram("FCAL_Pi0TOF","","TaggerTiming1", locDeltaTRF, ";t_{e^{-}} - t_{#gamma} [ns];Count [a.u.]", 500, -100., 100.);
627 //Fill2DWeightedHistogram("FCAL_Pi0TOF","","PhotonTiming1", t1 - t2, pi0Masslog, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100.);
628 //Fill2DWeightedHistogram("FCAL_Pi0TOF","","PhotonTiming1", t2 - t1, pi0Masslog, weight, ";t_{#gamma} - t_{#gamma} [ns]; pi0 mass [GeV];Count [a.u.]", 500, -100., 100.);
629 double weight = 0;
630 if (fabs(locDeltaTRF) <= 2.004) {
631 weight = 1;
632 } else if ( ( -(2.004 + 3.0 * 4.008) <= locDeltaTRF && locDeltaTRF <= -(2.004 + 4.008) ) ||
633 ( (2.004 + 4.008) <= locDeltaTRF && locDeltaTRF <= (2.004 + 3.0 * 4.008) ) ) {
634 weight = -0.25;
635 } else {
636 continue;
637 }
638 if (tof_match1 == 0 && tof_match2 == 0) {
639
640 Fill1DHistogram("FCAL_Pi0TOF","","TaggerTiming2", locDeltaTRF, ";t_{e^{-}} - t_{#gamma} [ns];Count [a.u.]", 500, -100., 100.);
641 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);
642 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);
643
644 Fill1DWeightedHistogram("FCAL_Pi0TOF","","Pi0Mass",
645 pi0Mass, weight,
646 "#pi^{0} Mass; #pi^{0} Mass;",
647 500, 0.05, 0.7);
648 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_ring_%d", ring1),
649 pi0Mass, weight,
650 "#pi^{0} Mass; #pi^{0} Mass;",
651 500, 0.05, 0.7);
652 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_rings_%d", rings1),
653 pi0Mass, weight,
654 "#pi^{0} Mass; #pi^{0} Mass;",
655 500, 0.05, 0.7);
656 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_ring_%d", ring2),
657 pi0Mass, weight,
658 "#pi^{0} Mass; #pi^{0} Mass;",
659 500, 0.05, 0.7);
660 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass_rings_%d", rings2),
661 pi0Mass, weight,
662 "#pi^{0} Mass; #pi^{0} Mass;",
663 500, 0.05, 0.7);
664
665 if (neutralParticleVector.size() == 2) {
666 Fill1DWeightedHistogram("FCAL_Pi0TOF","","Pi0Mass",
667 pi0Mass, weight,
668 "#pi^{0} Mass; #pi^{0} Mass;",
669 500, 0.05, 0.7);
670 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_ring_%d", ring1),
671 pi0Mass, weight,
672 "#pi^{0} Mass; #pi^{0} Mass;",
673 500, 0.05, 0.7);
674 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_rings_%d", rings1),
675 pi0Mass, weight,
676 "#pi^{0} Mass; #pi^{0} Mass;",
677 500, 0.05, 0.7);
678 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_ring_%d", ring2),
679 pi0Mass, weight,
680 "#pi^{0} Mass; #pi^{0} Mass;",
681 500, 0.05, 0.7);
682 Fill1DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2g_rings_%d", rings2),
683 pi0Mass, weight,
684 "#pi^{0} Mass; #pi^{0} Mass;",
685 500, 0.05, 0.7);
686 }
687 if(frac1 > 0.1){
688 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum",
689 ch1, pi0Mass, weight,
690 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
691 2800, -0.5, 2799.5, 500, 0.05, 0.7);
692
693 if(radiusShower2<108.4239 && radiusShower2>20.785){
694 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_Fid",
695 ch1, pi0Mass, weight,
696 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
697 2800, -0.5, 2799.5, 500, 0.05, 0.7);
698 if(radiusShower1<108.4239 && radiusShower1>20.785){
699 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_FidBoth",
700 ch1, pi0Mass, weight,
701 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
702 2800, -0.5, 2799.5, 500, 0.05, 0.7);
703 }
704 }
705 if(radiusShower1<20.785 || radiusShower2<20.785){
706 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_InnerRing",
707 ch1, pi0Mass, weight,
708 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
709 2800, -0.5, 2799.5, 500, 0.05, 0.7);
710 }
711
712 }
713 if(frac2 > 0.1){
714 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum",
715 ch2, pi0Mass, weight,
716 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
717 2800, -0.5, 2799.5, 500, 0.05, 0.7);
718 if(radiusShower1<108.4239 && radiusShower1>20.785){
719 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_Fid",
720 ch2, pi0Mass, weight,
721 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
722 2800, -0.5, 2799.5, 500, 0.05, 0.7);
723 if(radiusShower2<108.4239 && radiusShower2>20.785){
724 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_FidBoth",
725 ch2, pi0Mass, weight,
726 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
727 2800, -0.5, 2799.5, 500, 0.05, 0.7);
728 }
729 }
730 if(radiusShower1<20.785 || radiusShower2<20.785){
731 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNum_InnerRing",
732 ch1, pi0Mass, weight,
733 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
734 2800, -0.5, 2799.5, 500, 0.05, 0.7);
735 }
736
737 }
738 // Energy Weighted Pi0 Mass
739 for(auto hit : fcalCluster1->GetHits()){
740 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted",
741 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy() * weight,
742 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
743 2800, -0.5, 2799.5, 500, 0.05, 0.7);
744 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared",
745 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
746 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
747 2800, -0.5, 2799.5, 500, 0.05, 0.7);
748 if(radiusShower2<108.4239 && radiusShower2>20.785){
749 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_Fid",
750 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy() * weight,
751 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
752 2800, -0.5, 2799.5, 500, 0.05, 0.7);
753 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_Fid",
754 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
755 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
756 2800, -0.5, 2799.5, 500, 0.05, 0.7);
757 if(radiusShower1<108.4239 && radiusShower1>20.785){
758 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_FidBoth",
759 hit.ch, pi0Mass, hit.E / fcalCluster1->getEnergy() * weight,
760 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
761 2800, -0.5, 2799.5, 500, 0.05, 0.7);
762 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_FidBoth",
763 hit.ch, pi0Mass, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
764 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
765 2800, -0.5, 2799.5, 500, 0.05, 0.7);
766 }
767 }
768
769 }
770
771 for(auto hit : fcalCluster2->GetHits()){
772 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted",
773 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy() * weight,
774 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
775 2800, -0.5, 2799.5, 500, 0.05, 0.7);
776 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared",
777 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
778 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
779 2800, -0.5, 2799.5, 500, 0.05, 0.7);
780 if(radiusShower1<108.4239 && radiusShower1>20.785){
781 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_Fid",
782 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy() * weight,
783 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
784 2800, -0.5, 2799.5, 500, 0.05, 0.7);
785 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_Fid",
786 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
787 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
788 2800, -0.5, 2799.5, 500, 0.05, 0.7);
789 if(radiusShower2<108.4239 && radiusShower2>20.785){
790 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeighted_FidBoth",
791 hit.ch, pi0Mass, hit.E / fcalCluster2->getEnergy() * weight,
792 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
793 2800, -0.5, 2799.5, 500, 0.05, 0.7);
794 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsChNumWeightedSquared_FidBoth",
795 hit.ch, pi0Mass, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
796 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
797 2800, -0.5, 2799.5, 500, 0.05, 0.7);
798 }
799 }
800
801 }
802
803 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_ring_%d", ring1),
804 Eclust1, pi0Mass, weight,
805 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
806 100, 0.0, 10.0, 500, 0.05, 0.7);
807 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_ring_%d", ring2),
808 Eclust2, pi0Mass, weight,
809 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
810 100, 0.0, 10.0, 500, 0.05, 0.7);
811 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_rings_%d", rings1),
812 Eclust1, pi0Mass, weight,
813 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
814 100, 0.0, 10.0, 500, 0.05, 0.7);
815 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_rings_%d", rings2),
816 Eclust2, pi0Mass, weight,
817 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
818 100, 0.0, 10.0, 500, 0.05, 0.7);
819 if (neutralParticleVector.size() == 2) {
820 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_ring_%d", ring1),
821 Eclust1, pi0Mass, weight,
822 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
823 100, 0.0, 10.0, 500, 0.05, 0.7);
824 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_ring_%d", ring2),
825 Eclust2, pi0Mass, weight,
826 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
827 100, 0.0, 10.0, 500, 0.05, 0.7);
828 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_rings_%d", rings1),
829 Eclust1, pi0Mass, weight,
830 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
831 100, 0.0, 10.0, 500, 0.05, 0.7);
832 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_rings_%d", rings2),
833 Eclust2, pi0Mass, weight,
834 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
835 100, 0.0, 10.0, 500, 0.05, 0.7);
836 }
837
838 if (bo_5p){
839 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_ring_%d", ring1),
840 avgE, pi0Mass, weight,
841 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
842 100, 0.0, 10.0, 500, 0.05, 0.7);
843 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_ring_%d", ring2),
844 avgE, pi0Mass, weight,
845 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
846 100, 0.0, 10.0, 500, 0.05, 0.7);
847 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_rings_%d", rings1),
848 avgE, pi0Mass, weight,
849 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
850 100, 0.0, 10.0, 500, 0.05, 0.7);
851 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_5_rings_%d", rings2),
852 avgE, pi0Mass, weight,
853 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
854 100, 0.0, 10.0, 500, 0.05, 0.7);
855 if (neutralParticleVector.size() == 2) {
856 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_ring_%d", ring1),
857 avgE, pi0Mass, weight,
858 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
859 100, 0.0, 10.0, 500, 0.05, 0.7);
860 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_ring_%d", ring2),
861 avgE, pi0Mass, weight,
862 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
863 100, 0.0, 10.0, 500, 0.05, 0.7);
864 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_rings_%d", rings1),
865 avgE, pi0Mass, weight,
866 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
867 100, 0.0, 10.0, 500, 0.05, 0.7);
868 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_5_rings_%d", rings2),
869 avgE, pi0Mass, weight,
870 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
871 100, 0.0, 10.0, 500, 0.05, 0.7);
872 }
873
874 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_5",
875 avgE, pi0Mass, weight,
876 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
877 100, 0.0, 10.0, 500, 0.05, 0.7);
878 if(radiusShower2<108.4239 && radiusShower2>20.785){
879 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_5_Fiducial",
880 avgE, pi0Mass, weight,
881 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
882 100, 0.0, 10.0, 500, 0.05, 0.7);
883 if(radiusShower1<108.4239 && radiusShower1>20.785){
884 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_5_FiducialBoth",
885 avgE, pi0Mass, weight,
886 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
887 100, 0.0, 10.0, 500, 0.05, 0.7);
888 }
889 }
890
891 }
892 if (bo_10p){
893 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_ring_%d", ring1),
894 avgE, pi0Mass, weight,
895 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
896 100, 0.0, 10.0, 500, 0.05, 0.7);
897 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_ring_%d", ring2),
898 avgE, pi0Mass, weight,
899 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
900 100, 0.0, 10.0, 500, 0.05, 0.7);
901 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_rings_%d", rings1),
902 avgE, pi0Mass, weight,
903 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
904 100, 0.0, 10.0, 500, 0.05, 0.7);
905 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_10_rings_%d", rings2),
906 avgE, pi0Mass, weight,
907 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
908 100, 0.0, 10.0, 500, 0.05, 0.7);
909 if (neutralParticleVector.size() == 2) {
910 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_ring_%d", ring1),
911 avgE, pi0Mass, weight,
912 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
913 100, 0.0, 10.0, 500, 0.05, 0.7);
914 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_ring_%d", ring2),
915 avgE, pi0Mass, weight,
916 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
917 100, 0.0, 10.0, 500, 0.05, 0.7);
918 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_rings_%d", rings1),
919 avgE, pi0Mass, weight,
920 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
921 100, 0.0, 10.0, 500, 0.05, 0.7);
922 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_10_rings_%d", rings2),
923 avgE, pi0Mass, weight,
924 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
925 100, 0.0, 10.0, 500, 0.05, 0.7);
926 }
927 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_10",
928 avgE, pi0Mass, weight,
929 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
930 100, 0.0, 10.0, 500, 0.05, 0.7);
931
932 if(radiusShower2<108.4239 && radiusShower2>20.785){
933 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_10_Fiducial",
934 avgE, pi0Mass, weight,
935 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
936 100, 0.0, 10.0, 500, 0.05, 0.7);
937 if(radiusShower1<108.4239 && radiusShower1>20.785){
938 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_10_FiducialBoth",
939 avgE, pi0Mass, weight,
940 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
941 100, 0.0, 10.0, 500, 0.05, 0.7);
942 }
943 }
944
945 }
946 if (bo_20p){
947 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_ring_%d", ring1),
948 avgE, pi0Mass, weight,
949 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
950 100, 0.0, 10.0, 500, 0.05, 0.7);
951 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_ring_%d", ring2),
952 avgE, pi0Mass, weight,
953 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
954 100, 0.0, 10.0, 500, 0.05, 0.7);
955 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_rings_%d", rings1),
956 avgE, pi0Mass, weight,
957 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
958 100, 0.0, 10.0, 500, 0.05, 0.7);
959 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_20_rings_%d", rings2),
960 avgE, pi0Mass, weight,
961 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
962 100, 0.0, 10.0, 500, 0.05, 0.7);
963 if (neutralParticleVector.size() == 2) {
964 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_ring_%d", ring1),
965 avgE, pi0Mass, weight,
966 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
967 100, 0.0, 10.0, 500, 0.05, 0.7);
968 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_ring_%d", ring2),
969 avgE, pi0Mass, weight,
970 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
971 100, 0.0, 10.0, 500, 0.05, 0.7);
972 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_rings_%d", rings1),
973 avgE, pi0Mass, weight,
974 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
975 100, 0.0, 10.0, 500, 0.05, 0.7);
976 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_20_rings_%d", rings2),
977 avgE, pi0Mass, weight,
978 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
979 100, 0.0, 10.0, 500, 0.05, 0.7);
980 }
981 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_20",
982 avgE, pi0Mass, weight,
983 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
984 100, 0.0, 10.0, 500, 0.05, 0.7);
985
986 if(radiusShower2<108.4239 && radiusShower2>20.785){
987 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_20_Fiducial",
988 avgE, pi0Mass, weight,
989 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
990 100, 0.0, 10.0, 500, 0.05, 0.7);
991 if(radiusShower1<108.4239 && radiusShower1>20.785){
992 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_20_FiducialBoth",
993 avgE, pi0Mass, weight,
994 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
995 100, 0.0, 10.0, 500, 0.05, 0.7);
996 }
997 }
998 }
999 if (bo_30p){
1000 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_ring_%d", ring1),
1001 avgE, pi0Mass, weight,
1002 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1003 100, 0.0, 10.0, 500, 0.05, 0.7);
1004 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_ring_%d", ring2),
1005 avgE, pi0Mass, weight,
1006 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1007 100, 0.0, 10.0, 500, 0.05, 0.7);
1008 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_rings_%d", rings1),
1009 avgE, pi0Mass, weight,
1010 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1011 100, 0.0, 10.0, 500, 0.05, 0.7);
1012 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0MassVsE_30_rings_%d", rings2),
1013 avgE, pi0Mass, weight,
1014 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1015 100, 0.0, 10.0, 500, 0.05, 0.7);
1016 if (neutralParticleVector.size() == 2) {
1017 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_ring_%d", ring1),
1018 avgE, pi0Mass, weight,
1019 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1020 100, 0.0, 10.0, 500, 0.05, 0.7);
1021 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_ring_%d", ring2),
1022 avgE, pi0Mass, weight,
1023 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1024 100, 0.0, 10.0, 500, 0.05, 0.7);
1025 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_rings_%d", rings1),
1026 avgE, pi0Mass, weight,
1027 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1028 100, 0.0, 10.0, 500, 0.05, 0.7);
1029 Fill2DWeightedHistogram("FCAL_Pi0TOF","",Form("Pi0Mass2gVsE_30_rings_%d", rings2),
1030 avgE, pi0Mass, weight,
1031 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1032 100, 0.0, 10.0, 500, 0.05, 0.7);
1033 }
1034 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_30",
1035 avgE, pi0Mass, weight,
1036 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1037 100, 0.0, 10.0, 500, 0.05, 0.7);
1038 if(radiusShower2<108.4239 && radiusShower2>20.785){
1039 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_30_Fiducial",
1040 avgE, pi0Mass, weight,
1041 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1042 100, 0.0, 10.0, 500, 0.05, 0.7);
1043 if(radiusShower1<108.4239 && radiusShower1>20.785){
1044 Fill2DWeightedHistogram("FCAL_Pi0TOF","","Pi0MassVsE_30_FiducialBoth",
1045 avgE, pi0Mass, weight,
1046 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1047 100, 0.0, 10.0, 500, 0.05, 0.7);
1048 }
1049 }
1050 }
1051 }
1052
1053 if (ltof_match1 == 0 && ltof_match2 == 0) {
1054
1055 Fill1DHistogram("FCAL_Pi0log","","TaggerTiming1", locDeltaTRF, ";t_{e^{-}} - t_{#gamma} [ns];Count [a.u.]", 500, -100., 100.);
1056 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);
1057 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);
1058
1059 if (api0)
1060 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi0Clusters",
1061 ring1, d, weight,
1062 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1063 30, 0, 30, 500, 0., 100.);
1064 if (aeta)
1065 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi0Clusters",
1066 ring1, d, weight,
1067 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1068 30, 0, 30, 500, 0., 100.);
1069
1070
1071
1072 Fill1DWeightedHistogram("FCAL_Pi0log","","Pi0Mass",
1073 pi0Masslog, weight,
1074 "#pi^{0} Mass; #pi^{0} Mass;",
1075 500, 0.05, 0.7);
1076 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ring_%d", ring1),
1077 pi0Masslog, weight,
1078 "#pi^{0} Mass; #pi^{0} Mass;",
1079 500, 0.05, 0.7);
1080 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ringl_%d", ringl1),
1081 pi0Masslog, weight,
1082 "#pi^{0} Mass; #pi^{0} Mass;",
1083 500, 0.05, 0.7);
1084 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ring_%d", ring2),
1085 pi0Masslog, weight,
1086 "#pi^{0} Mass; #pi^{0} Mass;",
1087 500, 0.05, 0.7);
1088 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass_ringl_%d", ringl2),
1089 pi0Masslog, weight,
1090 "#pi^{0} Mass; #pi^{0} Mass;",
1091 500, 0.05, 0.7);
1092
1093 if (neutralParticleVector.size() == 2) {
1094 if (api0)
1095 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi02gClusters",
1096 ring1, d, weight,
1097 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1098 30, 0, 30, 500, 0., 100.);
1099 if (aeta)
1100 Fill2DWeightedHistogram("FCAL_Pi0log","","DistanceBetweenPi02gClusters",
1101 ring1, d, weight,
1102 ";ring #;Distance between two clusters [cm];Count [a.u.]",
1103 30, 0, 30, 500, 0., 100.);
1104
1105 Fill1DWeightedHistogram("FCAL_Pi0log","","Pi0Mass",
1106 pi0Masslog, weight,
1107 "#pi^{0} Mass; #pi^{0} Mass;",
1108 500, 0.05, 0.7);
1109 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ring_%d", ring1),
1110 pi0Masslog, weight,
1111 "#pi^{0} Mass; #pi^{0} Mass;",
1112 500, 0.05, 0.7);
1113 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ringl_%d", ringl1),
1114 pi0Masslog, weight,
1115 "#pi^{0} Mass; #pi^{0} Mass;",
1116 500, 0.05, 0.7);
1117 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ring_%d", ring2),
1118 pi0Masslog, weight,
1119 "#pi^{0} Mass; #pi^{0} Mass;",
1120 500, 0.05, 0.7);
1121 Fill1DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2g_ringl_%d", ringl2),
1122 pi0Masslog, weight,
1123 "#pi^{0} Mass; #pi^{0} Mass;",
1124 500, 0.05, 0.7);
1125 }
1126 if(frac1 > 0.1){
1127 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum",
1128 ch1, pi0Masslog, weight,
1129 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1130 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1131
1132 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1133 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_Fid",
1134 ch1, pi0Masslog, weight,
1135 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1136 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1137 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1138 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_FidBoth",
1139 ch1, pi0Masslog, weight,
1140 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1141 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1142 }
1143 }
1144 if(radiusShowerlog1<20.785 || radiusShowerlog2<20.785){
1145 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_InnerRing",
1146 ch1, pi0Masslog, weight,
1147 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1148 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1149 }
1150
1151 }
1152 if(frac2 > 0.1){
1153 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum",
1154 ch2, pi0Masslog, weight,
1155 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1156 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1157 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1158 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_Fid",
1159 ch2, pi0Masslog, weight,
1160 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1161 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1162 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1163 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_FidBoth",
1164 ch2, pi0Masslog, weight,
1165 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1166 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1167 }
1168 }
1169 if(radiusShowerlog1<20.785 || radiusShowerlog2<20.785){
1170 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNum_InnerRing",
1171 ch1, pi0Masslog, weight,
1172 "#pi^{0} Mass Vs. Channel Number; CCDB Index; #pi^{0} Mass",
1173 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1174 }
1175
1176 }
1177 // Energy Weighted Pi0 Mass
1178 for(auto hit : fcalCluster1->GetHits()){
1179 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted",
1180 hit.ch, pi0Masslog, hit.E / fcalCluster1->getEnergy() * weight,
1181 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1182 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1183 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared",
1184 hit.ch, pi0Masslog, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1185 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1186 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1187 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1188 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_Fid",
1189 hit.ch, pi0Masslog, hit.E / fcalCluster1->getEnergy() * weight,
1190 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1191 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1192 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_Fid",
1193 hit.ch, pi0Masslog, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1194 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1195 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1196 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1197 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_FidBoth",
1198 hit.ch, pi0Masslog, hit.E / fcalCluster1->getEnergy() * weight,
1199 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1200 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1201 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_FidBoth",
1202 hit.ch, pi0Masslog, (hit.E / fcalCluster1->getEnergy())*(hit.E / fcalCluster1->getEnergy()) * weight,
1203 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1204 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1205 }
1206 }
1207
1208 }
1209
1210 for(auto hit : fcalCluster2->GetHits()){
1211 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted",
1212 hit.ch, pi0Masslog, hit.E / fcalCluster2->getEnergy() * weight,
1213 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1214 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1215 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared",
1216 hit.ch, pi0Masslog, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1217 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1218 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1219 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1220 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_Fid",
1221 hit.ch, pi0Masslog, hit.E / fcalCluster2->getEnergy() * weight,
1222 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1223 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1224 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_Fid",
1225 hit.ch, pi0Masslog, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1226 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1227 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1228 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1229 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeighted_FidBoth",
1230 hit.ch, pi0Masslog, hit.E / fcalCluster2->getEnergy() * weight,
1231 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1232 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1233 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsChNumWeightedSquared_FidBoth",
1234 hit.ch, pi0Masslog, (hit.E / fcalCluster2->getEnergy())*(hit.E / fcalCluster2->getEnergy()) * weight,
1235 "#pi^{0} Mass Vs. Channel Number Weighted; CCDB Index; #pi^{0} Mass",
1236 2800, -0.5, 2799.5, 500, 0.05, 0.7);
1237 }
1238 }
1239
1240 }
1241
1242 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ring_%d", ring1),
1243 Eclust1, pi0Masslog, weight,
1244 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1245 100, 0.0, 10.0, 500, 0.05, 0.7);
1246 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ring_%d", ring2),
1247 Eclust2, pi0Masslog, weight,
1248 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1249 100, 0.0, 10.0, 500, 0.05, 0.7);
1250 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ringl_%d", ringl1),
1251 Eclust1, pi0Masslog, weight,
1252 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1253 100, 0.0, 10.0, 500, 0.05, 0.7);
1254 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_ringl_%d", ringl2),
1255 Eclust2, pi0Masslog, weight,
1256 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1257 100, 0.0, 10.0, 500, 0.05, 0.7);
1258 if (neutralParticleVector.size() == 2) {
1259 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ring_%d", ring1),
1260 Eclust1, pi0Masslog, weight,
1261 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1262 100, 0.0, 10.0, 500, 0.05, 0.7);
1263 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ring_%d", ring2),
1264 Eclust2, pi0Masslog, weight,
1265 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1266 100, 0.0, 10.0, 500, 0.05, 0.7);
1267 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ringl_%d", ringl1),
1268 Eclust1, pi0Masslog, weight,
1269 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1270 100, 0.0, 10.0, 500, 0.05, 0.7);
1271 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_ringl_%d", ringl2),
1272 Eclust2, pi0Masslog, weight,
1273 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1274 100, 0.0, 10.0, 500, 0.05, 0.7);
1275 }
1276
1277 if (bo_5p){
1278 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_ring_%d", ring1),
1279 avgE, pi0Masslog, 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_Pi0log","",Form("Pi0MassVsE_5_ring_%d", ring2),
1283 avgE, pi0Masslog, 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_Pi0log","",Form("Pi0MassVsE_5_ringl_%d", ringl1),
1287 avgE, pi0Masslog, 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 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_5_ringl_%d", ringl2),
1291 avgE, pi0Masslog, weight,
1292 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1293 100, 0.0, 10.0, 500, 0.05, 0.7);
1294 if (neutralParticleVector.size() == 2) {
1295 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ring_%d", ring1),
1296 avgE, pi0Masslog, weight,
1297 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1298 100, 0.0, 10.0, 500, 0.05, 0.7);
1299 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ring_%d", ring2),
1300 avgE, pi0Masslog, weight,
1301 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1302 100, 0.0, 10.0, 500, 0.05, 0.7);
1303 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ringl_%d", ringl1),
1304 avgE, pi0Masslog, weight,
1305 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1306 100, 0.0, 10.0, 500, 0.05, 0.7);
1307 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_5_ringl_%d", ringl2),
1308 avgE, pi0Masslog, weight,
1309 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1310 100, 0.0, 10.0, 500, 0.05, 0.7);
1311 }
1312
1313 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_5",
1314 avgE, pi0Masslog, 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 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1318 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_5_Fiducial",
1319 avgE, pi0Masslog, weight,
1320 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1321 100, 0.0, 10.0, 500, 0.05, 0.7);
1322 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1323 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_5_FiducialBoth",
1324 avgE, pi0Masslog, weight,
1325 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1326 100, 0.0, 10.0, 500, 0.05, 0.7);
1327 }
1328 }
1329
1330 }
1331 if (bo_10p){
1332 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ring_%d", ring1),
1333 avgE, pi0Masslog, 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 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ring_%d", ring2),
1337 avgE, pi0Masslog, weight,
1338 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1339 100, 0.0, 10.0, 500, 0.05, 0.7);
1340 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ringl_%d", ringl1),
1341 avgE, pi0Masslog, weight,
1342 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1343 100, 0.0, 10.0, 500, 0.05, 0.7);
1344 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_10_ringl_%d", ringl2),
1345 avgE, pi0Masslog, weight,
1346 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1347 100, 0.0, 10.0, 500, 0.05, 0.7);
1348 if (neutralParticleVector.size() == 2) {
1349 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_10_ring_%d", ring1),
1350 avgE, pi0Masslog, 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_Pi0log","",Form("Pi0Mass2gVsE_10_ring_%d", ring2),
1354 avgE, pi0Masslog, 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_Pi0log","",Form("Pi0Mass2gVsE_10_ringl_%d", ringl1),
1358 avgE, pi0Masslog, 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 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_10_ringl_%d", ringl2),
1362 avgE, pi0Masslog, weight,
1363 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1364 100, 0.0, 10.0, 500, 0.05, 0.7);
1365 }
1366 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_10",
1367 avgE, pi0Masslog, weight,
1368 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1369 100, 0.0, 10.0, 500, 0.05, 0.7);
1370
1371 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1372 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_10_Fiducial",
1373 avgE, pi0Masslog, weight,
1374 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1375 100, 0.0, 10.0, 500, 0.05, 0.7);
1376 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1377 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_10_FiducialBoth",
1378 avgE, pi0Masslog, weight,
1379 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1380 100, 0.0, 10.0, 500, 0.05, 0.7);
1381 }
1382 }
1383
1384 }
1385 if (bo_20p){
1386 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ring_%d", ring1),
1387 avgE, pi0Masslog, weight,
1388 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1389 100, 0.0, 10.0, 500, 0.05, 0.7);
1390 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ring_%d", ring2),
1391 avgE, pi0Masslog, weight,
1392 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1393 100, 0.0, 10.0, 500, 0.05, 0.7);
1394 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ringl_%d", ringl1),
1395 avgE, pi0Masslog, weight,
1396 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1397 100, 0.0, 10.0, 500, 0.05, 0.7);
1398 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_20_ringl_%d", ringl2),
1399 avgE, pi0Masslog, weight,
1400 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1401 100, 0.0, 10.0, 500, 0.05, 0.7);
1402 if (neutralParticleVector.size() == 2) {
1403 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ring_%d", ring1),
1404 avgE, pi0Masslog, weight,
1405 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1406 100, 0.0, 10.0, 500, 0.05, 0.7);
1407 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ring_%d", ring2),
1408 avgE, pi0Masslog, 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 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ringl_%d", ringl1),
1412 avgE, pi0Masslog, weight,
1413 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1414 100, 0.0, 10.0, 500, 0.05, 0.7);
1415 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_20_ringl_%d", ringl2),
1416 avgE, pi0Masslog, weight,
1417 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1418 100, 0.0, 10.0, 500, 0.05, 0.7);
1419 }
1420 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_20",
1421 avgE, pi0Masslog, weight,
1422 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1423 100, 0.0, 10.0, 500, 0.05, 0.7);
1424
1425 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1426 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_20_Fiducial",
1427 avgE, pi0Masslog, weight,
1428 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1429 100, 0.0, 10.0, 500, 0.05, 0.7);
1430 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1431 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_20_FiducialBoth",
1432 avgE, pi0Masslog, weight,
1433 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1434 100, 0.0, 10.0, 500, 0.05, 0.7);
1435 }
1436 }
1437 }
1438 if (bo_30p){
1439 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ring_%d", ring1),
1440 avgE, pi0Masslog, weight,
1441 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1442 100, 0.0, 10.0, 500, 0.05, 0.7);
1443 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ring_%d", ring2),
1444 avgE, pi0Masslog, weight,
1445 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1446 100, 0.0, 10.0, 500, 0.05, 0.7);
1447 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ringl_%d", ringl1),
1448 avgE, pi0Masslog, weight,
1449 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1450 100, 0.0, 10.0, 500, 0.05, 0.7);
1451 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0MassVsE_30_ringl_%d", ringl2),
1452 avgE, pi0Masslog, weight,
1453 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1454 100, 0.0, 10.0, 500, 0.05, 0.7);
1455 if (neutralParticleVector.size() == 2) {
1456 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ring_%d", ring1),
1457 avgE, pi0Masslog, weight,
1458 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1459 100, 0.0, 10.0, 500, 0.05, 0.7);
1460 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ring_%d", ring2),
1461 avgE, pi0Masslog, weight,
1462 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1463 100, 0.0, 10.0, 500, 0.05, 0.7);
1464 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ringl_%d", ringl1),
1465 avgE, pi0Masslog, weight,
1466 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1467 100, 0.0, 10.0, 500, 0.05, 0.7);
1468 Fill2DWeightedHistogram("FCAL_Pi0log","",Form("Pi0Mass2gVsE_30_ringl_%d", ringl2),
1469 avgE, pi0Masslog, weight,
1470 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1471 100, 0.0, 10.0, 500, 0.05, 0.7);
1472 }
1473 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_30",
1474 avgE, pi0Masslog, weight,
1475 "#pi^{0} Mass Vs. Average Shower Energy; Cluster Energy; #pi^{0} Mass",
1476 100, 0.0, 10.0, 500, 0.05, 0.7);
1477 if(radiusShowerlog2<108.4239 && radiusShowerlog2>20.785){
1478 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_30_Fiducial",
1479 avgE, pi0Masslog, weight,
1480 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1481 100, 0.0, 10.0, 500, 0.05, 0.7);
1482 if(radiusShowerlog1<108.4239 && radiusShowerlog1>20.785){
1483 Fill2DWeightedHistogram("FCAL_Pi0log","","Pi0MassVsE_30_FiducialBoth",
1484 avgE, pi0Masslog, weight,
1485 "#pi^{0} Mass Vs. Average Shower Energy; Avg. Cluster Energy; #pi^{0} Mass",
1486 100, 0.0, 10.0, 500, 0.05, 0.7);
1487 }
1488 }
1489 }
1490 }
1491 }
1492 }
1493 }
1494 }
1495
1496 return NOERROR;
1497}
1498
1499//------------------
1500// erun
1501//------------------
1502jerror_t JEventProcessor_FCAL_Pi0TOF::erun(void)
1503{
1504 // This is called whenever the run number changes, before it is
1505 // changed to give you a chance to clean up before processing
1506 // events from the next run number.
1507 return NOERROR;
1508}
1509
1510//------------------
1511// fini
1512//------------------
1513jerror_t JEventProcessor_FCAL_Pi0TOF::fini(void)
1514{
1515 // Called before program exit after event processing is finished.
1516 return NOERROR;
1517}
1518
1519
1520//--------------------------------------------
1521// Get TOF position from bar
1522//--------------------------------------------
1523double JEventProcessor_FCAL_Pi0TOF::bar2x(int bar) {
1524
1525 int ic = 2*bar - 45;
1526
1527 double pos;
1528 if( ic == 1 || ic == -1 ) pos = 3.0*(double)ic;
1529 else if( ic == 3 || ic == 5 ) pos = 1.5*(double)(ic+2);
1530 else if( ic == -3 || ic == -5 ) pos = 1.5*(double)(ic-2);
1531 else if( ic > 5 ) pos = 3.*(ic-2);
1532 else pos = 3.*(ic+2);
1533
1534 double x = 1.1*pos;
1535
1536 return x;
1537}
1538/*
1539int JEventProcessor_FCAL_Pi0TOF::TOF_Match(double kinVertexX, double kinVertexY, double kinVertexZ, double x, double y, double z) {
1540
1541 //----- Check for match between TOF and FCAL -----//
1542 int tof_match = 0;
1543 for (vector< const DTOFPoint* >::const_iterator tof_p = tof_points.begin(); tof_p != tof_points.end(); tof_p++ ) {
1544
1545 double xtof = (*tof_p)->pos.X() - kinVertexX;
1546 double ytof = (*tof_p)->pos.Y() - kinVertexY;
1547 double ztof = (*tof_p)->pos.Z() - kinVertexZ;
1548
1549 //double rtof = sqrt(xtof*xtof + ytof*ytof + ztof*ztof );
1550 //double ttof = (*tof_p)->t - (rtof/TMath::C());
1551
1552 xtof = xtof * (z / ztof);
1553 ytof = ytof * (z / ztof);
1554
1555 int hbar = (*tof_p)->dHorizontalBar;
1556 int hstat = (*tof_p)->dHorizontalBarStatus;
1557 int vbar = (*tof_p)->dVerticalBar;
1558 int vstat = (*tof_p)->dVerticalBarStatus;
1559
1560 double dx, dy;
1561 if( hstat==3 && vstat==3 ) {
1562 dx = x - xtof;
1563 dy = y - ytof;
1564 } else if( vstat==3 ) {
1565 dx = x - bar2x(vbar)*(z / ztof);
1566 dy = y - ytof;
1567 } else if( hstat==3 ) {
1568 dx = x - xtof;
1569 dy = y - bar2x(hbar)*(z / ztof);
1570 } else {
1571 dx = x - bar2x(vbar)*(z / ztof);
1572 dy = y - bar2x(hbar)*(z / ztof);
1573 }
1574
1575 if( fabs(dx) < 6. && fabs(dy) < 6. ) {
1576 //if( dt > -1. && dt < 3. ) tof_match = 1;
1577 tof_match = 1;
1578 }
1579 } // end DTOFPoint loop
1580
1581 return tof_match;
1582}
1583*/
1584
1585
1586