PandaRoot
PndTrackFunctor.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  * PndTrackFunctor.h
15  *
16  * Created on: 02.02.2017
17  * Author: Stockmanns
18  */
19 
20 #ifndef PNDTOOLS_TRACKINGQA_PNDTRACKFUNCTOR_H_
21 #define PNDTOOLS_TRACKINGQA_PNDTRACKFUNCTOR_H_
22 
23 #include "FairMultiLinkedData.h"
24 #include "FairRootManager.h"
25 
26 #include <functional>
27 
29  public:
30  virtual Bool_t operator()(FairMultiLinkedData *a, Bool_t primary) { return Call(a, primary); };
31  static PndTrackFunctor *make_PndTrackFunctor(std::string functorName);
32  virtual Bool_t Call(FairMultiLinkedData *a, Bool_t primary) = 0;
33  virtual void Print() = 0;
34 
35  virtual ~PndTrackFunctor(){};
36 };
37 
39  Bool_t Call(FairMultiLinkedData *a, Bool_t)
40  { // primary //[R.K.03/2017] unused variable(s)
41  FairRootManager *ioman = FairRootManager::Instance();
42  Bool_t possibleTrack = kFALSE;
43  possibleTrack =
44  (possibleTrack | ((a->GetLinksWithType(ioman->GetBranchId("MVDHitsPixel")).GetNLinks() + a->GetLinksWithType(ioman->GetBranchId("MVDHitsStrip")).GetNLinks()) > 3));
45 
46  possibleTrack = (possibleTrack | ((a->GetLinksWithType(ioman->GetBranchId("MVDHitsPixel")).GetNLinks() + a->GetLinksWithType(ioman->GetBranchId("MVDHitsStrip")).GetNLinks() +
47  a->GetLinksWithType(ioman->GetBranchId("STTHit")).GetNLinks() + a->GetLinksWithType(ioman->GetBranchId("GEMHit")).GetNLinks()) > 5));
48 
49  return possibleTrack;
50  }
51 
52  void Print() { std::cout << "StandardTrackFunctor: > 3 Hits in MVD or > 5 Hits in (MVD+Stt+GEM)" << std::endl; }
53 };
54 
56  Bool_t Call(FairMultiLinkedData *a, Bool_t)
57  { // primary //[R.K.03/2017] unused variable(s)
58  FairRootManager *ioman = FairRootManager::Instance();
59  Bool_t possibleTrack = kFALSE;
60 
61  possibleTrack = (possibleTrack | (a->GetLinksWithType(ioman->GetBranchId("STTHit")).GetNLinks() > 5));
62 
63  return possibleTrack;
64  }
65  void Print() { std::cout << "OnlySttFunctor: > 5 Hits in Stt" << std::endl; }
66 };
67 
69  Bool_t Call(FairMultiLinkedData *a, Bool_t)
70  {
71  FairRootManager *ioman = FairRootManager::Instance();
72  Bool_t possibleTrack = kFALSE;
73 
74  possibleTrack = (possibleTrack | (a->GetLinksWithType(ioman->GetBranchId("STTSortedHits")).GetNLinks() > 5));
75 
76  return possibleTrack;
77  }
78  void Print() { std::cout << "OnlySttTimeBasedFunctor: > 5 Hits in Stt" << std::endl; }
79 };
80 
82  Bool_t Call(FairMultiLinkedData *a, Bool_t)
83  { // primary //[R.K.03/2017] unused variable(s)
84  FairRootManager *ioman = FairRootManager::Instance();
85  Bool_t possibleTrack = kFALSE;
86  Bool_t mvdHits = ((a->GetLinksWithType(ioman->GetBranchId("MVDHitsPixel")).GetNLinks() + a->GetLinksWithType(ioman->GetBranchId("MVDHitsStrip")).GetNLinks()) > 2);
87 
88  if (mvdHits) {
89  possibleTrack = (a->GetLinksWithType(ioman->GetBranchId("STTHit")).GetNLinks() > 1) | (a->GetLinksWithType(ioman->GetBranchId("GEMHit")).GetNLinks() > 1);
90  }
91  return possibleTrack;
92  }
93  void Print() { std::cout << "RiemannMvdSttGemFunctor: > 2 Hits in MVD and >0 Hits in (Stt+Gem)" << std::endl; }
94 };
95 
97  Bool_t Call(FairMultiLinkedData *a, Bool_t primary)
98  {
99  if (primary == kFALSE)
100  return kFALSE;
101  FairRootManager *ioman = FairRootManager::Instance();
102  Bool_t possibleTrack = kFALSE;
103 
104  Int_t nHitsMvdPixel = a->GetLinksWithType(ioman->GetBranchId("MVDHitsPixel")).GetNLinks();
105  Int_t nHitsMvdStrip = a->GetLinksWithType(ioman->GetBranchId("MVDHitsStrip")).GetNLinks();
106  if (nHitsMvdPixel + nHitsMvdStrip > 2) { // First requirement: more than two MVD hits
107  // Int_t nHitsStt = a->GetLinksWithType(ioman->GetBranchId("STTHit")).GetNLinks();
108  // Int_t nHitsGem = a->GetLinksWithType(ioman->GetBranchId("GEMHit")).GetNLinks();
109  possibleTrack = kTRUE;
110  // possibleTrack = (nHitsMvdPixel + nHitsMvdStrip + nHitsStt + nHitsGem > 6); // Second requirement: More than six hits total
111  }
112  return possibleTrack;
113  }
114  void Print() { std::cout << "CircleHoughTrackFunctor: >= 3 Hits in MVD and primary track" << std::endl; }
115 };
116 
118  Bool_t Call(FairMultiLinkedData *a, Bool_t)
119  { // primary //[R.K.03/2017] unused variable(s)
120  FairRootManager *ioman = FairRootManager::Instance();
121  Bool_t possibleTrack = kFALSE;
122 
123  possibleTrack = (possibleTrack | (a->GetLinksWithType(ioman->GetBranchId("FTSHit")).GetNLinks() > 5));
124 
125  return possibleTrack;
126  }
127  void Print() { std::cout << "FTSTrackFunctor: > 5 Hits in Fts" << std::endl; }
128 };
129 
131  Bool_t Call(FairMultiLinkedData *a, Bool_t primary)
132  {
133  FairRootManager *ioman = FairRootManager::Instance();
134  Bool_t possibleTrack = kFALSE;
135 
136  possibleTrack = (possibleTrack | !(a->GetLinksWithType(ioman->GetBranchId("FTSHit")).GetNLinks() > 0));
137  if (possibleTrack == kFALSE)
138  return kFALSE;
139  StandardTrackFunctor standard;
140  possibleTrack = kFALSE;
141  possibleTrack = (possibleTrack | standard(a, primary));
142 
143  return possibleTrack;
144  }
145  void Print() { std::cout << "noFTSTrackFunctor: no Hits in Fts + standardFunctor!" << std::endl; }
146 };
147 
149  Bool_t Call(FairMultiLinkedData *, Bool_t)
150  { // a primary//[R.K.03/2017] unused variable(s)
151  return kTRUE;
152  }
153  void Print() { std::cout << "AllTracksFunctor: take everything" << std::endl; }
154 };
155 
156 #endif /* PNDTOOLS_TRACKINGQA_PNDTRACKFUNCTOR_H_ */
virtual void Print()=0
virtual ~PndTrackFunctor()
static PndTrackFunctor * make_PndTrackFunctor(std::string functorName)
virtual Bool_t operator()(FairMultiLinkedData *a, Bool_t primary)
virtual Bool_t Call(FairMultiLinkedData *a, Bool_t primary)=0