Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "DetSegmentation/GridDriftChamber.h"
namespace dd4hep {
namespace DDSegmentation {
/// default constructor using an encoding string
GridDriftChamber::GridDriftChamber(const std::string& cellEncoding) : Segmentation(cellEncoding) {
// define type and description
_type = "GridDriftChamber";
_description = "Drift chamber segmentation in the global coordinates";
registerIdentifier("identifier_phi", "Cell ID identifier for phi", m_phiID, "phi");
registerParameter("delta_phi", "delta phi", m_delta_phi, 0., SegmentationParameter::LengthUnit);
}
GridDriftChamber::GridDriftChamber(const BitFieldCoder* decoder) : Segmentation(decoder) {
// define type and description
_type = "GridDriftChamber";
_description = "Drift chamber segmentation in the global coordinates";
registerIdentifier("identifier_phi", "Cell ID identifier for phi", m_phiID, "phi");
registerParameter("delta_phi", "delta phi", m_delta_phi, 0., SegmentationParameter::LengthUnit);
}
Vector3D GridDriftChamber::position(const CellID& /*cID*/) const {
Vector3D cellPosition = {0, 0, 0};
return cellPosition;
}
CellID GridDriftChamber::cellID(const Vector3D& /*localPosition*/, const Vector3D& globalPosition,
const VolumeID& vID) const {
CellID cID = vID;
double phi_hit = phiFromXY(globalPosition);
double posx = globalPosition.X;
double posy = globalPosition.Y;
int lphi = (int) (phi_hit/m_delta_phi);
_decoder->set(cID, m_phiID, lphi);
// std::cout << " myliu: "
// << " x: " << posx
// << " y: " << posy
//// << " pre: " << phi_pre
// << " phi_hit: " << phi_hit
// << " lphi: " << lphi
// << std::endl;
return cID;
}
REGISTER_SEGMENTATION(GridDriftChamber)
}
}