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 mPoints(0),
24 mIdTruth(0),
25 mQaTruth(0)
26 {
27 
28 }
29 
30 
31 StFttCluster::~StFttCluster(){}
32 
33 void StFttCluster::addPoint(StFttPoint* p) {
34  mPoints.push_back(p);
35 }
36 
37 void StFttCluster::addRawHit(StFttRawHit* p) {
38  mRawHits.push_back(p);
39 }
40 
41 void StFttCluster::addNeighbor(StFttCluster* neighbor) {
42  int n=nNeighbors();
43  for(int i=0; i<n; i++) if(mNeighbors[i]==neighbor) return; //already there, do nothing
44  mNeighbors.push_back(neighbor);
45 }
46 
47 std::ostream&
48 operator<<( std::ostream &os, const StFttCluster& rh )
49 {
50 
51  os << endl;
52  os << "StFttCluster( " << endl;
53  os << "\tid = " << rh.id() << endl;
54  os << "\tplane = " << (int)rh.plane() << endl;
55  os << "\tquadrant = " << (int)rh.quadrant() << endl;
56  os << "\torientation = " << (int)rh.orientation() << endl;
57  os << "\tnStrips = " << rh.nStrips() << endl;
58  os << "\tnPoints = " << rh.nPoints() << endl;
59  os << "\tnRawHits = " << rh.nRawHits() << endl;
60  os << "\tnNeighbors = " << rh.nNeighbors() << endl;
61  os << "\tsumAdc = " << rh.sumAdc() << endl;
62  os << "\tx = " << rh.x() << endl;
63  os << "\tsigma = " << rh.sigma() << endl;
64  os << "\tidTruth = " << rh.idTruth() << endl;
65  os << "\tqaTruth = " << rh.qaTruth() << endl;
66  os << ")" << endl;
67  return os;
68 }