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 "BSEmcClusteringData.h"
17 #include "BSEmcClusteringPar.h"
19 #include "BSEmcGeoItem.h"
21 #include "BSEmcPositionAlgo.h"
22 
23 class BSEmcDigi;
24 class BSEmcCluster;
25 class BSEmcClusteringPar;
27 class BSEmcGeoItem;
29 class TBuffer;
30 class TClass;
31 class TMemberInspector;
32 struct BSEmcClusteringData;
33 template <class T>
34 class PndContainerI;
35 template <class T>
37 
46 class BSEmcRecursiveClustering : public PndProcess<BSEmcClusteringData> {
47  public:
49  virtual ~BSEmcRecursiveClustering();
50 
51  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
52  virtual void SetData(BSEmcClusteringData *t_data) /*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  protected:
63  std::string fClusteringParName{""};
64  std::string fClusterPropertiesParName{""};
65  std::string fPositionParName{""};
67  std::string fDigiBranchName{""};
68  Double_t fClusterActiveTime{-1};
69  Double_t fDigiEnergyThreshold{-1};
70 
73 
75  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
76  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
77  std::map<Int_t, std::unique_ptr<BSEmcGeoItem>> fIDToCrystal{};
78  std::set<BSEmcGeoItem *> fChangedCrystals{};
79 
80  protected:
81  void FillGeoItems(const std::vector<const BSEmcDigi *> &t_digis);
82  std::vector<std::vector<BSEmcGeoItem *>> SpatialClustering(const std::vector<const BSEmcDigi *> &t_digis);
83  std::vector<BSEmcCluster *> ConvertToCluster(const std::vector<std::vector<BSEmcGeoItem *>> &t_clusterstubs, const std::vector<const BSEmcDigi *> &t_digis) const;
84  void Reset();
85 
87 };
88 
89 #endif /*BSEMCRECURSIVECLUSTERING_HH*/
ClassDef(BSEmcRecursiveClustering, 1)
Base Process class.
Definition: PndProcess.h:24
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.
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 ~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)
PndOutputContainerI< BSEmcCluster > * fClusterArray
Convenience object for neighbouring relations used by BSEmcRecursiveClustering.
Definition: BSEmcGeoItem.h:25
Container of addresses for data Container used by BSEmcClusteringTask and passed to Clustering Proces...
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
virtual void SetData(BSEmcClusteringData *t_data)
Pass the data container ptrs to the process, and store pointers in class members. ...
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.
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)