PandaRoot
PndPatternMatcher.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  * PatternMatcher.h
15  *
16  * Created on: Jun 16, 2017
17  * Author: Michael Papenbrock
18  */
19 
20 #ifndef PNDTRACKERS_PATTERNMATCHINGTESTS_PATTERNMATCHER_H_
21 #define PNDTRACKERS_PATTERNMATCHINGTESTS_PATTERNMATCHER_H_
22 
23 #include <FairTask.h>
24 #include <PndGeoSttPar.h>
25 #include <PndTrackCand.h>
26 #include <TClonesArray.h>
27 #include <TFile.h>
28 #include <TTree.h>
29 
30 class PndPatternMatcher : public FairTask {
31  public:
33  virtual ~PndPatternMatcher();
34 
35  void SetOutputBranchname(TString name) { fTrackCandName = name; }
36  void SetPersistence(Bool_t val) { fPersistence = val; }
37  void SetMatchRatio(float ratio) { fMatchRatio = ratio; }
38 
39  protected:
40  virtual void SetParContainers();
41  virtual InitStatus Init();
42  virtual void Exec(Option_t *opt);
43  virtual void FinishTask();
44 
45  private:
46  void LoadPatternDB(TString filename);
47  void FindMatch();
48  void CreateTrackCandFromMatch(std::set<int> partialMatch);
49 
50  // Input data
51  PndGeoSttPar *fSttParameters;
52  TClonesArray *fEventHeader;
53  TClonesArray *fSTTHitArray;
54 
55  TFile *dbFile;
56  TTree *patternTree;
57  std::vector<std::set<int>> dbTubeIDs;
58 
59  // Output data
60  std::vector<PndTrackCand> fPartialCand;
61  TClonesArray *fPartialMatchCand;
62  TString fTrackCandName;
63 
64  Bool_t fPersistence;
65 
66  bool verboseMatches;
67  float fMatchRatio;
68 
69  ClassDef(PndPatternMatcher, 1)
70 };
71 
72 #endif /* PNDTRACKERS_PATTERNMATCHINGTESTS_PATTERNMATCHER_H_ */
virtual void Exec(Option_t *opt)
void SetMatchRatio(float ratio)
virtual void SetParContainers()
void SetOutputBranchname(TString name)
virtual ~PndPatternMatcher()
void SetPersistence(Bool_t val)
virtual void FinishTask()
virtual InitStatus Init()