rave is hosted by Hepforge, IPPP Durham
close Warning:
  • Error with navigation contributor "BrowserModule"
  • Failed to sync with repository "(default)": instance.__dict__ not accessible in restricted mode; repository information may be out of date. Look in the Trac log for more information including mitigation strategies.

Version 10 (modified by fmos, 17 years ago) (diff)

--

RaveKinematics

Introduction

As the aim of Rave is to provide a complete toolset for sophisticated vertex reconstruction, it naturally includes the possibility of performing a "constrained fit". This kind of reconstruction implies knowledge of the fitted topology, which then is used as extra information to refine the purely geometrically fitted results of the unconstrained vertex fit.

The topology (read decay chain) is represented by a data structure called KinematicTree referring to the tree-like hierarchical structure of a decay. This tree should be understood as a graph using KinematicParticle instances as its edges and KinematicVertex instances as its nodes. The following image should clearify the design.

To maximize the ease-of-use, a certain number of common constraints was chosen. At the moment there is no other possibilty to add new constraints than by requesting them from the package maintainer.

Quickstart

To get a head start immediately, copy, paste & compile the following source code. Don't forget to link against the RaveVertexKinematics library (additional to the Core, Base and Vertex libraries).

Because the code is already pretty huge for a first-should-be-tiny example, the comments follow seperately lateron.

#include <iostream>
#include <sstream>

#include <rave/Version.h>
#include <rave/TransientTrackKinematicParticle.h>
#include <rave/KinematicConstraintBuilder.h>
#include <rave/KinematicTreeFactory.h>

namespace {
  std::vector< rave::KinematicParticle > createParticles()
  {
    rave::Vector7D state1 (  0.0001,  0.0001,  0.0001, 
                           -31.2685, 13.0785, 28.7524, 0.1057 );
    rave::Covariance7D cov1 (
         1.5e-7,    3.6e-7,    4.0e-14,
                    8.5e-7,    9.6e-14,
                               1.7e-6,
                                 -1.4e-16,  -3.4e-16,   1.8e-24,
                                 -3.3e-16,  -8.1e-16,   4.3e-24,
                                 -3.9e-9,   -9.4e-9,    5.0e-17,
                                  4.9e-3,   -2.0e-3,   -4.4e-3,
                                             9.2e-4,    1.8e-3,
                                                        4.1e-3,
           0, 0, 0,   0, 0, 0,    6.2 );
    rave::TransientTrackKinematicParticle particle1 (
        state1, cov1, +1.0, 100, 100 );

    rave::Vector7D state2 ( -0.0006,  -0.0006,   0.0018,
                           -57.1634, -57.6416, -40.0142, 0.1057 );
    rave::Covariance7D cov2 (
        5.0e-7,    -5.0e-7,   -1.1e-14,
                    5.0e-7,    1.1e-14,
                               1.2e-6,
                                  1.5e-16,  -1.5e-16,   3.4e-24,
                                 -1.5e-16,   1.5e-16,  -3.4e-24,
                                  4.2e-9,   -4.2e-9,    9.7e-17,
                                  6.7e-2,    6.7e-2,    4.7e-2,
                                             6.8e-2,    4.7e-2,
                                                        3.3e-2,
           0, 0, 0,   0, 0, 0,    6.2 );
    rave::TransientTrackKinematicParticle particle2 (
        state2, cov2, -1.0, 100, 100 );

    std::vector< rave::KinematicParticle > particles;
    particles.push_back( particle1 );
    particles.push_back( particle2 );

    return particles;
  }

  std::string fit ()
  {
    std::ostringstream o;
    rave::ConstantMagneticField mfield(0.,0.,4.);
    rave::KinematicTreeFactory factory ( mfield, 
                                         rave::VacuumPropagator() );
    rave::KinematicConstraint constraint =
        rave::KinematicConstraintBuilder().createTwoTrackMassKinematicConstraint( 91.187 );
    std::vector < rave::KinematicParticle > input_particles = createParticles();
    rave::KinematicTree tree;
    try {
      tree = factory.useVertexFitter( input_particles, constraint );
    } catch ( ... ) {};
    if (!tree.isValid())
    {
      o << "The decay could not be reconstructed.";
    }
    else
    {
      rave::KinematicParticle topParticle = tree.topParticle();
      o << "The reconstructed mother particle is " << topParticle.fullstate();
    }
    return o.str();
  }

  std::string version()
  {
    std::ostringstream o;
    o << "Rave Version " << rave::Version();
    return o.str();
  }
}

int main(void)
{
  std::cout << "This is Rave Version " << rave::Version() << std::endl;
  std::cout << "Fitting says: " << fit() << std::endl;
  return 0;
}

Converting the input

The kinematic fit makes heavy use of the KinematicParticle class. It is used as an input as well as an output data class. Strictly spoken, the input data accepted by the kinematic fitting algorithms must be converted to TransientTrackKinematicParticle classes. This class can be created from !Track objects by providing an additional mass hypothesis or from !Vector7D and !Covariance7D objects by providing additional charge and fit information. The two basic constructors are

using namespace rave;
TransientTrackKinematicParticle (
const Track &initialTrack, const double &massGuess, const double &massSigma)
TransientTrackKinematicParticle (
const Vector7D &state, const Covariance7D &error, 
const Charge &charge, const double &chiSquared, const double &degreesOfFr)

The construction of Track instances works as described for the vertex fit.

In the example above, two instances of KinematicParticle are created from the respective Vector7D and Covariance7D instances, which themselves are initialized with hardcoded numbers. The basic constructors for these two classes are

using namespace rave;
Vector7D (
double x,  double y,  double z, 
double px, double py, double pz, double m );
Covariance7D (
double dxx, double dxy, double dxz, 
double dyy, double dyz, double dzz, 
double dxpx, double dxpy, double dxpz, 
double dypx, double dypy, double dypz, 
double dzpx, double dzpy, double dzpz, 
double dpxpx, double dpxpy, double dpxpz, 
double dpypy, double dpypz, double dpzpz, 
double dxm, double dym, double dzm, 
double dpxm, double dpym, double dpzm, double dmm );

Pushed into a vector, those instances are handed over to the fitter together with a constraint.

Constraints

Constraints are a central concept when it comes to kinematic fitting. Rave offers a certain set of constraints. The user can choose to apply any number of them to the problem at hand, but the calling convention of the fitter slightly depends on the type of constraint chosen.

The available constraints are:

  • Back-to-Back
  • Four-Momentum
  • Mass
  • Momentum
  • Pointing
  • Simple pointing
  • Smart pointing
  • Two-track Mass
  • Vertex
  • (Multiple)

Constraints are represented by instances of the KinematicConstraint class. They cannot be created freely, but only by using the KinematicConstraintBuilder. This builder offers a creation method for each type of constraint. The signatures of those methods can be found in the Doxygen documentation shipping with Rave.

As is visible from these signatures, the MultipleKinematicConstraint has a special role copared to the other constraints.

Attachments (1)

Download all attachments as: .zip