FairRoot/PandaRoot
PndSdsDigiPixel.h
Go to the documentation of this file.
1 // --------------------------------------------------------
2 // ---- PndSdsDigiPixel header file ---
3 // ---- Created 19.6.06 by T.Stockmanns ---
4 // --------------------------------------------------------
5 
13 #ifndef PNDSDSDIGIPIXEL_H
14 #define PNDSDSDIGIPIXEL_H
15 
16 #include "PndSdsDigi.h"
17 #include "PndDetectorList.h"
18 
19 #include "TObject.h"
20 #include "TString.h"
21 #include <iostream>
22 #include <vector>
23 
24 
26  {
28  out << "PndSdsDigiPixel in: " << digi.GetSensorID() << " FE: "
29  << digi.GetFE() << " Col/Row " << digi.GetPixelColumn() << "/" << digi.GetPixelRow()
30  << " charge " << digi.GetCharge() << " e"
31  << " timestamp "<< digi.GetTimeStamp()
32  << ", from Point(s) ";
33  std::vector<Int_t>indices = digi.GetIndices();
34  for (unsigned int i = 0; i < indices.size(); i++){
35  out << indices[i] << " ";
36  }
37  out << std::endl;
38 
39  return out;
40  }
41 
42  public : PndSdsDigiPixel();
43  PndSdsDigiPixel(std::vector<Int_t> index, Int_t detID, Int_t sensorID, Int_t fe, Int_t col, Int_t row, Double_t charge, Double_t timeStamp);
44 
45 
46  virtual ~PndSdsDigiPixel(){};
47 
48  void Print() {
49  std::cout << *this;
50  }
51 
52  Int_t GetPixelColumn() const { return fCol; }
53  Int_t GetPixelRow() const { return fRow; }
54 
55  void SetPixelColumn(Int_t col){ fCol = col;}
56  void SetPixelRow(Int_t row){ fRow = row;}
57 
58  bool operator==(PndSdsDigiPixel& myDigi){
59  if (fSensorID == myDigi.GetSensorID())
60  if (fFE == myDigi.GetFE())
61  if (fCol == myDigi.GetPixelColumn())
62  if (fRow == myDigi.GetPixelRow())
63  return true;
64  return false;
65  }
66 
67  virtual bool equal(FairTimeStamp* data) {
68  PndSdsDigiPixel* myDigi = dynamic_cast <PndSdsDigiPixel*> (data);
69  if (myDigi != 0){
70  if (fSensorID == myDigi->GetSensorID())
71  if (fFE == myDigi->GetFE())
72  if (fCol == myDigi->GetPixelColumn())
73  if (fRow == myDigi->GetPixelRow())
74  return true;
75  }
76  return false;
77  }
78 
79  virtual bool operator<(const PndSdsDigiPixel& myDigi) const{
80  if (fDetID < myDigi.GetDetID()) return true; else if(fDetID > myDigi.GetDetID()) return false;
81  if (fSensorID < myDigi.GetSensorID()) return true; else if (fSensorID > myDigi.GetSensorID()) return false;
82  if (fFE < myDigi.GetFE()) return true; else if (fFE > myDigi.GetFE()) return false;
83  if (fCol < myDigi.GetPixelColumn()) return true; else if (fCol > myDigi.GetPixelColumn()) return false;
84  if (fRow < myDigi.GetPixelRow()) return true; else if (fRow > myDigi.GetPixelRow()) return false;
85  return false;
86  }
87 
88  virtual bool operator>(const PndSdsDigiPixel& myDigi) const{
89  if (fDetID > myDigi.GetDetID()) return true; else if(fDetID < myDigi.GetDetID()) return false;
90  if (fSensorID > myDigi.GetSensorID()) return true; else if (fSensorID < myDigi.GetSensorID()) return false;
91  if (fFE > myDigi.GetFE()) return true; else if (fFE < myDigi.GetFE()) return false;
92  if (fCol > myDigi.GetPixelColumn()) return true; else if (fCol < myDigi.GetPixelColumn()) return false;
93  if (fRow > myDigi.GetPixelRow()) return true; else if (fRow < myDigi.GetPixelRow()) return false;
94  return false;
95  }
96 
98  if (this != &pix){
99  this->PndSdsDigi::operator=(pix);
100  fCol = pix.GetPixelColumn();
101  fRow = pix.GetPixelRow();
102  }
103  return *this;
104  }
105 
106  #ifndef __CINT__ // for BOOST serialization
107  template<class Archive>
108  void serialize(Archive & ar, const unsigned int version)
109  {
110  boost::serialization::void_cast_register<PndSdsDigiPixel, PndSdsDigi>();
111  ar & boost::serialization::base_object<PndSdsDigi>(*this);
112  ar & fCol;
113  ar & fRow;
114  }
115  #endif // for BOOST serialization
116 
117  private :
118  #ifndef __CINT__ // for BOOST serialization
120 
121  #endif // for BOOST serialization
122  Int_t fCol, fRow;
123 
125  };
126 
127 #endif
int row
Definition: anaLmdDigi.C:67
Int_t GetPixelRow() const
virtual bool operator>(const PndSdsDigiPixel &myDigi) const
TClonesArray * digi
Int_t GetSensorID() const
Definition: PndSdsDigi.h:59
Base class for Digi information.
Definition: PndSdsDigi.h:29
Int_t fSensorID
Definition: PndSdsDigi.h:112
PndSdsDigiPixel & operator=(const PndSdsDigiPixel &pix)
Int_t i
Definition: run_full.C:25
void serialize(Archive &ar, const unsigned int version)
Int_t GetPixelColumn() const
virtual bool equal(FairTimeStamp *data)
virtual bool operator<(const PndSdsDigiPixel &myDigi) const
int col
Definition: anaLmdDigi.C:67
Double_t GetCharge() const
Definition: PndSdsDigi.h:60
ClassDef(PndSdsDigiPixel, 8)
Int_t GetFE() const
Definition: PndSdsDigi.h:57
Int_t fDetID
Definition: PndSdsDigi.h:111
Double_t
bool operator==(PndSdsDigiPixel &myDigi)
TFile * out
Definition: reco_muo.C:20
friend std::ostream & operator<<(std::ostream &out, PndSdsDigiPixel &digi)
Int_t fFE
Definition: PndSdsDigi.h:113
std::vector< Int_t > GetIndices() const
Definition: PndSdsDigi.h:62
Int_t GetDetID() const
Definition: PndSdsDigi.h:61
void SetPixelRow(Int_t row)
int fe
Definition: anaLmdDigi.C:67
void SetPixelColumn(Int_t col)
Data class to store the digi output of a pixel module.
friend class boost::serialization::access
virtual ~PndSdsDigiPixel()