L1MuBMTrackSegPhi

TSQuality

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
//-------------------------------------------------
//
/**  \class L1MuBMTrackSegPhi
 *
 *   PHI Track Segment
 *
 *
 *
 *   N. Neumeister            CERN EP
 */
//
//--------------------------------------------------
#ifndef L1MUBM_TRACK_SEG_PHI_H
#define L1MUBM_TRACK_SEG_PHI_H

//---------------
// C++ Headers --
//---------------

#include <iosfwd>
#include <vector>

//----------------------
// Base Class Headers --
//----------------------

//------------------------------------
// Collaborating Class Declarations --
//------------------------------------

#include "DataFormats/L1TMuon/interface/BMTF/L1MuBMTrackSegLoc.h"

//              ---------------------
//              -- Class Interface --
//              ---------------------

class L1MuBMTrackSegPhi;

typedef std::vector<L1MuBMTrackSegPhi> L1MuBMTrackSegPhiCollection;

class L1MuBMTrackSegPhi {
public:
  /// quality code of BBMX phi track segments
  enum TSQuality { Li, Lo, Hi, Ho, LL, HL, HH, Null };

  /// default constructor
  L1MuBMTrackSegPhi();

  /// constructor
  L1MuBMTrackSegPhi(int wheel_id,
                    int sector_id,
                    int station_id,
                    int phi = 0,
                    int phib = 0,
                    TSQuality quality = Null,
                    bool tag = false,
                    int bx = 17,
                    bool etaFlag = false);

  /// constructor
  L1MuBMTrackSegPhi(const L1MuBMTrackSegLoc&,
                    int phi = 0,
                    int phib = 0,
                    TSQuality quality = Null,
                    bool tag = false,
                    int bx = 17,
                    bool etaFlag = false);

  /// copy constructor
  L1MuBMTrackSegPhi(const L1MuBMTrackSegPhi&) = default;

  /// move constructor
  L1MuBMTrackSegPhi(L1MuBMTrackSegPhi&&) = default;

  /// destructor
  virtual ~L1MuBMTrackSegPhi();

  /// reset phi track segment
  void reset();

  /// return phi-value in global coordinates [0,2pi]
  double phiValue() const;

  /// return phib-value in global coordinates [0,2pi]
  double phibValue() const;

  /// return wheel
  inline int wheel() const { return m_location.wheel(); }

  /// return sector
  inline int sector() const { return m_location.sector(); }

  /// return station
  inline int station() const { return m_location.station(); }

  /// return location of phi track segment
  inline const L1MuBMTrackSegLoc& where() const { return m_location; }

  /// return phi
  inline int phi() const { return m_phi; }

  /// return phib
  inline int phib() const { return m_phib; }

  /// return quality code
  inline int quality() const { return m_quality; }

  /// return tag (second TS tag)
  inline int tag() const { return m_tag; }

  /// return bunch crossing
  inline int bx() const { return m_bx; }

  /// return eta flag
  inline bool etaFlag() const { return m_etaFlag; }

  /// is it an empty phi track segment?
  inline bool empty() const { return m_quality == Null; }

  /// set eta flag
  inline void setEtaFlag(bool flag) { m_etaFlag = flag; }

  /// assignment operator
  L1MuBMTrackSegPhi& operator=(const L1MuBMTrackSegPhi&) = default;

  /// move assignment operator
  L1MuBMTrackSegPhi& operator=(L1MuBMTrackSegPhi&&) = default;

  /// equal operator
  bool operator==(const L1MuBMTrackSegPhi&) const;

  /// unequal operator
  bool operator!=(const L1MuBMTrackSegPhi&) const;

  /// overload output stream operator for phi track segment quality
  friend std::ostream& operator<<(std::ostream&, const TSQuality&);

  /// overload output stream operator for phi track segments
  friend std::ostream& operator<<(std::ostream&, const L1MuBMTrackSegPhi&);

private:
  L1MuBMTrackSegLoc m_location;  // logical location of TS
  int m_phi;                     // 12 bits
  int m_phib;                    // 10 bits
  TSQuality m_quality;           // 3 bits
  bool m_tag;                    // tag for second TS (of chamber)
  int m_bx;                      // bunch crossing identifier
  bool m_etaFlag;                // eta flag (for overlap region)
};

#endif