StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRpsCluster.cxx
1 /***************************************************************************
2  *
3  * $Id: StRpsCluster.cxx,v 2.2 2015/10/02 19:50:09 ullrich Exp $
4  *
5  * Author: Thomas Ullrich, Nov 2009
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StRpsCluster.cxx,v $
13  * Revision 2.2 2015/10/02 19:50:09 ullrich
14  * Added mPositionRMS and accessors.
15  *
16  * Revision 2.1 2009/11/23 22:18:25 ullrich
17  * Initial Revision
18  *
19  **************************************************************************/
20 #include "StRpsCluster.h"
21 
22 static const char rcsid[] = "$Id: StRpsCluster.cxx,v 2.2 2015/10/02 19:50:09 ullrich Exp $";
23 
24 ClassImp(StRpsCluster)
25 
27 {
28  mPosition = mEnergy = mXY = 0;
29  mLength = 0;
30  mQuality = 0;
31  mPlaneId = mRomanPotId = 0;
32 }
33 
34 StRpsCluster::StRpsCluster(double pos, double posRMS, short len,
35  double e, double xy, unsigned char qual)
36 {
37  mPosition = pos;
38  mPositionRMS = posRMS;
39  mLength = len;
40  mEnergy = e;
41  mXY = xy;
42  mQuality = qual;
43  mPlaneId = mRomanPotId = 0;
44  // mPlaneId and mRomanPotId are later set by StRpsPlane::addCluster()
45 }
46 
47 StRpsCluster::~StRpsCluster() { /* noop */ };
48 
49 double
50 StRpsCluster::position() const { return mPosition; }
51 
52 double
53 StRpsCluster::positionRMS() const { return mPositionRMS; }
54 
55 short
56 StRpsCluster::length() const { return mLength; }
57 
58 double
59 StRpsCluster::energy() const { return mEnergy; }
60 
61 double
62 StRpsCluster::xy() const { return mXY; }
63 
64 unsigned char
65 StRpsCluster::quality() const { return mQuality; }
66 
67 unsigned int
68 StRpsCluster::romanPotId() const { return mRomanPotId; }
69 
70 unsigned int
71 StRpsCluster::planeId() const { return mPlaneId; }
72 
73 void
74 StRpsCluster::setPosition(double val) { mPosition = val; }
75 
76 void
77 StRpsCluster::setPositionRMS(double val) { mPositionRMS = val; }
78 
79 void
80 StRpsCluster::setLength(short val) { mLength = val; }
81 
82 void
83 StRpsCluster::setEnergy(double val) { mEnergy = val; }
84 
85 void
86 StRpsCluster::setXY(double val) { mXY = val; }
87 
88 void
89 StRpsCluster::setQuality(unsigned char val) { mQuality = val; }
90 
91 void
92 StRpsCluster::setPlaneId(unsigned char val) { mPlaneId = val; }
93 
94 void
95 StRpsCluster::setRomanPotId(unsigned char val) { mRomanPotId = val; }
96 
97 //
98 // Non class methods
99 //
100 ostream& operator<<(ostream& os, const StRpsCluster& cluster)
101 {
102  os << "position = " << cluster.position() << endl;
103  os << "position rms = " << cluster.positionRMS() << endl;
104  os << "length = " << cluster.length() << endl;
105  os << "energy = " << cluster.energy() << endl;
106  os << "xy = " << cluster.xy() << endl;
107  os << "quality = " << static_cast<unsigned int>(cluster.quality()) << endl;
108  os << "roman pot id = " << cluster.romanPotId() << endl;
109  os << "plane id = " << cluster.planeId() << endl;
110  return os;
111 }