FairRoot/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 {
25  public:
26 
27 
29  PndEmcApdHit();
30 
31  PndEmcApdHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z);
32 
33  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]);
34 
35  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);
36 
38  PndEmcApdHit(const PndEmcApdHit &);
39 
41  virtual ~PndEmcApdHit();
42 
44  virtual void Print(const Option_t* opt ="") const;
45 
47  virtual void SetEnergy(Double32_t energy) { fEnergy = energy ;};
48  virtual void SetTime(Double32_t time) { fTime = time ;};
49 
51  virtual Double_t GetEnergy() const { return fEnergy ;};
52  virtual Double_t GetTime() const { return fTime ;};
53  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() ;};
54  Float_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY,fX)*TMath::RadToDeg() ;};
55  Short_t GetModule() const { return (fDetectorID/100000000) ;};
56  Short_t GetRow() const { return ((fDetectorID/1000000)%100);};
57  Short_t GetCrystal() const { return (fDetectorID%10000) ;};
58  Short_t GetCopy() const { return ((fDetectorID/10000)%100) ;};
59 
60  Short_t GetXPad() const;
61  Short_t GetYPad() const;
62 
63  Int_t GetNPoints() const { return fNPoints;};
64  Int_t GetMCIndex(Short_t ind) const { return fPointIndex[ind];};
65 
66  // Possible memory issue (FIXME).
67  std::vector<PndEmcApdPoint*>& GetPointList() {return fPointList;}
68 
69  //TArrayI* GetPoindIndexes() { return fPointIndexes;};
70 
71  protected:
72  Double32_t fTime; // time
73  Double32_t fEnergy; // hit amplitude
74  Int_t fPointIndex[10]; // index of ther first 10 particles entering
75 
76  //TArrayI *fPointIndexes;
77 
78  std::vector<PndEmcApdPoint*> fPointList; // points contributed to hit
79  Int_t fNPoints; // number of ApdPoints
80 
81  ClassDef(PndEmcApdHit,1)
82 };
83 
84 #endif //PNDEMCAPDHIT_H
Short_t GetCopy() const
Definition: PndEmcApdHit.h:58
virtual void SetTime(Double32_t time)
Definition: PndEmcApdHit.h:48
virtual void SetEnergy(Double32_t energy)
Definition: PndEmcApdHit.h:47
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
virtual ~PndEmcApdHit()
virtual Double_t GetTime() const
Definition: PndEmcApdHit.h:52
Double_t fX
Definition: PndCaloDraw.cxx:34
Int_t GetMCIndex(Short_t ind) const
Definition: PndEmcApdHit.h:64
virtual void Print(const Option_t *opt="") const
Short_t GetXPad() const
Short_t GetRow() const
Definition: PndEmcApdHit.h:56
double Y
Definition: anaLmdDigi.C:68
Double_t fZ
Definition: PndCaloDraw.cxx:34
Float_t GetPhi() const
Definition: PndEmcApdHit.h:54
Float_t GetTheta() const
Definition: PndEmcApdHit.h:53
virtual Double_t GetEnergy() const
Definition: PndEmcApdHit.h:51
int npoint
Double_t
Int_t fPointIndex[10]
Definition: PndEmcApdHit.h:74
static T ATan2(const T &y, const T &x)
Int_t GetNPoints() const
Definition: PndEmcApdHit.h:63
Double32_t fTime
Definition: PndEmcApdHit.h:72
double X
Definition: anaLmdDigi.C:68
Short_t GetCrystal() const
Definition: PndEmcApdHit.h:57
Int_t fNPoints
Definition: PndEmcApdHit.h:79
Double_t fY
Definition: PndCaloDraw.cxx:34
Short_t GetYPad() const
Double32_t fEnergy
Definition: PndEmcApdHit.h:73
double Z
Definition: anaLmdDigi.C:68
Short_t GetModule() const
Definition: PndEmcApdHit.h:55
std::vector< PndEmcApdPoint * > fPointList
Definition: PndEmcApdHit.h:78
std::vector< PndEmcApdPoint * > & GetPointList()
Definition: PndEmcApdHit.h:67
Double_t energy
Definition: plot_dirc.C:15