CMS 3D CMS Logo

Functions

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/CondFormats/L1TObjects/src/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.

                                                           {

  s.setf(ios::right,ios::adjustfield);
  s << "ID = " << setw(8) << p.id() << "  " 
    << "quality = "  << setw(2) << p.quality()  << "  " 
    << "eta = " << setw(1) << p.eta() << endl;
    for (int i = 0; i < 3; i++) {
      s << "station = " << i+1 << " : ";
      for (int j = 0; j < 5; j++) {
        bitset<7> pos;
        if ( p.m_position[i] && (p.m_wheel[i] == j-2) ) pos.set(p.m_position[i]-1);
        s <<  pos << " ";
      }
      s << endl;
    }    

  return s;

}
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.

                                                     {

  string pat;

  s >> p.m_id >> pat >> p.m_qual >> p.m_eta;

  for ( int i = 0; i < 3; i++ ) {
    string sub = pat.substr(3*i,3);
    if ( sub == "___" ) {
      p.m_wheel[i] = 0;
      p.m_position[i] = 0;
    }
    else {
      p.m_wheel[i] = atoi(sub.substr(0,2).c_str());
      p.m_position[i] = atoi(sub.substr(2,1).c_str());
    }
  }

  return s;

}