CMS 3D CMS Logo

Classes | Typedefs | Functions | Variables
emtf Namespace Reference

Classes

class  AbsoluteDeviation
 
struct  CPPFTag
 
struct  CSCTag
 
struct  Event
 
class  Forest
 
struct  GEMTag
 
class  Huber
 
struct  IRPCTag
 
class  LeastSquares
 
class  LossFunction
 
struct  ME0Tag
 
class  Node
 
class  PercentErrorSquared
 
struct  RPCTag
 
class  Tree
 
struct  TTTag
 

Typedefs

template<typename T >
using sector_array = std::array< T, NUM_SECTORS >
 
template<typename T >
using zone_array = std::array< T, NUM_ZONES >
 

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 calc_phi_loc_int_rpc (double glob, int sector)
 
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_eta (double eta)
 
double calc_theta_deg_from_int (int theta_int)
 
int calc_theta_int (double theta, int endcap)
 
int calc_theta_int_rpc (double theta, int endcap)
 
double calc_theta_rad (double eta)
 
double calc_theta_rad_from_eta (double eta)
 
double calc_theta_rad_from_int (int theta_int)
 
int calc_uGMT_chamber (int csc_ID, int subsector, int neighbor, int station)
 
template<typename T = void>
EMTFGEMDetId construct_EMTFGEMDetId (const L1TMuon::TriggerPrimitive &tp)
 
double deg_to_rad (double deg)
 
void mergeNtuples (const char *ntuplename, const char *filestomerge, const char *outputfile)
 
template<typename T >
std::string numToStr (T num)
 
float processPrediction (float BDTPt, int Quality, float PrelimFit)
 
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)
 
template<class bidiiter >
bidiiter shuffle (bidiiter begin, bidiiter end, size_t num_random)
 
void sort_uGMT_muons (l1t::RegionalMuonCandBxCollection &cands)
 
void sortNtupleByEvent (const char *ntuplename, const char *filenametosort, const char *outputfile)
 

Variables

int MAX_ENDCAP = 2
 
int MAX_TRIGSECTOR = 6
 
int MIN_ENDCAP = 1
 
int MIN_TRIGSECTOR = 1
 
int NUM_SECTORS = 12
 
int NUM_STATION_PAIRS = 6
 
int NUM_STATIONS = 4
 
int NUM_ZONE_HITS = 160
 
int NUM_ZONES = 4
 
const double ptscale [31]
 
const std::vector< double > ptScale
 
const double twoJets_scale [16]
 
const std::vector< double > twoJetsScale
 

Typedef Documentation

template<typename T >
using emtf::sector_array = typedef std::array<T, NUM_SECTORS>

Definition at line 76 of file Common.h.

template<typename T >
using emtf::zone_array = typedef std::array<T, NUM_ZONES>

Definition at line 78 of file Common.h.

Function Documentation

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

Definition at line 28 of file TrackTools.cc.

References relativeConstraints::chamber.

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

28  {
29  int chamber = -999;
30  if (station == 1) {
31  chamber = ((sector - 1) * 6) + csc_ID + 2; // Chamber offset of 2: First chamber in sector 1 is chamber 3
32  if (ring == 2)
33  chamber -= 3;
34  if (ring == 3)
35  chamber -= 6;
36  if (subsector == 2)
37  chamber += 3;
38  if (chamber > 36)
39  chamber -= 36;
40  } else if (ring == 1) {
41  chamber = ((sector - 1) * 3) + csc_ID + 1; // Chamber offset of 1: First chamber in sector 1 is chamber 2
42  if (chamber > 18)
43  chamber -= 18;
44  } else if (ring == 2) {
45  chamber = ((sector - 1) * 6) + csc_ID - 3 + 2; // Chamber offset of 2: First chamber in sector 1 is chamber 3
46  if (chamber > 36)
47  chamber -= 36;
48  }
49  return chamber;
50  }
double emtf::calc_eta ( int  bits)
inline

Definition at line 84 of file TrackTools.h.

References bits, and PVValHelper::eta.

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

84  {
85  double eta = static_cast<double>(bits);
86  eta *= 0.010875;
87  return eta;
88  }
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 102 of file TrackTools.h.

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

Referenced by AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), and l1t::stage2::emtf::ImportRPC().

102  { // endcap [-1,+1]
103  double theta_rad = deg_to_rad(range_theta_deg(theta_deg)); // put theta in [0, 90] range
104  double eta = calc_eta_from_theta_rad(theta_rad);
105  eta = (endcap == -1) ? -eta : eta;
106  return eta;
107  }
double calc_eta_from_theta_rad(double theta_rad)
Definition: TrackTools.h:97
double deg_to_rad(double deg)
Definition: TrackTools.h:57
double range_theta_deg(double deg)
Definition: TrackTools.h:37
double emtf::calc_eta_from_theta_rad ( double  theta_rad)
inline

Definition at line 97 of file TrackTools.h.

References PVValHelper::eta, dqm-mbProfile::log, and funct::tan().

Referenced by calc_eta_from_theta_deg().

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

Definition at line 109 of file TrackTools.h.

109  {
110  val /= 0.010875;
111  int gmt_eta = static_cast<int>(std::round(val));
112  return gmt_eta;
113  }
double emtf::calc_phi_glob_deg ( double  loc,
int  sector 
)
inline

Definition at line 155 of file TrackTools.h.

Referenced by calc_phi_glob_rad(), AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), l1t::stage2::emtf::ImportRPC(), and l1t::stage2::emtf::ImportSP().

155  { // loc in deg, sector [1-6]
156  double glob = loc + 15. + (60. * (sector - 1));
157  glob = (glob < 180.) ? glob : glob - 360.;
158  return glob;
159  }
double emtf::calc_phi_glob_rad ( double  loc,
int  sector 
)
inline

Definition at line 161 of file TrackTools.h.

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

161  { // loc in rad, sector [1-6]
162  return deg_to_rad(calc_phi_glob_deg(rad_to_deg(loc), sector));
163  }
double calc_phi_glob_deg(double loc, int sector)
Definition: TrackTools.h:155
double deg_to_rad(double deg)
Definition: TrackTools.h:57
double rad_to_deg(double rad)
Definition: TrackTools.h:62
double emtf::calc_phi_GMT_deg ( int  bits)
inline

Definition at line 206 of file TrackTools.h.

References bits.

Referenced by calc_phi_GMT_rad().

206  {
207  double phi = static_cast<double>(bits);
208  phi = (phi * 360. / 576.) + (180. / 576.);
209  return phi;
210  }
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 218 of file TrackTools.h.

References range_phi_deg().

218  { // phi in deg
219  val = range_phi_deg(val); // put phi in [-180,180] range
220  val = (val - 180. / 576.) / (360. / 576.);
221  int gmt_phi = static_cast<int>(std::round(val));
222  return gmt_phi;
223  }
double range_phi_deg(double deg)
Definition: TrackTools.h:21
double emtf::calc_phi_GMT_rad ( int  bits)
inline

Definition at line 216 of file TrackTools.h.

References calc_phi_GMT_deg(), and deg_to_rad().

216 { return deg_to_rad(calc_phi_GMT_deg(bits)); }
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:57
double calc_phi_GMT_deg(int bits)
Definition: TrackTools.h:206
double emtf::calc_phi_loc_deg ( int  bits)
inline

Definition at line 165 of file TrackTools.h.

References bits.

Referenced by calc_phi_loc_rad(), AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), l1t::stage2::emtf::ImportRPC(), and l1t::stage2::emtf::ImportSP().

165  {
166  double loc = static_cast<double>(bits);
167  loc = (loc / 60.) - 22.;
168  return loc;
169  }
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 184 of file TrackTools.h.

References range_phi_deg().

Referenced by calc_phi_loc_int(), and calc_phi_loc_int_rpc().

184  { // glob in deg, sector [1-6]
185  glob = range_phi_deg(glob); // put phi in [-180,180] range
186  double loc = glob - 15. - (60. * (sector - 1));
187  return loc;
188  }
double range_phi_deg(double deg)
Definition: TrackTools.h:21
int emtf::calc_phi_loc_int ( double  glob,
int  sector 
)
inline

Definition at line 190 of file TrackTools.h.

References calc_phi_loc_deg_from_glob().

Referenced by PrimitiveConversion::convert_gem().

190  { // glob in deg, sector [1-6]
191  double loc = calc_phi_loc_deg_from_glob(glob, sector);
192  loc = ((loc + 22.) < 0.) ? loc + 360. : loc;
193  loc = (loc + 22.) * 60.;
194  int phi_int = static_cast<int>(std::round(loc));
195  return phi_int;
196  }
double calc_phi_loc_deg_from_glob(double glob, int sector)
Definition: TrackTools.h:184
int emtf::calc_phi_loc_int_rpc ( double  glob,
int  sector 
)
inline

Definition at line 198 of file TrackTools.h.

References calc_phi_loc_deg_from_glob().

Referenced by PrimitiveConversion::convert_rpc().

198  { // glob in deg, sector [1-6]
199  double loc = calc_phi_loc_deg_from_glob(glob, sector);
200  loc = ((loc + 22.) < 0.) ? loc + 360. : loc;
201  loc = (loc + 22.) * 60. / 4.; // 4x coarser resolution
202  int phi_int = static_cast<int>(std::round(loc));
203  return phi_int;
204  }
double calc_phi_loc_deg_from_glob(double glob, int sector)
Definition: TrackTools.h:184
double emtf::calc_phi_loc_rad ( int  bits)
inline

Definition at line 171 of file TrackTools.h.

References calc_phi_loc_deg(), and deg_to_rad().

171 { return deg_to_rad(calc_phi_loc_deg(bits)); }
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:165
double deg_to_rad(double deg)
Definition: TrackTools.h:57
double emtf::calc_pt ( int  bits)
inline

Definition at line 69 of file TrackTools.h.

References bits, and DiDispStaMuonMonitor_cfi::pt.

69  {
70  double pt = static_cast<double>(bits);
71  pt = 0.5 * (pt - 1);
72  return pt;
73  }
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 75 of file TrackTools.h.

75  {
76  val = (val * 2) + 1;
77  int gmt_pt = static_cast<int>(std::round(val));
78  gmt_pt = (gmt_pt > 511) ? 511 : gmt_pt;
79  return gmt_pt;
80  }
int emtf::calc_ring ( int  station,
int  csc_ID,
int  strip 
)

Definition at line 5 of file TrackTools.cc.

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

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

Definition at line 130 of file TrackTools.h.

References calc_theta_rad(), and rad_to_deg().

130 { return rad_to_deg(calc_theta_rad(eta)); }
double calc_theta_rad(double eta)
Definition: TrackTools.h:125
double rad_to_deg(double rad)
Definition: TrackTools.h:62
double emtf::calc_theta_deg_from_eta ( double  eta)
inline

Definition at line 151 of file TrackTools.h.

References calc_theta_rad_from_eta(), and rad_to_deg().

double calc_theta_rad_from_eta(double eta)
Definition: TrackTools.h:146
double rad_to_deg(double rad)
Definition: TrackTools.h:62
double emtf::calc_theta_deg_from_int ( int  theta_int)
inline

Definition at line 117 of file TrackTools.h.

References theta().

Referenced by calc_theta_rad_from_int(), AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), and l1t::stage2::emtf::ImportRPC().

117  {
118  double theta = static_cast<double>(theta_int);
119  theta = theta * (45.0 - 8.5) / 128. + 8.5;
120  return theta;
121  }
Geom::Theta< T > theta() const
int emtf::calc_theta_int ( double  theta,
int  endcap 
)
inline

Definition at line 132 of file TrackTools.h.

References theta().

Referenced by PrimitiveConversion::convert_gem().

132  { // theta in deg, endcap [-1,+1]
133  theta = (endcap == -1) ? (180. - theta) : theta;
134  theta = (theta - 8.5) * 128. / (45.0 - 8.5);
135  int theta_int = static_cast<int>(std::round(theta));
136  return theta_int;
137  }
Geom::Theta< T > theta() const
int emtf::calc_theta_int_rpc ( double  theta,
int  endcap 
)
inline

Definition at line 139 of file TrackTools.h.

References theta().

Referenced by PrimitiveConversion::convert_rpc().

139  { // theta in deg, endcap [-1,+1]
140  theta = (endcap == -1) ? (180. - theta) : theta;
141  theta = (theta - 8.5) * (128. / 4.) / (45.0 - 8.5); // 4x coarser resolution
142  int theta_int = static_cast<int>(std::round(theta));
143  return theta_int;
144  }
Geom::Theta< T > theta() const
double emtf::calc_theta_rad ( double  eta)
inline

Definition at line 125 of file TrackTools.h.

References JetChargeProducer_cfi::exp.

Referenced by calc_theta_deg().

125  {
126  double theta_rad = 2. * std::atan(std::exp(-1. * eta));
127  return theta_rad;
128  }
double emtf::calc_theta_rad_from_eta ( double  eta)
inline

Definition at line 146 of file TrackTools.h.

References theta().

Referenced by calc_theta_deg_from_eta().

146  {
147  double theta = std::atan2(1.0, std::sinh(eta)); // cot(theta) = sinh(eta)
148  return theta;
149  }
Geom::Theta< T > theta() const
double emtf::calc_theta_rad_from_int ( int  theta_int)
inline

Definition at line 123 of file TrackTools.h.

References calc_theta_deg_from_int(), and deg_to_rad().

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

Definition at line 53 of file TrackTools.cc.

Referenced by l1t::stage2::emtf::SPBlockUnpacker::unpack().

53  {
54  if (station == 1) {
55  if (csc_ID == 3 && neighbor == 1 && subsector == 2)
56  return 1;
57  else if (csc_ID == 6 && neighbor == 1 && subsector == 2)
58  return 2;
59  else if (csc_ID == 9 && neighbor == 1 && subsector == 2)
60  return 3;
61  else if (csc_ID == 3 && neighbor == 0 && subsector == 2)
62  return 4;
63  else if (csc_ID == 6 && neighbor == 0 && subsector == 2)
64  return 5;
65  else if (csc_ID == 9 && neighbor == 0 && subsector == 2)
66  return 6;
67  else
68  return 0;
69  } else {
70  if (csc_ID == 3 && neighbor == 1)
71  return 1;
72  else if (csc_ID == 9 && neighbor == 1)
73  return 2;
74  else if (csc_ID == 3 && neighbor == 0)
75  return 3;
76  else if (csc_ID == 9 && neighbor == 0)
77  return 4;
78  else
79  return 0;
80  }
81  }
template<typename T = void>
EMTFGEMDetId emtf::construct_EMTFGEMDetId ( const L1TMuon::TriggerPrimitive tp)
double emtf::deg_to_rad ( double  deg)
inline

Definition at line 57 of file TrackTools.h.

References constexpr, DQMScaleToClient_cfi::factor, 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().

57  {
58  constexpr double factor = M_PI / 180.;
59  return deg * factor;
60  }
#define M_PI
#define constexpr
void emtf::mergeNtuples ( const char *  ntuplename,
const char *  filestomerge,
const char *  outputfile 
)

Definition at line 88 of file Utilities.cc.

Referenced by numToStr().

88  {
89  TChain chain(ntuplename);
90  chain.Add(filestomerge);
91  chain.Merge(outputfile);
92 }
Definition: chain.py:1
template<typename T >
std::string emtf::numToStr ( T  num)
float emtf::processPrediction ( float  BDTPt,
int  Quality,
float  PrelimFit 
)

Definition at line 46 of file Utilities.cc.

References RPCpg::pts, and ptscale.

Referenced by numToStr().

46  {
47  // Discretize and scale the BDTPt prediction
48 
49  // Fix terrible predictions
50  if (BDTPt < 0)
51  BDTPt = PrelimFit;
52  if (BDTPt > 250)
53  BDTPt = PrelimFit;
54 
55  float BDTPt1 = BDTPt;
56  float scaleF = 1.0;
57 
58  // Scale based upon quality
59  if (Quality == 3)
60  scaleF = 1.15;
61  if (Quality == 2)
62  scaleF = 1.3;
63  if (Quality == 1)
64  scaleF = 1.7;
65 
66  BDTPt1 = scaleF * BDTPt1;
67 
68  // Discretize based upon ptscale
69  for (int pts = 0; pts < 31; pts++) {
70  if (ptscale[pts] <= BDTPt1 && ptscale[pts + 1] > BDTPt1) {
71  BDTPt1 = ptscale[pts];
72  break;
73  }
74  }
75 
76  if (BDTPt1 > 140)
77  BDTPt1 = 140;
78  if (BDTPt1 < 0)
79  BDTPt1 = 0;
80 
81  return BDTPt1;
82 }
static const double pts[33]
Definition: Constants.h:30
const double ptscale[31]
Definition: Utilities.cc:29
double emtf::rad_to_deg ( double  rad)
inline
double emtf::range_phi_deg ( double  deg)
inline

Definition at line 21 of file TrackTools.h.

Referenced by calc_phi_GMT_int(), and calc_phi_loc_deg_from_glob().

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

Definition at line 29 of file TrackTools.h.

References M_PI.

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

Definition at line 37 of file TrackTools.h.

Referenced by calc_eta_from_theta_deg().

37  {
38  deg = fabs(deg);
39  while (deg >= 180.)
40  deg -= 180.;
41  if (deg >= 180. / 2.)
42  deg = 180. - deg;
43  return deg;
44  }
double emtf::range_theta_rad ( double  rad)
inline

Definition at line 46 of file TrackTools.h.

References M_PI.

46  {
47  rad = fabs(rad);
48  while (rad >= M_PI)
49  rad -= M_PI;
50  if (rad >= M_PI / 2.)
51  rad = M_PI - rad;
52  return rad;
53  }
#define M_PI
template<class bidiiter >
bidiiter emtf::shuffle ( bidiiter  begin,
bidiiter  end,
size_t  num_random 
)

Definition at line 27 of file Utilities.h.

References begin, HLT_2018_cff::distance, alignCSCRings::r, rand(), and std::swap().

Referenced by emtf::Forest::prepareRandomSubsample().

27  {
28  // We will end up with the same elements in the collection except that
29  // the first num_random elements will be randomized.
30 
31  size_t left = std::distance(begin, end);
32  while (num_random--) {
33  bidiiter r = begin;
34  std::advance(r, rand() % left);
35  std::swap(*begin, *r);
36  ++begin;
37  --left;
38  }
39  return begin;
40  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
Signal rand(Signal arg)
Definition: vlib.cc:379
void emtf::sort_uGMT_muons ( l1t::RegionalMuonCandBxCollection cands)

Definition at line 109 of file MicroGMTConverter.cc.

References BXVector< T >::begin(), l1t::emtf_neg, BXVector< T >::end(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), simKBmtfStubs_cfi::maxBX, simKBmtfStubs_cfi::minBX, ValidateTausOnZEEFastSim_cff::proc, and std::swap().

Referenced by MicroGMTConverter::convert_all(), and l1t::stage2::EMTFCollections::~EMTFCollections().

109  {
110  int minBX = cands.getFirstBX();
111  int maxBX = cands.getLastBX();
112  int emtfMinProc = 0; // ME+ sector 1
113  int emtfMaxProc = 11; // ME- sector 6
114 
115  // New collection, sorted by processor to match uGMT unpacked order
116  auto sortedCands = std::make_unique<l1t::RegionalMuonCandBxCollection>();
117  sortedCands->clear();
118  sortedCands->setBXRange(minBX, maxBX);
119  for (int iBX = minBX; iBX <= maxBX; ++iBX) {
120  for (int proc = emtfMinProc; proc <= emtfMaxProc; proc++) {
121  for (l1t::RegionalMuonCandBxCollection::const_iterator cand = cands.begin(iBX); cand != cands.end(iBX);
122  ++cand) {
123  int cand_proc = cand->processor();
124  if (cand->trackFinderType() == l1t::tftype::emtf_neg)
125  cand_proc += 6;
126  if (cand_proc != proc)
127  continue;
128  sortedCands->push_back(iBX, *cand);
129  }
130  }
131  }
132 
133  // Return sorted collection
134  std::swap(cands, *sortedCands);
135  sortedCands.reset();
136  }
const_iterator end(int bx) const
std::vector< RegionalMuonCand >::const_iterator const_iterator
Definition: BXVector.h:18
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
int getFirstBX() const
int getLastBX() const
const_iterator begin(int bx) const
void emtf::sortNtupleByEvent ( const char *  ntuplename,
const char *  filenametosort,
const char *  outputfile 
)

Definition at line 98 of file Utilities.cc.

References f, DeadROC_duringRun::f2, mps_fire::i, and createfilelist::int.

Referenced by numToStr().

98  {
99  //TFile f("../../all_test_redux_post.root");
100  TFile f(filenametosort);
101  TNtuple* tree = (TNtuple*)f.Get(ntuplename);
102  int nentries = (int)tree->GetEntries();
103  //Drawing variable pz with no graphics option.
104  //variable pz stored in array fV1 (see TTree::Draw)
105  tree->Draw("Event", "", "goff");
106  int* index = new int[nentries];
107  //sort array containing pz in decreasing order
108  //The array index contains the entry numbers in decreasing order
109  TMath::Sort(nentries, tree->GetV1(), index);
110 
111  //open new file to store the sorted Tree
112  //TFile f2("../../test_events_sorted.root","recreate");
113  TFile f2(outputfile, "recreate");
114 
115  //Create an empty clone of the original tree
116  TTree* tsorted = (TTree*)tree->CloneTree(0);
117  for (int i = 0; i < nentries; i++) {
118  tree->GetEntry(index[i]);
119  tsorted->Fill();
120  }
121  tsorted->Write();
122  delete[] index;
123 }
double f[11][100]
Definition: tree.py:1

Variable Documentation

int emtf::MAX_ENDCAP = 2
int emtf::MAX_TRIGSECTOR = 6
int emtf::MIN_ENDCAP = 1
int emtf::MIN_TRIGSECTOR = 1
int emtf::NUM_SECTORS = 12

Definition at line 64 of file Common.h.

int emtf::NUM_STATION_PAIRS = 6

Definition at line 72 of file Common.h.

Referenced by AngleCalculation::calculate_angles(), and PtAssignment::process().

int emtf::NUM_STATIONS = 4
int emtf::NUM_ZONE_HITS = 160

Definition at line 68 of file Common.h.

Referenced by PatternRecognition::process_single_zone().

int emtf::NUM_ZONES = 4
const double emtf::ptscale
Initial value:
= {0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0,
8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 35.0, 40.0,
45.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 120.0, 140.0}

Definition at line 29 of file Utilities.cc.

Referenced by L1TGMT::bookHistograms(), and processPrediction().

const std::vector<double> emtf::ptScale

Definition at line 33 of file Utilities.cc.

Referenced by CSCTFPtLUT::CSCTFPtLUT(), and CSCTFTrackProducer::produce().

const double emtf::twoJets_scale
Initial value:
= {
0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 20.0, 50.0, 100, 500, 1000, 5000, 7500, 50000}

Definition at line 36 of file Utilities.cc.

const std::vector< double > emtf::twoJetsScale
Initial value:
=
std::vector<double>(twoJets_scale, twoJets_scale + sizeof twoJets_scale / sizeof twoJets_scale[0])
const double twoJets_scale[16]
Definition: Utilities.cc:36

Definition at line 39 of file Utilities.cc.