CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DataFormats/DTDigi/interface/DTDigi.h

Go to the documentation of this file.
00001 #ifndef DTDigi_DTDigi_h
00002 #define DTDigi_DTDigi_h
00003 
00017 #include <boost/cstdint.hpp>
00018 
00019 class DTDigi{
00020 
00021 public:
00022   //  typedef uint32_t ChannelType;
00023   
00026   explicit DTDigi (int wire, int nTDC, int number=0);
00027 
00028   // Construct from the wire#, the time (ns) and the digi number.
00029   // time is converted in TDC counts (1 TDC = 25./32. ns)
00030   // number should identify uniquely multiple digis in the same cell.
00031   explicit DTDigi (int wire, double tdrift, int number=0);
00032 
00033   // Construct from channel and counts.
00034   //  explicit DTDigi (ChannelType channel, int nTDC);
00035 
00037   DTDigi ();
00038 
00040   bool operator==(const DTDigi& digi) const;
00041 
00042   // The channel identifier and the digi number packed together
00043   //  ChannelType channel() const ;
00044 
00046   int wire() const;
00047 
00049   int number() const;
00050 
00052   double time() const;
00053 
00055   uint32_t countsTDC() const;
00056 
00058   void setTime(double time);  
00059 
00061   void setCountsTDC (int nTDC);
00062 
00064   void print() const;
00065 
00066 private:
00067   friend class testDTDigis;
00068 
00069   // The value of one TDC count in ns
00070   static const double reso;
00071 
00072   // Masks&shifts for the channel identifier
00073 //   static const uint32_t wire_mask   = 0xffff0000;
00074 //   static const uint32_t number_mask = 0xffff;
00075 //   static const uint32_t wire_offset = 16;
00076 
00077   uint16_t theWire;   // channel number
00078   uint32_t theCounts; // TDC count, up to 20 bits actually used
00079   uint16_t theNumber; // counter for digis in the same cell
00080 };
00081 
00082 #include<iostream>
00083 inline std::ostream & operator<<(std::ostream & o, const DTDigi& digi) {
00084   return o << " " << digi.wire()
00085            << " " << digi.time()
00086            << " " << digi.number();
00087 }
00088 #endif
00089