]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSTrackSegmentMakerv1.cxx
No more calls to gAlice in the reconstruction
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrackSegmentMakerv1.cxx
index 7bdecac7a2f69dc6b7b279378b7d88470cfbc445..1f475525c631dade161651d21b5f4eb40bf7529e 100644 (file)
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.85  2007/03/28 19:18:15  kharlov
+ * RecPoints recalculation in TSM removed
+ *
+ * Revision 1.84  2007/03/07 07:01:21  hristov
+ * Fixing copy/paste erro. Additional protections
+ *
+ * Revision 1.83  2007/03/06 21:07:37  kharlov
+ * DP: xz CPV-EMC distance filled to TS
+ *
+ * Revision 1.82  2007/03/06 06:54:48  kharlov
+ * DP:Calculation of cluster properties dep. on vertex added
+ *
  * Revision 1.81  2007/02/05 10:02:40  kharlov
  * Module numbering is corrected
  *
@@ -412,10 +424,12 @@ void  AliPHOSTrackSegmentMakerv1::MakePairs()
     if(emcExist[linkUp->GetEmc()-fEmcFirst] != -1){
 
       if(cpvExist[linkUp->GetCpv()-fCpvFirst]){ //CPV still exist
+         Float_t dx,dz ;
+         linkUp->GetXZ(dx,dz) ;
         new ((* trackSegments)[fNTrackSegments]) 
           AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(linkUp->GetEmc())) , 
                               dynamic_cast<AliPHOSCpvRecPoint *>(cpvRecPoints->At(linkUp->GetCpv())) , 
-                              linkUp->GetTrack()) ;
+                              linkUp->GetTrack(),dx,dz) ;
         
        (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++ ;
@@ -481,9 +495,6 @@ void  AliPHOSTrackSegmentMakerv1::Exec(Option_t *option)
     
     gime->TrackSegments()->Clear();
 
-    GetVertex() ;
-    EvalRecPoints() ;
-
     //    if(!ReadRecPoints(ievent))   continue; //reads RecPoints for event ievent
     
     for(fModule = 1; fModule <= geom->GetNModules() ; fModule++ ) {
@@ -509,50 +520,6 @@ void  AliPHOSTrackSegmentMakerv1::Exec(Option_t *option)
    }
   if(fWrite) //do not unload in "on flight" mode
     Unload();
-}
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv1::GetVertex(void)
-{ //extract vertex either using ESD or generator
-  
-  //Try to extract vertex from data
-  if(fESD){
-    const AliESDVertex *esdVtx = fESD->GetVertex() ;
-    if(esdVtx){
-      fVtx.SetXYZ(esdVtx->GetXv(),esdVtx->GetYv(),esdVtx->GetZv()) ;
-      return ;
-    }
-  }
-  
-  AliWarning("Can not read vertex from data, use fixed \n") ;
-  fVtx.SetXYZ(0.,0.,0.) ;
-}
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv1::EvalRecPoints(void)
-{ //calculate parameters of RecPoints using vertex and writing them
-
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  TClonesArray * digits = gime->Digits() ;
-  AliPHOSClusterizer * cl = gime->Clusterizer() ;
-  Double_t w0=cl->GetEmcLogWeight() ;
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  for(Int_t i=0; i<emcRecPoints->GetEntriesFast() ; i++){
-    static_cast<AliPHOSEmcRecPoint*>(emcRecPoints->At(i))->EvalAll(w0,fVtx,digits) ;
-  }
-  emcRecPoints->Sort() ;
-
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  Double_t w0CPV=cl->GetCpvLogWeight() ;
-  for(Int_t i=0; i<emcRecPoints->GetEntriesFast() ; i++){
-    static_cast<AliPHOSCpvRecPoint*>(cpvRecPoints->At(i))->EvalAll(w0CPV,fVtx,digits) ;
-  }
-  cpvRecPoints->Sort() ;
-
-  //write recaculated RecPoints
-  gime->WriteRecPoints("OVERWRITE");
-  gime->WriteClusterizer("OVERWRITE");
-
 }
 //____________________________________________________________________________
 void AliPHOSTrackSegmentMakerv1::Unload() 
@@ -620,7 +587,7 @@ void AliPHOSTrackSegmentMakerv1::PrintTrackSegments(Option_t * option)
   TClonesArray * trackSegments = AliPHOSGetter::Instance()->TrackSegments() ; 
 
   Info("PrintTrackSegments", "Results from TrackSegmentMaker:") ; 
-  printf("nevent: %d\n", gAlice->GetEvNumber()) ; 
+  printf("nevent: %d\n", AliPHOSGetter::Instance()->EventNumber()) ; 
   printf("        Found %d TrackSegments\n", trackSegments->GetEntriesFast() ); 
   
   if(strstr(option,"all")) {  // printing found TS