Bug Summary

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