SiPixelModuleStatus

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

#include "CalibTracker/SiPixelQuality/interface/SiPixelRocStatus.h"
#include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"

#include <vector>

// ----------------------------------------------------------------------
class SiPixelModuleStatus {
public:
  SiPixelModuleStatus(int det = 0, int nrocs = 16);  // default for Phase-1
  ~SiPixelModuleStatus();

  /// fill digi
  void fillDIGI(int iroc);
  /// fill FEDerror25
  void fillFEDerror25(PixelFEDChannel ch);

  /// update digi (nhit > 1)
  void updateDIGI(int iroc, unsigned int nhit);
  /// update FEDerror25
  void updateFEDerror25(int iroc, bool FEDerror25);

  /// return ROC status (= hits on ROC iroc)
  unsigned int digiOccROC(int iroc);

  /// return ROC FEDerror25
  bool fedError25(int iroc);

  /// return module status (= hits on module)
  unsigned int digiOccMOD();

  /// get a ROC
  SiPixelRocStatus* getRoc(int i);

  /// accessors and setters
  int detid();
  int nrocs();
  void setDetId(int detid);
  void setNrocs(int iroc);

  /// calculate (averaged over this module's ROCs) mean hit number and its sigma
  double perRocDigiOcc();
  double perRocDigiOccVar();

  /// combine new data to update(topup) module status
  void updateModuleDIGI(int roc, unsigned int nhits);
  void updateModuleStatus(SiPixelModuleStatus newData);

private:
  int fDetid_, fNrocs_;
  std::vector<SiPixelRocStatus> fRocs_;
};

#endif