42 double intercept(
double tx,
double ty,
double x0_track,
double y0_track)
const;
53 TVectorD
getEndPoint(
int elementID,
int sign = -1)
const;
118 TMatrixD
rotM = TMatrixD(3, 3);
141 void loadAlignment(
const std::string& alignmentFile_chamber,
const std::string& alignmentFile_hodo,
const std::string& alignmentFile_prop);
153 planes[index].
x0 = val;
159 planes[index].
y0 = val;
165 planes[index].
z0 = val;
172 return planes[index].
x0;
176 return planes[index].
y0;
180 return planes[index].
z0;
186 return map_detectorID.find(detectorName)!=map_detectorID.end() ? map_detectorID.at(detectorName) : 0;
190 return map_detectorName.find(detectorID)!=map_detectorName.end() ? map_detectorName.at(detectorID) :
"";
207 int getTriggerLv(
int detectorID) {
return map_detid_triggerlv[detectorID]; }
232 double getInterception(
int detectorID,
double tx,
double ty,
double x0,
double y0)
const {
return planes[detectorID].
intercept(tx, ty, x0, y0); }
233 double getInterceptionFast(
int detectorID,
double tx,
double ty,
double x0,
double y0)
const;
234 double getInterceptionFast(
int detectorID,
double x_exp,
double y_exp)
const {
return planes[detectorID].
getW(x_exp, y_exp); }
235 double getDCA(
int detectorID,
int elementID,
double tx,
double ty,
double x0,
double y0);
238 void getMeasurement(
int detectorID,
int elementID,
double& measurement,
double& dmeasurement);
240 void getEndPoints(
int detectorID,
int elementID, TVectorD& ep1, TVectorD& ep2);
241 void getEndPoints(
int detectorID,
int elementID, TVector3& ep1, TVector3& ep2);
242 void get2DBoxSize(
int detectorID,
int elementID,
double& x_min,
double& x_max,
double& y_min,
double& y_max);
243 void getWireEndPoints(
int detectorID,
int elementID,
double& x_min,
double& x_max,
double& y_min,
double& y_max);
249 bool isInTime(
int detectorID,
double tdcTime);
258 bool isInPlane(
int detectorID,
double x,
double y);
259 bool isInElement(
int detectorID,
int elementID,
double x,
double y,
double tolr = 0.);
303 static void UseDbSvc(
const bool val) { use_dbsvc = val; }
312 bool calibration_loaded;
315 double xmin_kmag, xmax_kmag;
316 double ymin_kmag, ymax_kmag;
317 double zmin_kmag, zmax_kmag;
320 std::map<std::string, int> map_detectorID;
321 std::map<int, std::string> map_detectorName;
324 std::map<int, int> map_detid_triggerlv;
327 std::map<std::pair<int, int>,
double> map_wirePosition;
330 std::map<std::pair<int, int>, TVectorD> map_endPoint1;
331 std::map<std::pair<int, int>, TVectorD> map_endPoint2;
339 static bool use_dbsvc;
void loadMilleAlignment(const std::string &alignmentFile_mille)
void ELOSS_ABSORBER(const double v)
virtual void set_DoubleFlag(const std::string &name, const double flag)
int getTriggerLv(int detectorID)
double Z_FMAG_BEND() const
std::string getDetectorName(const int &detectorID) const
void printAlignPar()
Debugging print of the content.
double getPlaneWOffset(int detectorID)
double getWirePosition(int elementID) const
void init()
Initialization, either from MySQL or from ascii file.
double getInterceptionFast(int detectorID, double x_exp, double y_exp) const
double getDetectorY0(const std::string detectorName) const
double getSintheta(int detectorID) const
double getCellWidth(int detectorID)
double intercept(double tx, double ty, double x0_track, double y0_track) const
double getTantheta(int detectorID) const
void Z_REF(const double v)
double getYinStereoPlane(int detectorID, double x, double u)
Convert the stereo hits to Y value.
double getPlaneWOffset(int detectorID, int moduleID)
std::vector< double > elementPos
double getW(double x, double y) const
double getPlaneCenterX(int detectorID)
double ELOSS_KFMAG() const
void setDetectorZ0(const std::string detectorName, const double val)
virtual double get_DoubleFlag(const std::string &name) const
double getPlaneCenterY(int detectorID)
double getUinStereoPlane(int detectorID, double x, double y)
double getRotationInX(int detectorID)
double getPlaneResolution(int detectorID) const
TVectorD getEndPoint(int elementID, int sign=-1) const
double getX(double w, double y) const
double FMAG_LENGTH() const
double getKMAGDownstream()
double Z_ABSORBER() const
void get2DBoxSize(int detectorID, int elementID, double &x_min, double &x_max, double &y_min, double &y_max)
double Z_UPSTREAM() const
void Z_ST1(const double v)
double getDetectorX0(const std::string detectorName) const
void Z_UPSTREAM(const double v)
bool isInTime(int detectorID, double tdcTime)
void Z_ST2(const double v)
void Z_KFMAG_BEND(const double v)
bool isInElement(int detectorID, int elementID, double x, double y, double tolr=0.)
double Z_KFMAG_BEND() const
double getPlaneOverlap(int detectorID) const
void close()
Close the geometry service before exit or starting a new one.
void loadCalibration(const std::string &calibrateFile)
TSpline3 * getRTCurve(int detectorID)
void Z_ABSORBER(const double v)
double ELOSS_ABSORBER() const
double getInterception(int detectorID, double tx, double ty, double x0, double y0) const
Get the interception of a line an a plane.
bool findPatternInDetector(int detectorID, std::string pattern)
void FMAG_LENGTH(const double v)
void Z_DUMP(const double v)
double getDCA(int detectorID, int elementID, double tx, double ty, double x0, double y0)
double getPlaneZOffset(int detectorID)
double getRotationInZ(int detectorID)
double getY(double x, double w) const
bool isInKMAG(double x, double y)
double getPlaneSpacing(int detectorID) const
double getInterceptionFast(int detectorID, double tx, double ty, double x0, double y0) const
friend std::ostream & operator<<(std::ostream &os, const Plane &plane)
int getPlaneType(int detectorID) const
double getPlaneScaleX(int detectorID)
std::vector< int > getDetectorIDs(std::string pattern)
void setDetectorX0(const std::string detectorName, const double val)
TODO temp solution to overwrite the y0 of a plane.
double getPlaneScaleZ(int detectorID)
double getPlaneScaleY(int detectorID)
double getRotationInY(int detectorID)
double getCostheta(int detectorID) const
void Z_ST3(const double v)
static GeomSvc * instance()
singlton instance
double FMAG_HOLE_LENGTH() const
void Z_KMAG_BEND(const double v)
void toLocalDetectorName(std::string &detectorName, int &eID)
Convert the official detectorName to local detectorName.
static void UseDbSvc(const bool val)
int getExpElementID(int detectorID, double pos_exp)
int getDetectorID(const std::string &detectorName) const
Get the plane position.
double getPlaneCenterZ(int detectorID)
double FMAG_HOLE_RADIUS() const
void getEndPoints(int detectorID, int elementID, TVectorD &ep1, TVectorD &ep2)
Plane getPlane(int detectorID) const
int getPlaneNElements(int detectorID)
double getXinStereoPlane(int detectorID, double u, double y)
void Z_TARGET(const double v)
double getPlanePhiOffset(int detectorID)
void getMeasurement(int detectorID, int elementID, double &measurement, double &dmeasurement)
Convert the detectorID and elementID to the actual hit position.
void FMAG_HOLE_RADIUS(const double v)
#define nDarkPhotonPlanes
double Z_DOWNSTREAM() const
double Z_KMAG_BEND() const
Getter/setters for a set of fixed parameters - should not be changed unless absolutely necessary...
bool isInPlane(int detectorID, double x, double y)
See if a point is in a plane.
bool isCalibrationLoaded()
Calibration related.
void getWireEndPoints(int detectorID, int elementID, double &x_min, double &x_max, double &y_min, double &y_max)
void Z_FMAG_BEND(const double v)
void setDetectorY0(const std::string detectorName, const double val)
double getDriftDistance(int detectorID, double tdcTime)
void ELOSS_KFMAG(const double v)
void Z_DOWNSTREAM(const double v)
double getDetectorZ0(const std::string detectorName) const
double getPlanePosition(int detectorID) const
void loadAlignment(const std::string &alignmentFile_chamber, const std::string &alignmentFile_hodo, const std::string &alignmentFile_prop)
int getHodoStation(const int detectorID) const
void FMAG_HOLE_LENGTH(const double v)