FairRoot/PandaRoot
PndSdsStripCorrelator.h
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------
2 //---------------- PndSdsStripCorrelator.h -------------------------
3 // Class to correlate top and bottom clusters on double sided strip sensors
4 //
5 // Authors: R. Kliemt (Uni Bonn)
6 // H.G. Zaunick (Uni Bonn)
7 // Date: June 2012
8 //
9 //------------------------------------------------------------------------------------
10 
11 #ifndef PNDSDSSTRIPCLUSTECORRELATOR_H
12 #define PNDSDSSTRIPCLUSTECORRELATOR_H 1
13 
14 #include <map>
15 #include <vector>
16 #include <utility>
17 #include <iostream>
18 
19 using namespace std;
20 
21 //Data types
22 
25  : top(), bot(), q_top(), q_bot(), prob(1.)
26  {}
27  PndSdsStripCorrelatorCand(int t, int b, double qt, double qb, double p)
28  : top(t), bot(b), q_top(qt), q_bot(qb), prob(p)
29  {}
30  int top,bot;
31  double q_top, q_bot;
32  double prob;
33 };
34 
35 
37 public:
39  : pairlist(), prob(1.)
40  {}
41  PndSdsStripCorrelatorCombi(const std::vector<PndSdsStripCorrelatorCand>& list, double p)
42  : pairlist(), prob(p)
43 
44  {
45  pairlist.insert(pairlist.end(),list.begin(),list.end());
46  }
48  : pairlist(), prob(a_combi.prob)
49  {
50  pairlist.insert(pairlist.end(),a_combi.pairlist.begin(),a_combi.pairlist.end());
51  }
52  std::vector<PndSdsStripCorrelatorCand> pairlist;
53  double prob;
54 };
55 
56 
57 // Now the "real" class
58 
60 
61 public:
62  PndSdsStripCorrelator(int mode=0, double cut=0., double noise=0., double threshold=0.);
64 
65  void Reset();
66 
67  void Setup(int mode=0, double cut=0., double noise=0., double threshold=0.);
68 
69  void AddCluster(int moduleId, int side, int clusterIndex, double charge);
70 
71  vector<pair<int,int> > GetCorrelationList();
72 
73  vector<double> GetProbList();
74  vector<double> GetSecondProbList();
75  vector<int> GetMultProbList();
76 
77 private:
78  void CalcChargeDifferenceCut();
79  void CalcLikelihoodAlgo();
80  void CalcAll();
81  std::vector<PndSdsStripCorrelatorCombi> getCombinations(std::map<int,std::map<int,PndSdsStripCorrelatorCand> > matrix, int cols, int rows);
82  std::map<int,std::map<int,PndSdsStripCorrelatorCand> > getSubMatrix(std::map<int,std::map<int,PndSdsStripCorrelatorCand> > matrix, int cols, int rows, int pivotCol, int pivotRow);
83 
84  // Module Side clusterindex charge
85  map<int,map<int,vector<pair<int,double> > > > fClusterList; //List of the cluster indices and their charges
86  vector<pair<int,int> > fCorrelationList; //List of matching top/bottom clusters
87  vector<double> fCorrelationProbList; //List of associated prob values for each module
88  vector<double> fSecondProbList; //List of the second prob values for each module
89  vector<int> fMultProbList; //List of number of correlations
90 
91  double fCut; //Cut parameter: ChargeDifference or minimum Likelihood
92  double fNoise; //Noise sigma[e-]
93  double fThreshold; //Discrimination threshold [e-]
94  int fMode; //which mode to use 0:ChargeDifferenceCut 1:Liklelihood
95  bool fCalculated; //flag for automatic calculation calls
96 
97 };
98 
99 
100 #endif
Double_t p
Definition: anasim.C:58
TTree * b
PndTransMap * map
Definition: sim_emc_apd.C:99
PndSdsStripCorrelatorCombi(const std::vector< PndSdsStripCorrelatorCand > &list, double p)
vector< double > fSecondProbList
map< int, map< int, vector< pair< int, double > > > > fClusterList
TGeoVolume * top
vector< double > fCorrelationProbList
double cut[MAX]
Definition: autocutx.C:36
Int_t mode
Definition: autocutx.C:47
PndSdsStripCorrelatorCombi(const PndSdsStripCorrelatorCombi &a_combi)
int cols[10]
Definition: evaltrig.C:69
vector< pair< int, int > > fCorrelationList
double threshold
TTree * t
Definition: bump_analys.C:13
std::vector< PndSdsStripCorrelatorCand > pairlist
double noise
PndSdsStripCorrelatorCand(int t, int b, double qt, double qb, double p)
gROOT Reset()