PandaRoot
BSEmcRecursiveClustering.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 BSEMCRECURSIVECLUSTERING_HH
14 #define BSEMCRECURSIVECLUSTERING_HH
15 
16 #include <map>
17 #include <memory>
18 #include <set>
19 #include <string>
20 #include <vector>
21 
22 #include "Rtypes.h"
23 #include "RtypesCore.h"
24 
25 #include "PndContainerI.h"
26 #include "PndProcess.h"
27 
28 #include "BSEmcClusteringPar.h"
30 #include "BSEmcGeoItem.h"
32 #include "BSEmcPositionAlgo.h"
33 
34 class BSEmcDigi;
35 class BSEmcCluster;
36 class BSEmcClusteringPar;
38 class BSEmcGeoItem;
40 class TBuffer;
41 class TClass;
42 class TMemberInspector;
43 struct BSEmcClusteringData;
44 template <class T>
45 class PndContainerI;
46 template <class T>
48 
58  public:
60  virtual ~BSEmcRecursiveClustering();
61 
62  virtual void SetDetectorName(const std::string &t_detectorName) /*override*/;
63  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
64  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
65  virtual void SetupParameters(const PndParameterRegister *t_paramRegister) /*override*/;
66  virtual void Process() /*override*/;
67  std::vector<BSEmcCluster *> Clustering(const std::vector<const BSEmcDigi *> &t_digis);
68 
69  void SetClusteringParName(const std::string &t_parName) { fClusteringParName = t_parName; }
70  void SetClusterPropertiesParName(const std::string &t_parName) { fClusterPropertiesParName = t_parName; }
71  void SetPositionParName(const std::string &t_parName) { fPositionParName = t_parName; }
72  void SetNeighbouringRelationParName(const std::string &t_parName) { fNeighbouringRelationParName = t_parName; }
73 
74  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
75  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
76 
77  protected:
78  std::string fClusteringParName{""};
79  std::string fClusterPropertiesParName{""};
80  std::string fPositionParName{""};
82  Double_t fClusterActiveTime{-1};
83  Double_t fDigiEnergyThreshold{-1};
84 
85  TString fDigiBranchname{""};
86  TString fClusterBranchname{""};
87 
90 
92  std::unique_ptr<BSEmcPositionAlgo> fPositionProcess{new BSEmcPositionAlgo};
93  std::unique_ptr<BSEmcEnergyCalculationAlgo> fEnergyProcess{new BSEmcEnergyCalculationAlgo};
94  std::map<Int_t, std::unique_ptr<BSEmcGeoItem>> fIDToCrystal{};
95  std::set<BSEmcGeoItem *> fChangedCrystals{};
96 
97  protected:
98  void FillGeoItems(const std::vector<const BSEmcDigi *> &t_digis);
99  std::vector<std::vector<BSEmcGeoItem *>> SpatialClustering(const std::vector<const BSEmcDigi *> &t_digis);
100  std::vector<BSEmcCluster *> ConvertToCluster(const std::vector<std::vector<BSEmcGeoItem *>> &t_clusterstubs, const std::vector<const BSEmcDigi *> &t_digis) const;
101  void Reset();
102 
104 };
105 
106 #endif /*BSEMCRECURSIVECLUSTERING_HH*/
ClassDef(BSEmcRecursiveClustering, 1)
Base Process class.
Definition: PndProcess.h:36
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:66
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:37
std::vector< std::vector< BSEmcGeoItem * > > SpatialClustering(const std::vector< const BSEmcDigi *> &t_digis)
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:59
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)