// --- ROOT system ---
-#include "TPad.h"
-#include "TH2.h"
#include "TMath.h"
-#include "TCanvas.h"
// --- Standard library ---
-#include <Riostream.h>
-
// --- AliRoot header files ---
- #include "AliGenerator.h"
+#include "AliGenerator.h"
#include "AliEMCALGeometry.h"
#include "AliEMCALTowerRecPoint.h"
-#include "AliRun.h"
#include "AliEMCALGetter.h"
ClassImp(AliEMCALTowerRecPoint)
fEnergyList = 0 ;
fTime = 0. ;
fLocPos.SetX(0.) ; //Local position should be evaluated
-
}
//____________________________________________________________________________
fCoreEnergy = 0 ;
fEnergyList = 0 ;
fTime = -1. ;
- fLocPos.SetX(1000000.) ; //Local position should be evaluated
-
+ fLocPos.SetX(1000000.) ; //Local position should be evaluated
}
//____________________________________________________________________________
Bool_t aren = kFALSE ;
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- AliEMCALGeometry * phosgeom = (AliEMCALGeometry*)gime->EMCALGeometry();
+ AliEMCALGeometry * phosgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
- Int_t relid1[4] ;
+ Int_t relid1[3] ;
phosgeom->AbsToRelNumbering(digit1->GetId(), relid1) ;
- Int_t relid2[4] ;
+ Int_t relid2[3] ;
phosgeom->AbsToRelNumbering(digit2->GetId(), relid2) ;
- Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
- Int_t coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
+ Int_t rowdiff = TMath::Abs( relid1[1] - relid2[1] ) ;
+ Int_t coldiff = TMath::Abs( relid1[2] - relid2[2] ) ;
if (( coldiff <= 1 ) && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0))
aren = kTRUE ;
{
// Compares two RecPoints according to their position in the EMCAL modules
- Float_t delta = 1 ; //Width of "Sorting row". If you changibg this
+ Float_t delta = 1 ; //Width of "Sorting row". If you change this
//value (what is senseless) change as vell delta in
//AliEMCALTrackSegmentMakerv* and other RecPoints...
Int_t rv ;
return rv ;
}
//______________________________________________________________________________
-void AliEMCALTowerRecPoint::ExecuteEvent(Int_t event, Int_t px, Int_t py) const
+void AliEMCALTowerRecPoint::ExecuteEvent(Int_t /*event*/, Int_t, Int_t) const
{
// Execute action corresponding to one event
// and switched off when the mouse button is released.
- // AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
-// if(!gime) return ;
-// AliEMCALGeometry * emcalgeom = (AliEMCALGeometry*)gime->EMCALGeometry();
-
+ // AliEMCALGeometry * phosgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
+
// static TGraph * digitgraph = 0 ;
// if (!gPad->IsEditable()) return;
// case kButton1Down: {
// AliEMCALDigit * digit ;
// Int_t iDigit;
-// Int_t relid[4] ;
+// Int_t relid[3] ;
// const Int_t kMulDigit = AliEMCALTowerRecPoint::GetDigitsMultiplicity() ;
// Float_t * xi = new Float_t[kMulDigit] ;
AliEMCALDigit * digit ;
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- AliEMCALGeometry * emcalgeom = (AliEMCALGeometry*)gime->EMCALGeometry();
+ AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
// Calculates the center of gravity in the local EMCAL-module coordinates
Int_t iDigit;
- Int_t relid[4] ;
- if (!fTheta || !fPhi ) {
- for(iDigit=0; iDigit<fMulDigit; iDigit++) {
- digit = dynamic_cast<AliEMCALDigit *>(digits->At(fDigitsList[iDigit])) ;
-
- Float_t thetai ;
- Float_t phii ;
- emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- emcalgeom->PosInAlice(relid, thetai, phii);
- Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
- fTheta = fTheta + thetai * w ;
- fPhi += (phii * w );
- wtot += w ;
- }
+ if (!fTheta || !fPhi )
+ EvalGlobalPosition(logWeight, digits) ;
+
+ const Float_t kDeg2Rad = TMath::DegToRad() ;
- if (wtot > 0 ) {
- fTheta /= wtot ;
- fPhi /= wtot ;
- } else {
- fTheta = -1. ;
- fPhi = -1. ;
- }
-
- }
+ Float_t cyl_radius = 0 ;
- const Float_t kDeg2Rad = TMath::Pi() / static_cast<Double_t>(180) ;
+ if (IsInECA())
+ cyl_radius = emcalgeom->GetIP2ECASection() ;
+ else
+ Fatal("EvalDispersion", "Unexpected tower section!") ;
- Float_t cyl_radius = emcalgeom->GetIPDistance()+emcalgeom->GetAirGap() ;
- Float_t x = cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
- Float_t y = cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
- Float_t z = cyl_radius * TMath::Tan(fTheta * kDeg2Rad ) ;
+ Float_t x = fLocPos.X() ;
+ Float_t y = fLocPos.Y() ;
+ Float_t z = fLocPos.Z() ;
+ if (gDebug == 2)
+ printf("EvalDispersion: x,y,z = %f,%f,%f", x, y, z) ;
+
// Calculates the dispersion in coordinates
wtot = 0.;
for(iDigit=0; iDigit < fMulDigit; iDigit++) {
digit = (AliEMCALDigit *) digits->At(fDigitsList[iDigit]) ;
Float_t thetai = 0. ;
Float_t phii = 0.;
- emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- emcalgeom->PosInAlice(relid, thetai, phii);
+ emcalgeom->PosInAlice(digit->GetId(), thetai, phii);
Float_t xi = cyl_radius * TMath::Cos(phii * kDeg2Rad ) ;
Float_t yi = cyl_radius * TMath::Sin(phii * kDeg2Rad ) ;
- Float_t zi = cyl_radius * TMath::Tan(thetai * kDeg2Rad ) ;
+ Float_t zi = cyl_radius / TMath::Tan(thetai * kDeg2Rad ) ;
+
+ if (gDebug == 2)
+ printf("EvalDispersion: id = %d, xi,yi,zi = %f,%f,%f", digit->GetId(), xi, yi, zi) ;
Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
- d += w*((xi-x)*(xi-x) + (yi-y)*(yi-y)+ (zi-z)*(zi-z) ) ;
+ d += w * ( (xi-x)*(xi-x) + (zi-z)*(zi-z) ) ;
wtot+=w ;
}
Float_t coreRadius = 10. ;
AliEMCALDigit * digit ;
- Int_t relid[4] ;
Float_t wtot = 0. ;
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- AliEMCALGeometry * emcalgeom = (AliEMCALGeometry*)gime->EMCALGeometry();
-
+ AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
Int_t iDigit;
if (!fTheta || !fPhi ) {
Float_t thetai ;
Float_t phii ;
- emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- emcalgeom->PosInAlice(relid, thetai, phii);
+ emcalgeom->PosInAlice(digit->GetId(), thetai, phii);
Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
fTheta = fTheta + thetai * w ;
fPhi += (phii * w );
fPhi = -1 ;
}
}
-
- const Float_t kDeg2Rad = TMath::Pi() / static_cast<Double_t>(180) ;
-
- Float_t cyl_radius = emcalgeom->GetIPDistance()+emcalgeom->GetAirGap() ;
+
+ const Float_t kDeg2Rad = TMath::DegToRad() ;
+
+ Float_t cyl_radius = emcalgeom->GetIP2ECASection();
Float_t x = cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
Float_t y = cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
Float_t z = cyl_radius * TMath::Tan(fTheta * kDeg2Rad ) ;
for(iDigit=0; iDigit < fMulDigit; iDigit++) {
digit = (AliEMCALDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
- Int_t relid[4] ;
Float_t thetai = 0. ;
Float_t phii = 0. ;
- emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- emcalgeom->PosInAlice(relid, thetai, phii);
+ emcalgeom->PosInAlice(digit->GetId(), thetai, phii);
Float_t xi = cyl_radius * TMath::Cos(phii * kDeg2Rad ) ;
Float_t yi = cyl_radius * TMath::Sin(phii * kDeg2Rad ) ;
if(distance < coreRadius)
fCoreEnergy += fEnergyList[iDigit] ;
}
-
+
}
//____________________________________________________________________________
AliEMCALDigit * digit ;
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- AliEMCALGeometry * emcalgeom = (AliEMCALGeometry*)gime->EMCALGeometry();
+ AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
Int_t iDigit;
- const Float_t kDeg2Rad = TMath::Pi() / static_cast<Double_t>(180) ;
+ const Float_t kDeg2Rad = TMath::DegToRad() ;
- Float_t cyl_radius = emcalgeom->GetIPDistance()+emcalgeom->GetAirGap() ;
+ Float_t cyl_radius = 0 ;
+
+ if (IsInECA())
+ cyl_radius = emcalgeom->GetIP2ECASection() ;
+ else
+ Fatal("EvalDispersion", "Unexpected tower section!") ;
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
digit = (AliEMCALDigit *) digits->At(fDigitsList[iDigit]) ;
- Int_t relid[4] ;
Float_t thetai = 0. ;
Float_t phii = 0. ;
- emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- emcalgeom->PosInAlice(relid, thetai, phii);
+ emcalgeom->PosInAlice(digit->GetId(), thetai, phii);
Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
Float_t xi = cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
- Float_t zi = cyl_radius * TMath::Tan(fTheta * kDeg2Rad ) ;
+ Float_t zi = cyl_radius / TMath::Tan(fTheta * kDeg2Rad ) ;
dxx += w * xi * xi ;
x += w * xi ;
dzz += w * zi * zi ;
// //Apply correction due to non-perpendicular incidence
// Double_t CosX ;
// Double_t CosZ ;
-// AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
-// AliEMCALGeometry * emcalgeom = (AliEMCALGeometry*)gime->EMCALGeometry();
+// AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
// Double_t DistanceToIP= (Double_t ) emcalgeom->GetIPDistance() ;
// CosX = DistanceToIP/TMath::Sqrt(DistanceToIP*DistanceToIP+x*x) ;
// Calculates the center of gravity in the local EMCAL-module coordinates
Float_t wtot = 0. ;
- Int_t relid[4] ;
+ // Int_t relid[3] ;
AliEMCALDigit * digit ;
-
- AliEMCALGetter * gime = AliEMCALGetter::GetInstance() ;
- AliEMCALGeometry * emcalgeom = static_cast<AliEMCALGeometry*>(gime->EMCALGeometry());
+ AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
Int_t iDigit;
for(iDigit=0; iDigit<fMulDigit; iDigit++) {
Float_t thetai ;
Float_t phii ;
- emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
- emcalgeom->PosInAlice(relid, thetai, phii);
+ emcalgeom->PosInAlice(digit->GetId(), thetai, phii);
Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
fTheta = fTheta + thetai * w ;
fPhi += (phii * w );
fPhi = -1.;
}
- fLocPos.SetX(0.) ;
- fLocPos.SetY(0.) ;
- fLocPos.SetZ(0.) ;
+ const Float_t kDeg2Rad = TMath::DegToRad() ;
+
+ Float_t cyl_radius = 0 ;
+
+ if (IsInECA())
+ cyl_radius = emcalgeom->GetIP2ECASection() ;
+ else
+ Fatal("EvalGlobalPosition", "Unexpected tower section!") ;
+
+ Float_t x = cyl_radius * TMath::Cos(fPhi * kDeg2Rad ) ;
+ Float_t y = cyl_radius * TMath::Sin(fPhi * kDeg2Rad ) ;
+ Float_t z = cyl_radius / TMath::Tan(fTheta * kDeg2Rad ) ;
+
+ fLocPos.SetX(x) ;
+ fLocPos.SetY(y) ;
+ fLocPos.SetZ(z) ;
+
+ if (gDebug==2)
+ printf("EvalGlobalPosition: x,y,z = %f,%f,%f", fLocPos.X(), fLocPos.Y(), fLocPos.Z()) ;
fLocPosM = 0 ;
}
AliEMCALDigit * digit ;
AliEMCALDigit * digitN ;
-
Int_t iDigitN ;
Int_t iDigit ;
for(iDigit = 0; iDigit < fMulDigit; iDigit++)
maxAt[iDigit] = (AliEMCALDigit*) digits->At(fDigitsList[iDigit]) ;
-
for(iDigit = 0 ; iDigit < fMulDigit; iDigit++) {
if(maxAt[iDigit]) {
}
//____________________________________________________________________________
-void AliEMCALTowerRecPoint::Print(Option_t * option)
+void AliEMCALTowerRecPoint::Print(Option_t *)
{
// Print the list of digits belonging to the cluster
- cout << "AliEMCALTowerRecPoint: " << endl ;
+ printf("\n") ;
Int_t iDigit;
- cout << " digits # = " ;
- for(iDigit=0; iDigit<fMulDigit; iDigit++)
- cout << fDigitsList[iDigit] << " " ;
- cout << endl ;
-
- cout << " Energies = " ;
- for(iDigit=0; iDigit<fMulDigit; iDigit++)
- cout << fEnergyList[iDigit] << " ";
- cout << endl ;
-
- cout << " Primaries " ;
- for(iDigit = 0;iDigit < fMulTrack; iDigit++)
- cout << fTracksList[iDigit] << " " << endl ;
-
- cout << " Multiplicity = " << fMulDigit << endl ;
- cout << " Cluster Energy = " << fAmp << endl ;
- cout << " Number of primaries " << fMulTrack << endl ;
- cout << " Stored at position " << GetIndexInList() << endl ;
-
+ printf("digits # = ");
+ for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+ printf("%i ", fDigitsList[iDigit]);
+ }
+
+ printf("\nEnergies = ");
+ for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+ printf("%f ", fEnergyList[iDigit]);
+ }
+
+ printf("\nPrimaries ");
+ for(iDigit = 0;iDigit < fMulTrack; iDigit++) {
+ printf("%i ", fTracksList[iDigit]);
+ }
+ printf("\n Multiplicity = %i", fMulDigit);
+ printf("\n Cluster Energy = %f", fAmp);
+ printf("\n Number of primaries %i", fMulTrack);
+ printf("\n Stored at position: %i", GetIndexInList());
}
+//____________________________________________________________________________
+const TVector3 AliEMCALTowerRecPoint::XYZInAlice(Float_t r, Float_t theta, Float_t phi) const
+{
+ // spherical coordinates of recpoint in Alice reference frame
+
+ if (gDebug == 2)
+ printf("XYZInAlice: r = %f, theta = %f, phi = %f", r, theta, phi) ;
+
+ if (theta == 9999. || phi == 9999. || r == 9999.) {
+ TVector3 globalpos;
+ GetGlobalPosition(globalpos);
+ phi = globalpos.X() * TMath::DegToRad() ;
+ r = globalpos.Y() ;
+ theta = globalpos.Z() * TMath::DegToRad() ;
+ }
+ else {
+ theta *= TMath::DegToRad() ;
+ phi *= TMath::DegToRad() ;
+ }
+
+ Float_t y = r * TMath::Cos(phi) ;
+ Float_t x = r * TMath::Sin(phi) * TMath::Sin(theta) ;
+ Float_t z = r * TMath::Sin(phi) * TMath::Cos(theta) ;
+
+ TVector3 vec(z, x, y) ;
+ return vec ;
+}