1 #ifndef L1Trigger_TrackFindingTracklet_interface_Util_h 2 #define L1Trigger_TrackFindingTracklet_interface_Util_h 10 #include <sys/types.h> 22 unsigned int radix = 1,
value = 0;
23 for (
int i = binary.length() - 1;
i >= 0;
i--) {
24 if (binary.at(
i) !=
'0' && binary.at(
i) !=
'1')
26 value += (binary.at(
i) -
'0') * radix;
42 inline double bendstrip(
double r,
double rinv,
double stripPitch,
double sensorSpacing) {
43 double delta = r * sensorSpacing * 0.5 *
rinv;
44 double bend =
delta / stripPitch;
49 double FEbend,
double sensorSep,
double sensorSpacing,
double CF,
bool barrel,
double r = 0) {
50 double bend = sensorSpacing * CF * FEbend / sensorSep;
54 inline double tan_theta(
double r,
double z,
double z0,
bool z0_max) {
66 inline double rinv(
double phi1,
double phi2,
double r1,
double r2) {
69 double dphi = phi2 - phi1;
72 return 2.0 *
sin(dphi) / dr /
sqrt(1.0 + 2 * r1 *
r2 * (1.0 -
cos(dphi)) / (dr * dr));
78 for (
char word : stubwordhex) {
100 else if (
word ==
'A')
102 else if (
word ==
'B')
104 else if (
word ==
'C')
106 else if (
word ==
'D')
108 else if (
word ==
'E')
110 else if (
word ==
'F')
114 << __FILE__ <<
" " << __LINE__ <<
" hex string format invalid: " << stubwordhex;
116 stubwordbin += hexword;
123 int ipower = round(
power);
141 if (errno == ENOENT) {
144 if (errno == ENOTDIR) {
150 return (
info.st_mode & S_IFDIR) ? 1 : 0;
187 out.open(
fname, std::ofstream::app);
Log< level::Info, true > LogVerbatim
Sin< T >::type sin(const T &t)
std::string hexFormat(const std::string &binary)
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
double convertFEBend(double FEbend, double sensorSep, double sensorSpacing, double CF, bool barrel, double r=0)
double tan_theta(double r, double z, double z0, bool z0_max)
double rinv(double phi1, double phi2, double r1, double r2)
int dirExists(const std::string &path)
std::string convertHexToBin(const std::string &stubwordhex)
double bendstrip(double r, double rinv, double stripPitch, double sensorSpacing)
std::ofstream openfile(const std::string &dir, const std::string &fname, const char *file, int line)