Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTTtrig_H
0002 #define DTTtrig_H
0003 /** \class DTTtrig
0004  *
0005  *  Description:
0006  *       Class to hold drift tubes TTrigs
0007  *             ( SL by SL 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 #include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
0025 #include "FWCore/Utilities/interface/ConstRespectingPtr.h"
0026 
0027 //---------------
0028 // C++ Headers --
0029 //---------------
0030 #include <string>
0031 #include <vector>
0032 #include <utility>
0033 
0034 template <class Key, class Content>
0035 class DTBufferTree;
0036 
0037 //              ---------------------
0038 //              -- Class Interface --
0039 //              ---------------------
0040 
0041 class DTTtrigId {
0042 public:
0043   DTTtrigId();
0044   ~DTTtrigId();
0045 
0046   int wheelId;
0047   int stationId;
0048   int sectorId;
0049   int slId;
0050   int layerId;
0051   int cellId;
0052 
0053   COND_SERIALIZABLE;
0054 };
0055 
0056 class DTTtrigData {
0057 public:
0058   DTTtrigData();
0059   ~DTTtrigData();
0060 
0061   float tTrig;
0062   float tTrms;
0063   float kFact;
0064 
0065   COND_SERIALIZABLE;
0066 };
0067 
0068 class DTTtrig {
0069 public:
0070   /** Constructor
0071    */
0072   DTTtrig();
0073   DTTtrig(DTTtrig const&) = delete;
0074   DTTtrig& operator=(DTTtrig const&) = delete;
0075   DTTtrig(const std::string& version);
0076 
0077   /** Destructor
0078    */
0079   ~DTTtrig();
0080 
0081   /** Operations
0082    */
0083   /// get content
0084   int get(int wheelId,
0085           int stationId,
0086           int sectorId,
0087           int slId,
0088           float& tTrig,
0089           float& tTrms,
0090           float& kFact,
0091           DTTimeUnits::type unit) const;
0092   int get(int wheelId,
0093           int stationId,
0094           int sectorId,
0095           int slId,
0096           int layerId,
0097           int cellId,
0098           float& tTrig,
0099           float& tTrms,
0100           float& kFact,
0101           DTTimeUnits::type unit) const;
0102   int get(const DTSuperLayerId& id, float& tTrig, float& tTrms, float& kFact, DTTimeUnits::type unit) const;
0103   int get(const DetId& id, float& tTrig, float& tTrms, float& kFact, DTTimeUnits::type unit) const;
0104   int get(int wheelId, int stationId, int sectorId, int slId, float& tTrig, DTTimeUnits::type unit) const;
0105   int get(int wheelId,
0106           int stationId,
0107           int sectorId,
0108           int slId,
0109           int layerId,
0110           int cellId,
0111           float& tTrig,
0112           DTTimeUnits::type unit) const;
0113   int get(const DTSuperLayerId& id, float& tTrig, DTTimeUnits::type unit) const;
0114   int get(const DetId& id, float& tTrig, DTTimeUnits::type unit) const;
0115   float unit() const;
0116 
0117   /// access version
0118   const std::string& version() const;
0119   std::string& version();
0120 
0121   /// reset content
0122   void clear();
0123 
0124   int set(
0125       int wheelId, int stationId, int sectorId, int slId, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit);
0126   int set(int wheelId,
0127           int stationId,
0128           int sectorId,
0129           int slId,
0130           int layerId,
0131           int cellId,
0132           float tTrig,
0133           float tTrms,
0134           float kFact,
0135           DTTimeUnits::type unit);
0136   int set(const DTSuperLayerId& id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit);
0137   int set(const DetId& id, float tTrig, float tTrms, float kFact, DTTimeUnits::type unit);
0138   void setUnit(float unit);
0139 
0140   /// Access methods to data
0141   typedef std::vector<std::pair<DTTtrigId, DTTtrigData> >::const_iterator const_iterator;
0142   const_iterator begin() const;
0143   const_iterator end() const;
0144 
0145   void initialize();
0146 
0147 private:
0148   std::string dataVersion;
0149   float nsPerCount;
0150 
0151   std::vector<std::pair<DTTtrigId, DTTtrigData> > dataList;
0152 
0153   edm::ConstRespectingPtr<DTBufferTree<int, int> > dBuf COND_TRANSIENT;
0154 
0155   std::string mapName() const;
0156 
0157   COND_SERIALIZABLE;
0158 };
0159 #endif  // DTTtrig_H