Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Measurement.h

Go to the documentation of this file.
00001 
00002 //   **************************************************************************
00003 //   *                                                                        *
00004 //   *                      ! ! ! A T T E N T I O N ! ! !                     *
00005 //   *                                                                        *
00006 //   *  This file was created automatically by GaudiObjDesc, please do not    *
00007 //   *  delete it or edit it by hand.                                         *
00008 //   *                                                                        *
00009 //   *  If you want to change this file, first change the corresponding       *
00010 //   *  xml-file and rerun the tools from GaudiObjDesc (or run make if you    *
00011 //   *  are using it from inside a Gaudi-package).                            *
00012 //   *                                                                        *
00013 //   **************************************************************************
00014 
00015 #ifndef TrackEvent_Measurement_H
00016 #define TrackEvent_Measurement_H 1
00017 
00018 // Include files
00019 #include "Kernel/LHCbID.h"
00020 
00021 
00022 // Forward declarations
00023 
00033 class Measurement
00034 {
00035 public:
00036 
00038   enum Type{ Unknown,
00039              Muon,
00040              OT,
00041              ST,
00042              TT,
00043              VeloR,
00044              VeloPhi };
00045 
00047   Measurement() : m_mtype(0),
00048                   m_z(0.0),
00049                   m_measure(0.0),
00050                   m_errMeasure(0.0),
00051                   m_lhcbID() {}
00052 
00054   virtual ~Measurement() {}
00055 
00057   double errMeasure2() const;
00058 
00060   Type type() const;
00061 
00063   virtual Measurement* clone() const;
00064 
00066   void setType(const Type& value);
00067 
00069   bool checkType(const Type& value) const;
00070 
00072   double z() const;
00073 
00075   void setZ(double value);
00076 
00078   double measure() const;
00079 
00081   void setMeasure(double value);
00082 
00084   double errMeasure() const;
00085 
00087   void setErrMeasure(double value);
00088 
00090   const LHCbID& lhcbID() const;
00091 
00093   LHCbID& lhcbID();
00094 
00096   void setLhcbID(const LHCbID& value);
00097 
00098 protected:
00099 
00101   enum mtypeBits{typeBits = 0};
00102 
00104   enum mtypeMasks{typeMask = 0x3FL};
00105 
00106 
00107   unsigned int m_mtype;      
00108   double   m_z;          
00109   double   m_measure;    
00110   double   m_errMeasure; 
00111   LHCbID   m_lhcbID;     
00112 
00113 private:
00114 
00115 };
00116 
00117 // -----------------------------------------------------------------------------
00118 //   end of class
00119 // -----------------------------------------------------------------------------
00120 
00121 // Including forward declarations
00122 
00123 inline void Measurement::setType(const Type& value)
00124 {
00125   unsigned int val = (unsigned int)value;
00126   m_mtype &= ~typeMask;
00127   m_mtype |= ((((unsigned int)val) << typeBits) & typeMask);
00128 }
00129 
00130 inline bool Measurement::checkType(const Type& value) const
00131 {
00132   unsigned int val = (unsigned int)value;
00133   return 0 != ( m_mtype & typeMask & ( val << typeBits ));
00134 }
00135 
00136 inline double Measurement::z() const 
00137 {
00138   return m_z;
00139 }
00140 
00141 inline void Measurement::setZ(double value) 
00142 {
00143   m_z = value;
00144 }
00145 
00146 inline double Measurement::measure() const 
00147 {
00148   return m_measure;
00149 }
00150 
00151 inline void Measurement::setMeasure(double value) 
00152 {
00153   m_measure = value;
00154 }
00155 
00156 inline double Measurement::errMeasure() const 
00157 {
00158   return m_errMeasure;
00159 }
00160 
00161 inline void Measurement::setErrMeasure(double value) 
00162 {
00163   m_errMeasure = value;
00164 }
00165 
00166 inline const LHCbID& Measurement::lhcbID() const 
00167 {
00168   return m_lhcbID;
00169 }
00170 
00171 inline LHCbID& Measurement::lhcbID() 
00172 {
00173   return m_lhcbID;
00174 }
00175 
00176 inline void Measurement::setLhcbID(const LHCbID& value) 
00177 {
00178   m_lhcbID = value;
00179 }
00180 
00181 inline double Measurement::errMeasure2() const 
00182 {
00183 
00184   return m_errMeasure*m_errMeasure;
00185         
00186 }
00187 
00188 inline Measurement::Type Measurement::type() const 
00189 {
00190 
00191   return (Measurement::Type)((m_mtype & typeMask) >> typeBits);
00192         
00193 }
00194 
00195 inline Measurement* Measurement::clone() const 
00196 {
00197 
00198   Measurement* me = new Measurement(); *me = *this; return me;
00199         
00200 }
00201 
00202 
00203 #endif 

Generated on Fri May 27 13:59:37 2005 for New Track Event Model by doxygen 1.4.1