CMS 3D CMS Logo

Classes | Typedefs | Functions | Variables
emtf Namespace Reference

Classes

class  AbsoluteDeviation
 
struct  CSCTag
 
struct  Event
 
class  Forest
 
struct  GEMTag
 
class  Huber
 
class  LeastSquares
 
class  LossFunction
 
class  Node
 
class  PercentErrorSquared
 
struct  RPCTag
 
class  Tree
 

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 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)
 
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
 
int PHASE_TWO_GEOMETRY = 0
 
const double ptscale [31]
 
const std::vector< double > ptScale
 
const double twoJets_scale [16]
 
const std::vector< double > twoJetsScale = std::vector<double>(twoJets_scale, twoJets_scale + sizeof twoJets_scale / sizeof twoJets_scale[0])
 

Typedef Documentation

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

Definition at line 66 of file Common.h.

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

Definition at line 68 of file Common.h.

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.

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

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.

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

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 AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), and 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(), AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), l1t::stage2::emtf::ImportRPC(), and l1t::stage2::emtf::ImportSP().

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(), AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), l1t::stage2::emtf::ImportRPC(), and l1t::stage2::emtf::ImportSP().

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().

Referenced by PrimitiveConversion::convert_gem(), and PrimitiveConversion::convert_rpc().

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.

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

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(), AngleCalculation::calculate_angles(), PrimitiveConversion::convert_csc_details(), PrimitiveConversion::convert_gem_details(), PrimitiveConversion::convert_rpc_details(), and l1t::stage2::emtf::ImportRPC().

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().

Referenced by PrimitiveConversion::convert_gem(), and PrimitiveConversion::convert_rpc().

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.

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

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 }
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
void emtf::mergeNtuples ( const char *  ntuplename,
const char *  filestomerge,
const char *  outputfile 
)

Definition at line 90 of file Utilities.cc.

Referenced by numToStr().

91 {
92  TChain chain(ntuplename);
93  chain.Add(filestomerge);
94  chain.Merge(outputfile);
95 }
Definition: chain.py:1
template<typename T >
std::string emtf::numToStr ( T  num)

Definition at line 44 of file Utilities.h.

References mergeNtuples(), pileupDistInMC::num, estimatePileup_makeJSON::outputfile, processPrediction(), alignCSCRings::s, sortNtupleByEvent(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by emtf::Tree::addXMLAttributes().

45 {
46 // Convert a number to a string.
47  std::stringstream ss;
48  ss << num;
49  std::string s = ss.str();
50  return s;
51 };
float emtf::processPrediction ( float  BDTPt,
int  Quality,
float  PrelimFit 
)

Definition at line 50 of file Utilities.cc.

References RPCpg::pts, and ptscale.

Referenced by numToStr().

51 {
52 // Discretize and scale the BDTPt prediction
53 
54 
55  // Fix terrible predictions
56  if(BDTPt < 0) BDTPt = PrelimFit;
57  if(BDTPt > 250) BDTPt = PrelimFit;
58 
59  float BDTPt1 = BDTPt;
60  float scaleF = 1.0;
61 
62  // Scale based upon quality
63  if (Quality == 3) scaleF = 1.15;
64  if (Quality == 2) scaleF = 1.3;
65  if (Quality == 1) scaleF = 1.7;
66 
67  BDTPt1 = scaleF*BDTPt1;
68 
69 
70  // Discretize based upon ptscale
71  for (int pts=0; pts<31; pts++)
72  {
73  if (ptscale[pts]<=BDTPt1 && ptscale[pts+1]>BDTPt1)
74  {
75  BDTPt1 = ptscale[pts];
76  break;
77  }
78  }
79 
80  if (BDTPt1 > 140) BDTPt1 = 140;
81  if (BDTPt1 < 0) BDTPt1 = 0;
82 
83  return BDTPt1;
84 }
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

Definition at line 55 of file TrackTools.h.

References constexpr, and M_PI.

Referenced by calc_phi_glob_rad(), calc_theta_deg(), PrimitiveConversion::convert_csc(), PrimitiveConversion::convert_gem(), PrimitiveConversion::convert_rpc(), RecHitProcessor::process(), and RecHitProcessor::processLook().

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
template<class bidiiter >
bidiiter emtf::shuffle ( bidiiter  begin,
bidiiter  end,
size_t  num_random 
)

Definition at line 27 of file Utilities.h.

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

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

28 {
29 // We will end up with the same elements in the collection except that
30 // the first num_random elements will be randomized.
31 
32  size_t left = std::distance(begin, end);
33  while (num_random--) {
34  bidiiter r = begin;
35  std::advance(r, rand()%left);
36  std::swap(*begin, *r);
37  ++begin;
38  --left;
39  }
40  return begin;
41 }
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:442
void emtf::sort_uGMT_muons ( l1t::RegionalMuonCandBxCollection cands)

Definition at line 118 of file MicroGMTConverter.cc.

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

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

120  {
121 
122  int minBX = cands.getFirstBX();
123  int maxBX = cands.getLastBX();
124  int emtfMinProc = 0; // ME+ sector 1
125  int emtfMaxProc = 11; // ME- sector 6
126 
127  // New collection, sorted by processor to match uGMT unpacked order
128  auto sortedCands = std::make_unique<l1t::RegionalMuonCandBxCollection>();
129  sortedCands->clear();
130  sortedCands->setBXRange(minBX, maxBX);
131  for (int iBX = minBX; iBX <= maxBX; ++iBX) {
132  for (int proc = emtfMinProc; proc <= emtfMaxProc; proc++) {
133  for (l1t::RegionalMuonCandBxCollection::const_iterator cand = cands.begin(iBX); cand != cands.end(iBX); ++cand) {
134  int cand_proc = cand->processor();
135  if (cand->trackFinderType() == l1t::tftype::emtf_neg) cand_proc += 6;
136  if (cand_proc != proc) continue;
137  sortedCands->push_back(iBX, *cand);
138  }
139  }
140  }
141 
142  // Return sorted collection
143  std::swap(cands, *sortedCands);
144  sortedCands.reset();
145 }
const_iterator end(int bx) const
TrainProcessor *const proc
Definition: MVATrainer.cc:101
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
int getFirstBX() const
int getLastBX() const
const_iterator begin(int bx) const
std::vector< RegionalMuonCand >::const_iterator const_iterator
Definition: BXVector.h:20
void emtf::sortNtupleByEvent ( const char *  ntuplename,
const char *  filenametosort,
const char *  outputfile 
)

Definition at line 101 of file Utilities.cc.

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

Referenced by numToStr().

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

int emtf::NUM_STATION_PAIRS = 6

Definition at line 62 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 58 of file Common.h.

Referenced by PatternRecognition::process_single_zone().

int emtf::NUM_ZONES = 4
int emtf::PHASE_TWO_GEOMETRY = 0

Definition at line 45 of file Common.h.

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 35 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 38 of file Utilities.cc.

const std::vector< double > emtf::twoJetsScale = std::vector<double>(twoJets_scale, twoJets_scale + sizeof twoJets_scale / sizeof twoJets_scale[0])

Definition at line 42 of file Utilities.cc.