 |
Belle II Software
release-05-02-19
|
13 #include <framework/core/Module.h>
16 #include <framework/database/DBObjPtr.h>
19 #include <analysis/VertexFitting/RaveInterface/RaveSetup.h>
20 #include <analysis/VertexFitting/RaveInterface/RaveVertexFitter.h>
21 #include <analysis/VertexFitting/RaveInterface/RaveKinematicVertexFitter.h>
24 #include <CLHEP/Geometry/Point3D.h>
25 #include <CLHEP/Matrix/SymMatrix.h>
26 #include <CLHEP/Vector/LorentzVector.h>
29 #include <mdst/dataobjects/Track.h>
30 #include <mdst/dataobjects/TrackFitResult.h>
31 #include <analysis/dataobjects/FlavorTaggerInfo.h>
32 #include <mdst/dbobjects/BeamSpot.h>
33 #include <mdst/dataobjects/MCParticle.h>
46 struct ParticleAndWeight;
53 class TagVertexModule :
public Module {
77 virtual void event()
override;
100 std::vector<const MCParticle*>
157 std::pair<TVector3, TMatrixDSym>
findConstraintBoost(
double cut,
double shiftAlongBoost = -2000.)
const;
178 std::vector<ParticleAndWeight>
getParticlesWithoutKS(
const std::vector<const Particle*>& tagParticles,
179 double massWindowWidth = 0.01)
const;
201 void fillParticles(std::vector<ParticleAndWeight>& particleAndWeights);
207 void fillTagVinfo(
const TVector3& tagVpos,
const TMatrixDSym& tagVposErr);
233 static std::string
printVector(
const TVector3& vec);
238 static std::string
printMatrix(
const TMatrixD& mat);
243 static std::string
printMatrix(
const TMatrixDSym& mat);
Particle * doVertexFitForBTube(const Particle *mother, std::string fitType) const
it returns an intersection between B rec and beam spot (= origin of BTube)
TVector3 m_constraintCenter
centre position of the constraint for the tag Vertex fit
double m_tagVChi2
chi^2 value of the tag vertex fit result
std::vector< double > m_raveWeights
Store the weights used by Rave in the vtx fit so that they can be accessed later.
double m_tagVNDF
Number of degrees of freedom in the tag vertex fit.
double m_tagVol
tagV component in the direction orthogonal to the boost
double m_truthTagVl
MC tagV component in the boost direction
static std::string printMatrix(const TMatrixD &mat)
Print a TMatrix (useful for debugging)
std::string m_fitAlgo
Algorithm used for the tag fit (Rave or KFit)
void fillTagVinfo(const TVector3 &tagVpos, const TMatrixDSym &tagVposErr)
Fill tagV vertex info.
double m_mcTagLifeTime
generated tag side life time of B-decay
std::vector< ParticleAndWeight > getParticlesWithoutKS(const std::vector< const Particle * > &tagParticles, double massWindowWidth=0.01) const
Get a list of pions from a list of pions removing the Kshorts Warning: this assumes all the particles...
TMatrixDSym m_BeamSpotCov
size of the beam spot == covariance matrix on the beam spot position
double m_shiftZ
parameter for testing the systematic error from the IP measurement
double weight
rave weight associated to the track, for sorting purposes
const MCParticle * mcParticle
mc particle matched to the tag track, for sorting purposes
double m_truthTagVol
MC tagV component in the direction orthogonal to the boost.
std::string m_trackFindingType
Choose how to find the tag tracks: standard, standard_PXD.
bool m_useRollBack
Set to true if the tag fit is to be made with the tag track position rolled back to mother B.
static bool compBrecoBgen(const Particle *Breco, const MCParticle *Bgen)
compare Breco with the two MC B particles
std::pair< TVector3, TMatrixDSym > findConstraint(const Particle *Breco, double cut) const
calculate the constraint for the vertex fit on the tag side using Breco information
TVector3 getRollBackPoca(ParticleAndWeight const &paw)
This shifts the position of tracks by the vector difference of mother B and production point of track...
double m_deltaT
reconstructed DeltaT
TagVertexModule()
Constructor.
virtual void event() override
Event processor.
void BtagMCVertex(const Particle *Breco)
get the vertex of the MC B particle associated to Btag.
double m_fitPval
P value of the tag side fit result.
std::pair< TVector3, TMatrixDSym > findConstraintBoost(double cut, double shiftAlongBoost=-2000.) const
calculate the standard constraint for the vertex fit on the tag side
double m_tagVolErr
Error of the tagV component in the direction orthogonal to the boost.
std::vector< const Particle * > m_tagParticles
tracks of the rest of the event
TVector3 m_tagV
tag side fit result
TMatrixDSym m_pvCov
covariance matrix of the PV (useful with tube and KFit)
bool m_verbose
choose if you want to print extra infos
TVector3 m_mcVertReco
generated Breco decay vertex
Values of the result of a track fit with a given particle hypothesis.
This class contains the beam spot position and size modeled as a gaussian distribution in space.
double m_tagVlErr
Error of the tagV component in the boost direction
double m_tagVl
tagV component in the boost direction
std::string m_listName
Breco particle list name.
virtual void initialize() override
Initialize the Module.
TrackFitResult getTrackWithTrueCoordinates(ParticleAndWeight const &paw) const
If the fit has to be done with the truth info, Rave is fed with a track where the momentum is replace...
Class for accessing objects in the database.
std::string m_roeMaskName
ROE particles from this mask will be used for vertex fitting.
double m_deltaTErr
reconstructed DeltaT error
TLorentzVector m_tagMomentum
B tag momentum computed from fully reconstructed B sig.
double m_Bfield
magnetic field from data base
bool makeGeneralFit()
TO DO: tag side vertex fit in the case of semileptonic tag side decay.
std::string m_constraintType
Choose constraint: noConstraint, IP, tube, boost, (breco)
int m_FitType
fit algo used
double m_tagVChi2IP
IP component of the chi^2 of the tag vertex fit result.
bool makeGeneralFitKFit()
make the vertex fit on the tag side: KFit tracks coming from Ks removed all other tracks used
Abstract base class for different kinds of events.
static std::string printVector(const TVector3 &vec)
Print a TVector3 (useful for debugging)
void resetReturnParams()
Reset all parameters that are computed in each event and then used to compute tuple variables.
double m_mcDeltaT
generated DeltaT with boost-direction approximation
void deltaT(const Particle *Breco)
calculate DeltaT and MC-DeltaT (rec - tag) in ps from Breco and Btag vertices DT = Dl / gamma beta c ...
bool doVertexFit(const Particle *Breco)
central method for the tag side vertex fit
bool m_mcInfo
true if user wants to retrieve MC information out from the tracks used in the fit
std::string m_useMCassociation
No MC association or standard Breco particle or internal MCparticle association.
double m_mcLifeTimeReco
generated Breco life time
const BeamSpot & getBeamSpot() const
returns the BeamSpot object
TrackFitResult getTrackWithRollBackCoordinates(ParticleAndWeight const &paw)
If the fit has to be done with the rolled back tracks, Rave or KFit is fed with a track where the pos...
std::vector< const Particle * > getTagTracks_standardAlgorithm(const Particle *Breco, int nPXDHits) const
performs the fit using the standard algorithm - using all tracks in RoE The user can specify a reques...
DBObjPtr< BeamSpot > m_beamSpotDB
Beam spot database object.
int m_mcPDG
generated tag side B flavor
std::pair< TVector3, TMatrixDSym > findConstraintBTube(const Particle *Breco, double cut)
calculate constraint for the vertex fit on the tag side using the B tube (cylinder along the expected...
this struct is used to store and sort the tag tracks
double m_confidenceLevel
required fit confidence level
static TVector3 getTruePoca(ParticleAndWeight const &paw)
This finds the point on the true particle trajectory closest to the measured track position.
bool m_useTruthInFit
Set to true if the tag fit is to be made with the TRUE tag track momentum and position.
Class to store reconstructed particles.
TVector3 m_BeamSpotCenter
Beam spot position.
void fillParticles(std::vector< ParticleAndWeight > &particleAndWeights)
Fill sorted list of particles into external variable.
int m_reqPXDHits
N of PXD hits for a track to be used.
double m_mcDeltaTau
generated DeltaT
int m_fitTruthStatus
Store info about whether the fit was performed with the truth info 0 fit performed with measured para...
TMatrixDSym m_constraintCov
constraint to be used in the tag vertex fit
A Class to store the Monte Carlo particle information.
TVector3 m_mcTagV
generated tag side vertex
TMatrixDSym m_tagVErrMatrix
Error matrix of the tag side fit result.
std::vector< const Particle * > m_raveParticles
tracks given to rave for the track fit (after removing Kshorts
int m_rollbackStatus
Store info about whether the fit was performed with the rolled back tracks 0 fit performed with measu...
bool makeGeneralFitRave()
make the vertex fit on the tag side: RAVE AVF tracks coming from Ks removed all other tracks used
std::vector< const MCParticle * > m_raveMCParticles
Store the MC particles corresponding to each track used by Rave in the vtx fit.
const Particle * particle
tag track fit result with pion mass hypo, for sorting purposes
virtual void beginRun() override
Called when entering a new run.