PandaRoot
PndEmcHit.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndEmcHit header file -----
3 // ----- Created 14/08/06 by S.Spataro -----
4 // -------------------------------------------------------------------------
5 
12 //#pragma once
13 #ifndef PNDEMCHIT_H
14 #define PNDEMCHIT_H
15 
16 #include "FairHit.h"
17 #include "TMath.h"
18 #include <vector>
19 #include <map>
20 #include <algorithm>
21 
22 class PndEmcPoint;
23 
28 class PndEmcHit : public FairHit {
29  public:
31  PndEmcHit();
32 
33  PndEmcHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z);
34 
35  PndEmcHit(Int_t trackid, Int_t id, Float_t energy, Float_t time, Float_t X, Float_t Y, Float_t Z, std::vector<Int_t> McTruth, FairMultiLinkedData enteringTrack,
36  FairMultiLinkedData exitingTrack, std::set<Int_t> clusterList);
37 
39  PndEmcHit(const PndEmcHit &);
40 
42  virtual ~PndEmcHit();
43 
45  void Print(const Option_t *opt = "") const;
46 
48  void SetEnergy(Double32_t energy) { fEnergy = energy; };
49  void SetTime(Double32_t time) { fTimeStamp = time * 1E9; };
50  void SetDepositedEnergyMap(const std::map<Int_t, Double_t> &depEnergy) { fDepositedEnergy = depEnergy; }
51  void AddDepositedEnergy(Int_t mcId, Double_t depEnergy) { fDepositedEnergy[mcId] += depEnergy; }
52 
54  Double_t GetEnergy() const { return fEnergy; };
55  Double_t GetTime() const { return fTimeStamp / 1E9; };
56  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(); };
57  Float_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY, fX) * TMath::RadToDeg(); };
58  Short_t GetModule() const { return (fDetectorID / 100000000); };
59  Short_t GetRow() const { return ((fDetectorID / 1000000) % 100); };
60  Short_t GetCrystal() const { return (fDetectorID % 10000); };
61  Short_t GetCopy() const { return ((fDetectorID / 10000) % 100); };
62 
63  Short_t GetXPad() const;
64  Short_t GetYPad() const;
65  FairMultiLinkedData GetTrackEntering() const { return fTrackEntering; }
66  FairMultiLinkedData GetTrackExiting() const { return fTrackExiting; }
67 
68  const std::vector<Int_t> &GetMcList() { return fMcList; }
69  std::set<Int_t> GetClusterList() { return fClusterList; }
70 
71  void AddClusterID(int clusterId) { fClusterList.insert(clusterId); }
72 
73  std::map<Int_t, Double_t> GetDepositedEnergyMap() const { return fDepositedEnergy; };
74 
75  protected:
76  Double32_t fEnergy; // hit amplitude
77 
78  std::vector<Int_t> fMcList; // Mc TrackIndex contributed to hit
79  FairMultiLinkedData fTrackEntering; // Links to tracks entering the crystal
80  FairMultiLinkedData fTrackExiting; // Links to tracks exiting the crystal
81  std::set<Int_t> fClusterList; // To which cluster belongs the hit based on MC information (could be more than one)
82  std::map<Int_t, Double_t> fDepositedEnergy; // MC deposited energy per (primary) MC particle
83 
84  ClassDef(PndEmcHit, 4)
85 };
86 
87 #endif // PNDEMCHIT_H
represents a mc hit in an emc crystal
Definition: PndEmcPoint.h:19
Short_t GetYPad() const
void SetTime(Double32_t time)
Definition: PndEmcHit.h:49
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
FairMultiLinkedData fTrackExiting
Definition: PndEmcHit.h:80
Short_t GetModule() const
Definition: PndEmcHit.h:58
FairMultiLinkedData GetTrackExiting() const
Definition: PndEmcHit.h:66
std::set< Int_t > GetClusterList()
Definition: PndEmcHit.h:69
std::set< Int_t > fClusterList
Definition: PndEmcHit.h:81
FairMultiLinkedData GetTrackEntering() const
Definition: PndEmcHit.h:65
void SetEnergy(Double32_t energy)
Definition: PndEmcHit.h:48
Double_t GetTime() const
Definition: PndEmcHit.h:55
const std::vector< Int_t > & GetMcList()
Definition: PndEmcHit.h:68
virtual ~PndEmcHit()
static T ATan2(const T &y, const T &x)
Short_t GetRow() const
Definition: PndEmcHit.h:59
Float_t GetTheta() const
Definition: PndEmcHit.h:56
void AddDepositedEnergy(Int_t mcId, Double_t depEnergy)
Definition: PndEmcHit.h:51
Short_t GetCrystal() const
Definition: PndEmcHit.h:60
Short_t GetCopy() const
Definition: PndEmcHit.h:61
void AddClusterID(int clusterId)
Definition: PndEmcHit.h:71
std::map< Int_t, Double_t > fDepositedEnergy
Definition: PndEmcHit.h:82
std::vector< Int_t > fMcList
Definition: PndEmcHit.h:78
Short_t GetXPad() const
std::map< Int_t, Double_t > GetDepositedEnergyMap() const
Definition: PndEmcHit.h:73
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:28
Double_t GetEnergy() const
Definition: PndEmcHit.h:54
FairMultiLinkedData fTrackEntering
Definition: PndEmcHit.h:79
void Print(const Option_t *opt="") const
Float_t GetPhi() const
Definition: PndEmcHit.h:57
Double32_t fEnergy
Definition: PndEmcHit.h:73
void SetDepositedEnergyMap(const std::map< Int_t, Double_t > &depEnergy)
Definition: PndEmcHit.h:50