FairRoot/PandaRoot
PndEmcPoint.cxx
Go to the documentation of this file.
1 //
3 // PndEmcPoint
4 //
5 // Geant point for Emc detector
6 //
7 // Created 14/08/06 by S.Spataro
8 //
10 
11 #include "PndEmcPoint.h"
12 #include "PndDetectorList.h"
13 #include <iostream>
14 
15 using std::cout;
16 using std::endl;
17 
18 // ----- Default constructor -------------------------------------------
19 PndEmcPoint::PndEmcPoint() : FairMCPoint(),
20  nModule(-1), nRow(-1), nCrystal(-1), nCopy(-1), fEntering(kFALSE), fExiting(kFALSE)
21 {
22 }
23 // -------------------------------------------------------------------------
24 
25 
26 
27 // ----- Standard constructor ------------------------------------------
28 PndEmcPoint::PndEmcPoint(Int_t trackID, Int_t detID, Int_t evtID, TVector3 pos,
29  TVector3 mom, Double_t tof, Double_t length,
30  Double_t eLoss, Short_t mod, Short_t row, Short_t crys, Short_t copy, Bool_t entering, Bool_t exiting)
31  : FairMCPoint(trackID, detID, pos, mom, tof, length, eLoss, evtID),
32  nModule(mod), nRow(row), nCrystal(crys), nCopy(copy), fEntering(entering), fExiting(exiting)
33 {
34  SetLink(FairLink("MCTrack", trackID));
35 }
36 // -------------------------------------------------------------------------
37 
38 // ----- Copy constructor ------------------------------------------
40  :FairMCPoint(point.fTrackID, point.fDetectorID, TVector3(point.fX, point.fY, point.fZ), TVector3(point.fPx, point.fPy, point.fPz),
41  point.fTime, point.fLength, point.fELoss, point.fEventId),
42  nModule(point.nModule), nRow(point.nRow), nCrystal(point.nCrystal), nCopy(point.nCopy), fEntering(point.fEntering), fExiting(point.fExiting)
43 
44 {
45  SetLinks(point.GetLinks());
46 }
47 // -------------------------------------------------------------------------
48 
49 // ----- Destructor ----------------------------------------------------
51 // -------------------------------------------------------------------------
52 
53 // ----- Public method Print -------------------------------------------
54 void PndEmcPoint::Print(const Option_t* ) const {
55  cout << "-I- PndEmcPoint: EMC Point for track " << fTrackID
56  << " in detector " << fDetectorID << endl;
57  cout << " Position (" << fX << ", " << fY << ", " << fZ
58  << ") cm" << endl;
59  cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz
60  << ") GeV" << endl;
61  cout << " Time " << fTime << " ns, Length " << fLength
62  << " cm, Energy loss " << fELoss*1.0e06 << " keV" << endl;
63  if (GetEntering() == kTRUE){
64  cout << " Particle entering the crystal!" << std::endl;
65  }
66  if (GetExiting() == kFALSE){
67  cout << " Particle exiting the crystal!" << std::endl;
68  }
69 }
70 // -------------------------------------------------------------------------
71 
72 Short_t PndEmcPoint::GetXPad() const {
73  // Return the X pad value for clusterization
74 
75  // Barrel EMC
76  if (GetModule()==1 || GetModule()==2)
77  return (GetCrystal()+(GetCopy()-1)*10);
78 
79  // BwEndCap and forward EMC
80  if ((GetModule()==4) || (GetModule()==5))
81  {
82  if (GetCopy()==1) { return -GetRow()+1;}
83  if (GetCopy()==2) { return -GetRow()+1; }
84  if (GetCopy()==3) { return GetRow();}
85  if (GetCopy()==4) { return GetRow();}
86  }
87 
88  // FwEndCap
89  if (GetModule()==3)
90  return -(GetCrystal()-36); //the minus sign before the paranthesis is introduced since the geometry of FwEndCap gets rotated by 180 deg around the y-axis in PndEmc.cxx;
91  //this rotation was done in turn due to the way the geometry was defined in the geometry file of the forward end cap
92 
93  /*
94  if (GetModule()==3 && GetCrystal()==999 && GetRow()==999)
95  return GetCrystal();
96  */
97 
98  // Test EMC
99  if (GetModule()==6)
100  return GetRow();
101 
102  return -1000; // failure
103 }
104 
105 Short_t PndEmcPoint::GetYPad() const {
106  // Return the Y pad value for clusterization
107 
108  // Barrel EMC
109  if (GetModule()==1)
110  return (GetRow()+29);
111 
112  if (GetModule()==2)
113  return (-GetRow()+30);
114 
115  // BwEndCap and forward EMC
116  if ((GetModule()==4) || (GetModule()==5))
117  {
118  if (GetCopy()==1) { return GetCrystal(); }
119  if (GetCopy()==2) { return -GetCrystal()+1; }
120  if (GetCopy()==3) { return -GetCrystal()+1; }
121  if (GetCopy()==4) { return GetCrystal(); }
122  }
123 
124  // FwEndCap
125  if (GetModule()==3)
126  return GetRow()-37;
127 
128  /*
129  if (GetModule()==3 && GetCrystal()==999 && GetRow()==999)
130  return GetRow();
131  */
132 
133  // Test EMC
134  if (GetModule()==6)
135  return GetCrystal();
136 
137  return -1000; // failure
138 }
139 
140 // -------------------------------------------------------------------------
141 
142 
represents a mc hit in an emc crystal
Definition: PndEmcPoint.h:19
int row
Definition: anaLmdDigi.C:67
TVector3 pos
Short_t GetModule() const
Definition: PndEmcPoint.h:60
Short_t GetYPad() const
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t mom
Definition: plot_dirc.C:14
Double_t fZ
Definition: PndCaloDraw.cxx:34
Bool_t GetExiting() const
Definition: PndEmcPoint.h:65
Short_t GetRow() const
Definition: PndEmcPoint.h:61
Double_t
Short_t GetCrystal() const
Definition: PndEmcPoint.h:62
Short_t GetXPad() const
Definition: PndEmcPoint.cxx:72
Double_t fY
Definition: PndCaloDraw.cxx:34
Bool_t GetEntering() const
Definition: PndEmcPoint.h:64
ClassImp(PndAnaContFact)
Short_t GetCopy() const
Definition: PndEmcPoint.h:63
virtual void Print(const Option_t *opt) const
Definition: PndEmcPoint.cxx:54
virtual ~PndEmcPoint()
Definition: PndEmcPoint.cxx:50
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72