ATLAS Offline Software
Loading...
Searching...
No Matches
TrigL2MuonSA::UtilTools Class Reference

#include <CscRegUtils.h>

Collaboration diagram for TrigL2MuonSA::UtilTools:

Public Member Functions

 UtilTools ()
double calc_theta (double eta) const
double calc_theta (double x, double y, double z) const
double calc_eta (double x, double y, double z) const
double calc_phi (double x, double y) const
double calc_dphi (double phi1, double phi2) const
double calc_sumsq (double x, double y) const
double calc_sumsq (double x, double y, double z) const
double cotan (double theta) const
double relative_error (double measured, double reference) const
double average_phi (double phi1, double phi2) const

Detailed Description

Definition at line 25 of file CscRegUtils.h.

Constructor & Destructor Documentation

◆ UtilTools()

TrigL2MuonSA::UtilTools::UtilTools ( )
inline

Definition at line 28 of file CscRegUtils.h.

28{}

Member Function Documentation

◆ average_phi()

double TrigL2MuonSA::UtilTools::average_phi ( double phi1,
double phi2 ) const

Definition at line 243 of file CscRegUtils.cxx.

244{
245 double phi = 0.;
246
247 if (phi1*phi2<0. && std::abs(phi1)>M_PI/2.){
248
249 double tmp1 = (phi1>0.) ? phi1 - M_PI : phi1 + M_PI;
250 double tmp2 = (phi2>0.) ? phi2 - M_PI : phi2 + M_PI;
251
252 double tmp = (tmp1+tmp2)/2.;
253
254 phi = (tmp>0.) ? tmp - M_PI : tmp + M_PI;
255
256 } else {
257
258 phi = (phi1+phi2)/2.;
259
260 }
261
262 return phi;
263}
#define M_PI
Scalar phi() const
phi method

◆ calc_dphi()

double TrigL2MuonSA::UtilTools::calc_dphi ( double phi1,
double phi2 ) const

Definition at line 229 of file CscRegUtils.cxx.

230{
231 double dphi=phi1-phi2;
232
233 if (dphi > M_PI) {
234 dphi -= 2*M_PI;
235 }else if(dphi < (-1)*M_PI){
236 dphi += 2*M_PI;
237 }
238
239 return dphi;
240}

◆ calc_eta()

double TrigL2MuonSA::UtilTools::calc_eta ( double x,
double y,
double z ) const
inline

Definition at line 32 of file CscRegUtils.h.

32{return (-1)*std::log(std::tan(calc_theta(x,y,z)/2.));}
#define y
#define x
#define z
double calc_theta(double eta) const
Definition CscRegUtils.h:30

◆ calc_phi()

double TrigL2MuonSA::UtilTools::calc_phi ( double x,
double y ) const

Definition at line 207 of file CscRegUtils.cxx.

207 {
208
209 double /*abs_x=std::abs(x),*/ abs_y=std::abs(y);
210 double abs_sine=abs_y/std::sqrt(x*x+y*y);
211 //std::cout << "convert " << ASin(abssin) << std::endl;
212
213 if (x>0 && y>=0) {
214 return std::asin(abs_sine);
215 }else if(x<=0 && y>0){
216 return M_PI-std::asin(abs_sine);
217 }else if(x<0 && y<=0){
218 return M_PI+std::asin(abs_sine)-2*M_PI;
219 }else if(x>=0 && y<0){
220 return 2*M_PI-std::asin(abs_sine)-2*M_PI;
221 }else{
222 //std::cout<< "UtilTools::calc_phi, sin=cos=0" << std::endl;
223 return 0.;
224 }
225
226}

◆ calc_sumsq() [1/2]

double TrigL2MuonSA::UtilTools::calc_sumsq ( double x,
double y ) const
inline

Definition at line 35 of file CscRegUtils.h.

35{ return std::sqrt(x*x+y*y); }

◆ calc_sumsq() [2/2]

double TrigL2MuonSA::UtilTools::calc_sumsq ( double x,
double y,
double z ) const
inline

Definition at line 36 of file CscRegUtils.h.

36{ return std::sqrt(x*x+y*y+z*z);}

◆ calc_theta() [1/2]

double TrigL2MuonSA::UtilTools::calc_theta ( double eta) const
inline

Definition at line 30 of file CscRegUtils.h.

30{ return 2*std::atan(std::exp((-1)*eta)); }
Scalar eta() const
pseudorapidity method

◆ calc_theta() [2/2]

double TrigL2MuonSA::UtilTools::calc_theta ( double x,
double y,
double z ) const
inline

Definition at line 31 of file CscRegUtils.h.

31{ return std::acos(z/std::sqrt(x*x+y*y+z*z)); } // for position not for direction theta in [0,pi]

◆ cotan()

double TrigL2MuonSA::UtilTools::cotan ( double theta) const
inline

Definition at line 37 of file CscRegUtils.h.

37{ return std::tan(M_PI-theta); }
Scalar theta() const
theta method

◆ relative_error()

double TrigL2MuonSA::UtilTools::relative_error ( double measured,
double reference ) const
inline

Definition at line 38 of file CscRegUtils.h.

38{return (measured-reference)/reference; }

The documentation for this class was generated from the following files: