EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SmearWithTof.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SmearWithTof.cxx
1 //-----------------------
2 //Simple Detector: perfect resolution
3 //Acceptance from [-15,15] in eta
4 // Original author: Barak Schmookler
5 //-----------------------
6 
11 #include "eicsmear/smear/Smearer.h"
15 
16 
17 //Convert pseudorapidity (eta) to polar angle (theta) in radians.
18 //Make use of TLorentzVector to do eta-to-theta conversion.
19 static double etaToTheta(const double eta) {
20  TLorentzVector v;
21  v.SetPtEtaPhiM(1., eta, 0., 0.);
22  return v.Theta();
23 }
24 
25 //Build Detector
27 
28  //Create Devices
29  Smear::Device energy(Smear::kE,"0"); //"0":Perfect Resolution
33 
34  //Detector Acceptance
35  Smear::Acceptance::Zone acceptall(etaToTheta(15.),etaToTheta(-15.));
36 
37  energy.Accept.AddZone(acceptall);
38  momentum.Accept.AddZone(acceptall);
39  theta.Accept.AddZone(acceptall);
40  phi.Accept.AddZone(acceptall);
41 
42  Smear::TofBarrelSmearer tofBarrel(100, -1.0, 1.0, 10);
43  tofBarrel.Accept.AddZone( acceptall ); // cuts are done by the detector!
44  tofBarrel.Accept.SetCharge(Smear::kCharged);
45 
46  // //PID performance is unparameterised as of now
47  // Smear::PerfectID pid;
48  // pid.Accept.AddZone(acceptall);
49 
50  //Create the detector and add devices
51  Smear::Detector det;
52  det.AddDevice(energy);
53  det.AddDevice(momentum);
54  det.AddDevice(theta);
55  det.AddDevice(phi);
56  det.AddDevice(tofBarrel);
57  // det.AddDevice(pid);
58  det.SetEventKinematicsCalculator("NM JB DA");
59 
60  return det;
61 
62 }