From d5600e3c7efae6f334c91b9b63a2dca024090185 Mon Sep 17 00:00:00 2001 From: myliu <201916234@mail.sdu.edu.cn> Date: Mon, 2 Nov 2020 20:07:06 +0800 Subject: [PATCH] The default centimeter unit in DD4hep --- Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h | 5 +++-- Detector/DetSegmentation/src/GridDriftChamber.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h b/Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h index ef39f692..465388fe 100644 --- a/Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h +++ b/Detector/DetSegmentation/DetSegmentation/GridDriftChamber.h @@ -23,7 +23,7 @@ typedef struct Layer double eps; double offset; Layer(){}; - Layer(double x, double y, double z, double k):layerphi(x),R(y),eps(z),offset(k){}; + Layer(double x, double y, double z, double k):layerphi(x),R(y),eps(z),offset(k){} bool operator < (const Layer &a) const { return layerphi < a.layerphi; @@ -46,7 +46,7 @@ public: const VolumeID& aVolumeID) const; virtual double distanceTrackWire(const CellID& cID, const TVector3& hit_start/*, const TVector3& hit_end*/) const; - double phi(const CellID& cID) const; +// double phi(const CellID& cID) const; inline double cell_Size() const { return m_cellSize; } inline double epsilon0() const { return m_epsilon0; } inline double detectorLength() const { return m_detectorLength; } @@ -122,6 +122,7 @@ public: protected: + double phi(const CellID& cID) const; std::map<int,LAYER> layer_params; // <layer, {layerphi, R, eps, offset}> std::map<int, std::vector<std::pair<TVector3, TVector3> >> m_wiresPositions; // < layer, vec<WireMidpoint, WireDirection> > diff --git a/Detector/DetSegmentation/src/GridDriftChamber.cpp b/Detector/DetSegmentation/src/GridDriftChamber.cpp index 3b0032e0..46d601be 100644 --- a/Detector/DetSegmentation/src/GridDriftChamber.cpp +++ b/Detector/DetSegmentation/src/GridDriftChamber.cpp @@ -81,8 +81,8 @@ double GridDriftChamber::distanceTrackWire(const CellID& cID, const TVector3& hi double phi_start = phi(cID); double phi_end = phi_start + returnAlpha(); - TVector3 Wstart = 10*returnWirePosition(phi_start, -1); // Convert from cm to mm - TVector3 Wend = 10*returnWirePosition(phi_end, 1); // Convert from cm to mm + TVector3 Wstart = returnWirePosition(phi_start, -1); // The default centimeter unit in DD4hep + TVector3 Wend = returnWirePosition(phi_end, 1); // The default centimeter unit in DD4hep // TVector3 a = hit_end - hit_start; TVector3 b = Wend - Wstart; -- GitLab