Belle II Software development
RecoTrackGenfitAccess Class Reference

This class allows access to the genfit::Track of the RecoTrack. More...

#include <RecoTrack.h>

Static Public Member Functions

static genfit::Track & getGenfitTrack (RecoTrack &recoTrack)
 Give access to the RecoTrack's genfit::Track.
 
static void swapGenfitTrack (RecoTrack &recoTrack, const genfit::Track *track)
 Set the genfit track of a Recotrack copying the information from another genfit track.
 
static genfit::AbsTrackRep * createOrReturnRKTrackRep (RecoTrack &recoTrack, int PDGcode)
 Checks if a TrackRap for the PDG id of the RecoTrack (and its charge conjugate) does already exit and returns it if available.
 

Detailed Description

This class allows access to the genfit::Track of the RecoTrack.

This class allows direct access to the most holy part of the RecoTrack. The design of the RecoTrack is such, that this should not be required. However, some interfaces require a genfit::Track, e.g. the genfit rave interface, and the access to the genfit::Track member is required. This should only be used when no other solution works.

Definition at line 1084 of file RecoTrack.h.

Member Function Documentation

◆ createOrReturnRKTrackRep()

genfit::AbsTrackRep * createOrReturnRKTrackRep ( RecoTrack recoTrack,
int  PDGcode 
)
static

Checks if a TrackRap for the PDG id of the RecoTrack (and its charge conjugate) does already exit and returns it if available.

If no TrackRep is available, a new RKTrackRep is added to the genfit::Track. This ensures that a TrackRep with the same PDG id (and its charge conjugate) is not available two times in the genfit::Track.

By convention, only one TrackRep for one particle type can exist inside of a RecoTrack, no matter the charge. So there can only be a electron or positron TrackRep, but not both.

Parameters
recoTrackTrack to add TrackRep to
PDGcode: code of the hypothesis which is negative or positive, depending on the charge of the hypothesis particle.

Definition at line 409 of file RecoTrack.cc.

410{
411 // try to get the trackRep, if it has already been added
412 genfit::AbsTrackRep* trackRepresentation = recoTrack.getTrackRepresentationForPDG(std::abs(PDGcode));
413
414 // not available? create one
415 if (trackRepresentation == nullptr) {
416 if (PDGcode == Monopoles::c_monopolePDGCode) {
417 trackRepresentation = new genfit::MplTrackRep(PDGcode, Monopoles::monopoleMagCharge);
418 } else {
419 trackRepresentation = new genfit::RKTrackRep(PDGcode);
420 }
421 RecoTrackGenfitAccess::getGenfitTrack(recoTrack).addTrackRep(trackRepresentation);
422 }
423 return trackRepresentation;
424}
static genfit::Track & getGenfitTrack(RecoTrack &recoTrack)
Give access to the RecoTrack's genfit::Track.
Definition: RecoTrack.cc:404
genfit::AbsTrackRep * getTrackRepresentationForPDG(int pdgCode) const
Return an already created track representation of the given reco track for the PDG.
Definition: RecoTrack.cc:475

◆ getGenfitTrack()

genfit::Track & getGenfitTrack ( RecoTrack recoTrack)
static

Give access to the RecoTrack's genfit::Track.

Parameters
recoTrackTrack to unpack
Returns
genfit::Track of the RecoTrack.

Definition at line 404 of file RecoTrack.cc.

405{
406 return recoTrack.m_genfitTrack;
407}
genfit::Track m_genfitTrack
Internal storage for the genfit track.
Definition: RecoTrack.h:897

◆ swapGenfitTrack()

void swapGenfitTrack ( RecoTrack recoTrack,
const genfit::Track *  track 
)
static

Set the genfit track of a Recotrack copying the information from another genfit track.

This is used by the fit&refit, since the original genfit track must be updated with the refitted object obtained after the flip

Parameters
recoTrack: RecoTrack whose Track we want to update
track: input genfit::Track which we want to copy inside the RecoTrack

Definition at line 399 of file RecoTrack.cc.

400{
401 recoTrack.m_genfitTrack = *track;
402}

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