StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcIUSmdCluster.h
1 #ifndef __StEEmcIUSmdCluster_h__
2 #define __StEEmcIUSmdCluster_h__
3 
4 #include <cassert>
5 #include <TObject.h>
6 #include "StEEmcPool/StEEmcA2EMaker/StEEmcStrip.h"
7 #include "StEEmcPool/StEEmcA2EMaker/StEEmcTower.h"
8 
9 class StEmcCluster;
10 
11 class StEEmcIUSmdCluster : public TObject {
12 
13  public:
14 
16  ~StEEmcIUSmdCluster(){ /* nada */ };
17 
20 
23  void add( StEEmcStrip strip, Float_t weight=1.0 );
24 
26  Int_t key(){ return mKey; }
28  Int_t key()const { return mKey; }
29 
33  void key(Int_t k){ mKey=k; }
34 
36  Float_t energy();
38  Float_t energy()const;
40  Float_t mean();
42  Float_t mean()const;
44  Float_t sigma();
46  Float_t sigma()const;
47 
49  void mean(Float_t x){ mMean=x; }
51  void sigma(Float_t s){ mSigma=s; }
53  void energy( Float_t e){ mEnergy=e; }
54 
58  Float_t energy( Int_t nmax, Option_t *opts="mean" );
60  Float_t sigma( Int_t nmax, Option_t *opts="mean" );
61 
62  /*
63  Float_t energy3(){ return energy(3,"seed"); }
64  Float_t energy5(){ return energy(5,"seed"); }
65  Float_t sigma3(){ return sigma(3,"seed"); }
66  Float_t sigma5(){ return sigma(5,"seed"); }
67  */
68 
70  Int_t size();
71 
73  StEEmcTowerVec_t towers();
75  Int_t numberOfMatchedTowers();
77  StEEmcTower tower(Int_t t);
78 
81  Bool_t operator>( StEEmcIUSmdCluster &other );
82 
84  Int_t numberOfStrips(){ return (Int_t)mStrips.size(); }
85 
87  StEEmcStrip strip(Int_t s){ return mStrips[s]; }
88 
91  StEEmcStrip seed(){ assert(mStrips.size()>0); return mStrips[0]; }
92 
94  Int_t plane(){ return mPlane; }
96  Int_t sector(){ return mSector; }
98  void sector( Int_t s ) { mSector=s; }
100  void plane( Int_t p ){ mPlane = p; }
101 
104  StEmcCluster *stemc();
106  void stemc( StEmcCluster *c ){ mEmcCluster = c; }
108  void print();
109 
110  private:
111  protected:
112 
114  Int_t mKey;
115 
117  StEEmcStripVec_t mStrips;
118  std::vector<Float_t> mWeights;
120 
122  Int_t mSize;
123 
125  Float_t mEnergy;
126 
128  Float_t mSumXW;
130  Float_t mSumX2W;
131 
133  Float_t mMean;
135  Float_t mSigma;
137  Int_t mPlane;
139  Int_t mSector;
140 
142  StEEmcTowerVec_t mMatchedTowers;
143 
146 
149 
150 };
151 
152 inline Float_t StEEmcIUSmdCluster::energy(){ return mEnergy; }
153 inline Float_t StEEmcIUSmdCluster::mean(){ return mMean; }
154 inline Float_t StEEmcIUSmdCluster::sigma(){ return mSigma; }
155 
156 inline Float_t StEEmcIUSmdCluster::energy()const{ return mEnergy; }
157 inline Float_t StEEmcIUSmdCluster::mean()const{ return mMean; }
158 inline Float_t StEEmcIUSmdCluster::sigma()const{ return mSigma; }
159 
160 inline Int_t StEEmcIUSmdCluster::size(){ return (Int_t)mSize; }
161 
162 inline StEEmcTowerVec_t StEEmcIUSmdCluster::towers(){ return mMatchedTowers; }
163 inline Int_t StEEmcIUSmdCluster::numberOfMatchedTowers(){ return (Int_t)mMatchedTowers.size(); }
165 inline Bool_t StEEmcIUSmdCluster::operator>(StEEmcIUSmdCluster &other){ return (this->energy() > other.energy()); }
166 
167 
169 inline Bool_t inner( const StEEmcIUSmdCluster &me, const StEEmcIUSmdCluster &you) { return me.mean()<you.mean(); }
171 inline Bool_t outer( const StEEmcIUSmdCluster &me, const StEEmcIUSmdCluster &you) { return me.mean()>you.mean(); }
173 inline Bool_t Energy( const StEEmcIUSmdCluster &me, const StEEmcIUSmdCluster &you) { return me.energy()>you.energy(); }
175 inline Bool_t Key(const StEEmcIUSmdCluster &me, const StEEmcIUSmdCluster &you) { return me.key()<you.key(); }
176 
177 
178 
179 typedef std::vector<StEEmcIUSmdCluster> StEEmcIUSmdClusterVec_t;
180 
181 #endif
StEEmcTowerVec_t towers()
Return list of towers matching this cluster.
void mean(Float_t x)
Set the mean of the cluster.
Float_t mEnergy
Energy of this SMD cluster.
void sigma(Float_t s)
Set the width of the cluster.
Int_t key()
Return a unique key assigned by the cluster maker.
Int_t mSize
Kludge so that root will store number of smd strips.
std::vector< Float_t > mWeights
Vector of strip weights.
Int_t numberOfStrips()
Returns the number of SMD strips in the cluster.
ClassDef(StEEmcIUSmdCluster, 1)
Makes class available to root.
void plane(Int_t p)
Set the plane.
Float_t mSumXW
Running sums to calculate mean, sigma of cluster.
Bool_t operator>(StEEmcIUSmdCluster &other)
Float_t mMean
Mean and sigma computed after each strip is added.
StEEmcStrip strip(Int_t s)
Returns the specified smd strip w/in the cluster.
StEEmcTower tower(Int_t t)
Return a specific tower matching this SMD cluster.
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StEEmcTowerVec_t mMatchedTowers
Vector of hit towers above this SMD cluster.
Int_t size()
Return the size (number of strips) of the cluster.
Float_t mean()
Return the mean strip number of this cluster.
Float_t mSumX2W
Running sums to calculate mean, sigma of cluster.
Float_t sigma()
Return the sigma – TMath::Sqrt(variance) – of the cluster.
Int_t mKey
Unique key.
A base class for representing clusters of EEMC smd strips.
void stemc(StEmcCluster *c)
Set pointer to StEmcCluster.
StEmcCluster * mEmcCluster
POinter to EMC cluster.
void sector(Int_t s)
Set the sector.
Int_t key() const
Return a unique key assigned by the cluster maker.
Int_t numberOfMatchedTowers()
Return number of towers matching this cluster.
void energy(Float_t e)
Set the energy of the cluster.
StEEmcStripVec_t mStrips
Vector of strips belonging to this SMD cluster.
Int_t sector()
Return the sector of the cluster.
Base class for describing an endcap SMD strip.
Definition: StEEmcStrip.h:8
Int_t plane()
Return the plane of the cluster.
Float_t energy()
Return the energy of this cluster.
StEmcCluster * stemc()
void add(StEEmcStrip strip, Float_t weight=1.0)