FairRoot/PandaRoot
PndEmcApdPoint.cxx
Go to the documentation of this file.
1 //
3 // PndEmcApdPoint
4 //
5 // Geant point for EmcApd detector
6 //
7 // Created 07/04/08 by S.Spataro
8 //
10 
11 #include "PndEmcApdPoint.h"
12 
13 #include <iostream>
14 
15 using std::cout;
16 using std::endl;
17 
18 // ----- Default constructor -------------------------------------------
20  nModule(-1), nRow(-1), nCrystal(-1), nCopy(-1), fFlag(-10)
21 {
22 }
23 // -------------------------------------------------------------------------
24 
25 
26 
27 // ----- Standard constructor ------------------------------------------
28 PndEmcApdPoint::PndEmcApdPoint(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, Short_t flag)
31  : FairMCPoint(trackID, detID, pos, mom, tof, length, eLoss, evtID),
32  nModule(mod), nRow(row), nCrystal(crys), nCopy(copy), fFlag(flag)
33 {
34  SetLink(FairLink("MCTrack", trackID));
35 }
36 
37 // ----- Copy constructor ------------------------------------------
39  :FairMCPoint(point.fTrackID, point.fDetectorID, TVector3(point.fX, point.fY, point.fZ), TVector3(point.fPx, point.fPy, point.fPz),
40  point.fTime, point.fLength, point.fELoss),
41  nModule(point.nModule), nRow(point.nRow), nCrystal(point.nCrystal), nCopy(point.nCopy), fFlag(point.fFlag)
42 
43 {
44  SetLinks(point.GetLinks());
45 }
46 
47 // ----- Destructor ----------------------------------------------------
49 // -------------------------------------------------------------------------
50 
51 // ----- Public method Print -------------------------------------------
52 void PndEmcApdPoint::Print(const Option_t* ) const {
53  cout << "-I- PndEmcApdPoint: EMCAPD Point for track " << fTrackID
54  << " in detector " << fDetectorID << endl;
55  cout << " Position (" << fX << ", " << fY << ", " << fZ
56  << ") cm" << endl;
57  cout << " Momentum (" << fPx << ", " << fPy << ", " << fPz
58  << ") GeV" << endl;
59  cout << " Time " << fTime << " ns, Length " << fLength
60  << " cm, Energy loss " << fELoss*1.0e06 << " keV" << endl;
61 }
62 // -------------------------------------------------------------------------
63 
64 Short_t PndEmcApdPoint::GetXPad() const {
65  // Return the X pad value for clusterization
66 
67  // Barrel EMC
68  if (GetModule()==1 || GetModule()==2)
69  return (GetCrystal()+(GetCopy()-1)*10);
70 
71  // BwEndCap and forward EMC
72  if ((GetModule()==4) || (GetModule()==5))
73  {
74  if (GetCopy()==1) { return -GetRow()+1;}
75  if (GetCopy()==2) { return -GetRow()+1; }
76  if (GetCopy()==3) { return GetRow();}
77  if (GetCopy()==4) { return GetRow();}
78  }
79 
80  // FwEndCap
81  if (GetModule()==3)
82  return -(GetCrystal()-36);
83 
84  /*
85  if (GetModule()==3 && GetCrystal()==999 && GetRow()==999)
86  return GetCrystal();
87  */
88 
89  // Test EMC
90  if (GetModule()==6)
91  return GetRow();
92 
93  return -1000; // failure
94 }
95 
96 Short_t PndEmcApdPoint::GetYPad() const {
97  // Return the Y pad value for clusterization
98 
99  // Barrel EMC
100  if (GetModule()==1)
101  return (GetRow()+29);
102 
103  if (GetModule()==2)
104  return (-GetRow()+30);
105 
106  // BwEndCap and forward EMC
107  if ((GetModule()==4) || (GetModule()==5))
108  {
109  if (GetCopy()==1) { return GetCrystal(); }
110  if (GetCopy()==2) { return -GetCrystal()+1; }
111  if (GetCopy()==3) { return -GetCrystal()+1; }
112  if (GetCopy()==4) { return GetCrystal(); }
113  }
114 
115  // FwEndCap
116  if (GetModule()==3)
117  return GetRow()-37;
118 
119  /*
120  if (GetModule()==3 && GetCrystal()==999 && GetRow()==999)
121  return GetRow();
122  */
123 
124  // Test EMC
125  if (GetModule()==6)
126  return GetCrystal();
127 
128  return -1000; // failure
129 }
130 
131 // -------------------------------------------------------------------------
132 
133 
int row
Definition: anaLmdDigi.C:67
TVector3 pos
Short_t GetRow() const
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t mom
Definition: plot_dirc.C:14
Double_t fZ
Definition: PndCaloDraw.cxx:34
Double_t
Short_t GetCrystal() const
Short_t GetCopy() const
Short_t GetYPad() const
virtual ~PndEmcApdPoint()
Double_t fY
Definition: PndCaloDraw.cxx:34
virtual void Print(const Option_t *opt) const
ClassImp(PndAnaContFact)
Short_t GetXPad() const
Short_t GetModule() const
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72