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 41 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 80 of file PndGemCluster.h.

80 { fClusterCharge += iCharge; }

◆ AddIndex() [1/2]

void PndGemCluster::AddIndex ( int  index)
inline

Definition at line 111 of file PndGemCluster.h.

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

◆ AddIndex() [2/2]

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

Definition at line 112 of file PndGemCluster.h.

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

◆ equal()

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

Definition at line 114 of file PndGemCluster.h.

References GetDetectorId().

115  {
116  PndGemCluster *myCluster = dynamic_cast<PndGemCluster *>(data);
117  if (myCluster != nullptr) {
118  if (fDetectorId == myCluster->GetDetectorId())
119  return kTRUE;
120  }
121  return false;
122  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:83

◆ GetChannelNr()

Double_t PndGemCluster::GetChannelNr ( ) const
inline

Definition at line 84 of file PndGemCluster.h.

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

84 { return fChannelNr; }

◆ GetCharge()

Double_t PndGemCluster::GetCharge ( ) const
inline

Definition at line 96 of file PndGemCluster.h.

96 { return fClusterCharge; }

◆ GetClusterBeg()

Int_t PndGemCluster::GetClusterBeg ( ) const
inline

Definition at line 94 of file PndGemCluster.h.

94 { return fClusterBeg; }

◆ GetClusterEnd()

Int_t PndGemCluster::GetClusterEnd ( ) const
inline

Definition at line 95 of file PndGemCluster.h.

95 { return fClusterEnd; }

◆ GetCor()

Double_t PndGemCluster::GetCor ( ) const
inline

Definition at line 97 of file PndGemCluster.h.

97 { return fClusterCor; }

◆ GetDetectorId()

Int_t PndGemCluster::GetDetectorId ( ) const
inline

Accessors

Definition at line 83 of file PndGemCluster.h.

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

83 { return fDetectorId; }

◆ GetIndex()

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

Definition at line 109 of file PndGemCluster.h.

References i.

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

◆ GetIndices()

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

Definition at line 99 of file PndGemCluster.h.

100  {
101  std::vector<Int_t> result;
102  std::set<FairLink> myLinks = GetLinks();
103  for (std::set<FairLink>::iterator it = myLinks.begin(); it != myLinks.end(); it++) {
104  result.push_back(it->GetIndex());
105  }
106  return result;
107  }

◆ GetNIndices()

Int_t PndGemCluster::GetNIndices ( )
inline

Definition at line 108 of file PndGemCluster.h.

108 { return GetNLinks(); }

◆ GetSensorNr()

Int_t PndGemCluster::GetSensorNr ( ) const
inline

Definition at line 88 of file PndGemCluster.h.

89  { // sensor number within station
90  return ((fDetectorId & (3 << 6)) >> 6);
91  }

◆ GetSide()

Int_t PndGemCluster::GetSide ( ) const
inline

Definition at line 92 of file PndGemCluster.h.

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

◆ GetStationNr()

Int_t PndGemCluster::GetStationNr ( ) const
inline

Definition at line 87 of file PndGemCluster.h.

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

◆ GetSystemId()

Int_t PndGemCluster::GetSystemId ( ) const
inline

Definition at line 86 of file PndGemCluster.h.

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

◆ operator<()

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

Definition at line 124 of file PndGemCluster.h.

References GetChannelNr(), and GetDetectorId().

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

◆ operator==()

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

Definition at line 150 of file PndGemCluster.h.

References GetChannelNr(), and GetDetectorId().

151  {
152  if (fDetectorId == myCluster.GetDetectorId())
153  if (fChannelNr == myCluster.GetChannelNr())
154  return true;
155  return false;
156  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:83
Double_t GetChannelNr() const
Definition: PndGemCluster.h:84

◆ operator>()

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

Definition at line 137 of file PndGemCluster.h.

References GetChannelNr(), and GetDetectorId().

138  {
139  if (fDetectorId > myCluster.GetDetectorId())
140  return true;
141  else if (fDetectorId < myCluster.GetDetectorId())
142  return false;
143  if (fChannelNr > myCluster.GetChannelNr())
144  return true;
145  else if (fChannelNr < myCluster.GetChannelNr())
146  return false;
147  return false;
148  }
Int_t GetDetectorId() const
Definition: PndGemCluster.h:83
Double_t GetChannelNr() const
Definition: PndGemCluster.h:84

◆ SetCharge()

void PndGemCluster::SetCharge ( Double_t  iCharge)
inline

Definition at line 74 of file PndGemCluster.h.

74 { fClusterCharge = iCharge; }

◆ SetClusterBeg()

void PndGemCluster::SetClusterBeg ( Int_t  bChan)
inline

Definition at line 77 of file PndGemCluster.h.

77 { fClusterBeg = bChan; }

◆ SetClusterEnd()

void PndGemCluster::SetClusterEnd ( Int_t  eChan)
inline

Definition at line 78 of file PndGemCluster.h.

78 { fClusterEnd = eChan; }

◆ SetCor()

void PndGemCluster::SetCor ( Double_t  iCor)
inline

Definition at line 75 of file PndGemCluster.h.

75 { fClusterCor = iCor; }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 42 of file PndGemCluster.h.

43  {
44  out << "PndGemCluster in: " << cluster.GetDetectorId() << "( system = " << cluster.GetSystemId() << ", station = " << cluster.GetStationNr()
45  << ", sensor = " << cluster.GetSensorNr() << ", side = " << cluster.GetSide() << "), channelNr = " << cluster.GetChannelNr() << " < from " << cluster.GetClusterBeg()
46  << " to " << cluster.GetClusterEnd() << " > charge = " << cluster.GetCharge() << ", cor = " << cluster.GetCor() << ", timestamp " << cluster.GetTimeStamp()
47  << ", from Point(s) ";
48  std::vector<Int_t> indices = cluster.GetIndices();
49  for (unsigned int i = 0; i < indices.size(); i++) {
50  out << indices[i] << " ";
51  }
52  out << std::endl;
53 
54  return out;
55  }
Int_t GetSensorNr() const
Definition: PndGemCluster.h:88
Int_t GetDetectorId() const
Definition: PndGemCluster.h:83
Int_t GetClusterBeg() const
Definition: PndGemCluster.h:94
unsigned int i
Definition: P4_F32vec4.h:33
Int_t GetSystemId() const
Definition: PndGemCluster.h:86
Int_t GetClusterEnd() const
Definition: PndGemCluster.h:95
Double_t GetCor() const
Definition: PndGemCluster.h:97
std::vector< Int_t > GetIndices() const
Definition: PndGemCluster.h:99
Int_t GetStationNr() const
Definition: PndGemCluster.h:87
Double_t GetCharge() const
Definition: PndGemCluster.h:96
Double_t GetChannelNr() const
Definition: PndGemCluster.h:84
Int_t GetSide() const
Definition: PndGemCluster.h:92

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