FairRoot/PandaRoot
PndLmdPairFinderTask.h
Go to the documentation of this file.
1 /*
2  * PairFinderTask.h
3  *
4  * Created on: Jul 22, 2014
5  * Author: Roman Klasen, roklasen@uni-mainz.de or klasen@kph.uni-mainz.de
6  */
7 
8 #ifndef PNDLMDPAIRFINDERTASK_H_
9 #define PNDLMDPAIRFINDERTASK_H_
10 
11 #include "PndLmdAlignStructs.h"
12 #include <PndLmdHitPair.h>
13 #include <PndSdsHit.h>
14 #include "PndSdsTask.h"
15 
16 #include "TClonesArray.h"
17 
18 #include <boost/property_tree/ptree.hpp>
19 
20 #include <iostream>
21 #include <string>
22 #include <vector>
23 
25 
27 
28 private:
29 
30  //for statistics
36  Int_t unsuitable;
38  Int_t noOfCombos;
39 
41 
43 
44  //data for dynamic cut
47  std::string _cutParameterFile;
48  std::map<int, dynamicCutHandler> cutHandlers;
49 
51 
52  boost::property_tree::ptree config;
53 
54 public:
55 
56  void SetParContainers();
57 
59  PndLmdPairFinderTask(const char* name);
60  virtual ~PndLmdPairFinderTask();
61 
63  virtual void SetBranchNames();
64 
66  virtual InitStatus Init();
67  virtual InitStatus ReInit();
68 
70  virtual void Exec(Option_t* opt);
71 
72  virtual void FinishEvent();
73  virtual void FinishTask();
74 
75  //find the minDistance and maxDistance for dynamic cut
76  void findDynamicCutParameters(Bool_t value, std::string parameterFile) {
78  _cutParameterFile = parameterFile;
79  }
80 
81  //apply a dynamic cut. uses the first N pairs to decide what min and max distance should be.
82  void useDynamicCut(Bool_t value, std::string parameterFile) {
83  _useDynamicCut = value;
84  _cutParameterFile = parameterFile;
85  }
86 
87  // apply distance cut, will be ignored when using dynamic cut
88  void setMaxDistance(Double_t value) {
89  _maxDistance = value;
90  }
91 
92  void ignoreClusters(Bool_t value) {
93  _ignoreClusters = value;
94  }
95 
96 protected:
97 
98  //PndLmdDim* dimension;
99 
101 
102  TClonesArray* digiArray;
103  TClonesArray* recoArray;
104  TClonesArray* hitPairArray;
105  TClonesArray* clusterCandidateArray;
106 
109 
110  std::map<int, TClonesArray*> hitPairMap;
111  std::map<int, int> hitCountMap;
112 
113  void Register();
114  void Reset();
115 
116  //function to return result of all checks, distance cut etc.
117  void getStatistics(PndLmdHitPair &candidate);
118 
119  bool applyDynamicDistanceCut(PndLmdHitPair &candidate);
120  bool applyStaticDistanceCut(PndLmdHitPair &candidate);
121 
122  //self explanatory
123  bool candHitsOverlappingArea(const PndLmdHitPair &candidate);
124 
125  //means two clusters can reasonably belong to a single track
126  bool candDistanceIsGood(PndLmdHitPair &candidate);
127 
129  ;
130 };
131 
132 #endif /* PAIRFINDERTASK_H_ */
void ignoreClusters(Bool_t value)
std::map< int, dynamicCutHandler > cutHandlers
ClassDef(PndSdsTask, 1)
virtual InitStatus ReInit()
bool applyStaticDistanceCut(PndLmdHitPair &candidate)
std::map< int, TClonesArray * > hitPairMap
bool candDistanceIsGood(PndLmdHitPair &candidate)
bool applyDynamicDistanceCut(PndLmdHitPair &candidate)
virtual InitStatus Init()
void findDynamicCutParameters(Bool_t value, std::string parameterFile)
void getStatistics(PndLmdHitPair &candidate)
void useDynamicCut(Bool_t value, std::string parameterFile)
pixelHit getPixelHitFromSdsHit(PndSdsHit *sdsHit)
TClonesArray * clusterCandidateArray
PndLmdGeometryHelper * helper
boost::property_tree::ptree config
Double_t
TString name
bool candHitsOverlappingArea(const PndLmdHitPair &candidate)
void setMaxDistance(Double_t value)
std::map< int, int > hitCountMap
virtual void Exec(Option_t *opt)