4#include "MdcGeomSvc/MdcGeoWire.h"
5#include "MdcGeomSvc/MdcGeomSvc.h"
16 const double L = (fForward - fBackward).mag();
18 return (L*L*1.184E-6/fTension);
34 fWireNeighborsID.push_back(
id);
35 fNeighborType.push_back(type);
39 fWireNeighbors.push_back(awire);
40 fNeighborType.push_back(type);
44 fWireNeighbors.push_back(awire);
45 fNeighborType.push_back(type);
46 fWireNeighborsID.push_back(
id);
50 return (fForward.x()-fBackward.x())*(z-fBackward.z())/(fForward.z()-fBackward.z())+fBackward.x();
54 return (fForward.y()-fBackward.y())*(z-fBackward.z())/(fForward.z()-fBackward.z())+fBackward.y();
58 std::vector<int> NeighborType3;
59 for(
unsigned i=0;i<fWireNeighborsID.size();i++){
60 if(fNeighborType.at(i)==3){
61 NeighborType3.push_back(fWireNeighborsID.at(i));
68 std::vector<int> NeighborType4;
69 for(
unsigned i=0;i<fWireNeighborsID.size();i++){
70 if(fNeighborType.at(i)==4){
71 NeighborType4.push_back(fWireNeighborsID.at(i));
78 std::vector<MdcGeoWire*> NeighborType3;
79 for(
unsigned i=0;i<fWireNeighbors.size();i++){
80 if(fNeighborType.at(i)==3){
81 NeighborType3.push_back(fWireNeighbors.at(i));
88 std::vector<MdcGeoWire*> NeighborType4;
89 for(
unsigned i=0;i<fWireNeighbors.size();i++){
90 if(fNeighborType.at(i)==4){
91 NeighborType4.push_back(fWireNeighbors.at(i));
99 std::vector<MdcGeoWire*> NeighborZType3;
101 double phi2,dPhi1,dPhi2,phiMax,phiMin;
104 if(NeighborType3.size()>0) {
105 dPhi2=
M_PI/double(NeighborType3.at(0)->Lyr()->NCell());
108 if(fabs(z)<NeighborType3.at(0)->Lyr()->Length()/2.){
109 for(
unsigned i=0;i<NeighborType3.size();i++){
110 phi2 =NeighborType3.at(i)->WirePhi(z);
111 if(
phi2>phiMin&&
phi2<phiMax) NeighborZType3.push_back(NeighborType3.at(i));
112 else if(phiMin>phiMax&&(
phi2>phiMin||
phi2<phiMax)) NeighborZType3.push_back(NeighborType3.at(i));
116 return NeighborZType3;
120 std::vector<MdcGeoWire*> NeighborZType4;
122 double phi2,dPhi1,dPhi2,phiMax,phiMin;
125 if(NeighborType4.size()>0) {
126 dPhi2=
M_PI/double(NeighborType4.at(0)->Lyr()->NCell());
130 for(
unsigned i=0;i<NeighborType4.size();i++){
131 phi2 =NeighborType4.at(i)->WirePhi(z);
132 if(
phi2>phiMin&&
phi2<phiMax) NeighborZType4.push_back(NeighborType4.at(i));
133 else if(phiMin>phiMax&&(
phi2>phiMin||
phi2<phiMax)) NeighborZType4.push_back(NeighborType4.at(i));
137 return NeighborZType4;
141 fWireNeighborsID.clear();
142 fWireNeighbors.clear();
143 fNeighborType.clear();
152 phi = acos(
x/sqrt(pow(
x,2.)+pow(y,2.)));
155 phi =2*
M_PI-acos(
x/sqrt(pow(
x,2.)+pow(y,2.)));
161 if(0<phi&&phi<2*
M_PI){
double GetX(const double z) const
vector< MdcGeoWire * > GetNeighborType3(void) const
vector< int > GetNeighborIDType4(void) const
double GetY(const double z) const
const double Sag(void) const
const double Sagz(const double z) const
vector< MdcGeoWire * > GetNeighborType4(void) const
double WirePhi(double z) const
vector< MdcGeoWire * > GetNeighboratZType3(double z) const
vector< MdcGeoWire * > GetNeighboratZType4(double z) const
void AddWireNeighbor(int id, int type)
vector< int > GetNeighborIDType3(void) const
double CalculatePhi(double phi) const
static bool getSagFlag(void)