Fork me on GitHub

Changeset 1388e73 in git for modules


Ignore:
Timestamp:
Feb 26, 2020, 8:03:48 PM (4 years ago)
Author:
Michele Selvaggi <michele.selvaggi@…>
Branches:
ImprovedOutputFile, master
Children:
288a5fc
Parents:
7b518f0
Message:

added missing track parameters to TrackCovariance module

Location:
modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • modules/TrackCovariance.cc

    r7b518f0 r1388e73  
    2121 *  Smears track parameters according to appropriate covariance matrix.
    2222 *
    23  *  \author P. Demin - UCLouvain, Louvain-la-Neuve
     23 *  \authors P. Demin - UCLouvain, Louvain-la-Neuve
     24 *           M. Selvaggi - CERN
    2425 *
    2526 */
    2627
    2728//FIXME add reference to Bedeschi-code
    28 //FIXME add smearing of impact parameter as well
    29 
     29//FIXME make sure about units of P, X
     30//FIXME fix pt > 200 GeV issue and angle > 6.41
    3031
    3132#include "modules/TrackCovariance.h"
     
    4041#include "TMath.h"
    4142#include "TObjArray.h"
     43
     44#include <iostream>
     45#include <sstream>
     46
     47using namespace std;
    4248
    4349//------------------------------------------------------------------------------
     
    8995{
    9096  Candidate *candidate, *mother;
    91   Double_t mass;
     97  Double_t mass, p, pt, q, ct;
     98  Double_t dd0, ddz, dphi, dct, dp, dpt;
     99 
    92100
    93101  fItInputArray->Reset();
    94102  while((candidate = static_cast<Candidate *>(fItInputArray->Next())))
    95103  {
    96     const TLorentzVector &candidatePosition = candidate->Position;
     104    const TLorentzVector &candidatePosition = candidate->InitialPosition;
    97105    const TLorentzVector &candidateMomentum = candidate->Momentum;
    98106
     
    103111    mother = candidate;
    104112    candidate = static_cast<Candidate *>(candidate->Clone());
     113
    105114    candidate->Momentum.SetVectM(track.GetObsP(), mass);
     115    candidate->InitialPosition.SetXYZT(track.GetObsX().X(),track.GetObsX().Y(),track.GetObsX().Z(),candidatePosition.T());
     116
     117    pt = candidate->Momentum.Pt();
     118    p  = candidate->Momentum.P();
     119    q  = track.GetObsQ();
     120    ct = track.GetObsPar()[4];
     121
     122    candidate->D0 = track.GetObsPar()[0];
     123    candidate->DZ = track.GetObsPar()[3];
     124    candidate->P  = track.GetObsP().Mag();
     125    candidate->CtgTheta = track.GetObsPar()[4];
     126    candidate->Phi = track.GetObsPar()[1];
     127
     128    candidate->PT = pt;
     129    candidate->Charge = q;
     130
     131    dd0       = TMath::Sqrt(track.GetCov()(0, 0));
     132    ddz       = TMath::Sqrt(track.GetCov()(3, 3));
     133    dphi      = TMath::Sqrt(track.GetCov()(1, 1));
     134    dct       = TMath::Sqrt(track.GetCov()(4, 4));
     135    dpt       = 2 * TMath::Sqrt( track.GetCov()(2, 2))*pt*pt / (0.2998*fBz);
     136    dp        = TMath::Sqrt((1.+ct*ct)*dpt*dpt + 4*pt*pt*ct*ct*dct*dct/(1.+ct*ct)/(1.+ct*ct));
     137
     138    candidate->ErrorD0 = dd0;
     139    candidate->ErrorDZ = ddz;
     140    candidate->ErrorP = dp;
     141    candidate->ErrorCtgTheta = dct;
     142    candidate->ErrorPhi = dphi;
     143    candidate->ErrorPT = dpt;
     144    //candidate->TrackResolution = dpt / pt;
     145    candidate->TrackResolution = dp / p;
    106146
    107147    candidate->AddCandidate(mother);
  • modules/TrackCovariance.h

    r7b518f0 r1388e73  
    2424 *  Smears track parameters according to appropriate covariance matrix.
    2525 *
    26  *  \author P. Demin - UCLouvain, Louvain-la-Neuve
     26 *  \authors P. Demin - UCLouvain, Louvain-la-Neuve
     27 *           M. Selvaggi - CERN
    2728 *
    2829 */
Note: See TracChangeset for help on using the changeset viewer.