PandaRoot
PndMvdRiemannVertexFinderTask.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 #ifndef PNDMVDRIEMANNVERTEXFINDERTASK_H_
14 #define PNDMVDRIEMANNVERTEXFINDERTASK_H_
15 
16 #include <iostream>
17 #include "FairTask.h"
18 //#include "PndSdsHit.h"
19 #include "TH1F.h"
20 #include "PndTrackCand.h"
21 #include "PndMCTrack.h"
22 #include "TString.h"
23 #include "TClonesArray.h"
24 #include "stdio.h"
25 
26 class PndMvdRiemannVertexFinderTask : public FairTask {
27  public:
32 
34  virtual void SetParContainers();
35  virtual InitStatus Init();
36  virtual InitStatus ReInit();
37 
39  virtual void Exec(Option_t *opt);
40  virtual void FinishEvent();
41 
42  // void PrintResult(); // not implemented
43  void SetVerbose(Int_t verbose) { fVerbose = verbose; };
44  void SetVertexCut(double cut) { fVertexCut = cut; };
45  TH1F *delta;
46  TH1F *wrongV;
47 
48  std::pair<double, double> eff;
49  std::pair<double, double> ghosts;
50 
51  private:
52  TString fHitBranch;
53  TString fHitBranch2;
54  TString fTrackBranch;
55  TString fIdealTrackCandBranch;
56  TString fMCTrackBranch;
57 
58  int fEventNr;
59  int fVerbose;
60  double fVertexCut;
61 
62  TClonesArray *fHitArray;
63  TClonesArray *fHitArray2;
64  TClonesArray *fTrackCandArray;
65  // TClonesArray* fRiemannTrackArray;
66  TClonesArray *fTrackArray;
67  TClonesArray *fIdealTrackCandArray;
68  TClonesArray *fMCTrackArray;
69 
70  TClonesArray *fVertex;
71  TClonesArray *fMCVertex;
72 
73  bool CheckRecoTrack(PndTrackCand *cand, PndMCTrack *myTrack);
74 
75  bool CheckVertex(std::vector<int> Combination, std::vector<std::pair<int, int>> PairCand);
76  bool CheckTwoCands(int first, int second);
77  int FoundCandInMCCands(int candN);
78  void refit(std::vector<int> &CheckedCand);
79  void FindVertex(std::vector<int> CheckedCand, std::vector<std::pair<int, int>> &PairCand, std::vector<std::pair<int, int>> &TrueMCCand,
80  std::vector<std::pair<int, int>> &FalseMCCand, std::vector<std::pair<int, int>> &MCCand, int &MaxIndex);
81  void CalcEfficiency(std::vector<std::pair<int, int>> TrueMCCand, std::vector<std::pair<int, int>> FalseMCCand, std::vector<std::pair<int, int>> MCCand);
82 
83  void Register();
84  void Reset();
85  void ProduceHits();
86 
87  ClassDef(PndMvdRiemannVertexFinderTask, 1);
88 };
89 
90 #endif /*PndMvdRiemannVertexFinderTask_H_*/
virtual InitStatus ReInit()
virtual InitStatus Init()
virtual void Exec(Option_t *opt)
PndMvdRiemannVertexFinderTask & operator=(const PndMvdRiemannVertexFinderTask &)=delete