Belle II Software  release-05-01-25
PXDUtilities.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2021 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Qingyuan Liu *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/gearbox/Unit.h>
14 #include <framework/gearbox/Const.h>
15 #include <tracking/dataobjects/RecoTrack.h>
16 #include <genfit/MeasuredStateOnPlane.h>
17 #include <TVector3.h>
18 //#include <limits>
19 #include <math.h>
20 
21 namespace Belle2 {
27  namespace PXD {
28 
32  const int Z_Si = 14;
33  const double A_Si = 28.085;
34  const double rho_Si = 2.3290 * Unit::g_cm3;
43  inline double xiBeta2_L(const int Z = Z_Si,
44  const double A = A_Si,
45  const double rho = rho_Si,
46  const int z = 1)
47  {
48  const double K = 0.307075 * Unit::MeV * pow(Unit::cm, 2);
49  return K / 2 * Z / A * z * z * rho;
50  }
51 
58  inline double hbarWp(const int Z = Z_Si,
59  const double A = A_Si,
60  const double rho = rho_Si)
61  {
62  return std::sqrt(rho * Z / A) * 28.816 * Unit::eV;
63  }
64 
71  inline double getDeltaP(const double mom, const double length, const double mass = Const::electronMass)
72  {
73  double betaGamma = mom / mass;
74  if (betaGamma <= 100) return 0.0; // requirement of the formula.
75  double beta2 = 1. / (1. + 1. / betaGamma / betaGamma);
76  double xi = xiBeta2_L() * length / beta2;
77  return xi * log(2 * mass * xi / pow(hbarWp(), 2) + 0.2);
78  }
79 
81  inline unsigned short getPXDModuleID(const VxdID& sensorID)
82  {
83  return sensorID.getLayerNumber() * 1000 +
84  sensorID.getLadderNumber() * 10 +
85  sensorID.getSensorNumber();
86  }
87 
89  inline VxdID getVxdIDFromPXDModuleID(const unsigned short& id)
90  {
91  return VxdID(id / 1000, (id % 1000) / 10, id % 10);
92  }
93 
101  std::shared_ptr<TrackState> getTrackStateOnModule(const VXD::SensorInfoBase& pxdSensorInfo,
102  RecoTrack& recoTrack, double lambda = 0.0);
103 
104  } // end namespace PXD
106 } // end namespace Belle2
Belle2::PXD::rho_Si
const double rho_Si
Silicon density in g cm^-3.
Definition: PXDUtilities.h:42
Belle2::Unit::cm
static const double cm
Standard units with the value = 1.
Definition: Unit.h:57
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
Belle2::PXD::getPXDModuleID
unsigned short getPXDModuleID(const VxdID &sensorID)
Helper function to get DHE id like module id from VxdID.
Definition: PXDUtilities.h:89
genfit::MeasuredStateOnPlane
#StateOnPlane with additional covariance matrix.
Definition: MeasuredStateOnPlane.h:39
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2::VXD::SensorInfoBase
Base class to provide Sensor Information for PXD and SVD.
Definition: SensorInfoBase.h:40
Belle2::PXD::xiBeta2_L
double xiBeta2_L(const int Z=Z_Si, const double A=A_Si, const double rho=rho_Si, const int z=1)
xi = (K/2)*(Z/A)*z*z*(rho*L)/beta2 in MeV
Definition: PXDUtilities.h:51
Belle2::Const::electronMass
static const double electronMass
electron mass
Definition: Const.h:558
Belle2::PXD::hbarWp
double hbarWp(const int Z=Z_Si, const double A=A_Si, const double rho=rho_Si)
hbarWp = sqrt(rho*Z/A)*28.816 in eV
Definition: PXDUtilities.h:66
Belle2::PXD::TrackState
genfit::MeasuredStateOnPlane TrackState
Helper function to get a track state on a module.
Definition: PXDUtilities.h:108
Belle2::PXD::A_Si
const double A_Si
Atomic mass of silicon in g mol^-1.
Definition: PXDUtilities.h:41
Belle2::Unit::MeV
static const double MeV
[megaelectronvolt]
Definition: Unit.h:124
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::Unit::eV
static const double eV
[electronvolt]
Definition: Unit.h:122
Belle2::PXD::getVxdIDFromPXDModuleID
VxdID getVxdIDFromPXDModuleID(const unsigned short &id)
Helper function to get VxdID from DHE id like module iid.
Definition: PXDUtilities.h:97
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::PXD::getDeltaP
double getDeltaP(const double mom, const double length, const double mass=Const::electronMass)
helper function to estimate the most probable energy loss for a given track length.
Definition: PXDUtilities.h:79
Belle2::PXD::Z_Si
const int Z_Si
Const and Const expressions Only valid when g_mol is the default unit.
Definition: PXDUtilities.h:40
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106
Belle2::Unit::g_cm3
static const double g_cm3
Practical units with the value set at 1.
Definition: Unit.h:70