StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPmdClustering.h
1 
5 /******************************************************
6  *
7  * $Id: StPmdClustering.h,v 1.11 2010/05/29 00:47:10 rashmi Exp $
8  *
9  * Author: Dr. S.C. Phatak
10  * Dipak Mishra
11  ******************************************************
12  *
13  * Description: Base class for PMD clusters
14  *
15  * $Log: StPmdClustering.h,v $
16  * Revision 1.11 2010/05/29 00:47:10 rashmi
17  * Added a call to new clustering routines in StPmdClustering
18  *
19  * Revision 1.10 2010/04/15 06:52:32 rashmi
20  * Clustering with option to turn calibration refineclustering on/off
21  *
22  * Revision 1.9 2007/11/02 11:00:14 rashmi
23  * Applying hitcalibration; eta,phi wrt primary vertex
24  *
25  * Revision 1.8 2007/08/31 10:52:00 rashmi
26  * Defined cutoff, setting it using inline SetAdcCutOff()
27  *
28  * Revision 1.7 2004/09/07 23:02:43 fisyak
29  * Add missing default ctors
30  *
31  * Revision 1.6 2004/07/19 13:23:27 subhasis
32  * checks applied on clust_cell dimension
33  *
34  * Revision 1.5 2004/06/24 13:43:02 subhasis
35  * several changes in clustering code
36  *
37  *
38  ******************************************************/
39 #ifndef STAR_StPmdClustering
40 #define STAR_StPmdClustering
41 #include <TH2.h>
42 #include<math.h>
43 #include <TH1.h>
44 #include <TCanvas.h>
45 #include <TArrayF.h>
46 #include <TArrayI.h>
47 #include "StPmdAbsClustering.h"
48 #include "StThreeVectorF.hh"
49 class StPmdHit;
50 class StPmdCluster;
51 class StPmdModule;
52 class StPmdDetector;
55 {
56 
57  private:
58 
59  // These options are passed to this maker by StPmdClusterMaker
60  Bool_t mOptCalibrate;
61  Bool_t mOptSimulate;
62  Bool_t mOptRefineCluster;
63  Double_t cutoff;
64  StThreeVectorF mVertexPos;
65 
66  StPmdClusterCollection * pmdclus;
67 
68  //Made static so that I to declare this only once and not for each module
69  static const Int_t NColumnMax = 96;; //Maximum number of cell along x axis
70  static const Int_t NRowMax = 72; //Maximum number of cells along y axis
71  // static StPmdHit* hitmap[NRowMax][NColumnMax];//stores addresses of hits
72  static const Int_t CutOff = 7;
73  static const Int_t MaxHits = 15000; // max hits in an event
74  static const Int_t MaxSuperSize = 2000;
75  static const Int_t MaxLocalPeaks = 700;
76  static const Int_t MaxClusterSize = 2000;
77  static const Int_t MaxNeighLP = 35;
78  // static const Float_t logweight = 4.5;
79  // Float_t logweight;
80  static const Int_t debug = 0; // 0 for no cout; 1 for cout;
81 
82  // TClonesArray * mPmdSuperClusters;
83  void CellXY(Int_t, Int_t, Float_t&, Float_t&);
84 
85  //checks whether the hit position in question is within the SM boundary
86  Int_t CheckBoundary(Int_t, Int_t, Int_t);
87 
88 
89  protected:
90 
91 
92  public:
93  // functions for clustering
95  StPmdClustering(StPmdDetector *pmd_det = 0, StPmdDetector* cpv_det = 0);
97  virtual ~StPmdClustering();
98 
99  // These are the new cluster maker functions
100 
102  // void findPmdClusters(); // new method
104  // Make clusters our of superclusters => refclust
105  Int_t MakeClusters(TClonesArray *);
106  //Int_t MakeClusters(TClonesArray *, StPmdClusterCollection*);
107  // Make SuperClusters => crclust
108  Int_t MakeSuperClusters(Int_t, StPmdModule*,TClonesArray*);
109  // Helping BreakSuperClusters
110  Int_t GetLocalPeaks(Int_t*,TList *);
111  // Breaks the supercluster by associating cells with each localPeak
112  Bool_t BreakSuperCluster(Int_t, Int_t*, TList * );
113  //Bool_t BreakSuperCluster(Int_t, Int_t*, TList * , StPmdClusterCollection *);
114  Float_t BuildCluster(StPmdCluster*, Float_t*);
115  // GetCluster Properties from hits =>CentroidCal
116  void Cell_eta_phi(Float_t, Float_t, Float_t &, Float_t &);
117 
118  // These are the old cluster maker functions
119 
121  // void findPmdClusters(); // old method
123 
125  Int_t crclust(Double_t , Double_t, Int_t, Int_t);
127  void refclust(StPmdDetector*,Int_t, Int_t, Int_t,StPmdClusterCollection*);
128 
130  void order(Int_t);
132  void arrange(Int_t);
133  Double_t Dist(Double_t, Double_t, Double_t, Double_t);
134 
136  // void gaussfit(Int_t, Int_t, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &,Double_t &,Double_t & );
138  void printclust(Int_t,Int_t, StPmdCluster*);
140  Int_t CentroidCal(Int_t,Int_t,Double_t&,Double_t&,Double_t&,Double_t&,Double_t&,Double_t&,Double_t&,Double_t&,Double_t&);
141  void SetAdcCutOff(Double_t adccutoff);
142  void SetVertexPos(const StThreeVectorF&);
143  void Cluster_Eta_Phi(Float_t, Float_t, Float_t,Float_t&, Float_t&);
144 
145 
146  void SetOptCalibrate(Bool_t a=kTRUE){mOptCalibrate = a;} // Default is on; YES Calibrate
147  void SetOptSimulate(Bool_t a=kFALSE){mOptSimulate = a;} // Default is off; No Simulation
148  void SetOptRefineCluster(Bool_t a=kFALSE){mOptRefineCluster = a;} // Default is off; NO Refine Clustering
149 
150 
152  // StPmdHit* GetHit(StPmdDetector*, Int_t, Int_t, Int_t);
153  StPmdHit* GetHit(StPmdDetector*, Int_t, Double_t, Double_t);
154 
155  ClassDef(StPmdClustering, 1)
156  };
157 
158  inline void StPmdClustering::SetAdcCutOff(Double_t adccutoff){
159  cutoff = adccutoff;
160  }
161 
162 inline void StPmdClustering::SetVertexPos(const StThreeVectorF& vertexPos){
163  mVertexPos = vertexPos;
164 }
165 
166 
167 
168 
169 #endif
170 
171 
172 
173 
174 
Bool_t findPmdClusters2(StPmdDetector *)
for Pmd clusters
void printclust(Int_t, Int_t, StPmdCluster *)
distance between two clusters
StPmdHit * GetHit(StPmdDetector *, Int_t, Double_t, Double_t)
for getting hits of each cluster
void findPmdClusters(StPmdDetector *)
for Pmd clusters
void order(Int_t)
for ordering
StPmdClustering(StPmdDetector *pmd_det=0, StPmdDetector *cpv_det=0)
constructor
Int_t CentroidCal(Int_t, Int_t, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &, Double_t &)
for Calculating cluster properties, those clusters having more then two cells
void arrange(Int_t)
ordering
void refclust(StPmdDetector *, Int_t, Int_t, Int_t, StPmdClusterCollection *)
refined clustering
virtual ~StPmdClustering()
destructor
Int_t crclust(Double_t, Double_t, Int_t, Int_t)
crude clustering
Double_t Dist(Double_t, Double_t, Double_t, Double_t)