PandaRoot
PndEmcApdHit.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndEmcApdHit header file -----
3 // ----- Created 07/04/08 by S.Spataro -----
4 // -------------------------------------------------------------------------
5 
12 //#pragma once
13 #ifndef PNDEMCAPDHIT_H
14 #define PNDEMCAPDHIT_H
15 
16 #include "FairHit.h"
17 #include "TMath.h"
18 #include "TArrayI.h"
19 #include <vector>
20 
21 class PndEmcApdPoint;
22 
23 class PndEmcApdHit : public FairHit {
24  public:
26  PndEmcApdHit();
27 
28  PndEmcApdHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z);
29 
30  PndEmcApdHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z, Int_t npoint, Int_t pointIndex[10]);
31 
32  PndEmcApdHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z, std::vector<PndEmcApdPoint *> PointList);
33 
35  PndEmcApdHit(const PndEmcApdHit &);
36 
38  virtual ~PndEmcApdHit();
39 
41  virtual void Print(const Option_t *opt = "") const;
42 
44  virtual void SetEnergy(Double32_t energy) { fEnergy = energy; };
45  virtual void SetTime(Double32_t time) { fTime = time; };
46 
48  virtual Double_t GetEnergy() const { return fEnergy; };
49  virtual Double_t GetTime() const { return fTime; };
50  Float_t GetTheta() const { return fX == 0.0 && fY == 0.0 && fZ == 0.0 ? 0.0 : TMath::ATan2(sqrt(fX * fX + fY * fY), fZ) * TMath::RadToDeg(); };
51  Float_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY, fX) * TMath::RadToDeg(); };
52  Short_t GetModule() const { return (fDetectorID / 100000000); };
53  Short_t GetRow() const { return ((fDetectorID / 1000000) % 100); };
54  Short_t GetCrystal() const { return (fDetectorID % 10000); };
55  Short_t GetCopy() const { return ((fDetectorID / 10000) % 100); };
56 
57  Short_t GetXPad() const;
58  Short_t GetYPad() const;
59 
60  Int_t GetNPoints() const { return fNPoints; };
61  Int_t GetMCIndex(Short_t ind) const { return fPointIndex[ind]; };
62 
63  // Possible memory issue (FIXME).
64  std::vector<PndEmcApdPoint *> &GetPointList() { return fPointList; }
65 
66  // TArrayI* GetPoindIndexes() { return fPointIndexes;};
67 
68  protected:
69  Double32_t fTime; // time
70  Double32_t fEnergy; // hit amplitude
71  Int_t fPointIndex[10]; // index of ther first 10 particles entering
72 
73  // TArrayI *fPointIndexes;
74 
75  std::vector<PndEmcApdPoint *> fPointList; // points contributed to hit
76  Int_t fNPoints; // number of ApdPoints
77 
78  ClassDef(PndEmcApdHit, 1)
79 };
80 
81 #endif // PNDEMCAPDHIT_H
virtual void SetTime(Double32_t time)
Definition: PndEmcApdHit.h:45
virtual void SetEnergy(Double32_t energy)
Definition: PndEmcApdHit.h:44
virtual Double_t GetEnergy() const
Definition: PndEmcApdHit.h:48
std::vector< PndEmcApdPoint * > fPointList
Definition: PndEmcApdHit.h:75
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
Float_t GetPhi() const
Definition: PndEmcApdHit.h:51
Int_t GetNPoints() const
Definition: PndEmcApdHit.h:60
Int_t GetMCIndex(Short_t ind) const
Definition: PndEmcApdHit.h:61
Short_t GetCopy() const
Definition: PndEmcApdHit.h:55
virtual Double_t GetTime() const
Definition: PndEmcApdHit.h:49
Int_t fPointIndex[10]
Definition: PndEmcApdHit.h:71
static T ATan2(const T &y, const T &x)
virtual void Print(const Option_t *opt="") const
Short_t GetRow() const
Definition: PndEmcApdHit.h:53
Short_t GetXPad() const
Double32_t fTime
Definition: PndEmcApdHit.h:69
Float_t GetTheta() const
Definition: PndEmcApdHit.h:50
Int_t fNPoints
Definition: PndEmcApdHit.h:76
Short_t GetYPad() const
Short_t GetModule() const
Definition: PndEmcApdHit.h:52
virtual ~PndEmcApdHit()
Double32_t fEnergy
Definition: PndEmcApdHit.h:70
std::vector< PndEmcApdPoint * > & GetPointList()
Definition: PndEmcApdHit.h:64
Short_t GetCrystal() const
Definition: PndEmcApdHit.h:54