Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-23 04:29:04

0001 #ifndef MTDCommonData_MTDBaseNumber_h
0002 #define MTDCommonData_MTDBaseNumber_h
0003 
0004 /** \class MTDBaseNumber
0005  *   
0006  * Cloned from the EcalBaseNumber class
0007  */
0008 
0009 #include <vector>
0010 #include <string>
0011 
0012 #include "FWCore/Utilities/interface/Exception.h"
0013 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0014 
0015 class MTDBaseNumber {
0016 public:
0017   MTDBaseNumber();
0018   MTDBaseNumber(const MTDBaseNumber& aBaseNumber);
0019   ~MTDBaseNumber() {}
0020 
0021   void setSize(const int size);
0022   void addLevel(const std::string_view name, const int copyNumber);
0023 
0024   int getLevels() const;
0025   int getCopyNumber(int level) const;
0026   int getCopyNumber(const std::string_view levelName) const;
0027   std::string_view const& getLevelName(int level) const;
0028   int getCapacity();
0029 
0030   void reset();
0031 
0032 protected:
0033   static constexpr int MAXLEVEL = 20;
0034 
0035   std::vector<std::string_view> _sortedName;
0036   std::vector<int> _sortedCopyNumber;
0037   int _theLevels;
0038 };
0039 
0040 #endif