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 bool saveHitContribs = true);
36
37 void setMinHitEnergy(float x_) { min_hit_energy_ = x_; }
38
39 void setMinHitDistance(float x_) { cluster_hit_dist_ = x_; }
40
41 void setZBias(float x_) {
42 cluster_z_bias_ = x_;
43 } // set the z_ bias of the cluster
44
45 void setMinHitMultiplicity(int x_) { min_cluster_hit_mult_ = x_; }
46
47 float getMinHitEnergy() const { return min_hit_energy_; };
48
49 float setMinHitDistance() const { return cluster_hit_dist_; }
50
51 int setMinHitMultiplicity() const { return min_cluster_hit_mult_; }
52
53 private:
54 bool isIn(unsigned int i, std::vector<unsigned int> l) {
55 return std::find(l.begin(), l.end(), i) != l.end();
56 }
57 float dist(const ldmx::CalorimeterHit *a, const ldmx::CalorimeterHit *b) {
58 return sqrt(pow(a->getXPos() - b->getXPos(), 2) // distance
59 + pow(a->getYPos() - b->getYPos(), 2) +
60 pow((a->getZPos() - b->getZPos()) / cluster_z_bias_,
61 2)); // divide by the z_ bias
62 }
63
64 float min_hit_energy_{0};
65 float cluster_hit_dist_{100.};
66 float cluster_z_bias_{1.}; // private parameter for z_ bias
67 int min_cluster_hit_mult_{2};
69 enableLogging("DBScanClusterBuilder")
70};
71} // namespace recon
72
73#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].