Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef PixelDetectorConfig_h
0002 #define PixelDetectorConfig_h
0003 /**
0004 *   \file CalibFormats/SiPixelObjects/interface/PixelDetectorConfig.h
0005 *   \brief This class specifies which detector components are used in the 
0006 *          configuration (and eventually should specify which  xdaq process 
0007 *          controls which components).
0008 *
0009 *   A longer explanation will be placed here later
0010 */
0011 //
0012 // This class specifies which detector
0013 // components are used in the configuration
0014 // (and eventually should specify which
0015 // xdaq process controlls which components).
0016 //
0017 //
0018 //
0019 //
0020 
0021 #include <vector>
0022 #include <set>
0023 #include <map>
0024 #include <string>
0025 #include "CalibFormats/SiPixelObjects/interface/PixelConfigBase.h"
0026 #include "CalibFormats/SiPixelObjects/interface/PixelModuleName.h"
0027 #include "CalibFormats/SiPixelObjects/interface/PixelHdwAddress.h"
0028 #include "CalibFormats/SiPixelObjects/interface/PixelNameTranslation.h"
0029 #include "CalibFormats/SiPixelObjects/interface/PixelROCStatus.h"
0030 
0031 namespace pos {
0032   /*!  \ingroup ConfigurationObjects "Configuration Objects"
0033 *    
0034 *  @{
0035 *
0036 *  \class PixelDetectorConfig PixelDetectorConfig.h
0037 *  \brief This is the documentation about PixelDetectorConfig...
0038 */
0039   class PixelDetectorConfig : public PixelConfigBase {
0040   public:
0041     PixelDetectorConfig(std::vector<std::vector<std::string> > &tableMat);
0042     PixelDetectorConfig(std::string filename);
0043 
0044     unsigned int getNModules() const;
0045 
0046     PixelModuleName getModule(unsigned int i) const;
0047 
0048     const std::vector<PixelModuleName> &getModuleList() const { return modules_; }
0049 
0050     void addROC(PixelROCName &, std::string statusLabel);
0051     void addROC(PixelROCName &);
0052     void removeROC(PixelROCName &);
0053     const std::map<PixelROCName, PixelROCStatus> &getROCsList() const { return rocs_; };
0054 
0055     void writeASCII(std::string dir = "") const override;
0056     void writeXML(pos::PixelConfigKey key, int version, std::string path) const override;
0057     void writeXMLHeader(pos::PixelConfigKey key,
0058                         int version,
0059                         std::string path,
0060                         std::ofstream *out,
0061                         std::ofstream *out1 = nullptr,
0062                         std::ofstream *out2 = nullptr) const override;
0063     void writeXML(std::ofstream *out, std::ofstream *out1 = nullptr, std::ofstream *out2 = nullptr) const override;
0064     void writeXMLTrailer(std::ofstream *out,
0065                          std::ofstream *out1 = nullptr,
0066                          std::ofstream *out2 = nullptr) const override;
0067 
0068     bool containsModule(const PixelModuleName &moduleToFind) const;
0069 
0070     std::set<unsigned int> getFEDs(PixelNameTranslation *translation) const;
0071     std::map<unsigned int, std::set<unsigned int> > getFEDsAndChannels(PixelNameTranslation *translation) const;
0072 
0073     //friend std::ostream& operator<<(std::ostream& s, const PixelDetectorconfig& config);
0074 
0075   private:
0076     std::vector<PixelModuleName> modules_;
0077 
0078     std::map<PixelROCName, PixelROCStatus> rocs_;
0079   };
0080 }  // namespace pos
0081 /* @} */
0082 #endif