PandaRoot
PndHypDigi.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // --------------------------------------------------------
14 // ---- MvdDigi header file ---
15 // ---- Created 19.10.07 by T.Stockmanns ---
16 // --------------------------------------------------------
17 
26 #ifndef PNDHYPDIGI_H
27 #define PNDHYPDIGI_H
28 
29 #include "TObject.h"
30 #include "TString.h"
31 #include <iostream>
32 #include <vector>
33 
34 class PndHypDigi : public TObject {
35 
36  friend std::ostream &operator<<(std::ostream &out, PndHypDigi &digi)
37  {
38  out << "Hyp Digi in: " << digi.GetDetName() << " FE: " << digi.GetFE() << " "
39  << " charge " << digi.GetCharge() << " e";
40  std::vector<Int_t> indices = digi.GetIndices();
41  for (unsigned int i = 0; i < indices.size(); i++) {
42  std::cout << digi.GetIndex(i) << " " << std::endl;
43  }
44  return out;
45  }
46 
47  public:
48  PndHypDigi();
49  PndHypDigi(Int_t index, Int_t detID, TString detName, Int_t fe, Double_t charge);
58  virtual ~PndHypDigi(){};
59 
60  Int_t GetFE() const { return fFE; }
61  TString GetDetName() const { return fDetName; }
62  Double_t GetCharge() const { return fCharge; }
63  Int_t GetDetID() const { return fDetID; }
64  std::vector<Int_t> GetIndices() const { return fIndex; }
65  Int_t GetIndex(int i = 0) const { return fIndex[i]; }
66 
67  void AddIndex(int index) { fIndex.push_back(index); }
68  void AddCharge(double charge) { fCharge += charge; }
69 
70  virtual void print() { std::cout << *this; }
71 
72  protected:
73  std::vector<Int_t> fIndex;
74  Int_t fDetID;
75  TString fDetName;
76  Double_t fCharge;
77  Int_t fFE;
78 
79  ClassDef(PndHypDigi, 1);
80 };
81 
82 #endif
std::vector< Int_t > GetIndices() const
Definition: PndHypDigi.h:64
unsigned int i
Definition: P4_F32vec4.h:33
void AddIndex(int index)
Definition: PndHypDigi.h:67
Double_t GetCharge() const
Definition: PndHypDigi.h:62
void AddCharge(double charge)
Definition: PndHypDigi.h:68
virtual void print()
Definition: PndHypDigi.h:70
Int_t fDetID
Definition: PndHypDigi.h:74
ClassDef(PndHypDigi, 1)
TString GetDetName() const
Definition: PndHypDigi.h:61
std::vector< Int_t > fIndex
Definition: PndHypDigi.h:73
Int_t fFE
Definition: PndHypDigi.h:77
Int_t GetFE() const
Definition: PndHypDigi.h:60
TString fDetName
Definition: PndHypDigi.h:75
friend std::ostream & operator<<(std::ostream &out, PndHypDigi &digi)
Definition: PndHypDigi.h:36
virtual ~PndHypDigi()
Definition: PndHypDigi.h:58
Int_t GetDetID() const
Definition: PndHypDigi.h:63
Double_t fCharge
Definition: PndHypDigi.h:76
Base class for Digi information.
Definition: PndHypDigi.h:34
Int_t GetIndex(int i=0) const
Definition: PndHypDigi.h:65