PandaRoot
PndLmdLinFitTask.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //-----------------------------------------------------------
14 //
15 // Description:
16 // 3D Straight Line fitter
17 //
18 // Author List:
19 // Mathias Michel
20 // Anastasia Karavdina
21 //-----------------------------------------------------------
22 
23 #ifndef PNDLMDLINFITTASK_H
24 #define PNDLMDLINFITTASK_H
25 
26 #include "FairTask.h"
27 
28 #include "TMatrixDSym.h"
29 #include "TString.h"
30 
31 class PndGeoHandling;
32 class TGraph2DErrors;
33 class TClonesArray;
34 class TGeoManager;
35 class TVector3;
36 namespace ROOT {
37 namespace Math {
38 class Minimizer;
39 }
40 } // namespace ROOT
41 
42 class PndLmdLinFitTask : public FairTask {
43  public:
44  // Constructors/Destructors ---------
46  PndLmdLinFitTask(TString tTCandBranchName, TString tRecoBranchName, TString tOutputBranchName = "LMDPndTrack", TString tOutputFolder = "PndLmd");
47 
48  virtual ~PndLmdLinFitTask();
49 
50  virtual InitStatus Init();
51 
52  virtual void Exec(Option_t *opt);
53 
54  virtual void Finish();
55 
56  void SetRadLen(double x) { ftotRadLen = 1e-2 * x; } // rad.length X/X0 [%]
57 
58  protected:
59  double FCN_MS(const double *vars);
60  static double distance_MS(double x, double y, double z, double errx, double erry, const double *p, double *zpr);
61  double ScatteredAngle(double radLen); // calculate uncertainty for kink angle
62  double line3DfitMS(TGraph2DErrors *gr, const TVector3 &posSeed, const TVector3 &dirSeed, std::vector<double> &fitpar,
63  TMatrixDSym *covmatrix); // fit with kink angle
64  double GetSigmaMS(int side)
65  {
66  if (side < 1)
67  return fsigmaMSa;
68  else
69  return fsigmaMSb;
70  }
71 
72  // Input Data------------
73  TClonesArray *fTCandArray;
74  TClonesArray *fRecoArray;
75 
77  TString fRecoBranchName;
79  TString fOutputFolder;
80  // Output Data----------
81  TClonesArray *fTrackArray;
82 
83  double fPbeam;
84  double fsigmaMSa; // single hit before CVD diamond
85  double fsigmaMSb; // single hit after CVD diamond
86 
87  bool hitMergedfl[4];
88  double fPDGCode;
89  int fCharge;
91 
92  ROOT::Math::Minimizer *fmin;
93  TGraph2DErrors *fGraph2D;
94 
95  double ftotRadLen; // X/X0
96 
97  ClassDef(PndLmdLinFitTask, 2);
98 };
99 
100 #endif
TGraph2DErrors * fGraph2D
const TString vars[13]
void SetRadLen(double x)
TClonesArray * fTCandArray
Class to access the naming information of the MVD.
TClonesArray * fRecoArray
double GetSigmaMS(int side)
PndGeoHandling * fGeoH
ROOT::Math::Minimizer * fmin
TClonesArray * fTrackArray