Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:38

0001 #ifndef SiStripCommon_SiStripFolderOrganizer_h
0002 #define SiStripCommon_SiStripFolderOrganizer_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     SiStripCommon
0006 // Class  :     SiStripFolderOrganizer
0007 //
0008 /**\class SiStripFolderOrganizer SiStripFolderOrganizer.h DQM/SiStripCommon/interface/SiStripFolderOrganizer.h
0009 
0010  Description: <Organizes the folders for the monitoring elements of the SiStrip Tracker. Its methods return strings with names of folders to be created and used.>
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  dkcira
0018 //         Created:  Thu Jan 26 23:49:46 CET 2006
0019 
0020 //
0021 #include "DataFormats/SiStripDetId/interface/SiStripDetId.h"
0022 #include "DQMServices/Core/interface/DQMStore.h"
0023 
0024 #include <string>
0025 
0026 class TrackerTopology;
0027 class SiStripFolderOrganizer {
0028 public:
0029   typedef dqm::legacy::DQMStore DQMStore;
0030 
0031   static unsigned short const all_ = 65535;
0032 
0033   SiStripFolderOrganizer();
0034   virtual ~SiStripFolderOrganizer();
0035 
0036   // top folder
0037   void setSiStripFolderName(std::string name);
0038   std::string getSiStripFolder();
0039   void setSiStripFolder();
0040 
0041   // control folder
0042   std::string getSiStripTopControlFolder();
0043   void setSiStripTopControlFolder();
0044   std::string getSiStripControlFolder(
0045       // unsigned short crate,
0046       unsigned short slot = all_,
0047       unsigned short ring = all_,
0048       unsigned short addr = all_,
0049       unsigned short chan = all_
0050       // unsigned short i2c
0051   );
0052   void setSiStripControlFolder(
0053       // unsigned short crate,
0054       unsigned short slot = all_,
0055       unsigned short ring = all_,
0056       unsigned short addr = all_,
0057       unsigned short chan = all_
0058       // unsigned short i2c
0059   );
0060 
0061   std::pair<std::string, int32_t> GetSubDetAndLayer(const uint32_t& detid,
0062                                                     const TrackerTopology* tTopo,
0063                                                     bool ring_flag = false);
0064   std::pair<std::string, int32_t> GetSubDetAndLayerThickness(const uint32_t& detid,
0065                                                              const TrackerTopology* tTopo,
0066                                                              std::string& cThickness);
0067   std::pair<std::string, int32_t> GetSubDetAndRing(const uint32_t& detid, const TrackerTopology* tTopo);
0068   // detector folders
0069   void setDetectorFolder(uint32_t rawdetid, const TrackerTopology* tTopo);
0070   void getFolderName(int32_t rawdetid, const TrackerTopology* tTopo, std::string& lokal_folder);
0071 
0072   // layer folders
0073   void setLayerFolder(uint32_t rawdetid, const TrackerTopology* tTopo, int32_t layer = 0, bool ring_flag = false);
0074   void getLayerFolderName(std::stringstream& ss,
0075                           uint32_t rawdetid,
0076                           const TrackerTopology* tTopo,
0077                           bool ring_flag = false);
0078   void getSubDetLayerFolderName(std::stringstream& ss,
0079                                 SiStripDetId::SubDetector subDet,
0080                                 uint32_t layer,
0081                                 uint32_t side = 0);
0082   // ring folder
0083   void setRingFolder(uint32_t rawdetid, const TrackerTopology* tTopo, int32_t layer = 0) {
0084     setLayerFolder(rawdetid, tTopo, layer, true);
0085   }
0086   void getRingFolderName(std::stringstream& ss, uint32_t rawdetid, const TrackerTopology* tTopo) {
0087     getLayerFolderName(ss, rawdetid, tTopo, true);
0088   }
0089   // SubDetector Folder
0090   void getSubDetFolder(const uint32_t& detid, const TrackerTopology* tTopo, std::string& folder_name);
0091   std::pair<const std::string, const char*> getSubDetFolderAndTag(const uint32_t& detid, const TrackerTopology* tTopo);
0092 
0093   SiStripFolderOrganizer(const SiStripFolderOrganizer&) = delete;                   // stop default
0094   const SiStripFolderOrganizer& operator=(const SiStripFolderOrganizer&) = delete;  // stop default
0095 
0096 private:
0097   std::string TopFolderName;
0098   DQMStore* dbe_;
0099 };
0100 #endif