]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Local and global coordinates systems of the EMCAL changed on the clusteriser level...
authormhorner <mhorner@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Feb 2004 21:10:01 +0000 (21:10 +0000)
committermhorner <mhorner@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 9 Feb 2004 21:10:01 +0000 (21:10 +0000)
14 files changed:
EMCAL/AliEMCALClusterizerv1.cxx
EMCAL/AliEMCALClusterizerv1.h
EMCAL/AliEMCALGeometry.h
EMCAL/AliEMCALGetter.h
EMCAL/AliEMCALLoader.h
EMCAL/AliEMCALPIDv1.cxx
EMCAL/AliEMCALPIDv1.h
EMCAL/AliEMCALRecParticle.cxx
EMCAL/AliEMCALRecPoint.cxx
EMCAL/AliEMCALRecPoint.h
EMCAL/AliEMCALTrackSegment.cxx
EMCAL/AliEMCALTrackSegment.h
EMCAL/AliEMCALTrackSegmentMakerv1.cxx
EMCAL/AliEMCALTrackSegmentMakerv1.h

index 66186ebcc8210c85dbf4f18179746fbf36321686..63a187819723ced2bbf62042431f0783e34a753a 100644 (file)
@@ -61,7 +61,7 @@
 // --- AliRoot header files ---
 #include "AliEMCALGetter.h"
 #include "AliEMCALClusterizerv1.h"
-#include "AliEMCALTowerRecPoint.h"
+#include "AliEMCALRecPoint.h"
 #include "AliEMCALDigit.h"
 #include "AliEMCALDigitizer.h"
 #include "AliEMCAL.h"
@@ -128,9 +128,8 @@ void AliEMCALClusterizerv1::Exec(Option_t * option)
   AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle()) ;
 
   if (fLastEvent == -1) 
-    fLastEvent = gime->MaxEvent() - 1 ;
-  else 
-    fLastEvent = TMath::Min(fFirstEvent, gime->MaxEvent());
+    fLastEvent = gime->MaxEvent() - 1;
+
   Int_t nEvents   = fLastEvent - fFirstEvent + 1;
 
   Int_t ievent ;
@@ -165,7 +164,7 @@ void AliEMCALClusterizerv1::Exec(Option_t * option)
 }
 
 //____________________________________________________________________________
-Bool_t AliEMCALClusterizerv1::FindFit(AliEMCALTowerRecPoint * emcRP, AliEMCALDigit ** maxAt, Float_t * maxAtEnergy,
+Bool_t AliEMCALClusterizerv1::FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** maxAt, Float_t * maxAtEnergy,
                                    Int_t nPar, Float_t * fitparameters) const
 { 
   // Calls TMinuit to fit the energy distribution of a cluster with several maxima 
@@ -199,7 +198,7 @@ Bool_t AliEMCALClusterizerv1::FindFit(AliEMCALTowerRecPoint * emcRP, AliEMCALDig
   for(iDigit = 0; iDigit < nDigits; iDigit++){
     digit = maxAt[iDigit]; 
 
-    Int_t relid[3] ;
+    Int_t relid[2] ;
     Float_t x = 0.;
     Float_t z = 0.;
     geom->AbsToRelNumbering(digit->GetId(), relid) ;
@@ -314,36 +313,29 @@ Int_t AliEMCALClusterizerv1::AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d
 
   Int_t rv = 0 ; 
 
-  Int_t relid1[3] ; 
+  Int_t relid1[2] ; 
   geom->AbsToRelNumbering(d1->GetId(), relid1) ; 
 
-  Int_t relid2[3] ; 
+  Int_t relid2[2] ; 
   geom->AbsToRelNumbering(d2->GetId(), relid2) ; 
   
-  if ( (relid1[0] == relid2[0])){ // inside the same EMCAL Arm 
-    Int_t rowdiff = TMath::Abs( relid1[1] - relid2[1] ) ;  
-    Int_t coldiff = TMath::Abs( relid1[2] - relid2[2] ) ;  
-    
-    if (( coldiff <= 1 )  && ( rowdiff <= 1 )){
-      if(TMath::Abs(d1->GetTime() - d2->GetTime() ) < fTimeGate)
-        rv = 1 ; 
-    }
-    else {
-      if((relid2[1] > relid1[1]) && (relid2[2] > relid1[2]+1)) 
-       rv = 2; //  Difference in row numbers is too large to look further 
-    }
 
-  } 
+  Int_t rowdiff = TMath::Abs( relid1[0] - relid2[0] ) ;  
+  Int_t coldiff = TMath::Abs( relid1[1] - relid2[1] ) ;  
+  
+  if (( coldiff <= 1 )  && ( rowdiff <= 1 )){
+    if(TMath::Abs(d1->GetTime() - d2->GetTime() ) < fTimeGate)
+      rv = 1 ; 
+  }
   else {
-    
-    if(relid1[0] < relid2[0])  
-      rv=0 ;
+    if((relid2[0] > relid1[0]) && (relid2[1] > relid1[1]+1)) 
+      rv = 2; //  Difference in row numbers is too large to look further 
   }
-
   if (gDebug == 2 ) 
-    printf("AreNeighbours: neighbours=%d, id1=%d, relid1=%d,%d,%d \n id2=%d, relid2=%d,%d,%d ", 
-        rv, d1->GetId(), relid1[0], relid1[1], relid1[2],
-        d2->GetId(), relid2[0], relid2[1], relid2[2]) ;   
+    printf("AreNeighbours: neighbours=%d, id1=%d, relid1=%d,%d \n id2=%d, relid2=%d,%d ", 
+        rv, d1->GetId(), relid1[0], relid1[1],
+        d2->GetId(), relid2[0], relid2[1]) ;   
   
   return rv ; 
 }
@@ -375,12 +367,12 @@ void AliEMCALClusterizerv1::WriteRecPoints()
 
   //Evaluate position, dispersion and other RecPoint properties for EC section
   for(index = 0; index < aECARecPoints->GetEntries(); index++)
-    (dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(index)))->EvalAll(fECAW0,digits) ;
+    (dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(index)))->EvalAll(fECAW0,digits) ;
   
   aECARecPoints->Sort() ;
 
   for(index = 0; index < aECARecPoints->GetEntries(); index++)
-    (dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(index)))->SetIndexInList(index) ;
+    (dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(index)))->SetIndexInList(index) ;
 
   aECARecPoints->Expand(aECARecPoints->GetEntriesFast()) ; 
   
@@ -453,10 +445,9 @@ void AliEMCALClusterizerv1::MakeClusters()
        // start a new Tower RecPoint
        if(fNumberOfECAClusters >= aECARecPoints->GetSize()) 
          aECARecPoints->Expand(2*fNumberOfECAClusters+1) ;
-       AliEMCALTowerRecPoint * rp = new  AliEMCALTowerRecPoint("") ; 
-       rp->SetECA() ; 
+       AliEMCALRecPoint * rp = new  AliEMCALRecPoint("") ; 
        aECARecPoints->AddAt(rp, fNumberOfECAClusters) ;
-       clu = dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(fNumberOfECAClusters)) ; 
+       clu = dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(fNumberOfECAClusters)) ; 
        fNumberOfECAClusters++ ; 
        clu->AddDigit(*digit, Calibrate(digit->GetAmp())) ; 
        clusterECAdigitslist[iDigitInECACluster] = digit->GetIndexInList() ;    
@@ -521,7 +512,7 @@ Double_t  AliEMCALClusterizerv1::ShowerShape(Double_t r)
 }
 
 //____________________________________________________________________________
-void  AliEMCALClusterizerv1::UnfoldCluster(AliEMCALTowerRecPoint * /*iniTower*/, 
+void  AliEMCALClusterizerv1::UnfoldCluster(AliEMCALRecPoint * /*iniTower*/, 
                                           Int_t /*nMax*/, 
                                           AliEMCALDigit ** /*maxAt*/, 
                                           Float_t * /*maxAtEnergy*/) const
@@ -599,7 +590,7 @@ void AliEMCALClusterizerv1::PrintRecPoints(Option_t * option)
     printf("Index    Ene(GeV) Multi Module     phi     r   theta    X    Y      Z   Dispersion Lambda 1   Lambda 2  # of prim  Primaries list\n") ;      
     
     for (index = 0 ; index < aECARecPoints->GetEntries() ; index++) {
-      AliEMCALTowerRecPoint * rp = dynamic_cast<AliEMCALTowerRecPoint * >(aECARecPoints->At(index)) ; 
+      AliEMCALRecPoint * rp = dynamic_cast<AliEMCALRecPoint * >(aECARecPoints->At(index)) ; 
       TVector3  globalpos;  
       rp->GetGlobalPosition(globalpos);
       TVector3  localpos;  
@@ -609,8 +600,8 @@ void AliEMCALClusterizerv1::PrintRecPoints(Option_t * option)
       Int_t * primaries; 
       Int_t nprimaries;
       primaries = rp->GetPrimaries(nprimaries);
-      printf("\n%6d  %8.4f  %3d     %2d     %4.1f    %4.1f %4.1f  %4.1f %4.1f %4.1f    %4.1f   %4f  %4f    %2d     : ", 
-            rp->GetIndexInList(), rp->GetEnergy(), rp->GetMultiplicity(), rp->GetEMCALArm(), 
+      printf("\n%6d  %8.4f  %3d     %4.1f    %4.1f %4.1f  %4.1f %4.1f %4.1f    %4.1f   %4f  %4f    %2d     : ", 
+            rp->GetIndexInList(), rp->GetEnergy(), rp->GetMultiplicity(),
             globalpos.X(), globalpos.Y(), globalpos.Z(), localpos.X(), localpos.Y(), localpos.Z(), 
             rp->GetDispersion(), lambda[0], lambda[1], nprimaries) ; 
       for (Int_t iprimary=0; iprimary<nprimaries; iprimary++) {
index 1462a78a7bd290f0c55f5d3d48e09ccf2608a799..925623544b9a67667c10abf93ad3bcdc7fc06172 100644 (file)
@@ -24,7 +24,7 @@
 // --- AliRoot header files ---
 
 #include "AliEMCALClusterizer.h"
-class AliEMCALTowerRecPoint ; 
+class AliEMCALRecPoint ; 
 class AliEMCALDigit ;
 class AliEMCALDigitizer ;
 class AliEMCALGeometry ;
@@ -78,13 +78,13 @@ private:
   const TString BranchName() const ; 
   void    GetCalibrationParameters(void) ;
   
-  Bool_t  FindFit(AliEMCALTowerRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy, 
+  Bool_t  FindFit(AliEMCALRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy, 
                  Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
   void Init() ;
   void InitParameters() ;
 
   virtual void   MakeUnfolding() const;
-  void           UnfoldCluster(AliEMCALTowerRecPoint * /*iniEmc*/, Int_t /*Nmax*/, 
+  void           UnfoldCluster(AliEMCALRecPoint * /*iniEmc*/, Int_t /*Nmax*/, 
                               AliEMCALDigit ** /*maxAt*/,
                               Float_t * /*maxAtEnergy*/ ) const; //Unfolds cluster using TMinuit package
   void           PrintRecPoints(Option_t * option) ;
index 7940b54ff669e8560efc561914c76774d5007674..81af60746068ca31acf0434020429b3be037aaad 100644 (file)
@@ -95,7 +95,6 @@ public:
        // for a given eta and phi in the EMCAL it returns the tower index.
   Int_t TowerIndexFromEtaPhi(Float_t eta,Float_t phi) const;
        // for a given eta and phi in the EMCAL it returns the pretower index.
-       // Returns theta and phi (degree) for a given EMCAL cell indicated by relid or absid
   void PosInAlice(const Int_t *relid, Float_t &theta, Float_t &phi) const ;
   void PosInAlice(Int_t absid, Float_t &theta, Float_t &phi) const ;
   Bool_t AbsToRelNumbering(Int_t AbsId, Int_t *relid) const;
index 1dddd86ae0470704bf76d09099e39d3def38eebd..2b1bdb94a0f7842e0c93898a7bd5962f2057fb05 100644 (file)
@@ -37,7 +37,6 @@ class AliEMCAL ;
 class AliEMCALGeometry ; 
 class AliEMCALClusterizer ; 
 class AliEMCALRecPoint ; 
-class AliEMCALTowerRecPoint ; 
 class AliEMCALTrackSegmentMaker ;
 class AliEMCALTrackSegment ; 
 class AliEMCALPID ; 
@@ -133,7 +132,7 @@ class AliEMCALGetter : public TObject {
   
   //========== RecPoints =============
   TObjArray *             ECARecPoints() const;
-  AliEMCALTowerRecPoint * ECARecPoint(Int_t index) const{ return static_cast<AliEMCALTowerRecPoint *>(ECARecPoints()->At(index)) ;}    
+  AliEMCALRecPoint * ECARecPoint(Int_t index) const{ return static_cast<AliEMCALRecPoint *>(ECARecPoints()->At(index)) ;}    
   TTree *                 TreeR() const ;
   AliEMCALClusterizer *   Clusterizer()  ;
   TString                 GetRecPointsFileName() const { return EmcalLoader()->GetRecPointsFileName() ; } 
index 52ddf16ea9afd46ee922856bc7e82d9aa521547a..4e2ae3cbdb607b700ecef3b1f40ce3631248ec0e 100644 (file)
@@ -32,7 +32,6 @@ class TTask ;
 #include "AliRunLoader.h"
 #include "AliEMCALDigit.h"
 #include "AliEMCALRecPoint.h"
-#include "AliEMCALTowerRecPoint.h" 
 #include "AliEMCALTrackSegment.h"
 #include "AliEMCALClusterizer.h"
 #include "AliEMCALTrackSegmentMaker.h" 
@@ -138,7 +137,7 @@ class AliEMCALLoader : public AliLoader {
   void MakeDigitsArray();
   /****  R e c P o i n t s  ****/
   TObjArray * ECARecPoints();
-  const AliEMCALTowerRecPoint * ECARecPoint(Int_t index) ;
+  const AliEMCALRecPoint * ECARecPoint(Int_t index) ;
   void MakeRecPointsArray();
   /****   T r a c k S e g m e n t s ****/
   TClonesArray * TrackSegments();
@@ -281,11 +280,11 @@ inline TObjArray * AliEMCALLoader::ECARecPoints()
 
 /******************************************************************************/
 
-inline const AliEMCALTowerRecPoint * AliEMCALLoader::ECARecPoint(Int_t index)
+inline const AliEMCALRecPoint * AliEMCALLoader::ECARecPoint(Int_t index)
 {
   TObjArray* tcarr = ECARecPoints();
   if (tcarr)
-    return dynamic_cast<const AliEMCALTowerRecPoint*>(tcarr->At(index));
+    return dynamic_cast<const AliEMCALRecPoint*>(tcarr->At(index));
   return 0x0; 
 }
 
index 3d48dc5e895138ed1babedda5f2957f0c3d6c854..e854449b6a5d937d2cded09df9474998dc85cd60 100644 (file)
@@ -95,7 +95,7 @@ Float_t  AliEMCALPIDv1::GetCalibratedEnergy(Float_t e) const
 
 }
 //____________________________________________________________________________
-TVector3 AliEMCALPIDv1::GetMomentumDirection(AliEMCALTowerRecPoint * emc)const 
+TVector3 AliEMCALPIDv1::GetMomentumDirection(AliEMCALRecPoint * emc)const 
 { 
   // Calculates the momentum direction:
   // direction is given by IP and this RecPoint
@@ -103,9 +103,9 @@ TVector3 AliEMCALPIDv1::GetMomentumDirection(AliEMCALTowerRecPoint * emc)const
 
   TVector3 dir(0,0,0) ; 
   TVector3 emcglobalpos ;
-  TMatrix  dummy ;
+  // TMatrix  dummy ;
   
-  emc->GetGlobalPosition(emcglobalpos, dummy) ;
+  emc->GetGlobalPosition(emcglobalpos) ;
   
 
   dir = emcglobalpos ;  
@@ -201,10 +201,10 @@ void  AliEMCALPIDv1::MakeRecParticles(){
   recParticles->Clear();
 
   TIter next(aECARecPoints) ; 
-  AliEMCALTowerRecPoint * eca ; 
+  AliEMCALRecPoint * eca ; 
   Int_t index = 0 ; 
   AliEMCALRecParticle * rp ; 
-  while ( (eca = (AliEMCALTowerRecPoint *)next()) ) {
+  while ( (eca = (AliEMCALRecPoint *)next()) ) {
     
     new( (*recParticles)[index] ) AliEMCALRecParticle() ;
     rp = (AliEMCALRecParticle *)recParticles->At(index) ; 
index 1c61092b5758f5c20604827663738f42d8c66040..46ad900522ca808ce864edbed8ac8b8954546f14 100644 (file)
@@ -21,7 +21,6 @@ class TPrincipal ;
 // --- Standard library ---
 
 // --- AliRoot header files ---
-class AliEMCALTowerRecPoint ;
 class AliEMCALRecPoint ;
 
 #include "AliEMCALPID.h"
@@ -40,7 +39,7 @@ class  AliEMCALPIDv1 : public AliEMCALPID {
 
   virtual const Int_t GetRecParticlesInRun() const  {return fRecParticlesInRun ;}  
   Float_t  GetCalibratedEnergy    (Float_t e)                 const;
-  TVector3 GetMomentumDirection(AliEMCALTowerRecPoint * emc)const ;
+  TVector3 GetMomentumDirection(AliEMCALRecPoint * emc)const ;
 
   virtual void Print(Option_t * option) const ;
  
index 5f774f5837b9f1ad0e1dc369631e8cb560ad1ff9..37e49ba2accd62e2bbb709bc7e4c759985056675 100644 (file)
@@ -81,7 +81,8 @@ const Int_t AliEMCALRecParticle::GetNPrimariesToRecParticles() const
   // Returns the number of primaries at the origine of a RecParticle
   Int_t rv = 0 ;
   AliEMCALGetter * gime = AliEMCALGetter::Instance() ; 
-  dynamic_cast<AliEMCALTowerRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(rv) ; 
+  dynamic_cast<AliEMCALRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(rv) ; 
+
   return rv ; 
 }
 
@@ -98,7 +99,8 @@ const TParticle * AliEMCALRecParticle::GetPrimary(Int_t index) const
   Int_t dummy ; 
   AliEMCALGetter * gime = AliEMCALGetter::Instance() ; 
 
-  Int_t primaryindex = dynamic_cast<AliEMCALTowerRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(dummy)[index] ; 
+  Int_t primaryindex = dynamic_cast<AliEMCALRecPoint*>(gime->ECARecPoints()->At(GetEMCALRPIndex()))->GetPrimaries(dummy)[index] ; 
+
   return gime->Primary(primaryindex) ;
 }
 
index ae85e048a9649b757f4156071a106b017ccf26d0..015f929e9860e62d2ab5892d7c49b85adc2eed44 100644 (file)
  **************************************************************************/
 /* $Id$ */
 //_________________________________________________________________________
-//  Base Class for EMCAL Reconstructed Points  
-//  Why should I put meaningless comments
-//  just to satisfy
-//  the code checker                
+//  Reconstructed Points for the EMCAL
+//  A RecPoint is a cluster of digits
 //*-- Author: Yves Schutz (SUBATECH)
+//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
+//*-- Author: Heather Gray (LBL) merged AliEMCALRecPoint and AliEMCALTowerRecPoint 02/04
 
 // --- ROOT system ---
 #include "TPad.h"
 #include "TGraph.h"
 #include "TPaveText.h"
 #include "TClonesArray.h"
+#include "TMath.h" 
 
 // --- Standard library ---
 
 // --- AliRoot header files ---
-
+#include "AliGenerator.h"
 #include "AliEMCALGeometry.h"
 #include "AliEMCALDigit.h"
 #include "AliEMCALRecPoint.h"
@@ -43,22 +44,131 @@ AliEMCALRecPoint::AliEMCALRecPoint()
   : AliRecPoint()
 {
   // ctor
-
   fMaxTrack = 0 ;
-  fTheta = fPhi = 0. ; 
-  fEMCALArm = 0;
-  fECASection = kFALSE ; 
+  fMulDigit   = 0 ;  
+  fAmp   = 0. ;   
+  fCoreEnergy = 0 ; 
+  fEnergyList = 0 ;
+  fTime = 0. ;
+  fLocPos.SetX(0.)  ;      //Local position should be evaluated
+  fCoreRadius = 10;        //HG Check this
 }
 
 //____________________________________________________________________________
 AliEMCALRecPoint::AliEMCALRecPoint(const char * opt) : AliRecPoint(opt)
 {
   // ctor
-  
   fMaxTrack = 200 ;
-  fTheta = fPhi = 0. ; 
-  fEMCALArm = 1;
+  fMulDigit   = 0 ;  
+  fAmp   = 0. ;   
+  fCoreEnergy = 0 ; 
+  fEnergyList = 0 ;
+  fTime = -1. ;
+  fLocPos.SetX(1000000.)  ;      //Local position should be evaluated
+  fCoreRadius = 10;        //HG Check this
+}
+//____________________________________________________________________________
+AliEMCALRecPoint::~AliEMCALRecPoint()
+{
+  // dtor
+  if ( fEnergyList )
+    delete[] fEnergyList ; 
+}
+
+//____________________________________________________________________________
+void AliEMCALRecPoint::AddDigit(AliEMCALDigit & digit, Float_t Energy)
+{
+  // Adds a digit to the RecPoint
+  // and accumulates the total amplitude and the multiplicity 
+  
+  if(fEnergyList == 0)
+    fEnergyList =  new Float_t[fMaxDigit]; 
+
+  if ( fMulDigit >= fMaxDigit ) { // increase the size of the lists 
+    fMaxDigit*=2 ; 
+    Int_t * tempo = new ( Int_t[fMaxDigit] ) ; 
+    Float_t * tempoE =  new ( Float_t[fMaxDigit] ) ;
+
+    Int_t index ;     
+    for ( index = 0 ; index < fMulDigit ; index++ ){
+      tempo[index]  = fDigitsList[index] ;
+      tempoE[index] = fEnergyList[index] ; 
+    }
+    
+    delete [] fDigitsList ; 
+    fDigitsList =  new ( Int_t[fMaxDigit] ) ;
+    delete [] fEnergyList ;
+    fEnergyList =  new ( Float_t[fMaxDigit] ) ;
+
+    for ( index = 0 ; index < fMulDigit ; index++ ){
+      fDigitsList[index] = tempo[index] ;
+      fEnergyList[index] = tempoE[index] ; 
+    }
+    delete [] tempo ;
+    delete [] tempoE ; 
+  } // if
+  
+  fDigitsList[fMulDigit]   = digit.GetIndexInList()  ; 
+  fEnergyList[fMulDigit]   = Energy ;
+  fMulDigit++ ; 
+  fAmp += Energy ; 
+
+}
+//____________________________________________________________________________
+Bool_t AliEMCALRecPoint::AreNeighbours(AliEMCALDigit * digit1, AliEMCALDigit * digit2 ) const
+{
+  // Tells if (true) or not (false) two digits are neighbours
+  // A neighbour is defined as being two digits which share a corner
+  
+  Bool_t areNeighbours = kFALSE ;
+  
+  AliEMCALGeometry * geom =  (AliEMCALGetter::Instance())->EMCALGeometry();
+
+  Int_t relid1[2] ; 
+  geom->AbsToRelNumbering(digit1->GetId(), relid1) ; 
+
+  Int_t relid2[2] ; 
+  geom->AbsToRelNumbering(digit2->GetId(), relid2) ; 
+  
+  Int_t rowdiff = TMath::Abs( relid1[0] - relid2[0] ) ;  
+  Int_t coldiff = TMath::Abs( relid1[1] - relid2[1] ) ;  
+
+  if (( coldiff <= 1 )  && ( rowdiff <= 1 ) && (coldiff + rowdiff > 0)) 
+    areNeighbours = kTRUE ;
   
+  return areNeighbours;
+}
+
+//____________________________________________________________________________
+Int_t AliEMCALRecPoint::Compare(const TObject * obj) const
+{
+  // Compares two RecPoints according to their position in the EMCAL modules
+
+  Float_t delta = 1 ; //Width of "Sorting row". If you change this 
+                      //value (what is senseless) change as well delta in
+                      //AliEMCALTrackSegmentMakerv* and other RecPoints...
+  Int_t rv ; 
+
+  AliEMCALRecPoint * clu = (AliEMCALRecPoint *)obj ; 
+
+  TVector3 locpos1; 
+  GetLocalPosition(locpos1);
+  TVector3 locpos2;  
+  clu->GetLocalPosition(locpos2);  
+
+  Int_t rowdif = (Int_t)TMath::Ceil(locpos1.X()/delta)-(Int_t)TMath::Ceil(locpos2.X()/delta) ;
+  if (rowdif> 0) 
+    rv = 1 ;
+  else if(rowdif < 0) 
+    rv = -1 ;
+  else if(locpos1.Y()>locpos2.Y()) 
+    rv = -1 ;
+  else 
+    rv = 1 ; 
+
+  return rv ; 
 }
 
 //____________________________________________________________________________
@@ -67,11 +177,12 @@ Int_t AliEMCALRecPoint::DistancetoPrimitive(Int_t px, Int_t py)
   // Compute distance from point px,py to  a AliEMCALRecPoint considered as a Tmarker
   // Compute the closest distance of approach from point px,py to this marker.
   // The distance is computed in pixels units.
+  // HG Still need to update -> Not sure what this should achieve
 
   TVector3 pos(0.,0.,0.) ;
-  GetLocalPosition( pos) ;
+  GetLocalPosition(pos) ;
   Float_t x =  pos.X() ;
-  Float_t y =  pos.Z() ;
+  Float_t y =  pos.Y() ;
   const Int_t kMaxDiff = 10;
   Int_t pxm  = gPad->XtoAbsPixel(x);
   Int_t pym  = gPad->YtoAbsPixel(y);
@@ -90,7 +201,7 @@ Int_t AliEMCALRecPoint::DistancetoPrimitive(Int_t px, Int_t py)
  }
 
 //______________________________________________________________________________
-void AliEMCALRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t)
+void AliEMCALRecPoint::ExecuteEvent(Int_t /*event*/, Int_t, Int_t)
 {
   // Execute action corresponding to one event
   // This member function is called when a AliEMCALRecPoint is clicked with the locator
@@ -100,7 +211,7 @@ void AliEMCALRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t)
 
   //  static Int_t pxold, pyold;
 
-  static TGraph *  digitgraph = 0 ;
+  /* static TGraph *  digitgraph = 0 ;
   static TPaveText* clustertext = 0 ;
   
   if (!gPad->IsEditable()) return;
@@ -113,7 +224,7 @@ void AliEMCALRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t)
     AliEMCALGeometry * emcalgeom =  (AliEMCALGetter::Instance())->EMCALGeometry() ;
 
     Int_t iDigit;
-    Int_t relid[3] ;
+    Int_t relid[2] ;
   
     const Int_t kMulDigit=AliEMCALRecPoint::GetDigitsMultiplicity() ;
     Float_t * xi = new Float_t [kMulDigit] ; 
@@ -166,29 +277,204 @@ break;
     
     break;
     
+    }*/
+}
+//____________________________________________________________________________
+void AliEMCALRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits) 
+{
+  // Evaluates all shower parameters
+
+  EvalLocalPosition(logWeight, digits) ;
+  EvalElipsAxis(logWeight, digits) ;
+  EvalDispersion(logWeight, digits) ;
+  EvalCoreEnergy(logWeight, digits);
+  EvalTime(digits) ;
+
+  //EvalPrimaries(digits) ;
+}
+
+//____________________________________________________________________________
+void  AliEMCALRecPoint::EvalDispersion(Float_t logWeight, TClonesArray * digits)
+{
+  // Calculates the dispersion of the shower at the origin of the RecPoint
+
+  Float_t d    = 0. ;
+  Float_t wtot = 0. ;
+
+  AliEMCALDigit * digit ;
+  AliEMCALGeometry * geom = (AliEMCALGetter::Instance())->EMCALGeometry();
+  
+  // Calculates the centre of gravity in the local EMCAL-module coordinates   
+  Int_t iDigit;
+
+  if (!fLocPos.X() || !fLocPos.Y()) 
+    EvalLocalPosition(logWeight, digits) ;
+  
+  const Float_t kDeg2Rad = TMath::DegToRad() ; 
+    
+  Float_t cluEta =  fLocPos.X() ; 
+  Float_t cluPhi =  fLocPos.Y() ; 
+  Float_t cluR =  fLocPos.Z() ; 
+  
+  if (gDebug == 2) 
+    printf("EvalDispersion: eta,phi,r = %f,%f,%f", cluEta, cluPhi, cluR) ;
+  
+  // Calculates the dispersion in coordinates 
+  wtot = 0.;
+  for(iDigit=0; iDigit < fMulDigit; iDigit++) {
+    digit = (AliEMCALDigit *) digits->At(fDigitsList[iDigit])  ;
+    Float_t etai = 0.;
+    Float_t phii = 0.;
+    geom->EtaPhiFromIndex(digit->GetId(), etai, phii);
+    phii = phii * kDeg2Rad;
+    if (gDebug == 2) 
+      printf("EvalDispersion: id = %d, etai,phii = %f,%f", digit->GetId(), etai, phii) ;
+
+    Float_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
+    d += w * ( (etai-cluEta)*(etai-cluEta) + (phii-cluPhi)*(phii-cluPhi) ) ; 
+    wtot+=w ;
   }
+  
+  if ( wtot > 0 ) 
+    d /= wtot ;
+  else 
+    d = 0. ; 
+
+  fDispersion = TMath::Sqrt(d) ;
 }
+
 //____________________________________________________________________________
-void AliEMCALRecPoint::EvalAll(Float_t /*logWeight*/,TClonesArray * digits) 
+void AliEMCALRecPoint::EvalLocalPosition(Float_t logWeight, TClonesArray * digits)
 {
-  //evaluates (if necessary) all RecPoint data members 
+  // Calculates the center of gravity in the local EMCAL-module coordinates 
+  Float_t wtot = 0. ;
+  //  Int_t relid[3] ;
+  
+  AliEMCALDigit * digit ;
+  AliEMCALGeometry * geom  =  (AliEMCALGetter::Instance())->EMCALGeometry();
+  Int_t iDigit;
+  Float_t cluEta = 0;
+  Float_t cluPhi = 0;
+  const Float_t kDeg2Rad = TMath::DegToRad();
+
+  for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+    digit = dynamic_cast<AliEMCALDigit *>(digits->At(fDigitsList[iDigit])) ;
+
+    Float_t etai ;
+    Float_t phii ;
+    geom->EtaPhiFromIndex(digit->GetId(), etai, phii);
+    phii = phii * kDeg2Rad;
+    Float_t w = TMath::Max( 0., logWeight + TMath::Log( fEnergyList[iDigit] / fAmp ) ) ;
+    cluEta += (etai * w) ;
+    cluPhi += (phii * w );
+    wtot += w ;
+  }
 
-  EvalPrimaries(digits) ;
+  if ( wtot > 0 ) { 
+    cluEta /= wtot ;
+    cluPhi /= wtot ;
+  } else {
+    cluEta = -1 ; 
+    cluPhi = -1.; 
+  }
+  
+  fLocPos.SetX(cluEta);
+  fLocPos.SetY(cluPhi);
+  fLocPos.SetZ(geom->GetIP2ECASection());
+    
+  if (gDebug==2)
+    printf("EvalLocalPosition: eta,phi,r = %f,%f,%f", fLocPos.X(), fLocPos.Y(), fLocPos.Z()) ; 
+  fLocPosM = 0 ;
 }
 
+//______________________________________________________________________________
+void AliEMCALRecPoint::EvalCoreEnergy(Float_t logWeight, TClonesArray * digits)
+{
+  // This function calculates energy in the core, 
+  // i.e. within a radius rad = 3cm around the center. Beyond this radius
+  // in accordance with shower profile the energy deposition 
+  // should be less than 2%
+
+  AliEMCALDigit * digit ;
+  const Float_t kDeg2Rad = TMath::DegToRad() ;
+  AliEMCALGeometry * geom = (AliEMCALGetter::Instance())->EMCALGeometry();    
+  Int_t iDigit;
+
+  if (!fLocPos.X() || !fLocPos.Y() ) {
+    EvalLocalPosition(logWeight, digits);
+  }
+  
+  for(iDigit=0; iDigit < fMulDigit; iDigit++) {
+    digit = (AliEMCALDigit *) ( digits->At(fDigitsList[iDigit]) ) ;
+    Float_t etai = 0. ;
+    Float_t phii = 0. ;
+    geom->PosInAlice(digit->GetId(), etai, phii);
+    phii = phii * kDeg2Rad;
+  
+    Float_t distance = TMath::Sqrt((etai-fLocPos.X())*(etai-fLocPos.X())+(phii-fLocPos.Y())*(phii-fLocPos.Y())) ;
+    if(distance < fCoreRadius)
+      fCoreEnergy += fEnergyList[iDigit] ;
+  }
+  
+}
 //____________________________________________________________________________
-void AliEMCALRecPoint::EvalEMCALArm(AliEMCALDigit * digit) 
+void  AliEMCALRecPoint::EvalElipsAxis(Float_t logWeight,TClonesArray * digits)
 {
-  // Returns the EMCAL module in which the RecPoint is found
+  // Calculates the axis of the shower ellipsoid in eta and phi
 
+  Double_t wtot = 0. ;
+  Double_t x    = 0.;
+  Double_t z    = 0.;
+  Double_t dxx  = 0.;
+  Double_t dzz  = 0.;
+  Double_t dxz  = 0.;
 
-  if( fEMCALArm == 0){
-  Int_t relid[3] ; 
+  AliEMCALDigit * digit ;
+
+  AliEMCALGeometry * geom = (AliEMCALGetter::Instance())->EMCALGeometry();
+
+  Int_t iDigit;
   
-  AliEMCALGeometry * emcalgeom = (AliEMCALGetter::Instance())->EMCALGeometry();
+  for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+    digit = (AliEMCALDigit *) digits->At(fDigitsList[iDigit])  ;
+    Float_t etai = 0. ;
+    Float_t phii = 0. ; 
+    geom->EtaPhiFromIndex(digit->GetId(), etai, phii);
+    Double_t w = TMath::Max(0.,logWeight+TMath::Log(fEnergyList[iDigit]/fAmp ) ) ;
+    dxx  += w * etai * etai ;
+    x    += w * etai ;
+    dzz  += w * phii * phii ;
+    z    += w * phii ; 
+    dxz  += w * etai * etai ; 
+    wtot += w ;
+  }
+  if ( wtot > 0 ) { 
+    dxx /= wtot ;
+    x   /= wtot ;
+    dxx -= x * x ;
+    dzz /= wtot ;
+    z   /= wtot ;
+    dzz -= z * z ;
+    dxz /= wtot ;
+    dxz -= x * z ;
 
-  emcalgeom->AbsToRelNumbering(digit->GetId(), relid) ;
-  fEMCALArm = relid[0];
+    fLambda[0] =  0.5 * (dxx + dzz) + TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz )  ;
+    if(fLambda[0] > 0)
+      fLambda[0] = TMath::Sqrt(fLambda[0]) ;
+    else
+      fLambda[0] = 0;
+    
+    fLambda[1] =  0.5 * (dxx + dzz) - TMath::Sqrt( 0.25 * (dxx - dzz) * (dxx - dzz) + dxz * dxz )  ;
+    if(fLambda[1] > 0) //To avoid exception if numerical errors lead to negative lambda.
+      fLambda[1] = TMath::Sqrt(fLambda[1]) ;
+    else
+      fLambda[1]= 0. ;
+  } else { 
+    fLambda[0]= 0. ;
+    fLambda[1]= 0. ;
   }
 }
 
@@ -242,28 +528,125 @@ void  AliEMCALRecPoint::EvalPrimaries(TClonesArray * digits)
 
 }
 
+//____________________________________________________________________________
+void AliEMCALRecPoint::GetLocalPosition(TVector3 & lpos) const
+{
+  // returns the position of the cluster in the local reference system of ALICE
+  // X = eta, Y = phi, Z = r (a constant for the EMCAL)
+  
+  lpos.SetX(fLocPos.X()) ;
+  lpos.SetY(fLocPos.Y()) ;
+  lpos.SetZ(fLocPos.Z()) ;
+}
+
 //____________________________________________________________________________
 void AliEMCALRecPoint::GetGlobalPosition(TVector3 & gpos) const
 {
   // returns the position of the cluster in the global reference system of ALICE
+  // These are now the Cartesian X, Y and Z
+
+  AliEMCALGeometry * geom = (AliEMCALGetter::Instance())->EMCALGeometry();
+  Int_t absid = geom->TowerIndexFromEtaPhi(fLocPos.X(), TMath::RadToDeg()*fLocPos.Y());
+  geom->XYZFromIndex(absid, gpos);
+}
+
+//____________________________________________________________________________
+Float_t AliEMCALRecPoint::GetMaximalEnergy(void) const
+{
+  // Finds the maximum energy in the cluster
   
-  AliEMCALGeometry * emcalgeom = AliEMCALGetter::Instance()->EMCALGeometry();  
-  gpos.SetX(fPhi) ;
-  if ( IsInECA() ) 
-    gpos.SetY(emcalgeom->GetIP2ECASection()) ;
-  else 
-    Fatal("GetGlobalPosition", "Unexpected tower section") ; 
-  gpos.SetZ(fTheta) ; 
+  Float_t menergy = 0. ;
+
+  Int_t iDigit;
+
+  for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+    if(fEnergyList[iDigit] > menergy) 
+      menergy = fEnergyList[iDigit] ;
+  }
+  return menergy ;
 }
 
 //____________________________________________________________________________
-void AliEMCALRecPoint::GetLocalPosition(TVector3 & lpos) const
+Int_t AliEMCALRecPoint::GetMultiplicityAtLevel(Float_t H) const
 {
-  // returns the position of the cluster in the global reference system of ALICE
+  // Calculates the multiplicity of digits with energy larger than H*energy 
+  
+  Int_t multipl   = 0 ;
+  Int_t iDigit ;
+  for(iDigit=0; iDigit<fMulDigit; iDigit++) {
+
+    if(fEnergyList[iDigit] > H * fAmp) 
+      multipl++ ;
+  }
+  return multipl ;
+}
+
+//____________________________________________________________________________
+Int_t  AliEMCALRecPoint::GetNumberOfLocalMax(AliEMCALDigit **  maxAt, Float_t * maxAtEnergy,
+                                              Float_t locMaxCut,TClonesArray * digits) const
+{ 
+  // Calculates the number of local maxima in the cluster using fLocalMaxCut as the minimum
+  // energy difference between two local maxima
+
+  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]) {
+      digit = maxAt[iDigit] ;
+          
+      for(iDigitN = 0; iDigitN < fMulDigit; iDigitN++) {       
+       digitN = (AliEMCALDigit *) digits->At(fDigitsList[iDigitN]) ; 
+       
+       if ( AreNeighbours(digit, digitN) ) {
+         if (fEnergyList[iDigit] > fEnergyList[iDigitN] ) {    
+           maxAt[iDigitN] = 0 ;
+           // but may be digit too is not local max ?
+           if(fEnergyList[iDigit] < fEnergyList[iDigitN] + locMaxCut) 
+             maxAt[iDigit] = 0 ;
+         }
+         else {
+           maxAt[iDigit] = 0 ;
+           // but may be digitN too is not local max ?
+           if(fEnergyList[iDigit] > fEnergyList[iDigitN] - locMaxCut) 
+             maxAt[iDigitN] = 0 ; 
+         } 
+       } // if Areneighbours
+      } // while digitN
+    } // slot not empty
+  } // while digit
+  
+  iDigitN = 0 ;
+  for(iDigit = 0; iDigit < fMulDigit; iDigit++) { 
+    if(maxAt[iDigit] ){
+      maxAt[iDigitN] = maxAt[iDigit] ;
+      maxAtEnergy[iDigitN] = fEnergyList[iDigit] ;
+      iDigitN++ ; 
+    }
+  }
+  return iDigitN ;
+}
+//____________________________________________________________________________
+void AliEMCALRecPoint::EvalTime(TClonesArray * digits){
+  // time is set to the time of the digit with the maximum energy
+
+  Float_t maxE = 0;
+  Int_t maxAt = 0;
+  for(Int_t idig=0; idig < fMulDigit; idig++){
+    if(fEnergyList[idig] > maxE){
+      maxE = fEnergyList[idig] ;
+      maxAt = idig;
+    }
+  }
+  fTime = ((AliEMCALDigit*) digits->At(fDigitsList[maxAt]))->GetTime() ;
   
-  lpos.SetX(fLocPos.X()) ;
-  lpos.SetY(fLocPos.Y()) ;
-  lpos.SetZ(fLocPos.Z()) ;
 }
 
 //______________________________________________________________________________
@@ -287,3 +670,17 @@ void AliEMCALRecPoint::Paint(Option_t *)
   gPad->SetAttMarkerPS(markercolor,markerstyle,markersize) ;
   gPad->PaintPolyMarker(1,&x,&y,"") ;
 }
+
+//______________________________________________________________________________
+Float_t AliEMCALRecPoint::EtaToTheta(Float_t arg) const
+{
+  //Converts Theta (Radians) to Eta(Radians)
+  return (2.*TMath::ATan(TMath::Exp(-arg)));
+}
+
+//______________________________________________________________________________
+Float_t AliEMCALRecPoint::ThetaToEta(Float_t arg) const
+{
+  //Converts Eta (Radians) to Theta(Radians)
+  return (-1 * TMath::Log(TMath::Tan(0.5 * arg)));
+}
index d682197174d73183d8db883eee7ec6af8442254f..2352e4d0637e7a02e4aeac762590a5086ecf9da8 100644 (file)
@@ -6,8 +6,11 @@
 //  Base Class for EMCAL Reconstructed Points  
 //  A recpoint being equivalent to a cluster in encal terminology                 
 //*-- Author: Yves Schutz (SUBATECH)
+//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
+//*-- Author: Heather Gray (LBL): merged AliEMCALRecPoint and AliEMCALTowerRecPoint 02/04
 
 // --- ROOT system ---
+class TVector3 ;  
 
 // --- Standard library ---
 
@@ -26,27 +29,39 @@ class AliEMCALRecPoint : public AliRecPoint {
   AliEMCALRecPoint(const char * opt) ;   // ctor 
   AliEMCALRecPoint(const AliEMCALRecPoint & rp):AliRecPoint(rp) { Fatal("cpy ctor", "not implemented") ; } 
   
-  virtual ~AliEMCALRecPoint(){
-    // dtor
-  }
-  virtual  void   AddDigit(AliDigitNew &){ Fatal("AddDigit", "use AddDigit(AliEMCALDigit & digit, Float_t Energy )") ; }
-  virtual  void   AddDigit(AliEMCALDigit & digit, Float_t Energy) = 0 ; 
-  virtual Int_t   Compare(const TObject * obj) const = 0 ;   
+  virtual ~AliEMCALRecPoint();
+  virtual void    AddDigit(AliDigitNew &){ Fatal("AddDigit", "use AddDigit(AliEMCALDigit & digit, Float_t Energy )") ; }
+  virtual void    AddDigit(AliEMCALDigit & digit, Float_t Energy); 
+  virtual Int_t   Compare(const TObject * obj) const;   
   virtual Int_t   DistancetoPrimitive(Int_t px, Int_t py);
   virtual void    Draw(Option_t * option="") ;
   virtual void    ExecuteEvent(Int_t event, Int_t, Int_t) ;
-  virtual void    EvalAll(Float_t /*logWeight*/,TClonesArray * digits) ;  
-  virtual void    EvalEMCALArm(AliEMCALDigit * digit) ;  
-  virtual void    EvalPrimaries(TClonesArray * digits) ;  
-  virtual Int_t   GetEMCALArm(void) const {return fEMCALArm ; }
-  virtual void    GetGlobalPosition(TVector3 & /*gpos*/, TMatrix & /*gmat*/) const {;} // return global position in ALICE
-  virtual void    GetGlobalPosition(TVector3 & gpos) const ; // return global position (r, theta, phi) in ALICE
-  virtual void    GetLocalPosition(TVector3 & lpos) const ; // return loca position (x, y, z) in EMCAL
-  //  virtual Int_t   GetEMCALMod(void) const {return fEMCALMod ; }
+
+  virtual void    EvalAll(Float_t logWeight, TClonesArray * digits);
+  virtual void    EvalLocalPosition(Float_t logWeight, TClonesArray * digits) ;
+  virtual void    EvalPrimaries(TClonesArray * digits) ;
+
+  // virtual void    GetGlobalPosition(TVector3 & gpos, TMatrix & /*gmat*/) const; // return global position in ALICE
+  virtual void    GetGlobalPosition(TVector3 & gpos) const; // return global position (x, y, z) in ALICE
+  virtual void    GetLocalPosition(TVector3 & lpos) const; // return local position (eta, phi, r) in EMCAL
   virtual Int_t * GetPrimaries(Int_t & number) const {number = fMulTrack ; 
                                                       return fTracksList ; }
+  Float_t         GetCoreEnergy()const {return fCoreEnergy ;}
+  virtual Float_t GetDispersion()const {return fDispersion ;}
+  virtual void    GetElipsAxis(Float_t * lambda)const {lambda[0] = fLambda[0]; lambda[1] = fLambda[1];};
+  
+  Float_t *   GetEnergiesList() const {return fEnergyList ;}       // gets the list of energies making this recpoint
+  Float_t     GetMaximalEnergy(void) const ;                       // get the highest energy in the cluster
+  Int_t       GetMaximumMultiplicity() const {return fMaxDigit ;}  // gets the maximum number of digits allowed
+  Int_t       GetMultiplicity(void) const { return fMulDigit ; }   // gets the number of digits making this recpoint
+  Int_t       GetMultiplicityAtLevel(Float_t level) const ;  // computes multiplicity of digits with 
+                                                                   // energy above relative level
+  virtual Int_t GetNumberOfLocalMax(AliEMCALDigit **  maxAt, Float_t * maxAtEnergy,
+                                    Float_t locMaxCut,TClonesArray * digits ) const ; 
+                                                                   // searches for the local maxima 
+  Float_t     GetTime(void) const{return  fTime ; }
   virtual Bool_t  IsEmc(void)const { return kTRUE ;  }
-  const Bool_t IsInECA(void) const { return fECASection ; } 
   virtual Bool_t  IsSortable() const { 
     // tells that this is a sortable object
     return kTRUE ; 
@@ -56,20 +71,28 @@ class AliEMCALRecPoint : public AliRecPoint {
     // Print prototype
   } 
   
-  void SetECA() { fECASection = kTRUE ; } 
   AliEMCALRecPoint & operator = (const AliEMCALRecPoint & )  {
     Fatal("operator =", "not implemented") ;
     return *this ; 
   }
 
 protected:
-  
-  Int_t fEMCALArm ; // EMCAM Arm number
-  Float_t fTheta ; // theta angle in Alice
-  Float_t fPhi ;   // phi angle in Alice
-  Bool_t  fECASection ; // tells if the recpoint is in ECAL section 
+          void  EvalCoreEnergy(Float_t logWeight,TClonesArray * digits) ;             
+         virtual void  EvalDispersion(Float_t logWeight,TClonesArray * digits) ;   // computes the dispersion of the shower
+         virtual void  EvalElipsAxis(Float_t logWeight, TClonesArray * digits );   // computes the axis of shower ellipsoide
+          void  EvalTime( TClonesArray * digits );
+         virtual Bool_t AreNeighbours(AliEMCALDigit * digit1, AliEMCALDigit * digit2 ) const;
+         Float_t ThetaToEta(Float_t arg) const;  //Converts Theta (Radians) to Eta(Radians)
+         Float_t EtaToTheta(Float_t arg) const;  //Converts Eta (Radians) to Theta(Radians)
+
+         Float_t fCoreEnergy ;       // energy in a shower core 
+         Float_t fLambda[2] ;        // shower ellipse axes
+         Float_t fDispersion ;       // shower dispersion
+         Float_t *fEnergyList ;      //[fMulDigit] energy of digits
+         Float_t fTime ;             // Time of the digit with maximal energy deposition
+         Float_t fCoreRadius;        // The radius in which the core energy is evaluated
 
-  ClassDef(AliEMCALRecPoint,3) // RecPoint for EMCAL (Base Class)
+  ClassDef(AliEMCALRecPoint,4) // RecPoint for EMCAL (Base Class)
  
 };
 
index bc731be826be1588dadf628800637755c90d7710..798509af2cdaa83ae2a2ef220da72bde8c35e03a 100644 (file)
@@ -33,7 +33,7 @@
 ClassImp(AliEMCALTrackSegment)
 
 //____________________________________________________________________________
-AliEMCALTrackSegment::AliEMCALTrackSegment( AliEMCALTowerRecPoint * eca)
+AliEMCALTrackSegment::AliEMCALTrackSegment( AliEMCALRecPoint * eca)
 {
   // ctor
   if( eca )   
index b106bb52bdf91d3fc2135875fc81ffef42437a74..2bd634ec1fcd584b3cfbde58c7e12f9d9dcdb127 100644 (file)
@@ -18,7 +18,7 @@ class TClonesArray ;
 // --- Standard library ---
 
 // --- AliRoot header files ---
-#include "AliEMCALTowerRecPoint.h" 
+#include "AliEMCALRecPoint.h" 
 class AliEMCALRecPoint ; 
 
 class AliEMCALTrackSegment : public TObject  {
@@ -26,7 +26,7 @@ class AliEMCALTrackSegment : public TObject  {
 public:
 
   AliEMCALTrackSegment() {} 
-  AliEMCALTrackSegment(AliEMCALTowerRecPoint * ec) ; 
+  AliEMCALTrackSegment(AliEMCALRecPoint * ec) ; 
   AliEMCALTrackSegment(const AliEMCALTrackSegment & ts) ;  // ctor                   
   virtual ~AliEMCALTrackSegment() {  } 
 
index bbc555db9ae369e4a4026f519af62faef2ab4fb0..9d1b408804627fdb3d67ef076d199159abb9b1f5 100644 (file)
@@ -84,7 +84,7 @@ const TString AliEMCALTrackSegmentMakerv1::BranchName() const
 }
 
 //____________________________________________________________________________
-Float_t  AliEMCALTrackSegmentMakerv1::HowClose(AliEMCALTowerRecPoint * ec, AliEMCALTowerRecPoint * rp, Bool_t &toofar)const
+Float_t  AliEMCALTrackSegmentMakerv1::HowClose(AliEMCALRecPoint * ec, AliEMCALRecPoint * rp, Bool_t &toofar)const
 {
   // Calculates the distance between the EMC RecPoint and the PPSD RecPoint
   // Clusters are sorted in "rows" and "columns" of width 1 cm
@@ -93,8 +93,10 @@ Float_t  AliEMCALTrackSegmentMakerv1::HowClose(AliEMCALTowerRecPoint * ec, AliEM
   Float_t delta = 10. ;  // large enough to be ineffective ??! 
 
  
-  TVector3 vecEC = ec->XYZInAlice() ;
-  TVector3 vecRP = rp->XYZInAlice() ;
+  TVector3 vecEC;
+  TVector3 vecRP;
+  ec->GetGlobalPosition(vecEC);
+  rp->GetGlobalPosition(vecRP);
   
   Float_t pro = TMath::Abs(1 - (vecEC * vecRP / ( vecEC.Mag() * vecRP.Mag() ))) ; 
 
@@ -146,20 +148,20 @@ void  AliEMCALTrackSegmentMakerv1::MakeLinks()const
   fPRELinkArray->Clear() ;    
   fHCALinkArray->Clear() ;    
 
-  AliEMCALTowerRecPoint * pre ;
-  AliEMCALTowerRecPoint * eca ;
-  AliEMCALTowerRecPoint * hca ;
+  AliEMCALRecPoint * pre ;
+  AliEMCALRecPoint * eca ;
+  AliEMCALRecPoint * hca ;
 
   Int_t iPRELink  = 0 ;
   Int_t iHCALink  = 0 ;
     
   Int_t iECARP;
   for(iECARP = 0; iECARP < aECARecPoints->GetEntriesFast(); iECARP++ ) {
-    eca = dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(iECARP)) ;
+    eca = dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(iECARP)) ;
     Bool_t toofar = kTRUE ;        
     Int_t iPRERP = 0 ;    
     for(iPRERP = 0; iPRERP < aPRERecPoints->GetEntriesFast(); iPRERP++ ) { 
-      pre = dynamic_cast<AliEMCALTowerRecPoint *>(aPRERecPoints->At(iPRERP)) ;
+      pre = dynamic_cast<AliEMCALRecPoint *>(aPRERecPoints->At(iPRERP)) ;
       Float_t prod = HowClose(eca, pre, toofar) ;    
       if(toofar)
        break ;  
@@ -170,7 +172,7 @@ void  AliEMCALTrackSegmentMakerv1::MakeLinks()const
     toofar = kTRUE ; 
     Int_t iHCARP = 0 ;    
     for(iHCARP = 0; iHCARP < aHCARecPoints->GetEntriesFast(); iHCARP++ ) { 
-      hca = dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(iHCARP)) ;
+      hca = dynamic_cast<AliEMCALRecPoint *>(aHCARecPoints->At(iHCARP)) ;
       Float_t prod = HowClose(eca, hca, toofar) ;    
       if(toofar)
        break ;  
@@ -223,7 +225,7 @@ void  AliEMCALTrackSegmentMakerv1::MakePairs()
   for(index = 0; index < nHCA; index ++)
     hcaExist[index] = kTRUE ;
   
-  AliEMCALTowerRecPoint * null = 0 ; 
+  AliEMCALRecPoint * null = 0 ; 
  // Finds the smallest links and makes pairs of PRE and ECAL clusters with largest scalar product 
  
   TIter nextPRE(fPRELinkArray) ;
@@ -236,8 +238,8 @@ void  AliEMCALTrackSegmentMakerv1::MakePairs()
       if(preExist[linkPRE->GetOther()]){ // PRE still exist
        
        new ((* trackSegments)[fNTrackSegments]) 
-         AliEMCALTrackSegment(dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(linkPRE->GetECA())) , 
-                              dynamic_cast<AliEMCALTowerRecPoint *>(aPRERecPoints->At(linkPRE->GetOther())), null) ;
+         AliEMCALTrackSegment(dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(linkPRE->GetECA())) , 
+                              dynamic_cast<AliEMCALRecPoint *>(aPRERecPoints->At(linkPRE->GetOther())), null) ;
        (dynamic_cast<AliEMCALTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++ ;
        if (gDebug == 2 ) 
@@ -271,14 +273,14 @@ void  AliEMCALTrackSegmentMakerv1::MakePairs()
          }
        }
        if (found){
-         ts->SetHCARecPoint( dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(linkHCA->GetOther())) ) ;
+         ts->SetHCARecPoint( dynamic_cast<AliEMCALRecPoint *>(aHCARecPoints->At(linkHCA->GetOther())) ) ;
          if (gDebug == 2 ) 
            printf("MakePairs: ECAL section with PRE and HCAL sections") ;
        }       
        if (!found) {
          new ((* trackSegments)[fNTrackSegments]) 
-           AliEMCALTrackSegment(dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(linkHCA->GetECA())), null,
-                                dynamic_cast<AliEMCALTowerRecPoint *>(aHCARecPoints->At(linkHCA->GetOther()))) ; 
+           AliEMCALTrackSegment(dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(linkHCA->GetECA())), null,
+                                dynamic_cast<AliEMCALRecPoint *>(aHCARecPoints->At(linkHCA->GetOther()))) ; 
        (dynamic_cast<AliEMCALTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++ ;
        if (gDebug == 2 ) 
@@ -298,7 +300,7 @@ void  AliEMCALTrackSegmentMakerv1::MakePairs()
     for(iECARP = 0; iECARP < nECA  ; iECARP++ ){
       if(ecaExist[iECARP] > 0 ){
        new ((*trackSegments)[fNTrackSegments])  
-         AliEMCALTrackSegment(dynamic_cast<AliEMCALTowerRecPoint *>(aECARecPoints->At(iECARP)), null, null) ;
+         AliEMCALTrackSegment(dynamic_cast<AliEMCALRecPoint *>(aECARecPoints->At(iECARP)), null, null) ;
        (dynamic_cast<AliEMCALTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++;    
        if( gDebug == 2 ) 
index 1cce6c0d8ce67eeddcade43e4ca961899aa7ff4b..2ff675e624c76bb1afd3dafde05c626911fe69af 100644 (file)
@@ -19,7 +19,7 @@
 // --- AliRoot header files ---
 #include "AliEMCALTrackSegmentMaker.h"
 
-class AliEMCALTowerRecPoint ;
+class AliEMCALRecPoint ;
 
 class  AliEMCALTrackSegmentMakerv1 : public AliEMCALTrackSegmentMaker {
 
@@ -38,7 +38,7 @@ public:
   virtual const Int_t GetTrackSegmentsInRun()const {return fTrackSegmentsInRun ;}  
 
   virtual void   Exec(Option_t * option) ;
-  Float_t HowClose(AliEMCALTowerRecPoint * ec, AliEMCALTowerRecPoint * rp, Bool_t &toofar) const ;
+  Float_t HowClose(AliEMCALRecPoint * ec, AliEMCALRecPoint * rp, Bool_t &toofar) const ;
           void   MakeLinks() const;      //Evaluates distances(links) between recpoints
           void   MakePairs() ;           //Finds pairs(triplets) with smallest link
   virtual void   Print(Option_t * option) const ;