PandaRoot
BSEmcClusteringProcess.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 #ifndef BSEMCCLUSTERINGPROCESS_HH
14 #define BSEMCCLUSTERINGPROCESS_HH
15 
16 #include <memory>
17 #include <string>
18 #include <utility>
19 #include <vector>
20 
21 #include "Rtypes.h"
22 #include "RtypesCore.h"
23 
24 #include "PndContainerI.h"
25 #include "PndProcess.h"
26 
27 #include "BSEmcClusteringPar.h"
30 #include "BSEmcPositionAlgo.h"
31 
32 class BSEmcDigi;
33 class BSEmcCluster;
34 class BSEmcSubCluster;
35 class BSEmcClusteringPar;
38 class TBuffer;
39 class TClass;
40 class TMemberInspector;
41 struct BSEmcClusteringData;
42 template <class T>
43 class PndContainerI;
44 template <class T>
46 
48  Int_t DigiIdx{-1}; // digi index in fDigis
49  Int_t NNeighbours{0};
50  std::vector<Int_t> Neighbours{}; // indices of neighbours in fDigiCandidates
51  Int_t ClusterNumber{-1};
52  Double_t Time{0};
53  Int_t DetectorId{-1};
54 };
55 
68  public:
70  virtual ~BSEmcClusteringProcess();
71 
72  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
73  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
74  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
75  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
76  virtual void Process() /*override*/;
77  std::vector<BSEmcCluster *> Clustering(const std::vector<const BSEmcDigi *> &t_digis);
78 
79  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
80  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
81  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
82  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
83 
84  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
85  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
86 
87  protected:
88  std::string fClusteringParName{""};
89  std::string fClusterPropertiesParName{""};
90  std::string fPositionParName{""};
91  std::string fNeighbouringRelationParName{""};
92  std::string fDigiBranchName{""};
93  Double_t fClusterActiveTime{-1};
94  Double_t fDigiEnergyThreshold{-1};
95 
96  TString fDigiBranchname{""};
97  TString fClusterBranchname{""};
98 
99  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
100  PndMutableContainerI<BSEmcCluster> *fClusterArray{nullptr};
101 
102  std::vector<DigiClusteringCandidate> fDigiCandidates{};
103  Int_t fNClusters{0};
104  Int_t fNDigisPassed{-1};
105  std::vector<std::pair<Int_t, Int_t>> fClusterNumbersForSameCluster{};
106  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
107  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
108  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
109 
110  protected:
111  void CreateClusterableDigiCandidates(const std::vector<const BSEmcDigi *> &t_digis);
112  void FindNeighboursOfEveryDigi();
113  Bool_t AreDigisNeighbours(Int_t t_digi1, Int_t t_digi2) const;
114  void PrimaryClustering();
115  void SecondaryClustering();
116  void CleanUpClusterNumbering();
117  std::vector<BSEmcCluster *> CreateEmcCluster();
118  void AssignNeighbouringDigisSameClusterNumber(DigiClusteringCandidate &t_digi);
119 
120  ClassDef(BSEmcClusteringProcess, 1);
121 };
122 
123 #endif /*BSEMCCLUSTERINGPROCESS_HH*/
Base Process class.
Definition: PndProcess.h:36
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:66
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:59
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...