StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRpsTrackPoint.cxx
1 /***************************************************************************
2  *
3  * $Id: StRpsTrackPoint.cxx,v 2.1 2015/10/02 19:48:14 ullrich Exp $
4  *
5  * Author: Rafal Sikora, 1 Oct 2015
6  *
7  ***************************************************************************
8  *
9  * Description: StRpsTrackPoint class representing reconstructed (x,y,z)
10  * position of the hit in single Roman Pot detector
11  *
12  ***************************************************************************
13  *
14  * $Log: StRpsTrackPoint.cxx,v $
15  * Revision 2.1 2015/10/02 19:48:14 ullrich
16  * Initial Revision.
17  *
18  **************************************************************************/
19 #include "StRpsTrackPoint.h"
20 
21 ClassImp(StRpsTrackPoint)
22 
24 {
25  mRpId = -1;
26  for (unsigned int i=0; i<mNumberOfPlanesInRp; ++i) mClusterId[i] = -1;
27  for (unsigned int i=0; i<mNumberOfPmtsInRp; ++i) mTime[i] = -1;
28  mQuality = rpsNotSet;
29 }
30 
31 StRpsTrackPoint::StRpsTrackPoint(const StRpsTrackPoint& trackPoint)
32 {
33  *this = trackPoint;
34 }
35 
36 StRpsTrackPoint::~StRpsTrackPoint() { /* no op */ }
37 
38 StRpsTrackPoint& StRpsTrackPoint::operator=(const StRpsTrackPoint& trackPoint)
39 {
40  if (this != &trackPoint) {
41  mPosition = trackPoint.positionVec();
42  mRpId = trackPoint.rpId();
43  for (unsigned int i=0; i<mNumberOfPlanesInRp; ++i ) mClusterId[i] = trackPoint.clusterId(i);
44  for (unsigned int i=0; i<mNumberOfPmtsInRp; ++i ) mTime[i] = trackPoint.time(i);
45  mQuality = trackPoint.quality();
46  }
47  return *this;
48 }
49 
50 unsigned int StRpsTrackPoint::planesUsed() const
51 {
52  unsigned int nPlanesUsed = 0;
53  for(unsigned int i=0; i<mNumberOfPlanesInRp; ++i)
54  if (mClusterId[i]>-1) ++nPlanesUsed;
55  return nPlanesUsed;
56 }