CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 169 of file L1MuDTEtaPattern.cc.

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

169  {
170 
171  s.setf(ios::right,ios::adjustfield);
172  s << "ID = " << setw(8) << p.id() << " "
173  << "quality = " << setw(2) << p.quality() << " "
174  << "eta = " << setw(1) << p.eta() << endl;
175  for (int i = 0; i < 3; i++) {
176  s << "station = " << i+1 << " : ";
177  for (int j = 0; j < 5; j++) {
178  bitset<7> pos;
179  if ( p.m_position[i] && (p.m_wheel[i] == j-2) ) pos.set(p.m_position[i]-1);
180  s << pos << " ";
181  }
182  s << endl;
183  }
184 
185  return s;
186 
187 }
int i
Definition: DBlmapReader.cc:9
int quality() const
return quality
int id() const
return id
int eta() const
return eta
int j
Definition: DBlmapReader.cc:9
istream& operator>> ( istream &  s,
L1MuDTEtaPattern p 
)

Definition at line 193 of file L1MuDTEtaPattern.cc.

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

193  {
194 
195  string pat;
196 
197  s >> p.m_id >> pat >> p.m_qual >> p.m_eta;
198 
199  for ( int i = 0; i < 3; i++ ) {
200  string sub = pat.substr(3*i,3);
201  if ( sub == "___" ) {
202  p.m_wheel[i] = 0;
203  p.m_position[i] = 0;
204  }
205  else {
206  p.m_wheel[i] = atoi(sub.substr(0,2).c_str());
207  p.m_position[i] = atoi(sub.substr(2,1).c_str());
208  }
209  }
210 
211  return s;
212 
213 }
int i
Definition: DBlmapReader.cc:9