Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
eic_sphenix.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file eic_sphenix.C
1 
11 float eta2theta( double eta )
12 {
13  float theta = 2.0 * atan( exp( -1 * eta ) );
14  return theta;
15 }
16 
19 Smear::Detector BuildEicSphenix() {
20 
21  gSystem->Load("libeicsmear");
22 
23  /* CALORIMETER
24  *
25  * Calorimeter resolution usually given as sigma_E/E = const% + stocastic%/Sqrt{E}
26  * EIC Smear needs absolute sigma: sigma_E = Sqrt{const*const*E*E + stoc*stoc*E}
27  *
28  * Genre == 1 (third argument) means only photons and electrons are smeared
29  *
30  * Accept.Charge( kAll ) seems not to be working properly
31  */
32 
33  /* Create "electron-going" (backward) electromagnetic calorimeter (PbWO4)*/
34  Smear::Acceptance::Zone zone_eemc( eta2theta( -1.55 ), eta2theta( -4.00 ) );
35 
36  Smear::Device eemcE(Smear::kE, "sqrt(0.01*0.01*E*E + 0.025*0.025*E)");
37  eemcE.Accept.SetGenre(Smear::kElectromagnetic);
38  eemcE.Accept.AddZone(zone_eemc);
39 
40  /* Create "central rapidity" electromagnetic calorimeter (W-SciFi) */
41  Smear::Acceptance::Zone zone_cemc( eta2theta( 1.24 ), eta2theta( -1.55 ) );
42 
43  Smear::Device cemcE(Smear::kE, "sqrt(0.05*0.05*E*E + 0.16*0.16*E)");
44  cemcE.Accept.SetGenre(Smear::kElectromagnetic);
45  cemcE.Accept.AddZone(zone_cemc);
46 
47  /* Create "hadron-going" (forward) electromagnetic calorimeter (PbScint) */
48  Smear::Acceptance::Zone zone_femc( eta2theta( 4.00 ), eta2theta( 1.24 ) );
49 
50  Smear::Device femcE(Smear::kE, "sqrt(0.02*0.02*E*E + 0.08*0.08*E)");
51  femcE.Accept.SetGenre(Smear::kElectromagnetic);
52  femcE.Accept.AddZone(zone_femc);
53 
54  /* Create "central rapidity" hadron calorimeter (inner+outer) (Fe Scint + Steel Scint) */
55  Smear::Acceptance::Zone zone_chcal( eta2theta( 1.10 ), eta2theta( -1.10 ) );
56 
57  Smear::Device chcalE(Smear::kE, "sqrt(0.12*0.12*E*E + 0.81*0.81*E)");
58  chcalE.Accept.SetGenre(Smear::kHadronic);
59  chcalE.Accept.AddZone(zone_chcal);
60 
61  /* Create "hadron-going" (forward) hadron calorimeter (Fe Scint) */
62  Smear::Acceptance::Zone zone_fhcal( eta2theta( 4.00 ), eta2theta( 1.24 ) );
63 
64  Smear::Device fhcalE(Smear::kE, "sqrt(0.0*0.0*E*E + 0.70*0.70*E)");
65  fhcalE.Accept.SetGenre(Smear::kHadronic);
66  fhcalE.Accept.AddZone(zone_fhcal);
67 
68  /* TRACKING SYSTEM */
69  /* Create our tracking capabilities, by a combination of mometum, theta and phi Devices.
70  * The momentum parametrization (a*p + b) gives sigma_P/P in percent.
71  * So Multiply through by P and divide by 100 to get absolute sigma_P
72  * Theta and Phi parametrizations give absolute sigma in miliradians
73  *
74  * Note: eic-smear only saves smeared parameters for 'smeared' particle, i.e. if you want to
75  * save e.g. the 'true' energy for particles measured with the tracker, you need to smear the
76  * energy with '0' smearing for those particles.
77  */
78 
79  /* Create tracking system. */
80  Smear::Acceptance::Zone zone_tracking( eta2theta( 4 ), eta2theta( -4.00 ) );
81 
82  /* Try parametrization based on sPHENIX Geant4 simulation. The fit to the simulations only covers pseudorapidity -2.5 to + 2.5, so be extra careful with the parametrization outside that range. */
83  Smear::Device trackingMomentum(Smear::kP, "P * sqrt( (7.82e-3 + 4.39e-4*(-log(tan(theta/2.0)))**2 + 7.55e-4*(-log(tan(theta/2.0)))**4)**2 + ( (1.44e-3 + -5.35e-4*(-log(tan(theta/2.0)))**2 + -6.73e-5*(-log(tan(theta/2.0)))**3 + 1.37e-4*(-log(tan(theta/2.0)))**4) * P )**2 )");
84  trackingMomentum.Accept.SetGenre(Smear::kAll);
85  trackingMomentum.Accept.SetCharge(Smear::kCharged);
86  trackingMomentum.Accept.AddZone(zone_tracking);
87 
88  Smear::Device trackingTheta(Smear::kTheta, "0");
89  trackingTheta.Accept.SetGenre(Smear::kAll);
90  trackingTheta.Accept.SetCharge(Smear::kCharged);
91  trackingTheta.Accept.AddZone(zone_tracking);
92 
93  Smear::Device trackingPhi(Smear::kPhi, "0");
94  trackingPhi.Accept.SetGenre(Smear::kAll);
95  trackingPhi.Accept.SetCharge(Smear::kCharged);
96  trackingPhi.Accept.AddZone(zone_tracking);
97 
98  /* @TODO Below numbers are for tracking with BeAST. We need to get the parametrization for EIC-sPHENIX!!! */
99  // Smear::Device trackingMomentum(Smear::kP, "(P*P*(0.0182031 + 0.00921047*pow((-log(tan(theta/2.0))), 2) - 0.00291243*pow((-log(tan(theta/2.0))), 4) + 0.000264353*pow((-log(tan(theta/2.0))), 6)) + P*(0.209681 + 0.275144*pow((-log(tan(theta/2.0))), 2) - 0.0436536*pow((-log(tan(theta/2.0))), 4) + 0.00367412*pow((-log(tan(theta/2.0))), 6)))*0.01");
100  // trackingMomentum.Accept.SetCharge(Smear::kCharged);
101  // trackingMomentum.Accept.AddZone(zone_tracking);
102 
103  // Smear::Device trackingTheta(Smear::kTheta, "((1.0/(1.0*P))*(0.752935 + 0.280370*pow((-log(tan(theta/2.0))), 2) - 0.0359713*pow((-log(tan(theta/2.0))), 4) + 0.00200623*pow((-log(tan(theta/2.0))), 6)) + 0.0282315 - 0.00998623*pow((-log(tan(theta/2.0))), 2) + 0.00117487*pow((-log(tan(theta/2.0))), 4) - 0.0000443918*pow((-log(tan(theta/2.0))), 6))*0.001");
104  // trackingTheta.Accept.SetCharge(Smear::kCharged);
105  // trackingTheta.Accept.AddZone(zone_tracking);
106 
107  // Smear::Device trackingPhi(Smear::kPhi, "((1.0/(1.0*P))*(0.743977 + 0.753393*pow((-log(tan(theta/2.0))), 2) + 0.0634184*pow((-log(tan(theta/2.0))), 4) + 0.0128001*pow((-log(tan(theta/2.0))), 6)) + 0.0308753 + 0.0480770*pow((-log(tan(theta/2.0))), 2) - 0.0129859*pow((-log(tan(theta/2.0))), 4) + 0.00109374*pow((-log(tan(theta/2.0))), 6))*0.001");
108  // trackingPhi.Accept.SetCharge(Smear::kCharged);
109  // trackingPhi.Accept.AddZone(zone_tracking);
110 
111  /* Create mRICH detector parameterization */
112 
113  //dRICH parameterization is available for studies, but the current design in the 2018 Detector Design Study only used h-side mRICH, e-side mRICH, DIRC and gas RICH, so the dRICH is commented out here
114  /*Smear::Acceptance::Zone zone_dRICH( eta2theta( 3.95 ), eta2theta( 1.24 ));
115  Smear::ParticleID dRICH_KPi("PIDMatrixFiles/dRICH_KPiPIDMatrix.dat");
116  Smear::ParticleID dRICH_ePi("PIDMatrixFiles/dRICH_ePiPIDMatrix.dat");
117  dRICH_KPi.Accept.AddZone(zone_dRICH);
118  dRICH_ePi.Accept.AddZone(zone_dRICH);*/
119 
120  Smear::Acceptance::Zone zone_gasRICH( eta2theta( 3.95 ), eta2theta( 1.24 ));
121  Smear::ParticleID gasRICH_KPi("PIDMatrixFiles/gasRICH_KPiPIDMatrix.dat");
122  Smear::ParticleID gasRICH_ePi("PIDMatrixFiles/gasRICH_ePiPIDMatrix.dat");
123  gasRICH_KPi.Accept.AddZone(zone_gasRICH);
124  gasRICH_ePi.Accept.AddZone(zone_gasRICH);
125 
126  Smear::Acceptance::Zone zone_hside_mRICH( eta2theta( 1.85 ), eta2theta( 1.10 ));
127  Smear::ParticleID hside_mRICH_KPi("PIDMatrixFiles/mRICH_KPiPIDMatrix.dat");
128  Smear::ParticleID hside_mRICH_ePi("PIDMatrixFiles/mRICH_ePiPIDMatrix.dat");
129  hside_mRICH_KPi.Accept.AddZone(zone_hside_mRICH);
130  hside_mRICH_ePi.Accept.AddZone(zone_hside_mRICH);
131 
132  Smear::Acceptance::Zone zone_DIRC( eta2theta( 1.24 ), eta2theta( -1.4 ));
133  Smear::ParticleID DIRC("PIDMatrixFiles/DIRCPIDMatrix.dat");
134  DIRC.Accept.AddZone(zone_DIRC);
135 
136  Smear::Acceptance::Zone zone_eside_mRICH( eta2theta( -1.4 ), eta2theta( -3.9 ));
137  Smear::ParticleID eside_mRICH_KPi("PIDMatrixFiles/mRICH_KPiPIDMatrix.dat");
138  Smear::ParticleID eside_mRICH_ePi("PIDMatrixFiles/mRICH_ePiPIDMatrix.dat");
139  eside_mRICH_KPi.Accept.AddZone(zone_eside_mRICH);
140  eside_mRICH_ePi.Accept.AddZone(zone_eside_mRICH);
141 
142  /* Create a DETECTOR and add the devices
143  */
144  Smear::Detector det;
145 
146  det.AddDevice(eemcE);
147  det.AddDevice(cemcE);
148  det.AddDevice(femcE);
149 
150  det.AddDevice(chcalE);
151  det.AddDevice(fhcalE);
152 
153  det.AddDevice(trackingMomentum);
154  det.AddDevice(trackingTheta);
155  det.AddDevice(trackingPhi);
156 
157  //det.AddDevice(dRICH_KPi);
158  //det.AddDevice(dRICH_ePi);
159  det.AddDevice(gasRICH_KPi);
160  det.AddDevice(gasRICH_ePi);
161  det.AddDevice(hside_mRICH_KPi);
162  det.AddDevice(hside_mRICH_ePi);
163  det.AddDevice(DIRC);
164  det.AddDevice(eside_mRICH_KPi);
165  det.AddDevice(eside_mRICH_ePi);
166 
167  det.SetEventKinematicsCalculator("NM JB DA"); // The detector will calculate event kinematics from smeared values
168 
169  return det;
170 }