Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:36

0001 #ifndef SIPIXELMODULESTATUS_h
0002 #define SIPIXELMODULESTATUS_h
0003 
0004 #include "CalibTracker/SiPixelQuality/interface/SiPixelRocStatus.h"
0005 #include "DataFormats/SiPixelDetId/interface/PixelFEDChannel.h"
0006 
0007 #include <vector>
0008 
0009 // ----------------------------------------------------------------------
0010 class SiPixelModuleStatus {
0011 public:
0012   SiPixelModuleStatus(int det = 0, int nrocs = 16);  // default for Phase-1
0013   ~SiPixelModuleStatus();
0014 
0015   /// fill digi
0016   void fillDIGI(int iroc);
0017   /// fill FEDerror25
0018   void fillFEDerror25(PixelFEDChannel ch);
0019 
0020   /// update digi (nhit > 1)
0021   void updateDIGI(int iroc, unsigned int nhit);
0022   /// update FEDerror25
0023   void updateFEDerror25(int iroc, bool FEDerror25);
0024 
0025   /// return ROC status (= hits on ROC iroc)
0026   unsigned int digiOccROC(int iroc);
0027 
0028   /// return ROC FEDerror25
0029   bool fedError25(int iroc);
0030 
0031   /// return module status (= hits on module)
0032   unsigned int digiOccMOD();
0033 
0034   /// get a ROC
0035   SiPixelRocStatus* getRoc(int i);
0036 
0037   /// accessors and setters
0038   int detid();
0039   int nrocs();
0040   void setDetId(int detid);
0041   void setNrocs(int iroc);
0042 
0043   /// calculate (averaged over this module's ROCs) mean hit number and its sigma
0044   double perRocDigiOcc();
0045   double perRocDigiOccVar();
0046 
0047   /// combine new data to update(topup) module status
0048   void updateModuleDIGI(int roc, unsigned int nhits);
0049   void updateModuleStatus(SiPixelModuleStatus newData);
0050 
0051 private:
0052   int fDetid_, fNrocs_;
0053   std::vector<SiPixelRocStatus> fRocs_;
0054 };
0055 
0056 #endif