LDMX Software
DBScanClusterBuilder.h
Go to the documentation of this file.
1
7#ifndef DBSCANCLUSTERBUILDER_H
8#define DBSCANCLUSTERBUILDER_H
9
13#include "TFitResult.h"
14#include "TGraph.h"
15namespace recon {
16
22 public:
24
25 DBScanClusterBuilder(float minHitEnergy, float clusterHitDist,
26 float clusterZBias,
27 float minClusterHitMult); // overloaded constructor
28
29 std::vector<std::vector<const ldmx::CalorimeterHit *> > runDBSCAN(
30 const std::vector<const ldmx::CalorimeterHit *> &hits_);
31
32 void fillClusterInfoFromHits(ldmx::CaloCluster *cl,
33 std::vector<const ldmx::CalorimeterHit *> hits_,
34 bool logEnergyWeight);
35
36 void setMinHitEnergy(float x_) { min_hit_energy_ = x_; }
37
38 void setMinHitDistance(float x_) { cluster_hit_dist_ = x_; }
39
40 void setZBias(float x_) {
41 cluster_z_bias_ = x_;
42 } // set the z_ bias of the cluster
43
44 void setMinHitMultiplicity(int x_) { min_cluster_hit_mult_ = x_; }
45
46 float getMinHitEnergy() const { return min_hit_energy_; };
47
48 float setMinHitDistance() const { return cluster_hit_dist_; }
49
50 int setMinHitMultiplicity() const { return min_cluster_hit_mult_; }
51
52 private:
53 bool isIn(unsigned int i, std::vector<unsigned int> l) {
54 return std::find(l.begin(), l.end(), i) != l.end();
55 }
56 float dist(const ldmx::CalorimeterHit *a, const ldmx::CalorimeterHit *b) {
57 return sqrt(pow(a->getXPos() - b->getXPos(), 2) // distance
58 + pow(a->getYPos() - b->getYPos(), 2) +
59 pow((a->getZPos() - b->getZPos()) / cluster_z_bias_,
60 2)); // divide by the z_ bias
61 }
62
63 float min_hit_energy_{0};
64 float cluster_hit_dist_{100.};
65 float cluster_z_bias_{1.}; // private parameter for z_ bias
66 int min_cluster_hit_mult_{2};
68 enableLogging("DBScanClusterBuilder")
69};
70} // namespace recon
71
72#endif /* DBSCANCLUSTERBUILDER_H */
Class that stores calorimeter cluster information.
Class that represents a reconstructed hit in a calorimeter cell within the detector.
Base classes for all user event processing components to extend.
Stores cluster information from the ECal.
Definition CaloCluster.h:26
Represents a reconstructed hit in a calorimeter cell within the detector.
float getYPos() const
Get the Y position of the hit [mm].
float getZPos() const
Get the Z position of the hit [mm].
float getXPos() const
Get the X position of the hit [mm].