Skip to content
View KinFit's full-sized avatar

Block or report KinFit

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
KinFit/README.md

KinFit: A Kinematic Fitting Package for Hadron Physics Experiments

For a more detailed user's guide and description of the package see

Installation:

  1. Clone the repository git clone https://github.com/KinFit/KinFit.git
  2. Build the library using cmake
    mkdir build
    cd build
    cmake .. -DCMAKE_INSTALL_PREFIX=/your_preferred_install_location
    make
    make install
  3. Add library to rootlogon.C
    gSystem->Load("pathtoinstall/libKinFit.so")

KinFit depends on the ROOT libraries Core, Physics and Tree
When properly installed, KinFit can be included and linked to other CMake projects by

find_package(KinFit REQUIRED)
target_link_libraries(your_executable other_dependencies KinFit::KinFit ROOT::Core ROOT::Physics ROOT::Tree)

Direkt use of the fitter tools in your own analysis:

  1. Create KFitParticles from your particle candidates
    KFitParticle particle(TLorentzVector lv, Double_t R, Double_t Z);
    FillData(particle, particle_covariance)

  2. Create a vector of particles which shall be fitted
    std::vector cands;
    cands.push_back(particle);

  3. Initialize the KinFitter and fit
    KinFitter fitter(cands);
    fitter.addXXConstraint(arguments);
    fitter.fit()

  4. Get the fit result
    KFitParticle fcand = fitter.getDaughter(0);

The procedure is illustrated in the example macro fit_toyMC.C in QA. An example input file is provided in QA/test_files/toy_montecarlo_rz_vtx.root.

Automated analysis:

The KFitAnalyzer can be used to automatically analyze a root file event by event, performing the selected fit. The best particle combination for each event according to fit probability is written to an output file.

Input: A root file containing a TClonesArray of KFitParticles. Example: QA/test_files/input.root

Output: A root file containing a TClonesArray of KFitParticles, fit probability and chi2

Usage:

  1. User uses the macro analysis_user.C to define input and output and the fit that should be performed.

  2. KFitAnalyzer object is created. User adds fitting tasks to it, defines PIDs of particles to be fitted.

  3. KFitAnalyzer creates the output tree. The particle combination with the best probability is written there for each event.

Popular repositories Loading

  1. KinFit KinFit Public

    Kinematic refit libaray for hadron physics experiments

    C++ 1 3

  2. PyKinFit PyKinFit Public

    Python Implementation of the KinFit library

    Python 1 1