EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SmearPerfectDetector.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SmearPerfectDetector.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"
14 
15 
16 //Convert pseudorapidity (eta) to polar angle (theta) in radians.
17 //Make use of TLorentzVector to do eta-to-theta conversion.
18 static double etaToTheta(const double eta) {
19  TLorentzVector v;
20  v.SetPtEtaPhiM(1., eta, 0., 0.);
21  return v.Theta();
22 }
23 
24 //Build Detector
26 
27  //Create Devices
28  Smear::Device energy(Smear::kE,"0"); //"0":Perfect Resolution
32 
33  //Detector Acceptance
34  Smear::Acceptance::Zone acceptall(etaToTheta(15.),etaToTheta(-15.));
35 
36  energy.Accept.AddZone(acceptall);
37  momentum.Accept.AddZone(acceptall);
38  theta.Accept.AddZone(acceptall);
39  phi.Accept.AddZone(acceptall);
40 
41  //PID performance is unparameterised as of now
43  pid.Accept.AddZone(acceptall);
44 
45  //Create the detector and add devices
46  Smear::Detector det;
47  det.AddDevice(energy);
48  det.AddDevice(momentum);
49  det.AddDevice(theta);
50  det.AddDevice(phi);
51  det.AddDevice(pid);
52  det.SetEventKinematicsCalculator("NM JB DA");
53 
54  return det;
55 
56 }