Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:37:00

0001 #ifndef DTTPGParameters_H
0002 #define DTTPGParameters_H
0003 /** \class DTTPGParameters
0004  *
0005  *  Description:
0006  *       Class to hold drift tubes TPG parameters
0007  *
0008  *  \author Paolo Ronchese INFN Padova
0009  *
0010  */
0011 
0012 //----------------------
0013 // Base Class Headers --
0014 //----------------------
0015 
0016 //------------------------------------
0017 // Collaborating Class Declarations --
0018 //------------------------------------
0019 #include "CondFormats/Serialization/interface/Serializable.h"
0020 
0021 #include "CondFormats/DTObjects/interface/DTTimeUnits.h"
0022 #include "DataFormats/MuonDetId/interface/DTChamberId.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 DTTPGParametersId {
0040 public:
0041   DTTPGParametersId();
0042   ~DTTPGParametersId();
0043 
0044   int wheelId;
0045   int stationId;
0046   int sectorId;
0047 
0048   COND_SERIALIZABLE;
0049 };
0050 
0051 class DTTPGParametersData {
0052 public:
0053   DTTPGParametersData();
0054   ~DTTPGParametersData();
0055 
0056   int nClock;
0057   float tPhase;
0058 
0059   COND_SERIALIZABLE;
0060 };
0061 
0062 class DTTPGParameters {
0063 public:
0064   /** Constructor
0065    */
0066   DTTPGParameters();
0067   DTTPGParameters(DTTPGParameters const&) = delete;
0068   DTTPGParameters(const std::string& version);
0069 
0070   /** Destructor
0071    */
0072   ~DTTPGParameters();
0073 
0074   /** Operations
0075    */
0076   /// get content
0077   int get(int wheelId, int stationId, int sectorId, int& nc, float& ph, DTTimeUnits::type unit) const;
0078   int get(const DTChamberId& id, int& nc, float& ph, DTTimeUnits::type unit) const;
0079   float totalTime(int wheelId, int stationId, int sectorId, DTTimeUnits::type unit) const;
0080   float totalTime(const DTChamberId& id, DTTimeUnits::type unit) const;
0081   int clock() const;
0082   float unit() const;
0083 
0084   /// access version
0085   const std::string& version() const;
0086   std::string& version();
0087 
0088   /// reset content
0089   void clear();
0090 
0091   int set(int wheelId, int stationId, int sectorId, int nc, float ph, DTTimeUnits::type unit);
0092   int set(const DTChamberId& id, int nc, float ph, DTTimeUnits::type unit);
0093   void setClock(int clock);
0094   void setUnit(float unit);
0095 
0096   /// Access methods to data
0097   typedef std::vector<std::pair<DTTPGParametersId, DTTPGParametersData> >::const_iterator const_iterator;
0098   const_iterator begin() const;
0099   const_iterator end() const;
0100 
0101   void initialize();
0102 
0103   DTTPGParameters& operator=(DTTPGParameters const&);
0104 
0105 private:
0106   std::string dataVersion;
0107   float nsPerCount;
0108   int clockLength;
0109 
0110   std::vector<std::pair<DTTPGParametersId, DTTPGParametersData> > dataList;
0111 
0112   edm::ConstRespectingPtr<DTBufferTree<int, int> > dBuf COND_TRANSIENT;
0113 
0114   std::string mapName() const;
0115 
0116   COND_SERIALIZABLE;
0117 };
0118 #endif  // DTTPGParameters_H