Fork me on GitHub

Ignore:
Timestamp:
Nov 29, 2021, 3:18:22 PM (3 years ago)
Author:
Franco BEDESCHI <bed@…>
Branches:
master
Children:
bd376e3
Parents:
9a7ea36
Message:

Major update to handle highly displaced tracks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • external/TrackCovariance/SolTrack.h

    r9a7ea36 rebf40fd  
     1//
    12#ifndef G__SOLTRK_H
    23#define G__SOLTRK_H
    3 
     4//
    45#include <TMath.h>
    56#include <TVector3.h>
    67#include <TMatrixDSym.h>
    7 
    8 class SolGeom;
    9 
     8#include "SolGeom.h"
     9#include "TrkUtil.h"
     10#include <TGraph.h>
     11//
     12//
    1013// Class to store track information
    1114// Assumes that the geometry has been initialized
    12 class SolTrack{
    13   // Track handling class
    14   // Assume tracks originate from (0,0) for the time being
     15//
     16class SolTrack: public TrkUtil
     17{
     18        //
     19        // Track handling class
     20        // Assume tracks originate from (0,0) for the time being
     21        //
    1522private:
    16   Int_t fNl;        // Actual number of layers
    17   SolGeom *fG;      // Geometry
    18   Double_t fp[3];   // px, py, pz momentum
    19   Double_t fx[3];   //  x,  y,  z track origin
    20   Double_t fpar[5]; // D, phi0, C, z0, cot(theta)
    21 
    22   TMatrixDSym fCov; // Full covariance matrix
    23 
     23        Int_t fNl;      // Actual number of layers
     24        SolGeom *fG;    // Geometry
     25        Double_t fp[3]; // px, py, pz momentum
     26        Double_t fx[3]; //  x,  y,  z track origin
     27        Double_t fpar[5];       // D, phi0, C, z0, cot(theta)
     28        //
     29        TMatrixDSym fCov;               // Full covariance matrix
     30        //
     31        //
    2432public:
    25   // Constructors
    26   SolTrack(Double_t *x, Double_t *p, SolGeom *G);
     33        //
     34        // Constructors
     35        SolTrack(Double_t *x, Double_t *p, SolGeom *G);
    2736        SolTrack(TVector3 x, TVector3 p, SolGeom* G);
    28   SolTrack(Double_t D, Double_t phi0, Double_t C, Double_t z0, Double_t ct, SolGeom *G);
    29   // Destructor
    30   ~SolTrack();
    31   // Accessors
    32   // Position (at minimum approach)
    33   Double_t x() { return fx[0]; }
    34   Double_t y() { return fx[1]; }
    35   Double_t z() { return fx[2]; }
    36   // Momentum  (at minimum approach)
    37   Double_t px() { return fp[0]; }
    38   Double_t py() { return fp[1]; }
    39   Double_t pz() { return fp[2]; }
    40   Double_t pt() { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1]); }
    41   Double_t p()  { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1] + fp[2] * fp[2]); }
    42   // Track parameters
    43   Double_t D()    { return fpar[0]; }
    44   Double_t phi0() { return fpar[1]; }
    45   Double_t C()    { return fpar[2]; }
    46   Double_t z0()   { return fpar[3]; }
    47   Double_t ct()   { return fpar[4]; }
    48   // Covariance
    49   TMatrixDSym Cov()   { return fCov; }
    50   // Track parameter covariance calculation
    51   void CovCalc(Bool_t Res, Bool_t MS);
    52   // Parameter errors
    53   Double_t s_D()    { return TMath::Sqrt(fCov(0, 0)); }
    54   Double_t s_phi0() { return TMath::Sqrt(fCov(1, 1)); }
    55   Double_t s_C()    { return TMath::Sqrt(fCov(2, 2)); }
    56   Double_t s_pt()   { return 2 * s_C()*pt() / (0.2998*fG->B()); } // Dpt/pt
    57   Double_t s_z0()   { return TMath::Sqrt(fCov(3, 3)); }
    58   Double_t s_ct()   { return TMath::Sqrt(fCov(4, 4)); }
    59   // Track hit management
    60   Int_t nHit();
    61   Int_t nmHit();
    62   Bool_t HitLayer(Int_t Layer, Double_t &R, Double_t &phi, Double_t &zz);
    63   Int_t HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh);
    64   Int_t HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh);
    65 
    66   // Make normalized matrix positive definite
    67   TMatrixDSym MakePosDef(TMatrixDSym NormMat);
     37        SolTrack(Double_t D, Double_t phi0, Double_t C, Double_t z0, Double_t ct, SolGeom *G);
     38        // Destructor
     39        ~SolTrack();
     40        // Accessors
     41        // Position (at minimum approach)
     42        Double_t x() { return fx[0]; }
     43        Double_t y() { return fx[1]; }
     44        Double_t z() { return fx[2]; }
     45        // Momentum  (at minimum approach)
     46        Double_t px() { return fp[0]; }
     47        Double_t py() { return fp[1]; }
     48        Double_t pz() { return fp[2]; }
     49        Double_t pt() { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1]); }
     50        Double_t p()  { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1] + fp[2] * fp[2]); }
     51        // Track parameters
     52        Double_t D()    { return fpar[0]; }
     53        Double_t phi0() { return fpar[1]; }
     54        Double_t C()    { return fpar[2]; }
     55        Double_t z0()   { return fpar[3]; }
     56        Double_t ct()   { return fpar[4]; }
     57        // Covariance
     58        TMatrixDSym Cov()               { return fCov; }
     59        // Track parameter covariance calculation
     60        void CovCalc(Bool_t Res, Bool_t MS);
     61        // Parameter errors
     62        Double_t s_D()    { return TMath::Sqrt(fCov(0, 0)); }
     63        Double_t s_phi0() { return TMath::Sqrt(fCov(1, 1)); }
     64        Double_t s_C()    { return TMath::Sqrt(fCov(2, 2)); }
     65        Double_t s_pt()   { return 2 * s_C()*pt() / (0.2998*fG->B()); } // Dpt/pt
     66        Double_t s_z0()   { return TMath::Sqrt(fCov(3, 3)); }
     67        Double_t s_ct()   { return TMath::Sqrt(fCov(4, 4)); }
     68        //
     69        // Track hit management
     70        Int_t nHit();
     71        Int_t nmHit();
     72        Bool_t HitLayer(Int_t Layer, Double_t &R, Double_t &phi, Double_t &zz);
     73        Int_t HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh);
     74        Int_t HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh);
     75        //
     76        // Track graph
     77        TGraph *TrkPlot();      // Graph with R-z plot of track trajectory
     78        //
     79        // Make normalized matrix positive definite
     80        TMatrixDSym MakePosDef(TMatrixDSym NormMat);
    6881};
     82//
    6983#endif
Note: See TracChangeset for help on using the changeset viewer.