31 #include "Math/Vector4D.h"
41 const std::valarray<double>& eta_min,
const std::valarray<double>& eta_max,
42 const std::valarray<double>& A,
const std::valarray<double>& B );
50 static std::valarray<double>
CalcA (
const double Bfield,
51 const double x1,
const std::valarray<double> A1,
52 const double x2,
const std::valarray<double>
A2 );
59 static std::valarray<double>
CalcB (
const double Bfield,
60 const double x1,
const std::valarray<double> B1,
61 const double x2,
const std::valarray<double> B2 );
64 gSystem->Load(
"libeicsmear");
98 const std::valarray<double> eta_min = { 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5 };
99 const std::valarray<double> eta_max = { 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4 };
101 const std::valarray<double> A3T = { 0.018, 0.016, 0.016, 0.012, 0.018, 0.039, 0.103, 0.295 };
102 const std::valarray<double> B3T = { 0.369, 0.428, 0.427, 0.462, 0.719, 1.336, 2.428, 4.552 };
103 const std::valarray<double> A1p4T = { 0.038, 0.035, 0.035, 0.026, 0.041, 0.088, 0.217, 0.610 };
104 const std::valarray<double> B1p4T = { 0.816, 0.898, 0.921, 0.997, 1.548, 2.830, 5.234, 9.797 };
106 const std::valarray<double> A =
CalcA ( Bfield, 1.4, A1p4T, 3.0, A3T );
107 const std::valarray<double> B =
CalcB ( Bfield, 1.4, B1p4T, 3.0, B3T );
120 0., TMath::Infinity(),
166 Smear::Device EmcalForwardBarrel(
Smear::kE,
"sqrt( pow ( 0.02,2 ) + pow( 0.14,2)*E + pow ( 0.03*E,2 ) )");
242 if ( !std::isnan(eta) && !std::isinf(eta) ) {
243 return 2.0 * atan( exp( -eta ));
245 throw std::runtime_error(
"ThetaFromEta called with NaN or Inf");
250 std::valarray<double>
CalcA (
const double Bfield,
251 const double x1,
const std::valarray<double> A1,
252 const double x2,
const std::valarray<double>
A2 ){
262 return A1 + (Bfield - x1 ) * (A2 - A1) / (x2 - x1 );
265 std::valarray<double>
CalcB (
const double Bfield,
266 const double x1,
const std::valarray<double> B1,
267 const double x2,
const std::valarray<double> B2 ){
277 return B1 + (Bfield - x1 ) * (B2 - B1) / (x2 - x1 );
282 const std::valarray<double>& eta_min,
const std::valarray<double>& eta_max,
283 const std::valarray<double>& A,
const std::valarray<double>& B ){
286 const TString SmearString =
"sqrt( pow ( AAA *P*P, 2) + pow ( BBB * P, 2) )";
288 for(
auto i = 0; i< A.size(); ++i) {
289 auto CurrentString = SmearString;
290 TString AAA =
""; AAA += 0.01*A[i];
291 TString BBB =
""; BBB += 0.01*B[i];
292 CurrentString.ReplaceAll (
"AAA", AAA );
293 CurrentString.ReplaceAll (
"BBB", BBB );