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 42 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 77 of file PndGemDigi.h.

77 { fDigiCharge += iCharge; }

◆ AddIndex() [1/2]

void PndGemDigi::AddIndex ( int  index)
inline

Definition at line 106 of file PndGemDigi.h.

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

◆ AddIndex() [2/2]

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

Definition at line 107 of file PndGemDigi.h.

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

◆ equal()

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

Definition at line 109 of file PndGemDigi.h.

References GetDetectorId().

110  {
111  PndGemDigi *myDigi = dynamic_cast<PndGemDigi *>(data);
112  if (myDigi != nullptr) {
113  if (fDetectorId == myDigi->GetDetectorId())
114  return kTRUE;
115  }
116  return false;
117  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:80

◆ GetChannelNr()

Double_t PndGemDigi::GetChannelNr ( ) const
inline

Definition at line 81 of file PndGemDigi.h.

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

81 { return fChannelNr; }

◆ GetCharge()

Double_t PndGemDigi::GetCharge ( ) const
inline

Definition at line 91 of file PndGemDigi.h.

91 { return fDigiCharge; }

◆ GetCor()

Double_t PndGemDigi::GetCor ( ) const
inline

Definition at line 92 of file PndGemDigi.h.

92 { return fDigiCor; }

◆ GetDetectorId()

Int_t PndGemDigi::GetDetectorId ( ) const
inline

Accessors

Definition at line 80 of file PndGemDigi.h.

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

80 { return fDetectorId; }

◆ GetIndex()

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

Definition at line 104 of file PndGemDigi.h.

References i.

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

◆ GetIndices()

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

Definition at line 94 of file PndGemDigi.h.

95  {
96  std::vector<Int_t> result;
97  std::set<FairLink> myLinks = GetLinks();
98  for (std::set<FairLink>::iterator it = myLinks.begin(); it != myLinks.end(); it++) {
99  result.push_back(it->GetIndex());
100  }
101  return result;
102  }

◆ GetNIndices()

Int_t PndGemDigi::GetNIndices ( )
inline

Definition at line 103 of file PndGemDigi.h.

103 { return GetNLinks(); }

◆ GetSensorNr()

Int_t PndGemDigi::GetSensorNr ( ) const
inline

Definition at line 85 of file PndGemDigi.h.

86  { // sensor number within station
87  return ((fDetectorId & (3 << 6)) >> 6);
88  }

◆ GetSide()

Int_t PndGemDigi::GetSide ( ) const
inline

Definition at line 89 of file PndGemDigi.h.

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

◆ GetStationNr()

Int_t PndGemDigi::GetStationNr ( ) const
inline

Definition at line 84 of file PndGemDigi.h.

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

◆ GetSystemId()

Int_t PndGemDigi::GetSystemId ( ) const
inline

Definition at line 83 of file PndGemDigi.h.

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

◆ operator<()

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

Definition at line 119 of file PndGemDigi.h.

References GetChannelNr(), and GetDetectorId().

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

◆ operator==()

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

Definition at line 145 of file PndGemDigi.h.

References GetChannelNr(), and GetDetectorId().

146  {
147  if (fDetectorId == myDigi.GetDetectorId())
148  if (fChannelNr == myDigi.GetChannelNr())
149  return true;
150  return false;
151  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:80
Double_t GetChannelNr() const
Definition: PndGemDigi.h:81

◆ operator>()

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

Definition at line 132 of file PndGemDigi.h.

References GetChannelNr(), and GetDetectorId().

133  {
134  if (fDetectorId > myDigi.GetDetectorId())
135  return true;
136  else if (fDetectorId < myDigi.GetDetectorId())
137  return false;
138  if (fChannelNr > myDigi.GetChannelNr())
139  return true;
140  else if (fChannelNr < myDigi.GetChannelNr())
141  return false;
142  return false;
143  }
Int_t GetDetectorId() const
Definition: PndGemDigi.h:80
Double_t GetChannelNr() const
Definition: PndGemDigi.h:81

◆ SetCharge()

void PndGemDigi::SetCharge ( Double_t  iCharge)
inline

Definition at line 74 of file PndGemDigi.h.

74 { fDigiCharge = iCharge; }

◆ SetCor()

void PndGemDigi::SetCor ( Double_t  iCor)
inline

Definition at line 75 of file PndGemDigi.h.

75 { fDigiCor = iCor; }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 43 of file PndGemDigi.h.

44  {
45  out << "PndGemDigi in: " << digi.GetDetectorId() << "( system = " << digi.GetSystemId() << ", station = " << digi.GetStationNr() << ", sensor = " << digi.GetSensorNr()
46  << ", side = " << digi.GetSide() << "), channelNr = " << digi.GetChannelNr() << ", charge = " << digi.GetCharge() << ", cor = " << digi.GetCor() << ", timestamp "
47  << digi.GetTimeStamp() << ", from Point(s) ";
48  std::vector<Int_t> indices = digi.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 GetSystemId() const
Definition: PndGemDigi.h:83
Int_t GetSide() const
Definition: PndGemDigi.h:89
Double_t GetCharge() const
Definition: PndGemDigi.h:91
unsigned int i
Definition: P4_F32vec4.h:33
Int_t GetDetectorId() const
Definition: PndGemDigi.h:80
Double_t GetChannelNr() const
Definition: PndGemDigi.h:81
std::vector< Int_t > GetIndices() const
Definition: PndGemDigi.h:94
Int_t GetSensorNr() const
Definition: PndGemDigi.h:85
Int_t GetStationNr() const
Definition: PndGemDigi.h:84
Double_t GetCor() const
Definition: PndGemDigi.h:92

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