-
Notifications
You must be signed in to change notification settings - Fork 1
/
TargettedClustering.h
100 lines (81 loc) · 2.13 KB
/
TargettedClustering.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef RECURSIVECLUSTERING_H
#define RECURSIVECLUSTERING_H
#include <utility>
#include<TString.h>
#include<TFormula.h>
#include<TRandom3.h>
class Point
{
public:
Double_t fX;
Double_t fY;
Double_t fW;
Point(){}
Point(Double_t x, Double_t y, Double_t w){ fX = x; fY = y; fW = w;}
};
class Cluster
{
public:
Cluster(){}
Cluster( vector<Point> , vector<Point>, vector<Point>, Int_t, TString, TRandom3* r);
~Cluster() { }
void recluster();
Int_t FindUnclusterizableCluster( Point );
TString FindSubClusterName(Point, Int_t);
TString GetName(){ return fName; }
private:
vector<Point> fTTbar;
vector<Point> fTTH ;
vector<Point> fTTW ;
vector<Point> fData ;
vector<Point> fCentroids;
vector<Int_t> fTgt;
vector<Cluster> SubClusters;
TString fName;
TRandom3* r_;
bool fIsClusterizable;
Int_t fIndex; // global label for every non clusterizable cluster
void MakeAssignment();
Int_t CalculateCentroids();
UInt_t fK;
UInt_t FindSubCluster( Point, bool verbose=false );
Double_t d(Double_t, Double_t, Double_t, Double_t);
double FOMforClusterCut( const double*);
TFormula fFormula;
};
// https://english.stackexchange.com/questions/205815/is-targetted-a-standard-british-english-spelling
class TargettedClustering
{
public:
TargettedClustering(Int_t k, Int_t nLep=2, UInt_t seed=0) ;
~TargettedClustering() {}
void makeHistos();
void VoronoiPlot();
void VoronoiPlot2(Int_t);
void Test();
void SortedTest();
Double_t SignificanceAtLevel(Int_t);
void SignificancesEachLevel();
protected:
// Monte Carlo
vector<Point> fTTbar;
vector<Point> fTTH;
vector<Point> fTTW;
vector<Point> fTTbarMC;
vector<Point> fTTHMC;
vector<Point> fTTWMC;
vector<Point> fCentroids;
vector<double> fSignificances;
Int_t fK;
Int_t nLep_; // Choose between 2lss and 3l input
UInt_t seed_;
vector<pair<Double_t,Int_t>> SoverB;
TRandom3* r_; // Randomizer
Cluster mainCluster;
Double_t d(Double_t, Double_t, Double_t, Double_t);
void readFromFiles();
void StartTheThing();
void StoreToFile();
Int_t SortedThing(Int_t);
};
#endif