StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcCluster.cxx
1 /***************************************************************************
2  *
3  * $Id: StEmcCluster.cxx,v 2.9 2013/01/15 23:21:05 fisyak Exp $
4  *
5  * Author: Akio Ogawa, Jan 2000
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StEmcCluster.cxx,v $
13  * Revision 2.9 2013/01/15 23:21:05 fisyak
14  * improve printouts
15  *
16  * Revision 2.8 2012/10/23 20:18:33 fisyak
17  * Add/modify print outs
18  *
19  * Revision 2.7 2012/09/16 21:33:33 fisyak
20  * Make one line print out
21  *
22  * Revision 2.6 2004/07/15 16:36:23 ullrich
23  * Removed all clone() declerations and definitions. Use StObject::clone() only.
24  *
25  * Revision 2.5 2001/04/05 04:00:48 ullrich
26  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
27  *
28  * Revision 2.4 2001/03/24 03:34:44 perev
29  * clone() -> clone() const
30  *
31  * Revision 2.3 2000/07/31 22:12:22 akio
32  * eliminate print() for L3(?)
33  *
34  * Revision 2.2 2000/03/23 22:24:06 akio
35  * Initial version of Emc Point, and Inclusion of track pointers
36  *
37  * Revision 2.1 2000/02/23 17:34:01 ullrich
38  * Initial Revision
39  *
40  **************************************************************************/
41 #include "StEmcCluster.h"
42 
43 ClassImp(StEmcCluster)
44 
45 static const char rcsid[] = "$Id: StEmcCluster.cxx,v 2.9 2013/01/15 23:21:05 fisyak Exp $";
46 
47 StEmcCluster::StEmcCluster() {/* noop*/};
48 
49 StEmcCluster::~StEmcCluster() {/* noop */};
50 
51 float
52 StEmcCluster::eta() const {return mEta;}
53 
54 float
55 StEmcCluster::phi() const {return mPhi;}
56 
57 float
58 StEmcCluster::sigmaEta() const {return mSigmaEta;}
59 
60 float
61 StEmcCluster::sigmaPhi() const {return mSigmaPhi;}
62 
63 float
64 StEmcCluster::energy() const {return mEnergy;}
65 
66 int
67 StEmcCluster::nHits() const {return mHits.size();}
68 
69 int
70 StEmcCluster::nNeighbors() const {return mNeighbors.size();}
71 
72 int
73 StEmcCluster::nTracks() const {return mTracks.size();}
74 
75 StPtrVecEmcRawHit&
76 StEmcCluster::hit() {return mHits;}
77 
78 const StPtrVecEmcRawHit&
79 StEmcCluster::hit() const {return mHits;}
80 
81 StPtrVecEmcCluster&
82 StEmcCluster::neighbor() {return mNeighbors;}
83 
84 const StPtrVecEmcCluster&
85 StEmcCluster::neighbor() const {return mNeighbors;}
86 
87 StPtrVecTrack&
88 StEmcCluster::track() {return mTracks;}
89 
90 const StPtrVecTrack&
91 StEmcCluster::track() const {return mTracks;}
92 
93 void
94 StEmcCluster::setEta(float ver) {mEta=ver;}
95 
96 void
97 StEmcCluster::setPhi(float ver) {mPhi=ver;}
98 
99 void
100 StEmcCluster::setSigmaEta(float ver) {mSigmaEta=ver;}
101 
102 void
103 StEmcCluster::setSigmaPhi(float ver) {mSigmaPhi=ver;}
104 
105 void
106 StEmcCluster::setEnergy(float ver) {mEnergy=ver;}
107 
108 void
109 StEmcCluster::addHit(StEmcRawHit* hit) {mHits.push_back(hit);}
110 
111 void
112 StEmcCluster::addNeighbor(StEmcCluster* cluster) {mNeighbors.push_back(cluster);}
113 
114 void
115 StEmcCluster::addTrack(StTrack* track) {mTracks.push_back(track);}
116 
117 ostream&
118 operator<<(ostream &os, const StEmcCluster& cl)
119 {
120  return os << Form("EmcCluster Energy %5.2f Eta %7.4f +/- %6.4f", cl.energy(), cl.eta(),cl.sigmaEta())
121  << Form(" Phi %7.4f +/- %6.4f",cl.phi(),cl.sigmaPhi())
122  << " # of hits " << cl.nHits() << ",# of neighbor " << cl.nNeighbors();
123  // << *((StHit *)&cl);
124 }
125 void StEmcCluster::Print(Option_t *option) const {cout << *this << endl;}
126