PandaRoot
BSEmcFlagSplitOffs.h
Go to the documentation of this file.
1 #ifndef BSEMCFLAGSPLITOFFS_HH
2 #define BSEMCFLAGSPLITOFFS_HH
3 
4 #include "BSEmcCluster.h"
5 
8 #include "BSEmcSplitOffPar.h"
9 #include "PndContainerI.h"
10 #include "PndMutableContainerI.h"
11 #include "PndParameterRegister.h"
12 #include "PndProcess.h"
13 #include "TF1.h"
14 #include <vector>
15 
16 class FairParGenericSet;
17 
18 class BSEmcDigi;
19 class BSEmcCluster;
20 class BSEmcSubCluster;
21 class BSEmcRecoHit;
22 
24  public:
26  virtual ~BSEmcFlagSplitOffs();
27  virtual void SetDetectorName(const std::string &t_detectorName);
28  virtual void SetupParameters(const PndParameterRegister *t_parameterRegister);
29  virtual void RequestDataContainer(PndContainerRegister *t_register) /*override*/;
30  virtual void GetDataContainer(PndContainerRegister *t_register) /*override*/;
31  virtual void Process() /*override*/;
32 
33  void SetDigiBranchName(const TString &t_branchname) { fDigiBranchname = t_branchname; }
34  void SetClusterBranchName(const TString &t_branchname) { fClusterBranchname = t_branchname; }
35  void SetSubClusterBranchName(const TString &t_branchname) { fSubClusterBranchname = t_branchname; }
36  void SetRecoHitBranchName(const TString &t_branchname) { fRecoHitBranchname = t_branchname; }
37  struct Cluster_Info {
38  const std::vector<const BSEmcDigi *> &DigiArray;
39  const std::vector<const BSEmcCluster *> &ClusterArray;
41  const std::vector<const BSEmcSubCluster *> &SubclusterArray;
42 
43  Cluster_Info(const std::vector<const BSEmcDigi *> &digis, const std::vector<const BSEmcCluster *> &clusters, const BSEmcCluster *current_cluster,
44  const std::vector<const BSEmcSubCluster *> &subclusters)
45  : DigiArray(digis), ClusterArray(clusters), cluster(current_cluster), SubclusterArray(subclusters)
46  {
47  }
48  };
49 
55  std::map<int, std::vector<const BSEmcSubCluster *>> CreateClusterMap();
56 
65  const BSEmcSubCluster *FindSubCluster(const BSEmcDigiInfo_t &max, std::vector<const BSEmcSubCluster *> subcluster_array);
66 
74  std::vector<BSEmcDigiInfo_t> FindSecondaryMaxima(const BSEmcDigiInfo_t &centralmax, const std::vector<BSEmcDigiInfo_t> &maxima);
75 
85  double CalculateShowerMass(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcCluster *cluster);
86 
98  bool ShowerMassCut(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcCluster *cluster);
99 
110  double CalculateHighPEDShowerMass(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcSubCluster *subcluster1, const BSEmcSubCluster *subcluster2);
111 
124  bool HighPEDCut(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcSubCluster *subcluster1, const BSEmcSubCluster *subcluster2);
125 
135  double CalculateDistance(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &firstmax, const BSEmcDigiInfo_t &secondmax);
136 
146  double FindSmallestDistance(const std::vector<const BSEmcCluster *> &ClusterArray, const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &max);
147 
157  double FindEnergyClosestCluster(const std::vector<const BSEmcCluster *> &ClusterArray, const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &max);
158 
171  bool RatioCut(const double ratio, const double distance);
172 
183  void FlagHighPED(Cluster_Info &ClusterInfo, std::vector<int> &SplitOffSubclusterIds);
184 
195  void Flag2PED(Cluster_Info &ClusterInfo, std::vector<int> &SplitOffSubclusterIds);
196 
208  void Flag1PED(Cluster_Info &ClusterInfo, std::vector<int> &SplitOffSubclusterIds);
209 
210  private:
211  std::string fPositionParName{""};
212  std::string fNeighbouringRelationParName{""};
213  std::string fSplitOffParName{""};
214  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
215  const BSEmcCrystalPositionPar *fPositionPar;
216  BSEmcSplitOffPar *fSplitOffPar{nullptr};
217 
218  TString fDigiBranchname{""};
219  TString fClusterBranchname{""};
220  TString fSubClusterBranchname{""};
221  TString fRecoHitBranchname{""};
222 
223  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
224  PndContainerI<BSEmcCluster> *fClusterArray{nullptr};
225  PndContainerI<BSEmcSubCluster> *fSubClusterArray{nullptr};
226  PndMutableContainerI<BSEmcRecoHit> *fRecoHitArray{nullptr};
227 
228  std::unique_ptr<TF1> f1PEDFunction;
229  std::unique_ptr<TF1> f2PEDFunction;
230  std::unique_ptr<TF1> fHighPEDFunction;
231 
232  ClassDef(BSEmcFlagSplitOffs, 1);
233 };
234 
235 #endif /*BSEMCFLAGSPLITOFFS_HH*/
Base Process class.
Definition: PndProcess.h:24
double FindEnergyClosestCluster(const std::vector< const BSEmcCluster *> &ClusterArray, const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &max)
Find the next closest Cluster to the current maximum and return its energy.
Resembles/Contains all information a particle hitting the EMC can provide for later use in the PID st...
Definition: BSEmcRecoHit.h:31
double CalculateShowerMass(const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcCluster *cluster)
Calculate the shower mass of a Cluster. The shower mass corresponds to the invariant mass of a cluste...
void Flag1PED(Cluster_Info &ClusterInfo, std::vector< int > &SplitOffSubclusterIds)
Collect the crystal Ids of Subclusters from 1 PED (Particle Energy Deposition) clusters that are mark...
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
Container for SplitOff parameters.
const std::vector< const BSEmcDigi * > & DigiArray
void Flag2PED(Cluster_Info &ClusterInfo, std::vector< int > &SplitOffSubclusterIds)
Collect the crystal Ids of Subclusters from 2 PED (Particle Energy Deposition) clusters that are mark...
a cluster (group of neighboring crystals) of hit emc crystals
Definition: BSEmcCluster.h:54
std::vector< BSEmcDigiInfo_t > FindSecondaryMaxima(const BSEmcDigiInfo_t &centralmax, const std::vector< BSEmcDigiInfo_t > &maxima)
Create an array of all the secondary maxima of a Cluster.
virtual void SetupParameters(const PndParameterRegister *t_parameterRegister)
Fetch all parameters from the PndParameterRegister.
Parameter for crystal positions.
bool HighPEDCut(const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcSubCluster *subcluster1, const BSEmcSubCluster *subcluster2)
Evaluate if a high (>2) PED (Particle Energy Deposition) cluster (build out of 2 SubClusters) is dete...
std::map< int, std::vector< const BSEmcSubCluster * > > CreateClusterMap()
Create a Map that links Clusters to their corresponding Subclusters.
Cluster_Info(const std::vector< const BSEmcDigi *> &digis, const std::vector< const BSEmcCluster *> &clusters, const BSEmcCluster *current_cluster, const std::vector< const BSEmcSubCluster *> &subclusters)
const BSEmcSubCluster * FindSubCluster(const BSEmcDigiInfo_t &max, std::vector< const BSEmcSubCluster *> subcluster_array)
Search the Subcluster-array for the Subcluster that belongs to the current maximum.
const std::vector< const BSEmcSubCluster * > & SubclusterArray
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 Process()
The actual data transformation (digitizing, clustering, etc.) should be defined here.
represents the reconstructed hit of one emc crystal
Definition: BSEmcDigi.h:47
void SetClusterBranchName(const TString &t_branchname)
void SetDigiBranchName(const TString &t_branchname)
bool ShowerMassCut(const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcCluster *cluster)
Evaluate if a 2 PED (Particle Energy Deposition) cluster is determined to include a Split-Off maximum...
void SetRecoHitBranchName(const TString &t_branchname)
bool RatioCut(const double ratio, const double distance)
Evaluate if a 1 PED (Particle Energy Deposition) cluster is determined to be a Split-Off maximum base...
void SetSubClusterBranchName(const TString &t_branchname)
Interface to a datacontainer to be used in PandaROOT.
double CalculateHighPEDShowerMass(const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcSubCluster *subcluster1, const BSEmcSubCluster *subcluster2)
Calculate the shower mass of two Subclusters of a Cluster. The shower mass corresponds to the invaria...
virtual void RequestDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and get the processes container requirements.
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
Neigbouring Relations based on a list of detectorIds.
void FlagHighPED(Cluster_Info &ClusterInfo, std::vector< int > &SplitOffSubclusterIds)
Collect the crystal Ids of Subclusters from high (>2) PED (Particle Energy Deposition) clusters that ...
represents a reconstructed (splitted) emc cluster
const std::vector< const BSEmcCluster * > & ClusterArray
virtual void GetDataContainer(PndContainerRegister *t_register)
Pass the container register to the process, and set the processes container requirements.
double CalculateDistance(const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &firstmax, const BSEmcDigiInfo_t &secondmax)
Calculate the distance between the centers of two given forward endcap crystals.
virtual ~BSEmcFlagSplitOffs()
double FindSmallestDistance(const std::vector< const BSEmcCluster *> &ClusterArray, const std::vector< const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &max)
Find the next closest Cluster to the current maximum and calculate the distance to its closest digi...
simple Struct used in Cluster classes to index crystal. Includes the weight of the crystal on the cur...
Definition: BSEmcCluster.h:39