CMS 3D CMS Logo

Classes | Functions
emtf Namespace Reference

Classes

struct  Event
 
class  Node
 
class  Tree
 

Functions

int calc_chamber (int station, int sector, int subsector, int ring, int csc_ID)
 
double calc_eta (int bits)
 
double calc_eta_from_theta_deg (double theta_deg, int endcap)
 
double calc_eta_from_theta_rad (double theta_rad)
 
int calc_eta_GMT (double val)
 
double calc_phi_glob_deg (double loc, int sector)
 
double calc_phi_glob_rad (double loc, int sector)
 
double calc_phi_GMT_deg (int bits)
 
int calc_phi_GMT_int (double val)
 
double calc_phi_GMT_rad (int bits)
 
double calc_phi_loc_deg (int bits)
 
double calc_phi_loc_deg_from_glob (double glob, int sector)
 
int calc_phi_loc_int (double glob, int sector, int bits)
 
double calc_phi_loc_rad (int bits)
 
double calc_pt (int bits)
 
int calc_pt_GMT (double val)
 
int calc_ring (int station, int csc_ID, int strip)
 
double calc_theta_deg (double eta)
 
double calc_theta_deg_from_int (int theta_int)
 
int calc_theta_int (double theta, int endcap, int bits)
 
double calc_theta_rad (double eta)
 
double calc_theta_rad_from_int (int theta_int)
 
int calc_uGMT_chamber (int csc_ID, int subsector, int neighbor, int station)
 
double deg_to_rad (double deg)
 
double rad_to_deg (double rad)
 
double range_phi_deg (double deg)
 
double range_phi_rad (double rad)
 
double range_theta_deg (double deg)
 
double range_theta_rad (double rad)
 

Function Documentation

int emtf::calc_chamber ( int  station,
int  sector,
int  subsector,
int  ring,
int  csc_ID 
)

Definition at line 21 of file TrackTools.cc.

References relativeConstraints::chamber.

21  {
22  int chamber = -999;
23  if (station == 1) {
24  chamber = ((sector-1) * 6) + csc_ID + 2; // Chamber offset of 2: First chamber in sector 1 is chamber 3
25  if (ring == 2) chamber -= 3;
26  if (ring == 3) chamber -= 6;
27  if (subsector == 2) chamber += 3;
28  if (chamber > 36) chamber -= 36;
29  }
30  else if (ring == 1) {
31  chamber = ((sector-1) * 3) + csc_ID + 1; // Chamber offset of 1: First chamber in sector 1 is chamber 2
32  if (chamber > 18) chamber -= 18;
33  }
34  else if (ring == 2) {
35  chamber = ((sector-1) * 6) + csc_ID - 3 + 2; // Chamber offset of 2: First chamber in sector 1 is chamber 3
36  if (chamber > 36) chamber -= 36;
37  }
38  return chamber;
39 }
double emtf::calc_eta ( int  bits)
inline

Definition at line 77 of file TrackTools.h.

References bits, and PVValHelper::eta.

77  {
78  double eta = static_cast<double>(bits);
79  eta *= 0.010875;
80  return eta;
81  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
double emtf::calc_eta_from_theta_deg ( double  theta_deg,
int  endcap 
)
inline

Definition at line 95 of file TrackTools.h.

References calc_eta_from_theta_rad(), deg_to_rad(), PVValHelper::eta, and range_theta_deg().

Referenced by l1t::stage2::emtf::ImportRPC().

95  { // endcap [-1,+1]
96  double theta_rad = deg_to_rad(range_theta_deg(theta_deg)); // put theta in [0, 90] range
97  double eta = calc_eta_from_theta_rad(theta_rad);
98  eta = (endcap == -1) ? -eta : eta;
99  return eta;
100  }
double calc_eta_from_theta_rad(double theta_rad)
Definition: TrackTools.h:90
double deg_to_rad(double deg)
Definition: TrackTools.h:50
double range_theta_deg(double deg)
Definition: TrackTools.h:34
double emtf::calc_eta_from_theta_rad ( double  theta_rad)
inline

Definition at line 90 of file TrackTools.h.

References PVValHelper::eta, cmsBatch::log, and funct::tan().

Referenced by calc_eta_from_theta_deg().

90  {
91  double eta = -1. * std::log(std::tan(theta_rad/2.));
92  return eta;
93  }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int emtf::calc_eta_GMT ( double  val)
inline

Definition at line 102 of file TrackTools.h.

102  {
103  val /= 0.010875;
104  int gmt_eta = static_cast<int>(std::round(val));
105  return gmt_eta;
106  }
double emtf::calc_phi_glob_deg ( double  loc,
int  sector 
)
inline

Definition at line 139 of file TrackTools.h.

Referenced by calc_phi_glob_rad().

139  { // loc in deg, sector [1-6]
140  double glob = loc + 15. + (60. * (sector-1));
141  glob = (glob < 180.) ? glob : glob - 360.;
142  return glob;
143  }
double emtf::calc_phi_glob_rad ( double  loc,
int  sector 
)
inline

Definition at line 145 of file TrackTools.h.

References calc_phi_glob_deg(), deg_to_rad(), and rad_to_deg().

145  { // loc in rad, sector [1-6]
146  return deg_to_rad(calc_phi_glob_deg(rad_to_deg(loc), sector));
147  }
double calc_phi_glob_deg(double loc, int sector)
Definition: TrackTools.h:139
double deg_to_rad(double deg)
Definition: TrackTools.h:50
double rad_to_deg(double rad)
Definition: TrackTools.h:55
double emtf::calc_phi_GMT_deg ( int  bits)
inline

Definition at line 185 of file TrackTools.h.

References bits.

Referenced by calc_phi_GMT_rad().

185  {
186  double phi = static_cast<double>(bits);
187  phi = (phi * 360./576.) + (180./576.);
188  return phi;
189  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
int emtf::calc_phi_GMT_int ( double  val)
inline

Definition at line 199 of file TrackTools.h.

References range_phi_deg().

199  { // phi in deg
200  val = range_phi_deg(val); // put phi in [-180,180] range
201  val = (val - 180./576.) / (360./576.);
202  int gmt_phi = static_cast<int>(std::round(val));
203  return gmt_phi;
204  }
double range_phi_deg(double deg)
Definition: TrackTools.h:22
double emtf::calc_phi_GMT_rad ( int  bits)
inline

Definition at line 195 of file TrackTools.h.

References calc_phi_GMT_deg(), and deg_to_rad().

195  {
197  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
double deg_to_rad(double deg)
Definition: TrackTools.h:50
double calc_phi_GMT_deg(int bits)
Definition: TrackTools.h:185
double emtf::calc_phi_loc_deg ( int  bits)
inline

Definition at line 149 of file TrackTools.h.

References bits, and create_public_lumi_plots::loc.

Referenced by calc_phi_loc_rad().

149  {
150  double loc = static_cast<double>(bits);
151  loc = (loc/60.) - 22.;
152  return loc;
153  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
double emtf::calc_phi_loc_deg_from_glob ( double  glob,
int  sector 
)
inline

Definition at line 170 of file TrackTools.h.

References create_public_lumi_plots::loc, and range_phi_deg().

Referenced by calc_phi_loc_int().

170  { // glob in deg, sector [1-6]
171  glob = range_phi_deg(glob); // put phi in [-180,180] range
172  double loc = glob - 15. - (60. * (sector-1));
173  return loc;
174  }
double range_phi_deg(double deg)
Definition: TrackTools.h:22
int emtf::calc_phi_loc_int ( double  glob,
int  sector,
int  bits 
)
inline

Definition at line 176 of file TrackTools.h.

References calc_phi_loc_deg_from_glob(), create_public_lumi_plots::loc, and funct::pow().

176  { // glob in deg, sector [1-6]
177  assert(bits == 11 || bits == 13); // 11 for RPCs from CPPF, 13 for CSC LCTs
178  double loc = calc_phi_loc_deg_from_glob(glob, sector);
179  loc = ((loc + 22.) < 0.) ? loc + 360. : loc;
180  loc = (loc + 22.) * 15. * pow(2, bits - 11);
181  int phi_int = static_cast<int>(std::round(loc));
182  return phi_int;
183  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
double calc_phi_loc_deg_from_glob(double glob, int sector)
Definition: TrackTools.h:170
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double emtf::calc_phi_loc_rad ( int  bits)
inline

Definition at line 155 of file TrackTools.h.

References calc_phi_loc_deg(), and deg_to_rad().

155  {
157  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
double calc_phi_loc_deg(int bits)
Definition: TrackTools.h:149
double deg_to_rad(double deg)
Definition: TrackTools.h:50
double emtf::calc_pt ( int  bits)
inline

Definition at line 62 of file TrackTools.h.

References bits, and EnergyCorrector::pt.

62  {
63  double pt = static_cast<double>(bits);
64  pt = 0.5 * (pt - 1);
65  return pt;
66  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
int emtf::calc_pt_GMT ( double  val)
inline

Definition at line 68 of file TrackTools.h.

68  {
69  val = (val * 2) + 1;
70  int gmt_pt = static_cast<int>(std::round(val));
71  gmt_pt = (gmt_pt > 511) ? 511 : gmt_pt;
72  return gmt_pt;
73  }
int emtf::calc_ring ( int  station,
int  csc_ID,
int  strip 
)

Definition at line 5 of file TrackTools.cc.

5  {
6  if (station > 1) {
7  if (csc_ID < 4) return 1;
8  else if (csc_ID < 10) return 2;
9  else return -999;
10  }
11  else if (station == 1) {
12  if (csc_ID < 4 && strip > 127) return 4;
13  else if (csc_ID < 4 && strip >= 0) return 1;
14  else if (csc_ID > 3 && csc_ID < 7) return 2;
15  else if (csc_ID > 6 && csc_ID < 10) return 3;
16  else return -999;
17  }
18  else return -999;
19 }
double emtf::calc_theta_deg ( double  eta)
inline

Definition at line 125 of file TrackTools.h.

References calc_theta_rad(), and rad_to_deg().

125  {
126  return rad_to_deg(calc_theta_rad(eta));
127  }
double calc_theta_rad(double eta)
Definition: TrackTools.h:120
double rad_to_deg(double rad)
Definition: TrackTools.h:55
double emtf::calc_theta_deg_from_int ( int  theta_int)
inline

Definition at line 110 of file TrackTools.h.

References theta().

Referenced by calc_theta_rad_from_int().

110  {
111  double theta = static_cast<double>(theta_int);
112  theta = theta * (45.0-8.5)/128. + 8.5;
113  return theta;
114  }
Geom::Theta< T > theta() const
int emtf::calc_theta_int ( double  theta,
int  endcap,
int  bits 
)
inline

Definition at line 129 of file TrackTools.h.

References funct::pow(), and theta().

129  { // theta in deg, endcap [-1,+1]
130  assert(bits == 5 || bits == 7); // 5 for RPC hits from CPPF, 7 for CSC LCTs
131  theta = (endcap == -1) ? (180. - theta) : theta;
132  theta = (theta - 8.5) * pow(2, bits) / (45.0-8.5);
133  int theta_int = static_cast<int>(std::round(theta));
134  return theta_int;
135  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
Geom::Theta< T > theta() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double emtf::calc_theta_rad ( double  eta)
inline

Definition at line 120 of file TrackTools.h.

References JetChargeProducer_cfi::exp.

Referenced by calc_theta_deg().

120  {
121  double theta_rad = 2. * std::atan(std::exp(-1.*eta));
122  return theta_rad;
123  }
double emtf::calc_theta_rad_from_int ( int  theta_int)
inline

Definition at line 116 of file TrackTools.h.

References calc_theta_deg_from_int(), and deg_to_rad().

116  {
117  return deg_to_rad(calc_theta_deg_from_int(theta_int));
118  }
double calc_theta_deg_from_int(int theta_int)
Definition: TrackTools.h:110
double deg_to_rad(double deg)
Definition: TrackTools.h:50
int emtf::calc_uGMT_chamber ( int  csc_ID,
int  subsector,
int  neighbor,
int  station 
)

Definition at line 42 of file TrackTools.cc.

42  {
43  if (station == 1) {
44  if (csc_ID == 3 && neighbor == 1 && subsector == 2) return 1;
45  else if (csc_ID == 6 && neighbor == 1 && subsector == 2) return 2;
46  else if (csc_ID == 9 && neighbor == 1 && subsector == 2) return 3;
47  else if (csc_ID == 3 && neighbor == 0 && subsector == 2) return 4;
48  else if (csc_ID == 6 && neighbor == 0 && subsector == 2) return 5;
49  else if (csc_ID == 9 && neighbor == 0 && subsector == 2) return 6;
50  else return 0;
51  }
52  else {
53  if (csc_ID == 3 && neighbor == 1) return 1;
54  else if (csc_ID == 9 && neighbor == 1) return 2;
55  else if (csc_ID == 3 && neighbor == 0) return 3;
56  else if (csc_ID == 9 && neighbor == 0) return 4;
57  else return 0;
58  }
59 }
bool neighbor(int endcap, int sector, int SectIndex, int id, int sub, int station)
double emtf::deg_to_rad ( double  deg)
inline

Definition at line 50 of file TrackTools.h.

References constexpr, and M_PI.

Referenced by calc_eta_from_theta_deg(), calc_phi_glob_rad(), calc_phi_GMT_rad(), calc_phi_loc_rad(), and calc_theta_rad_from_int().

50  {
51  constexpr double factor = M_PI/180.;
52  return deg * factor;
53  }
#define constexpr
#define M_PI
double emtf::rad_to_deg ( double  rad)
inline

Definition at line 55 of file TrackTools.h.

References constexpr, and M_PI.

Referenced by calc_phi_glob_rad(), and calc_theta_deg().

55  {
56  constexpr double factor = 180./M_PI;
57  return rad * factor;
58  }
#define constexpr
#define M_PI
double emtf::range_phi_deg ( double  deg)
inline

Definition at line 22 of file TrackTools.h.

Referenced by calc_phi_GMT_int(), and calc_phi_loc_deg_from_glob().

22  {
23  while (deg < -180.) deg += 360.;
24  while (deg >= +180.) deg -= 360.;
25  return deg;
26  }
double emtf::range_phi_rad ( double  rad)
inline

Definition at line 28 of file TrackTools.h.

References M_PI.

28  {
29  while (rad < -M_PI) rad += 2.*M_PI;
30  while (rad >= +M_PI) rad -= 2.*M_PI;
31  return rad;
32  }
#define M_PI
double emtf::range_theta_deg ( double  deg)
inline

Definition at line 34 of file TrackTools.h.

Referenced by calc_eta_from_theta_deg().

34  {
35  deg = fabs(deg);
36  while (deg >= 180.) deg -= 180.;
37  if (deg >= 180./2.) deg = 180. - deg;
38  return deg;
39  }
double emtf::range_theta_rad ( double  rad)
inline

Definition at line 41 of file TrackTools.h.

References M_PI.

41  {
42  rad = fabs(rad);
43  while (rad >= M_PI) rad -= M_PI;
44  if (rad >= M_PI/2.) rad = M_PI - rad;
45  return rad;
46  }
#define M_PI