StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFttCluster.cxx
1 /***************************************************************************
2  *
3  * $Id: StFttCluster.cxx,v 1.0 2021/11/18 14:53:48 jdb Exp $
4  *
5  * Author: jdb, Nov 2021
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************/
11 #include "StEvent/StFttCluster.h"
12 
13 
14 StFttCluster::StFttCluster() :
15 mId(-1),
16 mOrientation(kFttUnknownOrientation),
17 mNStrips(0),
18 mSumAdc(0.0),
19 mX(0.0),
20 mSigma(0.0),
21 mRawHits(0),
22 mNeighbors(0)
23 {
24 
25 }
26 
27 
28 StFttCluster::~StFttCluster(){}
29 
30 void StFttCluster::addPoint(StFttPoint* p) {
31  mPoints.push_back(p);
32 }
33 
34 void StFttCluster::addRawHit(StFttRawHit* p) {
35  mRawHits.push_back(p);
36 }
37 
38 void StFttCluster::addNeighbor(StFttCluster* neighbor) {
39  int n=nNeighbors();
40  for(int i=0; i<n; i++) if(mNeighbors[i]==neighbor) return; //already there, do nothing
41  mNeighbors.push_back(neighbor);
42 }
43 
44 std::ostream&
45 operator<<( std::ostream &os, const StFttCluster& rh )
46 {
47 
48  os << endl;
49  os << "StFttCluster( " << endl;
50  os << "\tid = " << rh.id() << endl;
51  os << "\tplane = " << (int)rh.plane() << endl;
52  os << "\tquadrant = " << (int)rh.quadrant() << endl;
53  os << "\torientation = " << (int)rh.orientation() << endl;
54  os << "\tnStrips = " << rh.nStrips() << endl;
55  os << "\tnPoints = " << rh.nPoints() << endl;
56  os << "\tnRawHits = " << rh.nRawHits() << endl;
57  os << "\tnNeighbors = " << rh.nNeighbors() << endl;
58  os << "\tsumAdc = " << rh.sumAdc() << endl;
59  os << "\tx = " << rh.x() << endl;
60  os << "\tsigma = " << rh.sigma() << endl;
61  os << ")" << endl;
62  return os;
63 }