Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DTPerformance_H
0002 #define DTPerformance_H
0003 /** \class DTPerformance
0004  *
0005  *  Description:
0006  *       Class to hold drift tubes performances ( SL by SL )
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/DTSuperLayerId.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 DTPerformanceId {
0040 public:
0041   DTPerformanceId();
0042   ~DTPerformanceId();
0043 
0044   int wheelId;
0045   int stationId;
0046   int sectorId;
0047   int slId;
0048 
0049   COND_SERIALIZABLE;
0050 };
0051 
0052 class DTPerformanceData {
0053 public:
0054   DTPerformanceData();
0055   ~DTPerformanceData();
0056 
0057   float meanT0;
0058   float meanTtrig;
0059   float meanMtime;
0060   float meanNoise;
0061   float meanAfterPulse;
0062   float meanResolution;
0063   float meanEfficiency;
0064 
0065   COND_SERIALIZABLE;
0066 };
0067 
0068 class DTPerformance {
0069 public:
0070   /** Constructor
0071    */
0072   DTPerformance();
0073   DTPerformance(DTPerformance const&) = delete;
0074   DTPerformance& operator=(DTPerformance const&) = delete;
0075   DTPerformance(const std::string& version);
0076 
0077   /** Destructor
0078    */
0079   ~DTPerformance();
0080 
0081   /** Operations
0082    */
0083   /// get content
0084   int slPerformance(int wheelId,
0085                     int stationId,
0086                     int sectorId,
0087                     int slId,
0088                     float& meanT0,
0089                     float& meanTtrig,
0090                     float& meanMtime,
0091                     float& meanNoise,
0092                     float& meanAfterPulse,
0093                     float& meanResolution,
0094                     float& meanEfficiency,
0095                     DTTimeUnits::type unit) const {
0096     return get(wheelId,
0097                stationId,
0098                sectorId,
0099                slId,
0100                meanT0,
0101                meanTtrig,
0102                meanMtime,
0103                meanNoise,
0104                meanAfterPulse,
0105                meanResolution,
0106                meanEfficiency,
0107                unit);
0108   };
0109   int slPerformance(const DTSuperLayerId& id,
0110                     float& meanT0,
0111                     float& meanTtrig,
0112                     float& meanMtime,
0113                     float& meanNoise,
0114                     float& meanAfterPulse,
0115                     float& meanResolution,
0116                     float& meanEfficiency,
0117                     DTTimeUnits::type unit) const {
0118     return get(id, meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, meanResolution, meanEfficiency, unit);
0119   };
0120   int get(int wheelId,
0121           int stationId,
0122           int sectorId,
0123           int slId,
0124           float& meanT0,
0125           float& meanTtrig,
0126           float& meanMtime,
0127           float& meanNoise,
0128           float& meanAfterPulse,
0129           float& meanResolution,
0130           float& meanEfficiency,
0131           DTTimeUnits::type unit) const;
0132   int get(const DTSuperLayerId& id,
0133           float& meanT0,
0134           float& meanTtrig,
0135           float& meanMtime,
0136           float& meanNoise,
0137           float& meanAfterPulse,
0138           float& meanResolution,
0139           float& meanEfficiency,
0140           DTTimeUnits::type unit) const;
0141   float unit() const;
0142 
0143   /// access version
0144   const std::string& version() const;
0145   std::string& version();
0146 
0147   /// reset content
0148   void clear();
0149 
0150   int setSLPerformance(int wheelId,
0151                        int stationId,
0152                        int sectorId,
0153                        int slId,
0154                        float meanT0,
0155                        float meanTtrig,
0156                        float meanMtime,
0157                        float meanNoise,
0158                        float meanAfterPulse,
0159                        float meanResolution,
0160                        float meanEfficiency,
0161                        DTTimeUnits::type unit) {
0162     return set(wheelId,
0163                stationId,
0164                sectorId,
0165                slId,
0166                meanT0,
0167                meanTtrig,
0168                meanMtime,
0169                meanNoise,
0170                meanAfterPulse,
0171                meanResolution,
0172                meanEfficiency,
0173                unit);
0174   };
0175   int setSLPerformance(const DTSuperLayerId& id,
0176                        float meanT0,
0177                        float meanTtrig,
0178                        float meanMtime,
0179                        float meanNoise,
0180                        float meanAfterPulse,
0181                        float meanResolution,
0182                        float meanEfficiency,
0183                        DTTimeUnits::type unit) {
0184     return set(id, meanT0, meanTtrig, meanMtime, meanNoise, meanAfterPulse, meanResolution, meanEfficiency, unit);
0185   };
0186   int set(int wheelId,
0187           int stationId,
0188           int sectorId,
0189           int slId,
0190           float meanT0,
0191           float meanTtrig,
0192           float meanMtime,
0193           float meanNoise,
0194           float meanAfterPulse,
0195           float meanResolution,
0196           float meanEfficiency,
0197           DTTimeUnits::type unit);
0198   int set(const DTSuperLayerId& id,
0199           float meanT0,
0200           float meanTtrig,
0201           float meanMtime,
0202           float meanNoise,
0203           float meanAfterPulse,
0204           float meanResolution,
0205           float meanEfficiency,
0206           DTTimeUnits::type unit);
0207   void setUnit(float unit);
0208 
0209   /// Access methods to data
0210   typedef std::vector<std::pair<DTPerformanceId, DTPerformanceData> >::const_iterator const_iterator;
0211   const_iterator begin() const;
0212   const_iterator end() const;
0213 
0214   void initialize();
0215 
0216 private:
0217   std::string dataVersion;
0218   float nsPerCount;
0219 
0220   std::vector<std::pair<DTPerformanceId, DTPerformanceData> > dataList;
0221 
0222   DTBufferTree<int, int>* dBuf COND_TRANSIENT;
0223 
0224   /// read and store full content
0225   std::string mapName() const;
0226 
0227   COND_SERIALIZABLE;
0228 };
0229 #endif  // DTPerformance_H