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 #include "GaudiKernel/KeyedObject.h"
00021 #include "GaudiKernel/KeyedContainer.h"
00022 
00023 
00024 // Forward declarations
00025 
00035 class Measurement: public KeyedObject<int>
00036 {
00037 public:
00038 
00040   enum Type{ Unknown,
00041              Muon,
00042              OT,
00043              ST,
00044              TT,
00045              VeloR,
00046              VeloPhi };
00047 
00049   Measurement() : m_mtype(0),
00050                   m_z(0.0),
00051                   m_measure(0.0),
00052                   m_errMeasure(0.0),
00053                   m_lhcbID() {}
00054 
00056   virtual ~Measurement() {}
00057 
00059   double errMeasure2() const;
00060 
00062   Type type() const;
00063 
00065   virtual Measurement* clone() const;
00066 
00068   void setType(const Type& value);
00069 
00071   bool checkType(const Type& value) const;
00072 
00074   double z() const;
00075 
00077   void setZ(double value);
00078 
00080   double measure() const;
00081 
00083   void setMeasure(double value);
00084 
00086   double errMeasure() const;
00087 
00089   void setErrMeasure(double value);
00090 
00092   const LHCbID& lhcbID() const;
00093 
00095   LHCbID& lhcbID();
00096 
00098   void setLhcbID(const LHCbID& value);
00099 
00100 protected:
00101 
00103   enum mtypeBits{typeBits = 0};
00104 
00106   enum mtypeMasks{typeMask = 0x3FL};
00107 
00108 
00109   unsigned int m_mtype;      
00110   double   m_z;          
00111   double   m_measure;    
00112   double   m_errMeasure; 
00113   LHCbID   m_lhcbID;     
00114 
00115 private:
00116 
00117 };
00118 
00119 // -----------------------------------------------------------------------------
00120 //   end of class
00121 // -----------------------------------------------------------------------------
00122 
00123 // Including forward declarations
00124 
00125 inline void Measurement::setType(const Type& value)
00126 {
00127   unsigned int val = (unsigned int)value;
00128   m_mtype &= ~typeMask;
00129   m_mtype |= ((((unsigned int)val) << typeBits) & typeMask);
00130 }
00131 
00132 inline bool Measurement::checkType(const Type& value) const
00133 {
00134   unsigned int val = (unsigned int)value;
00135   return 0 != ( m_mtype & typeMask & ( val << typeBits ));
00136 }
00137 
00138 inline double Measurement::z() const 
00139 {
00140   return m_z;
00141 }
00142 
00143 inline void Measurement::setZ(double value) 
00144 {
00145   m_z = value;
00146 }
00147 
00148 inline double Measurement::measure() const 
00149 {
00150   return m_measure;
00151 }
00152 
00153 inline void Measurement::setMeasure(double value) 
00154 {
00155   m_measure = value;
00156 }
00157 
00158 inline double Measurement::errMeasure() const 
00159 {
00160   return m_errMeasure;
00161 }
00162 
00163 inline void Measurement::setErrMeasure(double value) 
00164 {
00165   m_errMeasure = value;
00166 }
00167 
00168 inline const LHCbID& Measurement::lhcbID() const 
00169 {
00170   return m_lhcbID;
00171 }
00172 
00173 inline LHCbID& Measurement::lhcbID() 
00174 {
00175   return m_lhcbID;
00176 }
00177 
00178 inline void Measurement::setLhcbID(const LHCbID& value) 
00179 {
00180   m_lhcbID = value;
00181 }
00182 
00183 inline double Measurement::errMeasure2() const 
00184 {
00185 
00186   return m_errMeasure*m_errMeasure;
00187         
00188 }
00189 
00190 inline Measurement::Type Measurement::type() const 
00191 {
00192 
00193   return (Measurement::Type)((m_mtype & typeMask) >> typeBits);
00194         
00195 }
00196 
00197 inline Measurement* Measurement::clone() const 
00198 {
00199 
00200   Measurement* me = new Measurement(); *me = *this; return me;
00201         
00202 }
00203 
00204 // Definition of Keyed Container for Measurement
00205 typedef KeyedContainer<Measurement, Containers::HashMap> Measurements;
00206 
00207 
00208 
00209 #endif 

Generated on Wed May 4 11:52:34 2005 for New Track Event Model by doxygen 1.4.1