PandaRoot
BSEmcRecursiveClustering.h
Go to the documentation of this file.
1 #ifndef BSEMCRECURSIVECLUSTERING_HH
2 #define BSEMCRECURSIVECLUSTERING_HH
3 
4 #include <map>
5 #include <memory>
6 #include <set>
7 #include <string>
8 #include <vector>
9 
10 #include "Rtypes.h"
11 #include "RtypesCore.h"
12 
13 #include "PndContainerI.h"
14 #include "PndProcess.h"
15 
16 #include "BSEmcClusteringPar.h"
18 #include "BSEmcGeoItem.h"
20 #include "BSEmcPositionAlgo.h"
21 
22 class BSEmcDigi;
23 class BSEmcCluster;
24 class BSEmcClusteringPar;
26 class BSEmcGeoItem;
28 class TBuffer;
29 class TClass;
30 class TMemberInspector;
31 struct BSEmcClusteringData;
32 template <class T>
33 class PndContainerI;
34 template <class T>
36 
46  public:
48  virtual ~BSEmcRecursiveClustering();
49 
50  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
51  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
52  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
53  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
54  virtual void Process() /*override*/;
55  std::vector<BSEmcCluster *> Clustering(const std::vector<const BSEmcDigi *> &t_digis);
56 
57  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
58  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
59  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
60  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
61 
62  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
63  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
64 
65  protected:
66  std::string fClusteringParName{""};
67  std::string fClusterPropertiesParName{""};
68  std::string fPositionParName{""};
70  Double_t fClusterActiveTime{-1};
71  Double_t fDigiEnergyThreshold{-1};
72 
73  TString fDigiBranchname{""};
74  TString fClusterBranchname{""};
75 
78 
80  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
81  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
82  std::map<Int_t, std::unique_ptr<BSEmcGeoItem>> fIDToCrystal{};
83  std::set<BSEmcGeoItem *> fChangedCrystals{};
84 
85  protected:
86  void FillGeoItems(const std::vector<const BSEmcDigi *> &t_digis);
87  std::vector<std::vector<BSEmcGeoItem *>> SpatialClustering(const std::vector<const BSEmcDigi *> &t_digis);
88  std::vector<BSEmcCluster *> ConvertToCluster(const std::vector<std::vector<BSEmcGeoItem *>> &t_clusterstubs, const std::vector<const BSEmcDigi *> &t_digis) const;
89  void Reset();
90 
92 };
93 
94 #endif /*BSEMCRECURSIVECLUSTERING_HH*/
ClassDef(BSEmcRecursiveClustering, 1)
Base Process class.
Definition: PndProcess.h:24
PndMutableContainerI< BSEmcCluster > * fClusterArray
Container for clustering parameter.
void FillGeoItems(const std::vector< const BSEmcDigi *> &t_digis)
virtual void SetupParameters(const PndParameterRegister *t_paramRegister)
Fetch all parameters from the PndParameterRegister.
void SetClusterBranchName(const TString &t_branchname)
virtual void SetDetectorName(const std::string &t_detectorName)
Set the Detector name. Important, as most EmcParameter need to know for which detector they need to b...
virtual void GetDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and set the processes container requirements.
virtual ~BSEmcRecursiveClustering()
Helper class to calculate the cluster position.
void SetPositionParName(const std::string &t_parName)
PndContainerI< BSEmcDigi > * fDigiArray
BSEmcGeoNeighbouringRelationPar * fNeighbouringRelationPar
void SetClusteringParName(const std::string &t_parName)
a cluster (group of neighboring crystals) of hit emc crystals
Definition: BSEmcCluster.h:54
std::vector< BSEmcCluster * > Clustering(const std::vector< const BSEmcDigi *> &t_digis)
virtual void RequestDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and get the processes container requirements.
Convenience object for neighbouring relations used by BSEmcRecursiveClustering.
Definition: BSEmcGeoItem.h:25
std::vector< std::vector< BSEmcGeoItem * > > SpatialClustering(const std::vector< const BSEmcDigi *> &t_digis)
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:47
std::vector< BSEmcCluster * > ConvertToCluster(const std::vector< std::vector< BSEmcGeoItem *>> &t_clusterstubs, const std::vector< const BSEmcDigi *> &t_digis) const
virtual void Process()
The actual data transformation (digitizing, clustering, etc.) should be defined here.
Interface to a datacontainer to be used in PandaROOT.
std::set< BSEmcGeoItem * > fChangedCrystals
Helper class to calculate the Energies of a cluster.
void SetDigiBranchName(const TString &t_branchname)
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
Neigbouring Relations based on a list of detectorIds.
std::unique_ptr< BSEmcEnergyCalculationAlgo > fEnergyProcess
void SetClusterPropertiesParName(const std::string &t_parName)
std::unique_ptr< BSEmcPositionAlgo > fPositionProcess
std::map< Int_t, std::unique_ptr< BSEmcGeoItem > > fIDToCrystal
void SetNeighbouringRelationParName(const std::string &t_parName)