Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:33

0001 //---------------------------------------------------
0002 
0003 // Author : Freya.Blekman@cern.ch
0004 // Name   : SiPixelCalibConfiguration
0005 
0006 //---------------------------------------------------
0007 
0008 #ifndef SiPixelCalibConfiguration_H
0009 #define SiPixelCalibConfiguration_H
0010 
0011 #include "CondFormats/Serialization/interface/Serializable.h"
0012 
0013 #include <iostream>
0014 #include <string>
0015 #include <vector>
0016 #include <cstdint>
0017 #include "CalibFormats/SiPixelObjects/interface/PixelCalibConfiguration.h"
0018 
0019 class SiPixelCalibConfiguration {
0020 public:
0021   SiPixelCalibConfiguration() { ; }
0022   SiPixelCalibConfiguration(const pos::PixelCalibConfiguration &fancyConfig);
0023 
0024   virtual ~SiPixelCalibConfiguration() { ; }
0025 
0026   //-- Setter/Getter
0027 
0028   short getNTriggers() const { return fNTriggers; }
0029   void setNTriggers(const short &in) { fNTriggers = in; }
0030 
0031   std::vector<short> getRowPattern() const { return fRowPattern; }
0032   void setRowPattern(const std::vector<short> &in) { fRowPattern = in; }
0033 
0034   std::vector<short> getColumnPattern() const { return fColumnPattern; }
0035   void setColumnPattern(const std::vector<short> &in) { fColumnPattern = in; }
0036 
0037   void setCalibrationMode(const std::string &in) { fMode = in; }
0038   std::string getCalibrationMode() const { return fMode; }
0039 
0040   const std::vector<short> getVCalValues() const { return fVCalValues; }
0041   void setVCalValues(const std::vector<short> &in) { fVCalValues = in; }
0042 
0043   // interface with calibration analyzers:
0044   short vcalForEvent(const uint32_t &eventnumber) const;
0045   short vcalIndexForEvent(const uint32_t &eventnumber) const;
0046   std::vector<short> columnPatternForEvent(const uint32_t &eventnumber) const;
0047   std::vector<short> rowPatternForEvent(const uint32_t &eventnumber) const;
0048   uint32_t nextPatternChangeForEvent(const uint32_t &eventnumber) const;
0049   uint32_t expectedTotalEvents() const;
0050   uint32_t patternSize() const { return fNTriggers * fVCalValues.size(); }
0051   uint32_t nPatterns() const { return nRowPatterns() * nColumnPatterns(); }
0052   uint32_t nColumnPatterns() const;
0053   uint32_t nRowPatterns() const;
0054   uint32_t nVCal() const { return fVCalValues.size(); }
0055 
0056 private:
0057   short fNTriggers;                   //
0058   std::vector<short> fRowPattern;     //
0059   std::vector<short> fColumnPattern;  //
0060   std::vector<short> fVCalValues;     //
0061   std::string fMode;
0062 
0063   COND_SERIALIZABLE;
0064 };
0065 
0066 #endif