PandaRoot
PndGemDigi Class Reference

#include <PndGemDigi.h>

Inheritance diagram for PndGemDigi:

Public Member Functions

 PndGemDigi ()
 
 PndGemDigi (Int_t iDetectorId, Double_t iChannel, Int_t index)
 
 PndGemDigi (Int_t iDetectorId, Double_t iChannel, Int_t index, Double_t signal, Double_t time)
 
virtual ~PndGemDigi ()
 
void SetCharge (Double_t iCharge)
 
void SetCor (Double_t iCor)
 
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
 
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 PndGemDigi &myDigi) const
 
virtual bool operator> (const PndGemDigi &myDigi) const
 
virtual bool operator== (const PndGemDigi &myDigi) const
 

Friends

std::ostream & operator<< (std::ostream &out, PndGemDigi &digi)
 

Detailed Description

PndGemDigi.h

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

Data class for digital GEM information Data level: RAW

The index of the (first) MCPoint having activated this channel is accessible via GetMcPointIndex().

Definition at line 30 of file PndGemDigi.h.

Constructor & Destructor Documentation

◆ PndGemDigi() [1/3]

PndGemDigi::PndGemDigi ( )

Default constructor

◆ PndGemDigi() [2/3]

PndGemDigi::PndGemDigi ( Int_t  iDetectorId,
Double_t  iChannel,
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

◆ PndGemDigi() [3/3]

PndGemDigi::PndGemDigi ( Int_t  iDetectorId,
Double_t  iChannel,
Int_t  index,
Double_t  signal,
Double_t  time 
)

◆ ~PndGemDigi()

virtual PndGemDigi::~PndGemDigi ( )
virtual

Destructor

Member Function Documentation

◆ AddCharge()

void PndGemDigi::AddCharge ( Double_t  iCharge)
inline

Definition at line 65 of file PndGemDigi.h.

65 { fDigiCharge += iCharge; }

◆ AddIndex() [1/2]

void PndGemDigi::AddIndex ( int  index)
inline

Definition at line 94 of file PndGemDigi.h.

94 { AddLink(FairLink("GEMPoint", index)); }

◆ AddIndex() [2/2]

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

Definition at line 95 of file PndGemDigi.h.

95 { SetLinks(FairMultiLinkedData("GEMPoint", index)); }

◆ equal()

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

Definition at line 97 of file PndGemDigi.h.

References GetDetectorId().

98  {
99  PndGemDigi *myDigi = dynamic_cast<PndGemDigi *>(data);
100  if (myDigi != nullptr) {
101  if (fDetectorId == myDigi->GetDetectorId())
102  return kTRUE;
103  }
104  return false;
105  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:68

◆ GetChannelNr()

Double_t PndGemDigi::GetChannelNr ( ) const
inline

Definition at line 69 of file PndGemDigi.h.

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

69 { return fChannelNr; }

◆ GetCharge()

Double_t PndGemDigi::GetCharge ( ) const
inline

Definition at line 79 of file PndGemDigi.h.

79 { return fDigiCharge; }

◆ GetCor()

Double_t PndGemDigi::GetCor ( ) const
inline

Definition at line 80 of file PndGemDigi.h.

80 { return fDigiCor; }

◆ GetDetectorId()

Int_t PndGemDigi::GetDetectorId ( ) const
inline

Accessors

Definition at line 68 of file PndGemDigi.h.

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

68 { return fDetectorId; }

◆ GetIndex()

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

Definition at line 92 of file PndGemDigi.h.

References i.

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

◆ GetIndices()

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

Definition at line 82 of file PndGemDigi.h.

83  {
84  std::vector<Int_t> result;
85  std::set<FairLink> myLinks = GetLinks();
86  for (std::set<FairLink>::iterator it = myLinks.begin(); it != myLinks.end(); it++) {
87  result.push_back(it->GetIndex());
88  }
89  return result;
90  }

◆ GetNIndices()

Int_t PndGemDigi::GetNIndices ( )
inline

Definition at line 91 of file PndGemDigi.h.

91 { return GetNLinks(); }

◆ GetSensorNr()

Int_t PndGemDigi::GetSensorNr ( ) const
inline

Definition at line 73 of file PndGemDigi.h.

74  { // sensor number within station
75  return ((fDetectorId & (3 << 6)) >> 6);
76  }

◆ GetSide()

Int_t PndGemDigi::GetSide ( ) const
inline

Definition at line 77 of file PndGemDigi.h.

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

◆ GetStationNr()

Int_t PndGemDigi::GetStationNr ( ) const
inline

Definition at line 72 of file PndGemDigi.h.

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

◆ GetSystemId()

Int_t PndGemDigi::GetSystemId ( ) const
inline

Definition at line 71 of file PndGemDigi.h.

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

◆ operator<()

virtual bool PndGemDigi::operator< ( const PndGemDigi myDigi) const
inlinevirtual

Definition at line 107 of file PndGemDigi.h.

References GetChannelNr(), and GetDetectorId().

108  {
109  if (fDetectorId < myDigi.GetDetectorId())
110  return true;
111  else if (fDetectorId > myDigi.GetDetectorId())
112  return false;
113  if (fChannelNr < myDigi.GetChannelNr())
114  return true;
115  else if (fChannelNr > myDigi.GetChannelNr())
116  return false;
117  return false;
118  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:68
Double_t GetChannelNr() const
Definition: PndGemDigi.h:69

◆ operator==()

virtual bool PndGemDigi::operator== ( const PndGemDigi myDigi) const
inlinevirtual

Definition at line 133 of file PndGemDigi.h.

References GetChannelNr(), and GetDetectorId().

134  {
135  if (fDetectorId == myDigi.GetDetectorId())
136  if (fChannelNr == myDigi.GetChannelNr())
137  return true;
138  return false;
139  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:68
Double_t GetChannelNr() const
Definition: PndGemDigi.h:69

◆ operator>()

virtual bool PndGemDigi::operator> ( const PndGemDigi myDigi) const
inlinevirtual

Definition at line 120 of file PndGemDigi.h.

References GetChannelNr(), and GetDetectorId().

121  {
122  if (fDetectorId > myDigi.GetDetectorId())
123  return true;
124  else if (fDetectorId < myDigi.GetDetectorId())
125  return false;
126  if (fChannelNr > myDigi.GetChannelNr())
127  return true;
128  else if (fChannelNr < myDigi.GetChannelNr())
129  return false;
130  return false;
131  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:68
Double_t GetChannelNr() const
Definition: PndGemDigi.h:69

◆ SetCharge()

void PndGemDigi::SetCharge ( Double_t  iCharge)
inline

Definition at line 62 of file PndGemDigi.h.

62 { fDigiCharge = iCharge; }

◆ SetCor()

void PndGemDigi::SetCor ( Double_t  iCor)
inline

Definition at line 63 of file PndGemDigi.h.

63 { fDigiCor = iCor; }

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
PndGemDigi digi 
)
friend

Definition at line 31 of file PndGemDigi.h.

32  {
33  out << "PndGemDigi in: " << digi.GetDetectorId() << "( system = " << digi.GetSystemId() << ", station = " << digi.GetStationNr() << ", sensor = " << digi.GetSensorNr()
34  << ", side = " << digi.GetSide() << "), channelNr = " << digi.GetChannelNr() << ", charge = " << digi.GetCharge() << ", cor = " << digi.GetCor() << ", timestamp "
35  << digi.GetTimeStamp() << ", from Point(s) ";
36  std::vector<Int_t> indices = digi.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 GetSystemId() const
Definition: PndGemDigi.h:71
Int_t GetSide() const
Definition: PndGemDigi.h:77
Double_t GetCharge() const
Definition: PndGemDigi.h:79
unsigned int i
Definition: P4_F32vec4.h:21
Int_t GetDetectorId() const
Definition: PndGemDigi.h:68
Double_t GetChannelNr() const
Definition: PndGemDigi.h:69
std::vector< Int_t > GetIndices() const
Definition: PndGemDigi.h:82
Int_t GetSensorNr() const
Definition: PndGemDigi.h:73
Int_t GetStationNr() const
Definition: PndGemDigi.h:72
Double_t GetCor() const
Definition: PndGemDigi.h:80

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