Function to call all the sub-findlets.
181{
182
184 return;
185 }
186
187 for (auto& track : finalTracks) {
188
190 continue;
191 }
192
193 QualityEstimationResults refittedTrackEstimate;
195 auto sortedHits = track.getSortedHits();
196
200 sortedHits.push_back(&virtualIPSpacePoint);
201 }
202
203 std::sort(sortedHits.begin(), sortedHits.end(),
204 [](const SpacePoint * a, const SpacePoint * b) {return a->getPosition().Perp() < b->getPosition().Perp(); });
205
206 refittedTrackEstimate =
m_estimator->estimateQualityAndProperties(sortedHits);
207 }
208
209 std::vector<PXDIntercept> thisTracksIntercepts;
210 thisTracksIntercepts.reserve(8);
211
212 B2Vector3D momentumEstimate = track.getMomSeed();
214 momentumEstimate = *refittedTrackEstimate.
p;
215 }
216
217 const double trackPhi = momentumEstimate.
Phi();
218 const double trackTheta = momentumEstimate.
Theta();
219 const double tanTrackLambda =
tan(M_PI_2 - trackTheta);
220 const double trackRadius = momentumEstimate.
Perp() / (0.00299792458 *
m_bFieldZ) ;
221 const double trackCharge = track.getChargeSeed();
222
224 for (int layer = 1; layer <= 2; layer++) {
226
228 for (int ladder = 1; ladder <= (layer == 1 ? 8 : 12); ladder++) {
232
233
234 const double sensorLocalX = sensorPerpRadius - rotatedBeamSpotX;
235
236 double phiDiff = trackPhi - sensorPhi;
237 if (phiDiff < -M_PI) {
238 phiDiff += 2. * M_PI;
239 }
240 if (phiDiff > M_PI) {
241 phiDiff -= 2. * M_PI;
242 }
243
244
245
246
247 if (fabs(phiDiff) > 0.25 * M_PI and fabs(phiDiff) < 0.75 * M_PI) {
248 continue;
249 }
250 if (fabs(phiDiff) > 0.75 * M_PI and fabs(tanTrackLambda) > 0.2 ) {
251 continue;
252 }
253
254
255
256
257
258 double relTrackCenterPhi = 0;
259 if (trackCharge < 0) {
260 relTrackCenterPhi = trackPhi - M_PI_2 - sensorPhi;
261 } else if (trackCharge > 0) {
262 relTrackCenterPhi = trackPhi + M_PI_2 - sensorPhi;
263 }
264 const double xCenter = trackRadius * cos(relTrackCenterPhi);
265 const double yCenter = trackRadius * sin(relTrackCenterPhi);
266
267
268 if ((trackRadius * trackRadius - (sensorLocalX - xCenter) * (sensorLocalX - xCenter)) < 0) {
269 continue;
270 }
271 const double ytmp =
sqrt(trackRadius * trackRadius - (sensorLocalX - xCenter) * (sensorLocalX - xCenter));
272 const double yplus = yCenter + ytmp + rotatedBeamSpotY;
273 const double yminus = yCenter - ytmp + rotatedBeamSpotY;
274
276 trackRadius) +
279
280 const double localUPositionPlus = yplus -
c_shiftY + correctionterm;
281 const double localUPositionMinus = yminus -
c_shiftY + correctionterm;
283
284
287 continue;
288 }
289
290
296
298 for (int sensor = 1; sensor <= 2; sensor++) {
299
301
302 double localVPosition = z - shiftZ;
303 double localVPositionPlus = zPlus - shiftZ;
304 double localVPositionMinus = zMinus - shiftZ;
305
308
309 const VxdID sensorID = VxdID(layer, ladder, sensor);
310
311
314 PXDIntercept intercept;
315 intercept.
setCoorU(localUPositionPlus);
316 intercept.
setCoorV(localVPositionPlus);
319 thisTracksIntercepts.push_back(intercept);
320 }
321
324 PXDIntercept intercept;
325 intercept.
setCoorU(localUPositionMinus);
326 intercept.
setCoorV(localVPositionMinus);
329 thisTracksIntercepts.push_back(intercept);
330 }
331 }
332 }
333 }
334 }
335
336 const double omega = 1. / trackRadius;
341 for (auto& intercept : thisTracksIntercepts) {
342 const VxdID& interceptSensorID = intercept.
getSensorID();
343
344 double uCoordinate = intercept.
getCoorU();
345 double vCoordinate = intercept.
getCoorV();
346
348 interceptSensorID));
349
350 int interceptUCell = currentSensor->
getUCellID(uCoordinate, vCoordinate,
false);
351 int interceptVCell = currentSensor->
getVCellID(vCoordinate,
false);
352 int nUCells = currentSensor->
getUCells();
353 int nVCells = currentSensor->
getVCells();
354
355 unsigned short uSize = (interceptSensorID.
getLayerNumber() == 1 ? uSizeL1 : uSizeL2);
356 unsigned short vSize = (interceptSensorID.
getLayerNumber() == 1 ? vSizeL1 : vSizeL2);
359 }
362 }
363
365 short uCellDownLeft = interceptUCell - uSize / 2;
366 short vCellDownLeft = interceptVCell - vSize / 2;
367
369 short uCellUpRight = interceptUCell + uSize / 2;
370 short vCellUpRight = interceptVCell + vSize / 2;
371
372 if (uCellDownLeft >= nUCells or vCellDownLeft >= nVCells or uCellUpRight < 0 or vCellUpRight < 0) {
373 continue;
374 }
375
376 if (uCellDownLeft < 0) {
377 uCellDownLeft = 0;
378 }
379 if (vCellDownLeft < 0) {
380 vCellDownLeft = 0;
381 }
382
383
384 if (uCellUpRight >= nUCells) {
385 uCellUpRight = nUCells - 1;
386 }
387 if (vCellUpRight >= nVCells) {
388 vCellUpRight = nVCells - 1;
389 }
390
391 m_storeROIs.appendNew(ROIid(uCellDownLeft, uCellUpRight, vCellDownLeft, vCellUpRight, interceptSensorID));
392 }
393
394 }
395}
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