Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:23

0001 #ifndef PixelTrimBase_h
0002 #define PixelTrimBase_h
0003 /**
0004 * \file CalibFormats/SiPixelObjects/interface/PixelTrimBase.h
0005 * \brief This class provides a base class for the pixel trim data for the pixel FEC configuration
0006 * 
0007 *  This is a pure interface (abstract class) that
0008 *  needs to have an implementation.
0009 * 
0010 *  Need to figure out what is 'VMEcommand' below! 
0011 * 
0012 *  All applications should just use this 
0013 *  interface and not care about the specific
0014 *  implementation
0015 *
0016 */
0017 
0018 #include <string>
0019 #include "CalibFormats/SiPixelObjects/interface/PixelTrimOverrideBase.h"
0020 #include "CalibFormats/SiPixelObjects/interface/PixelTrimBase.h"
0021 #include "CalibFormats/SiPixelObjects/interface/PixelROCTrimBits.h"
0022 #include "CalibFormats/SiPixelObjects/interface/PixelROCName.h"
0023 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0024 #include "CalibFormats/SiPixelObjects/interface/PixelFECConfigInterface.h"
0025 
0026 namespace pos {
0027   /*!  \defgroup TrimObjects "Trim Objects"
0028 *    \ingroup ConfigurationObjects "Configuration Objects"
0029 *    
0030 *  @{
0031 *
0032 *  \class PixelTrimBase PixelTrimBase.h
0033 *  \brief This class provides a base class for the pixel trim data for the pixel FEC configuration
0034 *
0035 *  This is a pure interface (abstract class) that
0036 *  needs to have an implementation.
0037 * 
0038 *  Need to figure out what is 'VMEcommand' below! 
0039 * 
0040 *  All applications should just use this 
0041 *  interface and not care about the specific
0042 *  implementation
0043 *
0044 */
0045   class PixelTrimBase : public PixelConfigBase {
0046   public:
0047     PixelTrimBase(std::string description, std::string creator, std::string date);
0048 
0049     ~PixelTrimBase() override;
0050 
0051     void setOverride(PixelTrimOverrideBase* trimOverride);
0052 
0053     //Build the commands needed to configure ROCs
0054     //on control link
0055 
0056     virtual void generateConfiguration(PixelFECConfigInterface* pixelFEC,
0057                                        PixelNameTranslation* trans,
0058                                        const PixelMaskBase& pixelMask) const = 0;
0059     virtual void writeBinary(std::string filename) const = 0;
0060 
0061     void writeASCII(std::string filename) const override = 0;
0062     void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
0063     void writeXMLHeader(pos::PixelConfigKey key,
0064                         int version,
0065                         std::string path,
0066                         std::ofstream* out,
0067                         std::ofstream* out1 = nullptr,
0068                         std::ofstream* out2 = nullptr) const override {
0069       ;
0070     }
0071     void writeXML(std::ofstream* out, std::ofstream* out1 = nullptr, std::ofstream* out2 = nullptr) const override { ; }
0072     void writeXMLTrailer(std::ofstream* out,
0073                          std::ofstream* out1 = nullptr,
0074                          std::ofstream* out2 = nullptr) const override {
0075       ;
0076     }
0077 
0078     virtual PixelROCTrimBits getTrimBits(int ROCId) const = 0;
0079 
0080     virtual PixelROCTrimBits* getTrimBits(PixelROCName name) = 0;
0081 
0082     friend std::ostream& operator<<(std::ostream& s, const PixelTrimBase& mask);
0083 
0084   private:
0085     PixelTrimOverrideBase* trimOverride_;
0086   };
0087 }  // namespace pos
0088 /* @} */
0089 #endif