CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
L1MuDTEtaPattern.cc File Reference
#include "CondFormats/L1TObjects/interface/L1MuDTEtaPattern.h"
#include <iostream>
#include <iomanip>
#include <bitset>
#include <cstdlib>

Go to the source code of this file.

Functions

ostream & operator<< (ostream &s, const L1MuDTEtaPattern &p)
 
istream & operator>> (istream &s, L1MuDTEtaPattern &p)
 

Function Documentation

ostream& operator<< ( ostream &  s,
const L1MuDTEtaPattern p 
)

Definition at line 154 of file L1MuDTEtaPattern.cc.

References L1MuDTEtaPattern::eta(), mps_fire::i, L1MuDTEtaPattern::id(), dqmiolumiharvest::j, L1MuDTEtaPattern::m_position, L1MuDTEtaPattern::m_wheel, L1MuDTEtaPattern::quality(), and alignCSCRings::s.

154  {
155  s.setf(ios::right, ios::adjustfield);
156  s << "ID = " << setw(8) << p.id() << " "
157  << "quality = " << setw(2) << p.quality() << " "
158  << "eta = " << setw(1) << p.eta() << endl;
159  for (int i = 0; i < 3; i++) {
160  s << "station = " << i + 1 << " : ";
161  for (int j = 0; j < 5; j++) {
162  bitset<7> pos;
163  if (p.m_position[i] && (p.m_wheel[i] == j - 2))
164  pos.set(p.m_position[i] - 1);
165  s << pos << " ";
166  }
167  s << endl;
168  }
169 
170  return s;
171 }
int quality() const
return quality
int id() const
return id
int eta() const
return eta
istream& operator>> ( istream &  s,
L1MuDTEtaPattern p 
)

Definition at line 176 of file L1MuDTEtaPattern.cc.

References mps_fire::i, L1MuDTEtaPattern::m_eta, L1MuDTEtaPattern::m_id, L1MuDTEtaPattern::m_position, L1MuDTEtaPattern::m_qual, L1MuDTEtaPattern::m_wheel, and alignCSCRings::s.

176  {
177  string pat;
178 
179  s >> p.m_id >> pat >> p.m_qual >> p.m_eta;
180 
181  for (int i = 0; i < 3; i++) {
182  string sub = pat.substr(3 * i, 3);
183  if (sub == "___") {
184  p.m_wheel[i] = 0;
185  p.m_position[i] = 0;
186  } else {
187  p.m_wheel[i] = atoi(sub.substr(0, 2).c_str());
188  p.m_position[i] = atoi(sub.substr(2, 1).c_str());
189  }
190  }
191 
192  return s;
193 }