PandaRoot
PndEmcPoint.h
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // ----- PndEmcPoint header file -----
3 // ----- Created 14/08/06 by S.Spataro -----
4 // ------------------------------------------------------------------------
5 //#pragma once
6 #ifndef PNDEMCPOINT_H
7 #define PNDEMCPOINT_H
8 
9 #include "TObject.h"
10 #include "TVector3.h"
11 #include "TLorentzVector.h"
12 #include "FairMCPoint.h"
13 #include "PndDetectorList.h"
14 
19 class PndEmcPoint : public FairMCPoint {
20 
21  public:
23  PndEmcPoint();
24 
39  PndEmcPoint(Int_t trackID, Int_t detID, Int_t evtID, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss, Short_t mod, Short_t row, Short_t crys,
40  Short_t copy, Bool_t entering = kFALSE, Bool_t exiting = kFALSE, int clusteID = -1);
41 
43  PndEmcPoint(const PndEmcPoint &point);
44 
46  virtual ~PndEmcPoint();
47 
49  Double_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(); };
50  Double_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY, fX) * TMath::RadToDeg(); };
51  Short_t GetXPad() const;
52  Short_t GetYPad() const;
53 
54  Short_t GetModule() const { return (fDetectorID / 100000000); };
55  Short_t GetRow() const { return ((fDetectorID / 1000000) % 100); };
56  Short_t GetCrystal() const { return (fDetectorID % 10000); };
57  Short_t GetCopy() const { return ((fDetectorID / 10000) % 100); };
58  Bool_t GetEntering() const { return fEntering; }
59  Bool_t GetExiting() const { return fExiting; }
60  Int_t GetClusterID() const { return fClusterID; }
63  void SetModule(Short_t mod) { nModule = mod; };
64  void SetRow(Short_t row) { nRow = row; };
65  void SetCrystal(Short_t crys) { nCrystal = crys; };
66  void SetTrackID(Int_t trackId)
67  {
68  FairMCPoint::SetTrackID(trackId);
69  SetLink(FairLink("MCTrack", trackId));
70  } // 14.09.10 Stefano FIX
71 
72  void SetClusterID(int clusterID) { fClusterID = clusterID; }
73 
75  virtual void Print(const Option_t *opt = "") const;
76 
77  protected:
78  Short_t nModule; // Module number
79  Short_t nRow; // Row number
80  Short_t nCrystal; // Crystal number
81  Short_t nCopy; // Copy number
82  Bool_t fEntering; //< Is particle entering into crystal
83  Bool_t fExiting; //< Is particle exiting the crystal
84  Int_t fClusterID; //< MCParticle which created the cluster
85 
86  ClassDef(PndEmcPoint, 2)
87 };
88 
89 #endif
represents a mc hit in an emc crystal
Definition: PndEmcPoint.h:19
void SetClusterID(int clusterID)
Definition: PndEmcPoint.h:72
Double_t GetTheta() const
Definition: PndEmcPoint.h:49
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
Int_t fClusterID
Definition: PndEmcPoint.h:84
Short_t nRow
Definition: PndEmcPoint.h:79
Short_t nModule
Definition: PndEmcPoint.h:78
Short_t GetYPad() const
Bool_t GetEntering() const
Definition: PndEmcPoint.h:58
Short_t nCopy
Definition: PndEmcPoint.h:81
Double_t GetPhi() const
Definition: PndEmcPoint.h:50
Bool_t GetExiting() const
Definition: PndEmcPoint.h:59
Short_t GetModule() const
Definition: PndEmcPoint.h:54
Short_t GetCopy() const
Definition: PndEmcPoint.h:57
static T ATan2(const T &y, const T &x)
void SetModule(Short_t mod)
Definition: PndEmcPoint.h:63
Bool_t fEntering
Definition: PndEmcPoint.h:82
void SetRow(Short_t row)
Definition: PndEmcPoint.h:64
Int_t GetClusterID() const
Definition: PndEmcPoint.h:60
Short_t GetCrystal() const
Definition: PndEmcPoint.h:56
Short_t GetXPad() const
void SetCrystal(Short_t crys)
Definition: PndEmcPoint.h:65
Bool_t fExiting
Definition: PndEmcPoint.h:83
Short_t nCrystal
Definition: PndEmcPoint.h:80
virtual void Print(const Option_t *opt="") const
void SetTrackID(Int_t trackId)
Definition: PndEmcPoint.h:66
virtual ~PndEmcPoint()
Short_t GetRow() const
Definition: PndEmcPoint.h:55