CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcGeomSvc Class Reference

#include <MdcGeomSvc.h>

+ Inheritance diagram for MdcGeomSvc:

Classes

struct  AdjCandiTgtLine2D
 forms a line in x-y space, ax + by + c = 0 More...
 

Public Member Functions

 MdcGeomSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~MdcGeomSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &inc)
 this handle function is prepared for special use
 
const MdcGeoWire *const Wire (unsigned id)
 
const MdcGeoWire *const Wire (unsigned lyrid, unsigned wirid)
 
const MdcGeoLayer *const Layer (unsigned id)
 
const MdcGeoSuper *const SuperLayer (unsigned id)
 
const MdcGeoGeneral *const GeneralLayer (unsigned id)
 
const MdcGeoMisc *const Misc (void)
 
const MdcGeoEnd *const End (unsigned id)
 
const int getWireSize ()
 
const int getLayerSize ()
 
const int getSuperLayerSize ()
 
const int getGeneralLayerSize ()
 
const int getSegmentNo ()
 
void Dump ()
 
 MdcGeomSvc (const std::string &name, ISvcLocator *svcloc)
 
 ~MdcGeomSvc ()
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown)
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
void handle (const Incident &inc)
 
const MdcGeoWire *const Wire (unsigned id)
 
const MdcGeoWire *const Wire (unsigned lyrid, unsigned wirid)
 
const MdcGeoLayer *const Layer (unsigned id)
 
const MdcGeoSuper *const SuperLayer (unsigned id)
 
const MdcGeoGeneral *const GeneralLayer (unsigned id)
 
const MdcGeoMisc *const Misc (void)
 
const MdcGeoEnd *const End (unsigned id)
 
const int getWireSize ()
 
const int getLayerSize ()
 
const int getSuperLayerSize ()
 
const int getGeneralLayerSize ()
 
const int getSegmentNo ()
 
void Dump ()
 
vector< HepPoint3DgetAdjacentIntersectionShape (const MdcGeoWire *wireA, const MdcGeoWire *wireB)
 get touching shape of 2 adjacent layer wires.
return vertexs of intersection shape if the wires' sensitive area connects. return empty if not. points does go in order
 
vector< double > getAdjacentIntersectionBounds (const MdcGeoWire *wireA, const MdcGeoWire *wireB)
 get bounding box in \varphi and z of touching shape of 2 adjacent layer wires.
 
HepPoint3D getAdjacentIntersectionPointFast (const MdcGeoWire *wireA, const MdcGeoWire *wireB)
 find the z where points on wireA, wireB has same phi. point is given as avg(A(z),B(z))
 
HepPoint3D getAdjacentIntersectionPointSlower (const MdcGeoWire *wireA, const MdcGeoWire *wireB)
 
vector< AdjCandiTgtLine2DgetAdjacentCandidateWithDriftCircle (const MdcGeoWire *wireA, const MdcGeoWire *wireB, double driftA, double driftB)
 give the lines that is tangent to both drift circles at the approximate z that the wires cross. require wireA != wireB.
 
vector< AdjCandiTgtLine2DgetAdjacentCandidateWithDriftCircle (const MdcGeoWire *wireA, const MdcGeoWire *wireB, double driftA, double driftB, double expectedZ)
 give the lines that is tangent to both drift circles at certain z. require wireA != wireB.
 
void testAdjacentIntersection ()
 
- Public Member Functions inherited from IMdcGeomSvc

Static Public Member Functions

static bool getSagFlag (void)
 
static bool getSagFlag (void)
 
- Static Public Member Functions inherited from IMdcGeomSvc
static const InterfaceID & interfaceID ()
 
static const InterfaceID & interfaceID ()
 

Static Public Attributes

static bool m_doSag = true
 
static bool m_readAlignParDataBase = true
 
static bool m_nomcalignment =true
 

Detailed Description

Constructor & Destructor Documentation

◆ MdcGeomSvc() [1/2]

MdcGeomSvc::MdcGeomSvc ( const std::string & name,
ISvcLocator * svcloc )

Definition at line 30 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

30 : Service(name, svcloc) {
31 if(getenv("MDCGEOMSVCROOT")){
32 m_alignFilePath = std::string(getenv("MDCGEOMSVCROOT"))+std::string("/share/MdcAlignPar.dat");
33 //std::cout<<" the MDC alignment file: "<<m_alignFilePath<<std::endl;
34
35 m_wirePosFilePath = std::string(getenv("MDCGEOMSVCROOT"))+std::string("/share/WirePosCalib.dat");
36 //std::cout<<" the MDC wire position file: "<<m_wirePosFilePath<<std::endl;
37
38 m_wireTensionFilePath = std::string(getenv("MDCGEOMSVCROOT"))+std::string("/share/mdcWireTension.dat");
39 //std::cout<<" the MDC wire tension file: "<<m_wireTensionFilePath<<std::endl;
40
41 }
42 else {
43 std::cout<<"A fatal error, contact wangjk..."<<std::endl;
44 }
45
46 declareProperty("doSag", m_doSag = true);
47 declareProperty("readAlignParDataBase", m_readAlignParDataBase = true);
48 declareProperty("mcnoalignment",m_nomcalignment=true);
49 declareProperty("wholeShiftX",m_wholeShiftX = 0.);
50 declareProperty("wholeShiftY",m_wholeShiftY = 0.);
51 declareProperty("wholeShiftZ",m_wholeShiftZ = 0.);
52 declareProperty("wholeRotatX",m_wholeRotatX = 0.);
53 declareProperty("wholeRotatY",m_wholeRotatY = 0.);
54 declareProperty("wholeRotatZ",m_wholeRotatZ = 0.);
55 declareProperty("alignFilePath",m_alignFilePath);
56 declareProperty("wirePosFilePath",m_wirePosFilePath);
57 declareProperty("wireTensionFilePath",m_wireTensionFilePath);
58 declareProperty("useCGEM",m_useCgem = true);
59
60
61}

◆ ~MdcGeomSvc() [1/2]

MdcGeomSvc::~MdcGeomSvc ( )

Definition at line 113 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

113 {
114 for(vector<MdcGeoLayer*>::iterator it1 = fLayers.begin(); it1 != fLayers.end(); it1++) delete *it1;
115 for(vector<MdcGeoSuper*>::iterator it2 = fSupers.begin(); it2 != fSupers.end(); it2++) delete *it2;
116 for(vector<MdcGeoWire*>::iterator it3 = fWires.begin(); it3 != fWires.end(); it3++) delete *it3;
117 for(vector<MdcGeoEnd*>::iterator it4 = fEnd.begin(); it4 != fEnd.end(); it4++) delete *it4;
118 fGenerals.clear();
119 fWires.clear();
120 fLayers.clear();
121 fSupers.clear();
122 fEnd.clear();
123}

◆ MdcGeomSvc() [2/2]

MdcGeomSvc::MdcGeomSvc ( const std::string & name,
ISvcLocator * svcloc )

◆ ~MdcGeomSvc() [2/2]

MdcGeomSvc::~MdcGeomSvc ( )

Member Function Documentation

◆ Dump() [1/2]

void MdcGeomSvc::Dump ( )
virtual

Implements IMdcGeomSvc.

Definition at line 696 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

696{}

Referenced by main().

◆ Dump() [2/2]

void MdcGeomSvc::Dump ( )
virtual

Implements IMdcGeomSvc.

◆ End() [1/2]

const MdcGeoEnd *const MdcGeomSvc::End ( unsigned id)

Definition at line 815 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

815 {
816 if (id < fEnd.size())
817 return fEnd[id];
818
819 return 0;
820 }

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ End() [2/2]

const MdcGeoEnd *const MdcGeomSvc::End ( unsigned id)

◆ finalize() [1/2]

StatusCode MdcGeomSvc::finalize ( )
virtual

Definition at line 107 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

107 {
108 MsgStream log(messageService(), name());
109 log << MSG::INFO << name() << ": End of Run" << endreq;
110 return StatusCode::SUCCESS;
111}

Referenced by main().

◆ finalize() [2/2]

virtual StatusCode MdcGeomSvc::finalize ( )
virtual

◆ GeneralLayer() [1/2]

const MdcGeoGeneral *const MdcGeomSvc::GeneralLayer ( unsigned id)
virtual

Implements IMdcGeomSvc.

Definition at line 802 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

802 {
803 if (id < fGenerals.size())
804 return & fGenerals[id];
805
806 return 0;
807 }

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ GeneralLayer() [2/2]

const MdcGeoGeneral *const MdcGeomSvc::GeneralLayer ( unsigned id)
virtual

Implements IMdcGeomSvc.

◆ getAdjacentCandidateWithDriftCircle() [1/2]

vector< MdcGeomSvc::AdjCandiTgtLine2D > MdcGeomSvc::getAdjacentCandidateWithDriftCircle ( const MdcGeoWire * wireA,
const MdcGeoWire * wireB,
double driftA,
double driftB )

give the lines that is tangent to both drift circles at the approximate z that the wires cross. require wireA != wireB.

calls getAdjacentCandidateWithDriftCircle() with given Z. z calculated from center of bounds given in getAdjacentIntersectionBounds(); if no bound avaliable (the 2 wires has no neighbor), no line is returnd

Parameters
wireA,wireBthe 2 wires
driftA,driftBthe 2 drifts
Returns
vector<CLHEP::Hep2Vector>

Definition at line 1687 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1687 {
1688 std::vector<double> bound=getAdjacentIntersectionBounds(wireA, wireB);
1689 //[phiL,phiU, zL,zU]
1690 double expectedZ;
1691 if (bound.size()==4)expectedZ=(bound[3]+bound[2])/2;
1692 else {
1693 vector<MdcGeomSvc::AdjCandiTgtLine2D> ret;
1694 return ret ;
1695 }
1696 return getAdjacentCandidateWithDriftCircle(wireA, wireB, driftA, driftB,expectedZ);
1697}
vector< AdjCandiTgtLine2D > getAdjacentCandidateWithDriftCircle(const MdcGeoWire *wireA, const MdcGeoWire *wireB, double driftA, double driftB)
give the lines that is tangent to both drift circles at the approximate z that the wires cross....
vector< double > getAdjacentIntersectionBounds(const MdcGeoWire *wireA, const MdcGeoWire *wireB)
get bounding box in \varphi and z of touching shape of 2 adjacent layer wires.

Referenced by getAdjacentCandidateWithDriftCircle(), and testAdjacentIntersection().

◆ getAdjacentCandidateWithDriftCircle() [2/2]

vector< MdcGeomSvc::AdjCandiTgtLine2D > MdcGeomSvc::getAdjacentCandidateWithDriftCircle ( const MdcGeoWire * wireA,
const MdcGeoWire * wireB,
double driftA,
double driftB,
double expectedZ )

give the lines that is tangent to both drift circles at certain z. require wireA != wireB.

inf is used to rep uninitialized value. gives AdjCandiTgtLine2D as the lines. mid of two tangent points are provided with AdjCandiTgtLine2D::location(). further check AdjCandiTgtLine2D.

Parameters
wireA,wireBthe 2 wires
driftA,driftBthe 2 drifts
expectedZthe z to calc
Returns
vector<MdcGeomSvc::AdjCandiTgtLine2D>

Definition at line 1588 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1588 {
1589
1590 HepPoint3D A1=wireA->Forward();
1591 // HepPoint3D A2(wireA->GetX(expectedZ), wireA->GetY(expectedZ), expectedZ);
1592 HepPoint3D A3=wireA->Backward();
1593 HepPoint3D B1=wireB->Forward(); // is -
1594 // HepPoint3D B2(wireB->GetX(expectedZ), wireB->GetY(expectedZ), expectedZ);
1595 HepPoint3D B3=wireB->Backward();
1596 HepPoint3D directionA=(A3-A1);
1597 HepPoint3D directionB=(B3-B1);
1598 HepPoint3D directionABSurface=directionA.cross(directionB); // perp to the surface.
1599 if (directionABSurface.dot(A1)<0)
1600 directionABSurface=-directionABSurface; // make it outwards
1601 HepPoint3D directionABSurface2D=directionABSurface;
1602 directionABSurface2D.setZ(0);
1603 // double directionABSurface_mag=directionABSurface.mag();
1604 // HepPoint3D directionAlongAB_2D=A2-B2; // along the surface
1605 // double directionAlongAB_2D_mag=directionAlongAB_2D.mag();
1606
1607 // static int runcount=0;
1608 // {
1609 // runcount++;
1610 // if (runcount<5){
1611 // cout<<"debug_out:"<<__LINE__<<" "<<directionAlongAB_2D.x()<<' '<<directionAlongAB_2D.y()<<" "<<directionAlongAB_2D_mag<<endl;
1612 // }
1613 // }
1614 CLHEP::Hep2Vector pA(wireA->GetX(expectedZ),wireA->GetY(expectedZ));
1615 CLHEP::Hep2Vector pB(wireB->GetX(expectedZ),wireB->GetY(expectedZ));
1616 vector<MdcGeomSvc::AdjCandiTgtLine2D> ret=_MdcGeomSvc_impl::tangents(pA,pB, driftA, driftB);
1617 CLHEP::Hep2Vector pMid=(pA+pB)/2;
1618 // line: x0 x + y0 y - x0 ^2 - y0 ^2 =0
1619 // that is, we take the line as the line tangent to the circle passing my point
1620 // double r2=pMid.mag2();
1621 double x0=pMid.x();
1622 double y0=pMid.y();
1623 for (size_t i=0; i<ret.size(); i++) {
1624 double a=ret[i].a;
1625 double b=ret[i].b;
1626 double c=ret[i].c;
1627 // double a2b2=a*a+b*b; //=1
1628 // double mres=(x0*b - y0 * a);
1629 // if (abs(mres)<_MdcGeomSvc_impl::EPS){
1630 // // the root of perp for pMid against line.
1631 // ret[i].x0=AdjCandiTgtLine2D::INFTY;
1632 // ret[i].y0=AdjCandiTgtLine2D::INFTY;
1633 // ret[i].z0=expectedZ;
1634 // continue;
1635 // }
1636 // double x=(r2 * b + c * y0)/mres;
1637 // // double y=-(a*x+c)/b; //what if b ==0.
1638 // double y=(c*x0+a*r2)/(-mres);
1639 double x=(b*b*x0 - a*b*y0 - a*c); // .../a2b2
1640 double y=(-a*b*x0 + a*a*y0 - b*c);
1641
1642 ret[i].x0=x;
1643 ret[i].y0=y;
1644 ret[i].z0=expectedZ;
1645 HepPoint3D directionLine(b,-a,0);// is this right?
1646 if (directionLine.dot(HepPoint3D(x,y,0))<0)
1647 directionLine = -directionLine;
1648 HepPoint3D directionLineRotate90(-directionLine.y(),directionLine.x(),0);// spin pi/2 anti-clock.
1649 //double directionLine_mag=directionLine.mag(); // should be 1;
1650 //ret[i].angle3D=asin(directionLine.dot(directionABSurface )/(directionLine_mag*directionABSurface_mag));
1651 //double cosAngle2D=directionLine.dot(directionAlongAB_2D)/(directionLine_mag*directionAlongAB_2D_mag);
1652
1653 // double sinAngle3D=directionLine.dot(directionABSurface )/(directionABSurface_mag);
1654 // if (sinAngle3D>1 && sinAngle3D < 1 + _MdcGeomSvc_impl::EPS) sinAngle3D=1;
1655 // if (sinAngle3D<-1 && sinAngle3D > -1 - _MdcGeomSvc_impl::EPS)sinAngle3D=-1;
1656 // ret[i].angle3D=asin(sinAngle3D);
1657 ret[i].angle2D=directionLineRotate90.angle(directionABSurface);
1658 ret[i].angle3D=directionLineRotate90.angle(directionABSurface2D);
1659 // double cosAngle2D=directionLine.dot(directionAlongAB_2D)/(directionAlongAB_2D_mag);
1660 // if (cosAngle2D>1 && cosAngle2D < 1+ _MdcGeomSvc_impl::EPS)cosAngle2D=1;
1661 // if (cosAngle2D<-1 && cosAngle2D > -1 - _MdcGeomSvc_impl::EPS) cosAngle2D=-1;
1662 // // in test, rounding errors can make the cosAngle>1 when it is supposed to be 1. we revert that effect here.
1663 // ret[i].angle2D=acos(cosAngle2D);
1664 // {
1665 // if (runcount<5){
1666 // cout<<"debug_out:"<<__LINE__<<" "<<directionLine.x()<<' '<<directionLine.y()<<" "<<directionLine_mag<< " "<<directionLine.dot(directionAlongAB_2D)/(directionLine_mag*directionAlongAB_2D_mag)<<endl;
1667 // }
1668 // }
1669
1670 }// adding point of Hit.
1671
1672 return ret;
1673
1674}
Double_t x[10]
double GetX(const double z) const
double GetY(const double z) const
void tangents(CLHEP::Hep2Vector c, double r1, double r2, vector< MdcGeomSvc::AdjCandiTgtLine2D > &ans)
find tangent. should have returned optional<line>, but ok..

◆ getAdjacentIntersectionBounds()

vector< double > MdcGeomSvc::getAdjacentIntersectionBounds ( const MdcGeoWire * wireA,
const MdcGeoWire * wireB )

get bounding box in \varphi and z of touching shape of 2 adjacent layer wires.

Parameters
wireA
wireB
Returns
vector<double> empty if no touch. [phiL,phiU, zL,zU] if touching. may have phiL<0 if the box goes over phi=0. (circular)

Definition at line 1298 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1298 {
1299 vector<double> ret;
1300 vector<HepPoint3D> vertexs=getAdjacentIntersectionShape(wireA, wireB);
1301 if (vertexs.size()==0) return ret;
1302 else{
1303 // double maxZAllowed=std::max(
1304 // std::max(wireA->Backward().z(),wireB->Backward().z()),
1305 // std::max(wireA->Forward().z(), wireB->Forward().z())
1306 // );
1307 // double minZAllowed=std::min(
1308 // std::min(wireA->Forward().z(), wireB->Forward().z()),
1309 // std::min(wireA->Backward().z(),wireB->Backward().z())
1310 // );
1311
1312 // vertexs.push_back(vertexs[0]);
1313
1314 double phiL,phiU, zL,zU;
1315 bool firstp=true;
1316
1317 for (size_t i=0;i<vertexs.size()-1;i++){
1318 HepPoint3D p1=vertexs[i];
1319 // HepPoint3D p2=vertexs[i+1];
1320 // int sgn1=0;
1321 // int sgn2=0; // for vertex 1,2. 0 for in range, 1 for >max, -1 for <min
1322 // if (p1.z() > maxZAllowed) sgn1=1;
1323 // else if (p1.z() < minZAllowed) sgn1 = -1;
1324 // if (p2.z() > maxZAllowed) sgn2=1;
1325 // else if (p2.z() < minZAllowed) sgn2 = -1;
1326
1327 // if (sgn1==sgn2 && sgn1 !=0){// both at outside
1328 // continue;
1329 // }
1330 // else if (sgn1==sgn2 && sgn1 ==0){ // both at inside
1331
1332 // }else {// crossed angle
1333 // HepPoint3D pu,pl;
1334 // pu = interpolate(p1,p2,maxZAllowed);
1335 // pl = interpolate(p1,p2,minZAllowed);
1336 // if (sgn1 ==1) p1 = pu;
1337 // if (sgn1 ==-1) p1 = pl;
1338 // if (sgn2 ==1) p2 = pu;
1339 // if (sgn2 ==-1) p2 = pl;
1340
1341 // }
1342
1343 if (firstp){ // hate this copy-pasting
1344 HepPoint3D vertex=p1;
1345 zL=vertex.z();
1346 zU=vertex.z();
1347 phiL=vertex.getPhi();
1348 phiU=vertex.getPhi();
1349 firstp=false;
1350 }
1351 else{
1352 HepPoint3D vertex=p1;
1353 zL=std::min(zL,vertex.z());
1354 zU=std::max(zU,vertex.z());
1355 phiL=std::min(phiL,vertex.getPhi());
1356 phiU=std::max(phiU,vertex.getPhi());
1357 }
1358 }
1359
1360
1361 if (phiU >=M_PI *1.5 && phiL <= M_PI *.5) {//damn hated circular phi problem
1362 HepPoint3D vertex=vertexs[0];
1363 double phi2=vertex.getPhi();
1364 if (phi2>M_PI *1.5)phi2 -=M_PI *2;
1365 phiL=phiU=phi2;
1366 for (size_t i=1;i<vertexs.size();i++){
1367 HepPoint3D vertex=vertexs[i];
1368 double phi2=vertex.getPhi();
1369 if (phi2>M_PI *1.5)phi2 -=M_PI *2;
1370 phiL=std::min(phiL,phi2);
1371 phiU=std::max(phiU,phi2);
1372 }
1373 }
1374
1375 ret.push_back(phiL);
1376 ret.push_back(phiU);
1377 ret.push_back(zL);
1378 ret.push_back(zU);
1379 return ret;
1380 }
1381}
Double_t phi2
#define M_PI
Definition TConstant.h:4
vector< HepPoint3D > getAdjacentIntersectionShape(const MdcGeoWire *wireA, const MdcGeoWire *wireB)
get touching shape of 2 adjacent layer wires. return vertexs of intersection shape if the wires' se...

Referenced by getAdjacentCandidateWithDriftCircle(), getAdjacentIntersectionPointSlower(), and testAdjacentIntersection().

◆ getAdjacentIntersectionPointFast()

HepPoint3D MdcGeomSvc::getAdjacentIntersectionPointFast ( const MdcGeoWire * wireA,
const MdcGeoWire * wireB )

find the z where points on wireA, wireB has same phi. point is given as avg(A(z),B(z))

Parameters
wireA
wireB
Returns
HepPoint3D

Definition at line 1249 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1249 {
1250 HepPoint3D A1=wireA->Forward();
1251 HepPoint3D A2=wireA->Backward(); // OOps!!!
1252 HepPoint3D B1=wireB->Forward(); // is -
1253 HepPoint3D B2=wireB->Backward(); // is +
1254 double phiA1=A1.getPhi();
1255 double phiA2=A2.getPhi();
1256 double phiB1=B1.getPhi();
1257 double phiB2=B2.getPhi();
1258 circularPhiExtend(phiA1, phiA2);
1259 circularPhiExtend(phiB1, phiB2);
1260 double dPhiA=phiA2-phiA1;
1261 double dZA=A2.z()-A1.z();
1262 double phiAatB1=phiA1+(B1.z()-A1.z())/dZA*dPhiA;
1263 double dPhiB=phiB2-phiB1;
1264 double dZB=B2.z()-B1.z();
1265 // we want z that makes phiA(z)==phiB(z),
1266 // that is phiAatB1+(z-zB1)*dPhiA/dZA == phiB1+(z-zB1)*dPhiB/dZB
1267 double z=B1.z()+(phiAatB1-phiB1)/(dPhiB/dZB-dPhiA/dZA);
1268 return HepPoint3D(
1269 (wireA->GetX(z)+wireB->GetX(z))/2,
1270 (wireA->GetY(z)+wireB->GetY(z))/2,
1271 z
1272 );
1273}
HepGeom::Point3D< double > HepPoint3D
Definition Gam4pikp.cxx:37

◆ getAdjacentIntersectionPointSlower()

HepPoint3D MdcGeomSvc::getAdjacentIntersectionPointSlower ( const MdcGeoWire * wireA,
const MdcGeoWire * wireB )

Definition at line 1275 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1275 {
1276 vector<double> bounds = getAdjacentIntersectionBounds(wireA,wireB);
1277 HepPoint3D ret(1./0,1./0,1./0);
1278 if (bounds.empty()) return ret;
1279 double z=(bounds[2]+bounds[3])/2;
1280 return HepPoint3D(
1281 (wireA->GetX(z)+wireB->GetX(z))/2,
1282 (wireA->GetY(z)+wireB->GetY(z))/2,
1283 z
1284 );
1285
1286}

◆ getAdjacentIntersectionShape()

vector< HepPoint3D > MdcGeomSvc::getAdjacentIntersectionShape ( const MdcGeoWire * wireA,
const MdcGeoWire * wireB )

get touching shape of 2 adjacent layer wires.
return vertexs of intersection shape if the wires' sensitive area connects. return empty if not. points does go in order

Parameters
wireA
wireB
Returns
vector<HepPoint3D> return 4 vertexs of intersection parallelogram if the wires' sensitive area connects. return empty if not.

Definition at line 1045 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1045 {
1046 vector<HepPoint3D> ret;
1047
1048 //to dbg: b MdcGeomSvc.cxx:MdcGeomSvc::getAdjacentIntersectionShape
1049
1050 HepPoint3D A1=wireA->Forward();
1051 HepPoint3D A2=wireA->Backward(); // OOps!!!
1052 HepPoint3D B1=wireB->Forward(); // is -
1053 HepPoint3D B2=wireB->Backward(); // is +
1054
1055 double maxZAllowed=(
1056 std::max(wireA->Backward().z(),wireB->Backward().z())
1057 // std::max(wireA->Forward().z(), wireB->Forward().z())
1058 );
1059 double minZAllowed=(
1060 std::min(wireA->Forward().z(), wireB->Forward().z())
1061 // std::min(wireA->Backward().z(),wireB->Backward().z())
1062 );
1063
1064 HepPoint3D directionR=(A1+A2+B1+B2)/4;// in general, should be (almost) perpendicular to line A and B
1065 directionR.setZ(0);
1066 directionR.setMag(1); // now a directional vector.
1067 // HepPoint3D directionZ(0,0,1);
1068 // HepPoint3D directionPhi=directionR.cross(directionZ);
1069
1070 const MdcGeoWire* wireAl=this->Wire(static_cast<unsigned int>(wireA->GetNeighborIDType1()));
1071 //const MdcGeoWire* wireA2=this->Wire(static_cast<unsigned int>(wireA->GetNeighborIDType2()));
1072 const MdcGeoWire* wireB1=this->Wire(static_cast<unsigned int>(wireB->GetNeighborIDType1()));
1073 // const MdcGeoWire* wireB2=this->Wire(static_cast<unsigned int>(wireB->GetNeighborIDType2()));
1074 double typicalWidthA=(wireAl->Forward() - wireA->Forward()).mag();
1075 double typicalWidthB=(wireB1->Forward() - wireB->Forward()).mag(); // using dist at endplate;
1076
1077 // double radiusLayerA=this->Layer(wireA->Layer())->Radius();
1078 // double radiusLayerB=this->Layer(wireB->Layer())->Radius();
1079 // double typicalLayerThickness=(radiusLayerB-radiusLayerA)/(wireB->Layer()-wireA->Layer());
1080 // double dWAdr=typicalWidthA/typicalLayerThickness*2; // hope we have a better alternative.
1081 // double dWBdr=typicalWidthB/typicalLayerThickness*2;
1082
1083 // if we have r implemented, this will be calced from dr and dWAdr
1084 double widthAtSurfaceA=typicalWidthA;
1085 double widthAtSurfaceB=typicalWidthB;
1086 // double minWidth=min(widthAtSurfaceA,widthAtSurfaceB);
1087
1088 //double centerZ=getClosestZ(wireA,wireB);
1089 //double rA=wireA->GetX(centerZ);
1090
1091 double surfaceA=directionR.dot((A1+A2)/2); // centerZ
1092 double surfaceB=directionR.dot((B1+B2)/2);
1093 // double surfaceMid=(surfaceA+surfaceB)/2;
1094 double surfaceDiff=(surfaceB-surfaceA);
1095
1096 // so the midsurface: any X that directionR.dot(X)==surfaceMid
1097 HepPoint3D A1m=A1+ surfaceDiff/2*directionR;
1098 HepPoint3D A2m=A2+ surfaceDiff/2*directionR;
1099 HepPoint3D B1m=B1- surfaceDiff/2*directionR;
1100 HepPoint3D B2m=B2- surfaceDiff/2*directionR;
1101 // HepPoint3D d1m=
1102
1103 HepPoint3D direction1m=B1m - A1m;
1104 direction1m.setZ(0);
1105 {
1106 HepPoint3D direction2m=B2m - A2m;
1107 direction2m.setZ(0);
1108 if (direction2m.mag2() > direction1m.mag()) direction1m = direction2m;
1109 }
1110 direction1m.setMag(1);
1111
1112 //HepPoint3D center=getIntersection(A1m,A2m, B1m, B2m );
1113 HepPoint3D directionA=(A2-A1);directionA/=directionA.z();
1114 HepPoint3D directionB=(B2-B1);directionB/=directionB.z();
1115 HepPoint3D deltaA=direction1m*(widthAtSurfaceA/2); // A1->B1 direction
1116 HepPoint3D deltaB=direction1m*(widthAtSurfaceB/2); // A1->B1 direction
1117
1118 if ((directionA-directionB).mag2()<= 0.01*0.01){ // we know wire distance ~ 10 mm so a 10^-3 level error is allowed.
1119 // if parallel
1120 if (direction1m.mag2()>squared(widthAtSurfaceA+widthAtSurfaceB)/4) {// have no relation at all.
1121 return ret;
1122 // donothing. let it return.
1123 }
1124 else{// has interection
1125 ret.push_back(B1m-deltaB);
1126 ret.push_back(A1m+deltaA);
1127 ret.push_back(A2m+deltaA);
1128 ret.push_back(B2m-deltaB);
1129 }// if parallel and has intersection: intersection is a parallelogram, with a pair of lines tangent to Z
1130 }
1131 else{// expect a parallelogram. Z: not now. we want 3, 4, 5 or 6 angle shape . take care!
1132
1133 HepPoint3D Ptop=getIntersection(A1m+deltaA,directionA,B1m-deltaB,directionB); // appears wrong size..
1134 HepPoint3D Prht=getIntersection(A1m+deltaA,directionA,B1m+deltaB,directionB);
1135 HepPoint3D Plft=getIntersection(A1m-deltaA,directionA,B1m-deltaB,directionB);
1136 HepPoint3D Pbot=getIntersection(A1m-deltaA,directionA,B1m+deltaB,directionB);
1137
1138 if (Ptop.z() < Pbot.z()) std::swap(Ptop,Pbot);
1139
1140 HepPoint3D Pmtp=Prht.z()>Plft.z()? Prht: Plft; // median top
1141 HepPoint3D Pmbt=Prht.z()>Plft.z()? Plft: Prht; // median bottom
1142
1143 HepPoint3D PointsAtMaxZ[2]; //maxz or top
1144 int PointsAtMaxZCount=0;
1145 HepPoint3D PointsAtMinZ[2];
1146 int PointsAtMinZCount=0;
1147 HepPoint3D PointsLeftGood[1]={Plft};
1148 int PointsLeftGoodCount=1;
1149 HepPoint3D PointsRightGood[1]={Prht};
1150 int PointsRightGoodCount=1;
1151
1152 // a chain of ifs
1153 if (Ptop.z()<=maxZAllowed){
1154 PointsAtMaxZ[0]=Ptop;
1155 PointsAtMaxZCount=1;
1156 }else if (Ptop.z()>maxZAllowed && maxZAllowed>=Pmtp.z() ){ // only this 2
1157 PointsAtMaxZ[0]=interpolate(Ptop,Plft,maxZAllowed);//L
1158 PointsAtMaxZ[1]=interpolate(Ptop,Prht,maxZAllowed);//R
1159 PointsAtMaxZCount=2;
1160 }else if (Pmtp.z()>maxZAllowed && maxZAllowed>= Pmbt.z() ){ // midian
1161 PointsAtMaxZ[0]=interpolate(Ptop,Pmbt,maxZAllowed);// Top-mbot
1162 PointsAtMaxZ[1]=interpolate(Pmtp,Pbot,maxZAllowed);// mrop-Bot
1163 PointsAtMaxZCount=2;
1164 if (Plft==Pmtp) {// lft is higher
1165 std::swap(PointsAtMaxZ[0],PointsAtMaxZ[1]); // now 0=Left, 0-Right
1166 PointsLeftGoodCount=0; // so remove left point
1167 }else{ // rht is higher
1168 PointsRightGoodCount=0;
1169 }
1170
1171 // glad i choose not to play it in order
1172 }else if (Pmbt.z()>maxZAllowed && maxZAllowed>= Pbot.z() ){ // lower
1173 PointsAtMaxZ[0]=interpolate(Pbot,Plft,maxZAllowed);//L
1174 PointsAtMaxZ[1]=interpolate(Pbot,Prht,maxZAllowed);//R
1175 PointsAtMaxZCount=2;
1176 PointsLeftGoodCount=PointsRightGoodCount=0; // remove both
1177 }else{ // no---- we got nothing at all
1178 return ret;
1179 }
1180 // and then with minZAllowed
1181 if ( minZAllowed <=Pbot.z() ){ //
1182 PointsAtMinZ[0]=Pbot;
1183 PointsAtMinZCount=1;
1184 }else if (Pbot.z() < minZAllowed && minZAllowed <=Pmbt.z()){ // lower.
1185 PointsAtMinZ[0]=interpolate(Pbot,Plft,minZAllowed);//L //TODO: change to Pbot
1186 PointsAtMinZ[1]=interpolate(Pbot,Prht,minZAllowed);//R //TODO: change to Pbot
1187 PointsAtMinZCount=2;
1188 }else if (Pmbt.z() < minZAllowed && minZAllowed <=Pmtp.z()){// mid.
1189 PointsAtMinZ[0]=interpolate(Ptop,Pmbt,minZAllowed);// Top-mbot
1190 PointsAtMinZ[1]=interpolate(Pmtp,Pbot,minZAllowed);// mrop-Bot
1191 PointsAtMinZCount=2;
1192 if (Plft==Pmtp) {// lft is higher
1193 std::swap(PointsAtMaxZ[0],PointsAtMaxZ[1]); // now 0=Left, 0-Right
1194 PointsRightGoodCount=0; // so remove lower point
1195 }else{ // rht is higher
1196 PointsLeftGoodCount=0;
1197 }
1198 }else if (Pmtp.z() < minZAllowed && minZAllowed <=Ptop.z()){// higher
1199 PointsAtMinZ[0]=interpolate(Ptop,Plft,minZAllowed);//L
1200 PointsAtMinZ[1]=interpolate(Ptop,Prht,minZAllowed);//R
1201 PointsAtMinZCount=2;
1202 PointsRightGoodCount=PointsLeftGoodCount=0;
1203 }else{
1204 return ret;
1205 }
1206
1207 // now insert items in clockwise order.
1208 for (int i=0;i<PointsAtMaxZCount;i++){
1209 ret.push_back(PointsAtMaxZ[i]);
1210 }
1211 for (int i=0;i<PointsRightGoodCount;i++){
1212 ret.push_back(PointsRightGood[i]);
1213 }
1214 for (int i=PointsAtMinZCount-1;i>=0;i--){//
1215 ret.push_back(PointsAtMinZ[i]);
1216 }
1217 for (int i=0;i<PointsLeftGoodCount;i++){
1218 ret.push_back(PointsLeftGood[i]);
1219 }
1220
1221
1222 }
1223 return ret;
1224
1225}
const MdcGeoWire *const Wire(unsigned id)

Referenced by getAdjacentIntersectionBounds(), and testAdjacentIntersection().

◆ getGeneralLayerSize() [1/2]

const int MdcGeomSvc::getGeneralLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 686 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

687{
688 return fGenerals.size();
689}

◆ getGeneralLayerSize() [2/2]

const int MdcGeomSvc::getGeneralLayerSize ( )
virtual

Implements IMdcGeomSvc.

◆ getLayerSize() [1/2]

const int MdcGeomSvc::getLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 676 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

677{
678 return fLayers.size();
679}

Referenced by DotsConnection::initialize(), DotsHelixFitter::initialize(), MdcDetector::MdcDetector(), and KalFitAlg::set_Mdc().

◆ getLayerSize() [2/2]

const int MdcGeomSvc::getLayerSize ( )
virtual

Implements IMdcGeomSvc.

◆ getSagFlag() [1/2]

bool MdcGeomSvc::getSagFlag ( void )
static

Definition at line 823 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

823 {
824
825 return m_doSag;
826}

Referenced by MdcGeoWire::Sag().

◆ getSagFlag() [2/2]

static bool MdcGeomSvc::getSagFlag ( void )
static

◆ getSegmentNo() [1/2]

const int MdcGeomSvc::getSegmentNo ( )

Definition at line 691 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

692{
693 return fEnd.size();
694}

Referenced by BesMdcGeoParameter::InitFromSvc(), and DotsConnection::initialize().

◆ getSegmentNo() [2/2]

const int MdcGeomSvc::getSegmentNo ( )

◆ getSuperLayerSize() [1/2]

const int MdcGeomSvc::getSuperLayerSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 681 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

682{
683 return fSupers.size();
684}

Referenced by DotsConnection::initialize(), MdcDetector::MdcDetector(), and KalFitAlg::set_Mdc().

◆ getSuperLayerSize() [2/2]

const int MdcGeomSvc::getSuperLayerSize ( )
virtual

Implements IMdcGeomSvc.

◆ getWireSize() [1/2]

const int MdcGeomSvc::getWireSize ( )
virtual

Implements IMdcGeomSvc.

Definition at line 671 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

672{
673 return fWires.size();
674}

Referenced by DotsConnection::initialize(), MdcDetector::MdcDetector(), and KalFitAlg::set_Mdc().

◆ getWireSize() [2/2]

const int MdcGeomSvc::getWireSize ( )
virtual

Implements IMdcGeomSvc.

◆ handle() [1/2]

void MdcGeomSvc::handle ( const Incident & inc)

this handle function is prepared for special use

Definition at line 743 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

743 {
744 MsgStream log( messageService(), name() );
745 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
746 IDataProviderSvc* m_eventSvc;
747 Gaudi::svcLocator()->service("EventDataSvc", m_eventSvc, true);
748 SmartDataPtr<Event::EventHeader> eventHeader(m_eventSvc,"/Event/EventHeader");
749 if (!eventHeader) {
750 log << MSG::FATAL << "Could not find Event Header" << endreq;
751 }
752 if (m_updataalign) return;
753 if (inc.type() == "NewRun" ){
754 log << MSG::DEBUG << "Begin Event" << endreq;
755 clean();
756 m_updataalign = true;
757 if(m_nomcalignment&&m_mindex==0) {
758 int RunNo=eventHeader->runNumber();
759 if(RunNo<0) m_readAlignParDataBase=false ;
760 else m_readAlignParDataBase=true;
761 m_mindex+=1;
762 cout<<"m__RunNo="<<RunNo<<"m_mindex="<<m_mindex<<endl;
763 }
764 //std::cout<<"############"<<m_readAlignParDataBase<<std::endl;
765 ReadFilePar();
766 }
767}

◆ handle() [2/2]

void MdcGeomSvc::handle ( const Incident & inc)

◆ initialize() [1/2]

StatusCode MdcGeomSvc::initialize ( )
virtual

Definition at line 73 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

73 {
74 MsgStream log(messageService(), name());
75 log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
76
77 StatusCode sc = Service::initialize();
78 if ( sc.isFailure() ) return sc;
79 m_mindex=0;
80 m_updataalign = false;
81 IIncidentSvc* incsvc;
82 sc = service("IncidentSvc", incsvc);
83 int priority = 100;
84 if( sc.isSuccess() ){
85 incsvc -> addListener(this, "NewRun", priority);
86 }
87
88 // ReadFilePar(); // get geometry data from file SimUtil/dat/Mdc.txt
89 // Fill(); // get geometry data from Database
90
91 sc = service("CalibDataSvc", m_pCalibDataSvc, true);
92
93 if ( !sc.isSuccess() ) {
94 log << MSG::ERROR
95 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
96 << endreq;
97 return sc;
98 } else {
99 log << MSG::DEBUG
100 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
101 << endreq;
102 }
103 ReadFilePar();
104 return StatusCode::SUCCESS;
105}

Referenced by main().

◆ initialize() [2/2]

virtual StatusCode MdcGeomSvc::initialize ( )
virtual

◆ Layer() [1/2]

const MdcGeoLayer *const MdcGeomSvc::Layer ( unsigned id)
virtual

◆ Layer() [2/2]

const MdcGeoLayer *const MdcGeomSvc::Layer ( unsigned id)
virtual

Implements IMdcGeomSvc.

◆ Misc() [1/2]

const MdcGeoMisc *const MdcGeomSvc::Misc ( void )

Definition at line 810 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

810 {
811 return & fMisc;
812}

Referenced by BesMdcGeoParameter::InitFromSvc().

◆ Misc() [2/2]

const MdcGeoMisc *const MdcGeomSvc::Misc ( void )

◆ queryInterface() [1/2]

StatusCode MdcGeomSvc::queryInterface ( const InterfaceID & riid,
void ** ppvUnknown )
virtual

Definition at line 63 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

63 {
64
65 if ( IID_IMdcGeomSvc.versionMatch(riid) ) {
66 *ppvInterface = static_cast<IMdcGeomSvc*> (this);
67 } else {
68 return Service::queryInterface(riid, ppvInterface) ;
69 }
70 return StatusCode::SUCCESS;
71}

◆ queryInterface() [2/2]

virtual StatusCode MdcGeomSvc::queryInterface ( const InterfaceID & riid,
void ** ppvUnknown )
virtual

◆ SuperLayer() [1/2]

const MdcGeoSuper *const MdcGeomSvc::SuperLayer ( unsigned id)
virtual

Implements IMdcGeomSvc.

Definition at line 794 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

794 {
795 if (id < fSupers.size())
796 return fSupers[id];
797
798 return 0;
799 }

◆ SuperLayer() [2/2]

const MdcGeoSuper *const MdcGeomSvc::SuperLayer ( unsigned id)
virtual

Implements IMdcGeomSvc.

◆ testAdjacentIntersection()

void MdcGeomSvc::testAdjacentIntersection ( )

Definition at line 1384 of file MdcGeomSvc-00-01-42/src/MdcGeomSvc.cxx.

1384 {
1385 clock_t time0=clock();
1386 ofstream fileout("testAdjacentIntersection.csv");
1387 MsgStream log(messageService(), name());
1388 log << MSG::WARNING<<__PRETTY_FUNCTION__<<endreq;
1389 const char * comma=", ";
1390 const char * endll="\n";
1391 fileout << "# A_layer" << comma
1392 << "A_wireID" << comma
1393 << "A_WirePhi(0)" << comma
1394 // << "A_FWirePos_phi" << comma
1395 // << "A_BWirePos_phi" << comma
1396 << "A_Forward_phi" << comma
1397 << "A_Backward_phi" << comma
1398 << "B_layer" << comma
1399 << "B_wireID" << comma
1400 << "B_WirePhi(0)" << comma
1401 << "B_Forward_phi" << comma
1402 << "B_Backward_phi" << comma
1403
1404 << "phiL,phiU, zL,zU" << comma
1405
1406 << "wireA.x0, wireA.y0"<<comma
1407 << "wireB.x0, wireB.y0"<<comma
1408
1409 << "line.a,line.b,line.c,line.x0, line.y0, line.z0, line.Angle2d, line.angle3d, line.cosAngleR"<< comma
1410 << "line.a,line.b,line.c,line.x0, line.y0, line.z0, line.Angle2d, line.angle3d, line.cosAngleR"<< comma
1411 << "line.a,line.b,line.c,line.x0, line.y0, line.z0, line.Angle2d, line.angle3d, line.cosAngleR"<< comma
1412 << "line.a,line.b,line.c,line.x0, line.y0, line.z0, line.Angle2d, line.angle3d, line.cosAngleR"<< comma
1413
1414 << "xa1,ya1,za1" << comma // wireA.Forward
1415 << "xa2,ya2,za2" << comma // wireA.Backward
1416 << "xb1,yb1,zb1" << comma // wireB.Forward
1417 << "xb2,yb2,zb2" << comma // wireB.Backward
1418 << "x1,y1,z1" << comma //getAdjacentIntersectionShape.x,y,z
1419 << "x2,y2,z2" << comma
1420 << "x3,y3,z3" << comma
1421 << "x4,y4,z4" << endll;
1422
1423 fileout << "# xn yn zn are coordinates of vertex" << endll;
1424 fileout << "# layer: ";
1425 for (unsigned i=0;i<43;++i){
1426 fileout<<comma<<i;
1427 }fileout << endll;
1428 fileout << "# layerRadius: ";
1429 for (unsigned i=0;i<43;++i){
1430 double r=this->Layer(i)->Radius();
1431 fileout<<comma<<r;
1432 }fileout << endll;
1433 fileout << "# distToNextLayerRadius: ";
1434 for (unsigned i=0;i<42;++i){
1435 double r=this->Layer(i+1)->Radius()-this->Layer(i)->Radius();
1436 fileout<<comma<<r;
1437 }fileout << endll;
1438
1439 for (size_t _wire_index=0;_wire_index<fWires.size();++_wire_index){
1440 const MdcGeoWire * wire=fWires[_wire_index];
1441 // if (wire->Id()!=1726) continue;
1442 std::vector<MdcGeoWire *> cross_neighbors=wire->GetNeighborType4();
1443 for (size_t _neighbor_index=0;_neighbor_index<cross_neighbors.size();_neighbor_index++){
1444 const MdcGeoWire * neighbor=cross_neighbors[_neighbor_index];
1445 if (abs(neighbor->Layer()-wire->Layer())!=1) continue;
1446 std::vector<HepPoint3D> shape=getAdjacentIntersectionShape(wire, neighbor);
1447 std::vector<double> bound=getAdjacentIntersectionBounds(wire, neighbor);
1448 vector<AdjCandiTgtLine2D> psblines=getAdjacentCandidateWithDriftCircle(wire,neighbor,10,10);
1449 fileout << wire->Layer() << comma
1450 << wire->Id() << comma
1451 << wire->WirePhi(0) << comma
1452 // << wire->FWirePos().getPhi()<< comma
1453 // << wire->BWirePos().getPhi()<< comma
1454 << wire->Forward().getPhi() << comma
1455 << wire->Backward().getPhi() << comma
1456
1457 << neighbor->Layer() << comma
1458 << neighbor->Id() << comma
1459 << neighbor->WirePhi(0) << comma
1460 << neighbor->Forward().getPhi() << comma
1461 << neighbor->Backward().getPhi() << comma;
1462 // << neighbor->FWirePos().getPhi()<<comma
1463 // << neighbor->BWirePos().getPhi()<<comma;
1464 // fileout<<"seg"<<comma;
1465 if (bound.empty()) {
1466 for (size_t i = 0; i < 4; ++i) fileout << 0. << comma;
1467 } else {
1468 for (size_t i = 0; i < bound.size(); i++){
1469 fileout << bound.at(i) << comma;
1470 }
1471 }
1472 // fileout<<"seg"<<comma;
1473 //"wireA.x0, wireA.y0, wireB.x0, wireB.y0"
1474 double Z0=0;
1475 if (!psblines.empty())Z0=psblines[0].z0;
1476
1477 fileout
1478 << wire ->GetX(Z0)<<comma
1479 << wire ->GetY(Z0)<<comma
1480 << neighbor->GetX(Z0) << comma
1481 << neighbor->GetY(Z0) << comma;
1482 // fileout<<"seg"<<comma;
1483 {
1484 for (size_t i = 0; i < psblines.size(); ++i)
1485 fileout
1486 <<psblines[i].a << comma
1487 <<psblines[i].b << comma
1488 <<psblines[i].c << comma
1489 <<psblines[i].x0 << comma
1490 <<psblines[i].y0 << comma
1491 <<psblines[i].z0 << comma
1492 <<psblines[i].angle2D << comma
1493 <<psblines[i].angle3D << comma
1494 <<psblines[i].angleWithR() << comma;
1495 for (size_t i = psblines.size(); i < 4; ++i)
1496 for (size_t ii = 0; ii < 9; ii++)
1497 fileout<<'0'<<comma;
1498 }
1499 // fileout<<"seg"<<comma;
1500 {
1501 HepPoint3D vertex;
1502 vertex=wire->Forward();
1503 fileout << vertex.x() << comma << vertex.y() << comma << vertex.z() <<comma;
1504 vertex=wire->Backward();
1505 fileout << vertex.x() << comma << vertex.y() << comma << vertex.z() <<comma;
1506 vertex=neighbor->Forward();
1507 fileout << vertex.x() << comma << vertex.y() << comma << vertex.z() <<comma;
1508 vertex=neighbor->Backward();
1509 fileout << vertex.x() << comma << vertex.y() << comma << vertex.z();// <<comma;
1510 }
1511 // fileout<<comma<<"seg";
1512 // if (shape.empty) // i dont want it to output. a csv don't need to be full-length
1513 for (size_t i = 0; i < shape.size(); i++){
1514 HepPoint3D vertex=shape[i];
1515 fileout <<comma<< vertex.x() << comma << vertex.y() << comma << vertex.z();
1516 //if (i+1<shape.size()) fileout<<comma;
1517 // alittle fix when shape is empty and it will lead to a trailing comma.
1518 }
1519 fileout<< endll;
1520
1521 }
1522 }
1523 clock_t time1=clock();
1524 cout<<"test_Adj_Complete, time="<<(time1-time0)*1000./CLOCKS_PER_SEC<<"ms"<<endl;
1525}
double abs(const EvtComplex &c)
vector< MdcGeoWire * > GetNeighborType4(void) const
double WirePhi(double z) const
const MdcGeoLayer *const Layer(unsigned id)

◆ Wire() [1/4]

◆ Wire() [2/4]

const MdcGeoWire *const MdcGeomSvc::Wire ( unsigned id)
virtual

Implements IMdcGeomSvc.

◆ Wire() [3/4]

const MdcGeoWire *const MdcGeomSvc::Wire ( unsigned lyrid,
unsigned wirid )
virtual

Implements IMdcGeomSvc.

Definition at line 778 of file bak_MdcGeomSvc-00-01-39/src/MdcGeomSvc.cxx.

778 {
779 if ((lyrid <fLayers.size()) && ((int) wirid < Layer(lyrid)->NCell()))
780 return fWires[Layer(lyrid)->Wirst() + wirid];
781
782 return 0;
783 }

◆ Wire() [4/4]

const MdcGeoWire *const MdcGeomSvc::Wire ( unsigned lyrid,
unsigned wirid )
virtual

Implements IMdcGeomSvc.

Member Data Documentation

◆ m_doSag

bool MdcGeomSvc::m_doSag = true
static

Definition at line 54 of file bak_MdcGeomSvc-00-01-39/MdcGeomSvc/MdcGeomSvc.h.

Referenced by getSagFlag(), and MdcGeomSvc().

◆ m_nomcalignment

bool MdcGeomSvc::m_nomcalignment =true
static

Definition at line 56 of file bak_MdcGeomSvc-00-01-39/MdcGeomSvc/MdcGeomSvc.h.

Referenced by handle(), and MdcGeomSvc().

◆ m_readAlignParDataBase

bool MdcGeomSvc::m_readAlignParDataBase = true
static

Definition at line 55 of file bak_MdcGeomSvc-00-01-39/MdcGeomSvc/MdcGeomSvc.h.

Referenced by handle(), and MdcGeomSvc().


The documentation for this class was generated from the following files: