Belle II Software development
TrackPoint_t Struct Reference

Struct to hold variables for intersection points. More...

#include <PXDPerformanceStructs.h>

Public Member Functions

 TrackPoint_t ()
 Default constructor.
 
RecoTracksetValues (const PXDIntercept &pxdIntercept, const std::string &recoTracksName="", const double &mass=Const::electronMass)
 Update values from a PXDCluster.
 

Public Attributes

float x
 Global position in x.
 
float y
 Global position in y.
 
float z
 Global position in z.
 
float tol
 The variables below are included here as they can be calculated w.o.
 
float chargeMPV
 Expected charge in ADU.
 
bool inside
 True if it's inside the active region.
 

Detailed Description

Struct to hold variables for intersection points.

Definition at line 57 of file PXDPerformanceStructs.h.

Constructor & Destructor Documentation

◆ TrackPoint_t()

TrackPoint_t ( )
inline

Default constructor.

Definition at line 60 of file PXDPerformanceStructs.h.

60 : x(0.0), y(0.0), z(0.0),
61 tol(0.0), chargeMPV(0.0), inside(false) {}
bool inside
True if it's inside the active region.
float chargeMPV
Expected charge in ADU.
float tol
The variables below are included here as they can be calculated w.o.
float y
Global position in y.
float x
Global position in x.
float z
Global position in z.

Member Function Documentation

◆ setValues()

RecoTrack * setValues ( const PXDIntercept pxdIntercept,
const std::string &  recoTracksName = "",
const double &  mass = Const::electronMass 
)

Update values from a PXDCluster.

Parameters
pxdIntercepta PXDIntercept object.
recoTracksNameName of RecoTrack collection
massMass of the impinging particle
Returns
the pointer of the related RecoTrack object.

Definition at line 33 of file PXDPerformanceStructs.cc.

34 {
35 // Construct VxdID from its baseType (unsigned short)
36 VxdID sensorID(pxdIntercept.getSensorID());
37
38 //RelationVector<RecoTrack>
39 // DataStore::getRelationsWithObj<RecoTrack>(pxdIntercept);
40 auto recoTracks = pxdIntercept.getRelationsFrom<RecoTrack>(recoTracksName);
41
42 // The recoTracks collection shouldn't be empty
43 if (!recoTracks.size()) return nullptr;
44
45 // Propogate a track state back to the module of interest
46 // as PXDIntercept doesn't contain global track point,
47 // cos(incident angle), and the expected charge from the hit.
48 const VXD::SensorInfoBase& sensorInfo = VXD::GeoCache::getInstance().getSensorInfo(sensorID);
49 auto statePtr = getTrackStateOnModule(sensorInfo, *recoTracks[0]);
50 if (statePtr == nullptr) return nullptr; // shouldn't happen.
51 auto intersec = statePtr -> getPos();
52 auto localPoint = sensorInfo.pointToLocal(ROOT::Math::XYZVector(intersec), true);
53 auto intersec_p = statePtr -> getMom();
54 auto local_p = sensorInfo.vectorToLocal(ROOT::Math::XYZVector(intersec_p), true);
55
56 //inside = sensorInfo.inside(localPoint.X(), localPoint.Y(), 0., 0.);
57 inside = sensorInfo.inside(localPoint.X(), localPoint.Y());
58 x = intersec.X();
59 y = intersec.Y();
60 z = intersec.Z();
61 tol = cos(local_p.Theta());
62
63 // Estimate the charge MPV (in ADU) of the hit.
64 double length = sensorInfo.getThickness() / tol; // track path length
65 auto ADUToEnergy = PXD::PXDGainCalibrator::getInstance().getADUToEnergy(sensorID,
66 sensorInfo.getUCellID(pxdIntercept.getCoorU()),
67 sensorInfo.getVCellID(pxdIntercept.getCoorV()));
68 chargeMPV = getDeltaP(intersec_p.Mag(), length, mass) / ADUToEnergy;
69
70 // Return pointer of the relatd RecoTrack for accessing additional info.
71 return recoTracks[0];
72 }
float getADUToEnergy(VxdID id, unsigned int uid, unsigned int vid) const
Get conversion factor from ADU to energy.
static PXDGainCalibrator & getInstance()
Main (and only) way to access the PXDGainCalibrator.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
std::shared_ptr< TrackState > getTrackStateOnModule(const VXD::SensorInfoBase &pxdSensorInfo, RecoTrack &recoTrack, double lambda=0.0)
Helper function to get a track state on a module.
Definition: PXDUtilities.cc:21
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:68

Member Data Documentation

◆ chargeMPV

float chargeMPV

Expected charge in ADU.

Definition at line 80 of file PXDPerformanceStructs.h.

◆ inside

bool inside

True if it's inside the active region.

Definition at line 81 of file PXDPerformanceStructs.h.

◆ tol

float tol

The variables below are included here as they can be calculated w.o.

having a track cluster. cos(incident angle) = thickness/path length.

Definition at line 79 of file PXDPerformanceStructs.h.

◆ x

float x

Global position in x.

Definition at line 72 of file PXDPerformanceStructs.h.

◆ y

float y

Global position in y.

Definition at line 73 of file PXDPerformanceStructs.h.

◆ z

float z

Global position in z.

Definition at line 74 of file PXDPerformanceStructs.h.


The documentation for this struct was generated from the following files: