PandaRoot
PndSdsDigiStrip.h
Go to the documentation of this file.
1 // --------------------------------------------------------
2 // ---- PndSdsDigiStrip header file ---
3 // ---- Created 10.07.07 by Ralf Kliemt ---
4 // --------------------------------------------------------
5 
10 #ifndef PNDSDSDIGISTRIP_H
11 #define PNDSDSDIGISTRIP_H
12 
13 #include "PndSdsDigi.h"
14 #include "PndDetectorList.h"
15 
16 #include "TObject.h"
17 #include "TString.h"
18 #include <iostream>
19 
21 
27 class PndSdsDigiStrip : public PndSdsDigi {
28  public:
30 
31  PndSdsDigiStrip(std::vector<Int_t> index, Int_t detID, Int_t sensorID, Int_t fe, Int_t chan, Double_t charge, Double_t timestamp = -1);
32  PndSdsDigiStrip(Int_t index, Int_t detID, Int_t sensorID, Int_t fe, Int_t chan, Double_t charge, Double_t timestamp = -1);
34 
35  friend std::ostream &operator<<(std::ostream &out, const PndSdsDigiStrip &digi);
36 
37  // Int_t GetIndex() const { return fIndex; }
38  // Int_t GetDetID() const { return fDetID;}
39  // TString GetDetName() const { return fDetName; }
40  // Int_t GetFE() const { return fFE; }
41  Int_t GetChannel() const { return fChannel; }
42  // Int_t GetTimestamp() const { return fTimestamp; }
43  // Double_t GetCharge() const { return fCharge; }
44  // Int_t GetMCID() const { return fMCID; }
45 
46  // void SetIndex ( Int_t index ) { fIndex = index; }
47  // void SetDetID ( Int_t detID ) { fDetID = detID; }
48  // void SetDetName ( const TString& detName ) { fDetName = detName; }
49  // void SetFE ( Int_t fe ) { fFE = fe; }
50  // void SetChannel ( Int_t channel ) { fChannel = channel; }
51  // void SetCharge ( Double_t charge ) { fCharge = charge; }
52  // void SetMCID ( Int_t mcID ) { fMCID = mcID; }
53 
54  // const void Print();
55 
56  Bool_t operator==(const PndSdsDigiStrip &d2) const;
57  // Bool_t const HasNeighbour(const PndSdsDigiStrip& d2);
58 
59  virtual bool equal(FairTimeStamp *data);
60 
61  virtual bool operator<(const PndSdsDigiStrip &myDigi) const
62  {
63  if (fDetID < myDigi.GetDetID())
64  return true;
65  else if (fDetID > myDigi.GetDetID())
66  return false;
67  if (fSensorID < myDigi.GetSensorID())
68  return true;
69  else if (fSensorID > myDigi.GetSensorID())
70  return false;
71  if (fFE < myDigi.GetFE())
72  return true;
73  else if (fFE > myDigi.GetFE())
74  return false;
75  if (fChannel < myDigi.GetChannel())
76  return true;
77  else if (fChannel > myDigi.GetChannel())
78  return false;
79  return false;
80  }
81 
83  {
84  if (this != &strip) {
85  this->PndSdsDigi::operator=(strip);
86  fChannel = strip.GetChannel();
87  }
88  return *this;
89  }
90 
91  std::ostream &Print(std::ostream &out = std::cout) const
92  {
93  out << GetDetID() << " PndSds DigiStrip in sensor: " << GetSensorID() << " FE: " << GetFE() << " Channel: " << GetChannel() << " charge: " << GetCharge() << " (e or tot)"
94  << " timestamp: " << GetTimeStamp() << ", from Point(s): ";
95  std::vector<Int_t> indices = GetIndices();
96  for (unsigned int i = 0; i < indices.size(); i++) {
97  out << indices[i] << " ";
98  }
99  out << std::endl;
100  return out;
101  }
102 
103 #ifndef __CINT__ // for BOOST serialization
104  template <class Archive>
105  void serialize(Archive &ar, const unsigned int version)
106  {
107  boost::serialization::void_cast_register<PndSdsDigiStrip, PndSdsDigi>();
108  ar &boost::serialization::base_object<PndSdsDigi>(*this);
109  ar &fChannel;
110  }
111 #endif // for BOOST serialization
112 
113  private:
114 #ifndef __CINT__ // for BOOST serialization
116 #endif // for BOOST serialization
117 
118  Int_t fChannel;
119 
120  ClassDef(PndSdsDigiStrip, 6);
121 };
122 
123 #endif
PndSdsDigiStrip & operator=(const PndSdsDigiStrip &strip)
friend class boost::serialization::access
Base class for Digi information.
Definition: PndSdsDigi.h:29
Int_t fSensorID
Definition: PndSdsDigi.h:118
Bool_t operator==(const PndSdsDigiStrip &d2) const
Int_t GetChannel() const
std::vector< Int_t > GetIndices() const
Definition: PndSdsDigi.h:60
Double_t GetCharge() const
Definition: PndSdsDigi.h:58
Class for digitised strip hits.
std::ostream & Print(std::ostream &out=std::cout) const
unsigned int i
Definition: P4_F32vec4.h:21
Int_t fDetID
Definition: PndSdsDigi.h:117
virtual bool equal(FairTimeStamp *data)
virtual bool operator<(const PndSdsDigiStrip &myDigi) const
friend std::ostream & operator<<(std::ostream &out, const PndSdsDigiStrip &digi)
Int_t GetDetID() const
Definition: PndSdsDigi.h:59
Int_t fFE
Definition: PndSdsDigi.h:119
void serialize(Archive &ar, const unsigned int version)
Int_t GetSensorID() const
Definition: PndSdsDigi.h:57
Int_t GetFE() const
Definition: PndSdsDigi.h:55