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

#include <PndEmcClusterDistances.h>

Inheritance diagram for PndEmcClusterDistances:
PndEmcAbsClusterProperty

Public Member Functions

 PndEmcClusterDistances (const PndEmcCluster &cluster, const TClonesArray *digiArray)
 
 PndEmcClusterDistances (const PndEmcClusterDistances &)
 
virtual ~PndEmcClusterDistances ()
 
Double_t RadialDistance (const PndEmcDigi *const) const
 
Double_t AngularDistance (const PndEmcDigi *const) const
 
Double_t AngularSeparation (const PndEmcDigi *const) const
 

Protected Member Functions

const PndEmcClusterMyCluster () const
 
const std::map< Int_t, Int_t > & Members () const
 
const TClonesArray * DigiArray () const
 

Private Member Functions

PndEmcClusterDistancesoperator= (const PndEmcClusterDistances &)
 

Private Attributes

TVector3 * fShowerMaxLocation
 
TVector3 * fClusterLocation
 
PndEmcXtalfTheGeom
 
TVector3 * fTheNormalToFrontFace
 
Double_t fDistanceOfPlane
 
Double_t fClusPhi
 
Double_t fClusTheta
 

Detailed Description

Definition at line 29 of file PndEmcClusterDistances.h.

Constructor & Destructor Documentation

PndEmcClusterDistances::PndEmcClusterDistances ( const PndEmcCluster cluster,
const TClonesArray *  digiArray 
)

Definition at line 29 of file PndEmcClusterDistances.cxx.

References Double_t, PndEmcCluster::energy(), fClusPhi, fClusterLocation, fClusTheta, fDistanceOfPlane, fShowerMaxLocation, fTheGeom, fTheNormalToFrontFace, PndEmcStructure::GetTciXtalMap(), PndEmcStructure::Instance(), PndEmcStructure::locateIndex(), log(), PndEmcXtal::normalToFrontFace(), PndEmcCluster::phi(), PndEmcCluster::theta(), and PndEmcCluster::where().

29  :
30 PndEmcAbsClusterProperty( toUse, digiArray ),
31 fShowerMaxLocation(new TVector3()),
32 fClusterLocation(new TVector3()),
33 fTheGeom(new PndEmcXtal()),
34 fTheNormalToFrontFace(new TVector3()),
36 fClusPhi(0),
37 fClusTheta(0)
38 {
39  TVector3 clusLocation(toUse.where());
40 
41  fClusterLocation = new TVector3(clusLocation.x(), clusLocation.y(), clusLocation.z());
42 
43  fShowerMaxLocation = new TVector3(*fClusterLocation);
44 
45  Double_t showerMax = (log(toUse.energy()/0.0145) + 0.5) * 1.86;
46 
47  fShowerMaxLocation->SetMag(fClusterLocation->Mag() + showerMax);
48 
49  PndEmcTwoCoordIndex *theTCI=PndEmcStructure::Instance()->locateIndex(fShowerMaxLocation->Theta(),fShowerMaxLocation->Phi());
50 
51  assert(theTCI != 0);
52 
54  fTheGeom = tciXtalMap.find(theTCI)->second;
55 
57 
58  fDistanceOfPlane = fTheNormalToFrontFace->Dot(*fShowerMaxLocation);
59 
60  fClusPhi = toUse.phi();
61  fClusTheta = toUse.theta();
62 
63 }
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:110
represents coordinates of one crystal
Definition: PndEmcXtal.h:36
stores crystal index coordinates (x,y) or (theta,phi)
const TVector3 & normalToFrontFace() const
Definition: PndEmcXtal.cxx:151
Double_t
const PndEmcTciXtalMap & GetTciXtalMap() const
PndEmcTwoCoordIndex * locateIndex(double theta, double phi) const
std::map< PndEmcTwoCoordIndex *, PndEmcXtal * > PndEmcTciXtalMap
static PndEmcStructure * Instance()
PndEmcAbsClusterProperty(const PndEmcCluster &cluster, const TClonesArray *digiArray)
PndEmcClusterDistances::PndEmcClusterDistances ( const PndEmcClusterDistances theDistance)

Definition at line 65 of file PndEmcClusterDistances.cxx.

65  :
66  PndEmcAbsClusterProperty( theDistance ),
67  fShowerMaxLocation( new TVector3(*(theDistance.fShowerMaxLocation)) ),
68  fClusterLocation( new TVector3(*(theDistance.fClusterLocation)) ),
69  fTheGeom( theDistance.fTheGeom ),
71  fDistanceOfPlane( theDistance.fDistanceOfPlane ),
72  fClusPhi( theDistance.fClusPhi ),
73  fClusTheta( theDistance.fClusTheta )
74 {
75 }
PndEmcAbsClusterProperty(const PndEmcCluster &cluster, const TClonesArray *digiArray)
PndEmcClusterDistances::~PndEmcClusterDistances ( )
virtual

Definition at line 80 of file PndEmcClusterDistances.cxx.

References fClusterLocation, and fShowerMaxLocation.

81 {
82  delete fClusterLocation;
83  delete fShowerMaxLocation;
84 }

Member Function Documentation

Double_t PndEmcClusterDistances::AngularDistance ( const PndEmcDigi * const  theDigi) const

Definition at line 115 of file PndEmcClusterDistances.cxx.

References fClusterLocation, and PndEmcDigi::where().

115  {
116 
117  TVector3 digiWhere(theDigi->where());
118  TVector3 vecDigiWhere(digiWhere.x(), digiWhere.y(), digiWhere.z());
119 
120  return fClusterLocation->Angle(vecDigiWhere);
121 }
const TVector3 & where() const
Definition: PndEmcDigi.h:111
Double_t PndEmcClusterDistances::AngularSeparation ( const PndEmcDigi * const  theDigi) const

Definition at line 124 of file PndEmcClusterDistances.cxx.

References Double_t, fClusPhi, fClusTheta, PndEmcDigi::GetPhi(), PndEmcDigi::GetTheta(), phi, Pi, sqrt(), and theta.

124  {
125  Double_t phi = theDigi->GetPhi();
126  Double_t theta = theDigi->GetTheta();
127  Double_t phiDiff = phi - fClusPhi;
128  while( phiDiff> TMath::Pi() ) phiDiff -= 2*TMath::Pi();
129  while( phiDiff< -TMath::Pi() ) phiDiff += 2*TMath::Pi();
130 
131  Double_t thetaDiff = theta - fClusTheta;
132 
133  return sqrt(phiDiff*phiDiff + thetaDiff* thetaDiff);
134 }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t GetTheta() const
Definition: PndEmcDigi.h:101
Double_t
Double_t GetPhi() const
Definition: PndEmcDigi.h:102
Double_t Pi
const TClonesArray * PndEmcAbsClusterProperty::DigiArray ( ) const
protectedinherited
const std::map< Int_t, Int_t > & PndEmcAbsClusterProperty::Members ( ) const
protectedinherited
const PndEmcCluster & PndEmcAbsClusterProperty::MyCluster ( ) const
protectedinherited
PndEmcClusterDistances& PndEmcClusterDistances::operator= ( const PndEmcClusterDistances )
inlineprivate

Definition at line 56 of file PndEmcClusterDistances.h.

56 {return *this;};
Double_t PndEmcClusterDistances::RadialDistance ( const PndEmcDigi * const  theDigi) const

Definition at line 91 of file PndEmcClusterDistances.cxx.

References Double_t, fDistanceOfPlane, fShowerMaxLocation, fTheNormalToFrontFace, PndEmcDigi::GetTCI(), PndEmcStructure::GetTciXtalMap(), PndEmcStructure::Instance(), PndEmcXtal::normalToFrontFace(), and PndEmcDigi::where().

91  {
92 
93  TVector3 digiWhere(theDigi->where());
94  TVector3 vecDigiWhere(digiWhere.x(), digiWhere.y(), digiWhere.z());
95 
97  PndEmcXtal *theXtalGeom = tciXtalMap.find(theDigi->GetTCI())->second;
98 
99 
100  const TVector3 digiNormal = theXtalGeom->normalToFrontFace();
101 
102  Double_t normalProduct = fTheNormalToFrontFace->Dot(digiNormal);
103 
104  Double_t distToFF = fTheNormalToFrontFace->Dot(vecDigiWhere);
105 
106  Double_t digiDepth = (fDistanceOfPlane - distToFF)/normalProduct;
107 
108  TVector3 digiPerp(vecDigiWhere + digiDepth*digiNormal - *(fShowerMaxLocation));
109 
110  return digiPerp.Mag();
111 
112 }
represents coordinates of one crystal
Definition: PndEmcXtal.h:36
const TVector3 & normalToFrontFace() const
Definition: PndEmcXtal.cxx:151
Double_t
const PndEmcTciXtalMap & GetTciXtalMap() const
std::map< PndEmcTwoCoordIndex *, PndEmcXtal * > PndEmcTciXtalMap
const TVector3 & where() const
Definition: PndEmcDigi.h:111
static PndEmcStructure * Instance()
PndEmcTwoCoordIndex * GetTCI() const
Definition: PndEmcDigi.cxx:216

Member Data Documentation

Double_t PndEmcClusterDistances::fClusPhi
private

Definition at line 64 of file PndEmcClusterDistances.h.

Referenced by AngularSeparation(), and PndEmcClusterDistances().

TVector3* PndEmcClusterDistances::fClusterLocation
private
Double_t PndEmcClusterDistances::fClusTheta
private

Definition at line 65 of file PndEmcClusterDistances.h.

Referenced by AngularSeparation(), and PndEmcClusterDistances().

Double_t PndEmcClusterDistances::fDistanceOfPlane
private

Definition at line 63 of file PndEmcClusterDistances.h.

Referenced by PndEmcClusterDistances(), and RadialDistance().

TVector3* PndEmcClusterDistances::fShowerMaxLocation
private
PndEmcXtal* PndEmcClusterDistances::fTheGeom
private

Definition at line 61 of file PndEmcClusterDistances.h.

Referenced by PndEmcClusterDistances().

TVector3* PndEmcClusterDistances::fTheNormalToFrontFace
private

Definition at line 62 of file PndEmcClusterDistances.h.

Referenced by PndEmcClusterDistances(), and RadialDistance().


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