PandaRoot
PndEmcPoint.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 // ----- PndEmcPoint header file -----
15 // ----- Created 14/08/06 by S.Spataro -----
16 // ------------------------------------------------------------------------
17 //#pragma once
18 #ifndef PNDEMCPOINT_H
19 #define PNDEMCPOINT_H
20 
21 #include "TObject.h"
22 #include "TVector3.h"
23 #include "TLorentzVector.h"
24 #include "FairMCPoint.h"
25 #include "PndDetectorList.h"
26 
31 class PndEmcPoint : public FairMCPoint {
32 
33  public:
35  PndEmcPoint();
36 
51  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,
52  Short_t copy, Bool_t entering = kFALSE, Bool_t exiting = kFALSE, int clusteID = -1);
53 
55  PndEmcPoint(const PndEmcPoint &point);
56 
58  virtual ~PndEmcPoint();
59 
61  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(); };
62  Double_t GetPhi() const { return fX == 0.0 && fY == 0.0 ? 0.0 : TMath::ATan2(fY, fX) * TMath::RadToDeg(); };
63  Short_t GetXPad() const;
64  Short_t GetYPad() const;
65 
66  Short_t GetModule() const { return (fDetectorID / 100000000); };
67  Short_t GetRow() const { return ((fDetectorID / 1000000) % 100); };
68  Short_t GetCrystal() const { return (fDetectorID % 10000); };
69  Short_t GetCopy() const { return ((fDetectorID / 10000) % 100); };
70  Bool_t GetEntering() const { return fEntering; }
71  Bool_t GetExiting() const { return fExiting; }
72  Int_t GetClusterID() const { return fClusterID; }
75  void SetModule(Short_t mod) { nModule = mod; };
76  void SetRow(Short_t row) { nRow = row; };
77  void SetCrystal(Short_t crys) { nCrystal = crys; };
78  void SetTrackID(Int_t trackId)
79  {
80  FairMCPoint::SetTrackID(trackId);
81  SetLink(FairLink("MCTrack", trackId));
82  } // 14.09.10 Stefano FIX
83 
84  void SetClusterID(int clusterID) { fClusterID = clusterID; }
85 
87  virtual void Print(const Option_t *opt = "") const;
88 
89  protected:
90  Short_t nModule; // Module number
91  Short_t nRow; // Row number
92  Short_t nCrystal; // Crystal number
93  Short_t nCopy; // Copy number
94  Bool_t fEntering; //< Is particle entering into crystal
95  Bool_t fExiting; //< Is particle exiting the crystal
96  Int_t fClusterID; //< MCParticle which created the cluster
97 
98  ClassDef(PndEmcPoint, 2)
99 };
100 
101 #endif
represents a mc hit in an emc crystal
Definition: PndEmcPoint.h:31
void SetClusterID(int clusterID)
Definition: PndEmcPoint.h:84
Double_t GetTheta() const
Definition: PndEmcPoint.h:61
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:40
Int_t fClusterID
Definition: PndEmcPoint.h:96
Short_t nRow
Definition: PndEmcPoint.h:91
Short_t nModule
Definition: PndEmcPoint.h:90
Short_t GetYPad() const
Bool_t GetEntering() const
Definition: PndEmcPoint.h:70
Short_t nCopy
Definition: PndEmcPoint.h:93
Double_t GetPhi() const
Definition: PndEmcPoint.h:62
Bool_t GetExiting() const
Definition: PndEmcPoint.h:71
Short_t GetModule() const
Definition: PndEmcPoint.h:66
Short_t GetCopy() const
Definition: PndEmcPoint.h:69
static T ATan2(const T &y, const T &x)
void SetModule(Short_t mod)
Definition: PndEmcPoint.h:75
Bool_t fEntering
Definition: PndEmcPoint.h:94
void SetRow(Short_t row)
Definition: PndEmcPoint.h:76
Int_t GetClusterID() const
Definition: PndEmcPoint.h:72
Short_t GetCrystal() const
Definition: PndEmcPoint.h:68
Short_t GetXPad() const
void SetCrystal(Short_t crys)
Definition: PndEmcPoint.h:77
Bool_t fExiting
Definition: PndEmcPoint.h:95
Short_t nCrystal
Definition: PndEmcPoint.h:92
virtual void Print(const Option_t *opt="") const
void SetTrackID(Int_t trackId)
Definition: PndEmcPoint.h:78
virtual ~PndEmcPoint()
Short_t GetRow() const
Definition: PndEmcPoint.h:67