FairRoot/PandaRoot
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PndEmcSharedDigi Class Reference

used to share PndEmcDigis between bumps More...

#include <PndEmcSharedDigi.h>

Inheritance diagram for PndEmcSharedDigi:
PndEmcDigi

Public Types

enum  PositionMethod { surface, depth }
 

Public Member Functions

 PndEmcSharedDigi (const PndEmcDigi &theDigi, const Double_t weight)
 
 PndEmcSharedDigi (const PndEmcSharedDigi &theDigi)
 
 PndEmcSharedDigi ()
 
virtual ~PndEmcSharedDigi ()
 
virtual PndEmcDigiclone () const
 
virtual void weight (Double_t newWeight)
 
virtual Double_t GetEnergy () const
 
virtual Double_t weight () const
 
virtual PndEmcSharedDigidynamic_cast_PndEmcSharedDigi ()
 
virtual const PndEmcSharedDigidynamic_cast_PndEmcSharedDigi () const
 
virtual bool operator== (const PndEmcDigi &otherDigi) const
 
virtual bool operator!= (const PndEmcDigi &otherDigi) const
 
virtual bool operator< (const PndEmcDigi &otherDigi) const
 
virtual bool equal (FairTimeStamp *data)
 
virtual void Print (const Option_t *opt="") const
 
void SetEnergy (Double32_t energy)
 
void SetTrackId (Int_t id)
 
void SetDetectorId (Int_t id)
 
virtual void AbsorbEnergy (PndEmcDigi &otherDigi)
 
bool isNeighbour (const PndEmcDigi *theDigi) const
 
Int_t GetTrackId () const
 
Int_t GetDetectorId () const
 
PndEmcTwoCoordIndexGetTCI () const
 
Int_t GetThetaInt () const
 
Int_t GetPhiInt () const
 
Double_t GetTheta () const
 
Double_t GetPhi () const
 
Short_t GetModule () const
 
Short_t GetRow () const
 
Short_t GetCrystal () const
 
Short_t GetCopy () const
 
Short_t GetXPad () const
 
Short_t GetYPad () const
 
Int_t GetHitIndex ()
 
const TVector3 & where () const
 

Static Public Member Functions

static void InitDigiArrayTBD ()
 
static Double_t getRescaleFactor ()
 
static Double_t getPositionDepthPWO ()
 
static Double_t getPositionDepthShashlyk ()
 

Public Attributes

Int_t fEvtNo
 

Static Public Attributes

static TClonesArray * fDigiArrayTBD = NULL
 

Protected Attributes

Double_t fEnergy
 
Int_t fTrackId
 
Int_t fDetectorId
 
Int_t fHitIndex
 
TVector3 fWhere
 
Int_t fThetaInd
 
Int_t fPhiInd
 
Double_t fTheta
 
Double_t fPhi
 

Private Member Functions

PndEmcSharedDigioperator= (const PndEmcSharedDigi &)
 
 ClassDef (PndEmcSharedDigi, 2)
 

Private Attributes

Double_t fWeight
 

Detailed Description

used to share PndEmcDigis between bumps

Definition at line 34 of file PndEmcSharedDigi.h.

Member Enumeration Documentation

Enumerator
surface 
depth 

Definition at line 81 of file PndEmcDigi.h.

Constructor & Destructor Documentation

PndEmcSharedDigi::PndEmcSharedDigi ( const PndEmcDigi theDigi,
const Double_t  weight 
)
PndEmcSharedDigi::PndEmcSharedDigi ( const PndEmcSharedDigi theDigi)

Definition at line 34 of file PndEmcSharedDigi.cxx.

35  : PndEmcDigi( theDigi ),
36  fWeight( theDigi.fWeight )
37 {
38 }
PndEmcSharedDigi::PndEmcSharedDigi ( )

Definition at line 40 of file PndEmcSharedDigi.cxx.

Referenced by clone().

40  : fWeight(0)
41 {}
PndEmcSharedDigi::~PndEmcSharedDigi ( )
virtual

Definition at line 46 of file PndEmcSharedDigi.cxx.

47 {
48 }

Member Function Documentation

void PndEmcDigi::AbsorbEnergy ( PndEmcDigi otherDigi)
virtualinherited

Definition at line 118 of file PndEmcDigi.cxx.

References PndEmcDigi::equal(), PndEmcDigi::fEnergy, and PndEmcDigi::GetEnergy().

Referenced by PndEmcClusterRemoveDuplCrys::Exec().

118  {
119  if(otherDigi.equal(this)) {
120  fEnergy += otherDigi.GetEnergy();
121  } else {
122  std::cerr << "-E- in PndEmcDigi::AbsorbEnergy Mismatch in DetectorId. Cannot absorb energy." << std::endl;
123  }
124 }
virtual Double_t GetEnergy() const
Definition: PndEmcDigi.cxx:296
Double_t fEnergy
Definition: PndEmcDigi.h:124
virtual bool equal(FairTimeStamp *data)
Definition: PndEmcDigi.h:69
PndEmcSharedDigi::ClassDef ( PndEmcSharedDigi  ,
 
)
private
PndEmcDigi * PndEmcSharedDigi::clone ( ) const
virtual

Definition at line 51 of file PndEmcSharedDigi.cxx.

References PndEmcSharedDigi().

52 {
53  return new PndEmcSharedDigi(*this);
54 }
PndEmcSharedDigi * PndEmcSharedDigi::dynamic_cast_PndEmcSharedDigi ( )
virtual

Reimplemented from PndEmcDigi.

Definition at line 70 of file PndEmcSharedDigi.cxx.

71 {
72  return this;
73 }
const PndEmcSharedDigi * PndEmcSharedDigi::dynamic_cast_PndEmcSharedDigi ( ) const
virtual

Reimplemented from PndEmcDigi.

Definition at line 76 of file PndEmcSharedDigi.cxx.

77 {
78  return this;
79 }
virtual bool PndEmcDigi::equal ( FairTimeStamp *  data)
inlinevirtualinherited

Definition at line 69 of file PndEmcDigi.h.

References PndEmcDigi::fDetectorId, and PndEmcDigi::GetDetectorId().

Referenced by PndEmcDigi::AbsorbEnergy().

69  {
70  PndEmcDigi* myDigi = dynamic_cast <PndEmcDigi*> (data);
71  if (myDigi != 0){
72  if (fDetectorId == myDigi->GetDetectorId())
73  return true;
74  }
75  return false;
76  }
represents the reconstructed hit of one emc crystal
Definition: PndEmcDigi.h:40
Int_t GetDetectorId() const
Definition: PndEmcDigi.h:97
Int_t fDetectorId
Definition: PndEmcDigi.h:126
Short_t PndEmcDigi::GetCopy ( ) const
inlineinherited

Definition at line 106 of file PndEmcDigi.h.

References PndEmcDigi::fDetectorId.

Referenced by for(), PndEmcDigi::GetXPad(), and PndEmcDigi::GetYPad().

106 { return ((fDetectorId/10000)%100);};
Int_t fDetectorId
Definition: PndEmcDigi.h:126
Short_t PndEmcDigi::GetCrystal ( ) const
inlineinherited

Definition at line 105 of file PndEmcDigi.h.

References PndEmcDigi::fDetectorId.

Referenced by for(), PndEmcDigi::GetXPad(), and PndEmcDigi::GetYPad().

105 { return (fDetectorId%10000);};
Int_t fDetectorId
Definition: PndEmcDigi.h:126
Int_t PndEmcDigi::GetDetectorId ( ) const
inlineinherited
virtual Double_t PndEmcSharedDigi::GetEnergy ( ) const
inlinevirtual

Accessors

Reimplemented from PndEmcDigi.

Definition at line 55 of file PndEmcSharedDigi.h.

References PndEmcDigi::fEnergy, and fWeight.

Referenced by PndEmcExpClusterSplitter::Exec().

55 {return fEnergy*fWeight;}
Double_t fEnergy
Definition: PndEmcDigi.h:124
Int_t PndEmcDigi::GetHitIndex ( )
inlineinherited

Definition at line 110 of file PndEmcDigi.h.

References PndEmcDigi::fHitIndex.

Referenced by PndEmcAnalysis::Exec().

110 {return fHitIndex;}
Int_t fHitIndex
Definition: PndEmcDigi.h:127
Short_t PndEmcDigi::GetModule ( ) const
inlineinherited
Double_t PndEmcDigi::GetPhi ( ) const
inlineinherited
Int_t PndEmcDigi::GetPhiInt ( ) const
inlineinherited
static Double_t PndEmcDigi::getPositionDepthPWO ( )
inlinestaticinherited

Definition at line 117 of file PndEmcDigi.h.

References PndEmcDigi::fPositionDepthPWO.

117 { return fPositionDepthPWO; };
static double fPositionDepthPWO
Definition: PndEmcDigi.h:157
static Double_t PndEmcDigi::getPositionDepthShashlyk ( )
inlinestaticinherited

Definition at line 118 of file PndEmcDigi.h.

References PndEmcDigi::fPositionDepthShashlyk.

118 { return fPositionDepthShashlyk; };
static double fPositionDepthShashlyk
Definition: PndEmcDigi.h:158
static Double_t PndEmcDigi::getRescaleFactor ( )
inlinestaticinherited

Definition at line 116 of file PndEmcDigi.h.

References PndEmcDigi::fRescaleFactor.

Referenced by PndEmcXClMoments::Init().

116 { return fRescaleFactor; };
static double fRescaleFactor
Definition: PndEmcDigi.h:156
Short_t PndEmcDigi::GetRow ( ) const
inlineinherited

Definition at line 104 of file PndEmcDigi.h.

References PndEmcDigi::fDetectorId.

Referenced by for(), PndEmcDigi::GetXPad(), and PndEmcDigi::GetYPad().

104 { return ((fDetectorId/1000000)%100);};
Int_t fDetectorId
Definition: PndEmcDigi.h:126
PndEmcTwoCoordIndex * PndEmcDigi::GetTCI ( ) const
inherited

Definition at line 216 of file PndEmcDigi.cxx.

References emcMap, PndEmcDigi::fDetectorId, PndEmcMapper::GetTCI(), and PndEmcMapper::Instance().

Referenced by PndEmcExpClusterSplitter::Exec(), PndEmcDigi::isNeighbour(), PndEmcClusterProperties::LiloWhere(), and PndEmcClusterDistances::RadialDistance().

217 {
219  PndEmcTwoCoordIndex* tci=emcMap->GetTCI(fDetectorId);
220  return tci;
221 };
stores crystal index coordinates (x,y) or (theta,phi)
PndEmcTwoCoordIndex * GetTCI(Int_t DetectorId)
Emc geometry mapper.
Definition: PndEmcMapper.h:22
PndEmcMapper * emcMap
Int_t fDetectorId
Definition: PndEmcDigi.h:126
static PndEmcMapper * Instance()
Double_t PndEmcDigi::GetTheta ( ) const
inlineinherited
Int_t PndEmcDigi::GetThetaInt ( ) const
inlineinherited
Int_t PndEmcDigi::GetTrackId ( ) const
inlineinherited

Definition at line 96 of file PndEmcDigi.h.

References PndEmcDigi::fTrackId.

Referenced by PndEmcCluster::addDigi(), and PndEmcCluster::removeDigi().

96 { return fTrackId ;};
Int_t fTrackId
Definition: PndEmcDigi.h:125
Short_t PndEmcDigi::GetXPad ( ) const
inherited

Definition at line 223 of file PndEmcDigi.cxx.

References PndEmcDigi::GetCopy(), PndEmcDigi::GetCrystal(), PndEmcDigi::GetModule(), and PndEmcDigi::GetRow().

Referenced by for().

223  {
224  // Return the X pad value for clusterization
225 
226  // Barrel EMC
227  if (GetModule()==1 || GetModule()==2)
228  return (GetCrystal()+(GetCopy()-1)*10);
229 
230  // BwEndCap and forward EMC
231  if ((GetModule()==4) || (GetModule()==5))
232  {
233  if (GetCopy()==1) { return -GetRow()+1;}
234  if (GetCopy()==2) { return -GetRow()+1; }
235  if (GetCopy()==3) { return GetRow();}
236  if (GetCopy()==4) { return GetRow();}
237  }
238 
239  // FwEndCap
240  if (GetModule()==3)
241  return -(GetCrystal()-36);//the minus sign before the paranthesis
242  //is introduced since the geometry of
243  //FwEndCap gets rotated by 180 deg
244  //around the y-axis in PndEmc.cxx;
245 
246  //this rotation was done in turn due to the way the geometry was
247  //defined in the geometry file of the forward end cap
248 
249  /*
250  if (GetModule()==3 && GetCrystal()==999 && GetRow()==999)
251  return GetCrystal();
252  */
253 
254  // Test EMC
255  if (GetModule()==6)
256  return GetRow();
257 
258  return -1000; // failure
259 }
Short_t GetCrystal() const
Definition: PndEmcDigi.h:105
Short_t GetCopy() const
Definition: PndEmcDigi.h:106
Short_t GetModule() const
Definition: PndEmcDigi.h:103
Short_t GetRow() const
Definition: PndEmcDigi.h:104
Short_t PndEmcDigi::GetYPad ( ) const
inherited

Definition at line 261 of file PndEmcDigi.cxx.

References PndEmcDigi::GetCopy(), PndEmcDigi::GetCrystal(), PndEmcDigi::GetModule(), and PndEmcDigi::GetRow().

Referenced by for().

261  {
262  // Return the Y pad value for clusterization
263 
264  // Barrel EMC
265  if (GetModule()==1)
266  return (GetRow()+29);
267 
268  if (GetModule()==2)
269  return (-GetRow()+30);
270 
271  // BwEndCap and forward EMC
272  if ((GetModule()==4) || (GetModule()==5))
273  {
274  if (GetCopy()==1) { return GetCrystal(); }
275  if (GetCopy()==2) { return -GetCrystal() + 1; }
276  if (GetCopy()==3) { return -GetCrystal() + 1; }
277  if (GetCopy()==4) { return GetCrystal(); }
278  }
279 
280  // FwEndCap
281  if (GetModule()==3)
282  return (GetRow()- 37);
283 
284  /*
285  if (GetModule()==3 && GetCrystal()==999 && GetRow()==999)
286  return GetRow();
287  */
288 
289  // Test EMC
290  if (GetModule()==6)
291  return GetCrystal();
292 
293  return -1000; // failure
294 }
Short_t GetCrystal() const
Definition: PndEmcDigi.h:105
Short_t GetCopy() const
Definition: PndEmcDigi.h:106
Short_t GetModule() const
Definition: PndEmcDigi.h:103
Short_t GetRow() const
Definition: PndEmcDigi.h:104
void PndEmcDigi::InitDigiArrayTBD ( )
staticinherited

Definition at line 89 of file PndEmcDigi.cxx.

References PndEmcDigi::fDigiArrayTBD.

Referenced by PndEmcCorrBump::Init(), and PndEmcWaveformToDigi::Init().

90 {
91  if (fDigiArrayTBD==NULL)
92  fDigiArrayTBD = new TClonesArray("PndEmcDigi");
93 }
static TClonesArray * fDigiArrayTBD
Definition: PndEmcDigi.h:52
bool PndEmcDigi::isNeighbour ( const PndEmcDigi theDigi) const
inherited

Definition at line 201 of file PndEmcDigi.cxx.

References PndEmcDigi::GetTCI(), PndEmcMapper::Instance(), and PndEmcTwoCoordIndex::IsNeighbour().

Referenced by PndEmcClusterEnergySums::E25(), PndEmcClusterEnergySums::E9(), and PndEmcCluster::isInCluster().

202 {
203  PndEmcMapper::Instance(); //: unused variable?PndEmcMapper *emcMap= //[R.K.03/2017] unused variable
204  PndEmcTwoCoordIndex* tci=this->GetTCI();
205 
206  if ((theDigi->GetTCI()==0)||(tci==0)){
207  std::cout<<"TwoCoordIndex of digi is not defined"<<std::endl;
208  abort();
209  }
210 
211  if (tci->IsNeighbour(theDigi->GetTCI())) return true;
212 
213  return false;
214 }
stores crystal index coordinates (x,y) or (theta,phi)
bool IsNeighbour(PndEmcTwoCoordIndex *_tci)
static PndEmcMapper * Instance()
PndEmcTwoCoordIndex * GetTCI() const
Definition: PndEmcDigi.cxx:216
bool PndEmcDigi::operator!= ( const PndEmcDigi otherDigi) const
virtualinherited

Definition at line 317 of file PndEmcDigi.cxx.

318 {
319  return ! ( *this == otherDigi );
320 }
bool PndEmcDigi::operator< ( const PndEmcDigi otherDigi) const
virtualinherited

Definition at line 322 of file PndEmcDigi.cxx.

References PndEmcDigi::fEnergy, PndEmcDigi::fPhi, and PndEmcDigi::fTheta.

323 {
324  if (fEnergy < otherDigi.fEnergy)
325  return true;
326  else if (fEnergy == otherDigi.fEnergy && fTheta< otherDigi.fTheta)
327  return true;
328  else if (fEnergy == otherDigi.fEnergy && fTheta == otherDigi.fTheta && fPhi < otherDigi.fPhi)
329  return true;
330 
331  return false;
332 }
Double_t fEnergy
Definition: PndEmcDigi.h:124
Double_t fTheta
Definition: PndEmcDigi.h:131
Double_t fPhi
Definition: PndEmcDigi.h:132
PndEmcSharedDigi& PndEmcSharedDigi::operator= ( const PndEmcSharedDigi )
private
bool PndEmcDigi::operator== ( const PndEmcDigi otherDigi) const
virtualinherited

Definition at line 303 of file PndEmcDigi.cxx.

References Double_t, PndEmcDigi::GetEnergy(), PndEmcDigi::GetPhiInt(), and PndEmcDigi::GetThetaInt().

304 {
305  bool isEqual = false;
306 
307  // 2 EmcDigis are equal is their relative energy difference whithin the folloowing tolerance
308  Double_t energy_tolerance=1e-5;
309 
310  if ( this->GetThetaInt() == otherDigi.GetThetaInt() &&
311  this->GetPhiInt() == otherDigi.GetPhiInt() &&
312  ((this->GetEnergy() - otherDigi.GetEnergy())/this->GetEnergy()<energy_tolerance )) isEqual =true;
313 
314  return isEqual;
315 }
virtual Double_t GetEnergy() const
Definition: PndEmcDigi.cxx:296
Int_t GetThetaInt() const
Definition: PndEmcDigi.h:99
Double_t
Int_t GetPhiInt() const
Definition: PndEmcDigi.h:100
void PndEmcDigi::Print ( const Option_t *  opt = "") const
virtualinherited

Output to screen

Definition at line 337 of file PndEmcDigi.cxx.

References PndEmcDigi::fEnergy, PndEmcDigi::fEvtNo, PndEmcDigi::fTrackId, and PndEmcDigi::GetDetectorId().

Referenced by PndEmcCorrBump::Exec(), and PndEmcXClMoments::Print().

337  {
338  cout << "EMC digi: cellid=" << GetDetectorId() << ", Energy=" << fEnergy<<", Time="<<GetTimeStamp()<<", Evt="<<fEvtNo;
339  if (fTrackId>0) cout << ", TrackID= " << fTrackId;
340  //cout<<endl;
341 // cout << ", x=" << GetX() << ", y=" << GetY() << endl << flush;
342 }
Int_t GetDetectorId() const
Definition: PndEmcDigi.h:97
Int_t fTrackId
Definition: PndEmcDigi.h:125
Double_t fEnergy
Definition: PndEmcDigi.h:124
Int_t fEvtNo
Definition: PndEmcDigi.h:118
void PndEmcDigi::SetDetectorId ( Int_t  id)
inherited

Definition at line 95 of file PndEmcDigi.cxx.

References PndEmcDigi::algPointer, emcMap, PndEmcDigi::fDetectorId, PndEmcDigi::fPhi, PndEmcDigi::fPhiInd, PndEmcDigi::fTheta, PndEmcDigi::fThetaInd, PndEmcDigi::fWhere, PndEmcMapper::GetTCI(), PndEmcStructure::GetTciXtalMap(), PndEmcMapper::Instance(), PndEmcStructure::Instance(), PndEmcTwoCoordIndex::XCoord(), and PndEmcTwoCoordIndex::YCoord().

96 {
97 // PndEmcMapper assumed to instantiate first time with correct parameter before
99  PndEmcTwoCoordIndex* tci=emcMap->GetTCI(id);
100  fThetaInd=tci->XCoord();
101  fPhiInd=tci->YCoord();
102  fDetectorId=id;
103 
104  fThetaInd=tci->XCoord();
105  fPhiInd=tci->YCoord();
106 
108  PndEmcXtal* xtal = tciXtalMap.find(tci)->second;
109  fWhere = algPointer()(xtal);
110  fTheta = fWhere.Theta();
111  fPhi = fWhere.Phi();
112 
113 }
represents coordinates of one crystal
Definition: PndEmcXtal.h:36
stores crystal index coordinates (x,y) or (theta,phi)
PndEmcTwoCoordIndex * GetTCI(Int_t DetectorId)
Emc geometry mapper.
Definition: PndEmcMapper.h:22
TVector3 fWhere
Definition: PndEmcDigi.h:128
PndEmcMapper * emcMap
Double_t fTheta
Definition: PndEmcDigi.h:131
const PndEmcTciXtalMap & GetTciXtalMap() const
Int_t fPhiInd
Definition: PndEmcDigi.h:130
std::map< PndEmcTwoCoordIndex *, PndEmcXtal * > PndEmcTciXtalMap
Int_t fDetectorId
Definition: PndEmcDigi.h:126
static TVector3(*&)(const PndEmcXtal *) algPointer()
Definition: PndEmcDigi.h:154
Int_t fThetaInd
Definition: PndEmcDigi.h:129
static PndEmcStructure * Instance()
Double_t fPhi
Definition: PndEmcDigi.h:132
static PndEmcMapper * Instance()
void PndEmcDigi::SetEnergy ( Double32_t  energy)
inlineinherited

Modifiers

Definition at line 84 of file PndEmcDigi.h.

References energy, and PndEmcDigi::fEnergy.

Referenced by PndEmcWaveformToDigi::Exec().

84 { fEnergy = energy ;};
Double_t fEnergy
Definition: PndEmcDigi.h:124
Double_t energy
Definition: plot_dirc.C:15
void PndEmcDigi::SetTrackId ( Int_t  id)
inlineinherited

Definition at line 85 of file PndEmcDigi.h.

References PndEmcDigi::fTrackId.

85 { fTrackId = id ;};
Int_t fTrackId
Definition: PndEmcDigi.h:125
virtual void PndEmcSharedDigi::weight ( Double_t  newWeight)
virtual
virtual Double_t PndEmcSharedDigi::weight ( ) const
inlinevirtual

Definition at line 56 of file PndEmcSharedDigi.h.

References fWeight.

56 {return fWeight;}
const TVector3& PndEmcDigi::where ( ) const
inlineinherited

Member Data Documentation

Int_t PndEmcDigi::fDetectorId
protectedinherited
TClonesArray * PndEmcDigi::fDigiArrayTBD = NULL
staticinherited
Double_t PndEmcDigi::fEnergy
protectedinherited
Int_t PndEmcDigi::fEvtNo
inherited
Int_t PndEmcDigi::fHitIndex
protectedinherited

Definition at line 127 of file PndEmcDigi.h.

Referenced by PndEmcDigi::GetHitIndex().

Double_t PndEmcDigi::fPhi
protectedinherited
Int_t PndEmcDigi::fPhiInd
protectedinherited
Double_t PndEmcDigi::fTheta
protectedinherited
Int_t PndEmcDigi::fThetaInd
protectedinherited
Int_t PndEmcDigi::fTrackId
protectedinherited

Definition at line 125 of file PndEmcDigi.h.

Referenced by PndEmcDigi::GetTrackId(), PndEmcDigi::Print(), and PndEmcDigi::SetTrackId().

Double_t PndEmcSharedDigi::fWeight
private

Definition at line 65 of file PndEmcSharedDigi.h.

Referenced by GetEnergy(), and weight().

TVector3 PndEmcDigi::fWhere
protectedinherited

The documentation for this class was generated from the following files: