Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-13 22:59:45

0001 #ifndef CalibFormats_SiStripObjects_SiStripDetInfo_h
0002 #define CalibFormats_SiStripObjects_SiStripDetInfo_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     CalibFormats/SiStripObjects
0006 // Class  :     SiStripDetInfo
0007 //
0008 /**\class SiStripDetInfo SiStripDetInfo.h "SiStripDetInfo.h"
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Christopher Jones
0018 //         Created:  Fri, 28 May 2021 20:02:00 GMT
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 #include <map>
0025 #include <vector>
0026 #include <cstdint>
0027 // forward declarations
0028 
0029 class SiStripDetInfo {
0030 public:
0031   struct DetInfo {
0032     DetInfo(){};
0033     DetInfo(unsigned short _nApvs, double _stripLength, float _thickness)
0034         : nApvs(_nApvs), stripLength(_stripLength), thickness(_thickness){};
0035 
0036     unsigned short nApvs;
0037     double stripLength;
0038     float thickness;
0039   };
0040 
0041   SiStripDetInfo(std::map<uint32_t, DetInfo> iDetData, std::vector<uint32_t> iIDs) noexcept
0042       : detData_{std::move(iDetData)}, detIds_{std::move(iIDs)} {}
0043 
0044   SiStripDetInfo() = default;
0045   ~SiStripDetInfo() = default;
0046 
0047   SiStripDetInfo(const SiStripDetInfo&) = default;
0048   SiStripDetInfo& operator=(const SiStripDetInfo&) = default;
0049   SiStripDetInfo(SiStripDetInfo&&) = default;
0050   SiStripDetInfo& operator=(SiStripDetInfo&&) = default;
0051 
0052   // ---------- const member functions ---------------------
0053   const std::vector<uint32_t>& getAllDetIds() const noexcept { return detIds_; }
0054 
0055   const std::pair<unsigned short, double> getNumberOfApvsAndStripLength(uint32_t detId) const;
0056 
0057   const float& getThickness(uint32_t detId) const;
0058 
0059   const std::map<uint32_t, DetInfo>& getAllData() const noexcept { return detData_; }
0060 
0061   // ---------- static member functions --------------------
0062 
0063   // ---------- member functions ---------------------------
0064 
0065 private:
0066   // ---------- member data --------------------------------
0067   std::map<uint32_t, DetInfo> detData_;
0068   std::vector<uint32_t> detIds_;
0069 };
0070 
0071 #endif