PandaRoot
PndHypDigi.h
Go to the documentation of this file.
1 // --------------------------------------------------------
2 // ---- MvdDigi header file ---
3 // ---- Created 19.10.07 by T.Stockmanns ---
4 // --------------------------------------------------------
5 
14 #ifndef PNDHYPDIGI_H
15 #define PNDHYPDIGI_H
16 
17 #include "TObject.h"
18 #include "TString.h"
19 #include <iostream>
20 #include <vector>
21 
22 class PndHypDigi : public TObject {
23 
24  friend std::ostream &operator<<(std::ostream &out, PndHypDigi &digi)
25  {
26  out << "Hyp Digi in: " << digi.GetDetName() << " FE: " << digi.GetFE() << " "
27  << " charge " << digi.GetCharge() << " e";
28  std::vector<Int_t> indices = digi.GetIndices();
29  for (unsigned int i = 0; i < indices.size(); i++) {
30  std::cout << digi.GetIndex(i) << " " << std::endl;
31  }
32  return out;
33  }
34 
35  public:
36  PndHypDigi();
37  PndHypDigi(Int_t index, Int_t detID, TString detName, Int_t fe, Double_t charge);
46  virtual ~PndHypDigi(){};
47 
48  Int_t GetFE() const { return fFE; }
49  TString GetDetName() const { return fDetName; }
50  Double_t GetCharge() const { return fCharge; }
51  Int_t GetDetID() const { return fDetID; }
52  std::vector<Int_t> GetIndices() const { return fIndex; }
53  Int_t GetIndex(int i = 0) const { return fIndex[i]; }
54 
55  void AddIndex(int index) { fIndex.push_back(index); }
56  void AddCharge(double charge) { fCharge += charge; }
57 
58  virtual void print() { std::cout << *this; }
59 
60  protected:
61  std::vector<Int_t> fIndex;
62  Int_t fDetID;
63  TString fDetName;
64  Double_t fCharge;
65  Int_t fFE;
66 
67  ClassDef(PndHypDigi, 1);
68 };
69 
70 #endif
std::vector< Int_t > GetIndices() const
Definition: PndHypDigi.h:52
unsigned int i
Definition: P4_F32vec4.h:21
void AddIndex(int index)
Definition: PndHypDigi.h:55
Double_t GetCharge() const
Definition: PndHypDigi.h:50
void AddCharge(double charge)
Definition: PndHypDigi.h:56
virtual void print()
Definition: PndHypDigi.h:58
Int_t fDetID
Definition: PndHypDigi.h:62
ClassDef(PndHypDigi, 1)
TString GetDetName() const
Definition: PndHypDigi.h:49
std::vector< Int_t > fIndex
Definition: PndHypDigi.h:61
Int_t fFE
Definition: PndHypDigi.h:65
Int_t GetFE() const
Definition: PndHypDigi.h:48
TString fDetName
Definition: PndHypDigi.h:63
friend std::ostream & operator<<(std::ostream &out, PndHypDigi &digi)
Definition: PndHypDigi.h:24
virtual ~PndHypDigi()
Definition: PndHypDigi.h:46
Int_t GetDetID() const
Definition: PndHypDigi.h:51
Double_t fCharge
Definition: PndHypDigi.h:64
Base class for Digi information.
Definition: PndHypDigi.h:22
Int_t GetIndex(int i=0) const
Definition: PndHypDigi.h:53