Belle II Software development
TrackBase_t< TTrackCluster > Struct Template Reference

Struct to hold variables from a track which contains a vector of data type like TrackCluster. More...

#include <PXDPerformanceStructs.h>

Public Member Functions

 TrackBase_t ()
 Default constructor.
 
void setTrackVariables (const TrackFitResult *tfrPtr, const ROOT::Math::XYZVector &ip)
 update track level variables from TrackFitResult
 
void setValues (const RecoTrack &recoTrack, const ROOT::Math::XYZVector &ip=ROOT::Math::XYZVector(0, 0, 0), const std::string &recoTracksName="", const std::string &pxdInterceptsName="", const std::string &pxdTrackClustersName="PXDClustersFromTracks")
 Update values from a RecoTrack.
 

Public Attributes

float d0
 Impact parameter in r-phi.
 
float z0
 Impact parameter in z.
 
float phi0
 Track direction in r-phi.
 
float pt
 Transverse momentum.
 
float tanLambda
 Tangent of the dip angle.
 
float d0p
 Corrected impact parameter in r-phi.
 
float z0p
 Corrected impact parameter in z.
 
unsigned short nPXDHits
 Number of PXD Hits.
 
unsigned short nSVDHits
 Number of SVD Hits.
 
unsigned short nCDCHits
 Number of CDC Hits.
 
std::vector< TTrackCluster > trackClusters
 Vector of track cluster structs.
 

Detailed Description

template<typename TTrackCluster>
struct Belle2::PXD::TrackBase_t< TTrackCluster >

Struct to hold variables from a track which contains a vector of data type like TrackCluster.

Definition at line 112 of file PXDPerformanceStructs.h.

Constructor & Destructor Documentation

◆ TrackBase_t()

TrackBase_t ( )
inline

Default constructor.

Definition at line 114 of file PXDPerformanceStructs.h.

114 : d0(0.0), z0(0.0), phi0(0.0), pt(0.0), tanLambda(0.0),
115 d0p(0.0), z0p(0.0), nPXDHits(0), nSVDHits(0), nCDCHits(0) {}
float z0
Impact parameter in z.
float pt
Transverse momentum.
float d0p
Corrected impact parameter in r-phi.
float d0
Impact parameter in r-phi.
float phi0
Track direction in r-phi.
unsigned short nCDCHits
Number of CDC Hits.
unsigned short nSVDHits
Number of SVD Hits.
float z0p
Corrected impact parameter in z.
unsigned short nPXDHits
Number of PXD Hits.
float tanLambda
Tangent of the dip angle.

Member Function Documentation

◆ setTrackVariables()

void setTrackVariables ( const TrackFitResult tfrPtr,
const ROOT::Math::XYZVector &  ip 
)

update track level variables from TrackFitResult

Template implementation.

Parameters
tfrPtra pointer of TrackFitResult
ipThe interaction point for correcting d0 and z0

Definition at line 157 of file PXDPerformanceStructs.h.

160 {
161 if (!tfrPtr) {
162 B2ERROR("Expect the track fit result. Found Nothing!");
163 }
164 nCDCHits = tfrPtr->getHitPatternCDC().getNHits();
165 nSVDHits = tfrPtr->getHitPatternVXD().getNSVDHits();
166 nPXDHits = tfrPtr->getHitPatternVXD().getNPXDHits();
167 tanLambda = tfrPtr->getCotTheta();
168 pt = tfrPtr->getMomentum().Rho();
169 d0 = tfrPtr->getD0();
170 z0 = tfrPtr->getZ0();
171 phi0 = tfrPtr->getPhi0();
172 d0p = d0;
173 z0p = z0;
174 if (ip != ROOT::Math::XYZVector(0, 0, 0)) {
175 // get a helix and change coordinate origin to ip
176 auto uHelix = tfrPtr->getUncertainHelix();
177 uHelix.passiveMoveBy(ip);
178 d0p = uHelix.getD0();
179 z0p = uHelix.getZ0();
180 }
181 }

◆ setValues()

void setValues ( const RecoTrack recoTrack,
const ROOT::Math::XYZVector &  ip = ROOT::Math::XYZVector(0, 0, 0),
const std::string &  recoTracksName = "",
const std::string &  pxdInterceptsName = "",
const std::string &  pxdTrackClustersName = "PXDClustersFromTracks" 
)

Update values from a RecoTrack.

Parameters
recoTrackA RecoTrack object.
ipThe interaction point for correcting d0 and z0
recoTracksNameName of RecoTrack collection
pxdInterceptsNameName of PXDIntercept collection
pxdTrackClustersNameName of track matched PXDClusters

Definition at line 184 of file PXDPerformanceStructs.h.

190 {
191 // get Track pointer
192 auto trackPtr = recoTrack.getRelated<Track>("Tracks");
193 if (!trackPtr) {
194 B2ERROR("Expect a track for fitted recotracks. Found nothing!");
195 }
196
197 // get trackFitResult pointer
198 auto tfrPtr = trackPtr->getTrackFitResultWithClosestMass(
199 Const::pion); // always try to use pion as electron fit doesn't work properly.
200 setTrackVariables(tfrPtr, ip);
201
202 //RelationVector<PXDIntercept> pxdIntercepts = recoTrack.getRelationsTo<PXDIntercept>();
203 auto pxdIntercepts = recoTrack.getRelationsTo<PXDIntercept>(pxdInterceptsName);
204 for (auto& pxdIntercept : pxdIntercepts) {
205 TTrackCluster temp;
206 // Only push a TrackCluster when setValues succeeds
207 if (temp.setValues(pxdIntercept, recoTracksName, pxdTrackClustersName))
208 trackClusters.push_back(temp);
209 }
210 }
static const ChargedStable pion
charged pion particle
Definition: Const.h:661
void setTrackVariables(const TrackFitResult *tfrPtr, const ROOT::Math::XYZVector &ip)
update track level variables from TrackFitResult
std::vector< TTrackCluster > trackClusters
Vector of track cluster structs.

Member Data Documentation

◆ d0

float d0

Impact parameter in r-phi.

Definition at line 136 of file PXDPerformanceStructs.h.

◆ d0p

float d0p

Corrected impact parameter in r-phi.

Definition at line 141 of file PXDPerformanceStructs.h.

◆ nCDCHits

unsigned short nCDCHits

Number of CDC Hits.

Definition at line 145 of file PXDPerformanceStructs.h.

◆ nPXDHits

unsigned short nPXDHits

Number of PXD Hits.

Definition at line 143 of file PXDPerformanceStructs.h.

◆ nSVDHits

unsigned short nSVDHits

Number of SVD Hits.

Definition at line 144 of file PXDPerformanceStructs.h.

◆ phi0

float phi0

Track direction in r-phi.

Definition at line 138 of file PXDPerformanceStructs.h.

◆ pt

float pt

Transverse momentum.

Definition at line 139 of file PXDPerformanceStructs.h.

◆ tanLambda

float tanLambda

Tangent of the dip angle.

Definition at line 140 of file PXDPerformanceStructs.h.

◆ trackClusters

std::vector<TTrackCluster> trackClusters

Vector of track cluster structs.

Definition at line 146 of file PXDPerformanceStructs.h.

◆ z0

float z0

Impact parameter in z.

Definition at line 137 of file PXDPerformanceStructs.h.

◆ z0p

float z0p

Corrected impact parameter in z.

Definition at line 142 of file PXDPerformanceStructs.h.


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