rave is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/rave does not appear to be a Subversion repository.). Look in the Trac log for more information.

Version 5 (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 the additional charge information. The two basic constructors are

rave::TransientTrackKinematicParticle (const rave::Track &initialTrack, const double &massGuess, const double &massSigma, boost::any origin=boost::any(), std::string tag="")
rave::TransientTrackKinematicParticle (const rave::Vector7D &state, const rave::Covariance7D &error, const rave::Charge &charge, const double &chiSquared, const double &degreesOfFr, boost::any origin=boost::any(), std::string tag="")

Attachments (1)

Download all attachments as: .zip