File indexing completed on 2026-04-09 07:49:52
0001 #include <csignal>
0002 #include "SLOG.hh"
0003 #include "scuda.h"
0004 #include "squad.h"
0005 #include "SThetaCut.hh"
0006
0007 const plog::Severity SThetaCut::LEVEL = SLOG::EnvLevel("SThetaCut", "DEBUG" );
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 void SThetaCut::PrepareParam( quad& q0, quad& q1, double startTheta_pi, double deltaTheta_pi )
0060 {
0061 double theta0_pi = startTheta_pi ;
0062 double theta1_pi = startTheta_pi + deltaTheta_pi ;
0063 bool has_thetacut = theta0_pi > 0. || theta1_pi < 1. ;
0064 assert(has_thetacut);
0065 if(!has_thetacut) std::raise(SIGINT);
0066
0067 assert( theta0_pi >= 0. && theta0_pi <= 1.) ;
0068 assert( theta1_pi >= 0. && theta1_pi <= 1.) ;
0069
0070 bool plane_theta0 = theta0_pi == 0.5 ;
0071 bool plane_theta1 = theta1_pi == 0.5 ;
0072
0073
0074
0075 const double pi = M_PIf ;
0076 double theta0 = theta0_pi*pi ;
0077 double theta1 = theta1_pi*pi ;
0078
0079 double cosTheta0 = std::cos(theta0);
0080 double sinTheta0 = std::sin(theta0);
0081 double tanTheta0 = std::tan(theta0);
0082
0083 double cosTheta1 = std::cos(theta1);
0084 double sinTheta1 = std::sin(theta1);
0085 double tanTheta1 = std::tan(theta1);
0086
0087
0088
0089
0090 double tan2Theta0 = tanTheta0*tanTheta0 ;
0091 double tan2Theta1 = tanTheta1*tanTheta1 ;
0092
0093
0094 q0.f.x = float(plane_theta0 ? 0. : cosTheta0) ;
0095 q0.f.y = float(plane_theta0 ? 1.0 : sinTheta0) ;
0096 q0.f.z = float(plane_theta1 ? 0. : cosTheta1) ;
0097 q0.f.w = float(plane_theta1 ? 1.0 : sinTheta1) ;
0098
0099 q1.f.x = float(plane_theta0 ? 0. : tan2Theta0 );
0100 q1.f.y = float(plane_theta1 ? 0. : tan2Theta1 );
0101
0102
0103 LOG(LEVEL)
0104 << " startTheta_pi " << startTheta_pi
0105 << " deltaTheta_pi " << deltaTheta_pi
0106 << " plane_theta0 " << plane_theta0
0107 << " plane_theta1 " << plane_theta1
0108 << " theta0 " << theta0
0109 << " theta1 " << theta1
0110 ;
0111
0112 LOG(LEVEL)
0113 << " cosTheta0 " << cosTheta0
0114 << " sinTheta0 " << sinTheta0
0115 << " cosTheta1 " << cosTheta1
0116 << " sinTheta1 " << sinTheta1
0117 << " tan2Theta0 " << tan2Theta0
0118 << " tan2Theta1 " << tan2Theta1
0119 ;
0120
0121
0122 }
0123