8#include <tracking/datcon/findlets/ToPXDExtrapolator.h>
9#include <tracking/datcon/utilities/DATCONHelpers.h>
10#include <tracking/dataobjects/PXDIntercept.h>
11#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
12#include <pxd/geometry/SensorInfo.h>
13#include <vxd/dataobjects/VxdID.h>
14#include <vxd/geometry/GeoCache.h>
15#include <framework/gearbox/Unit.h>
16#include <framework/core/ModuleParamList.h>
17#include <framework/core/ModuleParamList.templateDetails.h>
20using namespace TrackFindingCDC;
31 "Only extrapolate to PXD sensors within this value away from the track phi value, L1.",
35 "Only extrapolate to PXD sensors within this value away from the track phi value, L2.",
57 const std::vector<std::pair<double, double>>& vTracks,
58 std::vector<std::pair<VxdID, long>>& uExtrapolations, std::vector<std::pair<VxdID, long>>& vExtrapolations)
62 for (
auto& uTrack : uTracks) {
63 const double trackPhi = uTrack.first;
64 const double trackRadius = uTrack.second;
70 for (
auto& vTrack : vTracks) {
71 const double& trackLambda = -vTrack.first;
79 for (
auto& uExtrapolatedHit : uExtrapolations) {
80 const VxdID& uHitSensorID = uExtrapolatedHit.first;
82 for (
auto& vExtrapolatedHit : vExtrapolations) {
83 const VxdID& vHitSensorID = vExtrapolatedHit.first;
85 if (uHitSensorID != vHitSensorID) {
90 double uCoordinateInCM = uExtrapolatedHit.second *
Unit::nm;
91 double vCoordinateInCM = vExtrapolatedHit.second *
Unit::nm;
102 B2DEBUG(29,
"uExtrapolations.size: " << uExtrapolations.size() <<
" vExtrapolations.size: " << vExtrapolations.size());
106 std::vector<std::pair<VxdID, long>>& uExtrapolations)
109 for (uint ladder = 1; ladder <=
laddersPerLayer[layer - 1]; ladder++) {
110 double sensorPhi = M_PI / (
laddersPerLayer[layer - 1] / 2) * (ladder - 1);
111 if (sensorPhi > M_PI) {
112 sensorPhi -= 2. * M_PI;
115 double angleDiff = trackPhi - sensorPhi;
116 if (angleDiff > M_PI) {
117 angleDiff -= 2. * M_PI;
119 if (angleDiff < -M_PI) {
120 angleDiff += 2. * M_PI;
131 long localUPosition = y -
shiftY;
135 uExtrapolations.emplace_back(sensorID, localUPosition);
138 sensorID =
VxdID(layer, ladder, 2);
139 uExtrapolations.emplace_back(sensorID, localUPosition);
145 std::vector<std::pair<VxdID, long>>& vExtrapolations)
147 for (uint sensor = 1; sensor <= 2; sensor++) {
148 const long& sensorPerpRadius =
layerRadius[layer - 1];
152 const long globalz = sensorPerpRadius * tanLambda;
154 const long localVPosition = globalz - shiftZ;
155 if (localVPosition >= -lengthOfSensor / 2. && localVPosition <= lengthOfSensor / 2.) {
157 for (uint ladder = 1; ladder <=
laddersPerLayer[layer - 1]; ladder++) {
158 VxdID sensorID =
VxdID(layer, ladder, sensor);
159 vExtrapolations.emplace_back(sensorID, localVPosition);
The Module parameter list class.
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
void initialize() override
Receive and dispatch signal before the start of the event processing.
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
static const double nm
[nanometers]
void setVxdID(VxdID::baseType user_vxdID)
set the sensor ID
void setCoorU(double user_coorU)
set the U coordinate of the intercept
void setCoorV(double user_coorV)
set the V coordinate of the intercept
Class to uniquely identify a any structure of the PXD and SVD.
void addParameter(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
double sqrt(double a)
sqrt for double
long convertFloatToInt(double value, int power)
Convert float or double to long int for more similarity to the FPGA implementation.
Abstract base class for different kinds of events.