StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcPreCluster.h
1 
10 #include "TObject.h"
11 #include "TList.h"
12 #include <math.h>
13 #include "StEmcUtil/geometry/StEmcGeom.h"
14 #include "StEmcUtil/others/StEmcMath.h"
15 #include "StEmcRawMaker/defines.h"
16 
17 #ifndef StEmcPreCluster_HH
18 #define StEmcPreCluster_HH
19 
20 class StEmcRawHit;
21 class StEmcCluster;
22 class StEmcPreCluster: public TObject
23 {
24 private:
25  StEmcGeom* mGeom;
26  TList mHits;
27 
28  Int_t mDetector;
29  Int_t mMatchingId;
30  Float_t mEta;
31  Float_t mPhi;
32  Float_t mSigmaEta;
33  Float_t mSigmaPhi;
34  Float_t mEnergy;
35 
36 protected:
37 public:
38  StEmcPreCluster(Int_t);
41  virtual ~StEmcPreCluster();
42 
43  Float_t eta() const;
44  Float_t phi() const;
45  Float_t sigmaEta() const;
46  Float_t sigmaPhi() const;
47  Float_t energy() const;
48  Int_t nHits() const;
49  Int_t detector() const;
50  Int_t matchingId() const;
51 
52  void addHit(StEmcRawHit*);
53  void removeHit(StEmcRawHit*);
54  void removeHit(Int_t);
55  StEmcRawHit* getHit(Int_t i)
56  {
57  return (StEmcRawHit*)mHits.At(i);
58  }
59 
61  void addCluster(StEmcCluster*);
64  StEmcPreCluster* splitInEta(Float_t);
65  StEmcPreCluster* splitInPhi(Float_t);
66 
67  void setMatchingId(Int_t a)
68  {
69  mMatchingId = a;
70  }
71 
72  void update();
74 
75  ClassDef(StEmcPreCluster,1)
76 };
77 inline Float_t StEmcPreCluster::eta() const
78 {
79  return mEta;
80 }
81 inline Float_t StEmcPreCluster::phi() const
82 {
83  return mPhi;
84 }
85 inline Float_t StEmcPreCluster::sigmaEta() const
86 {
87  return mSigmaEta;
88 }
89 inline Float_t StEmcPreCluster::sigmaPhi() const
90 {
91  return mSigmaPhi;
92 }
93 inline Float_t StEmcPreCluster::energy() const
94 {
95  return mEnergy;
96 }
97 inline Int_t StEmcPreCluster::nHits() const
98 {
99  return mHits.GetSize();
100 }
101 inline Int_t StEmcPreCluster::detector() const
102 {
103  return mDetector;
104 }
105 inline Int_t StEmcPreCluster::matchingId() const
106 {
107  return mMatchingId;
108 }
109 #endif
Float_t eta() const
returns the eta position of the cluster
StEmcPreCluster * splitInEta(Float_t)
split the cluster in the eta coordinate. Returns a pointer of the splitted cluster. The spllited cluster is not added to any collection
Int_t detector() const
returns the detector number
Int_t matchingId() const
returns the matching id with other detectors. 0 means no matching
Float_t energy() const
returns the energy of the cluster
void subtractCluster(StEmcPreCluster *)
subtract another cluster to this one.
void addHit(StEmcRawHit *)
add a hit to the cluster
void setMatchingId(Int_t a)
sets the matching id
Float_t sigmaEta() const
returns the width in eta
Int_t nHits() const
returns the number of hits in the cluster
StEmcPreCluster * splitInPhi(Float_t)
split the cluster in the phi coordinate. Returns a pointer of the splitted cluster. The spllited cluster is not added to any collection
void removeHit(StEmcRawHit *)
removes a hit from the cluster
StEmcCluster * makeStCluster()
creates an StEmcCluster from the information in this pre cluster
void update()
updates cluster information. Calculates eta,phi, ernergy, etc from the hits added to the cluster ...
Float_t sigmaPhi() const
returns the width in phi
void addCluster(StEmcPreCluster *)
add another cluster to this one. Does not delete the added cluster
StEmcRawHit * getHit(Int_t i)
gets a pointer to a hit in the cluster
Float_t phi() const
returns the phi position of the cluster