PandaRoot
PndHypHit.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 // ----- MvdHit header file -----
15 // ----- Created by T.Stockmanns -----
16 // ----- modified for hyp purpose by A.Sanchez
17 // -------------------------------------------------------------------------
18 
31 #ifndef PNDHYPHIT_H
32 #define PNDHYPHIT_H
33 
34 #include "TVector3.h"
35 #include "TString.h"
36 #include "FairHit.h"
37 
38 #include <stdio.h>
39 #include <iostream>
40 #include "PndDetectorList.h"
41 
42 class PndHypHit : public FairHit {
43  friend std::ostream &operator<<(std::ostream &out, const PndHypHit &hit)
44  {
45 
46  out << "Hyp hit in " << hit.GetDetName() << " at" << std::endl;
47  out << "(" << hit.GetX() << ", " << hit.GetY() << ", " << hit.GetZ() << ") cm "
48  << " with " << hit.GetCharge() << " e"
49  << ", Cluster No. " << hit.GetRefIndex();
50  if (hit.GetBotIndex() > -1)
51  out << " " << hit.GetBotIndex();
52  out << std::endl;
53 
54  return out;
55  }
56 
57  public:
59  PndHypHit();
60 
72  // PndHypHit(Int_t trackID, Int_t detID, TString detName,
73  // TVector3& pos, TVector3& dpos, Int_t index, Double_t charge, Int_t NPixelHits);
74 
75  PndHypHit(Int_t detID, TString detName, TVector3 &pos, TVector3 &dpos, Int_t index, Double_t charge, Int_t NDigiHits);
76 
77  // PndHypHit(PndHypHit& c);
79  virtual ~PndHypHit();
80 
83  // void SetTrackID(Int_t id){fTrackID = id;};
84  // new version const added
85  void SetDetName(TString name) { fDetName = name; };
86  void SetCharge(Double_t charge) { fCharge = charge; };
87  void SetNDigiHits(Int_t pixel) { fNDigiHits = pixel; };
88  void SetBotIndex(Int_t id) { fBotIndex = id; }
89 
90  TString GetDetName() const { return fDetName; }
91  // Int_t GetTrackID(){return fTrackID;};
92  Double_t GetCharge() const { return fCharge; };
93  Int_t GetNDigiHits() const { return fNDigiHits; }
94  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
95  Int_t GetBotIndex() const { return fBotIndex; }
96  Double_t GetEloss() const { return (fCharge * 3.61e-9); } // 3.6 eV/Electron in Silicon
97 
99  virtual void Print(const Option_t *opt = nullptr) const;
100  // new version
101 
102  private:
103  // Double_t GetD(Int_t i);
104 
105  TString fDetName; // Detector name
106  // Int_t fTrackID;
107  Double_t fCharge;
108  Int_t fNDigiHits;
109  Int_t fBotIndex;
110 
111  ClassDef(PndHypHit, 7);
112 };
113 
114 #endif
Double_t GetCharge() const
Definition: PndHypHit.h:92
virtual ~PndHypHit()
void SetNDigiHits(Int_t pixel)
Definition: PndHypHit.h:87
TString GetDetName() const
Definition: PndHypHit.h:90
void SetBotIndex(Int_t id)
Definition: PndHypHit.h:88
friend std::ostream & operator<<(std::ostream &out, const PndHypHit &hit)
Definition: PndHypHit.h:43
void SetCharge(Double_t charge)
Definition: PndHypHit.h:86
TVector3 GetPosition() const
Definition: PndHypHit.h:94
Double_t GetEloss() const
Definition: PndHypHit.h:96
Int_t GetNDigiHits() const
Definition: PndHypHit.h:93
virtual void Print(const Option_t *opt=nullptr) const
void SetDetName(TString name)
Definition: PndHypHit.h:85
Int_t GetBotIndex() const
Definition: PndHypHit.h:95