PandaRoot
BSEmcFlagSplitOffs.h
Go to the documentation of this file.
1 #ifndef BSEMCFLAGSPLITOFFS_HH
2 #define BSEMCFLAGSPLITOFFS_HH
3 
4 
5 #include "BSEmcCluster.h"
6 #include "BSEmcClusteringData.h"
7 #include "PndContainerI.h"
9 #include "BSEmcSplitOffPar.h"
10 #include "PndParameterRegister.h"
12 #include "PndOutputContainerI.h"
13 #include "PndProcess.h"
14 #include <vector>
15 #include "TF1.h"
16 
17 class FairParGenericSet;
18 
19 class BSEmcDigi;
20 class BSEmcCluster;
21 class BSEmcSubCluster;
22 class BSEmcRecoHit;
23 
24 
25 class BSEmcFlagSplitOffs : public PndProcess<BSEmcClusteringData>
26 {
27 public:
29  virtual ~BSEmcFlagSplitOffs();
30  virtual void SetDetectorName(const std::string &t_detectorName);
31  virtual void SetupParameters(const PndParameterRegister *t_parameterRegister) ;
32  virtual void SetData(BSEmcClusteringData *t_pdata) ;
33  virtual void Process() ;
34 
35  struct Cluster_Info {
36  const std::vector<const BSEmcDigi *> &DigiArray;
37  const std::vector<const BSEmcCluster *> &ClusterArray;
39  const std::vector<const BSEmcSubCluster*> &SubclusterArray;
40 
41  Cluster_Info(const std::vector<const BSEmcDigi *> &digis,const std::vector<const BSEmcCluster *> &clusters, const BSEmcCluster* current_cluster, const std::vector<const BSEmcSubCluster*> &subclusters)
42  : DigiArray(digis),ClusterArray(clusters), cluster(current_cluster),SubclusterArray(subclusters) {}
43  };
44 
50  std::map<int,std::vector<const BSEmcSubCluster*>> CreateClusterMap();
51 
59  const BSEmcSubCluster* FindSubCluster(const BSEmcDigiInfo_t &max, std::vector<const BSEmcSubCluster*> subcluster_array);
60 
68  std::vector<BSEmcDigiInfo_t> FindSecondaryMaxima(const BSEmcDigiInfo_t &centralmax, const std::vector<BSEmcDigiInfo_t> &maxima);
69 
78  double CalculateShowerMass(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcCluster* cluster);
79 
89  bool ShowerMassCut(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcCluster* cluster);
90 
100  double CalculateHighPEDShowerMass(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcSubCluster* subcluster1,const BSEmcSubCluster* subcluster2);
101 
112  bool HighPEDCut(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcSubCluster* subcluster1,const BSEmcSubCluster* subcluster2);
113 
122  double CalculateDistance(const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &firstmax, const BSEmcDigiInfo_t &secondmax);
123 
132  double FindSmallestDistance(const std::vector<const BSEmcCluster *> &ClusterArray, const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &max);
133 
142  double FindEnergyClosestCluster(const std::vector<const BSEmcCluster *> &ClusterArray, const std::vector<const BSEmcDigi *> &DigiArray, const BSEmcDigiInfo_t &max);
143 
153  bool RatioCut(const double ratio, const double distance);
154 
162  void FlagHighPED(Cluster_Info &ClusterInfo, std::vector<int> &SplitOffSubclusterIds);
163 
171  void Flag2PED(Cluster_Info &ClusterInfo, std::vector<int> &SplitOffSubclusterIds);
172 
180  void Flag1PED(Cluster_Info &ClusterInfo, std::vector<int> &SplitOffSubclusterIds);
181 
182 private:
183 
184  std::string fPositionParName{""};
185  std::string fNeighbouringRelationParName{""};
186  std::string fSplitOffParName{""};
187  BSEmcGeoNeighbouringRelationPar *fNeighbouringRelationPar{nullptr};
188  const BSEmcCrystalPositionPar* fPositionPar;
189  BSEmcSplitOffPar *fSplitOffPar{nullptr};
190  TString fSubClusterBranchName{""};
191 
192  PndContainerI<BSEmcDigi> *fDigiArray{nullptr};
193  PndContainerI<BSEmcCluster> *fClusterArray{nullptr};
194  PndContainerI<BSEmcSubCluster> *fSubClusterArray{nullptr};
195  PndOutputContainerI<BSEmcRecoHit> *fRecoHitArray{nullptr};
196 
197  std::unique_ptr<TF1> f1PEDFunction;
198  std::unique_ptr<TF1> f2PEDFunction;
199  std::unique_ptr<TF1> fHighPEDFunction;
200 
201  ClassDef(BSEmcFlagSplitOffs,1);
202 
203 };
204 
205 #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 BSEmcSubCluster * > & SubclusterArray
std::map< int, std::vector< const BSEmcSubCluster * > > CreateClusterMap()
Create a Map that links Clusters to their corresponding Subclusters.
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...
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.
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...
Container of addresses for data Container used by BSEmcClusteringTask and passed to Clustering Proces...
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
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...
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...
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...
Helper class to indirect the Parameter fetching via the FairRuntimeDb.
virtual void SetData(BSEmcClusteringData *t_pdata)
Pass the data container ptrs to the process, and store pointers in class members. ...
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
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