StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtSeededClusterAlgo.h
1 // $Id: StFgtSeededClusterAlgo.h,v 1.10 2013/03/13 15:57:35 akio Exp $
3 // $Log: StFgtSeededClusterAlgo.h,v $
4 // Revision 1.10 2013/03/13 15:57:35 akio
5 // Fix a bug with ZS data and phi-even strip clustering logic
6 // Also remove some kStFgtNumTimebins and use dynamic local mMaxTimeBin from StFgtCollection
7 //
8 // Revision 1.9 2013/02/20 01:32:27 avossen
9 // added n strips before and after cluster
10 //
11 // Revision 1.8 2013/02/19 18:24:04 avossen
12 // *** empty log message ***
13 //
14 // Revision 1.7 2012/12/10 23:18:01 avossen
15 // merged cluster finder
16 //
17 // Revision 1.6 2012/11/27 18:00:07 akio
18 // - Filling NStrip/SeedType/MaxTimebin/EvenOddChargeAsy in StFgtHit
19 // - Accepting kFgtSeedTypes4 & 5 for clustring
20 // - Setting kFgtClusterTooBig instead of kFgtClusterNo into strips when cluster is too big
21 // (Seedtype of the seed strip will not be overwritten)
22 // - Adding setThreshold2AddStrip() [proposed default 2 ~ 3 from cosmic data... no idea for run12 data]
23 // This will be used in isSameCluster() and this number times ChargeUncert() will be the threshold on charge
24 // (timebin sum) for a strip to be included in cluster if neighbore. It was hard coded to be 1.0 before.
25 // Too low threshold sometimes kill cluster because "cluster too big"
26 // - Slight code change to make trying different weight for getting R/PHI easy...
27 // - Slight code change for phi/even strip logic... hopefully improved
28 //
29 // Revision 1.5 2012/03/16 19:41:15 avossen
30 // added option to allow to jump strips
31 //
32 // Revision 1.4 2012/03/08 17:43:40 avossen
33 // added default cluster algo, made StFgtIClusterAlgo destructor =0
34 //
35 // Revision 1.3 2012/03/07 03:57:23 avossen
36 // various updates
37 //
38 // Revision 1.2 2012/03/01 16:38:13 avossen
39 // implemented tweaks to clustering
40 //
41 // Revision 1.1 2012/02/28 19:34:29 avossen
42 // added new cluster maker
43 //
44 // Revision 1.6 2011/11/01 18:46:30 sgliske
45 // Updated to correspond with StEvent containers, take 2.
46 //
47 // Revision 1.5 2011/10/10 20:35:08 avossen
48 // fixed strip-cluster association in MaxCluster algo, made other files cvs compliant
49 //
50 //
51 // \author Anselm Vossen (avossen@indiana.edu)
52 // \class StFgtSeededClusterAlgo
53 //
54 // Seeded Clustering algorithm taking the hits from the StFgtEvent and adding Clusters
55 //
56 //
57 //
58 
59 
60 #ifndef STAR_StFgtSeededClusterAlgo_HH
61 #define STAR_StFgtSeededClusterAlgo_HH
62 #include "TH1D.h"
63 #include "TH2D.h"
64 
65 #include "StFgtIClusterAlgo.h"
66 //#include "StRoot/StEvent/StFgtHit.h"
67 
68 //#include "StRoot/StEvent/StFgtStripCollection.h"
69 
70 
71 class StFgtHit;
72 class StFgtStrip;
74 class StFgtDb;
75 
86 {
87  public:
90  virtual Int_t doClustering(const StFgtCollection& fgtCollection, StFgtStripCollection& strips, StFgtHitCollection& clusters );
91  virtual Int_t Init();
92  virtual Int_t Finish();
93  virtual ~StFgtSeededClusterAlgo();
94  virtual void setJumpSingleStrip(Bool_t jump);
95  void setThreshold2AddStrip(Float_t v); // this value * charge uncertaintly is threshold on strip charge to add to the cluster
96  void setDb(StFgtDb* pDb);
97 
98  protected:
100  // Bool_t checkPulse(StFgtHit* pClus);
101  Int_t addStrips2Cluster(StFgtHit* clus, StFgtStrip** itSeed, StFgtStrip** itVecBegin, StFgtStrip** itVecEnd,Bool_t direction, Int_t sidedSize);
102  Bool_t isSameCluster(StFgtStrip** itSeed,StFgtStrip** nextStrip);
103  void FillClusterInfo(StFgtHit* cluster,StFgtStripCollection& allStrips);
104  void doStripFit(void* stripsT);
105  Float_t doClusterShapeFit(void* stripsT);
106  void setNumAdditionalStrips(Int_t numStrips);
107  // pointer to the DB
108  Int_t numAdditionalStrips;
109  StFgtDb* mDb;
110  int mMaxTimeBin;
111 
112  private:
113  Bool_t up;
114  Bool_t down;
115  Bool_t stepTwo;
116  Float_t mThreshold2AddStrip;
118 
119 
120 
121  TH1D* hGaussFitStatus;
122  TH1D* hGaussFitChi2;
123  TH1D* hTbFitStatus;
124  TH1D* hTbFitChi2;
125 
126  TH2D* hTbMaxCorr;
127  TH1D* hTbMaxRatio;
128 
129  TH2D* hTbSideCorr;
130  TH1D* hTbSideRatio;
131 
132  ClassDef(StFgtSeededClusterAlgo,1);
133 
134 };
135 
136 inline void StFgtSeededClusterAlgo::setJumpSingleStrip(Bool_t jump)
137 {
138  stepTwo=jump;
139 }
140 inline void StFgtSeededClusterAlgo::setThreshold2AddStrip(Float_t v){ mThreshold2AddStrip=v;}
141 
142 inline void StFgtSeededClusterAlgo::setNumAdditionalStrips(Int_t numStrips){numAdditionalStrips=numStrips;}
143 inline void StFgtSeededClusterAlgo::setDb(StFgtDb* pDb){mDb=pDb;}
144 
145 
146 #endif
147 
Bool_t isSameCluster(StFgtStrip **itSeed, StFgtStrip **nextStrip)
function to check if the strip belongs to the cluster. If it returns false we stop adding strips to t...
virtual Int_t doClustering(const StFgtCollection &fgtCollection, StFgtStripCollection &strips, StFgtHitCollection &clusters)
the main function, using a collection of strips tht fired to build clusters of neighbouring strips ...
Int_t addStrips2Cluster(StFgtHit *clus, StFgtStrip **itSeed, StFgtStrip **itVecBegin, StFgtStrip **itVecEnd, Bool_t direction, Int_t sidedSize)
migrated to A2C maker
void FillClusterInfo(StFgtHit *cluster, StFgtStripCollection &allStrips)
fill in cluster info like charge from the strips