PandaRoot
BSEmcClusteringProcess.h
Go to the documentation of this file.
1 #ifndef BSEMCCLUSTERINGPROCESS_HH
2 #define BSEMCCLUSTERINGPROCESS_HH
3 
4 #include <memory>
5 #include <string>
6 #include <utility>
7 #include <vector>
8 
9 #include "Rtypes.h"
10 #include "RtypesCore.h"
11 
12 #include "PndContainerI.h"
13 #include "PndProcess.h"
14 
15 #include "BSEmcClusteringPar.h"
18 #include "BSEmcPositionAlgo.h"
19 
20 class BSEmcDigi;
21 class BSEmcCluster;
22 class BSEmcSubCluster;
23 class BSEmcClusteringPar;
26 class TBuffer;
27 class TClass;
28 class TMemberInspector;
29 struct BSEmcClusteringData;
30 template <class T>
31 class PndContainerI;
32 template <class T>
34 
36  Int_t DigiIdx{-1}; // digi index in fDigis
37  Int_t NNeighbours{0};
38  std::vector<Int_t> Neighbours{}; // indices of neighbours in fDigiCandidates
39  Int_t ClusterNumber{-1};
40  Double_t Time{0};
41  Int_t DetectorId{-1};
42 };
43 
56  public:
58  virtual ~BSEmcClusteringProcess();
59 
60  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
61  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
62  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
63  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
64  virtual void Process() /*override*/;
65  std::vector<BSEmcCluster *> Clustering(const std::vector<const BSEmcDigi *> &t_digis);
66 
67  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
68  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
69  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
70  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
71 
72  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
73  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
74 
75  protected:
76  std::string fClusteringParName{""};
77  std::string fClusterPropertiesParName{""};
78  std::string fPositionParName{""};
79  std::string fNeighbouringRelationParName{""};
80  std::string fDigiBranchName{""};
81  Double_t fClusterActiveTime{-1};
82  Double_t fDigiEnergyThreshold{-1};
83 
84  TString fDigiBranchname{""};
85  TString fClusterBranchname{""};
86 
87  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
88  PndMutableContainerI<BSEmcCluster> *fClusterArray{nullptr};
89 
90  std::vector<DigiClusteringCandidate> fDigiCandidates{};
91  Int_t fNClusters{0};
92  Int_t fNDigisPassed{-1};
93  std::vector<std::pair<Int_t, Int_t>> fClusterNumbersForSameCluster{};
94  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
95  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
96  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
97 
98  protected:
99  void CreateClusterableDigiCandidates(const std::vector<const BSEmcDigi *> &t_digis);
100  void FindNeighboursOfEveryDigi();
101  Bool_t AreDigisNeighbours(Int_t t_digi1, Int_t t_digi2) const;
102  void PrimaryClustering();
103  void SecondaryClustering();
104  void CleanUpClusterNumbering();
105  std::vector<BSEmcCluster *> CreateEmcCluster();
106  void AssignNeighbouringDigisSameClusterNumber(DigiClusteringCandidate &t_digi);
107 
108  ClassDef(BSEmcClusteringProcess, 1);
109 };
110 
111 #endif /*BSEMCCLUSTERINGPROCESS_HH*/
Base Process class.
Definition: PndProcess.h:24
Container for clustering parameter.
void SetClusteringParName(const std::string &t_parName)
void SetDigiBranchName(const TString &t_branchname)
void SetClusterBranchName(const TString &t_branchname)
Helper class to calculate the cluster position.
void SetNeighbouringRelationParName(const std::string &t_parName)
std::vector< Int_t > Neighbours
a cluster (group of neighboring crystals) of hit emc crystals
Definition: BSEmcCluster.h:54
void SetPositionParName(const std::string &t_parName)
void SetClusterPropertiesParName(const std::string &t_parName)
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:47
Interface to a datacontainer to be used in PandaROOT.
Helper class to calculate the Energies of a cluster.
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
Neigbouring Relations based on a list of detectorIds.
DetectorId
represents a reconstructed (splitted) emc cluster
Rewritten version of old PndEmcMakeCluster algorithm for easier understanding and debugging...