PandaRoot
PndEmcApdHit.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 // ----- PndEmcApdHit header file -----
15 // ----- Created 07/04/08 by S.Spataro -----
16 // -------------------------------------------------------------------------
17 
24 //#pragma once
25 #ifndef PNDEMCAPDHIT_H
26 #define PNDEMCAPDHIT_H
27 
28 #include "FairHit.h"
29 #include "TMath.h"
30 #include "TArrayI.h"
31 #include <vector>
32 
33 class PndEmcApdPoint;
34 
35 class PndEmcApdHit : public FairHit {
36  public:
38  PndEmcApdHit();
39 
40  PndEmcApdHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z);
41 
42  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]);
43 
44  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);
45 
47  PndEmcApdHit(const PndEmcApdHit &);
48 
50  virtual ~PndEmcApdHit();
51 
53  virtual void Print(const Option_t *opt = "") const;
54 
56  virtual void SetEnergy(Double32_t energy) { fEnergy = energy; };
57  virtual void SetTime(Double32_t time) { fTime = time; };
58 
60  virtual Double_t GetEnergy() const { return fEnergy; };
61  virtual Double_t GetTime() const { return fTime; };
62  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(); };
63  Float_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY, fX) * TMath::RadToDeg(); };
64  Short_t GetModule() const { return (fDetectorID / 100000000); };
65  Short_t GetRow() const { return ((fDetectorID / 1000000) % 100); };
66  Short_t GetCrystal() const { return (fDetectorID % 10000); };
67  Short_t GetCopy() const { return ((fDetectorID / 10000) % 100); };
68 
69  Short_t GetXPad() const;
70  Short_t GetYPad() const;
71 
72  Int_t GetNPoints() const { return fNPoints; };
73  Int_t GetMCIndex(Short_t ind) const { return fPointIndex[ind]; };
74 
75  // Possible memory issue (FIXME).
76  std::vector<PndEmcApdPoint *> &GetPointList() { return fPointList; }
77 
78  // TArrayI* GetPoindIndexes() { return fPointIndexes;};
79 
80  protected:
81  Double32_t fTime; // time
82  Double32_t fEnergy; // hit amplitude
83  Int_t fPointIndex[10]; // index of ther first 10 particles entering
84 
85  // TArrayI *fPointIndexes;
86 
87  std::vector<PndEmcApdPoint *> fPointList; // points contributed to hit
88  Int_t fNPoints; // number of ApdPoints
89 
90  ClassDef(PndEmcApdHit, 1)
91 };
92 
93 #endif // PNDEMCAPDHIT_H
virtual void SetTime(Double32_t time)
Definition: PndEmcApdHit.h:57
virtual void SetEnergy(Double32_t energy)
Definition: PndEmcApdHit.h:56
virtual Double_t GetEnergy() const
Definition: PndEmcApdHit.h:60
std::vector< PndEmcApdPoint * > fPointList
Definition: PndEmcApdHit.h:87
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:40
Float_t GetPhi() const
Definition: PndEmcApdHit.h:63
Int_t GetNPoints() const
Definition: PndEmcApdHit.h:72
Int_t GetMCIndex(Short_t ind) const
Definition: PndEmcApdHit.h:73
Short_t GetCopy() const
Definition: PndEmcApdHit.h:67
virtual Double_t GetTime() const
Definition: PndEmcApdHit.h:61
Int_t fPointIndex[10]
Definition: PndEmcApdHit.h:83
static T ATan2(const T &y, const T &x)
virtual void Print(const Option_t *opt="") const
Short_t GetRow() const
Definition: PndEmcApdHit.h:65
Short_t GetXPad() const
Double32_t fTime
Definition: PndEmcApdHit.h:81
Float_t GetTheta() const
Definition: PndEmcApdHit.h:62
Int_t fNPoints
Definition: PndEmcApdHit.h:88
Short_t GetYPad() const
Short_t GetModule() const
Definition: PndEmcApdHit.h:64
virtual ~PndEmcApdHit()
Double32_t fEnergy
Definition: PndEmcApdHit.h:82
std::vector< PndEmcApdPoint * > & GetPointList()
Definition: PndEmcApdHit.h:76
Short_t GetCrystal() const
Definition: PndEmcApdHit.h:66