5#include <CLHEP/Units/PhysicalConstants.h>
6#include <CLHEP/Geometry/Point3D.h>
9#include "GaudiKernel/Algorithm.h"
11#include "MdcGeomSvc/MdcGeoWire.h"
12#include "MdcGeomSvc/MdcGeoLayer.h"
13#include "MdcGeomSvc/MdcGeoGeneral.h"
14#include "MdcGeomSvc/MdcGeoSuper.h"
15#include "MdcGeomSvc/MdcGeoMisc.h"
16#include "MdcGeomSvc/MdcGeoEnd.h"
17#include "GaudiKernel/IIncidentListener.h"
18#include "GaudiKernel/Service.h"
19#include "GaudiKernel/IInterface.h"
20#include "MdcGeomSvc/IMdcGeomSvc.h"
21#include "GaudiKernel/IDataProviderSvc.h"
22#include "GaudiKernel/IIncidentListener.h"
23#include "CLHEP/Vector/TwoVector.h"
30 MdcGeomSvc(
const std::string& name, ISvcLocator* svcloc );
33 virtual StatusCode
queryInterface(
const InterfaceID& riid,
void** ppvUnknown);
69 CLHEP::Hep2Vector ret(
b,-
a);
80 CLHEP::Hep2Vector directionR(
x0,
y0);
81 CLHEP::Hep2Vector dirRRot90(-
y0,
x0);
83 int sgn=dirRRot90.dot(dirL)>0;
84 return sgn*directionR.angle(dirL);
88 CLHEP::Hep2Vector ret(
x0,
y0);
121 void ReadTensionDataBase(std::vector<double> & wireTensionVec);
122 void ReadWirePosDataBase(std::vector<vector<double> > & wirePosVec);
123 void ReadAliParDataBase(vector<double>& Sx, vector<double>& Sy, vector<double>& Sz,
124 vector<double>& Rx, vector<double>& Ry, vector<double>& Rz);
126 void AddWireNeighbors();
127 void RenewWireNeighbors(
double range);
128 const int getAlignParIndexEast(
int lyr)
const;
129 const int getAlignParIndexWest(
int lyr)
const;
131 const double CalculatePhi(
double phi)
const;
137 double m_wholeShiftX;
138 double m_wholeShiftY;
139 double m_wholeShiftZ;
140 double m_wholeRotatX;
141 double m_wholeRotatY;
142 double m_wholeRotatZ;
144 std::string m_alignFilePath;
145 std::string m_wirePosFilePath;
146 std::string m_wireTensionFilePath;
150 double m_NeighborRange;
152 bool m_conf_testAdjacentIntersection;
154 vector <MdcGeoWire*> fWires;
155 vector <MdcGeoGeneral> fGenerals;
156 vector <MdcGeoLayer*> fLayers;
157 vector <MdcGeoSuper*> fSupers;
159 vector <MdcGeoEnd*> fEnd;
160 IDataProviderSvc* m_pCalibDataSvc;
static bool m_readAlignParDataBase
MdcGeomSvc(const std::string &name, ISvcLocator *svcloc)
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....
const MdcGeoSuper *const SuperLayer(unsigned id)
const MdcGeoWire *const Wire(unsigned id)
const MdcGeoGeneral *const GeneralLayer(unsigned id)
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))
void handle(const Incident &inc)
HepPoint3D getAdjacentIntersectionPointSlower(const MdcGeoWire *wireA, const MdcGeoWire *wireB)
const int getSuperLayerSize()
vector< double > getAdjacentIntersectionBounds(const MdcGeoWire *wireA, const MdcGeoWire *wireB)
get bounding box in \varphi and z of touching shape of 2 adjacent layer wires.
const MdcGeoEnd *const End(unsigned id)
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
virtual StatusCode finalize()
const MdcGeoLayer *const Layer(unsigned id)
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...
static bool getSagFlag(void)
const MdcGeoWire *const Wire(unsigned lyrid, unsigned wirid)
const int getGeneralLayerSize()
virtual StatusCode initialize()
void testAdjacentIntersection()
const MdcGeoMisc *const Misc(void)
static bool m_nomcalignment
forms a line in x-y space, ax + by + c = 0
CLHEP::Hep2Vector location()
static const double INFTY
double angleWithR()
returns the cosine of angle of the line with R at its location (x0,y0). note that location is the mid...
CLHEP::Hep2Vector direction()
get direction vector of a line. garanteed to be outwards