11 #include <tracking/spacePointCreation/SpacePoint.h>
12 #include <vxd/dataobjects/VxdID.h>
13 #include <pxd/reconstruction/PXDRecoHit.h>
14 #include <svd/reconstruction/SVDRecoHit.h>
21 const VXD::SensorInfoBase* aSensorInfo) : m_clustersAssigned( {
true,
true}), m_vxdID(pxdCluster->getSensorID())
25 if (aSensorInfo ==
nullptr) {
30 m_position = aSensorInfo->
pointToGlobal(TVector3(pxdCluster->getU(), pxdCluster->getV(), 0),
true);
32 setPositionError(pxdCluster->getUSigma(), pxdCluster->getVSigma(), aSensorInfo);
34 m_normalizedLocal = convertLocalToNormalizedCoordinates({ pxdCluster->getU(), pxdCluster->getV() },
35 m_vxdID, aSensorInfo);
37 m_sensorType = aSensorInfo->getType();
47 B2ASSERT(
"You have to insert 1 or two SVD Clusters, but gave: " << clusters.size(), ((clusters.size() == 1)
48 || (clusters.size() == 2)));
51 for (
auto && cluster : clusters) {
52 B2ASSERT(
"An SVDCluster Pointer is a nullptr!", cluster !=
nullptr);
56 if (clusters.size() == 2) {
57 B2ASSERT(
"Clusters are on different Sensors.", clusters[0]->getSensorID() == clusters[1]->getSensorID());
58 B2ASSERT(
"Clusters are of same direction type.", clusters[0]->isUCluster() != clusters[1]->isUCluster());
62 m_vxdID = clusters[0]->getSensorID();
65 if (aSensorInfo == NULL) {
77 const SVDCluster* vCluster(NULL), *uCluster(NULL);
79 if (aCluster->isUCluster() ==
true) {
81 uCoord = aCluster->getPosition();
82 uSigma = aCluster->getPositionSigma();
86 vCoord = aCluster->getPosition();
87 vSigma = aCluster->getPositionSigma();
93 vCluster != NULL && uCluster != NULL)
102 uSigma = aSensorInfo->
getUSize(vCoord) / sqrt(12.);
105 vSigma = aSensorInfo->
getVSize() / sqrt(12.);
112 if (aCluster->isUCluster() ==
true)
123 vector< genfit::PlanarMeasurement > collectedMeasurements;
127 if (
getType() == VXD::SensorInfoBase::SensorType::SVD) {
129 auto relatedClusters = this->getRelationsTo<SVDCluster>(
"ALL");
130 for (
unsigned i = 0; i < relatedClusters.size(); i++) {
131 collectedMeasurements.push_back(
SVDRecoHit(relatedClusters[i]));
134 }
else if (
getType() == VXD::SensorInfoBase::SensorType::PXD) {
137 auto relatedClusters = this->getRelationsTo<PXDCluster>(
"ALL");
138 for (
unsigned i = 0; i < relatedClusters.size(); i++) {
139 collectedMeasurements.push_back(
PXDRecoHit(relatedClusters[i]));
143 B2FATAL(
"unknown detector type");
146 B2DEBUG(50,
"SpacePoint::getGenfitCompatible(): collected " << collectedMeasurements.size() <<
" meaturements");
148 return collectedMeasurements;
153 const std::pair<double, double>& hitLocal,
VxdID vxdID,
158 if (aSensorInfo == NULL) {
166 double sensorSizeU = aSensorInfo->
getUSize(hitLocal.second);
167 double sensorSizeV = aSensorInfo->
getVSize();
169 double normalizedUPosition = (hitLocal.first + 0.5 * sensorSizeU) /
171 double normalizedVPosition = (hitLocal.second + 0.5 * sensorSizeV) / sensorSizeV;
173 boundaryEnforce(normalizedUPosition, normalizedVPosition, 0, 1 , 0, vxdID);
174 boundaryEnforce(normalizedVPosition, normalizedUPosition, 0, 1, 1, vxdID);
176 return { normalizedUPosition, normalizedVPosition };
182 const std::pair<double, double>& hitNormalized,
VxdID vxdID,
187 if (aSensorInfo == NULL) {
193 double localVPosition = (hitNormalized.second - 0.5) * aSensorInfo->
getVSize();
194 double uSizeAtHit = aSensorInfo->
getUSize(localVPosition);
195 double localUPosition = (hitNormalized.first - 0.5) * uSizeAtHit;
200 boundaryEnforce(localUPosition, localVPosition, -0.5 * uSizeAtHit, 0.5 * uSizeAtHit,
203 return { localUPosition, localVPosition };
211 if (aSensorInfo == NULL) {
216 return aSensorInfo->
pointToGlobal(TVector3(hitLocal.first, hitLocal.second, 0),
true);