StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmc2x2ClusterMaker.h
1 #ifndef __StEEmc2x2ClusterMaker_h__
2 #define __StEEmc2x2ClusterMaker_h__
3 
4 /*
5  ***************************************************************************
6  *
7  * \class StEEmc2x2ClusterMaker
8  * \author Jason C. Webb
9  * \brief an example clustering algorithm
10  *
11  * StEEmc2x2ClusterMaker 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  StEEmc2x2ClusterParams(){ /* nada */ };
84  ~StEEmc2x2ClusterParams(){ /* nada */ };
85 };
86 
87 
89 {
90 public:
91  StEEmc2x2ClusterMaker(const Char_t *name, const StEEmcA2EMaker *a2e, StMuDstMaker * /*mumk*/);
92  virtual ~StEEmc2x2ClusterMaker(){ /* 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: StEEmc2x2ClusterMaker.h,v 1.4 2014/08/06 11:42:59 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs;}
131 
132 
133 protected:
134 
135  //StMuDstMaker *mMuDst;
136  //TFile *mFile;
137 
138  Float_t seed_threshold;
139  Float_t seed_slope;
140 
141  Float_t mSmdSeedEnergy;
142  Float_t mSmdMinEnergy;
144  Int_t mMaxExtent;
145  Float_t mTruncateRatio;
146  Int_t mMinStrips;
148  Int_t mEtaCut;
149  Int_t mPhiCut;
151  // builder for tower clusters
152  virtual Int_t buildTowerClusters();
153  // builder for preshower clusters (both layers)
154  virtual Int_t buildPreshowerClusters();
155  // builder for postshower clusters
156  virtual Int_t buildPostshowerClusters();
157  // builder for smd clusters
158  virtual Int_t buildSmdClusters();
159 
160  // builder generic builder for tower, pre and post clusters
161  Int_t buildLayer( Int_t layer );
162 
163  Float_t mSeedEnergy[6];
164  Float_t mMinEnergy[6];
166  Bool_t mBreakSize;
167  Bool_t mBreakTruncation;
168  Bool_t mBreakInflection;
169  Bool_t mUseFloor;
170  Float_t mFloorParams[2];
171 
172  ClassDef(StEEmc2x2ClusterMaker,1);
173 };
174 
175 
176 #endif
void setSmdMinimumStrips(Int_t m)
Set the minimum number of SMD strips to accept a cluster.
void setDoBreakSize(Bool_t b)
Sets maximimum size truncation.
void setEtaCut(Int_t nbins)
Sets the maximum distance (in eta bins) from the seed tower.
EEmc ADC –&gt; energy maker.
void setMinimumEnergy(Float_t e, Int_t layer=0)
Sets the minimum energy required to add a tower.
void setSmdMaximumSize(Int_t m)
Sets maximum number of strips to add on each side of the cluster.
void setFloor(Float_t relative_yield, Float_t width)
void setPhiCut(Int_t nbins)
Sets the maximum distance (in phi bins) from the seed tower.
virtual Int_t buildSmdClusters()
builder for smd clusters
void setSmdMinimumEnergy(Float_t e)
Sets minimum energy to add an SMD strip to a cluster.
void setSmdSeedEnergy(Float_t e, Float_t s=0.)
Sets SMD seed threshold.
void setSmdTruncationRatio(Float_t t)
void setDoBreakTruncation(Bool_t b)
Sets energy ratio break.
virtual Int_t buildPostshowerClusters()
builder for postshower clusters
virtual Int_t buildTowerClusters()
builder for tower clusters
virtual Int_t buildPreshowerClusters()
builder for preshower clusters (both layers)
void setDoBreakInflection(Bool_t b)
Sets inflection-point break.
void setSeedEnergy(Float_t e, Int_t layer=0)
Sets the minimum seed energy for each tower layer.