Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-04 02:02:17

0001 #ifndef DTRangeT0_H
0002 #define DTRangeT0_H
0003 /** \class DTRangeT0
0004  *
0005  *  Description:
0006  *       Class to hold drift tubes T0 range
0007  *             ( SL by SL min - max T0 )
0008  *
0009  *  \author Paolo Ronchese INFN Padova
0010  *
0011  */
0012 
0013 //----------------------
0014 // Base Class Headers --
0015 //----------------------
0016 
0017 //------------------------------------
0018 // Collaborating Class Declarations --
0019 //------------------------------------
0020 #include "CondFormats/Serialization/interface/Serializable.h"
0021 
0022 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0023 #include "FWCore/Utilities/interface/ConstRespectingPtr.h"
0024 
0025 //---------------
0026 // C++ Headers --
0027 //---------------
0028 #include <string>
0029 #include <vector>
0030 #include <utility>
0031 
0032 template <class Key, class Content>
0033 class DTBufferTree;
0034 
0035 //              ---------------------
0036 //              -- Class Interface --
0037 //              ---------------------
0038 
0039 class DTRangeT0Id {
0040 public:
0041   DTRangeT0Id();
0042   ~DTRangeT0Id();
0043 
0044   int wheelId;
0045   int stationId;
0046   int sectorId;
0047   int slId;
0048 
0049   COND_SERIALIZABLE;
0050 };
0051 
0052 class DTRangeT0Data {
0053 public:
0054   DTRangeT0Data();
0055   ~DTRangeT0Data();
0056 
0057   int t0min;
0058   int t0max;
0059 
0060   COND_SERIALIZABLE;
0061 };
0062 
0063 class DTRangeT0 {
0064 public:
0065   /** Constructor
0066    */
0067   DTRangeT0();
0068   DTRangeT0(DTRangeT0 const&) = delete;
0069   DTRangeT0& operator=(DTRangeT0 const&) = delete;
0070   DTRangeT0(const std::string& version);
0071 
0072   /** Destructor
0073    */
0074   ~DTRangeT0();
0075 
0076   /** Operations
0077    */
0078   /// get content
0079   int slRangeT0(int wheelId, int stationId, int sectorId, int slId, int& t0min, int& t0max) const {
0080     return get(wheelId, stationId, sectorId, slId, t0min, t0max);
0081   };
0082   int slRangeT0(const DTSuperLayerId& id, int& t0min, int& t0max) const { return get(id, t0min, t0max); };
0083   int get(int wheelId, int stationId, int sectorId, int slId, int& t0min, int& t0max) const;
0084   int get(const DTSuperLayerId& id, int& t0min, int& t0max) const;
0085 
0086   /// access version
0087   const std::string& version() const;
0088   std::string& version();
0089 
0090   /// reset content
0091   void clear();
0092 
0093   int setSLRangeT0(int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max) {
0094     return set(wheelId, stationId, sectorId, slId, t0min, t0max);
0095   };
0096   int setSLRangeT0(const DTSuperLayerId& id, int t0min, int t0max) { return set(id, t0min, t0max); };
0097   int set(int wheelId, int stationId, int sectorId, int slId, int t0min, int t0max);
0098   int set(const DTSuperLayerId& id, int t0min, int t0max);
0099 
0100   /// Access methods to data
0101   typedef std::vector<std::pair<DTRangeT0Id, DTRangeT0Data> >::const_iterator const_iterator;
0102   const_iterator begin() const;
0103   const_iterator end() const;
0104 
0105   void initialize();
0106 
0107 private:
0108   std::string dataVersion;
0109 
0110   std::vector<std::pair<DTRangeT0Id, DTRangeT0Data> > dataList;
0111 
0112   DTBufferTree<int, int>* dBuf COND_TRANSIENT;
0113 
0114   /// read and store full content
0115   std::string mapName() const;
0116 
0117   COND_SERIALIZABLE;
0118 };
0119 #endif  // DTRangeT0_H