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, bool debug);
31
32 void fillClusterInfoFromHits(ldmx::CaloCluster *cl,
33 std::vector<const ldmx::CalorimeterHit *> hits,
34 bool logEnergyWeight);
35
36 void setMinHitEnergy(float x) { minHitEnergy_ = x; }
37
38 void setMinHitDistance(float x) { clusterHitDist_ = x; }
39
40 void setZBias(float x) {
41 clusterZBias_ = x;
42 } // set the z bias of the cluster
43
44 void setMinHitMultiplicity(int x) { minClusterHitMult_ = x; }
45
46 float getMinHitEnergy() const { return minHitEnergy_; };
47
48 float setMinHitDistance() const { return clusterHitDist_; }
49
50 int setMinHitMultiplicity() const { return minClusterHitMult_; }
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()) / clusterZBias_,
60 2)); // divide by the z bias
61 }
62
63 float minHitEnergy_{0};
64 float clusterHitDist_{100.};
65 float clusterZBias_{1.}; // private parameter for z bias
66 int minClusterHitMult_{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].