CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/CondFormats/DTObjects/interface/DTT0.h

Go to the documentation of this file.
00001 #ifndef DTT0_H
00002 #define DTT0_H
00003 
00015 //----------------------
00016 // Base Class Headers --
00017 //----------------------
00018 
00019 
00020 //------------------------------------
00021 // Collaborating Class Declarations --
00022 //------------------------------------
00023 #include "CondFormats/DTObjects/interface/DTTimeUnits.h"
00024 #include "CondFormats/DTObjects/interface/DTBufferTree.h"
00025 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00026 
00027 //---------------
00028 // C++ Headers --
00029 //---------------
00030 #include <string>
00031 #include <vector>
00032 #include <map>
00033 
00034 //              ---------------------
00035 //              -- Class Interface --
00036 //              ---------------------
00037 
00038 class DTT0Id {
00039 
00040  public:
00041 
00042   DTT0Id();
00043   ~DTT0Id();
00044 
00045   int   wheelId;
00046   int stationId;
00047   int  sectorId;
00048   int      slId;
00049   int   layerId;
00050   int    cellId;
00051 
00052 };
00053 
00054 
00055 class DTT0Data {
00056 
00057  public:
00058 
00059   DTT0Data();
00060   ~DTT0Data();
00061 
00062   float t0mean;
00063   float t0rms;
00064 
00065 };
00066 
00067 
00068 class DTT0 {
00069 
00070  public:
00071 
00074   DTT0();
00075   DTT0( const std::string& version );
00076 
00079   ~DTT0();
00080 
00083 
00084   int cellT0( int   wheelId,
00085               int stationId,
00086               int  sectorId,
00087               int      slId,
00088               int   layerId,
00089               int    cellId,
00090               float& t0mean,
00091               float& t0rms,
00092               DTTimeUnits::type unit ) const
00093       { return get( wheelId, stationId, sectorId, slId, layerId, cellId,
00094                     t0mean, t0rms, unit ); };
00095   int cellT0( const DTWireId& id,
00096               float& t0mean,
00097               float& t0rms,
00098               DTTimeUnits::type unit ) const
00099       { return get( id, t0mean, t0rms, unit ); };
00100   int get( int   wheelId,
00101            int stationId,
00102            int  sectorId,
00103            int      slId,
00104            int   layerId,
00105            int    cellId,
00106            float& t0mean,
00107            float& t0rms,
00108            DTTimeUnits::type unit ) const;
00109   int get( const DTWireId& id,
00110            float& t0mean,
00111            float& t0rms,
00112            DTTimeUnits::type unit ) const;
00113   float unit() const;
00114 
00116   const
00117   std::string& version() const;
00118   std::string& version();
00119 
00121   void clear();
00122 
00123   int setCellT0( int   wheelId,
00124                  int stationId,
00125                  int  sectorId,
00126                  int      slId,
00127                  int   layerId,
00128                  int    cellId,
00129                  float t0mean,
00130                  float t0rms,
00131                  DTTimeUnits::type unit )
00132       { return set( wheelId, stationId, sectorId, slId, layerId, cellId,
00133                     t0mean, t0rms, unit ); };
00134   int setCellT0( const DTWireId& id,
00135                  float t0mean,
00136                  float t0rms,
00137                  DTTimeUnits::type unit )
00138       { return set( id, t0mean, t0rms, unit ); };
00139   int set( int   wheelId,
00140            int stationId,
00141            int  sectorId,
00142            int      slId,
00143            int   layerId,
00144            int    cellId,
00145            float t0mean,
00146            float t0rms,
00147            DTTimeUnits::type unit );
00148   int set( const DTWireId& id,
00149            float t0mean,
00150            float t0rms,
00151            DTTimeUnits::type unit );
00152   void setUnit( float unit );
00153   void sortData();
00154 
00156   typedef std::vector< std::pair<DTT0Id,
00157                                  DTT0Data> >::const_iterator
00158                                               const_iterator;
00159   const_iterator begin() const;
00160   const_iterator end() const;
00161 
00162  private:
00163 
00164   std::string dataVersion;
00165   float nsPerCount;
00166 
00167   std::vector< std::pair<DTT0Id,DTT0Data> > dataList;
00168 
00169   mutable std::vector<int>* sequencePtr;
00170   mutable DTBufferTree<int,int>* sortedLayers;
00171   mutable DTBufferTree<int,int>* dBuf;
00172 //  mutable std::map<int,int>* sortedLayers;
00173 //  mutable std::map<int,int>* dBuf;
00174 
00176   bool checkOrder() const;
00177   void cacheMap() const;
00178   std::string mapName() const;
00179   int maxCellsPerLayer() const;
00180   int getRandom( int   wheelId,
00181                  int stationId,
00182                  int  sectorId,
00183                  int      slId,
00184                  int   layerId,
00185                  int    cellId,
00186                  float& t0mean,
00187                  float& t0rms,
00188                  DTTimeUnits::type unit ) const;
00189   int getSorted( int   wheelId,
00190                  int stationId,
00191                  int  sectorId,
00192                  int      slId,
00193                  int   layerId,
00194                  int    cellId,
00195                  float& t0mean,
00196                  float& t0rms,
00197                  DTTimeUnits::type unit ) const;
00198 
00199 };
00200 
00201 
00202 #endif // DTT0_H
00203