CMS 3D CMS Logo

TTMuonTriggerPrimitive.cc
Go to the documentation of this file.
2 
3 #include <iostream>
4 
5 using namespace L1TMuon;
6 
7 namespace {
8  const char subsystem_names[][3] = {"TT"};
9 }
10 
11 // Constructor from track trigger digi
13  _id(detid),
14  _subsystem(kTT) {
16 
17  const MeasurementPoint& mp = digi.getClusterRef(0)->findAverageLocalCoordinatesCentered();
18  _data.row_f = mp.x();
19  _data.col_f = mp.y();
20  _data.bend = digi.getTriggerBend();
21  _data.bx = 0;
22 }
23 
24 // Copy constructor
26  _data(tp._data),
27  _id(tp._id),
31  _eta(tp._eta),
32  _phi(tp._phi),
33  _rho(tp._rho),
34  _theta(tp._theta){
35 }
36 
37 // Assignment operator
39  this->_data = tp._data;
40  this->_id = tp._id;
41  this->_subsystem = tp._subsystem;
42  this->_globalsector = tp._globalsector;
43  this->_subsector = tp._subsector;
44  this->_eta = tp._eta;
45  this->_phi = tp._phi;
46  this->_rho = tp._rho;
47  this->_theta = tp._theta;
48  return *this;
49 }
50 
51 // Equality operator
53  return ( static_cast<int>(this->_data.row_f) == static_cast<int>(tp._data.row_f) &&
54  static_cast<int>(this->_data.col_f) == static_cast<int>(tp._data.col_f) &&
55  this->_data.bend == tp._data.bend &&
56  this->_data.bx == tp._data.bx &&
57  this->_id == tp._id &&
58  this->_subsystem == tp._subsystem &&
59  this->_globalsector == tp._globalsector &&
60  this->_subsector == tp._subsector );
61 }
62 
63 const int TTTriggerPrimitive::getBX() const {
64  switch(_subsystem) {
65  case kTT:
66  return _data.bx;
67  default:
68  throw cms::Exception("Invalid Subsytem")
69  << "The specified subsystem for this track stub is out of range"
70  << std::endl;
71  }
72  return -1;
73 }
74 
75 const int TTTriggerPrimitive::getStrip() const {
76  switch(_subsystem) {
77  case kTT:
78  return static_cast<int>(_data.row_f);
79  default:
80  throw cms::Exception("Invalid Subsytem")
81  << "The specified subsystem for this track stub is out of range"
82  << std::endl;
83  }
84  return -1;
85 }
86 
87 const int TTTriggerPrimitive::getSegment() const {
88  switch(_subsystem) {
89  case kTT:
90  return static_cast<int>(_data.col_f);
91  default:
92  throw cms::Exception("Invalid Subsytem")
93  << "The specified subsystem for this track stub is out of range"
94  << std::endl;
95  }
96  return -1;
97 }
98 
99 const int TTTriggerPrimitive::getBend() const {
100  switch(_subsystem) {
101  case kTT:
102  return static_cast<int>(_data.bend);
103  default:
104  throw cms::Exception("Invalid Subsytem")
105  << "The specified subsystem for this track stub is out of range"
106  << std::endl;
107  }
108  return -1;
109 }
110 
112  unsigned& globalsector,
113  unsigned& subsector ) {
114  globalsector = 0;
115  subsector = 0;
116 }
117 
118 std::ostream& operator<<(std::ostream& os, const TTTriggerPrimitive::TTDetId& detid) {
119  // Note that there is no endl to end the output
120  os << " undefined";
121  return os;
122 }
123 
124 void TTTriggerPrimitive::print(std::ostream& out) const {
125  unsigned idx = (unsigned) _subsystem;
126  out << subsystem_names[idx] << " Trigger Primitive" << std::endl;
127  out << "eta: " << _eta << " phi: " << _phi << " rho: " << _rho
128  << " bend: " << _theta << std::endl;
129  switch(_subsystem) {
130  case kTT:
131  out << detId() << std::endl;
132  out << "Strip : " << static_cast<int>(_data.row_f) << std::endl;
133  out << "Segment : " << static_cast<int>(_data.col_f) << std::endl;
134  out << "Bend : " << _data.bend << std::endl;
135  out << "BX : " << _data.bx << std::endl;
136  break;
137  default:
138  throw cms::Exception("Invalid Subsytem")
139  << "The specified subsystem for this track stub is out of range"
140  << std::endl;
141  }
142 }
T y() const
Definition: PV2DBase.h:46
void calculateTTGlobalSector(const TTDetId &detid, unsigned &globalsector, unsigned &subsector)
TTTriggerPrimitive & operator=(const TTTriggerPrimitive &tp)
std::ostream & operator<<(std::ostream &os, const TTTriggerPrimitive::TTDetId &detid)
bool operator==(const TTTriggerPrimitive &tp) const
double getTriggerBend() const
In FULL-STRIP units!
Definition: TTStub.h:159
Class to store the L1 Track Trigger stubs.
Definition: TTStub.h:22
void print(std::ostream &) const
Definition: DetId.h:18
T x() const
Definition: PV2DBase.h:45
const edm::Ref< edmNew::DetSetVector< TTCluster< T > >, TTCluster< T > > & getClusterRef(unsigned int hitIdentifier) const
Clusters composing the Stub.
Definition: TTStub.h:116