00001 // $Id: MdcGeoWire.h,v 1.6 2010/03/26 00:45:11 zhangy Exp $ // -*-c++-*- 00002 // header file for a class called "MdcGeoWire" 00003 #ifndef MDC_GEO_WIRE_H 00004 #define MDC_GEO_WIRE_H 00005 00006 #include <CLHEP/Geometry/Point3D.h> 00007 #include <iostream> 00008 #include "MdcGeomSvc/MdcGeoLayer.h" 00009 #ifndef ENABLE_BACKWARDS_COMPATIBILITY 00010 typedef HepGeom::Point3D<double> HepPoint3D; 00011 #endif 00012 00013 using namespace CLHEP; 00014 00015 00016 class MdcGeoWire { 00017 00018 public: 00019 // Constructor. 00020 MdcGeoWire() 00021 : fId(0), 00022 fSlant(0), 00023 fnomSlant(0), 00024 fCell(0), 00025 fLayer(0), 00026 fStat(0) 00027 { 00028 HepPoint3D O(0,0,0); 00029 fBackward=O; 00030 fForward=O; 00031 fBwirepos=O; 00032 fFwirepos=O; 00033 fnomBackward=O; 00034 fnomForward=O; 00035 fLyr=NULL; 00036 } 00037 00038 // Copy and Assignment 00039 MdcGeoWire(const MdcGeoWire& e){ 00040 fId=e.Id(); 00041 fBackward=e.Backward(); 00042 fForward=e.Forward(); 00043 fBwirepos=e.BWirePos(); 00044 fFwirepos=e.FWirePos(); 00045 fSlant=e.Slant(); 00046 fCell=e.Cell(); 00047 fLayer=e.Layer(); 00048 fStat=e.Stat(); 00049 fLyr=e.Lyr(); 00050 }; 00051 00052 MdcGeoWire& operator=(const MdcGeoWire& e) { 00053 if(this!=&e) 00054 { 00055 fId=e.Id(); 00056 fBackward=e.Backward(); 00057 fForward=e.Forward(); 00058 fBwirepos=e.BWirePos(); 00059 fFwirepos=e.FWirePos(); 00060 fSlant=e.Slant(); 00061 fCell=e.Cell(); 00062 fLayer=e.Layer(); 00063 fStat=e.Stat(); 00064 fLyr=e.Lyr(); 00065 } 00066 return *this; 00067 } 00068 00069 // Destructor 00070 ~MdcGeoWire(){ }; 00071 00072 public: // Extractors 00073 int Id(void) const; 00074 HepPoint3D Backward(void) const; 00075 HepPoint3D Forward(void) const; 00076 HepPoint3D BWirePos(void) const; 00077 HepPoint3D FWirePos(void) const; 00078 double Slant(void) const; 00079 HepPoint3D nomBackward(void) const; 00080 HepPoint3D nomForward(void) const; 00081 double nomSlant(void) const; 00082 double Tension(void) const; 00083 const double Sag(void) const; 00084 const double Sagz(const double z) const; 00085 00086 int Cell(void) const; 00087 int Layer(void) const; 00088 int Stat(void) const; 00089 MdcGeoLayer * Lyr(void) const; 00090 00091 public: // Modifiers 00092 int Id(int); 00093 HepPoint3D Backward(HepPoint3D); 00094 HepPoint3D Forward(HepPoint3D); 00095 HepPoint3D BWirePos(HepPoint3D); 00096 HepPoint3D FWirePos(HepPoint3D); 00097 double Slant(double); 00098 HepPoint3D nomBackward(HepPoint3D); 00099 HepPoint3D nomForward(HepPoint3D); 00100 double nomSlant(double); 00101 double Tension(double); 00102 00103 int Cell(int); 00104 int Layer(int); 00105 int Stat(int); 00106 MdcGeoLayer* Lyr( MdcGeoLayer * ); 00107 00108 private: 00109 int fId; 00110 HepPoint3D fBackward; //wire position at backward endplate (mm) 00111 HepPoint3D fForward; //wire position at forward endplate (mm) 00112 HepPoint3D fBwirepos; //wire position at backward endplate (mm) 00113 HepPoint3D fFwirepos; //wire position at forward endplate (mm) 00114 double fSlant; //slant angle of wire (rad) 00115 HepPoint3D fnomBackward; //nominal wire position at backward endplate (mm) 00116 HepPoint3D fnomForward; //nominal wire position at forward endplate (mm) 00117 double fnomSlant; //nominal slant angle of wire (rad) 00118 double fTension; // the tension of wire 00119 00120 int fCell; //#cell 00121 int fLayer; //#layer 00122 int fStat; //status (32 bits) 00123 MdcGeoLayer * fLyr; 00124 }; 00125 00126 // Extractors 00127 inline int MdcGeoWire::Id(void) const { return fId; } 00128 inline HepPoint3D MdcGeoWire::Backward(void) const { return fBackward;} 00129 inline HepPoint3D MdcGeoWire::Forward(void) const { return fForward;} 00130 inline HepPoint3D MdcGeoWire::BWirePos(void) const { return fBwirepos;} 00131 inline HepPoint3D MdcGeoWire::FWirePos(void) const { return fFwirepos;} 00132 inline double MdcGeoWire::Slant(void) const { return fSlant; } 00133 inline HepPoint3D MdcGeoWire::nomBackward(void) const { return fnomBackward;} 00134 inline HepPoint3D MdcGeoWire::nomForward(void) const { return fnomForward;} 00135 inline double MdcGeoWire::nomSlant(void) const { return fnomSlant; } 00136 inline double MdcGeoWire::Tension(void) const { return fTension;} 00137 inline int MdcGeoWire::Cell(void) const { return fCell; } 00138 inline int MdcGeoWire::Layer(void) const { return fLayer; } 00139 inline int MdcGeoWire::Stat(void) const { return fStat; } 00140 inline MdcGeoLayer* MdcGeoWire::Lyr(void) const { return fLyr; } 00141 00142 // Modifiers 00143 inline int MdcGeoWire::Id(int i) {return fId=i;} 00144 inline HepPoint3D MdcGeoWire::Backward(HepPoint3D i) {return fBackward=i;} 00145 inline HepPoint3D MdcGeoWire::Forward(HepPoint3D i) {return fForward=i;} 00146 inline HepPoint3D MdcGeoWire::BWirePos(HepPoint3D i) {return fBwirepos=i;} 00147 inline HepPoint3D MdcGeoWire::FWirePos(HepPoint3D i) {return fFwirepos=i;} 00148 inline HepPoint3D MdcGeoWire::nomBackward(HepPoint3D i) {return fnomBackward=i;} 00149 inline HepPoint3D MdcGeoWire::nomForward(HepPoint3D i) {return fnomForward=i;} 00150 inline double MdcGeoWire::Slant(double i) {return fnomSlant=i;} 00151 inline double MdcGeoWire::nomSlant(double i) {return fnomSlant=i;} 00152 inline double MdcGeoWire::Tension(double i) {return fTension=i;} 00153 inline int MdcGeoWire::Cell(int i) {return fCell=i;} 00154 inline int MdcGeoWire::Layer(int i) {return fLayer=i;} 00155 inline int MdcGeoWire::Stat(int i) {return fStat=i;} 00156 inline MdcGeoLayer* MdcGeoWire::Lyr(MdcGeoLayer* i) {return fLyr = i;} 00157 00158 #endif /* MdcGeoWire_CLASS */ 00159