Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:33:52

0001 #ifndef PixelFEDConfig_h
0002 #define PixelFEDConfig_h
0003 /**
0004 *   \file CalibFormats/SiPixelObjects/interface/PixelFEDConfig.h
0005 *   \brief This class implements..
0006 *
0007 *   This class specifies which FED boards
0008 *   are used and how they are addressed
0009 */
0010 
0011 #include <vector>
0012 #include <string>
0013 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0014 #include "CalibFormats/SiPixelObjects/interface/PixelFEDParameters.h"
0015 
0016 namespace pos {
0017   /*!  \ingroup ConfigurationObjects "Configuration Objects"
0018 *    
0019 *  @{
0020 *
0021 *  \class PixelFEDConfig PixelFEDConfig.h
0022 *  \brief This is the documentation about PixelFEDConfig...
0023 *
0024 *  This class specifies which FED boards
0025 *  are used and how they are addressed
0026 */
0027   class PixelFEDConfig : public PixelConfigBase {
0028   public:
0029     PixelFEDConfig(
0030         std::string
0031             filename);  //  <---- Modified for the conversion from parallel vectors to object that contain the configuration
0032 
0033     PixelFEDConfig(std::vector<std::vector<std::string> > &tableMat);
0034 
0035     ~PixelFEDConfig() override;
0036 
0037     unsigned int getNFEDBoards() const;
0038 
0039     unsigned int getFEDNumber(unsigned int i) const;
0040     unsigned int getCrate(unsigned int i) const;
0041     unsigned int getVMEBaseAddress(unsigned int i) const;
0042     unsigned int crateFromFEDNumber(unsigned int fednumber) const;
0043     unsigned int VMEBaseAddressFromFEDNumber(unsigned int fednumber) const;
0044 
0045     unsigned int FEDNumberFromCrateAndVMEBaseAddress(unsigned int crate, unsigned int vmebaseaddress) const;
0046 
0047     void writeASCII(std::string dir) const override;
0048     void writeXML(pos::PixelConfigKey key, int version, std::string path) const override { ; }
0049     void writeXMLHeader(pos::PixelConfigKey key,
0050                         int version,
0051                         std::string path,
0052                         std::ofstream *out,
0053                         std::ofstream *out1 = nullptr,
0054                         std::ofstream *out2 = nullptr) const override;
0055     void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
0056     void writeXMLTrailer(std::ofstream *out,
0057                          std::ofstream *out1 = nullptr,
0058                          std::ofstream *out2 = nullptr) const override;
0059 
0060     //friend std::ostream& operator<<(std::ostream& s, const PixelDetectorconfig& config);
0061 
0062   private:
0063     //Already fixed from parallel vectors to vector of objects .... the object that contains the FED config is PixelFEDParameters
0064 
0065     //    std::vector<unsigned int> fednumber_;
0066     //    std::vector<unsigned int> crate_;
0067     //    std::vector<unsigned int> vmebaseaddress_;
0068 
0069     std::vector<PixelFEDParameters> fedconfig_;
0070   };
0071 }  // namespace pos
0072 /* @} */
0073 #endif