StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMyClusterMaker.h
1 #ifndef __StMyClusterMaker_h__
2 #define __StMyClusterMaker_h__
3 
4 /*
5  ***************************************************************************
6  *
7  * \class StMyClusterMaker
8  * \author Jason C. Webb
9  * \brief an example clustering algorithm
10  *
11  * StMyClusterMaker is an implementation of the StEEmcGenericClusterMaker.
12  * It provides a clustering algorithm for all layers of the endcap. The
13  * algorithms work as follows:
14  *
15  * \section towers Tower/Preshower/Postshower cluster finder
16  *
17  * The tower cluster finder starts by identifying all towers (or pre/post
18  * elements) which exceed a user-specified seed threshold. The list of
19  * seed
20  * towers is then sorted by energy. We loop over all seed towers starting
21  * with the most energetic and proceeding to the least energetic.
22  *
23  * For each seed tower, we create a new cluster. We add all neighboring
24  * towers which exceed a
25  * specified minimum energy. These towers are flagged and will not be
26  * added to any other clusters. We then treat all towers within the
27  * cluster as a seed tower, and add any neighboring towers above threshold
28  * to the cluster. This procedure repeats until no new towers can be added
29  * to the cluster, or a user-specified size limit (dEta,dPhi) is reached.
30  *
31  * The cluster is then added to the list of clusters, and the next seed
32  * tower (not previously flagged) is processed.
33  *
34  * \section smd SMD cluster finder
35  *
36  * The SMD cluster finder starts by identifying all SMD strips in a given
37  * plane which are above a user-specified seed threshold. The list of
38  * seed strips is then sorted descending in energy. We loop over all seeds
39  * starting with the most energetic and proceeding to the least energetic.
40  *
41  * For each seed strip, we create a new cluster and add the strip to it.
42  * Neighboring strips are added until one of the following conditions
43  * are met:
44  *
45  * 1. A strip falls below a user-defined minimum
46  * 2. The next SMD strip exceeds the energy of the current strip
47  * 3. The cluster fails to grow by a user-specified amount
48  * 4. We have reached a user-specified size limit
49  *
50  * Each strip added to a cluster is flagged and will not be used by any other
51  * clusters.
52  *
53  * The SMD cluster is added to the list of clusters if it has more than a user-
54  * specified number of strips, and the next seed strip
55  * (not previously flagged) is processed.
56  *
57  *
58  ***************************************************************************
59  */
60 
61 #include "StEEmcGenericClusterMaker.h"
62 #include "TTree.h"
63 
64 #include "StMuDSTMaker/COMMON/StMuDstMaker.h"
65 #include "StMuDSTMaker/COMMON/StMuDst.h"
66 #include "StMuDSTMaker/COMMON/StMuEvent.h"
67 #include "StMuDSTMaker/COMMON/StMuTrack.h"
68 #include "TString.h"
69 #include "TFile.h"
70 #include "TObjArray.h"
71 
72 #include "TClonesArray.h"
73 
74 #include "TH1F.h"
75 #include "TH2F.h"
76 
77 #include <map>
78 
79 
81 {
82  public:
83  StMyClusterParams(){ /* nada */ };
84  ~StMyClusterParams(){ /* nada */ };
85 };
86 
87 
89 {
90 public:
91  StMyClusterMaker(const Char_t *name, const StEEmcA2EMaker *a2e, StMuDstMaker * /*mumk*/);
92  virtual ~StMyClusterMaker(){ /* nada */ }
93 
94  virtual Int_t Make();
95 
97  void setSmdSeedEnergy( Float_t e, Float_t s=0. ) { seed_threshold=e; seed_slope=s; }
98 
100  void setSmdMinimumEnergy( Float_t e ) { mSmdMinEnergy = e; }
101 
103  void setSmdMaximumSize( Int_t m ) { mMaxExtent = m; }
106  void setSmdTruncationRatio( Float_t t ) { mTruncateRatio = t; }
108  void setSmdMinimumStrips( Int_t m ) { mMinStrips = m; }
110  void setDoBreakInflection( Bool_t b ){ mBreakInflection=b; }
112  void setDoBreakTruncation( Bool_t b ){ mBreakTruncation=b; }
114  void setDoBreakSize( Bool_t b ){ mBreakSize=b; }
115 
117  void setEtaCut( Int_t nbins ){ mEtaCut = nbins; }
119  void setPhiCut( Int_t nbins ){ mPhiCut = nbins; }
121  void setSeedEnergy( Float_t e, Int_t layer=0 ){ mSeedEnergy[layer]=e; }
123  void setMinimumEnergy( Float_t e, Int_t layer=0 ){ mMinEnergy[layer]=e; }
124 
127  void setFloor( Float_t relative_yield, Float_t width ){ mFloorParams[0]=relative_yield; mFloorParams[1]=width; }
128 
129  virtual const char* GetCVS() const
130  {static const char cvs[]="Tag $Name: $ $Id: StMyClusterMaker.h,v 1.6 2014/08/06 11:42:59 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs;}
131 
132 protected:
133 
134  //StMuDstMaker *mMuDst;
135  //TFile *mFile;
136 
137  Float_t seed_threshold;
138  Float_t seed_slope;
139 
140  Float_t mSmdSeedEnergy;
141  Float_t mSmdMinEnergy;
143  Int_t mMaxExtent;
144  Float_t mTruncateRatio;
145  Int_t mMinStrips;
147  Int_t mEtaCut;
148  Int_t mPhiCut;
150  // builder for tower clusters
151  virtual Int_t buildTowerClusters();
152  // builder for preshower clusters (both layers)
153  virtual Int_t buildPreshowerClusters();
154  // builder for postshower clusters
155  virtual Int_t buildPostshowerClusters();
156  // builder for smd clusters
157  virtual Int_t buildSmdClusters();
158 
159  // builder generic builder for tower, pre and post clusters
160  Int_t buildLayer( Int_t layer );
161 
162  Float_t mSeedEnergy[6];
163  Float_t mMinEnergy[6];
165  Bool_t mBreakSize;
166  Bool_t mBreakTruncation;
167  Bool_t mBreakInflection;
168  Bool_t mUseFloor;
169  Float_t mFloorParams[2];
170 
171  ClassDef(StMyClusterMaker,1);
172 
173 };
174 
175 
176 #endif
EEmc ADC –&gt; energy maker.
void setSmdSeedEnergy(Float_t e, Float_t s=0.)
Sets SMD seed threshold.
virtual Int_t buildPreshowerClusters()
builder for preshower clusters (both layers)
virtual Int_t buildSmdClusters()
builder for smd clusters
void setDoBreakTruncation(Bool_t b)
Sets energy ratio break.
virtual Int_t buildTowerClusters()
builder for tower clusters
void setFloor(Float_t relative_yield, Float_t width)
void setMinimumEnergy(Float_t e, Int_t layer=0)
Sets the minimum energy required to add a tower.
void setSeedEnergy(Float_t e, Int_t layer=0)
Sets the minimum seed energy for each tower layer.
void setSmdMinimumEnergy(Float_t e)
Sets minimum energy to add an SMD strip to a cluster.
void setSmdTruncationRatio(Float_t t)
void setEtaCut(Int_t nbins)
Sets the maximum distance (in eta bins) from the seed tower.
void setSmdMaximumSize(Int_t m)
Sets maximum number of strips to add on each side of the cluster.
void setSmdMinimumStrips(Int_t m)
Set the minimum number of SMD strips to accept a cluster.
Float_t mSeedEnergy[6]
virtual Int_t buildPostshowerClusters()
builder for postshower clusters
void setPhiCut(Int_t nbins)
Sets the maximum distance (in phi bins) from the seed tower.
virtual Int_t Make()
void setDoBreakInflection(Bool_t b)
Sets inflection-point break.
void setDoBreakSize(Bool_t b)
Sets maximimum size truncation.