FairRoot/PandaRoot
PndEmcDigi.h
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id:$
4 //
5 // Description:
6 // EMC Digi.
7 //
8 // Software developed for the BaBar Detector at the SLAC B-Factory.
9 // Adapted for the PANDA experiment at GSI
10 //
11 // Author List:
12 // Xiaorong Shi Lawrence Livermore National Lab
13 // Steve Playfer University of Edinburgh
14 // Stephen Gowdy University of Edinburgh
15 // Dima Melnichuk - adaption for PANDA
16 //
17 // Copyright Information:
18 // Copyright (C) 1994 Lawrence Livermore National Lab
19 //
21 //#pragma once
22 #ifndef PNDEMCDIGI_H
23 #define PNDEMCDIGI_H
24 
25 #include "TObject.h"
26 #include "PndEmcTwoCoordIndex.h"
27 #include "PndEmcHit.h"
28 #include "FairTimeStamp.h"
29 #include "TVector3.h"
30 #include "TClonesArray.h"
31 
32 class TVector3;
33 class PndEmcXtal;
34 class PndEmcSharedDigi;
35 
40 class PndEmcDigi : public FairTimeStamp
41 {
42 
44  out << "PndEmc Digi in crystal: " << digi.GetDetectorId()
45  << " energy: " << digi.GetEnergy()
46  << " timestamp: "<<digi.GetTimeStamp();
47  return out;
48  }
49 
50  public:
51  //for time based simulation
52  static TClonesArray* fDigiArrayTBD;
53  static void InitDigiArrayTBD();
54 
56  PndEmcDigi();
57 
58  PndEmcDigi(Int_t trackid, Int_t id, Float_t energy, Float_t time, Int_t hitIndex=-1);
59  PndEmcDigi(const PndEmcDigi&);
60 
62  virtual ~PndEmcDigi();
63  // Operators
64 
65  virtual bool operator==(const PndEmcDigi & otherDigi) const;
66  virtual bool operator!=(const PndEmcDigi & otherDigi) const;
67  virtual bool operator<( const PndEmcDigi & otherDigi) const;
68 
69  virtual bool equal(FairTimeStamp* data){
70  PndEmcDigi* myDigi = dynamic_cast <PndEmcDigi*> (data);
71  if (myDigi != 0){
72  if (fDetectorId == myDigi->GetDetectorId())
73  return true;
74  }
75  return false;
76  }
77 
79  virtual void Print(const Option_t* opt ="") const;
80 
82 
84  void SetEnergy(Double32_t energy) { fEnergy = energy ;};
85  void SetTrackId(Int_t id) { fTrackId = id ;};
86  void SetDetectorId(Int_t id);
87 
88  virtual void AbsorbEnergy(PndEmcDigi& otherDigi);
89 
90  //check if 2 digis are neigbour or not (prelim for testing)
91  bool isNeighbour(const PndEmcDigi* theDigi) const;
92 
93 
95  virtual Double_t GetEnergy() const;
96  Int_t GetTrackId() const { return fTrackId ;};
97  Int_t GetDetectorId() const { return fDetectorId ;};
98  PndEmcTwoCoordIndex* GetTCI() const;
99  Int_t GetThetaInt() const {return fThetaInd;};
100  Int_t GetPhiInt() const {return fPhiInd;};
101  Double_t GetTheta() const {return fTheta;};
102  Double_t GetPhi() const {return fPhi;};
103  Short_t GetModule() const { return (fDetectorId/100000000);};
104  Short_t GetRow() const { return ((fDetectorId/1000000)%100);};
105  Short_t GetCrystal() const { return (fDetectorId%10000);};
106  Short_t GetCopy() const { return ((fDetectorId/10000)%100);};
107  Short_t GetXPad() const;
108  Short_t GetYPad() const;
109 
110  Int_t GetHitIndex() {return fHitIndex;}
111  const TVector3 &where() const {return fWhere;};
112 
114  virtual const PndEmcSharedDigi* dynamic_cast_PndEmcSharedDigi() const;
115 
119 
120 
121  Int_t fEvtNo;
122 
123  protected:
124  Double_t fEnergy; // digi amplitude
125  Int_t fTrackId;
126  Int_t fDetectorId;
127  Int_t fHitIndex; // Index of hit which is converted to digi
128  TVector3 fWhere;
129  Int_t fThetaInd;
130  Int_t fPhiInd;
133 
134 
135  private:
136 
137  friend class PndEmcWaveformToDigi;
141  friend class PndEmcFWEndcapDigi;
143  friend class PndEmcMakeDigi;
144  friend class PndEmcCorrBump;
145 
147  double positionDepthPWO = 0.,
148  double positionDepthShahslyk = 0.,
149  double rescaleFactor = 1.);
150 
151  static TVector3 surfacePosition( const PndEmcXtal* xtal );
152  static TVector3 depthPosition( const PndEmcXtal* xtal );
153 
154  static TVector3 ( *&algPointer() ) ( const PndEmcXtal* );
155 
156  static double fRescaleFactor;
157  static double fPositionDepthPWO;
158  static double fPositionDepthShashlyk;
159 
160 
161  ClassDef(PndEmcDigi,5);
162 };
163 
164 #endif //PndEmcDigi_H
currently not used, not in CMakeLists.txt
TClonesArray * digi
static void selectDigiPositionMethod(PositionMethod, double positionDepthPWO=0., double positionDepthShahslyk=0., double rescaleFactor=1.)
Definition: PndEmcDigi.cxx:153
static TClonesArray * fDigiArrayTBD
Definition: PndEmcDigi.h:52
virtual Double_t GetEnergy() const
Definition: PndEmcDigi.cxx:296
represents the reconstructed hit of one emc crystal
Definition: PndEmcDigi.h:40
virtual PndEmcSharedDigi * dynamic_cast_PndEmcSharedDigi()
Definition: PndEmcDigi.cxx:346
virtual bool operator<(const PndEmcDigi &otherDigi) const
Definition: PndEmcDigi.cxx:322
Int_t GetThetaInt() const
Definition: PndEmcDigi.h:99
Int_t GetDetectorId() const
Definition: PndEmcDigi.h:97
Module to take the hit list for the calorimeter and make ADC waveforms from them. ...
static double fPositionDepthPWO
Definition: PndEmcDigi.h:157
ClassDef(PndEmcDigi, 5)
static double fRescaleFactor
Definition: PndEmcDigi.h:156
Int_t fTrackId
Definition: PndEmcDigi.h:125
void SetTrackId(Int_t id)
Definition: PndEmcDigi.h:85
Short_t GetCrystal() const
Definition: PndEmcDigi.h:105
represents coordinates of one crystal
Definition: PndEmcXtal.h:36
static Double_t getPositionDepthShashlyk()
Definition: PndEmcDigi.h:118
Int_t GetTrackId() const
Definition: PndEmcDigi.h:96
stores crystal index coordinates (x,y) or (theta,phi)
static TVector3 depthPosition(const PndEmcXtal *xtal)
Definition: PndEmcDigi.cxx:134
Double_t fEnergy
Definition: PndEmcDigi.h:124
static void InitDigiArrayTBD()
Definition: PndEmcDigi.cxx:89
Short_t GetCopy() const
Definition: PndEmcDigi.h:106
TVector3 fWhere
Definition: PndEmcDigi.h:128
Short_t GetModule() const
Definition: PndEmcDigi.h:103
friend class PndEmcWaveformToDigiFPGA
Definition: PndEmcDigi.h:138
Double_t GetTheta() const
Definition: PndEmcDigi.h:101
Task to create digis from waveforms.
static Double_t getRescaleFactor()
Definition: PndEmcDigi.h:116
void SetEnergy(Double32_t energy)
Definition: PndEmcDigi.h:84
Int_t fHitIndex
Definition: PndEmcDigi.h:127
Double_t
used to share PndEmcDigis between bumps
Double_t fTheta
Definition: PndEmcDigi.h:131
static Double_t getPositionDepthPWO()
Definition: PndEmcDigi.h:117
virtual bool equal(FairTimeStamp *data)
Definition: PndEmcDigi.h:69
Int_t fPhiInd
Definition: PndEmcDigi.h:130
TFile * out
Definition: reco_muo.C:20
void SetDetectorId(Int_t id)
Definition: PndEmcDigi.cxx:95
static double fPositionDepthShashlyk
Definition: PndEmcDigi.h:158
friend std::ostream & operator<<(std::ostream &out, PndEmcDigi &digi)
Definition: PndEmcDigi.h:43
Int_t fEvtNo
Definition: PndEmcDigi.h:118
Int_t GetHitIndex()
Definition: PndEmcDigi.h:110
Double_t GetPhi() const
Definition: PndEmcDigi.h:102
Short_t GetYPad() const
Definition: PndEmcDigi.cxx:261
virtual bool operator==(const PndEmcDigi &otherDigi) const
Definition: PndEmcDigi.cxx:303
Short_t GetRow() const
Definition: PndEmcDigi.h:104
Int_t fDetectorId
Definition: PndEmcDigi.h:126
static TVector3 surfacePosition(const PndEmcXtal *xtal)
Definition: PndEmcDigi.cxx:128
const TVector3 & where() const
Definition: PndEmcDigi.h:111
virtual bool operator!=(const PndEmcDigi &otherDigi) const
Definition: PndEmcDigi.cxx:317
static TVector3(*&)(const PndEmcXtal *) algPointer()
Definition: PndEmcDigi.h:154
Takes list of PndEmcWaveform and creates PndEmcDigi.
virtual void Print(const Option_t *opt="") const
Definition: PndEmcDigi.cxx:337
Short_t GetXPad() const
Definition: PndEmcDigi.cxx:223
Int_t fThetaInd
Definition: PndEmcDigi.h:129
bool isNeighbour(const PndEmcDigi *theDigi) const
Definition: PndEmcDigi.cxx:201
Double_t fPhi
Definition: PndEmcDigi.h:132
virtual ~PndEmcDigi()
Definition: PndEmcDigi.cxx:47
virtual void AbsorbEnergy(PndEmcDigi &otherDigi)
Definition: PndEmcDigi.cxx:118
Task to create PndEmcDigi from PndEmcHit.
PndEmcTwoCoordIndex * GetTCI() const
Definition: PndEmcDigi.cxx:216
Module to take the hit list for the calorimeter and make ADC waveforms from them. ...
Double_t energy
Definition: plot_dirc.C:15
Int_t GetPhiInt() const
Definition: PndEmcDigi.h:100