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 "BSEmcClusteringData.h"
16 #include "BSEmcClusteringPar.h"
19 #include "BSEmcPositionAlgo.h"
20 
21 class BSEmcDigi;
22 class BSEmcCluster;
23 class BSEmcSubCluster;
24 class BSEmcClusteringPar;
27 class TBuffer;
28 class TClass;
29 class TMemberInspector;
30 struct BSEmcClusteringData;
31 template <class T>
32 class PndContainerI;
33 template <class T>
35 
37  Int_t DigiIdx{-1}; // digi index in fDigis
38  Int_t NNeighbours{0};
39  std::vector<Int_t> Neighbours{}; // indices of neighbours in fDigiCandidates
40  Int_t ClusterNumber{-1};
41  Double_t Time{0};
42  Int_t DetectorId{-1};
43 };
44 
56 class BSEmcClusteringProcess : public PndProcess<BSEmcClusteringData> {
57  public:
59  virtual ~BSEmcClusteringProcess();
60 
61  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
62  virtual void SetData(BSEmcClusteringData *t_data) /*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  protected:
73  std::string fClusteringParName{""};
74  std::string fClusterPropertiesParName{""};
75  std::string fPositionParName{""};
76  std::string fNeighbouringRelationParName{""};
77  std::string fDigiBranchName{""};
78  Double_t fClusterActiveTime{-1};
79  Double_t fDigiEnergyThreshold{-1};
80 
81  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
82  PndOutputContainerI<BSEmcCluster> *fClusterArray{nullptr};
83 
84  std::vector<DigiClusteringCandidate> fDigiCandidates{};
85  Int_t fNClusters{0};
86  Int_t fNDigisPassed{-1};
87  std::vector<std::pair<Int_t, Int_t>> fClusterNumbersForSameCluster{};
88  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
89  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
90  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
91 
92  protected:
93  void CreateClusterableDigiCandidates(const std::vector<const BSEmcDigi *> &t_digis);
94  void FindNeighboursOfEveryDigi();
95  Bool_t AreDigisNeighbours(Int_t t_digi1, Int_t t_digi2) const;
96  void PrimaryClustering();
97  void SecondaryClustering();
98  void CleanUpClusterNumbering();
99  std::vector<BSEmcCluster *> CreateEmcCluster();
100  void AssignNeighbouringDigisSameClusterNumber(DigiClusteringCandidate &t_digi);
101 
102  ClassDef(BSEmcClusteringProcess, 1);
103 };
104 
105 #endif /*BSEMCCLUSTERINGPROCESS_HH*/
Base Process class.
Definition: PndProcess.h:24
Container for clustering parameter.
void SetClusteringParName(const std::string &t_parName)
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)
Container of addresses for data Container used by BSEmcClusteringTask and passed to Clustering Proces...
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...