ModuleType

PixelModuleName

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
#ifndef SiPixelDetId_PixelModuleName_H
#define SiPixelDetId_PixelModuleName_H

#include <string>
#include <iostream>
#include <cstdint>

/** \class PixelModuleName
 * Base class to Pixel modules naming, provides a name as in PixelDatabase
 */

class PixelModuleName {
public:
  enum ModuleType { v1x2, v1x5, v1x8, v2x3, v2x4, v2x5, v2x8 };

  PixelModuleName(bool isBarrel) : barrel(isBarrel) {}
  virtual ~PixelModuleName() {}

  /// true for barrel modules
  virtual bool isBarrel() const { return barrel; }

  static bool isBarrel(uint32_t rawDetId) { return (1 == ((rawDetId >> 25) & 0x7)); }

  /// associated name
  virtual std::string name() const = 0;

  /// module type
  virtual ModuleType moduleType() const = 0;

  /// check equality of modules
  virtual bool operator==(const PixelModuleName&) const = 0;

private:
  bool barrel;
};

std::ostream& operator<<(std::ostream& out, const PixelModuleName::ModuleType& t);
#endif