11 #include <framework/datastore/RelationsObject.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <tracking/dataobjects/RecoTrack.h>
15 #include <framework/database/DBObjPtr.h>
16 #include <mdst/dbobjects/BeamSpot.h>
17 #include <mdst/dataobjects/Track.h>
18 #include <analysis/VertexFitting/RaveInterface/RaveVertexFitter.h>
20 #include <Math/Vector3D.h>
59 PXD2TrackBase(
const TVector3& vertex,
const T& track_p,
const T& track_m):
89 const std::string& recoTracksName =
"",
90 const std::string& pxdInterceptsName =
"",
91 const std::string& pxdTrackClustersName =
"PXDClustersFromTracks"
106 const std::string& recoTracksName,
107 const std::string& pxdInterceptsName,
108 const std::string& pxdTrackClustersName
116 auto track1Ptr = recoTracks[0]->getRelated<
Track>(
"Tracks");
117 auto track2Ptr = recoTracks[1]->getRelated<
Track>(
"Tracks");
118 if (!track1Ptr or !track2Ptr)
return false;
123 if (!tfr1Ptr or !tfr2Ptr)
return false;
126 if (tfr1Ptr->getPValue() <= 0 or tfr2Ptr->getPValue() <= 0)
return false;
129 if (tfr1Ptr->getChargeSign() * tfr2Ptr->getChargeSign() >= 0)
return false;
133 B2DEBUG(20,
"B Field = " << bField <<
" T");
140 B2DEBUG(20,
"Adding tracks to RaveVertexFitter failed.");
143 if (rvf.
fit() == 0)
return false;
145 auto vertex = rvf.
getPos();
153 B2DEBUG(20,
"Vertex = (" << m_vx
160 auto ip = ROOT::Math::XYZVector(beamSpotDB->getIPPosition());
161 if (tfr1Ptr->getChargeSign() > 0) {
162 m_track_p.setValues(*recoTracks[0], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
163 m_track_m.setValues(*recoTracks[1], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
165 m_track_p.setValues(*recoTracks[1], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
166 m_track_m.setValues(*recoTracks[0], ip, recoTracksName, pxdInterceptsName, pxdTrackClustersName);
static ROOT::Math::XYZVector getFieldInTesla(const ROOT::Math::XYZVector &pos)
return the magnetic field at a given position in Tesla.
static const ChargedStable pion
charged pion particle
Class for accessing objects in the database.
Class PXD2TrackBase: Event data container for performance and calibration studies.
const T & getTrackM() const
Get the track with negative charge.
const T & getTrackP() const
Get the track with positive charge.
PXD2TrackBase(const TVector3 &vertex, const T &track_p, const T &track_m)
Standard constructor.
float m_vy
Position of the vertex in y.
float m_vz
Position of the vertex in z.
TVector3 getVertex() const
Get the vertex.
T m_track_m
Track with the negative charge.
float m_vx
Position of the vertex in x.
PXD2TrackBase()
default constructor for ROOT
T baseType
The base type for a track structure.
T m_track_p
Track with the positive charge.
Defines interface for accessing relations of objects in StoreArray.
ClassDef(RelationsInterface, 0)
defines interface for accessing relations of objects in StoreArray.
bool isValid() const
Check wether the array was registered.
int getEntries() const
Get the number of objects in the array.
Class that bundles various TrackFitResults.
const TrackFitResult * getTrackFitResultWithClosestMass(const Const::ChargedStable &requestedType) const
Return the track fit for a fit hypothesis with the closest mass.
static void initialize(int verbosity=1, double MagneticField=1.5)
Set everything up so everything needed for vertex fitting is there.
static RaveSetup * getInstance()
get the pointer to the instance to get/set any of options stored in RaveSetup
void reset()
frees memory allocated by initialize().
The RaveVertexFitter class is part of the RaveInterface together with RaveSetup.
int fit(std::string options="default")
do the vertex fit with all tracks previously added with the addTrack or addMother function.
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
B2Vector3D 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.
Abstract base class for different kinds of events.