CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcGeomSvc-00-01-42/MdcGeomSvc/MdcGeoWire.h
Go to the documentation of this file.
1// $Id: MdcGeoWire.h,v 1.3 2020/09/25 02:20:23 zhouh Exp $ // -*-c++-*-
2// header file for a class called "MdcGeoWire"
3#ifndef MDC_GEO_WIRE_H
4#define MDC_GEO_WIRE_H
5
6#include <CLHEP/Geometry/Point3D.h>
7#include <iostream>
8#include <vector>
9#include "MdcGeomSvc/MdcGeoLayer.h"
10#ifndef ENABLE_BACKWARDS_COMPATIBILITY
12#endif
13
14using namespace CLHEP;
15using namespace std;
16
17
18class MdcGeoWire {
19
20 public:
21 // Constructor.
23 : fId(0),
24 fSlant(0),
25 fnomSlant(0),
26 fCell(0),
27 fLayer(0),
28 fStat(0)
29 {
30 HepPoint3D O(0,0,0);
31 fBackward=O;
32 fForward=O;
33 fBwirepos=O;
34 fFwirepos=O;
35 fnomBackward=O;
36 fnomForward=O;
37 fLyr=NULL;
38 fWireNeighbors.clear();
39 fNeighborType.clear();
40 fWireNeighborsID.clear();
41 }
42
43 // Copy and Assignment
45 fId=e.Id();
46 fBackward=e.Backward();
47 fForward=e.Forward();
48 fBwirepos=e.BWirePos();
49 fFwirepos=e.FWirePos();
50 fSlant=e.Slant();
51 fCell=e.Cell();
52 fLayer=e.Layer();
53 fStat=e.Stat();
54 fLyr=e.Lyr();
55 fWireNeighbors=e.GetNeighbors();
56 fWireNeighborsID=e.GetIDofNeighbors();
57 fNeighborType=e.GetNeighborsType();
58 };
59
61 if(this!=&e)
62 {
63 fId=e.Id();
64 fBackward=e.Backward();
65 fForward=e.Forward();
66 fBwirepos=e.BWirePos();
67 fFwirepos=e.FWirePos();
68 fSlant=e.Slant();
69 fCell=e.Cell();
70 fLayer=e.Layer();
71 fStat=e.Stat();
72 fLyr=e.Lyr();
73 fWireNeighbors=e.GetNeighbors();
74 fWireNeighborsID=e.GetIDofNeighbors();
75 fNeighborType=e.GetNeighborsType();
76 }
77 return *this;
78 }
79
80 // Destructor
82
83 public: // Extractors
84 int Id(void) const;
85 HepPoint3D Backward(void) const;
86 HepPoint3D Forward(void) const;
87 HepPoint3D BWirePos(void) const;
88 HepPoint3D FWirePos(void) const;
89 double Slant(void) const;
92 double nomSlant(void) const;
93 double Tension(void) const;
94 const double Sag(void) const;
95 const double Sagz(const double z) const;
96
97 double GetX(const double z) const;
98 double GetY(const double z) const;
99
100 int NeiborType(int nid) const;//1:number decrease 2:number increase 3:lower layer 4:upper layer
101 int NeighborID(int nid) const;//return cellID of a neighbor
102 int NumOfNeibors(void) const;//return amount of adjacent cells
103 vector<int> GetIDofNeighbors(void) const;
104 vector<MdcGeoWire*> GetNeighbors(void) const;
105
106 int GetNeighborIDType1(void) const;
107 int GetNeighborIDType2(void) const;
108 vector<int> GetNeighborIDType3(void) const;
109 vector<int> GetNeighborIDType4(void) const;
110 vector<int> GetNeighborsType(void) const;
111 MdcGeoWire* GetNeighborType1(void) const;
112 MdcGeoWire* GetNeighborType2(void) const;
113 vector<MdcGeoWire*> GetNeighborType3(void) const;
114 vector<MdcGeoWire*> GetNeighborType4(void) const;
115 double WirePhi(double z) const;
116 double CalculatePhi(double phi) const;
117
118 vector<MdcGeoWire*> GetNeighboratZType3(double z) const;
119 vector<MdcGeoWire*> GetNeighboratZType4(double z) const;
120
121 int Cell(void) const;
122 int Layer(void) const;
123 int Stat(void) const;
124
125
126 MdcGeoLayer * Lyr(void) const;
127
128 public: // Modifiers
129 int Id(int);
134 double Slant(double);
137 double nomSlant(double);
138 double Tension(double);
139
140 void AddWireNeighbor(int id,int type);//add a neighbor cell
141 void AddWireNeighbor(MdcGeoWire* awire,int type);
142 void AddWireNeighbor(MdcGeoWire* awire,int id,int type);
143 void ClearNeighbors();
144
145
146 int Cell(int);
147 int Layer(int);
148 int Stat(int);
150
151 private:
152 int fId;
153 HepPoint3D fBackward; //wire position at backward endplate (mm)
154 HepPoint3D fForward; //wire position at forward endplate (mm)
155 HepPoint3D fBwirepos; //wire position at backward endplate (mm)
156 HepPoint3D fFwirepos; //wire position at forward endplate (mm)
157 double fSlant; //slant angle of wire (rad)
158 HepPoint3D fnomBackward; //nominal wire position at backward endplate (mm)
159 HepPoint3D fnomForward; //nominal wire position at forward endplate (mm)
160 double fnomSlant; //nominal slant angle of wire (rad)
161 double fTension; // the tension of wire
162
163 int fCell; //#cell
164 int fLayer; //#layer
165 int fStat; //status (32 bits)
166 MdcGeoLayer * fLyr;
167
168 std::vector<int> fWireNeighborsID;
169 std::vector<MdcGeoWire*> fWireNeighbors;
170 std::vector<int> fNeighborType;
171
172};
173
174// Extractors
175inline int MdcGeoWire::Id(void) const { return fId; }
176inline HepPoint3D MdcGeoWire::Backward(void) const { return fBackward;}
177inline HepPoint3D MdcGeoWire::Forward(void) const { return fForward;}
178inline HepPoint3D MdcGeoWire::BWirePos(void) const { return fBwirepos;}
179inline HepPoint3D MdcGeoWire::FWirePos(void) const { return fFwirepos;}
180inline double MdcGeoWire::Slant(void) const { return fSlant; }
181inline HepPoint3D MdcGeoWire::nomBackward(void) const { return fnomBackward;}
182inline HepPoint3D MdcGeoWire::nomForward(void) const { return fnomForward;}
183inline double MdcGeoWire::nomSlant(void) const { return fnomSlant; }
184inline double MdcGeoWire::Tension(void) const { return fTension;}
185inline int MdcGeoWire::Cell(void) const { return fCell; }
186inline int MdcGeoWire::Layer(void) const { return fLayer; }
187inline int MdcGeoWire::Stat(void) const { return fStat; }
188inline MdcGeoLayer* MdcGeoWire::Lyr(void) const { return fLyr; }
189
190inline int MdcGeoWire::GetNeighborIDType1(void) const {return fWireNeighborsID.at(0);}
191inline int MdcGeoWire::GetNeighborIDType2(void) const {return fWireNeighborsID.at(1);}
192inline vector<MdcGeoWire*> MdcGeoWire::GetNeighbors(void) const {return fWireNeighbors;}
193inline MdcGeoWire* MdcGeoWire::GetNeighborType1(void) const {return fWireNeighbors.at(0);}
194inline MdcGeoWire* MdcGeoWire::GetNeighborType2(void) const {return fWireNeighbors.at(1);}
195inline int MdcGeoWire::NeighborID(int nid) const {return fWireNeighborsID.at(nid);}
196inline int MdcGeoWire::NumOfNeibors(void) const {return fWireNeighborsID.size();}
197inline vector<int> MdcGeoWire::GetIDofNeighbors(void) const {return fWireNeighborsID;}
198inline vector<int> MdcGeoWire::GetNeighborsType(void) const {return fNeighborType;}
199
200// Modifiers
201inline int MdcGeoWire::Id(int i) {return fId=i;}
202inline HepPoint3D MdcGeoWire::Backward(HepPoint3D i) {return fBackward=i;}
203inline HepPoint3D MdcGeoWire::Forward(HepPoint3D i) {return fForward=i;}
204inline HepPoint3D MdcGeoWire::BWirePos(HepPoint3D i) {return fBwirepos=i;}
205inline HepPoint3D MdcGeoWire::FWirePos(HepPoint3D i) {return fFwirepos=i;}
206inline HepPoint3D MdcGeoWire::nomBackward(HepPoint3D i) {return fnomBackward=i;}
207inline HepPoint3D MdcGeoWire::nomForward(HepPoint3D i) {return fnomForward=i;}
208inline double MdcGeoWire::Slant(double i) {return fSlant=i;}
209inline double MdcGeoWire::nomSlant(double i) {return fnomSlant=i;}
210inline double MdcGeoWire::Tension(double i) {return fTension=i;}
211inline int MdcGeoWire::Cell(int i) {return fCell=i;}
212inline int MdcGeoWire::Layer(int i) {return fLayer=i;}
213inline int MdcGeoWire::Stat(int i) {return fStat=i;}
214inline MdcGeoLayer* MdcGeoWire::Lyr(MdcGeoLayer* i) {return fLyr = i;}
215
216
217
218#endif /* MdcGeoWire_CLASS */
219
HepGeom::Point3D< double > HepPoint3D
double GetX(const double z) const
vector< MdcGeoWire * > GetNeighborType3(void) const
MdcGeoWire * GetNeighborType1(void) const
vector< int > GetNeighborIDType4(void) const
double GetY(const double z) const
HepPoint3D nomBackward(HepPoint3D)
HepPoint3D nomForward(HepPoint3D)
double Slant(double)
int Layer(int)
HepPoint3D FWirePos(HepPoint3D)
const double Sag(void) const
MdcGeoWire & operator=(const MdcGeoWire &e)
vector< MdcGeoWire * > GetNeighbors(void) const
int Cell(int)
const double Sagz(const double z) const
vector< MdcGeoWire * > GetNeighborType4(void) const
double Tension(double)
double WirePhi(double z) const
double nomSlant(double)
HepPoint3D nomForward(void) const
vector< MdcGeoWire * > GetNeighboratZType3(double z) const
HepPoint3D nomBackward(void) const
vector< MdcGeoWire * > GetNeighboratZType4(double z) const
void AddWireNeighbor(int id, int type)
HepPoint3D BWirePos(HepPoint3D)
vector< int > GetNeighborIDType3(void) const
double Tension(void) const
int NeiborType(int nid) const
double CalculatePhi(double phi) const
MdcGeoWire * GetNeighborType2(void) const
HepPoint3D Backward(HepPoint3D)
int Id(int)
vector< int > GetIDofNeighbors(void) const
int Stat(int)
HepPoint3D Forward(HepPoint3D)
double nomSlant(void) const
MdcGeoLayer * Lyr(MdcGeoLayer *)
vector< int > GetNeighborsType(void) const