PandaRoot
PndGemCluster Class Reference

#include <PndGemCluster.h>

Inheritance diagram for PndGemCluster:

Public Member Functions

 PndGemCluster ()
 
 PndGemCluster (Int_t iDetectorId, Double_t iChannel, Int_t bChannel, Int_t eChannel, std::vector< Int_t > index)
 
 PndGemCluster (Int_t iDetectorId, Double_t iChannel, Int_t bChannel, Int_t eChannel, Double_t signal, Double_t time, std::vector< Int_t > index)
 
virtual ~PndGemCluster ()
 
void SetCharge (Double_t iCharge)
 
void SetCor (Double_t iCor)
 
void SetClusterBeg (Int_t bChan)
 
void SetClusterEnd (Int_t eChan)
 
void AddCharge (Double_t iCharge)
 
Int_t GetDetectorId () const
 
Double_t GetChannelNr () const
 
Int_t GetSystemId () const
 
Int_t GetStationNr () const
 
Int_t GetSensorNr () const
 
Int_t GetSide () const
 
Int_t GetClusterBeg () const
 
Int_t GetClusterEnd () const
 
Double_t GetCharge () const
 
Double_t GetCor () const
 
std::vector< Int_t > GetIndices () const
 
Int_t GetNIndices ()
 
Int_t GetIndex (int i=0) const
 
void AddIndex (int index)
 
void AddIndex (std::vector< Int_t > index)
 
virtual bool equal (FairTimeStamp *data)
 
virtual bool operator< (const PndGemCluster &myCluster) const
 
virtual bool operator> (const PndGemCluster &myCluster) const
 
virtual bool operator== (const PndGemCluster &myCluster) const
 

Friends

std::ostream & operator<< (std::ostream &out, PndGemCluster &cluster)
 

Detailed Description

PndGemCluster.h

Author
R.Karabowicz r.kar.nosp@m.abow.nosp@m.icz@g.nosp@m.si.d.nosp@m.e
Since
03.06.2013
Version
1.0

Data class for first reconstruction stage of the GEM Tracker Data level: cluster

Definition at line 29 of file PndGemCluster.h.

Constructor & Destructor Documentation

◆ PndGemCluster() [1/3]

PndGemCluster::PndGemCluster ( )

Default constructor

◆ PndGemCluster() [2/3]

PndGemCluster::PndGemCluster ( Int_t  iDetectorId,
Double_t  iChannel,
Int_t  bChannel,
Int_t  eChannel,
std::vector< Int_t >  index 
)

Constructor from station number, sector number, front/back side and channel number

Parameters
iStationstation number (0-255)
iSectorsector number (0-32767)
iSide0=front side; 1=back side
iChannelchannel number

◆ PndGemCluster() [3/3]

PndGemCluster::PndGemCluster ( Int_t  iDetectorId,
Double_t  iChannel,
Int_t  bChannel,
Int_t  eChannel,
Double_t  signal,
Double_t  time,
std::vector< Int_t >  index 
)

◆ ~PndGemCluster()

virtual PndGemCluster::~PndGemCluster ( )
virtual

Destructor

Member Function Documentation

◆ AddCharge()

void PndGemCluster::AddCharge ( Double_t  iCharge)
inline

Definition at line 68 of file PndGemCluster.h.

68 { fClusterCharge += iCharge; }

◆ AddIndex() [1/2]

void PndGemCluster::AddIndex ( int  index)
inline

Definition at line 99 of file PndGemCluster.h.

99 { AddLink(FairLink("GEMDigi", index)); }

◆ AddIndex() [2/2]

void PndGemCluster::AddIndex ( std::vector< Int_t >  index)
inline

Definition at line 100 of file PndGemCluster.h.

100 { SetLinks(FairMultiLinkedData("GEMDigi", index)); }

◆ equal()

virtual bool PndGemCluster::equal ( FairTimeStamp *  data)
inlinevirtual

Definition at line 102 of file PndGemCluster.h.

References GetDetectorId().

103  {
104  PndGemCluster *myCluster = dynamic_cast<PndGemCluster *>(data);
105  if (myCluster != nullptr) {
106  if (fDetectorId == myCluster->GetDetectorId())
107  return kTRUE;
108  }
109  return false;
110  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:71

◆ GetChannelNr()

Double_t PndGemCluster::GetChannelNr ( ) const
inline

Definition at line 72 of file PndGemCluster.h.

Referenced by operator<(), operator==(), and operator>().

72 { return fChannelNr; }

◆ GetCharge()

Double_t PndGemCluster::GetCharge ( ) const
inline

Definition at line 84 of file PndGemCluster.h.

84 { return fClusterCharge; }

◆ GetClusterBeg()

Int_t PndGemCluster::GetClusterBeg ( ) const
inline

Definition at line 82 of file PndGemCluster.h.

82 { return fClusterBeg; }

◆ GetClusterEnd()

Int_t PndGemCluster::GetClusterEnd ( ) const
inline

Definition at line 83 of file PndGemCluster.h.

83 { return fClusterEnd; }

◆ GetCor()

Double_t PndGemCluster::GetCor ( ) const
inline

Definition at line 85 of file PndGemCluster.h.

85 { return fClusterCor; }

◆ GetDetectorId()

Int_t PndGemCluster::GetDetectorId ( ) const
inline

Accessors

Definition at line 71 of file PndGemCluster.h.

Referenced by equal(), operator<(), operator==(), and operator>().

71 { return fDetectorId; }

◆ GetIndex()

Int_t PndGemCluster::GetIndex ( int  i = 0) const
inline

Definition at line 97 of file PndGemCluster.h.

References i.

97 { return GetLink(i).GetIndex(); }
unsigned int i
Definition: P4_F32vec4.h:21

◆ GetIndices()

std::vector<Int_t> PndGemCluster::GetIndices ( ) const
inline

Definition at line 87 of file PndGemCluster.h.

88  {
89  std::vector<Int_t> result;
90  std::set<FairLink> myLinks = GetLinks();
91  for (std::set<FairLink>::iterator it = myLinks.begin(); it != myLinks.end(); it++) {
92  result.push_back(it->GetIndex());
93  }
94  return result;
95  }

◆ GetNIndices()

Int_t PndGemCluster::GetNIndices ( )
inline

Definition at line 96 of file PndGemCluster.h.

96 { return GetNLinks(); }

◆ GetSensorNr()

Int_t PndGemCluster::GetSensorNr ( ) const
inline

Definition at line 76 of file PndGemCluster.h.

77  { // sensor number within station
78  return ((fDetectorId & (3 << 6)) >> 6);
79  }

◆ GetSide()

Int_t PndGemCluster::GetSide ( ) const
inline

Definition at line 80 of file PndGemCluster.h.

80 { return ((fDetectorId & (1 << 5)) >> 5); } // 0=front, 1=back

◆ GetStationNr()

Int_t PndGemCluster::GetStationNr ( ) const
inline

Definition at line 75 of file PndGemCluster.h.

75 { return ((fDetectorId & (8191 << 8)) >> 8); }

◆ GetSystemId()

Int_t PndGemCluster::GetSystemId ( ) const
inline

Definition at line 74 of file PndGemCluster.h.

74 { return ((fDetectorId & (31 << 27)) >> 27); }

◆ operator<()

virtual bool PndGemCluster::operator< ( const PndGemCluster myCluster) const
inlinevirtual

Definition at line 112 of file PndGemCluster.h.

References GetChannelNr(), and GetDetectorId().

113  {
114  if (fDetectorId < myCluster.GetDetectorId())
115  return true;
116  else if (fDetectorId > myCluster.GetDetectorId())
117  return false;
118  if (fChannelNr < myCluster.GetChannelNr())
119  return true;
120  else if (fChannelNr > myCluster.GetChannelNr())
121  return false;
122  return false;
123  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:71
Double_t GetChannelNr() const
Definition: PndGemCluster.h:72

◆ operator==()

virtual bool PndGemCluster::operator== ( const PndGemCluster myCluster) const
inlinevirtual

Definition at line 138 of file PndGemCluster.h.

References GetChannelNr(), and GetDetectorId().

139  {
140  if (fDetectorId == myCluster.GetDetectorId())
141  if (fChannelNr == myCluster.GetChannelNr())
142  return true;
143  return false;
144  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:71
Double_t GetChannelNr() const
Definition: PndGemCluster.h:72

◆ operator>()

virtual bool PndGemCluster::operator> ( const PndGemCluster myCluster) const
inlinevirtual

Definition at line 125 of file PndGemCluster.h.

References GetChannelNr(), and GetDetectorId().

126  {
127  if (fDetectorId > myCluster.GetDetectorId())
128  return true;
129  else if (fDetectorId < myCluster.GetDetectorId())
130  return false;
131  if (fChannelNr > myCluster.GetChannelNr())
132  return true;
133  else if (fChannelNr < myCluster.GetChannelNr())
134  return false;
135  return false;
136  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:71
Double_t GetChannelNr() const
Definition: PndGemCluster.h:72

◆ SetCharge()

void PndGemCluster::SetCharge ( Double_t  iCharge)
inline

Definition at line 62 of file PndGemCluster.h.

62 { fClusterCharge = iCharge; }

◆ SetClusterBeg()

void PndGemCluster::SetClusterBeg ( Int_t  bChan)
inline

Definition at line 65 of file PndGemCluster.h.

65 { fClusterBeg = bChan; }

◆ SetClusterEnd()

void PndGemCluster::SetClusterEnd ( Int_t  eChan)
inline

Definition at line 66 of file PndGemCluster.h.

66 { fClusterEnd = eChan; }

◆ SetCor()

void PndGemCluster::SetCor ( Double_t  iCor)
inline

Definition at line 63 of file PndGemCluster.h.

63 { fClusterCor = iCor; }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
PndGemCluster cluster 
)
friend

Definition at line 30 of file PndGemCluster.h.

31  {
32  out << "PndGemCluster in: " << cluster.GetDetectorId() << "( system = " << cluster.GetSystemId() << ", station = " << cluster.GetStationNr()
33  << ", sensor = " << cluster.GetSensorNr() << ", side = " << cluster.GetSide() << "), channelNr = " << cluster.GetChannelNr() << " < from " << cluster.GetClusterBeg()
34  << " to " << cluster.GetClusterEnd() << " > charge = " << cluster.GetCharge() << ", cor = " << cluster.GetCor() << ", timestamp " << cluster.GetTimeStamp()
35  << ", from Point(s) ";
36  std::vector<Int_t> indices = cluster.GetIndices();
37  for (unsigned int i = 0; i < indices.size(); i++) {
38  out << indices[i] << " ";
39  }
40  out << std::endl;
41 
42  return out;
43  }
Int_t GetSensorNr() const
Definition: PndGemCluster.h:76
Int_t GetDetectorId() const
Definition: PndGemCluster.h:71
Int_t GetClusterBeg() const
Definition: PndGemCluster.h:82
unsigned int i
Definition: P4_F32vec4.h:21
Int_t GetSystemId() const
Definition: PndGemCluster.h:74
Int_t GetClusterEnd() const
Definition: PndGemCluster.h:83
Double_t GetCor() const
Definition: PndGemCluster.h:85
std::vector< Int_t > GetIndices() const
Definition: PndGemCluster.h:87
Int_t GetStationNr() const
Definition: PndGemCluster.h:75
Double_t GetCharge() const
Definition: PndGemCluster.h:84
Double_t GetChannelNr() const
Definition: PndGemCluster.h:72
Int_t GetSide() const
Definition: PndGemCluster.h:80

The documentation for this class was generated from the following file: