Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEventProcessor_bcalfcaltof_res_tree.cc
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DEventProcessor_bcalfcaltof_res_tree.cc
4 // Created: Thu Aug 25 11:38:03 EDT 2011
5 // Creator: pmatt (on Darwin swire-b241.jlab.org 8.4.0 powerpc)
6 //
7 
9 
10 // The executable should define the ROOTfile global variable. It will
11 // be automatically linked when dlopen is called.
12 extern TFile *ROOTfile;
13 
14 // Routine used to create our DEventProcessor
15 extern "C"{
16 void InitPlugin(JApplication *app){
17  InitJANAPlugin(app);
18  app->AddProcessor(new DEventProcessor_bcalfcaltof_res_tree());
19 }
20 } // "C"
21 
22 
23 //------------------
24 // init
25 //------------------
27 {
28 
29  dBCALStudyFlag = true;
30  dFCALStudyFlag = true;
31  dTOFStudyFlag = true;
32 
34  dPluginTree_BCALMCComparison = new TTree("dPluginTree_BCALMCComparison", "BCAL MC Comparison");
35  dPluginTree_BCALMCComparison->Branch("dPluginBranch_BCALMCComparison", "BCALMCComparison", &dBCALMCComparison);
36 
38  dPluginTree_FCALMCComparison = new TTree("dPluginTree_FCALMCComparison", "FCAL MC Comparison");
39  dPluginTree_FCALMCComparison->Branch("dPluginBranch_FCALMCComparison", "FCALMCComparison", &dFCALMCComparison);
40 
42  dPluginTree_TOFMCComparison = new TTree("dPluginTree_TOFMCComparison", "TOF MC Comparison");
43  dPluginTree_TOFMCComparison->Branch("dPluginBranch_TOFMCComparison", "TOFMCComparison", &dTOFMCComparison);
44 
45  return NOERROR;
46 }
47 
48 //------------------
49 // brun
50 //------------------
51 jerror_t DEventProcessor_bcalfcaltof_res_tree::brun(JEventLoop *eventLoop, int32_t runnumber)
52 {
53  DApplication* locApplication = dynamic_cast<DApplication*>(eventLoop->GetJApplication());
54  if(!locApplication){
55  _DBG_<<"Cannot get DApplication from JEventLoop! (are you using a JApplication based program?)"<<endl;
56  return RESOURCE_UNAVAILABLE;
57  }
58  dRootGeom = locApplication->GetRootGeom();
59 
60 
61  // Get pointer to TrackFitter object that actually fits a track
62  vector<const DTrackFitter *> locTrackFitters;
63  eventLoop->Get(locTrackFitters);
64  if(locTrackFitters.size()<1){
65  _DBG_<<"Unable to get a DTrackFitter object! NO Charged track fitting will be done!"<<endl;
66  return RESOURCE_UNAVAILABLE;
67  }
68 
69  dTrackFitter = const_cast<DTrackFitter*>(locTrackFitters[0]);
70  // Warn user if something happened that caused us NOT to get a fitter object pointer
71  if(!dTrackFitter){
72  _DBG_<<"Unable to get a DTrackFitter object! NO Charged track fitting will be done!"<<endl;
73  return RESOURCE_UNAVAILABLE;
74  }
75 
76 
77  double rho_Z_over_A_LnI, radlen;
78  dRootGeom->FindMat("Scintillator",dRhoZoverA,rho_Z_over_A_LnI, radlen); //defined both in hddsroot.C and hdgeant.C in the programs/Analysis/hdEventViewer/ folder
79  dKRhoZoverA = 0.1535*dRhoZoverA/1000.0;
80  dLnI = rho_Z_over_A_LnI/dRhoZoverA;
81 
82  return NOERROR;
83 }
84 
85 //------------------
86 // evnt
87 //------------------
88 jerror_t DEventProcessor_bcalfcaltof_res_tree::evnt(JEventLoop *loop, uint64_t eventnumber)
89 {
90  unsigned int loc_i, loc_j;
91  DVector3 locLabHitPosition, locLabHitPosition_Truth, locGeneratedVertex;
92 // locGeneratedVertex.SetXYZ(0.0, 0.0, 65.0); //should be grabbed (whatev)
93  vector<const DMCThrown*> locDMCThrownVector;
94  const DMCThrown *locDMCThrown;
95  loop->Get(locDMCThrownVector);
96 
97  if(dBCALStudyFlag == true){
98 
99  vector<const DBCALShower*> locBCALShowerVector;
100  const DBCALShower *locBCALShower;
101  float locDeltaR, locDeltaZ, locDeltaPhi, locDeltaE, locDeltaT;
102  float locTrueR, locTrueZ, locTruePhi, locTrueE, locTrueT;
103  float locTrueTheta, locPathLength, locPathLengthCorrection, locSurfaceR, locVelocity;
104  float locActualPathLength, locActualTheta, locActualPathLengthCorrection;
105  DVector3 locActualPathVector;
106 
107  loop->Get(locBCALShowerVector, "KLOE");
108 
109 //can't use truth hits!:
110  //project along track path until a designated distance.
111  //the designated distance needs to be such that the MEAN delta-z & delta-r are zero
112  //designated distance = dist to intersection with bcal + PathLength_correction, where PathLength_correction = f(theta to beamline (except at edges of chamber!), E) (thrown)
113 
114  //if more than 1 bcal hit, clustering didn't work, skip event!!
115  if(locBCALShowerVector.size() > 1)
116  return NOERROR;
117 
118  for(loc_i = 0; loc_i < locBCALShowerVector.size(); loc_i++){
119  locBCALShower = locBCALShowerVector[loc_i];
120  locLabHitPosition.SetXYZ(locBCALShower->x, locBCALShower->y, locBCALShower->z);
121 
122  locSurfaceR = 64.3; //from DBCALGeometry.cc
123 
124  // match to generated photon to get energy
125  for(loc_j = 0; loc_j < locDMCThrownVector.size(); loc_j++){ //assumes generated at center of target (at least in xy)
126  locDMCThrown = locDMCThrownVector[loc_j];
127  if(locDMCThrown->type != int(Gamma))
128  continue;
129  locTrueE = locDMCThrown->energy();
130  locGeneratedVertex = locDMCThrown->position();
131  //project hit on bcal surface
132  locPathLengthCorrection = Calc_BCALPathLengthCorrection(locTrueE);
133 // locPathLengthCorrection = 0.0;
134 
135  locTrueTheta = locDMCThrown->momentum().Theta();
136  locPathLength = locSurfaceR/sin(locTrueTheta) + locPathLengthCorrection;
137  locTrueZ = locGeneratedVertex.Z() + locPathLength*cos(locTrueTheta);
138  locPathLengthCorrection += Calc_BCALPathLengthCorrectionZPostE(locTrueZ); //must be e-corrected z!
139  locPathLength = locSurfaceR/sin(locTrueTheta) + locPathLengthCorrection;
140  locTrueZ = locGeneratedVertex.Z() + locPathLength*cos(locTrueTheta);
141 
142  locTrueR = locPathLength*sin(locTrueTheta);
143  locVelocity = 29.9792458;
144  locTrueT = 0.0 + locPathLength/locVelocity;
145  locTruePhi = locDMCThrown->momentum().Phi();
146 
147  break; //just in case!
148  }
149 
150  //hist to find PathLength correction!
151  locActualPathVector = locLabHitPosition - locGeneratedVertex;
152  locActualPathLength = locActualPathVector.Mag();
153  locActualTheta = locActualPathVector.Theta();
154  locActualPathLengthCorrection = locActualPathLength - locSurfaceR/sin(locTrueTheta);
155 
156  //differences
157  locDeltaR = locLabHitPosition.Perp() - locTrueR;
158  locDeltaPhi = locLabHitPosition.Phi() - locTruePhi;
159  locDeltaZ = locLabHitPosition.Z() - locTrueZ;
160  locDeltaE = locBCALShower->E - locTrueE;
161  locDeltaT = locBCALShower->t - locTrueT;
162 
163  // Although we are only filling objects local to this plugin, TTree::Fill() periodically writes to file: Global ROOT lock
164  japp->RootWriteLock(); //ACQUIRE ROOT LOCK
165 
166  dBCALMCComparison->dTrueR = locTrueR;
167  dBCALMCComparison->dTruePhi = locTruePhi;
168  dBCALMCComparison->dTrueZ = locTrueZ;
169  dBCALMCComparison->dTrueE = locTrueE;
170  dBCALMCComparison->dTrueT = locTrueT;
171  dBCALMCComparison->dDeltaR = locDeltaR;
172  dBCALMCComparison->dDeltaPhi = locDeltaPhi;
173  dBCALMCComparison->dDeltaZ = locDeltaZ;
174  dBCALMCComparison->dDeltaE = locDeltaE;
175  dBCALMCComparison->dDeltaT = locDeltaT;
176  dBCALMCComparison->dPathLengthCorrection = locActualPathLengthCorrection;
177 
178  dBCALMCComparison->dShowerUncertaintyX = locBCALShower->xErr();
179  dBCALMCComparison->dShowerUncertaintyY = locBCALShower->yErr();
180  dBCALMCComparison->dShowerUncertaintyZ = locBCALShower->zErr();
181  dBCALMCComparison->dShowerUncertaintyE = locBCALShower->EErr();
182  dBCALMCComparison->dShowerUncertaintyT = locBCALShower->tErr();
183 
185 
186  japp->RootUnLock(); //RELEASE ROOT LOCK
187  } //end DBCALShower loop
188 
189  } //end BCAL
190 
191 
192  if(dFCALStudyFlag == true){ //energy comparison only works if one generated photon!!!
193 
194  vector<const DFCALShower*> locFCALShowerVector;
195  const DFCALShower *locFCALShower;
196  float locDeltaX, locDeltaY, locDeltaZ, locDeltaE, locDeltaT;
197  float locTrueX, locTrueY, locTrueZ, locTrueE, locTrueT;
198  float locPathLength, locPathLengthCorrection, locTrueTheta, locTruePhi, locVelocity;
199  float locActualPathLength, locActualTheta, locActualPathLengthCorrection;
200  DVector3 locActualPathVector, locShowerHitPositionUncertainty;
201 
202  loop->Get(locFCALShowerVector);
203  float locSurfaceZ = 625.0; //560 from target center, + 65 target center
204 
205  //if more than 1 fcal hit, clustering didn't work, skip event!!
206  if(locFCALShowerVector.size() > 1)
207  return NOERROR;
208 
209  for(loc_i = 0; loc_i < locFCALShowerVector.size(); loc_i++){
210  locFCALShower = locFCALShowerVector[loc_i];
211  locLabHitPosition = locFCALShower->getPosition();
212 
213  // match to generated photon to get energy
214  for(loc_j = 0; loc_j < locDMCThrownVector.size(); loc_j++){
215  locDMCThrown = locDMCThrownVector[loc_j];
216  if(locDMCThrown->type != int(Gamma))
217  continue;
218  locTrueE = locDMCThrown->energy();
219  locTrueTheta = locDMCThrown->momentum().Theta();
220  locGeneratedVertex = locDMCThrown->position();
221  locVelocity = 29.9792458;
222  locTruePhi = locDMCThrown->momentum().Phi();
223  locPathLengthCorrection = Calc_FCALPathLengthCorrection(locTrueE);
224 // locPathLengthCorrection = 0.0;
225  locPathLength = (locSurfaceZ - locGeneratedVertex.Z())/cos(locTrueTheta) + locPathLengthCorrection;
226  locTrueX = locGeneratedVertex.X() + locPathLength*sin(locTrueTheta)*cos(locTruePhi);
227  locTrueY = locGeneratedVertex.Y() + locPathLength*sin(locTrueTheta)*sin(locTruePhi);
228  locTrueZ = locGeneratedVertex.Z() + locPathLength*cos(locTrueTheta);
229  locTrueT = 0.0 + locPathLength/locVelocity; //worst for low energy & z
230  break; //just in case!
231  }
232 
233  //hist to find PathLength correction!
234  locActualPathVector = locLabHitPosition - locGeneratedVertex;
235  locActualPathLength = locActualPathVector.Mag();
236  locActualTheta = locActualPathVector.Theta();
237  locActualPathLengthCorrection = locActualPathLength - (locSurfaceZ - locGeneratedVertex.Z())/cos(locTrueTheta);
238 
239  //differences
240  locDeltaX = locLabHitPosition.X() - locTrueX;
241  locDeltaY = locLabHitPosition.Y() - locTrueY;
242  locDeltaZ = locLabHitPosition.Z() - locTrueZ;
243  locDeltaE = locFCALShower->getEnergy() - locTrueE;
244  locDeltaT = locFCALShower->getTime() - locTrueT;
245 
246  // Although we are only filling objects local to this plugin, TTree::Fill() periodically writes to file: Global ROOT lock
247  japp->RootWriteLock(); //ACQUIRE ROOT LOCK
248 
249  dFCALMCComparison->dTrueX = locTrueX;
250  dFCALMCComparison->dTrueY = locTrueY;
251  dFCALMCComparison->dTrueZ = locTrueZ;
252  dFCALMCComparison->dTrueE = locTrueE;
253  dFCALMCComparison->dTrueT = locTrueT;
254  dFCALMCComparison->dDeltaX = locDeltaX;
255  dFCALMCComparison->dDeltaY = locDeltaY;
256  dFCALMCComparison->dDeltaZ = locDeltaZ;
257  dFCALMCComparison->dDeltaE = locDeltaE;
258  dFCALMCComparison->dDeltaT = locDeltaT;
259  dFCALMCComparison->dPathLengthCorrection = locActualPathLengthCorrection;
260 
261  locShowerHitPositionUncertainty = locFCALShower->getPositionError();
262  dFCALMCComparison->dShowerUncertaintyX = locShowerHitPositionUncertainty.X();
263  dFCALMCComparison->dShowerUncertaintyY = locShowerHitPositionUncertainty.Y();
264  dFCALMCComparison->dShowerUncertaintyZ = locShowerHitPositionUncertainty.Z();
265  dFCALMCComparison->dShowerUncertaintyE = (locFCALShower->getEnergy() >= 0.0) ? 0.042*sqrt(locFCALShower->getEnergy()) + 0.0001 : 1e-3; //from old DPhoton_factory::makeFCalPhoton() function
267 
269 
270  japp->RootUnLock(); //RELEASE ROOT LOCK
271  } //end DFCALShower loop
272 
273  } //end FCAL
274 
275 
276  if(dTOFStudyFlag == true){
277  //v is forward-most TOF plane: vertical
278 
279  vector<const DTOFPoint*> locTOFPointVector;
280  vector<const DTOFTruth*> locTOFTruthVector;
281  vector<const DTOFHit*> locTOFHitVector;
282 
283  const DTOFPoint *locTOFPoint;
284  const DTOFTruth *locTOFTruth;
285  const DTOFHit *locTOFHit;
286  float locDeltaX, locDeltaY, locDeltaZ, locDeltadE, locDeltaT;
287  float locTheta, locPhi, locVelocity, locDeltaPathLength, locBeta;
288  float locTrueX, locTrueY, locTrueZ, locTrueT, locTruedE, locTrueBetaGamma;
289  int locParticleType;
290  DVector3 locTrueMomentum;
291  bool locVerticalPlaneFlag, locHorizontalPlaneFlag;
292 
293  loop->Get(locTOFPointVector);
294  loop->Get(locTOFTruthVector);
295 
296  if((locTOFTruthVector.size() == 1) && (locTOFPointVector.size() == 1)){
297  locTOFTruth = locTOFTruthVector[0];
298  locLabHitPosition_Truth.SetXYZ(locTOFTruth->x, locTOFTruth->y, locTOFTruth->z);
299 
300  locTOFPoint = locTOFPointVector[0];
301  locLabHitPosition = locTOFPoint->pos;
302  locDeltaZ = locLabHitPosition.Z() - locTOFTruth->z;
303  locTrueMomentum.SetXYZ(locTOFTruth->px, locTOFTruth->py, locTOFTruth->pz);
304  locBeta = locTrueMomentum.Mag()/locTOFTruth->E;
305  locTrueBetaGamma = locBeta/sqrt(1.0 - locBeta*locBeta);
306  locDeltaPathLength = locDeltaZ/cos(locTheta);
307  locTheta = locTrueMomentum.Theta();
308  locPhi = locTrueMomentum.Phi();
309 
310  locTrueX = locTOFTruth->x + locDeltaPathLength*sin(locTheta)*cos(locPhi);
311  locTrueY = locTOFTruth->y + locDeltaPathLength*sin(locTheta)*sin(locPhi);
312  locTrueZ = locLabHitPosition.Z();
313  locVelocity = 29.9792458*locTrueMomentum.Mag()/locTOFTruth->E;
314  locTrueT = locTOFTruth->t + locDeltaPathLength/locVelocity; //v = x/t, t= x/v
315  locParticleType = locTOFTruth->ptype;
316 
317  //differences
318  locDeltaX = locLabHitPosition.X() - locTrueX;
319  locDeltaY = locLabHitPosition.Y() - locTrueY;
320  locDeltaZ = locLabHitPosition.Z() - locTrueZ;
321 
322 
323  locTruedE = Calc_MostProbableTOFdE(locTrueMomentum, ParticleMass(Particle_t(locParticleType)));
324 //cout << "recon de, truth de = " << locTOFPoint->dE << ", " << locTruedE << endl;
325  locDeltadE = locTOFPoint->dE - locTruedE; //locTOFPoint->dedx is actually dE!!!: rename it!!
326  locDeltaT = locTOFPoint->t - locTrueT;
327 
328  //hit-based info
329  locTOFPoint->GetT(locTOFHitVector);
330  locVerticalPlaneFlag = false;
331  locHorizontalPlaneFlag = false;
332  for(loc_i = 0; loc_i < locTOFHitVector.size(); loc_i++){
333  locTOFHit = locTOFHitVector[loc_i];
334  if(!((locTOFHit->meantime >= 0.0) || (locTOFHit->meantime <= 0.0)))
335  continue;
336  if(locTOFHit->orientation)
337  locHorizontalPlaneFlag = true;
338  else{locVerticalPlaneFlag = true;}
339  }
340 
341  // Although we are only filling objects local to this plugin, TTree::Fill() periodically writes to file: Global ROOT lock
342  japp->RootWriteLock(); //ACQUIRE ROOT LOCK
343 
344  dTOFMCComparison->dTrueX = locTrueX;
345  dTOFMCComparison->dTrueY = locTrueY;
346  dTOFMCComparison->dTrueZ = locTrueZ;
347  dTOFMCComparison->dTruedE = locTruedE;
348  dTOFMCComparison->dTrueT = locTrueT;
349  dTOFMCComparison->dDeltaX = locDeltaX;
350  dTOFMCComparison->dDeltaY = locDeltaY;
351  dTOFMCComparison->dDeltaZ = locDeltaZ;
352  dTOFMCComparison->dDeltadE = locDeltadE;
353  dTOFMCComparison->dDeltaT = locDeltaT;
354  dTOFMCComparison->dVerticalPlaneFlag = locVerticalPlaneFlag;
355  dTOFMCComparison->dHorizontalPlaneFlag = locHorizontalPlaneFlag;
356  dTOFMCComparison->dTrueBetaGamma = locTrueBetaGamma;
358 
359  japp->RootUnLock(); //RELEASE ROOT LOCK
360  } //end DTOFPoint loop
361 
362  } //end TOF
363 
364  return NOERROR;
365 }
366 
367 //------------------
368 // erun
369 //------------------
371 {
372  // Any final calculations on histograms (like dividing them)
373  // should be done here. This may get called more than once.
374  return NOERROR;
375 }
376 
377 //------------------
378 // fini
379 //------------------
381 {
382  return NOERROR;
383 }
384 
385 void DEventProcessor_bcalfcaltof_res_tree::Convert_Coordinates_BCALToLab(float locBCALR, float locBCALPhi, float locBCALZ, DVector3& locLabVertex){
386  //check to make sure phi is in radians and not degrees!!
387  locLabVertex.SetXYZ(locBCALR*cos(locBCALPhi), locBCALR*sin(locBCALPhi), locBCALZ);
388 }
389 
390 void DEventProcessor_bcalfcaltof_res_tree::Convert_Coordinates_LabToBCAL(const DVector3& locLabVertex, float& locBCALR, float& locBCALPhi, float& locBCALZ){
391  //check to make sure phi is in radians and not degrees!!
392  locBCALR = locLabVertex.Perp();
393  locBCALPhi = locLabVertex.Phi();
394  locBCALZ = locLabVertex.Z();
395 }
396 
398  float locPaddleThickness = 2.54; //get from database!
399  double locPathLength = locPaddleThickness/cos(locMomentum.Theta());
400 //dtofpoint e is averaged to a single plane, so just find the angle & use 2.54 for the thickness
401  double locdE, locdEdx;
402  Calc_MostProbableTOFdEdx(locMomentum.Mag(), mass, locPathLength, locdE, locdEdx);
403 //cout << "mean dedx, p, mass, path = " << locMeanTOFdEdx << ", " << locMomentum.Mag() << ", " << mass << ", " << locPathLength << endl;
404  return locdE;
405 }
406 
407 void DEventProcessor_bcalfcaltof_res_tree::Calc_MostProbableTOFdEdx(double p, double mass, double dx, double &dE, double &dEdx){
408 
409  double betagamma=p/mass;
410  double beta2=1./(1.+1./betagamma/betagamma);
411  if (beta2<1e-6) beta2=1e-6;
412 
413  // Electron mass
414  double Me=0.000511; //GeV
415 
416  // First (non-logarithmic) term in Bethe-Bloch formula
417  double locdETerm = dKRhoZoverA*dx/beta2; //divide by 2???
418 
419  //density factor
420  double locX0 = 0.1464;
421  double locX1 = 2.4855;
422  double locC = -3.1997;
423  double locA = 0.16101;
424  double locM = 3.2393;
425  double locX = log10(betagamma);
426  double locDelta; //density factor!
427  if(locX < locX0)
428  locDelta = 0.0;
429  else if(locX < locX1)
430  locDelta = 4.6052*locX + locC + locA*pow(locX1 - locX, locM);
431  else
432  locDelta = 4.6052*locX + locC;
433 
434 // double locDeltaNew = dTrackFitter->CalcDensityEffect(betagamma, dRhoZoverA, dLnI);
435 // locDelta = locDeltaNew;
436 // cout << "delta, deltanew, diff = " << locDelta << ", " << locDeltaNew << ", " << (locDelta - locDeltaNew) << endl;
437 
438  // Most probable energy loss from Landau theory (see Leo, pp. 51-52)
439  //more appropriately, from RPP 2011, section 27.2.7
440  dE = locdETerm*(log(locdETerm) - log((1.-beta2)/2./Me/beta2) - 2.*dLnI - beta2 + 0.200 - locDelta); //1000.0 converts MeV to GeV
441  dEdx = dE/dx;
442 
443 /*
444 TGeoMixture *mat25= new TGeoMixture("Scintillator",2,1.032); //2 elements, density = 1.032
445 mat25->SetUniqueID(25);
446 mat25->DefineElement(0,12.011,6,0.913734); //element index, A, Z, weight fraction
447 mat25->DefineElement(1,1.00797,1,0.0862662); //element index, A, Z, weight fraction
448 */
449 }
450 
452  if(locEnergy >= 1.0){
453  TF1 locFunction("df_BCAL_DepthCorrection", "[0] + [1]*x + [2]*exp([3]*x)", 0.0, 9.0);
454  locFunction.SetParameters(9.95659, 0.142382, -2.9869, -0.56881);
455  return locFunction.Eval(locEnergy);
456  }
457  TF1 locFunction("df_BCAL_DepthCorrection_LowE", "[0] + [1]*x + [2]*x*x", 0.0, 1.0);
458  locFunction.SetParameters(4.89141, 5.98362, -2.56308);
459  return locFunction.Eval(locEnergy);
460 }
461 
463  if(locZ < 22.5){
464  TF1 locFunction("df_BCAL_DepthCorrection_LowZ", "[0] + [1]*x + [2]*x*x", 0.0, 1.0);
465  locFunction.SetParameters(-31.4058, 2.40814, -0.0453179);
466  return locFunction.Eval(locZ);
467  }else if(locZ > 389.0){
468  TF1 locFunction("df_BCAL_DepthCorrection_HighZ", "[0] + [1]*x + [2]*x*x", 0.0, 1.0);
469  locFunction.SetParameters(-1994.66, 10.2362, -0.0131332);
470  return locFunction.Eval(locZ);
471  }
472  return 0.0;
473 }
474 
476  if(locEnergy >= 1.0){
477  TF1 locFunction("df_FCAL_DepthCorrection_HighE", "[0] + [1]*x + [2]*exp([3]*x)", 1.0, 9.0);
478  locFunction.SetParameters(17.1957, 0.383558, -6.9412, -0.598059);
479  return locFunction.Eval(locEnergy);
480  }
481  TF1 locFunction("df_FCAL_DepthCorrection_LowE", "[0] + [1]*x + [2]*x*x", 0.0, 1.0);
482  locFunction.SetParameters(6.83752, 12.0934, -5.24968);
483  return locFunction.Eval(locEnergy);
484 }
485 
void Convert_Coordinates_LabToBCAL(const DVector3 &locLabVertex, float &locBCALR, float &locBCALPhi, float &locBCALZ)
TFile * ROOTfile
double getEnergy() const
Definition: DFCALShower.h:156
struct VolMat FindMat(double *x)
Definition: DRootGeom.cc:518
float const EErr() const
Definition: DBCALShower.h:36
float z
Definition: DTOFTruth.h:23
float dE
Definition: DTOFPoint.h:35
The DTrackFitter class is a base class for different charged track fitting algorithms. It does not actually fit the track itself, but provides the interface and some common support features most algorthims will need to implement.
Definition: DTrackFitter.h:61
float x
Definition: DTOFTruth.h:23
TVector3 DVector3
Definition: DVector3.h:14
double energy(void) const
jerror_t erun(void)
Called everytime run number changes, provided brun has been called.
double getTime() const
Definition: DFCALShower.h:161
float E
Definition: DTOFTruth.h:26
const DVector3 & position(void) const
float const tErr() const
Definition: DBCALShower.h:40
float const xErr() const
Definition: DBCALShower.h:37
jerror_t brun(JEventLoop *eventLoop, int32_t runnumber)
Called everytime a new run number is detected.
void Convert_Coordinates_BCALToLab(float locBCALR, float locBCALPhi, float locBCALZ, DVector3 &locLabVertex)
float y
Definition: DTOFTruth.h:23
JApplication * japp
jerror_t evnt(JEventLoop *eventLoop, uint64_t eventnumber)
Called every event.
DRootGeom * GetRootGeom(unsigned int run_number)
TEllipse * e
DVector3 pos
Definition: DTOFPoint.h:33
void Calc_MostProbableTOFdEdx(double p, double mass, double dx, double &dE, double &dEdx)
InitPlugin_t InitPlugin
jerror_t fini(void)
Called after last event of last event source has been processed.
float px
Definition: DTOFTruth.h:24
#define _DBG_
Definition: HDEVIO.h:12
float py
Definition: DTOFTruth.h:24
float const zErr() const
Definition: DBCALShower.h:39
double Calc_MostProbableTOFdE(const DVector3 &locMomentum, double mass)
jerror_t init(void)
Called once at program start.
static double ParticleMass(Particle_t p)
double sqrt(double)
double sin(double)
float pz
Definition: DTOFTruth.h:24
float t
Definition: DTOFTruth.h:25
const DVector3 & momentum(void) const
DVector3 getPositionError() const
File: DTOFHit.h Created: Tue Jan 18 16:15:26 EST 2011 Creator: B. Zihlmann Purpose: Container class t...
Definition: DTOFHit.h:16
float t
Definition: DTOFPoint.h:34
float const yErr() const
Definition: DBCALShower.h:38
int type
GEANT particle ID.
Definition: DMCThrown.h:20
DVector3 getPosition() const
Definition: DFCALShower.h:151
int ptype
Definition: DTOFTruth.h:27
Particle_t
Definition: particleType.h:12