]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALPIDv1.cxx
Station2 detailed geometry builder (Sanjoy, Sukalyan, Shakeel)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALPIDv1.cxx
index dbff41fed10c1a746cf8a3140ed3cee1640ff294..391696736bbc4137c4248740c0ea5c57ca86127c 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,13 +103,12 @@ 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 ;  
-  dir.SetZ( -dir.Z() ) ;   // why ?  
   // dir.SetMag(1.) ; Removed to avoid warings !!!!!!!!!!!!!! TO BE REVISED
 
   //account correction to the position of IP
@@ -156,8 +155,8 @@ void  AliEMCALPIDv1::Exec(Option_t * option)
     Print("") ; 
     return ; 
   }
-  AliEMCALGetter * gime = AliEMCALGetter::Instance(GetTitle()) ; 
-
+  AliEMCALGetter * gime = AliEMCALGetter::Instance() ; 
+  
   if (fLastEvent == -1) 
     fLastEvent = gime->MaxEvent() - 1 ;
   else 
@@ -166,7 +165,6 @@ void  AliEMCALPIDv1::Exec(Option_t * option)
 
   Int_t ievent ;
 
-
   for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
     gime->Event(ievent,"R") ;
     MakeRecParticles() ;
@@ -174,8 +172,7 @@ void  AliEMCALPIDv1::Exec(Option_t * option)
     if(strstr(option,"deb"))
       PrintRecParticles(option) ;
     //increment the total number of rec particles per run 
-    fRecParticlesInRun += gime->RecParticles()->GetEntriesFast() ; 
-    
+    fRecParticlesInRun += gime->RecParticles()->GetEntriesFast() ;  
   }
   if(strstr(option,"tim")){
     gBenchmark->Stop("EMCALPID");
@@ -201,10 +198,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) ; 
@@ -246,6 +243,14 @@ void  AliEMCALPIDv1::MakeRecParticles(){
     rp->SetFirstDaughter(-1);
     rp->SetLastDaughter(-1);
     rp->SetPolarisation(0,0,0);
+    //Set the position in global coordinate system from the RecPoint
+    //AliEMCALGeometry * geom = gime->EMCALGeometry() ; 
+    //AliEMCALTowerRecPoint  * erp = gime->ECARecPoint(rp->GetEMCALRPIndex()) ; 
+    TVector3 pos ; 
+    //geom->GetGlobal(erp, pos) ; !!!!!!!!!! to check 
+    rp->SetPos(pos);
+
+
     index++ ; 
   }