 |
Belle II Software
release-05-01-25
|
13 #include <framework/datastore/RelationsObject.h>
14 #include <framework/datastore/StoreArray.h>
15 #include <tracking/dataobjects/RecoTrack.h>
17 #include <framework/database/DBObjPtr.h>
18 #include <mdst/dbobjects/BeamSpot.h>
19 #include <mdst/dataobjects/Track.h>
20 #include <analysis/VertexFitting/RaveInterface/RaveVertexFitter.h>
60 PXD2TrackBase(
const TVector3& vertex,
const T& track_p,
const T& track_m):
84 const std::string recoTracksName =
"",
85 const std::string pxdInterceptsName =
"",
86 const std::string pxdTrackClustersName =
"PXDClustersFromTracks"
101 const std::string recoTracksName,
102 const std::string pxdInterceptsName,
103 const std::string pxdTrackClustersName
111 auto track1Ptr = recoTracks[0]->getRelated<
Track>(
"Tracks");
112 auto track2Ptr = recoTracks[1]->getRelated<
Track>(
"Tracks");
113 if (!track1Ptr or !track2Ptr)
return false;
118 if (!tfr1Ptr or !tfr2Ptr)
return false;
121 if (tfr1Ptr->getPValue() <= 0 or tfr2Ptr->getPValue() <= 0)
return false;
124 if (tfr1Ptr->getChargeSign() * tfr2Ptr->getChargeSign() >= 0)
return false;
128 B2DEBUG(20,
"B Field = " << bField <<
" T");
135 B2DEBUG(20,
"Adding tracks to RaveVertexFitter failed.");
138 if (rvf.
fit() == 0)
return false;
140 auto vertex = rvf.
getPos();
148 B2DEBUG(20,
"Vertex = (" << m_vx
154 DBObjPtr<BeamSpot> beamSpotDB;
155 auto ip = beamSpotDB->getIPPosition();
156 if (tfr1Ptr->getChargeSign() > 0) {
157 m_track_p.setValues(*recoTracks[0], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
158 m_track_m.setValues(*recoTracks[1], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
160 m_track_p.setValues(*recoTracks[1], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
161 m_track_m.setValues(*recoTracks[0], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
static void getField(const double *pos, double *field)
return the magnetic field at a given position.
TVector3 getVertex() const
Get the vertex.
const T & getTrackM() const
Get the track with negative charge.
TVector3 getPos(VecSize vertexId=0) const
get the position of the fitted vertex.
virtual bool setValues(const StoreArray< RecoTrack > &recoTracks, const std::string recoTracksName="", const std::string pxdInterceptsName="", const std::string pxdTrackClustersName="PXDClustersFromTracks")
Set values from RecoTrack collection.
float m_vx
Position of the vertex in x.
T m_track_p
Track with the positive charge.
static void initialize(int verbosity=1, double MagneticField=1.5)
Set everything up so everything needed for vertex fitting is there.
T m_track_m
Track with the negative charge.
float m_vy
Position of the vertex in y.
static const ChargedStable pion
charged pion particle
static const double T
[tesla]
const T & getTrackP() const
Get the track with positive charge.
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for a fit hypothesis with the closest mass.
Abstract base class for different kinds of events.
void addTrack(const Particle *const aParticlePtr)
add a track (in the format of a Belle2::Particle) to set of tracks that should be fitted to a vertex
void reset()
frees memory allocated by initialize().
bool isValid() const
Check wether the array was registered.
Class PXD2TrackBase: Event data container for performance and calibration studies.
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
PXD2TrackBase()
default constructor for ROOT
float m_vz
Position of the vertex in z.
int fit(std::string options="default")
do the vertex fit with all tracks previously added with the addTrack or addMother function.
Class that bundles various TrackFitResults.
Accessor to arrays stored in the data store.
The RaveVertexFitter class is part of the RaveInterface together with RaveSetup.
int getEntries() const
Get the number of objects in the array.
T baseType
The base type for a track structure.
static RaveSetup * getInstance()
get the pointer to the instance to get/set any of options stored in RaveSetup