Function to call all the sub-findlets.
180{
181
183 return;
184 }
185
186 for (auto& track : finalTracks) {
187
189 continue;
190 }
191
192 QualityEstimationResults refittedTrackEstimate;
194 auto sortedHits = track.getSortedHits();
195
199 sortedHits.push_back(&virtualIPSpacePoint);
200 }
201
202 std::sort(sortedHits.begin(), sortedHits.end(),
203 [](const SpacePoint * a, const SpacePoint * b) {return a->getPosition().Perp() < b->getPosition().Perp(); });
204
205 refittedTrackEstimate =
m_estimator->estimateQualityAndProperties(sortedHits);
206 }
207
208 std::vector<PXDIntercept> thisTracksIntercepts;
209 thisTracksIntercepts.reserve(8);
210
211 B2Vector3D momentumEstimate = track.getMomSeed();
213 momentumEstimate = *refittedTrackEstimate.
p;
214 }
215
216 const double trackPhi = momentumEstimate.
Phi();
217 const double trackTheta = momentumEstimate.
Theta();
218 const double tanTrackLambda =
tan(M_PI_2 - trackTheta);
219 const double trackRadius = momentumEstimate.
Perp() / (0.00299792458 *
m_bFieldZ) ;
220 const double trackCharge = track.getChargeSeed();
221
223 for (int layer = 1; layer <= 2; layer++) {
225
227 for (int ladder = 1; ladder <= (layer == 1 ? 8 : 12); ladder++) {
231
232
233 const double sensorLocalX = sensorPerpRadius - rotatedBeamSpotX;
234
235 double phiDiff = trackPhi - sensorPhi;
236 if (phiDiff < -M_PI) {
237 phiDiff += 2. * M_PI;
238 }
239 if (phiDiff > M_PI) {
240 phiDiff -= 2. * M_PI;
241 }
242
243
244
245
246 if (fabs(phiDiff) > 0.25 * M_PI and fabs(phiDiff) < 0.75 * M_PI) {
247 continue;
248 }
249 if (fabs(phiDiff) > 0.75 * M_PI and fabs(tanTrackLambda) > 0.2 ) {
250 continue;
251 }
252
253
254
255
256
257 double relTrackCenterPhi = 0;
258 if (trackCharge < 0) {
259 relTrackCenterPhi = trackPhi - M_PI_2 - sensorPhi;
260 } else if (trackCharge > 0) {
261 relTrackCenterPhi = trackPhi + M_PI_2 - sensorPhi;
262 }
263 const double xCenter = trackRadius * cos(relTrackCenterPhi);
264 const double yCenter = trackRadius * sin(relTrackCenterPhi);
265
266
267 if ((trackRadius * trackRadius - (sensorLocalX - xCenter) * (sensorLocalX - xCenter)) < 0) {
268 continue;
269 }
270 const double ytmp =
sqrt(trackRadius * trackRadius - (sensorLocalX - xCenter) * (sensorLocalX - xCenter));
271 const double yplus = yCenter + ytmp + rotatedBeamSpotY;
272 const double yminus = yCenter - ytmp + rotatedBeamSpotY;
273
275 trackRadius) +
278
279 const double localUPositionPlus = yplus -
c_shiftY + correctionterm;
280 const double localUPositionMinus = yminus -
c_shiftY + correctionterm;
282
283
286 continue;
287 }
288
289
295
297 for (int sensor = 1; sensor <= 2; sensor++) {
298
300
301 double localVPosition = z - shiftZ;
302 double localVPositionPlus = zPlus - shiftZ;
303 double localVPositionMinus = zMinus - shiftZ;
304
307
308 const VxdID sensorID = VxdID(layer, ladder, sensor);
309
310
313 PXDIntercept intercept;
314 intercept.
setCoorU(localUPositionPlus);
315 intercept.
setCoorV(localVPositionPlus);
318 thisTracksIntercepts.push_back(intercept);
319 }
320
323 PXDIntercept intercept;
324 intercept.
setCoorU(localUPositionMinus);
325 intercept.
setCoorV(localVPositionMinus);
328 thisTracksIntercepts.push_back(intercept);
329 }
330 }
331 }
332 }
333 }
334
335 const double omega = 1. / trackRadius;
340 for (auto& intercept : thisTracksIntercepts) {
341 const VxdID& interceptSensorID = intercept.
getSensorID();
342
343 double uCoordinate = intercept.
getCoorU();
344 double vCoordinate = intercept.
getCoorV();
345
347 interceptSensorID));
348
349 int interceptUCell = currentSensor->
getUCellID(uCoordinate, vCoordinate,
false);
350 int interceptVCell = currentSensor->
getVCellID(vCoordinate,
false);
351 int nUCells = currentSensor->
getUCells();
352 int nVCells = currentSensor->
getVCells();
353
354 unsigned short uSize = (interceptSensorID.
getLayerNumber() == 1 ? uSizeL1 : uSizeL2);
355 unsigned short vSize = (interceptSensorID.
getLayerNumber() == 1 ? vSizeL1 : vSizeL2);
358 }
361 }
362
364 short uCellDownLeft = interceptUCell - uSize / 2;
365 short vCellDownLeft = interceptVCell - vSize / 2;
366
368 short uCellUpRight = interceptUCell + uSize / 2;
369 short vCellUpRight = interceptVCell + vSize / 2;
370
371 if (uCellDownLeft >= nUCells or vCellDownLeft >= nVCells or uCellUpRight < 0 or vCellUpRight < 0) {
372 continue;
373 }
374
375 if (uCellDownLeft < 0) {
376 uCellDownLeft = 0;
377 }
378 if (vCellDownLeft < 0) {
379 vCellDownLeft = 0;
380 }
381
382
383 if (uCellUpRight >= nUCells) {
384 uCellUpRight = nUCells - 1;
385 }
386 if (vCellUpRight >= nVCells) {
387 vCellUpRight = nVCells - 1;
388 }
389
390 m_storeROIs.appendNew(ROIid(uCellDownLeft, uCellUpRight, vCellDownLeft, vCellUpRight, interceptSensorID));
391 }
392
393 }
394}
DataType Phi() const
The azimuth angle.
DataType Theta() const
The polar angle.
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
@ c_isActive
bit 11: SPTC is active (i.e.
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
double getCoorV() const
return the V coordinate of the intercept
VxdID::baseType getSensorID() const
return the sensor ID
double getCoorU() const
return the U coordinate of the intercept
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a reference to the SensorInfo of a given SensorID.
static GeoCache & getInstance()
Return a reference to the singleton instance.
int getVCells() const
Return number of pixel/strips in v direction.
@ VXD
Any type of VXD Sensor.
int getUCells() const
Return number of pixel/strips in u direction.
int getVCellID(double v, bool clamp=false) const
Return the corresponding pixel/strip ID of a given v coordinate.
int getUCellID(double u, double v=0, bool clamp=false) const
Return the corresponding pixel/strip ID of a given u coordinate.
baseType getLayerNumber() const
Get the layer id.
double m_radiusCorrectionFactorL2
Correction factor for radial bias for L2: factor * charge / radius.
unsigned short m_maximumROISizeV
maximum ROI size in v in pixel
double m_minimumROISizeUL1
Minimum size of ROI in u-direction on L1 in pixel.
const double c_ladderPhiL2[12]
Phi values of the ladders of L2.
B2Vector3D m_BeamSpotPosition
B2Vector3D actually containing the BeamSpot position. This will be used as the starting point of the ...
bool m_calculateROI
Calculate ROI in this findlet?
double m_multiplierVL1
Multiplier term for v-direction on L1.
double m_radiusCorrectionFactorL1
Correction factor for radial bias for L1: factor * charge / radius.
const double c_centerZShiftLayer2[2]
Shift of the center of the active area of each sensor in a ladder of layer 2 For use of mhp_z > (leng...
double m_minimumROISizeVL2
Minimum size of ROI in v-direction on L2 in pixel.
double m_multiplierUL2
Multiplier term for u-direction on L2.
const double c_centerZShiftLayer1[2]
Shift of the center of the active area of each sensor in a ladder of layer 1 For use of mhp_z > (leng...
double m_multiplierVL2
Multiplier term for v-direction on L2.
StoreArray< ROIid > m_storeROIs
ROIs StoreArray.
double m_sinPhiCorrectionFactor
Correction factor for the sin(phi) modulation.
const double c_activeSensorLength[2]
Length of the active region for L1 and L2.
const double c_sensorMaxY
Maximum y coordinate if x-axis is perpendicular to the sensor:
const double c_ladderPhiL1[8]
Phi values of the ladders of L1.
double m_tolerancePhi
Allowed tolerance (in radians) phi to create intercepts per sensor.
const double c_layerRadius[2]
Radius of the two layers.
bool m_addVirtualIP
Add a virtual IP for the refit?
StoreArray< PXDIntercept > m_storePXDIntercepts
PXDIntercepts StoreArray.
B2Vector3D m_BeamSpotPositionError
B2Vector3D actually containing the BeamSpot position error.
bool m_refit
Refit the tracks with m_ROIFitMethod.
double m_zPositionCorrectionFactor
Correction factor for the z position.
double m_cosPhiCorrectionFactor
Correction factor for the cos(phi) modulation.
std::unique_ptr< QualityEstimatorBase > m_estimator
pointer to the selected QualityEstimator
double m_bFieldZ
BField in Tesla.
double m_minimumROISizeVL1
Minimum size of ROI in v-direction on L1 in pixel.
const double c_shiftY
Shift of the center position in y if the x-axis is perpendicular to the sensor:
const double c_sensorMinY
PXD is shifted to create the windmill structure.
double m_minimumROISizeUL2
Minimum size of ROI in u-direction on L2 in pixel.
unsigned short m_maximumROISizeU
maximum ROI size in u in pixel
double m_multiplierUL1
Multiplier term in ROI size estimation For u: size = multiplier * 1/R + minimumROISize For v: size = ...
double m_toleranceZ
Allowed tolerance (in cm) in z to create intercepts per sensor.
const double c_activeSensorWidth
PXD sensors in L1 and L2 have the same size in u direction (=width):
B2Vector3< double > B2Vector3D
typedef for common usage with double
double tan(double a)
tan for double
double sqrt(double a)
sqrt for double
std::optional< B2Vector3D > p
momentum vector estimate from the QE