Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:01

0001 #ifndef DTT0_H
0002 #define DTT0_H
0003 /** \class DTT0
0004  *
0005  *  Description:
0006  *       Class to hold drift tubes T0s
0007  *             ( cell by cell time offsets )
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 "CondFormats/DTObjects/interface/DTTimeUnits.h"
0023 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0024 
0025 //---------------
0026 // C++ Headers --
0027 //---------------
0028 #include <string>
0029 #include <vector>
0030 #include <map>
0031 
0032 //              ---------------------
0033 //              -- Class Interface --
0034 //              ---------------------
0035 
0036 class DTT0Data {
0037 public:
0038   DTT0Data();
0039   ~DTT0Data();
0040 
0041   uint32_t channelId;
0042   float t0mean;
0043   float t0rms;
0044 
0045   COND_SERIALIZABLE;
0046 };
0047 
0048 class DTT0 {
0049 public:
0050   /** Constructor
0051    */
0052   DTT0();
0053   DTT0(const std::string& version);
0054 
0055   /** Destructor
0056    */
0057   ~DTT0();
0058 
0059   /** Operations
0060    */
0061   /// get content
0062   int cellT0(int wheelId,
0063              int stationId,
0064              int sectorId,
0065              int slId,
0066              int layerId,
0067              int cellId,
0068              float& t0mean,
0069              float& t0rms,
0070              DTTimeUnits::type unit) const {
0071     return get(wheelId, stationId, sectorId, slId, layerId, cellId, t0mean, t0rms, unit);
0072   };
0073   int cellT0(const DTWireId& id, float& t0mean, float& t0rms, DTTimeUnits::type unit) const {
0074     return get(id, t0mean, t0rms, unit);
0075   };
0076   int get(int wheelId,
0077           int stationId,
0078           int sectorId,
0079           int slId,
0080           int layerId,
0081           int cellId,
0082           float& t0mean,
0083           float& t0rms,
0084           DTTimeUnits::type unit) const;
0085   int get(const DTWireId& id, float& t0mean, float& t0rms, DTTimeUnits::type unit) const;
0086   float unit() const;
0087 
0088   /// access version
0089   const std::string& version() const;
0090   std::string& version();
0091 
0092   /// reset content
0093   void clear();
0094 
0095   int setCellT0(int wheelId,
0096                 int stationId,
0097                 int sectorId,
0098                 int slId,
0099                 int layerId,
0100                 int cellId,
0101                 float t0mean,
0102                 float t0rms,
0103                 DTTimeUnits::type unit) {
0104     return set(wheelId, stationId, sectorId, slId, layerId, cellId, t0mean, t0rms, unit);
0105   };
0106   int setCellT0(const DTWireId& id, float t0mean, float t0rms, DTTimeUnits::type unit) {
0107     return set(id, t0mean, t0rms, unit);
0108   };
0109   int set(int wheelId,
0110           int stationId,
0111           int sectorId,
0112           int slId,
0113           int layerId,
0114           int cellId,
0115           float t0mean,
0116           float t0rms,
0117           DTTimeUnits::type unit);
0118   int set(const DTWireId& id, float t0mean, float t0rms, DTTimeUnits::type unit);
0119   void setUnit(float unit);
0120 
0121   /// Access methods to data
0122   typedef std::vector<DTT0Data>::const_iterator const_iterator;
0123   const_iterator begin() const;
0124   const_iterator end() const;
0125 
0126 private:
0127   std::string dataVersion;
0128   float nsPerCount;
0129 
0130   std::vector<DTT0Data> dataList;
0131 
0132   COND_SERIALIZABLE;
0133 };
0134 
0135 #endif  // DTT0_H