]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Loaders removed from the reconstruction code (C.Cheshkov)
authorpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2007 12:55:08 +0000 (12:55 +0000)
committerpolicheh <policheh@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Aug 2007 12:55:08 +0000 (12:55 +0000)
28 files changed:
PHOS/AliPHOSClusterizer.cxx
PHOS/AliPHOSClusterizer.h
PHOS/AliPHOSClusterizerv1.cxx
PHOS/AliPHOSClusterizerv1.h
PHOS/AliPHOSClusterizerv2.cxx
PHOS/AliPHOSClusterizerv2.h
PHOS/AliPHOSGeometry.cxx
PHOS/AliPHOSGetter.cxx
PHOS/AliPHOSGetter.h
PHOS/AliPHOSLoader.h
PHOS/AliPHOSOnlineMonitor.cxx
PHOS/AliPHOSPID.cxx
PHOS/AliPHOSPID.h
PHOS/AliPHOSPIDv0.cxx
PHOS/AliPHOSPIDv0.h
PHOS/AliPHOSPIDv1.cxx
PHOS/AliPHOSPIDv1.h
PHOS/AliPHOSRecPoint.cxx
PHOS/AliPHOSReconstructor.cxx
PHOS/AliPHOSReconstructor.h
PHOS/AliPHOSTrackSegmentMaker.cxx
PHOS/AliPHOSTrackSegmentMaker.h
PHOS/AliPHOSTrackSegmentMakerv1.cxx
PHOS/AliPHOSTrackSegmentMakerv1.h
PHOS/AliPHOSTrackSegmentMakerv2.cxx
PHOS/AliPHOSTrackSegmentMakerv2.h
PHOS/AliPHOSTracker.cxx
PHOS/AliPHOSTracker.h

index 2adef3868d6d0e467fd376406756b41a6a9e795c..70b322f906d0f196990b3c60bac75661b47bc643 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/* $Id$ */
-
 //_________________________________________________________________________
 //  Base class for the clusterization algorithm (pure abstract)
 //*--
 //*-- Author: Yves Schutz  SUBATECH 
 //////////////////////////////////////////////////////////////////////////////
 
-// --- ROOT system ---
-
-// --- Standard library ---
+#include <TClonesArray.h>
+#include <TTree.h>
 
-// --- AliRoot header files ---
 #include "AliPHOSClusterizer.h"
-#include "AliPHOSGetter.h" 
-#include "AliPHOSQualAssDataMaker.h" 
-
-// --- AliRoot header files ---
 #include "AliPHOSQualAssDataMaker.h"
+#include "AliPHOSDigit.h"
 
 ClassImp(AliPHOSClusterizer)
 
 //____________________________________________________________________________
 AliPHOSClusterizer::AliPHOSClusterizer():
-  TTask("",""),
-  fEventFolderName(""),
-  fFirstEvent(0),
-  fLastEvent(-1),
-  fRawReader(0),
-  fQADM(0)
+  fGeom(NULL),
+  fQADM(0),
+  fDigitsArr(0),
+  fTreeR(0),
+  fEMCRecPoints(0),
+  fCPVRecPoints(0)
 {
- // ctor
 // ctor
 }
 
 //____________________________________________________________________________
-AliPHOSClusterizer::AliPHOSClusterizer(const TString alirunFileName, 
-                                      const TString eventFolderName):
-  TTask("PHOS"+AliConfig::Instance()->GetReconstructionerTaskName(), 
-       alirunFileName), fEventFolderName(eventFolderName),
-  fFirstEvent(0),
-  fLastEvent(-1),
-  fRawReader(0),
-  fQADM(0)
+AliPHOSClusterizer::AliPHOSClusterizer(AliPHOSGeometry *geom):
+  fGeom(geom),
+  fQADM(0),
+  fDigitsArr(0),
+  fTreeR(0),
+  fEMCRecPoints(0),
+  fCPVRecPoints(0)
 {
   // ctor
   fQADM = new AliPHOSQualAssDataMaker() ;  
@@ -63,26 +55,57 @@ AliPHOSClusterizer::AliPHOSClusterizer(const TString alirunFileName,
   fQADM ->Init(AliQualAss::kRECPOINTS) ;    
 }
 
-//____________________________________________________________________________
-AliPHOSClusterizer::AliPHOSClusterizer(const AliPHOSClusterizer & clusterizer) :
-  TTask(clusterizer),fEventFolderName(clusterizer.GetEventFolderName()),
-  fFirstEvent(clusterizer.GetFirstEvent()),fLastEvent(clusterizer.GetLastEvent()),
-  fRawReader(clusterizer.GetRawReader()),
-  fQADM(clusterizer.GetQualAssDataMaker())
-{
-  //Copy constructor
-  //initiaizes the quality assurance data maker
-  GetQualAssDataMaker()->Init(AliQualAss::kRECPOINTS) ;    
-}
 //____________________________________________________________________________
 AliPHOSClusterizer::~AliPHOSClusterizer()
 {
   // dtor
-         
- //Remove this from the parental task before destroying
-  if(AliPHOSGetter::Instance()->PhosLoader())
-    AliPHOSGetter::Instance()->PhosLoader()->CleanReconstructioner();
   delete fQADM ; 
+  if (fDigitsArr) {
+    fDigitsArr->Delete();
+    delete fDigitsArr;
+  }
+  if (fEMCRecPoints) {
+    fEMCRecPoints->Delete();
+    delete fEMCRecPoints;
+  }
+  if (fCPVRecPoints) {
+    fCPVRecPoints->Delete();
+    delete fCPVRecPoints;
+  }
 }
 
+//____________________________________________________________________________
+void AliPHOSClusterizer::SetInput(TTree * digitsTree) 
+{
+  // Get the tree with digits and sets
+  // the input array with digits for PHOS
+  TBranch *branch = digitsTree->GetBranch("PHOS");
+  if (!branch) { 
+    AliError("can't get the branch with the PHOS digits !");
+    return;
+  }
+  fDigitsArr = new TClonesArray("AliPHOSDigit",100);
+  branch->SetAddress(&fDigitsArr);
+  branch->GetEntry(0);
+}
+
+//____________________________________________________________________________
+void AliPHOSClusterizer::SetOutput(TTree * clustersTree) 
+{
+  // Set the output clusters tree,
+  // creates the arrays for EMC and CPV,
+  // and set the corresponding branch addresses
+  fTreeR = clustersTree;
 
+  AliDebug(9, "Making array for EMC clusters");
+  fEMCRecPoints = new TObjArray(100) ;
+  fEMCRecPoints->SetName("EMCRECPOINTS") ;
+  Int_t split = 0;
+  Int_t bufsize = 32000;
+  fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split);
+
+  AliDebug(9, "Making array for CPV clusters");
+  fCPVRecPoints = new TObjArray(100) ;
+  fCPVRecPoints->SetName("CPVRECPOINTS") ;
+  fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split);
+}
index f365bbaf5c1651264eb4915698dac88dfffa0069..9176f203dc617507a42fd278123525c07b4e9706 100644 (file)
@@ -3,11 +3,12 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
                             
-/* $Id$ */
-
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.41  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.40  2006/08/25 16:56:30  kharlov
  * Compliance with Effective C++
  *
 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (SUBATECH & Kurchatov Institute)
 // --- ROOT system ---
 
+#include <TObject.h>
 
-#include "TTask.h" 
-class TFile ; 
-
-// --- Standard library ---
+class TTree;
 
-// --- AliRoot header files ---
-#include "AliConfig.h"
-#include "AliRawReaderFile.h"
+class AliPHOSGeometry;
 class AliPHOSQualAssDataMaker ; 
 
-class AliPHOSClusterizer : public TTask {
+class AliPHOSClusterizer : public TObject {
 
 public:
 
   AliPHOSClusterizer() ;        // default ctor
-  AliPHOSClusterizer(const TString alirunFileName, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
-  AliPHOSClusterizer(const AliPHOSClusterizer & clusterizer);
+  AliPHOSClusterizer(AliPHOSGeometry *geom);
   virtual ~AliPHOSClusterizer() ; // dtor
-  virtual Float_t GetEmcClusteringThreshold()const {Warning("GetEmcClusteringThreshold", "Not Defined" ) ; return 0. ; }  
-  virtual Float_t GetEmcLocalMaxCut()const {Warning("GetEmcLocalMaxCut", "Not Defined" ) ; return 0. ; } 
-  virtual Float_t GetEmcLogWeight()const {Warning("GetEmcLogWeight", "Not Defined" ) ; return 0. ; } 
-  virtual Float_t GetEmcTimeGate() const {Warning("GetEmcTimeGate", "Not Defined" ) ; return 0. ; }  ;
-  virtual Float_t GetCpvClusteringThreshold()const {Warning("GetCpvClusteringThreshold", "Not Defined" ) ; return 0. ; } 
-  virtual Float_t GetCpvLocalMaxCut()const {Warning("GetCpvLocalMaxCut", "Not Defined" ) ; return 0. ; } 
-  virtual Float_t GetCpvLogWeight()const {Warning("GetCpvLogWeight", "Not Defined" ) ; return 0. ; } 
-  virtual Int_t GetRecPointsInRun()  const {Warning("GetRecPointsInRun", "Not Defined" ) ; return 0 ; } 
-
-  virtual void MakeClusters() {Warning("MakeClusters", "Not Defined" ) ; } 
-  virtual void Print(const Option_t * = "")const {Warning("Print", "Not Defined" ) ; } 
+
+  virtual void    Digits2Clusters(Option_t *option) = 0;
+  virtual Float_t GetEmcClusteringThreshold()const = 0;
+  virtual Float_t GetEmcLocalMaxCut()const = 0;
+  virtual Float_t GetEmcLogWeight()const = 0;
+  virtual Float_t GetEmcTimeGate() const = 0;
+  virtual Float_t GetCpvClusteringThreshold()const = 0;
+  virtual Float_t GetCpvLocalMaxCut()const = 0;
+  virtual Float_t GetCpvLogWeight()const = 0;
+
+  virtual void Print(const Option_t * = "") const = 0;
 
   virtual void SetEmcClusteringThreshold(Float_t) = 0;
   virtual void SetEmcLocalMaxCut(Float_t )        = 0;
@@ -67,30 +63,27 @@ public:
   virtual void SetCpvLocalMaxCut(Float_t)         = 0;
   virtual void SetCpvLogWeight(Float_t)           = 0;
   virtual void SetUnfolding(Bool_t)               = 0;
-  void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
-  void SetEventFolderName(TString name) { fEventFolderName = name ; }
-  void SetRawReader(AliRawReader *reader) {fRawReader = reader;}
 
-  TString       GetEventFolderName() const {return fEventFolderName;}
-  Int_t         GetFirstEvent()      const {return fFirstEvent;     }
-  Int_t         GetLastEvent()       const {return fLastEvent;      }
-  AliRawReader *GetRawReader()       const {return fRawReader;      }
+  virtual const char * Version() const = 0;
 
-  AliPHOSClusterizer & operator = (const AliPHOSClusterizer & /*rvalue*/)  {return *this ;} 
-  virtual const char * Version() const {Warning("Version", "Not Defined" ) ; return 0 ; }  
+  virtual void SetInput(TTree *digitsTree);
+  virtual void SetOutput(TTree *clustersTree);
 
 protected:
   AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; } 
 
-  TString fEventFolderName ;  // event folder name
-  Int_t   fFirstEvent;        // first event to process
-  Int_t   fLastEvent;         // last  event to process
-  AliRawReader *fRawReader;   //! reader of raw data
-
+  AliPHOSGeometry *fGeom; // Pointer to PHOS geometry
   AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
+  TClonesArray *fDigitsArr; // Array with input digits
+  TTree *fTreeR; // Tree with output clusters
+  TObjArray *fEMCRecPoints; // Array with EMC clusters
+  TObjArray *fCPVRecPoints; // Array with CPV clusters
+
+private:
+  AliPHOSClusterizer(const AliPHOSClusterizer & clusterizer);
+  AliPHOSClusterizer & operator = (const AliPHOSClusterizer &clusterer);
 
-  ClassDef(AliPHOSClusterizer,4)  // Clusterization algorithm class 
+  ClassDef(AliPHOSClusterizer,5)  // Clusterization algorithm class 
 
 } ;
 
index 06fa62a32915a8e76d06a7dc9a677b19e1824251..f801bf96531b86b3753fbf5e8909c6fbd6259a00 100644 (file)
@@ -18,6 +18,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.112  2007/08/22 09:20:50  hristov
+ * Updated QA classes (Yves)
+ *
  * Revision 1.111  2007/08/08 12:11:28  kharlov
  * Protection against uninitialized fQADM
  *
 //  This TTask is normally called from Reconstructioner, but can as well be used in 
 //  standalone mode.
 // Use Case:
-//  root [0] AliPHOSClusterizerv1 * cl = new AliPHOSClusterizerv1("galice.root", "recpointsname", "digitsname")  
-//  Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
-//               // reads gAlice from header file "galice.root", uses digits stored in the branch names "digitsname" (default = "Default")
-//               // and saves recpoints in branch named "recpointsname" (default = "digitsname")                       
-//  root [1] cl->ExecuteTask()  
-//               //finds RecPoints in all events stored in galice.root
+//  root [0] AliPHOSClusterizerv1 * cl = new AliPHOSClusterizerv1(<pointer_to_phos_geometry_onject>)  
+//  root [1] cl->Digits2Clusters(digitsTree,clusterTree)
+//               //finds RecPoints in the current event
 //  root [2] cl->SetDigitsBranch("digits2") 
 //               //sets another title for Digitis (input) branch
 //  root [3] cl->SetRecPointsBranch("recp2")  
 //               //sets another title four output branches
 //  root [4] cl->SetEmcLocalMaxCut(0.03)  
 //               //set clusterization parameters
-//  root [5] cl->ExecuteTask("deb all time")  
-//               //once more finds RecPoints options are 
-//               // deb - print number of found rec points
-//               // deb all - print number of found RecPoints and some their characteristics 
-//               // time - print benchmarking results
 
 // --- ROOT system ---
 
 #include "TMinuit.h"
 #include "TTree.h" 
 #include "TBenchmark.h"
+#include "TClonesArray.h"
 
 // --- Standard library ---
 
 // --- AliRoot header files ---
 #include "AliLog.h"
-#include "AliRunLoader.h"
-#include "AliGenerator.h"
-#include "AliPHOSGetter.h"
+#include "AliConfig.h"
 #include "AliPHOSGeometry.h" 
 #include "AliPHOSClusterizerv1.h"
 #include "AliPHOSEmcRecPoint.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
 #include "AliCDBEntry.h"
-#include "AliPHOSReconstructor.h"
 #include "AliPHOSRecoParam.h"
 #include "AliPHOSQualAssDataMaker.h" 
+#include "AliPHOSCalibData.h"
+#include "AliPHOSReconstructor.h"
 
 ClassImp(AliPHOSClusterizerv1)
   
@@ -187,8 +182,8 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() :
   fADCchanelCpv(0),           fADCpedestalCpv(0),       fEmcClusteringThreshold(0),
   fCpvClusteringThreshold(0), fEmcMinE(0),              fCpvMinE(0),
   fEmcLocMaxCut(0),           fW0(0),                   fCpvLocMaxCut(0),
-  fW0CPV(0),                  fRecPointsInRun(0),       fEmcTimeGate(0),
-  fIsOldRCUFormat(0), fEventCounter(0)
+  fW0CPV(0),                  fEmcTimeGate(0),
+  fIsOldRCUFormat(0)
 {
   // default ctor (to be used mainly by Streamer)
   
@@ -197,16 +192,16 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1() :
 }
 
 //____________________________________________________________________________
-AliPHOSClusterizerv1::AliPHOSClusterizerv1(const TString alirunFileName, const TString eventFolderName) :
-  AliPHOSClusterizer(alirunFileName, eventFolderName),
+AliPHOSClusterizerv1::AliPHOSClusterizerv1(AliPHOSGeometry *geom) :
+  AliPHOSClusterizer(geom),
   fDefaultInit(0),            fEmcCrystals(0),          fToUnfold(0),
   fWrite(0),                  fNumberOfEmcClusters(0),  fNumberOfCpvClusters(0),
   fCalibData(0),              fADCchanelEmc(0),         fADCpedestalEmc(0),
   fADCchanelCpv(0),           fADCpedestalCpv(0),       fEmcClusteringThreshold(0),
   fCpvClusteringThreshold(0), fEmcMinE(0),              fCpvMinE(0),
   fEmcLocMaxCut(0),           fW0(0),                   fCpvLocMaxCut(0),
-  fW0CPV(0),                  fRecPointsInRun(0),       fEmcTimeGate(0),
-  fIsOldRCUFormat(0), fEventCounter(0)
+  fW0CPV(0),                  fEmcTimeGate(0),
+  fIsOldRCUFormat(0)
 {
   // ctor with the indication of the file where header Tree and digits Tree are stored
   
@@ -215,32 +210,13 @@ AliPHOSClusterizerv1::AliPHOSClusterizerv1(const TString alirunFileName, const T
   fDefaultInit = kFALSE ; 
 }
 
-//____________________________________________________________________________
-AliPHOSClusterizerv1::AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & obj) :
-  AliPHOSClusterizer(obj),
-  fDefaultInit(0),            fEmcCrystals(0),          fToUnfold(0),
-  fWrite(0),                  fNumberOfEmcClusters(0),  fNumberOfCpvClusters(0),
-  fCalibData(0),              fADCchanelEmc(0),         fADCpedestalEmc(0),
-  fADCchanelCpv(0),           fADCpedestalCpv(0),       fEmcClusteringThreshold(0),
-  fCpvClusteringThreshold(0), fEmcMinE(0),              fCpvMinE(0),
-  fEmcLocMaxCut(0),           fW0(0),                   fCpvLocMaxCut(0),
-  fW0CPV(0),                  fRecPointsInRun(0),       fEmcTimeGate(0),
-  fIsOldRCUFormat(0), fEventCounter(0)
-{
-  // Copy constructor
-}
 //____________________________________________________________________________
   AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
 {
   // dtor
 
 }
-//____________________________________________________________________________
-const TString AliPHOSClusterizerv1::BranchName() const 
-{  
-  return GetName();
-}
+
 //____________________________________________________________________________
 Float_t  AliPHOSClusterizerv1::CalibrateEMC(Float_t amp, Int_t absId)
 {  
@@ -250,8 +226,7 @@ Float_t  AliPHOSClusterizerv1::CalibrateEMC(Float_t amp, Int_t absId)
 
   if(fCalibData){
     Int_t relId[4];
-    AliPHOSGetter *gime = AliPHOSGetter::Instance();
-    gime->PHOSGeometry()->AbsToRelNumbering(absId,relId) ;
+    fGeom->AbsToRelNumbering(absId,relId) ;
     Int_t   module = relId[0];
     Int_t   column = relId[3];
     Int_t   row    = relId[2];
@@ -276,8 +251,7 @@ Float_t  AliPHOSClusterizerv1::CalibrateCPV(Int_t amp, Int_t absId)
 
   if(fCalibData){
     Int_t relId[4];
-    AliPHOSGetter *gime = AliPHOSGetter::Instance();
-    gime->PHOSGeometry()->AbsToRelNumbering(absId,relId) ;
+    fGeom->AbsToRelNumbering(absId,relId) ;
     Int_t   module = relId[0];
     Int_t   column = relId[3];
     Int_t   row    = relId[2];
@@ -295,12 +269,11 @@ Float_t  AliPHOSClusterizerv1::CalibrateCPV(Int_t amp, Int_t absId)
 }
 
 //____________________________________________________________________________
-void AliPHOSClusterizerv1::Exec(Option_t *option)
+void AliPHOSClusterizerv1::Digits2Clusters(Option_t *option)
 {
-  // Steering method to perform clusterization for events
-  // in the range from fFirstEvent to fLastEvent.
-  // This range is optionally set by SetEventRange().
-  // if fLastEvent=-1 (by default), then process events until the end.
+  // Steering method to perform clusterization for one event
+  // The input is the tree with digits.
+  // The output is the tree with clusters.
 
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSClusterizer"); 
@@ -312,70 +285,38 @@ void AliPHOSClusterizerv1::Exec(Option_t *option)
 
   GetCalibrationParameters() ;
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  if (fRawReader == 0)
-    gime->SetRawDigits(kFALSE);
-  else
-    gime->SetRawDigits(kTRUE);
-  
-  if (fLastEvent == -1) 
-    fLastEvent = gime->MaxEvent() - 1 ;
-  else 
-    fLastEvent = TMath::Min(fFirstEvent, gime->MaxEvent()); // one event at the time 
-  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
-
-  Int_t ievent ;
-  for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
-       fEventCounter++ ; 
-    if (fRawReader == 0)
-      gime->Event(ievent    ,"D"); // Read digits from simulated data
-    else {
-      AliRunLoader * rl = AliRunLoader::GetRunLoader(gime->PhosLoader()->GetTitle());
-      rl->GetEvent(ievent);
-      gime->Event(fRawReader,"W",fIsOldRCUFormat); // Read digits from raw data
-    }
-    fNumberOfEmcClusters  = fNumberOfCpvClusters  = 0 ;
+  MakeClusters() ;
     
-    MakeClusters() ;
-    
-    AliDebug(2,Form(" ---- Printing clusters (%d) of event %d.\n",
-          gime->EmcRecPoints()->GetEntries(),ievent));
-    if(AliLog::GetGlobalDebugLevel()>1)
-      gime->EmcRecPoints()->Print();
+  AliDebug(2,Form(" ---- Printing clusters (%d)\n",
+                 fEMCRecPoints->GetEntries()));
+  if(AliLog::GetGlobalDebugLevel()>1)
+    fEMCRecPoints->Print();
 
-    if(fToUnfold)             
-      MakeUnfolding() ;
+  if(fToUnfold)             
+    MakeUnfolding();
 
     //makes the quality assurance data
-    if (GetQualAssDataMaker()) {
-      GetQualAssDataMaker()->SetData(gime->EmcRecPoints()) ; 
-      GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
-      GetQualAssDataMaker()->SetData(gime->CpvRecPoints()) ; 
-      GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
-    }
+  if (GetQualAssDataMaker()) {
+    GetQualAssDataMaker()->SetData(fEMCRecPoints) ; 
+    GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
+    GetQualAssDataMaker()->SetData(fCPVRecPoints) ; 
+    GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
+  }
 
-    WriteRecPoints();
+  WriteRecPoints();
 
-    if(strstr(option,"deb"))  
-      PrintRecPoints(option) ;
+  if(strstr(option,"deb"))  
+    PrintRecPoints(option) ;
 
-    //increment the total number of recpoints per run 
-    fRecPointsInRun += gime->EmcRecPoints()->GetEntriesFast() ;  
-    fRecPointsInRun += gime->CpvRecPoints()->GetEntriesFast() ;  
-  }
-  
+  // PLEASE FIX BY MOVING IT TO ALIRECONSTRUCTION !!!
   //Write the quality assurance data only after the last event 
-  if (GetQualAssDataMaker() && fEventCounter == gime->MaxEvent()) 
-    GetQualAssDataMaker()->Finish(AliQualAss::kRECPOINTS) ;
+  //  if (GetQualAssDataMaker() && fEventCounter == gime->MaxEvent()) 
+  //    GetQualAssDataMaker()->Finish(AliQualAss::kRECPOINTS) ;
 
-  if(fWrite) //do not unload in "on flight" mode
-   Unload();
-  
   if(strstr(option,"tim")){
     gBenchmark->Stop("PHOSClusterizer");
-    AliInfo(Form("took %f seconds for Clusterizing %f seconds per event \n",
-        gBenchmark->GetCpuTime("PHOSClusterizer"), 
-        gBenchmark->GetCpuTime("PHOSClusterizer")/nEvents )) ; 
+    AliInfo(Form("took %f seconds for Clusterizing\n",
+                gBenchmark->GetCpuTime("PHOSClusterizer"))); 
   } 
 }
 
@@ -388,9 +329,6 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit **
   // Cluster will be fitted as a superposition of nPar/3 electromagnetic showers
 
   
-  AliPHOSGetter * gime = AliPHOSGetter::Instance();
-  TClonesArray * digits = gime->Digits(); 
-
   gMinuit->mncler();                     // Reset Minuit's list of paramters
   gMinuit->SetPrintLevel(-1) ;           // No Printout
   gMinuit->SetFCN(AliPHOSClusterizerv1::UnfoldingChiSquare) ;  
@@ -398,7 +336,8 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit **
 
   TList * toMinuit = new TList();
   toMinuit->AddAt(emcRP,0) ;
-  toMinuit->AddAt(digits,1) ;
+  toMinuit->AddAt(fDigitsArr,1) ;
+  toMinuit->AddAt(fGeom,2) ;
   
   gMinuit->SetObjectFit(toMinuit) ;         // To tranfer pointer to UnfoldingChiSquare
 
@@ -411,16 +350,14 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit **
 
   Int_t iDigit ;
 
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
-
   for(iDigit = 0; iDigit < nDigits; iDigit++){
     digit = maxAt[iDigit]; 
 
     Int_t relid[4] ;
     Float_t x = 0.;
     Float_t z = 0.;
-    geom->AbsToRelNumbering(digit->GetId(), relid) ;
-    geom->RelPosInModule(relid, x, z) ;
+    fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
+    fGeom->RelPosInModule(relid, x, z) ;
 
     Float_t energy = maxAtEnergy[iDigit] ;
 
@@ -496,20 +433,11 @@ void AliPHOSClusterizerv1::Init()
   // Make all memory allocations which can not be done in default constructor.
   // Attach the Clusterizer task to the list of PHOS tasks
  
-  AliPHOSGetter* gime = AliPHOSGetter::Instance() ;
-  if(!gime)
-    gime = AliPHOSGetter::Instance(GetTitle(), fEventFolderName.Data());
-
-  AliPHOSGeometry * geom = gime->PHOSGeometry();
-
-  fEmcCrystals = geom->GetNModules() *  geom->GetNCristalsInModule() ;
+  fEmcCrystals = fGeom->GetNModules() *  fGeom->GetNCristalsInModule() ;
 
   if(!gMinuit) 
     gMinuit = new TMinuit(100);
 
-  if ( !gime->Clusterizer() ) {
-    gime->PostClusterizer(this);
-  }
 }
 
 //____________________________________________________________________________
@@ -541,14 +469,10 @@ void AliPHOSClusterizerv1::InitParameters()
   
   fToUnfold                = kTRUE ;
     
-  fRecPointsInRun          = 0 ;
-
   fWrite                   = kTRUE ;
 
   fCalibData               = 0 ;
 
-  SetEventRange(0,-1) ;
-
   fIsOldRCUFormat          = kFALSE;
 }
 
@@ -562,15 +486,13 @@ Int_t AliPHOSClusterizerv1::AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)c
   // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster 
   //                                      which is compared to a digit (d2)  not yet in a cluster  
 
-  AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry() ;
-
   Int_t rv = 0 ; 
 
   Int_t relid1[4] ; 
-  geom->AbsToRelNumbering(d1->GetId(), relid1) ; 
+  fGeom->AbsToRelNumbering(d1->GetId(), relid1) ; 
 
   Int_t relid2[4] ; 
-  geom->AbsToRelNumbering(d2->GetId(), relid2) ; 
+  fGeom->AbsToRelNumbering(d2->GetId(), relid2) ; 
  
   if ( (relid1[0] == relid2[0]) && (relid1[1]==relid2[1]) ) { // inside the same PHOS module 
     Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;  
@@ -611,24 +533,16 @@ void AliPHOSClusterizerv1::CleanDigits(TClonesArray * digits)
     AliPHOSDigit *digit = static_cast<AliPHOSDigit*>( digits->At(i) ) ; 
     digit->SetIndexInList(i) ;     
   }
-
-  //Overwrite digits tree
-  AliPHOSGetter* gime = AliPHOSGetter::Instance();
-  TTree * treeD = gime->TreeD();
-  treeD->Branch("PHOS", &digits);
-  treeD->Fill() ;
-  gime->WriteDigits("OVERWRITE");
-  gime->PhosLoader()->UnloadDigits() ;
 }
+
 //____________________________________________________________________________
 Bool_t AliPHOSClusterizerv1::IsInEmc(AliPHOSDigit * digit) const
 {
   // Tells if (true) or not (false) the digit is in a PHOS-EMC module
  
   Bool_t rv = kFALSE ; 
-  AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry() ;
 
-  Int_t nEMC = geom->GetNModules()*geom->GetNPhi()*geom->GetNZ();  
+  Int_t nEMC = fGeom->GetNModules()*fGeom->GetNPhi()*fGeom->GetNZ();  
 
   if(digit->GetId() <= nEMC )   rv = kTRUE; 
 
@@ -642,23 +556,13 @@ Bool_t AliPHOSClusterizerv1::IsInCpv(AliPHOSDigit * digit) const
  
   Bool_t rv = kFALSE ; 
   
-  AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry() ;
-
-  Int_t nEMC = geom->GetNModules()*geom->GetNPhi()*geom->GetNZ();
+  Int_t nEMC = fGeom->GetNModules()*fGeom->GetNPhi()*fGeom->GetNZ();
 
   if(digit->GetId() > nEMC )   rv = kTRUE;
 
   return rv ; 
 }
 
-//____________________________________________________________________________
-void AliPHOSClusterizerv1::Unload() 
-{
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  gime->PhosLoader()->UnloadDigits() ; 
-  gime->PhosLoader()->UnloadRecPoints() ; 
-}
-
 //____________________________________________________________________________
 void AliPHOSClusterizerv1::WriteRecPoints()
 {
@@ -666,73 +570,50 @@ void AliPHOSClusterizerv1::WriteRecPoints()
   // Creates new branches with given title
   // fills and writes into TreeR.
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance();
-
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * digits = gime->Digits() ; 
   Int_t index ;
   //Evaluate position, dispersion and other RecPoint properties..
-  Int_t nEmc = emcRecPoints->GetEntriesFast();
+  Int_t nEmc = fEMCRecPoints->GetEntriesFast();
   for(index = 0; index < nEmc; index++){
     AliPHOSEmcRecPoint * rp =
-      dynamic_cast<AliPHOSEmcRecPoint *>( emcRecPoints->At(index) );
+      dynamic_cast<AliPHOSEmcRecPoint *>( fEMCRecPoints->At(index) );
     rp->Purify(fEmcMinE) ;
     if(rp->GetMultiplicity()==0){
-      emcRecPoints->RemoveAt(index) ;
+      fEMCRecPoints->RemoveAt(index) ;
       delete rp ;
       continue;
     }
 
     // No vertex is available now, calculate corrections in PID
-    rp->EvalAll(fW0,digits) ;
+    rp->EvalAll(fW0,fDigitsArr) ;
     TVector3 fakeVtx(0.,0.,0.) ;
-    rp->EvalAll(fW0,fakeVtx,digits) ;
+    rp->EvalAll(fW0,fakeVtx,fDigitsArr) ;
     rp->EvalLocal2TrackingCSTransform();
   }
-  emcRecPoints->Compress() ;
-//  emcRecPoints->Sort() ; //Can not sort until position is calculated!
-  //  emcRecPoints->Expand(emcRecPoints->GetEntriesFast()) ;
-  for(index = 0; index < emcRecPoints->GetEntries(); index++){
-    dynamic_cast<AliPHOSEmcRecPoint *>( emcRecPoints->At(index) )->SetIndexInList(index) ;
+  fEMCRecPoints->Compress() ;
+  //  fEMCRecPoints->Sort() ; //Can not sort until position is calculated!
+  //  fEMCRecPoints->Expand(fEMCRecPoints->GetEntriesFast()) ;
+  for(index = 0; index < fEMCRecPoints->GetEntries(); index++){
+    dynamic_cast<AliPHOSEmcRecPoint *>( fEMCRecPoints->At(index) )->SetIndexInList(index) ;
   }
   
   //For each rec.point set the distance to the nearest bad crystal (BVP)
   SetDistancesToBadChannels();
 
   //Now the same for CPV
-  for(index = 0; index < cpvRecPoints->GetEntries(); index++){
-    AliPHOSCpvRecPoint * rp = dynamic_cast<AliPHOSCpvRecPoint *>( cpvRecPoints->At(index) );
-    rp->EvalAll(fW0CPV,digits) ;
+  for(index = 0; index < fCPVRecPoints->GetEntries(); index++){
+    AliPHOSCpvRecPoint * rp = dynamic_cast<AliPHOSCpvRecPoint *>( fCPVRecPoints->At(index) );
+    rp->EvalAll(fW0CPV,fDigitsArr) ;
     rp->EvalLocal2TrackingCSTransform();
   }
-//  cpvRecPoints->Sort() ;
+//  fCPVRecPoints->Sort() ;
   
-  for(index = 0; index < cpvRecPoints->GetEntries(); index++)
-    dynamic_cast<AliPHOSCpvRecPoint *>( cpvRecPoints->At(index) )->SetIndexInList(index) ;
+  for(index = 0; index < fCPVRecPoints->GetEntries(); index++)
+    dynamic_cast<AliPHOSCpvRecPoint *>( fCPVRecPoints->At(index) )->SetIndexInList(index) ;
   
-  cpvRecPoints->Expand(cpvRecPoints->GetEntriesFast()) ;
+  fCPVRecPoints->Expand(fCPVRecPoints->GetEntriesFast()) ;
   
   if(fWrite){ //We write TreeR
-    TTree * treeR = gime->TreeR();
-    
-    Int_t bufferSize = 32000 ;    
-    Int_t splitlevel = 0 ;
-    
-    //First EMC
-    TBranch * emcBranch = treeR->Branch("PHOSEmcRP","TObjArray",&emcRecPoints,bufferSize,splitlevel);
-    emcBranch->SetTitle(BranchName());
-    
-    //Now CPV branch
-    TBranch * cpvBranch = treeR->Branch("PHOSCpvRP","TObjArray",&cpvRecPoints,bufferSize,splitlevel);
-    cpvBranch->SetTitle(BranchName());
-    
-    emcBranch        ->Fill() ;
-    cpvBranch        ->Fill() ;
-    
-    gime->WriteRecPoints("OVERWRITE");
-    gime->WriteClusterizer("OVERWRITE");
+    fTreeR->Fill();
   }
 }
 
@@ -742,21 +623,10 @@ void AliPHOSClusterizerv1::MakeClusters()
   // Steering method to construct the clusters stored in a list of Reconstructed Points
   // A cluster is defined as a list of neighbour digits
 
-  
-  AliPHOSGetter * gime = AliPHOSGetter::Instance();
-
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-
-  emcRecPoints->Delete() ;
-  cpvRecPoints->Delete() ;
-  
-  TClonesArray * digits = gime->Digits() ; 
-
   //Remove digits below threshold
-  CleanDigits(digits) ;
+  CleanDigits(fDigitsArr) ;
 
-  TClonesArray * digitsC =  static_cast<TClonesArray*>( digits->Clone() ) ;
+  TClonesArray * digitsC =  static_cast<TClonesArray*>( fDigitsArr->Clone() ) ;
  
   // Clusterization starts  
 
@@ -780,11 +650,11 @@ void AliPHOSClusterizerv1::MakeClusters()
       
       if  ( IsInEmc(digit) ) {   
         // start a new EMC RecPoint
-        if(fNumberOfEmcClusters >= emcRecPoints->GetSize()) 
-          emcRecPoints->Expand(2*fNumberOfEmcClusters+1) ;
+        if(fNumberOfEmcClusters >= fEMCRecPoints->GetSize()) 
+          fEMCRecPoints->Expand(2*fNumberOfEmcClusters+1) ;
           
-        emcRecPoints->AddAt(new  AliPHOSEmcRecPoint(""), fNumberOfEmcClusters) ;
-        clu = dynamic_cast<AliPHOSEmcRecPoint *>( emcRecPoints->At(fNumberOfEmcClusters) ) ; 
+        fEMCRecPoints->AddAt(new  AliPHOSEmcRecPoint(""), fNumberOfEmcClusters) ;
+        clu = dynamic_cast<AliPHOSEmcRecPoint *>( fEMCRecPoints->At(fNumberOfEmcClusters) ) ; 
        fNumberOfEmcClusters++ ; 
        clu->AddDigit(*digit, CalibrateEMC(digit->GetEnergy(),digit->GetId())) ;
         clusterdigitslist[iDigitInCluster] = digit->GetIndexInList() ;
@@ -794,12 +664,12 @@ void AliPHOSClusterizerv1::MakeClusters()
       } else { 
         
         // start a new CPV cluster
-        if(fNumberOfCpvClusters >= cpvRecPoints->GetSize()) 
-          cpvRecPoints->Expand(2*fNumberOfCpvClusters+1);
+        if(fNumberOfCpvClusters >= fCPVRecPoints->GetSize()) 
+          fCPVRecPoints->Expand(2*fNumberOfCpvClusters+1);
 
-        cpvRecPoints->AddAt(new AliPHOSCpvRecPoint(""), fNumberOfCpvClusters) ;
+        fCPVRecPoints->AddAt(new AliPHOSCpvRecPoint(""), fNumberOfCpvClusters) ;
 
-        clu =  dynamic_cast<AliPHOSCpvRecPoint *>( cpvRecPoints->At(fNumberOfCpvClusters) ) ;  
+        clu =  dynamic_cast<AliPHOSCpvRecPoint *>( fCPVRecPoints->At(fNumberOfCpvClusters) ) ;  
         fNumberOfCpvClusters++ ; 
         clu->AddDigit(*digit, CalibrateCPV(digit->GetAmp(),digit->GetId()) ) ;        
         clusterdigitslist[iDigitInCluster] = digit->GetIndexInList()  ;        
@@ -826,7 +696,7 @@ void AliPHOSClusterizerv1::MakeClusters()
       AliPHOSDigit * digitN ; 
       index = 0 ;
       while (index < iDigitInCluster){ // scan over digits already in cluster 
-        digit =  dynamic_cast<AliPHOSDigit*>( digits->At(clusterdigitslist[index]) )  ;      
+        digit =  dynamic_cast<AliPHOSDigit*>( fDigitsArr->At(clusterdigitslist[index]) )  ;      
         index++ ; 
         while ( (digitN = dynamic_cast<AliPHOSDigit *>( nextdigit() ) ) ) { // scan over the reduced list of digits 
           Int_t ineb = AreNeighbours(digit, digitN);       // call (digit,digitN) in THAT oder !!!!!
@@ -869,36 +739,28 @@ void AliPHOSClusterizerv1::MakeUnfolding()
   // Unfolds clusters using the shape of an ElectroMagnetic shower
   // Performs unfolding of all EMC/CPV clusters
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance();
-
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
-
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * digits = gime->Digits() ; 
-  
   // Unfold first EMC clusters 
   if(fNumberOfEmcClusters > 0){
 
-    Int_t nModulesToUnfold = geom->GetNModules() ; 
+    Int_t nModulesToUnfold = fGeom->GetNModules() ; 
 
     Int_t numberofNotUnfolded = fNumberOfEmcClusters ; 
     Int_t index ;   
     for(index = 0 ; index < numberofNotUnfolded ; index++){
       
-      AliPHOSEmcRecPoint * emcRecPoint = dynamic_cast<AliPHOSEmcRecPoint *>( emcRecPoints->At(index) ) ;
+      AliPHOSEmcRecPoint * emcRecPoint = dynamic_cast<AliPHOSEmcRecPoint *>( fEMCRecPoints->At(index) ) ;
       if(emcRecPoint->GetPHOSMod()> nModulesToUnfold)
         break ;
       
       Int_t nMultipl = emcRecPoint->GetMultiplicity() ; 
       AliPHOSDigit ** maxAt = new AliPHOSDigit*[nMultipl] ;
       Float_t * maxAtEnergy = new Float_t[nMultipl] ;
-      Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fEmcLocMaxCut,digits) ;
+      Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fEmcLocMaxCut,fDigitsArr) ;
       
       if( nMax > 1 ) {     // if cluster is very flat (no pronounced maximum) then nMax = 0       
         UnfoldCluster(emcRecPoint, nMax, maxAt, maxAtEnergy) ;
-        emcRecPoints->Remove(emcRecPoint); 
-        emcRecPoints->Compress() ;
+        fEMCRecPoints->Remove(emcRecPoint); 
+        fEMCRecPoints->Compress() ;
         index-- ;
         fNumberOfEmcClusters -- ;
         numberofNotUnfolded-- ;
@@ -917,13 +779,13 @@ void AliPHOSClusterizerv1::MakeUnfolding()
   // Unfold now CPV clusters
   if(fNumberOfCpvClusters > 0){
     
-    Int_t nModulesToUnfold = geom->GetNModules() ;
+    Int_t nModulesToUnfold = fGeom->GetNModules() ;
 
     Int_t numberofCpvNotUnfolded = fNumberOfCpvClusters ;     
     Int_t index ;   
     for(index = 0 ; index < numberofCpvNotUnfolded ; index++){
       
-      AliPHOSRecPoint * recPoint = dynamic_cast<AliPHOSRecPoint *>( cpvRecPoints->At(index) ) ;
+      AliPHOSRecPoint * recPoint = dynamic_cast<AliPHOSRecPoint *>( fCPVRecPoints->At(index) ) ;
 
       if(recPoint->GetPHOSMod()> nModulesToUnfold)
         break ;
@@ -933,12 +795,12 @@ void AliPHOSClusterizerv1::MakeUnfolding()
       Int_t nMultipl = emcRecPoint->GetMultiplicity() ; 
       AliPHOSDigit ** maxAt = new AliPHOSDigit*[nMultipl] ;
       Float_t * maxAtEnergy = new Float_t[nMultipl] ;
-      Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fCpvLocMaxCut,digits) ;
+      Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fCpvLocMaxCut,fDigitsArr) ;
       
       if( nMax > 1 ) {     // if cluster is very flat (no pronounced maximum) then nMax = 0       
         UnfoldCluster(emcRecPoint, nMax, maxAt, maxAtEnergy) ;
-        cpvRecPoints->Remove(emcRecPoint); 
-        cpvRecPoints->Compress() ;
+        fCPVRecPoints->Remove(emcRecPoint); 
+        fCPVRecPoints->Compress() ;
         index-- ;
         numberofCpvNotUnfolded-- ;
         fNumberOfCpvClusters-- ;
@@ -975,14 +837,6 @@ void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,
 { 
   // Performs the unfolding of a cluster with nMax overlapping showers 
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance();
-
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
-
-  const TClonesArray * digits = gime->Digits() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-
   Int_t nPar = 3 * nMax ;
   Float_t * fitparameters = new Float_t[nPar] ;
 
@@ -1011,9 +865,9 @@ void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,
   Int_t iparam ;
   Int_t iDigit ;
   for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
-    digit = dynamic_cast<AliPHOSDigit*>( digits->At(emcDigits[iDigit] ) ) ;   
-    geom->AbsToRelNumbering(digit->GetId(), relid) ;
-    geom->RelPosInModule(relid, xDigit, zDigit) ;
+    digit = dynamic_cast<AliPHOSDigit*>( fDigitsArr->At(emcDigits[iDigit] ) ) ;   
+    fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
+    fGeom->RelPosInModule(relid, xDigit, zDigit) ;
     efit[iDigit] = 0;
 
     iparam = 0 ;    
@@ -1022,7 +876,7 @@ void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,
       zpar = fitparameters[iparam+1] ;
       epar = fitparameters[iparam+2] ;
       iparam += 3 ;
-//      geom->GetIncidentVector(fVtx,relid[0],xpar,zpar,vIncid) ;
+//      fGeom->GetIncidentVector(fVtx,relid[0],xpar,zpar,vIncid) ;
 //      efit[iDigit] += epar * ShowerShape(xDigit - xpar,zDigit - zpar,vIncid) ;
       efit[iDigit] += epar * ShowerShape(xDigit - xpar,zDigit - zpar) ;
     }
@@ -1042,34 +896,34 @@ void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,
     zpar = fitparameters[iparam+1] ;
     epar = fitparameters[iparam+2] ;
     iparam += 3 ;    
-//    geom->GetIncidentVector(fVtx,iniEmc->GetPHOSMod(),xpar,zpar,vIncid) ;
+//    fGeom->GetIncidentVector(fVtx,iniEmc->GetPHOSMod(),xpar,zpar,vIncid) ;
     
     AliPHOSEmcRecPoint * emcRP = 0 ;  
 
-    if(iniEmc->IsEmc()){ //create new entries in fEmcRecPoints...
+    if(iniEmc->IsEmc()){ //create new entries in fEMCRecPoints...
       
-      if(fNumberOfEmcClusters >= emcRecPoints->GetSize())
-        emcRecPoints->Expand(2*fNumberOfEmcClusters) ;
+      if(fNumberOfEmcClusters >= fEMCRecPoints->GetSize())
+        fEMCRecPoints->Expand(2*fNumberOfEmcClusters) ;
       
-      (*emcRecPoints)[fNumberOfEmcClusters] = new AliPHOSEmcRecPoint("") ;
-      emcRP = dynamic_cast<AliPHOSEmcRecPoint *>( emcRecPoints->At(fNumberOfEmcClusters) ) ;
+      (*fEMCRecPoints)[fNumberOfEmcClusters] = new AliPHOSEmcRecPoint("") ;
+      emcRP = dynamic_cast<AliPHOSEmcRecPoint *>( fEMCRecPoints->At(fNumberOfEmcClusters) ) ;
       fNumberOfEmcClusters++ ;
       emcRP->SetNExMax((Int_t)nPar/3) ;
     }
-    else{//create new entries in fCpvRecPoints
-      if(fNumberOfCpvClusters >= cpvRecPoints->GetSize())
-        cpvRecPoints->Expand(2*fNumberOfCpvClusters) ;
+    else{//create new entries in fCPVRecPoints
+      if(fNumberOfCpvClusters >= fCPVRecPoints->GetSize())
+        fCPVRecPoints->Expand(2*fNumberOfCpvClusters) ;
       
-      (*cpvRecPoints)[fNumberOfCpvClusters] = new AliPHOSCpvRecPoint("") ;
-      emcRP = dynamic_cast<AliPHOSEmcRecPoint *>( cpvRecPoints->At(fNumberOfCpvClusters) ) ;
+      (*fCPVRecPoints)[fNumberOfCpvClusters] = new AliPHOSCpvRecPoint("") ;
+      emcRP = dynamic_cast<AliPHOSEmcRecPoint *>( fCPVRecPoints->At(fNumberOfCpvClusters) ) ;
       fNumberOfCpvClusters++ ;
     }
     
     Float_t eDigit ;
     for(iDigit = 0 ; iDigit < nDigits ; iDigit ++){
-      digit = dynamic_cast<AliPHOSDigit*>( digits->At( emcDigits[iDigit] ) ) ; 
-      geom->AbsToRelNumbering(digit->GetId(), relid) ;
-      geom->RelPosInModule(relid, xDigit, zDigit) ;
+      digit = dynamic_cast<AliPHOSDigit*>( fDigitsArr->At( emcDigits[iDigit] ) ) ; 
+      fGeom->AbsToRelNumbering(digit->GetId(), relid) ;
+      fGeom->RelPosInModule(relid, xDigit, zDigit) ;
 //      ratio = epar * ShowerShape(xDigit - xpar,zDigit - zpar,vIncid) / efit[iDigit] ; 
       ratio = epar * ShowerShape(xDigit - xpar,zDigit - zpar) / efit[iDigit] ; 
       eDigit = emcEnergies[iDigit] * ratio ;
@@ -1092,7 +946,11 @@ void AliPHOSClusterizerv1::UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Dou
 
   AliPHOSEmcRecPoint * emcRP = dynamic_cast<AliPHOSEmcRecPoint*>( toMinuit->At(0) )  ;
   TClonesArray * digits = dynamic_cast<TClonesArray*>( toMinuit->At(1) )  ;
-//  TVector3 * vtx = dynamic_cast<TVector3*>(toMinuit->At(2)) ;  //Vertex position
+  // A bit buggy way to get an access to the geometry
+  // To be revised!
+  AliPHOSGeometry *geom = dynamic_cast<AliPHOSGeometry *>(toMinuit->At(2));
+
+//  TVector3 * vtx = dynamic_cast<TVector3*>(toMinuit->At(3)) ;  //Vertex position
   
   //  AliPHOSEmcRecPoint * emcRP = dynamic_cast<AliPHOSEmcRecPoint *>( gMinuit->GetObjectFit() ) ; // EmcRecPoint to fit
 
@@ -1102,7 +960,6 @@ void AliPHOSClusterizerv1::UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Dou
 
   Float_t * emcEnergies = emcRP->GetEnergiesList() ;
   
-  const AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry() ; 
 //  TVector3 vInc ;
   fret = 0. ;     
   Int_t iparam ;
@@ -1136,7 +993,7 @@ void AliPHOSClusterizerv1::UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Dou
          iParam++ ; 
          Double_t dz = (zDigit - x[iParam]) ; 
          iParam++ ;          
-//         geom->GetIncidentVector(*vtx,emcRP->GetPHOSMod(),x[iParam-2],x[iParam-1],vInc) ;
+//         fGeom->GetIncidentVector(*vtx,emcRP->GetPHOSMod(),x[iParam-2],x[iParam-1],vInc) ;
 //         efit += x[iParam] * ShowerShape(dx,dz,vInc) ;
          efit += x[iParam] * ShowerShape(dx,dz) ;
          iParam++ ;
@@ -1147,7 +1004,7 @@ void AliPHOSClusterizerv1::UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Dou
          Double_t xpar = x[iParam] ;
          Double_t zpar = x[iParam+1] ;
          Double_t epar = x[iParam+2] ;
-//         geom->GetIncidentVector(*vtx,emcRP->GetPHOSMod(),xpar,zpar,vInc) ;
+//         fGeom->GetIncidentVector(*vtx,emcRP->GetPHOSMod(),xpar,zpar,vInc) ;
          Double_t dr = TMath::Sqrt( (xDigit - xpar) * (xDigit - xpar) + (zDigit - zpar) * (zDigit - zpar) );
 //         Double_t shape = sum * ShowerShape(xDigit - xpar,zDigit - zpar,vInc) ;
          Double_t shape = sum * ShowerShape(xDigit - xpar,zDigit - zpar) ;
@@ -1173,7 +1030,7 @@ void AliPHOSClusterizerv1::UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Dou
        Double_t zpar = x[iparam+1] ;
        Double_t epar = x[iparam+2] ;
        iparam += 3 ;
-//       geom->GetIncidentVector(*vtx,emcRP->GetPHOSMod(),xpar,zpar,vInc) ;
+//       fGeom->GetIncidentVector(*vtx,emcRP->GetPHOSMod(),xpar,zpar,vInc) ;
 //       efit += epar * ShowerShape(xDigit - xpar,zDigit - zpar,vInc) ;
        efit += epar * ShowerShape(xDigit - xpar,zDigit - zpar) ;
      }
@@ -1252,26 +1109,16 @@ void AliPHOSClusterizerv1::PrintRecPoints(Option_t * option)
 {
   // Prints list of RecPoints produced at the current pass of AliPHOSClusterizer
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance();
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-
-  AliInfo(Form("\nevent %d \n    Found %d EMC RecPoints and %d CPV RecPoints", 
-              gAlice->GetEvNumber(),
-              emcRecPoints->GetEntriesFast(),
-              cpvRecPoints->GetEntriesFast() ))  ;
+  AliInfo(Form("\nFound %d EMC RecPoints and %d CPV RecPoints", 
+              fEMCRecPoints->GetEntriesFast(),
+              fCPVRecPoints->GetEntriesFast() ))  ;
  
-  fRecPointsInRun +=  emcRecPoints->GetEntriesFast() ; 
-  fRecPointsInRun +=  cpvRecPoints->GetEntriesFast() ; 
-  
-  
   if(strstr(option,"all")) {
     printf("\n EMC clusters \n") ;
     printf("Index    Ene(MeV) Multi Module     X    Y   Z    Lambdas_1  Lambda_2  # of prim  Primaries list\n") ;      
     Int_t index ;
-    for (index = 0 ; index < emcRecPoints->GetEntries() ; index++) {
-      AliPHOSEmcRecPoint * rp = (AliPHOSEmcRecPoint * )emcRecPoints->At(index) ; 
+    for (index = 0 ; index < fEMCRecPoints->GetEntries() ; index++) {
+      AliPHOSEmcRecPoint * rp = (AliPHOSEmcRecPoint * )fEMCRecPoints->At(index) ; 
       TVector3  locpos;  
       rp->GetLocalPosition(locpos);
       Float_t lambda[2]; 
@@ -1292,8 +1139,8 @@ void AliPHOSClusterizerv1::PrintRecPoints(Option_t * option)
     //Now plot CPV recPoints
     printf("\n CPV clusters \n") ;
     printf("Index    Ene(MeV) Module     X     Y    Z  \n") ;      
-    for (index = 0 ; index < cpvRecPoints->GetEntries() ; index++) {
-      AliPHOSCpvRecPoint * rp = (AliPHOSCpvRecPoint * )cpvRecPoints->At(index) ; 
+    for (index = 0 ; index < fCPVRecPoints->GetEntries() ; index++) {
+      AliPHOSCpvRecPoint * rp = (AliPHOSCpvRecPoint * )fCPVRecPoints->At(index) ; 
       
       TVector3  locpos;  
       rp->GetLocalPosition(locpos);
@@ -1315,11 +1162,6 @@ void AliPHOSClusterizerv1::SetDistancesToBadChannels()
   if(!fCalibData->GetNumOfEmcBadChannels()) return;
   AliInfo(Form("%d bad channel(s) found.\n",fCalibData->GetNumOfEmcBadChannels()));
 
-  AliPHOSGetter* gime = AliPHOSGetter::Instance();
-  AliPHOSGeometry* geom = gime->PHOSGeometry();
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ;
-  
   Int_t badIds[8000];
   fCalibData->EmcBadChannelIds(badIds);
 
@@ -1332,13 +1174,13 @@ void AliPHOSClusterizerv1::SetDistancesToBadChannels()
 
   Float_t dist,minDist;
 
-  for(Int_t iRP=0; iRP<emcRecPoints->GetEntries(); iRP++){
-    rp = (AliPHOSEmcRecPoint*)emcRecPoints->At(iRP);
+  for(Int_t iRP=0; iRP<fEMCRecPoints->GetEntries(); iRP++){
+    rp = (AliPHOSEmcRecPoint*)fEMCRecPoints->At(iRP);
     minDist = 1.e+07;
 
     for(Int_t iBad=0; iBad<fCalibData->GetNumOfEmcBadChannels(); iBad++) {
       rp->GetGlobalPosition(gposRecPoint,gmat);
-      geom->RelPosInAlice(badIds[iBad],gposBadChannel);
+      fGeom->RelPosInAlice(badIds[iBad],gposBadChannel);
       AliDebug(2,Form("BC position:[%.3f,%.3f,%.3f], RP position:[%.3f,%.3f,%.3f]. E=%.3f\n",
                      gposBadChannel.X(),gposBadChannel.Y(),gposBadChannel.Z(),
                      gposRecPoint.X(),gposRecPoint.Y(),gposRecPoint.Z(),rp->GetEnergy()));
index b12d9b298f36372e83620d4831dbfc88aeb266e6..f6b765367f76a0d96388fc2bbccd6e394ca46db7 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.52  2007/08/07 14:16:00  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.51  2007/04/11 11:55:45  policheh
  * SetDistancesToBadChannels() added.
  *
@@ -65,8 +68,7 @@ class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
 public:
   
   AliPHOSClusterizerv1() ;
-  AliPHOSClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
-  AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
+  AliPHOSClusterizerv1(AliPHOSGeometry *geom);
   virtual ~AliPHOSClusterizerv1()  ;
   
   virtual Int_t   AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ; 
@@ -85,10 +87,9 @@ public:
   virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold;  } 
   virtual Float_t GetCpvLocalMaxCut()const        { return fCpvLocMaxCut;} 
   virtual Float_t GetCpvLogWeight()const          { return fW0CPV;}  
-  virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
-  virtual Int_t   GetRecPointsInRun() const       {return fRecPointsInRun ;} 
+  //  virtual const char *  GetRecPointsBranch() const{ return GetName() ;}
 
-  virtual void    Exec(Option_t *option);   // Does the job
+  virtual void    Digits2Clusters(Option_t *option);
 
   void Print(const Option_t * = "")const ;
 
@@ -108,7 +109,7 @@ public:
                                             //class member function (not object member function)
   static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag)  ;
                                             // Chi^2 of the fit. Should be static to be passed to MINUIT
-  void Unload() ; 
+  //  void Unload() ; 
   virtual const char * Version() const { return "clu-v1"; }  
 
   virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
@@ -124,12 +125,10 @@ protected:
   void           GetCalibrationParameters(void);
   void           SetDistancesToBadChannels();
 
-  AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
 private:
+  AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
+  AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
 
-  const   TString BranchName() const ; 
-  
   Bool_t  FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy, 
                  Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
   void    Init() ;
@@ -166,13 +165,12 @@ private:
   Float_t fW0 ;                      // logarithmic weight for the cluster center of gravity calculation
   Float_t fCpvLocMaxCut ;            // minimum energy difference to distinguish local maxima in a CPV cluster
   Float_t fW0CPV ;                   // logarithmic weight for the CPV cluster center of gravity calculation
-  Int_t fRecPointsInRun ;            //! Total number of recpoints in one run
+  //  Int_t fRecPointsInRun ;            //! Total number of recpoints in one run
   Float_t fEmcTimeGate ;             // Maximum time difference between the digits in ont EMC cluster
 
   Bool_t  fIsOldRCUFormat;           // assume old RCU raw data format
-  Int_t fEventCounter ;              //! counts the events processed
 
-  ClassDef(AliPHOSClusterizerv1,4)   // Clusterizer implementation version 1
+  ClassDef(AliPHOSClusterizerv1,5)   // Clusterizer implementation version 1
 
 };
 
index f4b0744899bc8495f89ae41740cb6d0fafd41118..61d9ccbc252b9e8d5c7d4b11c5520d0091596aa2 100644 (file)
 // --- AliRoot header files ---
 #include "AliLog.h"
 #include "AliPHOSClusterizerv2.h"
-#include "AliPHOSGetter.h"
-#include "TFolder.h"
 #include "AliPHOSEvalRecPoint.h"
 #include "AliPHOSRecCpvManager.h"
 #include "AliPHOSRecEmcManager.h"
 #include "AliPHOSGeometry.h"
 #include "AliPHOSQualAssDataMaker.h" 
+#include "AliPHOSDigit.h"
 
 ClassImp(AliPHOSClusterizerv2)
 
@@ -44,13 +43,8 @@ AliPHOSClusterizerv2::AliPHOSClusterizerv2() : AliPHOSClusterizerv1()
 {}
 
 //____________________________________________________________________________
-AliPHOSClusterizerv2::AliPHOSClusterizerv2(const char * headerFile, const char * name):
-AliPHOSClusterizerv1(headerFile,name)
-{}
-
-//____________________________________________________________________________
-AliPHOSClusterizerv2::AliPHOSClusterizerv2(const AliPHOSClusterizerv2 & clu):
-AliPHOSClusterizerv1(clu)
+AliPHOSClusterizerv2::AliPHOSClusterizerv2(AliPHOSGeometry *geom):
+AliPHOSClusterizerv1(geom)
 {}
 
 //____________________________________________________________________________
@@ -58,13 +52,12 @@ void AliPHOSClusterizerv2::GetNumberOfClustersFound(int* numb) const
 {
   // Returns the number of found EMC and CPV rec.points
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;   
-  numb[0] = gime->EmcRecPoints()->GetEntries();  
-  numb[1] = gime->CpvRecPoints()->GetEntries();  
+  numb[0] = fEMCRecPoints->GetEntries();  
+  numb[1] = fCPVRecPoints->GetEntries();  
 }
 
 //____________________________________________________________________________
-void AliPHOSClusterizerv2::Exec(Option_t* option)
+void AliPHOSClusterizerv2::Digits2Clusters(Option_t* option)
 {
   // Steering method
 
@@ -73,124 +66,124 @@ void AliPHOSClusterizerv2::Exec(Option_t* option)
   
   if(strstr(option,"print"))
     Print() ; 
+}
+//   AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-
-  TFolder* wPoolF =  gime->PhosLoader()->GetDetectorDataFolder();
+//   TFolder* wPoolF =  gime->PhosLoader()->GetDetectorDataFolder();
   
-  TObjArray* wPool = new TObjArray(400);
-  wPool->SetName("SmartPoints");
-  wPoolF->Add(wPool);
-  wPoolF->Add(this);
+//   TObjArray* wPool = new TObjArray(400);
+//   wPool->SetName("SmartPoints");
+//   wPoolF->Add(wPool);
+//   wPoolF->Add(this);
 
-  Int_t nevents = gime->MaxEvent() ;
-  Int_t ievent ;
+//   Int_t nevents = gime->MaxEvent() ;
+//   Int_t ievent ;
 
-  for(ievent = 0; ievent<nevents; ievent++) {
+//   for(ievent = 0; ievent<nevents; ievent++) {
     
-    gime->Event(ievent,"D") ;
+//     gime->Event(ievent,"D") ;
     
-    AliInfo(Form("MakeClusters invoked..")) ;
-    MakeClusters() ;
-    AliInfo(Form("MakeClusters done.")) ;
+//     AliInfo(Form("MakeClusters invoked..")) ;
+//     MakeClusters() ;
+//     AliInfo(Form("MakeClusters done.")) ;
 
 
-    //SmartRecPoints will communicate with wPool.
+//     //SmartRecPoints will communicate with wPool.
 
-    AliPHOSEvalRecPoint* rp=0;
+//     AliPHOSEvalRecPoint* rp=0;
 
-    // CPV reconstruction
+//     // CPV reconstruction
 
-    AliPHOSRecCpvManager* recCpv = new AliPHOSRecCpvManager();
-    wPoolF->Add(recCpv);
+//     AliPHOSRecCpvManager* recCpv = new AliPHOSRecCpvManager();
+//     wPoolF->Add(recCpv);
 
-    Int_t iPoint; //loop variable
+//     Int_t iPoint; //loop variable
 
-    for(iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
-      rp = new AliPHOSEvalRecPoint(iPoint, kTRUE);
-      rp->MakeJob();
-    }
+//     for(iPoint=0; iPoint<gime->CpvRecPoints()->GetEntriesFast(); iPoint++) {
+//       rp = new AliPHOSEvalRecPoint(iPoint, kTRUE);
+//       rp->MakeJob();
+//     }
 
-    AliPHOSEvalRecPoint pt;
-    pt.UpdateWorkingPool();
+//     AliPHOSEvalRecPoint pt;
+//     pt.UpdateWorkingPool();
 
-    TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-    Int_t nOldCpv = cpvRecPoints->GetEntries();
-    cpvRecPoints->Delete();
-    cpvRecPoints->Compress();
+//     TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
+//     Int_t nOldCpv = cpvRecPoints->GetEntries();
+//     cpvRecPoints->Delete();
+//     cpvRecPoints->Compress();
 
-    Int_t i; //loop variable
+//     Int_t i; //loop variable
 
-    for(i=0; i<wPool->GetEntries(); i++)
-      cpvRecPoints->Add(wPool->At(i));
+//     for(i=0; i<wPool->GetEntries(); i++)
+//       cpvRecPoints->Add(wPool->At(i));
 
-    wPool->Clear();
-    wPool->Compress();
+//     wPool->Clear();
+//     wPool->Compress();
 
-    wPoolF->Remove(recCpv);
-    delete recCpv;
+//     wPoolF->Remove(recCpv);
+//     delete recCpv;
 
-    AliInfo(Form("       %d", gime->CpvRecPoints()->GetEntries() )) ;
-    AliInfo(Form("       %d cpvRecPoints", cpvRecPoints->GetEntries() )) ;
+//     AliInfo(Form("       %d", gime->CpvRecPoints()->GetEntries() )) ;
+//     AliInfo(Form("       %d cpvRecPoints", cpvRecPoints->GetEntries() )) ;
 
 
-    // Now Emc reconstruction
+//     // Now Emc reconstruction
 
-    AliPHOSRecEmcManager* recEmc = new AliPHOSRecEmcManager();
-    wPoolF->Add(recEmc);
+//     AliPHOSRecEmcManager* recEmc = new AliPHOSRecEmcManager();
+//     wPoolF->Add(recEmc);
 
-    for(iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
-      rp = new AliPHOSEvalRecPoint(iPoint, kFALSE);
-      rp->MakeJob();
-    }
+//     for(iPoint=0; iPoint<gime->EmcRecPoints()->GetEntriesFast(); iPoint++) {
+//       rp = new AliPHOSEvalRecPoint(iPoint, kFALSE);
+//       rp->MakeJob();
+//     }
 
-    pt.UpdateWorkingPool();
+//     pt.UpdateWorkingPool();
 
-    TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-    Int_t nOldEmc = emcRecPoints->GetEntries();
-    emcRecPoints->Delete();
-    emcRecPoints->Compress();
+//     TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
+//     Int_t nOldEmc = emcRecPoints->GetEntries();
+//     emcRecPoints->Delete();
+//     emcRecPoints->Compress();
 
-    for(i=0; i<wPool->GetEntries(); i++)
-      emcRecPoints->Add(wPool->At(i));
+//     for(i=0; i<wPool->GetEntries(); i++)
+//       emcRecPoints->Add(wPool->At(i));
 
-    wPool->Clear();
-    wPool->Compress();
+//     wPool->Clear();
+//     wPool->Compress();
 
-    wPoolF->Remove(recEmc);
-    delete recEmc;
+//     wPoolF->Remove(recEmc);
+//     delete recEmc;
 
-    TString message ; 
-    message  = "       %d  OLD cpvRecPoints\n" ; 
-    message += "       %d\n" ; 
-    message += "       %d cpvRecPoints\n" ; 
+//     TString message ; 
+//     message  = "       %d  OLD cpvRecPoints\n" ; 
+//     message += "       %d\n" ; 
+//     message += "       %d cpvRecPoints\n" ; 
 
-    message += "       %d OLD emcRecPoints " ; 
-    message += "       %d\n" ;
-    message += "       %d emcRecPoints\n" ;
+//     message += "       %d OLD emcRecPoints " ; 
+//     message += "       %d\n" ;
+//     message += "       %d emcRecPoints\n" ;
 
-    AliInfo(Form("%s", message.Data(), 
-        nOldCpv, 
-        gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(), 
-        nOldEmc, 
-        gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() )); 
+//     AliInfo(Form("%s", message.Data(), 
+//      nOldCpv, 
+//      gime->CpvRecPoints()->GetEntries(),cpvRecPoints->GetEntries(), 
+//      nOldEmc, 
+//      gime->EmcRecPoints()->GetEntries(), emcRecPoints->GetEntries() )); 
     
-    GetQualAssDataMaker()->Init(AliQualAss::kRECPOINTS) ;    
-    GetQualAssDataMaker()->SetData(gime->EmcRecPoints()) ; 
-    GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
-    GetQualAssDataMaker()->SetData(gime->CpvRecPoints()) ; 
-    GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
+//     GetQualAssDataMaker()->Init(AliQualAss::kRECPOINTS) ;    
+//     GetQualAssDataMaker()->SetData(gime->EmcRecPoints()) ; 
+//     GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
+//     GetQualAssDataMaker()->SetData(gime->CpvRecPoints()) ; 
+//     GetQualAssDataMaker()->Exec(AliQualAss::kRECPOINTS) ; 
 
-    WriteRecPoints();
+//     WriteRecPoints();
 
 
-  } // loop over events
+//   } // loop over events
 
-  if(strstr(option,"tim")) {
-    gBenchmark->Stop("PHOSClusterizer");
-    AliInfo(Form("took %f seconds for Clusterizing", gBenchmark->GetCpuTime("PHOSClusterizer") )) ;
-  }
-}
+//   if(strstr(option,"tim")) {
+//     gBenchmark->Stop("PHOSClusterizer");
+//     AliInfo(Form("took %f seconds for Clusterizing", gBenchmark->GetCpuTime("PHOSClusterizer") )) ;
+//   }
+// }
 
 //____________________________________________________________________________
 Int_t AliPHOSClusterizerv2::AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) const
@@ -206,15 +199,13 @@ Int_t AliPHOSClusterizerv2::AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) co
   // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster 
   // which is compared to a digit (d2)  not yet in a cluster  
 
-  const AliPHOSGeometry * geom = AliPHOSGetter::Instance()->PHOSGeometry();
-
   Int_t rv = 0 ; 
 
   Int_t relid1[4] ; 
-  geom->AbsToRelNumbering(d1->GetId(), relid1) ; 
+  fGeom->AbsToRelNumbering(d1->GetId(), relid1) ; 
 
   Int_t relid2[4] ; 
-  geom->AbsToRelNumbering(d2->GetId(), relid2) ; 
+  fGeom->AbsToRelNumbering(d2->GetId(), relid2) ; 
  
   if ( (relid1[0] == relid2[0]) && (relid1[1]==relid2[1]) ) { // inside the same PHOS module and the same PPSD Module 
     Int_t rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;  
index c3214c74d13e49f2560e1b53f5db300042b7c995..aa73aae13de51414612bb7e2017237ce9087e679 100644 (file)
@@ -9,21 +9,19 @@ class AliPHOSClusterizerv2 : public AliPHOSClusterizerv1 {
 public:
 
   AliPHOSClusterizerv2();
-  AliPHOSClusterizerv2(const char * headerFile, const char * name = "Default") ;
-  AliPHOSClusterizerv2(const AliPHOSClusterizerv2 & clu) ;
+  AliPHOSClusterizerv2(AliPHOSGeometry *geom);
   ~AliPHOSClusterizerv2() {}
   
   Int_t AreNeighbours(AliPHOSDigit* d1, AliPHOSDigit* d2) const ;
   void GetNumberOfClustersFound(int* numb ) const;
 
-  void Exec(Option_t* option);
-  AliPHOSClusterizerv2 & operator = (const AliPHOSClusterizerv2 & /*rvalue*/)  {
-    // assignement operator requested by coding convention but not needed
-    Fatal("operator =", "not implemented") ;
-    return *this ; 
-  }
+  virtual void Digits2Clusters(Option_t* option);
+
+private:
+  AliPHOSClusterizerv2(const AliPHOSClusterizerv2 & clu) ;
+  AliPHOSClusterizerv2 & operator = (const AliPHOSClusterizerv2 &rvalue);
 
-  ClassDef(AliPHOSClusterizerv2,1)
+  ClassDef(AliPHOSClusterizerv2,2)
 };
 
 #endif
index ecfd9403f2d710da0608cd839be72d8faea823d8..e59711168fd910d70b54a719a2679dca152497ec 100644 (file)
@@ -92,6 +92,7 @@ AliPHOSGeometry::AliPHOSGeometry(const Text_t* name, const Text_t* title)
 { 
   // ctor only for internal usage (singleton)
   Init() ; 
+  fgGeom = this;
 }
 
 //____________________________________________________________________________
index 792cab4e52189960d4c13e0f6459820988eadec3..f1d311c2136c53e6ac06b25b93fb2e17f63b18f8 100644 (file)
@@ -813,7 +813,6 @@ Int_t AliPHOSGetter::ReadTreeR() const
   // gets TreeR from the root file (PHOS.RecPoints.root)
   //if ( !IsLoaded("R") ) {
     PhosLoader()->LoadRecPoints("UPDATE") ;
-    PhosLoader()->LoadClusterizer("UPDATE") ;
     //  SetLoaded("R") ; 
     //}
 
index 030b7cb79ba12398faf1b7a1ceee05c67e620203..d38934b519df34205d1df82e15ffe5b135030aac 100644 (file)
@@ -149,11 +149,7 @@ public:
   virtual AliPHOSClusterizer * Clusterizer() ;
   virtual TString               GetRecPointsFileName() const { return PhosLoader()->GetRecPointsFileName() ; } 
   virtual Int_t                 LoadRecPoints(Option_t* opt="") const { return PhosLoader()->LoadRecPoints(opt) ; }
-  virtual Int_t                 LoadClusterizer(Option_t* opt="") const {
-    return  PhosLoader()->LoadClusterizer(opt) ; }
   virtual Int_t                 WriteRecPoints(Option_t* opt="") const { return PhosLoader()->WriteRecPoints(opt) ; }
-  virtual Int_t                 WriteClusterizer(Option_t* opt="") const {
-    return  PhosLoader()->WriteClusterizer(opt) ; }
   
   //========== TrackSegments   TClonesArray * TrackSegments(const char * name = 0) { 
   virtual TClonesArray *           TrackSegments() const;
@@ -185,12 +181,6 @@ public:
   virtual Int_t ReadRaw(AliRawReader *rawReader,Bool_t isOldRCUFormat) ; 
 
   void SetDebug(Int_t level) {fgDebug = level;} // Set debug level 
-  virtual void PostClusterizer(AliPHOSClusterizer * clu) 
-    const{PhosLoader()->PostClusterizer(clu) ; }
-  virtual void PostPID(AliPHOSPID * pid) 
-    const{PhosLoader()->PostPID(pid) ; }
-  virtual void PostTrackSegmentMaker(AliPHOSTrackSegmentMaker * tr) 
-    const{PhosLoader()->PostTrackSegmentMaker(tr) ; }
   virtual void PostSDigitizer (AliPHOSSDigitizer * sdigitizer) 
     const {PhosLoader()->PostSDigitizer(sdigitizer);}    
   virtual void PostDigitizer (AliPHOSDigitizer * digitizer)    
index 46c342611b964f7ff6cf64474477e779a4b14fb4..eac3afe5b7ecbcc5f9287f846b57c3c7685519b9 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.12  2006/08/25 16:00:53  kharlov
+ * Compliance with Effective C++AliPHOSHit.cxx
+ *
  * Revision 1.11  2006/08/01 12:15:03  cvetan
  * Adding a constructor from TFolder. Needed by AliReconstruction plugin scheme
  *
@@ -170,19 +173,12 @@ public:
   //  AliPHOSSDigitizer*  PHOSSDigitizer(TString name = AliConfig::GetDefaultEventFolderName());
   //AliPHOSDigitizer*   PHOSDigitizer()  { return  dynamic_cast<AliPHOSDigitizer*>(Digitizer()) ;}
 
-  AliPHOSClusterizer* Clusterizer () const {return dynamic_cast<AliPHOSClusterizer*>(Reconstructioner()) ;}
-  Int_t PostClusterizer(TTask* clust) const {return PostReconstructioner(clust);}
-  Int_t LoadClusterizer(Option_t * opt="") const {return LoadReconstructioner(opt);}
-  Int_t WriteClusterizer(Option_t * opt="") const {return WriteReconstructioner(opt);}
-
   AliPHOSPID * PID () const {return dynamic_cast<AliPHOSPID*>(PIDTask()) ;}
-  Int_t PostPID(TTask* pid) const {return PostPIDTask(pid);}
   Int_t LoadPID(Option_t * opt="") const {return LoadPIDTask(opt);}
   Int_t WritePID(Option_t * opt="") const {return WritePIDTask(opt);}
 
 
   AliPHOSTrackSegmentMaker * TrackSegmentMaker () const { return dynamic_cast<AliPHOSTrackSegmentMaker *>(Tracker()) ;}
-  Int_t PostTrackSegmentMaker(TTask* segmaker) const {return PostTracker(segmaker);}
   Int_t LoadTrackSegmentMaker(Option_t * opt="") const {return LoadTracker(opt);}
   Int_t WriteTrackSegmentMaker(Option_t * opt="") const {return WriteTracker(opt);}
 
index 23e0305895ff47b9e15b8f56f24052b446986084..d0b8f3c4b5ed5a7d4d987d0cde97def8d71bcf73 100644 (file)
@@ -626,15 +626,15 @@ void  AliPHOSOnlineMonitor::Go(){
   AliPHOSTrackSegmentMakerv1 * tsm = 0 ;
   AliPHOSPIDv1 * pid = 0 ;
   if(fReconstruct){ //We will need calibation parameters
-    clu = new AliPHOSClusterizerv1("PHOS","On Flight") ;
+    clu = new AliPHOSClusterizerv1(gime->PHOSGeometry()) ;
     clu->SetWriting(0) ; //Do not write to file
     clu->SetEmcMinE(0.05) ;  //Minimal energy of the digit
     clu->SetEmcLocalMaxCut(0.05) ; //Height of local maximum over environment
     clu->SetEmcClusteringThreshold(0.2) ; //Minimal energy to start cluster
 //    clu->SetUnfolding(kFALSE) ; //Do not unfold
-    tsm = new AliPHOSTrackSegmentMakerv1("PHOS","On Flight") ;
+    tsm = new AliPHOSTrackSegmentMakerv1(gime->PHOSGeometry());
     tsm->SetWriting(0) ; //Do not write to file
-    pid = new AliPHOSPIDv1("PHOS","On Flight") ;
+    pid = new AliPHOSPIDv1(gime->PHOSGeometry()) ;
     pid->SetWriting(0) ; //Do not write to file    
   }
   
@@ -659,9 +659,10 @@ void  AliPHOSOnlineMonitor::Go(){
        if((rawStream->IsNELevent() || rawStream->IsWELevent()) && fScanSig){
          ScanEdep(digits) ;
          if(fReconstruct){
-           gime->Clusterizer()->Exec("") ;
-           gime->TrackSegmentMaker()->Exec("") ;
-           gime->PID()->Exec("") ;
+           // PLEASE FIX IT !!!
+           //      gime->Clusterizer()->Exec("") ;
+           //      gime->TrackSegmentMaker()->Exec("") ;
+           //      gime->PID()->Exec("") ;
            ScanRecon(recParticles) ;
          }
        }
index 870471a085b5ec8fc79f1ba77b2e711a4d8e766e..f9e1843cbcc75d46a4d8de45e9c23b20b1c033e5 100644 (file)
@@ -40,11 +40,13 @@ ClassImp(AliPHOSPID)
 
 //____________________________________________________________________________
 AliPHOSPID::AliPHOSPID():
-  TTask("",""),
-  fEventFolderName(""),
-  fFirstEvent(0),
-  fLastEvent(-1),
-  fESD(0x0), 
+  TObject(),
+  fGeom(NULL),
+  fESD(0x0),
+  fEMCRecPoints(NULL),
+  fCPVRecPoints(NULL),
+  fTrackSegments(NULL),
+  fRecParticles(NULL),
   fQADM(0x0)
 {
   // ctor
@@ -52,35 +54,78 @@ AliPHOSPID::AliPHOSPID():
 
 
 //____________________________________________________________________________
-AliPHOSPID::AliPHOSPID(const TString alirunFileName, const TString eventFolderName):
-  TTask("PHOS"+AliConfig::Instance()->GetPIDTaskName(), alirunFileName), 
-  fEventFolderName(eventFolderName),
-  fFirstEvent(0),
-  fLastEvent(-1), 
-  fESD(0x0), 
+AliPHOSPID::AliPHOSPID(AliPHOSGeometry *geom):
+  TObject(),
+  fGeom(geom),
+  fESD(0x0),
+  fEMCRecPoints(NULL),
+  fCPVRecPoints(NULL),
+  fTrackSegments(NULL),
+  fRecParticles(NULL),
   fQADM(0x0)
 {
   // ctor
+  fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ;
+  fRecParticles->SetName("RECPARTICLES");
+
   fQADM = new  AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker
   GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;    
 }
 
 //____________________________________________________________________________
 AliPHOSPID::AliPHOSPID(const AliPHOSPID & pid) :
-  TTask(pid),fEventFolderName(pid.GetEventFolderName()),
-  fFirstEvent(pid.GetFirstEvent()),fLastEvent(pid.GetLastEvent()), 
+  TObject(pid),
+  fGeom(pid.fGeom),
   fESD(pid.fESD), 
+  fEMCRecPoints(pid.fEMCRecPoints),
+  fCPVRecPoints(pid.fCPVRecPoints),
+  fTrackSegments(pid.fTrackSegments),
+  fRecParticles(pid.fRecParticles),
   fQADM(pid.fQADM)
 {
   // Copy constructor
 }
+
 //____________________________________________________________________________
 AliPHOSPID::~AliPHOSPID()
 {
   // dtor
- //Remove this from the parental task before destroying
-  if(AliPHOSGetter::Instance()->PhosLoader())
-    AliPHOSGetter::Instance()->PhosLoader()->CleanPIDTask();
+  if (fEMCRecPoints) {
+    fEMCRecPoints->Delete();
+    delete fEMCRecPoints;
+  }
+  if (fCPVRecPoints) {
+    fCPVRecPoints->Delete();
+    delete fCPVRecPoints;
+  }
   delete fQADM ; 
 }
 
+//____________________________________________________________________________
+void AliPHOSPID::SetInput(TTree *clustersTree, TClonesArray *trackSegments)
+{
+  // Read the clusters tree and creates the
+  // arrays with the EMC and CPV
+  // clusters.
+  // and set the corresponding branch addresses
+
+  fTrackSegments = trackSegments;
+
+  TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
+  if (!emcbranch) { 
+    AliError("can't get the branch with the PHOS EMC clusters !");
+    return;
+  }
+  fEMCRecPoints = new TObjArray(100) ;
+  emcbranch->SetAddress(&fEMCRecPoints);
+  emcbranch->GetEntry(0);
+
+  TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
+  if (!cpvbranch) { 
+    AliError("can't get the branch with the PHOS CPV clusters !");
+    return;
+  }
+  fCPVRecPoints = new TObjArray(100) ;
+  cpvbranch->SetAddress(&fCPVRecPoints);
+  cpvbranch->GetEntry(0);
+}
index 938e2a45f28fc6bd45741c61646ee44ecf6a9b53..1db79aded0cbd3b242e5a434bea5febd08ed8a3e 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.40  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.39  2007/07/11 13:43:30  hristov
  * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
  *
 //*-- Author: Yves Schutz (SUBATECH)
 
 // --- ROOT system ---
-
-#include "TTask.h"
-#include "AliConfig.h"
-
-class TFormula ;
-class TClonesArray ;
+#include "TObject.h"
+class TTree;
 
 // --- Standard library ---
 
@@ -48,45 +47,46 @@ class AliPHOSClusterizer ;
 class AliPHOSTrackSegmentMaker ;
 class AliPHOSQualAssDataMaker ; 
 
-class AliPHOSPID : public TTask {
+class AliPHOSPID : public TObject {
 
  public:
 
   AliPHOSPID() ;          // ctor            
-  AliPHOSPID (const TString alirunFileName, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
+  AliPHOSPID (AliPHOSGeometry *geom);
   AliPHOSPID(const AliPHOSPID & pid) ;
   virtual ~AliPHOSPID() ; // dtor
   AliPHOSPID & operator = (const AliPHOSPID & /*rvalue*/)  {
     Fatal("operator =", "not implemented") ; return *this ; }
 
-  virtual Int_t GetRecParticlesInRun()  const { Warning("GetRecParticlesInRun", "not defined" ) ; return 0 ;} 
-  virtual void Print(const Option_t * = "") const { Warning("Print", "not defined" ) ;}
+  virtual void TrackSegments2RecParticles(Option_t * option) = 0;
 
-  void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
-  void SetEventFolderName(TString name) { fEventFolderName = name ; }
+  void SetInput(TTree *clustersTree, TClonesArray *trackSegments);
+  TClonesArray* GetRecParticles() const { return fRecParticles; }
 
-  TString GetEventFolderName() const {return fEventFolderName;}
-  Int_t   GetFirstEvent()      const {return fFirstEvent;     }
-  Int_t   GetLastEvent()       const {return fLastEvent;      }
+  virtual void Print(const Option_t * = "") const = 0;
 
   void SetESD(AliESDEvent *esd) { fESD = esd; }
 
-  virtual const char * Version() const { Warning("Version", "not defined" ) ; return 0 ; }  
-  virtual void WriteRecParticles() = 0;
+  virtual const char * Version() const = 0;
+
   AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; } 
 
 protected:
 
-  TString fEventFolderName ;  // event folder name
-  Int_t   fFirstEvent;        // first event to process
-  Int_t   fLastEvent;         // last  event to process
+  AliPHOSGeometry * fGeom;    //! Pointer to PHOS Geometry
   AliESDEvent * fESD;         //! ESD object
 
+  TObjArray *fEMCRecPoints;      //!Array with EMC clusters
+  TObjArray *fCPVRecPoints;      //!Array with CPV clusters
+
+  TClonesArray *fTrackSegments;     //!Array with found track segments
+  TClonesArray *fRecParticles;      //!Array with reconstructed particles (PID)
+
 private: 
-  virtual void Init() { Warning("Init", "not defined" ) ; } 
+
   AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
 
-  ClassDef(AliPHOSPID,5)  // Particle Identifier algorithm (base class)
+  ClassDef(AliPHOSPID,6)  // Particle Identifier algorithm (base class)
 
 } ;
 
index bcdbdb88f7c4cb93101cec348d84070d17b0d26e..e281da8a7541739b31ec0bf951b2fc5d5905b2cf 100644 (file)
@@ -18,6 +18,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.15  2007/03/06 06:57:05  kharlov
+ * DP:calculation of distance to CPV done in TSM
+ *
  * Revision 1.14  2006/09/07 18:31:08  kharlov
  * Effective c++ corrections (T.Pocheptsov)
  *
 #include "TF2.h"
 #include "TFormula.h"
 #include "TCanvas.h"
+#include "TClonesArray.h"
 
 #include "TBenchmark.h"
 // --- Standard library ---
 
 // --- AliRoot header files ---
 #include "AliLog.h"
-#include "AliRun.h"
-#include "AliGenerator.h"
 #include "AliPHOSPIDv0.h"
 #include "AliPHOSEmcRecPoint.h"
 #include "AliPHOSTrackSegment.h"
 #include "AliPHOSRecParticle.h"
 #include "AliPHOSGeometry.h"
-#include "AliPHOSLoader.h"
 
 ClassImp( AliPHOSPIDv0) 
 
 //____________________________________________________________________________
 AliPHOSPIDv0::AliPHOSPIDv0():
-  fTrackSegmentsTitle(""), 
-  fRecPointsTitle(""),
-  fRecParticlesTitle(""),
   fIDOptions("dis time"),
-  fNEvent(0),
   fClusterizer(0),
   fTSMaker(0),
   fFormula(0),
   fDispersion(0.f),
   fCpvEmcDistance(0.f),
-  fTimeGate(2.e-9f),
-  fRecParticlesInRun(0)
+  fTimeGate(2.e-9f)
 { 
   // default ctor
-  fEventFolderName = ""; 
 }
 
 //____________________________________________________________________________
-AliPHOSPIDv0::AliPHOSPIDv0(const char * evFolderName,const char * name) : 
-  AliPHOSPID(evFolderName, name),
-  fTrackSegmentsTitle(GetName()), 
-  fRecPointsTitle(GetName()),
-  fRecParticlesTitle(GetName()),
+AliPHOSPIDv0::AliPHOSPIDv0(AliPHOSGeometry *geom) : 
+  AliPHOSPID(geom),
   fIDOptions("dis time"),
-  fNEvent(0),
   fClusterizer(0),
   fTSMaker(0),
   fFormula(new TFormula("LambdaCuts","(x>1)*(x<2.5)*(y>0)*(y<x)")),
   fDispersion(2.f),
   fCpvEmcDistance(3.f),
-  fTimeGate(2.e-9f),
-  fRecParticlesInRun(0)
+  fTimeGate(2.e-9f)
 { 
-  //ctor with the indication on where to look for the track segments
-  fEventFolderName    = GetTitle() ; 
-  Init() ;
+  //ctor
 }
 
 //____________________________________________________________________________
 AliPHOSPIDv0::AliPHOSPIDv0(const AliPHOSPIDv0 & rhs) :
   AliPHOSPID(rhs),
-  fTrackSegmentsTitle(rhs.fTrackSegmentsTitle), 
-  fRecPointsTitle(rhs.fRecPointsTitle),
-  fRecParticlesTitle(rhs.fRecParticlesTitle),
   fIDOptions(rhs.fIDOptions),
-  fNEvent(rhs.fNEvent),
   fClusterizer(rhs.fClusterizer),
   fTSMaker(rhs.fTSMaker),
   fFormula(rhs.fFormula),
   fDispersion(rhs.fDispersion),
   fCpvEmcDistance(rhs.fCpvEmcDistance),
-  fTimeGate(rhs.fTimeGate),
-  fRecParticlesInRun(rhs.fRecParticlesInRun)
+  fTimeGate(rhs.fTimeGate)
 {
   //Copy ctor, the same as compiler-generated, possibly wrong if
   //someone implements dtor correctly.
@@ -154,18 +137,13 @@ AliPHOSPIDv0 & AliPHOSPIDv0::operator = (const AliPHOSPIDv0 & rhs)
 {
   //Copy-assignment, emulates compiler generated, possibly wrong.
   AliPHOSPID::operator = (rhs);
-  fTrackSegmentsTitle = rhs.fTrackSegmentsTitle;
-  fRecPointsTitle = rhs.fRecPointsTitle;
-  fRecParticlesTitle = rhs.fRecParticlesTitle;
   fIDOptions = rhs.fIDOptions;
-  fNEvent = rhs.fNEvent;
   fClusterizer = rhs.fClusterizer;
   fTSMaker = rhs.fTSMaker;
   fFormula = rhs.fFormula;
   fDispersion = rhs.fDispersion;
   fCpvEmcDistance = rhs.fCpvEmcDistance;
   fTimeGate = rhs.fTimeGate;
-  fRecParticlesInRun = rhs.fRecParticlesInRun;
 
   return *this;
 }
@@ -206,13 +184,10 @@ AliPHOSPIDv0::~AliPHOSPIDv0()
 //}
 
 //____________________________________________________________________________
-void  AliPHOSPIDv0::Exec(Option_t * option) 
+void  AliPHOSPIDv0::TrackSegments2RecParticles(Option_t * option) 
 {
   //Steering method
-  
-  if( strcmp(GetName(), "")== 0 ) 
-    Init() ;
-  
+
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSPID");
   
@@ -221,78 +196,21 @@ void  AliPHOSPIDv0::Exec(Option_t * option)
     return ; 
   }
 
-  AliRunLoader* runget = AliRunLoader::GetRunLoader(GetTitle());
-  if(runget == 0x0) 
-   {
-     AliError(Form("Can not find run getter in event folder \"%s\"",
-                  GetTitle()));
-     return;
-   }
-  
-  AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(runget->GetLoader("PHOSLoader"));
-  if ( gime == 0 ) 
-   {
-     AliError("Could not obtain the Loader object !"); 
-     return ;
-   } 
-
-  if(gime->BranchExists("RecParticles") )
-    return ;
+  AliInfo(Form("%d emc clusters, %d track segments", 
+              fEMCRecPoints->GetEntriesFast(), 
+              fTrackSegments->GetEntriesFast())) ;
 
-  
-  Int_t nevents = runget->GetNumberOfEvents() ;       //(Int_t) gAlice->TreeE()->GetEntries() ;
-
-  Int_t ievent ;
-  
-  for(ievent = 0; ievent < nevents; ievent++){
-    runget->GetEvent(ievent);
-    AliInfo(Form("event %d %d %d", 
-                ievent, gime->EmcRecPoints(), 
-                gime->TrackSegments())) ;
-    MakeRecParticles() ;
+  MakeRecParticles() ;
     
-    WriteRecParticles();
-    
-    if(strstr(option,"deb"))
-      PrintRecParticles(option) ;
-
-    //increment the total number of rec particles per run 
-    fRecParticlesInRun += gime->RecParticles()->GetEntriesFast() ; 
+  if(strstr(option,"deb"))
+    PrintRecParticles(option) ;
 
-  }
-  
   if(strstr(option,"tim")){
     gBenchmark->Stop("PHOSPID");
-    AliInfo(Form("took %f seconds for PID %f seconds per event", 
-                gBenchmark->GetCpuTime("PHOSPID"), 
-                gBenchmark->GetCpuTime("PHOSPID")/nevents)) ; 
+    AliInfo(Form("took %f seconds for PID", 
+                gBenchmark->GetCpuTime("PHOSPID"))); 
   }
   
-}
-//____________________________________________________________________________
-void AliPHOSPIDv0::Init()
-{
-  // Make all memory allocations that are not possible in default constructor
-  // Add the PID task to the list of PHOS tasks
-  
-  AliRunLoader* runget = AliRunLoader::GetRunLoader(GetTitle());
-  if(runget == 0x0) 
-   {
-     AliError(Form("Can not find run getter in event folder \"%s\"",
-                  GetTitle()));
-     return;
-   }
-  
-  AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(runget->GetLoader("PHOSLoader"));
-  if ( gime == 0 ) 
-   {
-     AliError("Could not obtain the Loader object !"); 
-     return ;
-   } 
-   
-  gime->PostPID(this);
-  gime->LoadRecParticles("UPDATE");
-  
 }
 
 //____________________________________________________________________________
@@ -300,32 +218,9 @@ void  AliPHOSPIDv0::MakeRecParticles()
 {
   // Reconstructs the particles from the tracksegments
 
-  TString taskName(GetName()) ; 
-  taskName.Remove(taskName.Index(Version())-1) ;
-
-  AliRunLoader* runget = AliRunLoader::GetRunLoader(GetTitle());
-  if(runget == 0x0) 
-   {
-     AliError(Form("Can not find run getter in event folder \"%s\"",
-                  GetTitle()));
-     return;
-   }
+  fRecParticles->Clear();
   
-  AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(runget->GetLoader("PHOSLoader"));
-  if ( gime == 0 ) 
-   {
-     AliError("Could not obtain the Loader object !"); 
-     return ;
-   } 
-
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * trackSegments = gime->TrackSegments() ; 
-  TClonesArray * recParticles  = gime->RecParticles() ; 
-
-  recParticles->Clear();
-  
-  TIter next(trackSegments) ; 
+  TIter next(fTrackSegments) ; 
   AliPHOSTrackSegment * ts ; 
   Int_t index = 0 ; 
   AliPHOSRecParticle * rp ; 
@@ -336,18 +231,18 @@ void  AliPHOSPIDv0::MakeRecParticles()
   
   while ( (ts = (AliPHOSTrackSegment *)next()) ) {
     
-    new( (*recParticles)[index] ) AliPHOSRecParticle() ;
-    rp = (AliPHOSRecParticle *)recParticles->At(index) ; 
+    new( (*fRecParticles)[index] ) AliPHOSRecParticle() ;
+    rp = (AliPHOSRecParticle *)fRecParticles->At(index) ; 
     rp->SetTrackSegment(index) ;
     rp->SetIndexInList(index) ;
     
     AliPHOSEmcRecPoint * emc = 0 ;
     if(ts->GetEmcIndex()>=0)
-      emc = (AliPHOSEmcRecPoint *) emcRecPoints->At(ts->GetEmcIndex()) ;
+      emc = (AliPHOSEmcRecPoint *) fEMCRecPoints->At(ts->GetEmcIndex()) ;
     
     AliPHOSRecPoint    * cpv = 0 ;
     if(ts->GetCpvIndex()>=0)
-      cpv = (AliPHOSRecPoint *)   cpvRecPoints->At(ts->GetCpvIndex()) ;
+      cpv = (AliPHOSRecPoint *)   fCPVRecPoints->At(ts->GetCpvIndex()) ;
     
     //set momentum and energy first
     Float_t    e = emc->GetEnergy() ;
@@ -402,17 +297,9 @@ void  AliPHOSPIDv0:: Print(const Option_t *) const
   TString message ; 
   message  = "=============== AliPHOSPIDv0 ================\n" ;
   message += "Making PID\n" ;
-  message += "    Headers file:               %s\n" ; 
-  message += "    RecPoints branch title:     %s\n" ;
-  message += "    TrackSegments Branch title: %s\n" ; 
-  message += "    RecParticles Branch title   %s\n" ;  
   message += "with parameters:\n"  ;
   message += "    Maximal EMC - CPV  distance (cm) %f\n" ;
   AliInfo(Form( message.Data(),  
-       GetTitle(), 
-       fRecPointsTitle.Data(), 
-       fTrackSegmentsTitle.Data(), 
-       fRecParticlesTitle.Data(), 
        fCpvEmcDistance ));
 
   if(fIDOptions.Contains("dis",TString::kIgnoreCase ))
@@ -433,54 +320,6 @@ void  AliPHOSPIDv0::SetShowerProfileCut(const char * formula)
     delete fFormula; 
   fFormula = new TFormula("Lambda Cut",formula) ;
 }
-//____________________________________________________________________________
-void  AliPHOSPIDv0::WriteRecParticles()
-{
-  // Saves the reconstructed particles too a file
-  AliRunLoader* runget = AliRunLoader::GetRunLoader(GetTitle());
-  if(runget == 0x0) 
-   {
-     AliError(Form("Can not find run getter in event folder \"%s\"",
-                  GetTitle()));
-     return;
-   }
-  
-  AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(runget->GetLoader("PHOSLoader"));
-  if ( gime == 0 ) 
-   {
-     AliError("Could not obtain the Loader object !"); 
-     return ;
-   } 
-
-  TClonesArray * recParticles = gime->RecParticles() ; 
-  recParticles->Expand(recParticles->GetEntriesFast() ) ;
-
-  TTree * treeR = gime->TreeR();
-  
-  if(!treeR){
-    gime->MakeTree("R");
-    treeR = gime->TreeR() ;
-  }
-  
-  //First rp
-  Int_t bufferSize = 32000 ;    
-  TBranch * rpBranch = treeR->Branch("PHOSRP",&recParticles,bufferSize);
-  rpBranch->SetTitle(fRecParticlesTitle);
-  
-  //second, pid
-  Int_t splitlevel = 0 ; 
-  AliPHOSPIDv0 * pid = this ;
-  TBranch * pidBranch = treeR->Branch("AliPHOSPID","AliPHOSPIDv0",&pid,bufferSize,splitlevel);
-  pidBranch->SetTitle(fRecParticlesTitle.Data());
-  
-  rpBranch->Fill() ;
-  pidBranch->Fill() ;
-
-  gime->WriteRecParticles("OVERWRITE");
-  gime->WritePID("OVERWRITE");
-
-}
 
 //____________________________________________________________________________
 void  AliPHOSPIDv0::PlotDispersionCuts()const
@@ -552,11 +391,14 @@ TVector3 AliPHOSPIDv0::GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSRec
   dir.SetZ( -dir.Z() ) ;   // why ?  
   dir.SetMag(1.) ;
 
+  // One can not access MC information in the reconstruction!!
+  // PLEASE FIT IT, EITHER BY TAKING 0,0,0 OR ACCESSING THE
+  // VERTEX DIAMOND FROM CDB GRP FOLDER.
   //account correction to the position of IP
-  Float_t xo,yo,zo ; //Coordinates of the origin
-  gAlice->Generator()->GetOrigin(xo,yo,zo) ;
-  TVector3 origin(xo,yo,zo);
-  dir = dir - origin ;
+  //  Float_t xo,yo,zo ; //Coordinates of the origin
+  //  gAlice->Generator()->GetOrigin(xo,yo,zo) ;
+  //  TVector3 origin(xo,yo,zo);
+  //  dir = dir - origin ;
 
   return dir ;  
 }
@@ -565,37 +407,17 @@ void AliPHOSPIDv0::PrintRecParticles(Option_t * option)
 {
   // Print table of reconstructed particles
 
-  AliRunLoader* runget = AliRunLoader::GetRunLoader(GetTitle());
-  if(runget == 0x0) 
-   {
-     AliError(Form("Can not find run getter in event folder \"%s\"",
-                  GetTitle()));
-     return;
-   }
-  
-  AliPHOSLoader* gime = dynamic_cast<AliPHOSLoader*>(runget->GetLoader("PHOSLoader"));
-  if ( gime == 0 ) 
-   {
-     AliError("Could not obtain the Loader object !"); 
-     return ;
-   } 
-
-  TString taskName(GetName()) ; 
-  taskName.Remove(taskName.Index(Version())-1) ;
-  TClonesArray * recParticles = gime->RecParticles() ; 
-  
   TString message ; 
-  message  = "event %d\n" ; 
-  message += "       found %d RecParticles\n" ; 
+  message = "Found %d RecParticles\n" ; 
   AliInfo(Form(message.Data(), 
-              gAlice->GetEvNumber(), recParticles->GetEntriesFast() )) ;   
+              fRecParticles->GetEntriesFast() )) ;   
 
   if(strstr(option,"all")) {  // printing found TS
     AliInfo("  PARTICLE   Index"  ) ; 
    
     Int_t index ;
-    for (index = 0 ; index < recParticles->GetEntries() ; index++) {
-      AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) recParticles->At(index) ;       
+    for (index = 0 ; index < fRecParticles->GetEntries() ; index++) {
+      AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) fRecParticles->At(index) ;       
       
       Text_t particle[11];
       switch(rp->GetType()) {
@@ -634,6 +456,3 @@ void AliPHOSPIDv0::PrintRecParticles(Option_t * option)
     }
   }  
 }
-
-
-
index 9eeeaebacd39362b95068152e14b2cab35d6b27a..8c88457efb9e8b5536f73ed3a2a839b4546bad49 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.12  2007/03/06 06:57:05  kharlov
+ * DP:calculation of distance to CPV done in TSM
+ *
  * Revision 1.11  2006/09/07 18:31:08  kharlov
  * Effective c++ corrections (T.Pocheptsov)
  *
@@ -39,17 +42,14 @@ class  AliPHOSPIDv0 : public AliPHOSPID {
 public:
 
   AliPHOSPIDv0() ;          // ctor            
-  AliPHOSPIDv0(const char* evFolderName, const char * tsBranch = "Default");
+  AliPHOSPIDv0(AliPHOSGeometry *geom);
   virtual ~AliPHOSPIDv0() ; // dtor, empty, memory leak in fFormula member
 
   //Compiler generated should be ok, because destructor is empty.
   AliPHOSPIDv0(const AliPHOSPIDv0 & rhs);
   AliPHOSPIDv0 & operator = (const AliPHOSPIDv0 & rhs);
 
-  virtual void Exec(Option_t * option);
-  //  virtual char * GetRecParticlesBranch()const {return (char*) fRecParticlesTitle.Data() ;}      
-  //  virtual char * GetTrackSegmentsBranch()const{return (char*) fTrackSegmentsTitle.Data(); }
-  virtual Int_t GetRecParticlesInRun() const  {return fRecParticlesInRun ;}  
+  virtual void TrackSegments2RecParticles(Option_t * option);
 
   virtual void PlotDispersionCuts()const ;
   virtual void Print(const Option_t * = "")const ; 
@@ -58,26 +58,19 @@ public:
   virtual void SetDispersionCut(Float_t cut){fDispersion = cut ; } 
   virtual void SetCpvtoEmcDistanceCut(Float_t cut )      {fCpvEmcDistance = cut ;}
   virtual void SetTimeGate(Float_t gate)                 {fTimeGate = gate ;}
-  //  virtual void SetTrackSegmentsBranch(const char* title) { fTrackSegmentsTitle = title;}
-  //  virtual void SetRecParticlesBranch (const char* title) { fRecParticlesTitle = title;} 
+
   virtual const char * Version() const { return "pid-v0" ; }  
                      
  private:
   
-  virtual void Init() ;
   void     MakeRecParticles(void ) ;
 //  Float_t  GetDistance(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv, Option_t * Axis)const ; // Relative Distance CPV-EMC
   TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv)const ;
   void     PrintRecParticles(Option_t * option) ;
-  virtual void WriteRecParticles(); 
 
  private:
 
-  TString                fTrackSegmentsTitle; // branch name with track segments
-  TString                fRecPointsTitle ;    // branch name with rec points
-  TString                fRecParticlesTitle ; // branch name with rec particles
   TString                fIDOptions ;         // PID option
-  Int_t                  fNEvent ;            // current event number
 
   AliPHOSClusterizer   * fClusterizer ;       // !
   AliPHOSTrackSegmentMaker * fTSMaker ;       // !
@@ -86,9 +79,8 @@ public:
   Float_t                fDispersion ;        // dispersion cut
   Float_t                fCpvEmcDistance ;    // Max EMC-CPV distance
   Float_t                fTimeGate ;          // Time of the latest EmcRecPoint accepted as EM
-  Int_t                  fRecParticlesInRun ; //! Total number of recparticles in one run
 
-  ClassDef( AliPHOSPIDv0,1)  // Particle identifier implementation version 1
+  ClassDef( AliPHOSPIDv0,2)  // Particle identifier implementation version 1
 
 };
 
index ac064a65362cacb4182252b00a4fba43ea41ec3e..5816f07b7aab3d59bf4bfa833f4c29774948c647 100644 (file)
@@ -18,6 +18,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.113  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.112  2007/07/11 13:43:30  hristov
  * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
  *
              //#include "AliLog.h"
 #include "AliPHOS.h"
 #include "AliPHOSPIDv1.h"
-#include "AliPHOSGetter.h"
 #include "AliESDEvent.h"
 #include "AliESDVertex.h"
-#include "AliHeader.h"
-#include "AliGenEventHeader.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSEmcRecPoint.h"
+#include "AliPHOSRecParticle.h"
 
 ClassImp( AliPHOSPIDv1) 
 
@@ -149,7 +152,6 @@ AliPHOSPIDv1::AliPHOSPIDv1() :
   fBayesian(kFALSE),
   fDefaultInit(kFALSE),
   fWrite(kFALSE),
-  fNEvent(0),
   fFileNamePrincipalPhoton(),
   fFileNamePrincipalPi0(),
   fFileNameParameters(),
@@ -158,7 +160,6 @@ AliPHOSPIDv1::AliPHOSPIDv1() :
   fX(0),
   fPPhoton(0),
   fPPi0(0),
-  fRecParticlesInRun(0),
   fParameters(0),
   fVtx(0.), 
   fTFphoton(0),
@@ -186,7 +187,6 @@ AliPHOSPIDv1::AliPHOSPIDv1(const AliPHOSPIDv1 & pid ) :
   fBayesian(kFALSE),
   fDefaultInit(kFALSE),
   fWrite(kFALSE),
-  fNEvent(0),
   fFileNamePrincipalPhoton(),
   fFileNamePrincipalPi0(),
   fFileNameParameters(),
@@ -195,7 +195,6 @@ AliPHOSPIDv1::AliPHOSPIDv1(const AliPHOSPIDv1 & pid ) :
   fX(0),
   fPPhoton(0),
   fPPi0(0),
-  fRecParticlesInRun(0),
   fParameters(0),
   fVtx(0.), 
   fTFphoton(0),
@@ -214,17 +213,15 @@ AliPHOSPIDv1::AliPHOSPIDv1(const AliPHOSPIDv1 & pid ) :
 { 
   // ctor
   InitParameters() ; 
-  Init() ;
 
 }
 
 //____________________________________________________________________________
-AliPHOSPIDv1::AliPHOSPIDv1(const TString alirunFileName, const TString eventFolderName) :
-  AliPHOSPID(alirunFileName, eventFolderName),
+AliPHOSPIDv1::AliPHOSPIDv1(AliPHOSGeometry *geom):
+  AliPHOSPID(geom),
   fBayesian(kFALSE),
   fDefaultInit(kFALSE),
   fWrite(kFALSE),
-  fNEvent(0),
   fFileNamePrincipalPhoton(),
   fFileNamePrincipalPi0(),
   fFileNameParameters(),
@@ -233,7 +230,6 @@ AliPHOSPIDv1::AliPHOSPIDv1(const TString alirunFileName, const TString eventFold
   fX(0),
   fPPhoton(0),
   fPPi0(0),
-  fRecParticlesInRun(0),
   fParameters(0),
   fVtx(0.), 
   fTFphoton(0),
@@ -253,7 +249,6 @@ AliPHOSPIDv1::AliPHOSPIDv1(const TString alirunFileName, const TString eventFold
   //ctor with the indication on where to look for the track segments
  
   InitParameters() ; 
-  Init() ;
   fDefaultInit = kFALSE ; 
 }
 
@@ -277,38 +272,14 @@ AliPHOSPIDv1::~AliPHOSPIDv1()
   delete fTFhhadronl;
   delete fDFmuon;
 }
-//____________________________________________________________________________
-const TString AliPHOSPIDv1::BranchName() const 
-{  
-
-  return GetName() ;
-}
  
-//____________________________________________________________________________
-void AliPHOSPIDv1::Init()
-{
-  // Make all memory allocations that are not possible in default constructor
-  // Add the PID task to the list of PHOS tasks
-
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  if(!gime)
-    gime = AliPHOSGetter::Instance(GetTitle(), fEventFolderName.Data()) ; 
-
-  if ( !gime->PID() ) 
-    gime->PostPID(this) ;
-}
-
 //____________________________________________________________________________
 void AliPHOSPIDv1::InitParameters()
 {
   // Initialize PID parameters
   fWrite                   = kTRUE ;
-  fRecParticlesInRun = 0 ; 
-  fNEvent            = 0 ;            
-  fRecParticlesInRun = 0 ;
   fBayesian          = kTRUE ;
   SetParameters() ; // fill the parameters matrix from parameters file
-  SetEventRange(0,-1) ;
 
   // initialisation of response function parameters
   // Tof
@@ -509,12 +480,10 @@ void AliPHOSPIDv1::InitParameters()
 }
 
 //________________________________________________________________________
-void  AliPHOSPIDv1::Exec(Option_t *option)
+void  AliPHOSPIDv1::TrackSegments2RecParticles(Option_t *option)
 {
   // Steering method to perform particle reconstruction and identification
   // for the event range from fFirstEvent to fLastEvent.
-  // This range is optionally set by SetEventRange().
-  // if fLastEvent=-1 (by default), then process events until the end.
   
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSPID");
@@ -524,44 +493,26 @@ void  AliPHOSPIDv1::Exec(Option_t *option)
     return ; 
   }
 
+  if(fTrackSegments && //Skip events, where no track segments made
+     fTrackSegments->GetEntriesFast()) {
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  if (fLastEvent == -1) 
-    fLastEvent = gime->MaxEvent() - 1 ;
-  else 
-    fLastEvent = TMath::Min(fLastEvent,gime->MaxEvent());
-  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
-
-  Int_t ievent ; 
-  for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
-    gime->Event(ievent,"TR") ;
-    if(gime->TrackSegments() && //Skip events, where no track segments made
-       gime->TrackSegments()->GetEntriesFast()) {
-
-      GetVertex() ;
-      MakeRecParticles() ;
-
-      if(fBayesian)
-       MakePID() ; 
+    GetVertex() ;
+    MakeRecParticles() ;
+
+    if(fBayesian)
+      MakePID() ; 
       
-      WriteRecParticles();
-      if(strstr(option,"deb"))
-       PrintRecParticles(option) ;
-      //increment the total number of rec particles per run 
-      fRecParticlesInRun += gime->RecParticles()->GetEntriesFast() ; 
-    }
+    if(strstr(option,"deb"))
+      PrintRecParticles(option) ;
   }
+
   if(strstr(option,"deb"))
       PrintRecParticles(option);
   if(strstr(option,"tim")){
     gBenchmark->Stop("PHOSPID");
-    AliInfo(Form("took %f seconds for PID %f seconds per event", 
-        gBenchmark->GetCpuTime("PHOSPID"),  
-        gBenchmark->GetCpuTime("PHOSPID")/nEvents)) ;
+    AliInfo(Form("took %f seconds for PID", 
+                gBenchmark->GetCpuTime("PHOSPID")));  
   }
-  if(fWrite)
-    Unload();
 }
 
 //________________________________________________________________________
@@ -1043,17 +994,13 @@ void  AliPHOSPIDv1::MakePID()
   
   const Int_t kSPECIES = AliPID::kSPECIESN ;
  
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-
-  Int_t nparticles = gime->RecParticles()->GetEntriesFast() ;
+  Int_t nparticles = fRecParticles->GetEntriesFast() ;
 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * trackSegments = gime->TrackSegments() ;
-  if ( !emcRecPoints || !cpvRecPoints || !trackSegments ) {
+  if ( !fEMCRecPoints || !fCPVRecPoints || !fTrackSegments ) {
     AliFatal("RecPoints or TrackSegments not found !") ;  
   }
-  TIter next(trackSegments) ; 
+
+  TIter next(fTrackSegments) ; 
   AliPHOSTrackSegment * ts ; 
   Int_t index = 0 ; 
 
@@ -1077,7 +1024,7 @@ void  AliPHOSPIDv1::MakePID()
 
     AliPHOSEmcRecPoint * emc = 0 ;
     if(ts->GetEmcIndex()>=0)
-      emc = (AliPHOSEmcRecPoint *) emcRecPoints->At(ts->GetEmcIndex()) ;
+      emc = (AliPHOSEmcRecPoint *) fEMCRecPoints->At(ts->GetEmcIndex()) ;
     
 //    AliPHOSCpvRecPoint * cpv = 0 ;
 //    if(ts->GetCpvIndex()>=0)
@@ -1325,7 +1272,7 @@ void  AliPHOSPIDv1::MakePID()
   
   for(index = 0 ; index < nparticles ; index ++) {
     
-    AliPHOSRecParticle * recpar = gime->RecParticle(index) ;  
+    AliPHOSRecParticle * recpar = static_cast<AliPHOSRecParticle *>(fRecParticles->At(index));
     
     //Conversion electron?
     
@@ -1384,34 +1331,29 @@ void  AliPHOSPIDv1::MakeRecParticles()
 {
   // Makes a RecParticle out of a TrackSegment
   
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * trackSegments = gime->TrackSegments() ; 
-  if ( !emcRecPoints || !cpvRecPoints || !trackSegments ) {
+  if ( !fEMCRecPoints || !fCPVRecPoints || !fTrackSegments ) {
     AliFatal("RecPoints or TrackSegments not found !") ;  
   }
-  TClonesArray * recParticles  = gime->RecParticles() ; 
-  recParticles->Clear();
+  fRecParticles->Clear();
 
-  TIter next(trackSegments) ; 
+  TIter next(fTrackSegments) ; 
   AliPHOSTrackSegment * ts ; 
   Int_t index = 0 ; 
   AliPHOSRecParticle * rp ; 
   while ( (ts = (AliPHOSTrackSegment *)next()) ) {
     //  cout<<">>>>>>>>>>>>>>>PCA Index "<<index<<endl;
-    new( (*recParticles)[index] ) AliPHOSRecParticle() ;
-    rp = (AliPHOSRecParticle *)recParticles->At(index) ; 
+    new( (*fRecParticles)[index] ) AliPHOSRecParticle() ;
+    rp = (AliPHOSRecParticle *)fRecParticles->At(index) ; 
     rp->SetTrackSegment(index) ;
     rp->SetIndexInList(index) ;
        
     AliPHOSEmcRecPoint * emc = 0 ;
     if(ts->GetEmcIndex()>=0)
-      emc = (AliPHOSEmcRecPoint *) emcRecPoints->At(ts->GetEmcIndex()) ;
+      emc = (AliPHOSEmcRecPoint *) fEMCRecPoints->At(ts->GetEmcIndex()) ;
     
     AliPHOSCpvRecPoint * cpv = 0 ;
     if(ts->GetCpvIndex()>=0)
-      cpv = (AliPHOSCpvRecPoint *) cpvRecPoints->At(ts->GetCpvIndex()) ;
+      cpv = (AliPHOSCpvRecPoint *) fCPVRecPoints->At(ts->GetCpvIndex()) ;
     
     Int_t track = 0 ; 
     track = ts->GetTrackIndex() ; 
@@ -1513,11 +1455,10 @@ void  AliPHOSPIDv1::MakeRecParticles()
     rp->SetLastDaughter(-1);
     rp->SetPolarisation(0,0,0);
     //Set the position in global coordinate system from the RecPoint
-    AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
-    AliPHOSTrackSegment * ts  = gime->TrackSegment(rp->GetPHOSTSIndex()) ; 
-    AliPHOSEmcRecPoint  * erp = gime->EmcRecPoint(ts->GetEmcIndex()) ; 
+    AliPHOSTrackSegment * ts  = static_cast<AliPHOSTrackSegment *>(fTrackSegments->At(rp->GetPHOSTSIndex()));
+    AliPHOSEmcRecPoint  * erp = static_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(ts->GetEmcIndex()));
     TVector3 pos ; 
-    geom->GetGlobalPHOS(erp, pos) ; 
+    fGeom->GetGlobalPHOS(erp, pos) ; 
     rp->SetPos(pos);
     index++ ; 
   }
@@ -1548,23 +1489,17 @@ void AliPHOSPIDv1::PrintRecParticles(Option_t * option)
 {
   // Print table of reconstructed particles
 
-  AliPHOSGetter *gime = AliPHOSGetter::Instance() ; 
-
-  TClonesArray * recParticles = gime->RecParticles() ; 
-
   TString message ; 
-  message  = "\nevent " ;
-  message += gime->EventNumber();
-  message += "       found " ; 
-  message += recParticles->GetEntriesFast(); 
+  message  = "       found " ; 
+  message += fRecParticles->GetEntriesFast(); 
   message += " RecParticles\n" ; 
 
   if(strstr(option,"all")) {  // printing found TS
     message += "\n  PARTICLE         Index    \n" ; 
     
     Int_t index ;
-    for (index = 0 ; index < recParticles->GetEntries() ; index++) {
-      AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) recParticles->At(index) ;       
+    for (index = 0 ; index < fRecParticles->GetEntries() ; index++) {
+      AliPHOSRecParticle * rp = (AliPHOSRecParticle * ) fRecParticles->At(index) ;       
       message += "\n" ;
       message += rp->Name().Data() ;  
       message += " " ;
@@ -1724,39 +1659,6 @@ void  AliPHOSPIDv1::SetParameterToCalculateEllipse(TString particle, TString par
     (*fParameters)(p,i) = par ;
 } 
 
-//____________________________________________________________________________
-void AliPHOSPIDv1::Unload() 
-{
-  //Unloads RecPoints, Tracks and RecParticles
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;  
-  gime->PhosLoader()->UnloadRecPoints() ;
-  gime->PhosLoader()->UnloadTracks() ;
-  gime->PhosLoader()->UnloadRecParticles() ;
-}
-
-//____________________________________________________________________________
-void  AliPHOSPIDv1::WriteRecParticles()
-{
-  //It writes reconstructed particles and pid to file
-
-  AliPHOSGetter *gime = AliPHOSGetter::Instance() ; 
-
-  TClonesArray * recParticles = gime->RecParticles() ; 
-  recParticles->Expand(recParticles->GetEntriesFast() ) ;
-  if(fWrite){
-    TTree * treeP =  gime->TreeP();
-    
-    //First rp
-    Int_t bufferSize = 32000 ;
-    TBranch * rpBranch = treeP->Branch("PHOSRP",&recParticles,bufferSize);
-    rpBranch->SetTitle(BranchName());
-    
-    rpBranch->Fill() ;
-    
-    gime->WriteRecParticles("OVERWRITE");
-    gime->WritePID("OVERWRITE");
-  }
-}
 //____________________________________________________________________________
 void AliPHOSPIDv1::GetVertex(void)
 { //extract vertex either using ESD or generator
@@ -1769,14 +1671,9 @@ void AliPHOSPIDv1::GetVertex(void)
       return ;
     }
   }
-  if(gAlice && gAlice->GetHeader() && gAlice->GetHeader()->GenEventHeader()){
-     AliGenEventHeader *eh = gAlice->GetHeader()->GenEventHeader() ;
-     TArrayF ftx ;
-     eh->PrimaryVertex(ftx);
-     fVtx.SetXYZ(ftx[0],ftx[1],ftx[2]) ;
-     return ;
-  }
+
+  // Use vertex diamond from CDB GRP folder if the one from ESD is missing
+  // PLEASE FIX IT 
   AliWarning("Can not read vertex from data, use fixed \n") ;
   fVtx.SetXYZ(0.,0.,0.) ;
  
index 8a102c367802260c88f8f6759ad1709dc7342566..b61b717aca19c291ed2a92a04a0446727853901a 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.60  2007/04/01 15:40:15  kharlov
+ * Correction for actual vertex position implemented
+ *
  * Revision 1.59  2007/03/06 06:57:46  kharlov
  * DP:calculation of distance to CPV done in TSM
  *
@@ -54,12 +57,12 @@ class  AliPHOSPIDv1 : public AliPHOSPID {
 public:
   
   AliPHOSPIDv1() ;          // ctor   
-  AliPHOSPIDv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
+  AliPHOSPIDv1(AliPHOSGeometry *geom);
   AliPHOSPIDv1(const AliPHOSPIDv1 & pid) ;          // cpy ctor            
   
   virtual ~AliPHOSPIDv1() ; // dtor
   
-  virtual void Exec(Option_t *option);  // Does the job
+  virtual void TrackSegments2RecParticles(Option_t *option);  // Does the job
 
   //Get file name that contain the PCA
   const TString GetFileNamePrincipal(TString particle) const;
@@ -67,10 +70,6 @@ public:
   //Get file name that contain PID parameters
   const TString GetFileNameParameters()      const {return fFileNameParameters ;}
 
-  // Get number of rec.particles in this run
-  virtual Int_t GetRecParticlesInRun() const {return fRecParticlesInRun ;}  
-
-
   // Get PID parameters as they are defined in fParameters
   Float_t GetParameterCalibration    (Int_t i)               const;
   Float_t GetParameterCpv2Emc        (Int_t i, TString axis) const;
@@ -117,8 +116,6 @@ public:
   
 private:
   
-  const TString BranchName() const ; 
-  virtual void  Init() ;
   virtual void  InitParameters() ;
   void          MakeRecParticles(void ) ;
   void          MakePID(void) ;
@@ -136,9 +133,7 @@ private:
   Int_t   GetHardPi0Bit   (AliPHOSEmcRecPoint * emc) const;
   TVector3      GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv)const ;
   void          PrintRecParticles(Option_t * option) ;
-  virtual void  WriteRecParticles() ; 
   void          SetParameters() ; //Fills the matrix of parameters
-  void          Unload(); 
 
   //PID population
   void SetInitPID(const Double_t * pid) ;
@@ -148,7 +143,6 @@ private:
   Bool_t      fBayesian ;                 //  Do PID bayesian
   Bool_t      fDefaultInit;              //! kTRUE if the task was created by defaut ctor (only parameters are initialized)
   Bool_t      fWrite ;                   //! To write result to file 
-  Int_t       fNEvent ;                  //! current event number
   TString     fFileNamePrincipalPhoton ; //  File name of the photon principals
   TString     fFileNamePrincipalPi0 ;    //  File name of the pi0 principals
   TString     fFileNameParameters ;      //  File name with PID parameters
@@ -157,7 +151,6 @@ private:
   Double_t   *fX ;                       //! Shower shape for the principal data 
   Double_t   *fPPhoton ;                 //! Principal photon eigenvalues
   Double_t   *fPPi0 ;                    //! Principal pi0 eigenvalues
-  Int_t       fRecParticlesInRun ;       //! Total number of recparticles in one run
   TMatrixF    *fParameters;               //! Matrix of identification Parameters
 
   TVector3   fVtx ;                      //! Vertex position in current event
@@ -199,7 +192,7 @@ private:
   Float_t  fDispEnThreshold;          //Minimum energy to use shower shape
   Int_t    fDispMultThreshold ;       //Minimum multiplicity to use shower shape
 
-  ClassDef( AliPHOSPIDv1,12)  // Particle identifier implementation version 1
+  ClassDef( AliPHOSPIDv1,13)  // Particle identifier implementation version 1
 
 };
 
index 202165114b986d169a48fcda13c18ab9e7dc34a1..fa8ac8436e8a61c38335d004cc6f13f292719054 100644 (file)
@@ -164,11 +164,6 @@ void AliPHOSRecPoint::ExecuteEvent(Int_t event, Int_t, Int_t)
   case kButton1Down:{
     AliPHOSDigit * digit ;
   
-//  Accessing geometry this way is equivalent to getting from gAlice
-// to have Detector in Folder one have to load gAlice anyway
-//    AliPHOSLoader * gime = AliPHOSLoader::GetInstance();
-//    AliPHOSGeometry * phosgeom =  const_cast<AliPHOSGeometry*>(gime->PHOSGeometry());
-
     AliPHOSGeometry * phosgeom = AliPHOSLoader::GetPHOSGeometry();
 
     Int_t iDigit;
@@ -243,7 +238,7 @@ void AliPHOSRecPoint::EvalPHOSMod(AliPHOSDigit * digit)
   if( fPHOSMod == 0){
   Int_t relid[4] ; 
  
-  AliPHOSGeometry * phosgeom = (AliPHOSGetter::Instance())->PHOSGeometry();
+  AliPHOSGeometry * phosgeom = (AliPHOSGeometry::GetInstance());
 
   phosgeom->AbsToRelNumbering(digit->GetId(), relid) ;
   fPHOSMod = relid[0];
@@ -368,7 +363,7 @@ void AliPHOSRecPoint::EvalLocal2TrackingCSTransform()
   Double_t dy;
   Double_t crystalShift;
 
-  AliPHOSGeometry * phosgeom = (AliPHOSGetter::Instance())->PHOSGeometry();
+  AliPHOSGeometry * phosgeom = AliPHOSGeometry::GetInstance();
   AliPHOSEMCAGeometry* geoEMCA = phosgeom->GetEMCAGeometry(); 
 
   //Calculate offset to crystal surface.
index 386a40df1c9e77474168f9b260a26d46852f4a61..ed24fb1041627ff5fe5b41fb7fed22ff1687fff3 100644 (file)
 // --- Standard library ---
 
 // --- AliRoot header files ---
+#include "AliLog.h"
+#include "AliPHOSQualAssDataMaker.h"
 #include "AliESDEvent.h"
 #include "AliESDCaloCluster.h"
 #include "AliPHOSReconstructor.h"
 #include "AliPHOSClusterizerv1.h"
 #include "AliPHOSTrackSegmentMakerv1.h"
 #include "AliPHOSPIDv1.h"
-#include "AliPHOSGetter.h"
 #include "AliPHOSTracker.h"
 #include "AliRawReader.h"
 #include "AliPHOSTrigger.h"
 #include "AliPHOSGeometry.h"
 #include "AliPHOSRecoParamEmc.h"
 #include "AliPHOSRecoParamCpv.h"
+#include "AliPHOSDigit.h"
+#include "AliPHOSTrackSegment.h"
+#include "AliPHOSEmcRecPoint.h"
+#include "AliPHOSRecParticle.h"
+#include "AliPHOSRawDecoder.h"
+#include "AliPHOSRawDigiProducer.h"
+#include "AliPHOSPulseGenerator.h"
 
 ClassImp(AliPHOSReconstructor)
 
@@ -47,7 +55,8 @@ AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamEmc =0;  // EMC rec. paramet
 AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamCpv =0;  // CPV rec. parameters
 
 //____________________________________________________________________________
-  AliPHOSReconstructor::AliPHOSReconstructor() 
+AliPHOSReconstructor::AliPHOSReconstructor() :
+  fGeom(NULL)
 {
   // ctor
 
@@ -61,85 +70,85 @@ AliPHOSRecoParam* AliPHOSReconstructor::fgkRecoParamCpv =0;  // CPV rec. paramet
     fgkRecoParamCpv = AliPHOSRecoParamCpv::GetCpvDefaultParameters();
   }
 
+  fGeom = AliPHOSGeometry::GetInstance("IHEP","");
 } 
 
 //____________________________________________________________________________
   AliPHOSReconstructor::~AliPHOSReconstructor()
 {
   // dtor
-
+  delete fGeom;
 } 
 
 //____________________________________________________________________________
-void AliPHOSReconstructor::Reconstruct(AliRunLoader* runLoader) const
+void AliPHOSReconstructor::Reconstruct(TTree* digitsTree, TTree* clustersTree) const
 {
-  // method called by AliReconstruction; 
+  // 'single-event' local reco method called by AliReconstruction; 
   // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
   // segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by 
   // the global tracking.
-  TString headerFile(runLoader->GetFileName()) ; 
-  TString branchName(runLoader->GetEventFolder()->GetName()) ;  
-  
-  AliPHOSClusterizerv1 clu(headerFile, branchName);
-  clu.SetEventRange(0, -1) ; // do all the events
+
+  AliPHOSClusterizerv1 clu(fGeom);
+  clu.SetInput(digitsTree);
+  clu.SetOutput(clustersTree);
   if ( Debug() ) 
-    clu.ExecuteTask("deb all") ; 
+    clu.Digits2Clusters("deb all") ; 
   else 
-    clu.ExecuteTask("") ;  
-
+    clu.Digits2Clusters("") ;
 }
 
 //____________________________________________________________________________
-void AliPHOSReconstructor::Reconstruct(AliRunLoader* runLoader, AliRawReader* rawreader) const
+void AliPHOSReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree, 
+                                  AliESDEvent* esd) const
 {
-  // method called by AliReconstruction; 
-  // Only the clusterization is performed,; the rest of the reconstruction is done in FillESD because the track
-  // segment maker needs access to the AliESDEvent object to retrieve the tracks reconstructed by 
-  // the global tracking.
-  // Here we reconstruct from Raw Data
-
-  rawreader->Reset() ; 
-  TString headerFile(runLoader->GetFileName()) ; 
-  TString branchName(runLoader->GetEventFolder()->GetName()) ;  
+  // This method produces PHOS rec-particles,
+  // then it creates AliESDtracks out of them and
+  // write tracks to the ESD
+
+  AliPHOSTrackSegmentMaker *tsm = new AliPHOSTrackSegmentMakerv1(fGeom);
+  tsm->GetQualAssDataMaker()->Init(AliQualAss::kTRACKSEGMENTS) ; 
+  AliPHOSPID *pid = new AliPHOSPIDv1(fGeom);
+  pid->GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;    
+
+  // do current event; the loop over events is done by AliReconstruction::Run()
+  tsm->SetESD(esd) ; 
+  tsm->SetInput(clustersTree);
+  if ( Debug() ) 
+    tsm->Clusters2TrackSegments("deb all") ;
+  else 
+    tsm->Clusters2TrackSegments("") ;
   
-  AliPHOSClusterizerv1 clu(headerFile, branchName);
-  clu.SetEventRange(0, -1) ; // do all the events
-  clu.SetRawReader(rawreader);
-
-  TString option = GetOption();
-  if (option.Contains("OldRCUFormat"))
-    clu.SetOldRCUFormat(kTRUE);
+  tsm->GetQualAssDataMaker()->SetData(tsm->GetTrackSegments()) ; 
+  tsm->GetQualAssDataMaker()->Exec(AliQualAss::kTRACKSEGMENTS) ; 
 
+  pid->SetInput(clustersTree, tsm->GetTrackSegments()) ; 
+  pid->SetESD(esd) ; 
   if ( Debug() ) 
-    clu.ExecuteTask("deb all") ; 
+    pid->TrackSegments2RecParticles("deb all") ;
   else 
-    clu.ExecuteTask("") ;
-
-}
+    pid->TrackSegments2RecParticles("") ;
 
-//____________________________________________________________________________
-void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) const
-{
+  pid->GetQualAssDataMaker()->SetData(pid->GetRecParticles()) ; 
+  pid->GetQualAssDataMaker()->Exec(AliQualAss::kRECPARTICLES) ; 
+  
+  // PLEASE FIX IT. SHOULD GO TO ALIRECONSTRUCTION !!
+  //  if ( eventNumber == gime->MaxEvent()-1 ) {
+  //   fTSM->GetQualAssDataMaker()->Finish(AliQualAss::kTRACKSEGMENTS) ; 
+  //   fPID->GetQualAssDataMaker()->Finish(AliQualAss::kRECPARTICLES) ; 
+  //  }
+       
   // This function creates AliESDtracks from AliPHOSRecParticles
   //         and
   // writes them to the ESD
 
-  Int_t eventNumber = runLoader->GetEventNumber() ;
-
-
-  AliPHOSGetter *gime = AliPHOSGetter::Instance();
-  gime->Event(eventNumber, "DRTP") ; 
-  TClonesArray *recParticles  = gime->RecParticles();
+  TClonesArray *recParticles  = pid->GetRecParticles();
   Int_t nOfRecParticles = recParticles->GetEntries();
   
   
   esd->SetNumberOfPHOSClusters(nOfRecParticles) ; 
   esd->SetFirstPHOSCluster(esd->GetNumberOfCaloClusters()) ;
 
-  Int_t maxClu = esd->GetNumberOfPHOSClusters() ; 
-
-  AliDebug(2,Form("%d digits and %d rec. particles in event %d, option %s",gime->Digits()->GetEntries(),nOfRecParticles,eventNumber,GetOption()));
+  AliDebug(2,Form("%d rec. particles, option %s",nOfRecParticles,GetOption()));
 
 
   //#########Calculate trigger and set trigger info###########
@@ -153,8 +162,6 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) co
   Float_t ampOutOfPatch2x2  = tr.Get2x2AmpOutOfPatch() ;
   Float_t ampOutOfPatchnxn  = tr.GetnxnAmpOutOfPatch() ;
 
-  AliPHOSGeometry * geom = gime->PHOSGeometry();
-
   Int_t iSM2x2      = tr.Get2x2SuperModule();
   Int_t iSMnxn      = tr.GetnxnSuperModule();
   Int_t iCrystalPhi2x2 = tr.Get2x2CrystalPhi();
@@ -171,10 +178,10 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) co
   Int_t iAbsIdnxn =-1;
   TVector3    pos2x2(-1,-1,-1);
   TVector3    posnxn(-1,-1,-1);
-  geom->RelToAbsNumbering(iRelId2x2, iAbsId2x2);
-  geom->RelToAbsNumbering(iRelIdnxn, iAbsIdnxn);
-  geom->RelPosInAlice(iAbsId2x2, pos2x2);
-  geom->RelPosInAlice(iAbsIdnxn, posnxn);
+  fGeom->RelToAbsNumbering(iRelId2x2, iAbsId2x2);
+  fGeom->RelToAbsNumbering(iRelIdnxn, iAbsIdnxn);
+  fGeom->RelPosInAlice(iAbsId2x2, pos2x2);
+  fGeom->RelPosInAlice(iAbsIdnxn, posnxn);
 
   TArrayF triggerPosition(6);
   triggerPosition[0] = pos2x2(0) ;   
@@ -206,8 +213,19 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) co
     if (Debug()) 
       rp->Print();
     // Get track segment and EMC rec.point associated with this rec.particle
-    AliPHOSTrackSegment *ts    = gime->TrackSegment(rp->GetPHOSTSIndex());
-    AliPHOSEmcRecPoint  *emcRP = gime->EmcRecPoint(ts->GetEmcIndex());
+    AliPHOSTrackSegment *ts    = static_cast<AliPHOSTrackSegment *>(tsm->GetTrackSegments()->At(rp->GetPHOSTSIndex()));
+
+    // Get the clusters array
+    TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
+    if (!emcbranch) { 
+      AliError("can't get the branch with the PHOS EMC clusters !");
+      return;
+    }
+    TObjArray *emcRecPoints = new TObjArray(100) ;
+    emcbranch->SetAddress(&emcRecPoints);
+    emcbranch->GetEntry(0);
+
+    AliPHOSEmcRecPoint  *emcRP = static_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(ts->GetEmcIndex()));
     AliESDCaloCluster   *ec    = new AliESDCaloCluster() ; 
         
     Float_t xyz[3];
@@ -223,9 +241,19 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) co
     Short_t *timeList  = new Short_t[digitMult];
     Short_t *digiList  = new Short_t[digitMult];
 
+    // Read digits array
+    TBranch *branch = digitsTree->GetBranch("PHOS");
+    if (!branch) { 
+      AliError("can't get the branch with the PHOS digits !");
+      return;
+    }
+    TClonesArray *digitsArr = new TClonesArray("AliPHOSDigit",100);
+    branch->SetAddress(&digitsArr);
+    branch->GetEntry(0);
+
     // Convert Float_t* and Int_t* to Short_t* to save memory
     for (Int_t iDigit=0; iDigit<digitMult; iDigit++) {
-      AliPHOSDigit *digit = gime->Digit(digitsList[iDigit]);
+      AliPHOSDigit *digit = static_cast<AliPHOSDigit *>(digitsArr->At(digitsList[iDigit]));
       amplList[iDigit] =
        (Short_t)(TMath::Min(digit->GetEnergy()*gev500,kBigShort)); // Energy in units of GeV/500
       timeList[iDigit] =
@@ -276,97 +304,72 @@ void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader, AliESDEvent* esd) co
     
     // add the track to the esd object
     esd->AddCaloCluster(ec);
-    delete ec;    
+    delete ec;   
+    delete [] primList;
+    delete [] amplList;
+    delete [] timeList;
+    delete [] digiList;    
   }  
 }
 
-//____________________________________________________________________________
-void AliPHOSReconstructor::FillESD(AliRunLoader* runLoader,
-                                  AliRawReader* rawReader, AliESDEvent* esd) const
+AliTracker* AliPHOSReconstructor::CreateTracker(AliRunLoader* /* runLoader */) const
 {
-  //This function creates AliESDtracks from AliPHOSRecParticles 
-  //and writes them to the ESD in the case of raw data reconstruction.
-
-  Int_t eventNumber = runLoader->GetEventNumber() ;
-
-  AliPHOSGetter *gime = AliPHOSGetter::Instance();
-  gime->Event(eventNumber, "DRTP") ; 
-
-  TClonesArray *recParticles  = gime->RecParticles();
-  Int_t nOfRecParticles = recParticles->GetEntries();
-
-  esd->SetNumberOfPHOSClusters(nOfRecParticles) ; 
-  esd->SetFirstPHOSCluster(esd->GetNumberOfCaloClusters()) ;
-  
-  AliDebug(2,Form("%d digits and %d rec. particles in event %d, option %s",gime->Digits()->GetEntries(),nOfRecParticles,eventNumber,GetOption()));
+  // creates the PHOS tracker
+  return new AliPHOSTracker();
+}
 
-  for (Int_t recpart = 0 ; recpart < nOfRecParticles ; recpart++) {
-    AliPHOSRecParticle * rp = dynamic_cast<AliPHOSRecParticle*>(recParticles->At(recpart));
+void  AliPHOSReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const
+{
+  // Converts raw data to
+  // PHOS digits
+  // Works on a single-event basis
 
-    if(rp) {
-    Float_t xyz[3];
-    for (Int_t ixyz=0; ixyz<3; ixyz++) 
-      xyz[ixyz] = rp->GetPos()[ixyz];
+  rawReader->Reset() ; 
 
-    AliDebug(2,Form("Global position xyz=(%f,%f,%f)",xyz[0],xyz[1],xyz[2]));
-    
-    AliPHOSTrackSegment *ts    = gime->TrackSegment(rp->GetPHOSTSIndex());
-    AliPHOSEmcRecPoint  *emcRP = gime->EmcRecPoint(ts->GetEmcIndex());
-    AliESDCaloCluster   *ec    = new AliESDCaloCluster() ; 
+  AliPHOSRawDecoder dc(rawReader);
+  TString option = GetOption();
+  if (option.Contains("OldRCUFormat"))
+    dc.SetOldRCUFormat(kTRUE);
+  else
+    dc.SetOldRCUFormat(kFALSE);
 
-    Int_t  digitMult  = emcRP->GetDigitsMultiplicity();
-    Int_t *digitsList = emcRP->GetDigitsList();
-    Short_t *amplList  = new Short_t[digitMult];
-    Short_t *digiList  = new Short_t[digitMult];
+  dc.SubtractPedestals(kTRUE);
 
-    // Convert Float_t* and Int_t* to UShort_t* to save memory
-    for (Int_t iDigit=0; iDigit<digitMult; iDigit++) {
-      AliPHOSDigit *digit = gime->Digit(digitsList[iDigit]);
-      if(!digit) {
-       AliFatal(Form("Digit not found at the expected position %d!",iDigit));
-      }
-      else {
-       amplList[iDigit] = (Short_t)digit->GetEnergy();
-       digiList[iDigit] = (Short_t)(digit->GetId());
-       //timeList[iDigit] = (Short_t)(digit->GetTime());
-      }
-    }
+  TClonesArray *digits = new TClonesArray("AliPHOSDigit",1);
+  digits->SetName("DIGITS");
+  Int_t bufsize = 32000;
+  digitsTree->Branch("PHOS", &digits, bufsize);
 
-    ec->SetPHOS(kTRUE);
-    ec->SetPosition(xyz);                 //rec.point position in MARS
-    ec->SetE(rp->Energy());         //total particle energy
-    ec->SetClusterDisp(emcRP->GetDispersion()); //cluster dispersion
-    ec->SetPid          (rp->GetPID()) ;        //array of particle identification
-    ec->SetM02(emcRP->GetM2x()) ;               //second moment M2x
-    ec->SetM20(emcRP->GetM2z()) ;               //second moment M2z
-    ec->SetNExMax(emcRP->GetNExMax());          //number of local maxima
+  AliPHOSRawDigiProducer pr;
+  pr.MakeDigits(digits,&dc);
 
-    ec->SetEmcCpvDistance(-1);                  //not yet implemented
-    ec->SetClusterChi2(-1);                     //not yet implemented
-    ec->SetM11(-1) ;                            //not yet implemented
- //    TArrayS arrayAmpList(digitMult,amplList);
-//     TArrayS arrayTimeList(digitMult,timeList);
-//     TArrayS arrayIndexList(digitMult,digiList);
-//     ec->AddDigitAmplitude(arrayAmpList);
-//     ec->AddDigitTime(arrayTimeList);
-//     ec->AddDigitIndex(arrayIndexList);
-    //Distance to the nearest bad crystal
-    ec->SetDistanceToBadChannel(emcRP->GetDistanceToBadCrystal()); 
-    
-    // add the track to the esd object
-    esd->AddCaloCluster(ec);
-    delete ec;    
-    
+  //ADC counts -> GeV
+  for(Int_t i=0; i<digits->GetEntries(); i++) {
+    AliPHOSDigit* digit = (AliPHOSDigit*)digits->At(i);
+    digit->SetEnergy(digit->GetEnergy()/AliPHOSPulseGenerator::GeV2ADC());
+  }
+  
+  //!!!!for debug!!!
+  Int_t modMax=-111;
+  Int_t colMax=-111;
+  Int_t rowMax=-111;
+  Float_t eMax=-333;
+  //!!!for debug!!!
+
+  Int_t relId[4];
+  for(Int_t iDigit=0; iDigit<digits->GetEntries(); iDigit++) {
+    AliPHOSDigit* digit = (AliPHOSDigit*)digits->At(iDigit);
+    if(digit->GetEnergy()>eMax) {
+      fGeom->AbsToRelNumbering(digit->GetId(),relId);
+      eMax=digit->GetEnergy();
+      modMax=relId[0];
+      rowMax=relId[2];
+      colMax=relId[3];
     }
   }
 
+  AliDebug(1,Form("Digit with max. energy:  modMax %d colMax %d rowMax %d  eMax %f\n\n",
+                 modMax,colMax,rowMax,eMax));
 
+  digitsTree->Fill();
 }
-
-AliTracker* AliPHOSReconstructor::CreateTracker(AliRunLoader* runLoader) const
-{
-// creates the PHOS tracker
-  if (!runLoader) return NULL; 
-  return new AliPHOSTracker(runLoader);
-}
-
index 8556584f725c4a268852b9abbd14fdf45c5ffaff..bb2f3e20ca60da6bb0da427ee87bfad2427a0a09 100644 (file)
@@ -8,6 +8,10 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.11  2007/07/24 17:20:35  policheh
+ * Usage of RecoParam objects instead of hardcoded parameters in reconstruction.
+ * (See $ALICE_ROOT/PHOS/macros/BeamTest2006/RawReconstruction.C).
+ *
  * Revision 1.10  2007/07/11 13:43:30  hristov
  * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
  *
@@ -38,6 +42,7 @@ class AliPHOSSDigitizer ;
 class AliESDEvent ;
 class AliRawReader; 
 class AliPHOSRecoParam;
+class AliPHOSGeometry;
 
 // --- Standard library ---
 
@@ -48,7 +53,10 @@ class AliPHOSReconstructor : public AliReconstructor {
 public:
 
   AliPHOSReconstructor() ; //ctor            
-  AliPHOSReconstructor(const AliPHOSReconstructor & rec) : AliReconstructor(rec) {
+  AliPHOSReconstructor(const AliPHOSReconstructor & rec) :
+    AliReconstructor(rec),
+    fGeom(rec.fGeom)
+    {
     // cpy ctor: 
     // requested by the Coding Convention
     Fatal("cpy ctor", "not implemented") ;
@@ -59,11 +67,16 @@ public:
   static Bool_t              Debug() { return fgDebug ; }
   AliTracker *CreateTracker(AliRunLoader* runLoader) const;
   using AliReconstructor::FillESD;
-  virtual void               FillESD(AliRunLoader* runLoader, AliESDEvent* esd) const ;
-  virtual void FillESD(AliRunLoader* runLoader,AliRawReader* rawReader,AliESDEvent* esd) const;
+  virtual void               FillESD(TTree* digitsTree, TTree* clustersTree, 
+                                    AliESDEvent* esd) const;
   using AliReconstructor::Reconstruct;
-  virtual void               Reconstruct(AliRunLoader* runLoader) const ;
-  virtual void               Reconstruct(AliRunLoader* runLoader, AliRawReader * rawreader) const ;
+  virtual Bool_t             HasLocalReconstruction() const {return kTRUE;};
+  virtual void               Reconstruct(TTree* digitsTree, TTree* clustersTree) const;
+  //  virtual void               Reconstruct(AliRunLoader* runLoader) const ;
+  //  virtual void               Reconstruct(AliRunLoader* runLoader, AliRawReader * rawreader) const ;
+
+  virtual Bool_t             HasDigitConversion() const {return kTRUE;};
+  virtual void               ConvertDigits(AliRawReader* /*rawReader*/, TTree* /*digitsTree*/) const;
 
   AliPHOSReconstructor & operator = (const AliPHOSReconstructor & /*rvalue*/)  {
     // assignement operator requested by coding convention but not needed
@@ -82,8 +95,9 @@ private:
   static Bool_t fgDebug ; //! verbosity controller
   static AliPHOSRecoParam*   fgkRecoParamEmc; // reconstruction parameters for EMC
   static AliPHOSRecoParam*   fgkRecoParamCpv; // reconstruction parameters for EMC
+  AliPHOSGeometry*           fGeom;           // pointer to the PHOS geometry
 
-  ClassDef(AliPHOSReconstructor,2)  // Reconstruction algorithm class (Base Class)
+  ClassDef(AliPHOSReconstructor,3)  // PHOS Reconstruction class
 
 }; 
 
index fde90d5256cb6a2ca51d7ff2880bef9d9162a749..ac9ca683b9b782d9671fca96cb9450b7dea6dc45 100644 (file)
@@ -17,6 +17,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.28  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.27  2006/08/25 16:56:30  kharlov
  * Compliance with Effective C++
  *
 
 
 // --- ROOT system ---
+#include "TTree.h"
 
 // --- Standard library ---
 
 // --- AliRoot header files ---
 #include "AliPHOSTrackSegmentMaker.h"
-#include "AliPHOSGetter.h"
 #include "AliPHOSQualAssDataMaker.h" 
 
 ClassImp( AliPHOSTrackSegmentMaker) 
@@ -50,25 +53,24 @@ ClassImp( AliPHOSTrackSegmentMaker)
 
 //____________________________________________________________________________
 AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() : 
-  TTask("",""),
-  fEventFolderName(""),
-  fFirstEvent(0),
-  fLastEvent(-1),
+  TObject(),
   fESD(0), 
-  fQADM(0x0)  
+  fQADM(0x0),
+  fGeom(0),
+  fEMCRecPoints(0),
+  fCPVRecPoints(0)
 {
  // ctor
 }
 
 //____________________________________________________________________________
-AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const TString alirunFileName, 
-                                                  const TString eventFolderName):
-  TTask("PHOS"+AliConfig::Instance()->GetTrackerTaskName(), alirunFileName), 
-  fEventFolderName(eventFolderName),
-  fFirstEvent(0),
-  fLastEvent(-1),
+AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(AliPHOSGeometry *geom):
+  TObject(),
   fESD(0), 
-  fQADM(0x0)
+  fQADM(0x0),
+  fGeom(geom),
+  fEMCRecPoints(0),
+  fCPVRecPoints(0)
 {
   // ctor
   fQADM = new  AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker
@@ -77,12 +79,12 @@ AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const TString alirunFileName,
 
 //____________________________________________________________________________
 AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const AliPHOSTrackSegmentMaker & tsmaker) :
-  TTask(tsmaker),
-  fEventFolderName(tsmaker.GetEventFolderName()),
-  fFirstEvent(tsmaker.GetFirstEvent()),
-  fLastEvent(tsmaker.GetLastEvent()),
+  TObject(tsmaker),
   fESD(tsmaker.GetESD()), 
-  fQADM(tsmaker.fQADM)
+  fQADM(tsmaker.fQADM),
+  fGeom(tsmaker.fGeom),
+  fEMCRecPoints(tsmaker.fEMCRecPoints),
+  fCPVRecPoints(tsmaker.fCPVRecPoints)
 {
   //Copy constructor
 } 
@@ -91,8 +93,42 @@ AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const AliPHOSTrackSegmentMake
 AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker()
 {
  //Remove this from the parental task before destroying
-  if(AliPHOSGetter::Instance()->PhosLoader())
-    AliPHOSGetter::Instance()->PhosLoader()->CleanTracker();
+  //  if(AliPHOSGetter::Instance()->PhosLoader())
+  //    AliPHOSGetter::Instance()->PhosLoader()->CleanTracker();
   delete fQADM ; 
+  if (fEMCRecPoints) {
+    fEMCRecPoints->Delete();
+    delete fEMCRecPoints;
+  }
+  if (fCPVRecPoints) {
+    fCPVRecPoints->Delete();
+    delete fCPVRecPoints;
+  }
 }
 
+//____________________________________________________________________________
+void AliPHOSTrackSegmentMaker::SetInput(TTree *clustersTree)
+{
+  // Read the clusters tree and creates the
+  // arrays with the EMC and CPV
+  // clusters.
+  // and set the corresponding branch addresses
+
+  TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
+  if (!emcbranch) { 
+    AliError("can't get the branch with the PHOS EMC clusters !");
+    return;
+  }
+  fEMCRecPoints = new TObjArray(100) ;
+  emcbranch->SetAddress(&fEMCRecPoints);
+  emcbranch->GetEntry(0);
+
+  TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
+  if (!cpvbranch) { 
+    AliError("can't get the branch with the PHOS CPV clusters !");
+    return;
+  }
+  fCPVRecPoints = new TObjArray(100) ;
+  cpvbranch->SetAddress(&fCPVRecPoints);
+  cpvbranch->GetEntry(0);
+}
index bfb72cee941634102e4e176c0b0fbceb656913e8..f21ef106bae2c7b6f3f06abe3f5c1e282df943a2 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.42  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.41  2007/07/11 13:43:30  hristov
  * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
  *
 //*-- Author: Dmitri Peressounko (RRC Kurchatov Institute  & SUBATECH)
 
 // --- ROOT system ---
-#include "TTask.h"
-#include "AliConfig.h"
-class TFile ; 
-
-// --- Standard library ---
-//#include <iostream>
+#include <TObject.h>
+class TTree;
 
 // --- AliRoot header files ---
-class AliPHOSClusterizer ;
 class AliPHOSGeometry ;
 class AliESDEvent ;
 class AliPHOSQualAssDataMaker ; 
 
-class  AliPHOSTrackSegmentMaker : public TTask {
+class  AliPHOSTrackSegmentMaker : public TObject {
 
 public:
 
   AliPHOSTrackSegmentMaker();
-  AliPHOSTrackSegmentMaker(const TString alirunFileName, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;                     
+  AliPHOSTrackSegmentMaker(AliPHOSGeometry *geom);
   AliPHOSTrackSegmentMaker(const AliPHOSTrackSegmentMaker & tsmaker) ;
   virtual ~ AliPHOSTrackSegmentMaker() ;
   AliPHOSTrackSegmentMaker & operator = (const AliPHOSTrackSegmentMaker & /*rvalue*/)  {
     Fatal("operator =", "not implemented") ; return *this ; }
 
-  virtual Int_t GetTrackSegmentsInRun()  const {Warning("GetTrackSegmentsInRun", "Not Defined" ) ; return 0 ; } 
+  virtual void   Clusters2TrackSegments(Option_t *option) = 0;
+
+  void    SetInput(TTree *clustersTree);
 
   virtual void    Print(const Option_t * = "")const {Warning("Print", "Not Defined" ) ; }
 
-  void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
-  void SetEventFolderName(TString name) { fEventFolderName = name ; }
   void SetESD(AliESDEvent *esd) { fESD = esd; }
 
-  TString GetEventFolderName() const {return fEventFolderName;}
-  Int_t   GetFirstEvent()      const {return fFirstEvent;     }
-  Int_t   GetLastEvent()       const {return fLastEvent;      }
   AliESDEvent *GetESD()             const {return fESD;            }
 
-  virtual void WriteTrackSegments() = 0;
-  
   AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; } 
 
+  virtual TClonesArray * GetTrackSegments() const = 0;
+
 protected:
 
-  TString fEventFolderName ;  // event folder name
-  Int_t   fFirstEvent;        // first event to process
-  Int_t   fLastEvent;         // last  event to process
   AliESDEvent * fESD;              //! ESD object
-
   AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
+  AliPHOSGeometry *fGeom;           //! Pointer to the PHOS geometry
+  TObjArray *fEMCRecPoints;         //  Array with the EMC clusters
+  TObjArray *fCPVRecPoints;         //  Array with the CPV clusters
 
-  ClassDef( AliPHOSTrackSegmentMaker,5)  // Algorithm class to make PHOS track segments (Base Class)
+  ClassDef( AliPHOSTrackSegmentMaker,6)  // Algorithm class to make PHOS track segments (Base Class)
 };
 
 #endif // ALIPHOSTRACKSEGMENTMAKER_H
index 67fda5813d7617f4adab9cd7c3322758658752f2..de196b5d7eba5f53cb1b4a840e09404504a28dd7 100644 (file)
@@ -17,6 +17,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.91  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.90  2007/07/11 13:43:30  hristov
  * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
  *
 #include "AliPHOSTrackSegmentMakerv1.h"
 #include "AliPHOSTrackSegment.h"
 #include "AliPHOSLink.h"
-#include "AliPHOSGetter.h"
 #include "AliESDEvent.h"
 #include "AliESDtrack.h"
 #include "AliPHOSQualAssDataMaker.h"
+#include "AliPHOSEmcRecPoint.h"
+#include "AliPHOSCpvRecPoint.h"
 
 ClassImp( AliPHOSTrackSegmentMakerv1) 
 
@@ -136,16 +140,15 @@ AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1() :
   fCpvFirst(0),
   fCpvLast(0),
   fModule(0),
-  fTrackSegmentsInRun(0)
-  
+  fTrackSegments(NULL)
 {
   // default ctor (to be used mainly by Streamer)
   InitParameters() ; 
 }
 
 //____________________________________________________________________________
-AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const TString & alirunFileName, const TString & eventFolderName) :
-  AliPHOSTrackSegmentMaker(alirunFileName, eventFolderName),
+AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(AliPHOSGeometry *geom) :
+  AliPHOSTrackSegmentMaker(geom),
   fDefaultInit(kFALSE),
   fWrite(kFALSE),
   fNTrackSegments(0),
@@ -158,7 +161,7 @@ AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const TString & alirunFil
   fCpvFirst(0),
   fCpvLast(0),
   fModule(0),
-  fTrackSegmentsInRun(0)
+  fTrackSegments(NULL)
 {
   // ctor
   InitParameters() ; 
@@ -181,7 +184,7 @@ AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const AliPHOSTrackSegment
   fCpvFirst(0),
   fCpvLast(0),
   fModule(0),
-  fTrackSegmentsInRun(0)
+  fTrackSegments(NULL)
 {
   // cpy ctor: no implementation yet
   // requested by the Coding Convention
@@ -196,14 +199,10 @@ AliPHOSTrackSegmentMakerv1::AliPHOSTrackSegmentMakerv1(const AliPHOSTrackSegment
   // fDefaultInit = kTRUE if TrackSegmentMaker created by default ctor (to get just the parameters)
   if (!fDefaultInit)  
     delete fLinkUpArray ;
-}
-
-
-//____________________________________________________________________________
-const TString AliPHOSTrackSegmentMakerv1::BranchName() const 
-{  
-  return GetName() ;
+  if (fTrackSegments) {
+    fTrackSegments->Delete();
+    delete fTrackSegments;
+  }
 }
 
 //____________________________________________________________________________
@@ -212,21 +211,17 @@ void  AliPHOSTrackSegmentMakerv1::FillOneModule()
   // Finds first and last indexes between which 
   // clusters from one PHOS module are
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-   
   //First EMC clusters
-  Int_t totalEmc = emcRecPoints->GetEntriesFast() ;
+  Int_t totalEmc = fEMCRecPoints->GetEntriesFast() ;
   for(fEmcFirst = fEmcLast; (fEmcLast < totalEmc) &&  
-       ((dynamic_cast<AliPHOSRecPoint *>(emcRecPoints->At(fEmcLast)))->GetPHOSMod() == fModule ); 
+       ((dynamic_cast<AliPHOSRecPoint *>(fEMCRecPoints->At(fEmcLast)))->GetPHOSMod() == fModule ); 
       fEmcLast ++)  ;
   
   //Now CPV clusters
-  Int_t totalCpv = cpvRecPoints->GetEntriesFast() ;
+  Int_t totalCpv = fCPVRecPoints->GetEntriesFast() ;
 
     for(fCpvFirst = fCpvLast; (fCpvLast < totalCpv) && 
-         ((dynamic_cast<AliPHOSRecPoint *>(cpvRecPoints->At(fCpvLast)))->GetPHOSMod() == fModule ); 
+         ((dynamic_cast<AliPHOSRecPoint *>(fCPVRecPoints->At(fCpvLast)))->GetPHOSMod() == fModule ); 
        fCpvLast ++) ;
       
 }
@@ -259,18 +254,15 @@ void  AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * em
 
   emcClu->GetLocalPosition(vecEmc) ;
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
-    
   Double_t xCPV,zCPV ; //EMC-projected coordinates of CPV cluster 
   TVector3 cpvGlobal; // Global position of the CPV recpoint
-  geom->GetGlobalPHOS((AliPHOSRecPoint*)cpvClu,cpvGlobal);
+  fGeom->GetGlobalPHOS((AliPHOSRecPoint*)cpvClu,cpvGlobal);
   Double_t vtxCPV[3]={cpvGlobal.X(),cpvGlobal.Y(),cpvGlobal.Z()} ;
   Int_t dummyMod ;
 
   if (fESD == 0x0) {
      //if no track information available, assume straight line from IP to emcal
-     geom->ImpactOnEmc(vtxCPV,cpvGlobal.Theta(),cpvGlobal.Phi(),dummyMod,zCPV,xCPV) ;
+     fGeom->ImpactOnEmc(vtxCPV,cpvGlobal.Theta(),cpvGlobal.Phi(),dummyMod,zCPV,xCPV) ;
      dx=xCPV - vecEmc.X() ;
      dz=zCPV - vecEmc.Z() ;
      return ;
@@ -311,7 +303,7 @@ void  AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * em
       if (track->GetPxPyPzAt(rCPV, fESD->GetMagneticField(), pxyz)) { // track momentum ibid.
         vecP.SetXYZ(pxyz[0],pxyz[1],pxyz[2]);
         Int_t dummyMod ;
-       geom->ImpactOnEmc(vtxCPV,vecP.Theta(),vecP.Phi(),dummyMod,zCPV,xCPV) ;
+       fGeom->ImpactOnEmc(vtxCPV,vecP.Theta(),vecP.Phi(),dummyMod,zCPV,xCPV) ;
       }
     }
     
@@ -326,7 +318,7 @@ void  AliPHOSTrackSegmentMakerv1::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * em
   }
   else{
     // If no global track was found, just take the nearest CPV point
-    geom->ImpactOnEmc(vtxCPV,cpvGlobal.Theta(),cpvGlobal.Phi(),dummyMod,zCPV,xCPV) ;
+    fGeom->ImpactOnEmc(vtxCPV,cpvGlobal.Theta(),cpvGlobal.Phi(),dummyMod,zCPV,xCPV) ;
     dx=xCPV - vecEmc.X() ;
     dz=zCPV - vecEmc.Z() ;
   }
@@ -337,14 +329,9 @@ void  AliPHOSTrackSegmentMakerv1::Init()
 {
   // Make all memory allocations that are not possible in default constructor
   
-  AliPHOSGetter* gime = AliPHOSGetter::Instance();
-  if(!gime)
-    gime = AliPHOSGetter::Instance(GetTitle(), fEventFolderName.Data());
-  
   fLinkUpArray  = new TClonesArray("AliPHOSLink", 1000); 
-  if ( !gime->TrackSegmentMaker() ) {
-    gime->PostTrackSegmentMaker(this);
-  }
+  fTrackSegments = new TClonesArray("AliPHOSTrackSegment",100);
+  fTrackSegments->SetName("TRACKS");
 }
 
 //____________________________________________________________________________
@@ -359,8 +346,6 @@ void  AliPHOSTrackSegmentMakerv1::InitParameters()
   fCpvLast   = 0 ;   
   fLinkUpArray = 0 ;
   fWrite                   = kTRUE ;
-  fTrackSegmentsInRun       = 0 ; 
-  SetEventRange(0,-1) ;
 }
 
 
@@ -371,10 +356,6 @@ void  AliPHOSTrackSegmentMakerv1::MakeLinks()const
   // which are not further apart from each other than fRcpv 
   // and sort them in accordance with this distance
   
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-
   fLinkUpArray->Clear() ;    
 
   AliPHOSCpvRecPoint * cpv ;
@@ -384,13 +365,13 @@ void  AliPHOSTrackSegmentMakerv1::MakeLinks()const
   
   Int_t iEmcRP;
   for(iEmcRP = fEmcFirst; iEmcRP < fEmcLast; iEmcRP++ ) {
-    emcclu = dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(iEmcRP)) ;
+    emcclu = dynamic_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(iEmcRP)) ;
 
     //Bool_t toofar ;        
     Int_t iCpv = 0 ;    
     for(iCpv = fCpvFirst; iCpv < fCpvLast;iCpv++ ) { 
       
-      cpv = dynamic_cast<AliPHOSCpvRecPoint *>(cpvRecPoints->At(iCpv)) ;
+      cpv = dynamic_cast<AliPHOSCpvRecPoint *>(fCPVRecPoints->At(iCpv)) ;
       Int_t track = -1 ; 
       Float_t dx,dz ;
       GetDistanceInPHOSPlane(emcclu, cpv, track,dx,dz) ;     
@@ -411,12 +392,6 @@ void  AliPHOSTrackSegmentMakerv1::MakePairs()
   // unassigned RecParticles. We assign these RecPoints to TrackSegment and 
   // remove them from the list of "unassigned". 
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * trackSegments = gime->TrackSegments();
-    
   //Make arrays to mark clusters already chosen
   Int_t * emcExist = 0;
   if(fEmcLast > fEmcFirst)
@@ -447,12 +422,12 @@ void  AliPHOSTrackSegmentMakerv1::MakePairs()
       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())) , 
+        new ((* fTrackSegments)[fNTrackSegments]) 
+          AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(linkUp->GetEmc())) , 
+                              dynamic_cast<AliPHOSCpvRecPoint *>(fCPVRecPoints->At(linkUp->GetCpv())) , 
                               linkUp->GetTrack(),dx,dz) ;
         
-       (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
+       (dynamic_cast<AliPHOSTrackSegment *>(fTrackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++ ;
        emcExist[linkUp->GetEmc()-fEmcFirst] = -1 ; //Mark emc  that Cpv was found 
        //mark CPV recpoint as already used 
@@ -466,10 +441,10 @@ void  AliPHOSTrackSegmentMakerv1::MakePairs()
     Int_t iEmcRP ;
     for(iEmcRP = 0; iEmcRP < fEmcLast-fEmcFirst  ; iEmcRP++ ){
       if(emcExist[iEmcRP] > 0 ){
-       new ((*trackSegments)[fNTrackSegments])  
-         AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(iEmcRP+fEmcFirst)), 
+       new ((*fTrackSegments)[fNTrackSegments])  
+         AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(iEmcRP+fEmcFirst)), 
                            nullpointer) ;
-       (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
+       (dynamic_cast<AliPHOSTrackSegment *>(fTrackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++;    
       } 
     }
@@ -479,12 +454,10 @@ void  AliPHOSTrackSegmentMakerv1::MakePairs()
 }
 
 //____________________________________________________________________________
-void  AliPHOSTrackSegmentMakerv1::Exec(Option_t *option)
+void AliPHOSTrackSegmentMakerv1::Clusters2TrackSegments(Option_t *option)
 {
-  // Steering method to perform track segment construction for events
-  // in the range from fFirstEvent to fLastEvent.
-  // This range is optionally set by SetEventRange().
-  // if fLastEvent=-1 (by default), then process events until the end.
+  // Steering method to perform track segment construction for the current event
+  // Returns an array with the found track-segments.
   
   if(strstr(option,"tim"))
     gBenchmark->Start("PHOSTSMaker");
@@ -494,62 +467,31 @@ void  AliPHOSTrackSegmentMakerv1::Exec(Option_t *option)
     return ; 
   }
   
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;  
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
-
-  if (fLastEvent == -1) 
-    fLastEvent = gime->MaxEvent() - 1 ;
-  else 
-    fLastEvent = TMath::Min(fFirstEvent,gime->MaxEvent());
-  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
-
-  Int_t ievent ; 
-  for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
-    gime->Event(ievent,"DR") ;
-   //Make some initializations 
-    fNTrackSegments = 0 ;
-    fEmcFirst = 0 ;    
-    fEmcLast  = 0 ;   
-    fCpvFirst = 0 ;   
-    fCpvLast  = 0 ;   
-    
-    gime->TrackSegments()->Clear();
+  //Make some initializations 
+  fNTrackSegments = 0 ;
+  fEmcFirst = 0 ;    
+  fEmcLast  = 0 ;   
+  fCpvFirst = 0 ;   
+  fCpvLast  = 0 ;   
 
-   //   if(!ReadRecPoints(ievent))   continue; //reads RecPoints for event ievent
-    
-    for(fModule = 1; fModule <= geom->GetNModules() ; fModule++ ) {
-      FillOneModule() ; 
-      MakeLinks() ;
-      MakePairs() ;
-    }
-   
-    
-    WriteTrackSegments() ;
+  fTrackSegments->Clear();
 
-    if(strstr(option,"deb"))
-      PrintTrackSegments(option);
+  //   if(!ReadRecPoints(ievent))   continue; //reads RecPoints for event ievent
     
-    //increment the total number of track segments per run 
-    fTrackSegmentsInRun += gime->TrackSegments()->GetEntriesFast() ; 
+  for(fModule = 1; fModule <= fGeom->GetNModules() ; fModule++ ) {
+    FillOneModule() ; 
+    MakeLinks() ;
+    MakePairs() ;
   }
-  
+    
+  if(strstr(option,"deb"))
+    PrintTrackSegments(option);
+
   if(strstr(option,"tim")){
     gBenchmark->Stop("PHOSTSMaker");
-    Info("Exec", "took %f seconds for making TS %f seconds per event", 
-          gBenchmark->GetCpuTime("PHOSTSMaker"), 
-          gBenchmark->GetCpuTime("PHOSTSMaker")/nEvents) ;
-   }
-  if(fWrite) //do not unload in "on flight" mode
-    Unload();
-}
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv1::Unload() 
-{
-  // Unloads the task from the folder
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;  
-  gime->PhosLoader()->UnloadRecPoints() ;
-  gime->PhosLoader()->UnloadTracks() ;
+    Info("Exec", "took %f seconds for making TS", 
+        gBenchmark->GetCpuTime("PHOSTSMaker")); 
+  }
 }
 
 //____________________________________________________________________________
@@ -570,53 +512,20 @@ void AliPHOSTrackSegmentMakerv1::Print(const Option_t *)const
     Info("Print", "AliPHOSTrackSegmentMakerv1 not initialized ") ;
 }
 
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv1::WriteTrackSegments()
-{
-  // Writes found TrackSegments to TreeR. Creates branches 
-  // "PHOSTS" and "AliPHOSTrackSegmentMaker" with the same title.
-  // In the former branch found TrackSegments are stored, while 
-  // in the latter all parameters, with which TS were made. 
-  // ROOT does not allow overwriting existing branches, therefore
-  // first we check, if branches with the same title already exist.
-  // If yes - exits without writing.
-
-  AliPHOSGetter *gime = AliPHOSGetter::Instance() ; 
-
-  TClonesArray * trackSegments = gime->TrackSegments() ; 
-  trackSegments->Expand(trackSegments->GetEntriesFast()) ;
-
-  if(fWrite){ //We write TreeT
-    TTree * treeT = gime->TreeT();
-    
-    //First TS
-    Int_t bufferSize = 32000 ; 
-    TBranch * tsBranch = treeT->Branch("PHOSTS",&trackSegments,bufferSize);
-    tsBranch->Fill() ;  
-    
-    gime->WriteTracks("OVERWRITE");
-    gime->WriteTrackSegmentMaker("OVERWRITE");
-  }
-}
-
-
 //____________________________________________________________________________
 void AliPHOSTrackSegmentMakerv1::PrintTrackSegments(Option_t * option)
 {
   // option deb - prints # of found TrackSegments
   // option deb all - prints as well indexed of found RecParticles assigned to the TS
 
-  TClonesArray * trackSegments = AliPHOSGetter::Instance()->TrackSegments() ; 
-
   Info("PrintTrackSegments", "Results from TrackSegmentMaker:") ; 
-  printf("nevent: %d\n", AliPHOSGetter::Instance()->EventNumber()) ; 
-  printf("        Found %d TrackSegments\n", trackSegments->GetEntriesFast() ); 
+  printf("        Found %d TrackSegments\n", fTrackSegments->GetEntriesFast() ); 
   
   if(strstr(option,"all")) {  // printing found TS
     printf("TrackSegment #  EMC RP#  CPV RP#\n") ; 
     Int_t index;
-    for (index = 0 ; index <trackSegments->GetEntriesFast() ; index++) {
-      AliPHOSTrackSegment * ts = (AliPHOSTrackSegment * )trackSegments->At(index) ; 
+    for (index = 0 ; index <fTrackSegments->GetEntriesFast() ; index++) {
+      AliPHOSTrackSegment * ts = (AliPHOSTrackSegment * )fTrackSegments->At(index) ; 
       printf("   %d           %d        %d \n", ts->GetIndexInList(), ts->GetEmcIndex(), ts->GetCpvIndex() ) ; 
     }  
   }
index 3a45759cd911a22940793d13b906cf5297d43700..ac5b520c153a35db84230c72a6f341183c09c176 100644 (file)
@@ -7,6 +7,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.51  2007/03/28 19:18:15  kharlov
+ * RecPoints recalculation in TSM removed
+ *
  * Revision 1.50  2007/03/06 06:54:48  kharlov
  * DP:Calculation of cluster properties dep. on vertex added
  *
@@ -48,16 +51,12 @@ class  AliPHOSTrackSegmentMakerv1 : public AliPHOSTrackSegmentMaker {
 public:
 
   AliPHOSTrackSegmentMakerv1() ;                     
-  AliPHOSTrackSegmentMakerv1(const TString & alirunFileNameFile, const TString & eventFolderName = AliConfig::GetDefaultEventFolderName());
+  AliPHOSTrackSegmentMakerv1(AliPHOSGeometry *geom);
   AliPHOSTrackSegmentMakerv1(const AliPHOSTrackSegmentMakerv1 & tsm);
 
   virtual ~ AliPHOSTrackSegmentMakerv1() ; // dtor
   
-  //  virtual char*  GetRecPointsBranch    (void)const{return (char*)fRecPointsBranchTitle.Data() ;}
-  //  virtual char*  GetTrackSegmentsBranch(void)const{return (char*)fTrackSegmentsBranchTitle.Data() ;}
-  virtual Int_t GetTrackSegmentsInRun()const {return fTrackSegmentsInRun ;}  
-
-  virtual void   Exec(Option_t *option); // Does the job
+  virtual void   Clusters2TrackSegments(Option_t *option); // Does the job
           void   FillOneModule() ;       // Finds range in which RecPoints belonging current PHOS module are
 
           void   MakeLinks() const;      //Evaluates distances(links) between EMC and CPV
@@ -69,8 +68,6 @@ public:
                                                                //between EMCrp and CPVrp
   virtual void   SetMaxCPVTPCDistance(Float_t r){ fRtpc = r ;} //Maximal distance 
                                                                //between EMCrp and extrapolation of TPC track
-  //  virtual void   SetRecPointsBranch(const char * title) { fRecPointsBranchTitle = title ;} 
-  //  virtual void   SetTrackSegmentsBranch(const char * title){ fTrackSegmentsBranchTitle = title ; }
   virtual const char * Version() const { return "tsm-v1" ; }  
 
   AliPHOSTrackSegmentMakerv1 & operator = (const AliPHOSTrackSegmentMakerv1 & )  {
@@ -78,17 +75,16 @@ public:
     Fatal("operator =", "not implemented") ;
     return *this ; 
   }
-  void Unload() ;
+
+  virtual TClonesArray * GetTrackSegments() const { return fTrackSegments; }
 
 private:
 
-  const TString BranchName() const ; 
   void  GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * EmcClu , AliPHOSCpvRecPoint * Cpv, 
                                Int_t & track, Float_t &dx, Float_t &dz ) const ; // see R0
   void    Init() ;
   void    InitParameters() ;
   void    PrintTrackSegments(Option_t *option) ;
-  virtual void   WriteTrackSegments() ;
 
 private:  
 
@@ -108,9 +104,10 @@ private:
   Int_t fCpvFirst;     //! Cpv upper layer     
   Int_t fCpvLast;      //! 
   Int_t fModule ;      //! number of module being processed
-  Int_t fTrackSegmentsInRun ; //! Total number of track segments in one run
 
-  ClassDef( AliPHOSTrackSegmentMakerv1,3)  // Implementation version 1 of algorithm class to make PHOS track segments 
+  TClonesArray * fTrackSegments; // Array with found track-segments
+
+  ClassDef( AliPHOSTrackSegmentMakerv1,4)  // Implementation version 1 of algorithm class to make PHOS track segments 
 
  };
 
index 99fe339ef2a28e70f1e0f25e560a70fef36837c2..c5b325777a8a1fb27a2d2640b8a61aacfb2eb3ec 100644 (file)
@@ -17,6 +17,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.6  2007/08/22 09:20:50  hristov
+ * Updated QA classes (Yves)
+ *
  * Revision 1.5  2007/07/11 13:43:30  hristov
  * New class AliESDEvent, backward compatibility with the old AliESD (Christian)
  *
@@ -94,15 +97,15 @@ AliPHOSTrackSegmentMakerv2::AliPHOSTrackSegmentMakerv2() :
   fEmcFirst(0),
   fEmcLast(0),
   fModule(0),
-  fTrackSegmentsInRun(0)
+  fTrackSegments(NULL)
 {
   // default ctor (to be used mainly by Streamer)
   InitParameters() ; 
 }
 
 //____________________________________________________________________________
-AliPHOSTrackSegmentMakerv2::AliPHOSTrackSegmentMakerv2(const TString & alirunFileName, const TString & eventFolderName) :
-  AliPHOSTrackSegmentMaker(alirunFileName, eventFolderName),
+AliPHOSTrackSegmentMakerv2::AliPHOSTrackSegmentMakerv2(AliPHOSGeometry *geom) :
+  AliPHOSTrackSegmentMaker(geom),
   fDefaultInit(kFALSE),
   fWrite(kFALSE),
   fNTrackSegments(0),
@@ -113,7 +116,7 @@ AliPHOSTrackSegmentMakerv2::AliPHOSTrackSegmentMakerv2(const TString & alirunFil
   fEmcFirst(0),
   fEmcLast(0),
   fModule(0),
-  fTrackSegmentsInRun(0)
+  fTrackSegments(NULL)
 {
   // ctor
   InitParameters() ; 
@@ -134,7 +137,7 @@ AliPHOSTrackSegmentMakerv2::AliPHOSTrackSegmentMakerv2(const AliPHOSTrackSegment
   fEmcFirst(0),
   fEmcLast(0),
   fModule(0),
-  fTrackSegmentsInRun(0)
+  fTrackSegments(NULL)
 {
   // cpy ctor: no implementation yet
   // requested by the Coding Convention
@@ -149,13 +152,10 @@ AliPHOSTrackSegmentMakerv2::AliPHOSTrackSegmentMakerv2(const AliPHOSTrackSegment
   // fDefaultInit = kTRUE if TrackSegmentMaker created by default ctor (to get just the parameters)
   if (!fDefaultInit)  
     delete fLinkUpArray ;
-}
-
-//____________________________________________________________________________
-const TString AliPHOSTrackSegmentMakerv2::BranchName() const 
-{  
-  return GetName() ;
+  if (fTrackSegments) {
+    fTrackSegments->Delete();
+    delete fTrackSegments;
+  }
 }
 
 //____________________________________________________________________________
@@ -164,15 +164,10 @@ void  AliPHOSTrackSegmentMakerv2::FillOneModule()
   // Finds first and last indexes between which 
   // clusters from one PHOS module are
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
-  
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
   //First EMC clusters
-  Int_t totalEmc = emcRecPoints->GetEntriesFast() ;
+  Int_t totalEmc = fEMCRecPoints->GetEntriesFast() ;
   for(fEmcFirst = fEmcLast; (fEmcLast < totalEmc) &&  
-       ((dynamic_cast<AliPHOSRecPoint *>(emcRecPoints->At(fEmcLast)))->GetPHOSMod() == fModule ); 
+       ((dynamic_cast<AliPHOSRecPoint *>(fEMCRecPoints->At(fEmcLast)))->GetPHOSMod() == fModule ); 
       fEmcLast ++)  ;
   
   //Now TPC tracks
@@ -181,7 +176,7 @@ void  AliPHOSTrackSegmentMakerv2::FillOneModule()
     if(fModule==1){
       Int_t nTracks = fESD->GetNumberOfTracks();
 
-      Int_t nPHOSmod = geom->GetNModules() ;
+      Int_t nPHOSmod = fGeom->GetNModules() ;
       if(fTPCtracks[0].size()<(UInt_t)nTracks){
         for(Int_t i=0; i<nPHOSmod; i++) 
           fTPCtracks[i].resize(nTracks) ;
@@ -193,11 +188,11 @@ void  AliPHOSTrackSegmentMakerv2::FillOneModule()
       Double_t vtx[3]={0.,0.,0.} ;
       AliESDtrack *track;
       Double_t xyz[3] ;
-      Double_t rEMC = geom->GetIPtoCrystalSurface() ; //Use here ideal geometry 
+      Double_t rEMC = fGeom->GetIPtoCrystalSurface() ; //Use here ideal geometry 
       for (Int_t iTrack=0; iTrack<nTracks; iTrack++) {
         track = fESD->GetTrack(iTrack);
         for(Int_t iTestMod=1; iTestMod<=nPHOSmod; iTestMod++){
-           Double_t modAngle=270.+geom->GetPHOSAngle(iTestMod) ;
+           Double_t modAngle=270.+fGeom->GetPHOSAngle(iTestMod) ;
            modAngle*=TMath::Pi()/180. ;
            track->Rotate(modAngle);  
            if (!track->GetXYZAt(rEMC, fESD->GetMagneticField(), xyz))
@@ -208,7 +203,7 @@ void  AliPHOSTrackSegmentMakerv2::FillOneModule()
            inPHOS.SetXYZ(xyz[0],xyz[1],xyz[2]);
            Int_t modNum ; 
            Double_t x,z ;
-           geom->ImpactOnEmc(vtx, inPHOS.Theta(), inPHOS.Phi(), modNum, z, x) ;
+           fGeom->ImpactOnEmc(vtx, inPHOS.Theta(), inPHOS.Phi(), modNum, z, x) ;
            if(modNum==iTestMod){
              //Mark this track as one belonging to module
              TrackInPHOS_t &t = fTPCtracks[modNum-1][fNtpcTracks[modNum-1]++] ; 
@@ -232,12 +227,11 @@ void  AliPHOSTrackSegmentMakerv2::GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * em
   // Calculates the distance between the EMC RecPoint and the CPV RecPoint
   // Clusters are sorted in "rows" and "columns" of width 1 cm
 
-  const AliPHOSGeometry * geom = AliPHOSGeometry::GetInstance() ;
   TVector3 emcGlobal; // Global position of the EMC recpoint
-  geom->GetGlobalPHOS((AliPHOSRecPoint*)emcClu,emcGlobal);
+  fGeom->GetGlobalPHOS((AliPHOSRecPoint*)emcClu,emcGlobal);
 
   //Calculate actual distance to the PHOS surface
-  Double_t modAngle=270.+geom->GetPHOSAngle(emcClu->GetPHOSMod()) ;
+  Double_t modAngle=270.+fGeom->GetPHOSAngle(emcClu->GetPHOSMod()) ;
   modAngle*=TMath::Pi()/180. ;
   Double_t rEMC = emcGlobal.X()*TMath::Cos(modAngle)+emcGlobal.Y()*TMath::Sin(modAngle) ;
   track->Rotate(modAngle);
@@ -264,14 +258,8 @@ void  AliPHOSTrackSegmentMakerv2::Init()
 {
   // Make all memory allocations that are not possible in default constructor
   
-  AliPHOSGetter* gime = AliPHOSGetter::Instance();
-  if(!gime)
-    gime = AliPHOSGetter::Instance(GetTitle(), fEventFolderName.Data());
-  
   fLinkUpArray  = new TClonesArray("AliPHOSLink", 1000); 
-  if ( !gime->TrackSegmentMaker() ) {
-    gime->PostTrackSegmentMaker(this);
-  }
+  fTrackSegments = new TClonesArray("AliPHOSTrackSegment",100);
 }
 
 //____________________________________________________________________________
@@ -283,8 +271,6 @@ void  AliPHOSTrackSegmentMakerv2::InitParameters()
   fEmcLast   = 0 ;   
   fLinkUpArray = 0 ;
   fWrite                   = kTRUE ;
-  fTrackSegmentsInRun       = 0 ; 
-  SetEventRange(0,-1) ;
 }
 
 
@@ -295,9 +281,6 @@ void  AliPHOSTrackSegmentMakerv2::MakeLinks()
   // which are not further apart from each other than fRcpv 
   // and sort them in accordance with this distance
   
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-
   fLinkUpArray->Clear() ;    
 
   AliPHOSEmcRecPoint * emcclu ;
@@ -306,7 +289,7 @@ void  AliPHOSTrackSegmentMakerv2::MakeLinks()
   
   Int_t iEmcRP;
   for(iEmcRP = fEmcFirst; iEmcRP < fEmcLast; iEmcRP++ ) {
-    emcclu = dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(iEmcRP)) ;
+    emcclu = dynamic_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(iEmcRP)) ;
     TVector3 vecEmc ;
     emcclu->GetLocalPosition(vecEmc) ;
     Int_t mod=emcclu->GetPHOSMod() ;
@@ -335,11 +318,6 @@ void  AliPHOSTrackSegmentMakerv2::MakePairs()
   // unassigned RecParticles. We assign these RecPoints to TrackSegment and 
   // remove them from the list of "unassigned". 
 
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ; 
-
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TClonesArray * trackSegments = gime->TrackSegments();
-    
   //Make arrays to mark clusters already chosen
   Int_t * emcExist = 0;
   if(fEmcLast > fEmcFirst)
@@ -373,11 +351,11 @@ void  AliPHOSTrackSegmentMakerv2::MakePairs()
       if(tpcExist[linkUp->GetCpv()]){ //Track still exist
          Float_t dx,dz ; 
          linkUp->GetXZ(dx,dz) ;
-        new ((* trackSegments)[fNTrackSegments]) 
-          AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(linkUp->GetEmc())) , 
+        new ((* fTrackSegments)[fNTrackSegments]) 
+          AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(linkUp->GetEmc())) , 
                               nullpointer,
                               linkUp->GetTrack(),dx,dz) ;
-       (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
+       (dynamic_cast<AliPHOSTrackSegment *>(fTrackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++ ;
        emcExist[linkUp->GetEmc()-fEmcFirst] = -1 ; //Mark emc  that Cpv was found 
        //mark track as already used 
@@ -391,10 +369,10 @@ void  AliPHOSTrackSegmentMakerv2::MakePairs()
     Int_t iEmcRP ;
     for(iEmcRP = 0; iEmcRP < fEmcLast-fEmcFirst  ; iEmcRP++ ){
       if(emcExist[iEmcRP] > 0 ){
-       new ((*trackSegments)[fNTrackSegments])  
-         AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(emcRecPoints->At(iEmcRP+fEmcFirst)), 
+       new ((*fTrackSegments)[fNTrackSegments])  
+         AliPHOSTrackSegment(dynamic_cast<AliPHOSEmcRecPoint *>(fEMCRecPoints->At(iEmcRP+fEmcFirst)), 
                            nullpointer) ;
-       (dynamic_cast<AliPHOSTrackSegment *>(trackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
+       (dynamic_cast<AliPHOSTrackSegment *>(fTrackSegments->At(fNTrackSegments)))->SetIndexInList(fNTrackSegments);
        fNTrackSegments++;    
       } 
     }
@@ -404,7 +382,7 @@ void  AliPHOSTrackSegmentMakerv2::MakePairs()
 }
 
 //____________________________________________________________________________
-void  AliPHOSTrackSegmentMakerv2::Exec(Option_t *option)
+void  AliPHOSTrackSegmentMakerv2::Clusters2TrackSegments(Option_t *option)
 {
   // Steering method to perform track segment construction for events
   // in the range from fFirstEvent to fLastEvent.
@@ -419,59 +397,29 @@ void  AliPHOSTrackSegmentMakerv2::Exec(Option_t *option)
     return ; 
   }
   
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;  
-  const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
-
-  if (fLastEvent == -1) 
-    fLastEvent = gime->MaxEvent() - 1 ;
-  else 
-    fLastEvent = TMath::Min(fFirstEvent,gime->MaxEvent());
-  Int_t nEvents   = fLastEvent - fFirstEvent + 1;
-
-  Int_t ievent ; 
-  for (ievent = fFirstEvent; ievent <= fLastEvent; ievent++) {
-    gime->Event(ievent,"DR") ;
-   //Make some initializations 
-    fNTrackSegments = 0 ;
-    fEmcFirst = 0 ;    
-    fEmcLast  = 0 ;   
+  //Make some initializations 
+  fNTrackSegments = 0 ;
+  fEmcFirst = 0 ;    
+  fEmcLast  = 0 ;   
     
-    gime->TrackSegments()->Clear();
+  fTrackSegments->Clear();
 
-    //    if(!ReadRecPoints(ievent))   continue; //reads RecPoints for event ievent
+  //    if(!ReadRecPoints(ievent))   continue; //reads RecPoints for event ievent
     
-    for(fModule = 1; fModule <= geom->GetNModules() ; fModule++ ) {
-      FillOneModule() ; 
-      MakeLinks() ;
-      MakePairs() ;
-    }
-
-    WriteTrackSegments() ;
+  for(fModule = 1; fModule <= fGeom->GetNModules() ; fModule++ ) {
+    FillOneModule() ; 
+    MakeLinks() ;
+    MakePairs() ;
+  }
 
-    if(strstr(option,"deb"))
-      PrintTrackSegments(option);
+  if(strstr(option,"deb"))
+    PrintTrackSegments(option);
     
-    //increment the total number of track segments per run 
-    fTrackSegmentsInRun += gime->TrackSegments()->GetEntriesFast() ; 
-  }
-  
   if(strstr(option,"tim")){
     gBenchmark->Stop("PHOSTSMaker");
-    Info("Exec", "took %f seconds for making TS %f seconds per event", 
-          gBenchmark->GetCpuTime("PHOSTSMaker"), 
-          gBenchmark->GetCpuTime("PHOSTSMaker")/nEvents) ;
-   }
-  if(fWrite) //do not unload in "on flight" mode
-    Unload();
-}
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv2::Unload() 
-{
-  // Unloads the task from the folder
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;  
-  gime->PhosLoader()->UnloadRecPoints() ;
-  gime->PhosLoader()->UnloadTracks() ;
+    Info("Exec", "took %f seconds for making TS", 
+        gBenchmark->GetCpuTime("PHOSTSMaker")); 
+  }
 }
 
 //____________________________________________________________________________
@@ -490,55 +438,23 @@ void AliPHOSTrackSegmentMakerv2::Print(const Option_t *)const
   }
   else
     Info("Print", "AliPHOSTrackSegmentMakerv2 not initialized ") ;
-}
 
-//____________________________________________________________________________
-void AliPHOSTrackSegmentMakerv2::WriteTrackSegments()
-{
-  // Writes found TrackSegments to TreeR. Creates branches 
-  // "PHOSTS" and "AliPHOSTrackSegmentMaker" with the same title.
-  // In the former branch found TrackSegments are stored, while 
-  // in the latter all parameters, with which TS were made. 
-  // ROOT does not allow overwriting existing branches, therefore
-  // first we check, if branches with the same title already exist.
-  // If yes - exits without writing.
-
-  AliPHOSGetter *gime = AliPHOSGetter::Instance() ; 
-
-  TClonesArray * trackSegments = gime->TrackSegments() ; 
-  trackSegments->Expand(trackSegments->GetEntriesFast()) ;
-
-  if(fWrite){ //We write TreeT
-    TTree * treeT = gime->TreeT();
-    
-    //First TS
-    Int_t bufferSize = 32000 ; 
-    TBranch * tsBranch = treeT->Branch("PHOSTS",&trackSegments,bufferSize);
-    tsBranch->Fill() ;  
-    
-    gime->WriteTracks("OVERWRITE");
-    gime->WriteTrackSegmentMaker("OVERWRITE");
-  }
 }
 
-
 //____________________________________________________________________________
 void AliPHOSTrackSegmentMakerv2::PrintTrackSegments(Option_t * option)
 {
   // option deb - prints # of found TrackSegments
   // option deb all - prints as well indexed of found RecParticles assigned to the TS
 
-  TClonesArray * trackSegments = AliPHOSGetter::Instance()->TrackSegments() ; 
-
   Info("PrintTrackSegments", "Results from TrackSegmentMaker:") ; 
-  printf("nevent: %d\n", gAlice->GetEvNumber()) ; 
-  printf("        Found %d TrackSegments\n", trackSegments->GetEntriesFast() ); 
+  printf("        Found %d TrackSegments\n", fTrackSegments->GetEntriesFast() ); 
   
   if(strstr(option,"all")) {  // printing found TS
     printf("TrackSegment #  EMC RP#  CPV RP#\n") ; 
     Int_t index;
-    for (index = 0 ; index <trackSegments->GetEntriesFast() ; index++) {
-      AliPHOSTrackSegment * ts = (AliPHOSTrackSegment * )trackSegments->At(index) ; 
+    for (index = 0 ; index <fTrackSegments->GetEntriesFast() ; index++) {
+      AliPHOSTrackSegment * ts = (AliPHOSTrackSegment * )fTrackSegments->At(index) ; 
       printf("   %d           %d        %d \n", ts->GetIndexInList(), ts->GetEmcIndex(), ts->GetTrackIndex() ) ; 
     }  
   }
index f1f3f9bfc8b2599d7ece2407b9f5a5dd6bbd6ede..7c21e3fdc7af0b139311944b0f03b9ecb3c434f0 100644 (file)
@@ -7,6 +7,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.3  2007/04/25 19:39:42  kharlov
+ * Track extracpolation improved
+ *
  * Revision 1.2  2007/04/01 19:16:52  kharlov
  * D.P.: Produce EMCTrackSegments using TPC/ITS tracks (no CPV)
  *
@@ -53,16 +56,12 @@ class  AliPHOSTrackSegmentMakerv2 : public AliPHOSTrackSegmentMaker {
 public:
 
   AliPHOSTrackSegmentMakerv2() ;                     
-  AliPHOSTrackSegmentMakerv2(const TString & alirunFileNameFile, const TString & eventFolderName = AliConfig::GetDefaultEventFolderName());
+  AliPHOSTrackSegmentMakerv2(AliPHOSGeometry *geom);
   AliPHOSTrackSegmentMakerv2(const AliPHOSTrackSegmentMakerv2 & tsm);
 
   virtual ~ AliPHOSTrackSegmentMakerv2() ; // dtor
   
-  //  virtual char*  GetRecPointsBranch    (void)const{return (char*)fRecPointsBranchTitle.Data() ;}
-  //  virtual char*  GetTrackSegmentsBranch(void)const{return (char*)fTrackSegmentsBranchTitle.Data() ;}
-  virtual Int_t GetTrackSegmentsInRun()const {return fTrackSegmentsInRun ;}  
-
-  virtual void   Exec(Option_t *option); // Does the job
+  virtual void   Clusters2TrackSegments(Option_t *option); // Does the job
           void   FillOneModule() ;       // Finds range in which RecPoints belonging current PHOS module are
 
           void   MakeLinks() ;           //Evaluates distances(links) between EMC and CPV
@@ -72,26 +71,23 @@ public:
   void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;} 
   virtual void   SetMaxTPCDistance(Float_t r){ fRtpc = r ;} //Maximal distance 
                                                                //between EMCrp and extrapolation of TPC track
-  //  virtual void   SetRecPointsBranch(const char * title) { fRecPointsBranchTitle = title ;} 
-  //  virtual void   SetTrackSegmentsBranch(const char * title){ fTrackSegmentsBranchTitle = title ; }
-  virtual const char * Version() const { return "tsm-v2" ; }  
+ virtual const char * Version() const { return "tsm-v2" ; }  
 
   AliPHOSTrackSegmentMakerv2 & operator = (const AliPHOSTrackSegmentMakerv2 & )  {
     // assignement operator requested by coding convention but not needed
     Fatal("operator =", "not implemented") ;
     return *this ; 
   }
-  void Unload() ;
+
+  virtual TClonesArray * GetTrackSegments() const { return fTrackSegments; }
 
 private:
 
-  const TString BranchName() const ; 
   void  GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * EmcClu , AliESDtrack* track,
                                Float_t &dx, Float_t &dz ) const ; // see R0
   void    Init() ;
   void    InitParameters() ;
   void    PrintTrackSegments(Option_t *option) ;
-  virtual void   WriteTrackSegments() ;
 
 protected: 
   struct TrackInPHOS_t {
@@ -117,9 +113,10 @@ private:
   Int_t fEmcFirst;     //! Index of first EMC RecPoint belonging to currect PHOS module
   Int_t fEmcLast ;     //!
   Int_t fModule ;      //! number of module being processed
-  Int_t fTrackSegmentsInRun ; //! Total number of track segments in one run
 
-  ClassDef( AliPHOSTrackSegmentMakerv2,1)  // Implementation version 1 of algorithm class to make PHOS track segments 
+  TClonesArray * fTrackSegments; // Array with found track-segments
+
+  ClassDef( AliPHOSTrackSegmentMakerv2,2)  // Implementation version 1 of algorithm class to make PHOS track segments 
 
  };
 
index 8b6bdcf6f870bb1f593f012319916adbd3dbb10f..a70ce1765a3da01e2146040fd00d8ee0cdbce4e8 100644 (file)
@@ -17,6 +17,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.7  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.6  2007/08/03 14:41:37  cvetan
  * Missing header files
  *
@@ -61,21 +64,13 @@ const Double_t kZmax=65.; // Approximately: the maximal possible z-coord.(cm)
 
 //____________________________________________________________________________
 AliPHOSTracker::AliPHOSTracker(): 
-  AliTracker(), 
-  fRunLoader(0), 
-  fTSM(0x0), 
-  fPID(0x0) 
+  AliTracker()
 {
   //--------------------------------------------------------------------
   // The default constructor
   //--------------------------------------------------------------------
   for (Int_t i=0; i<5; i++) 
       fModules[i]=new TClonesArray("AliPHOSEmcRecPoint",777);
-  
-  fTSM = new AliPHOSTrackSegmentMakerv1("to be set", "to be set");
-  fTSM->GetQualAssDataMaker()->Init(AliQualAss::kTRACKSEGMENTS) ; 
-  fPID = new AliPHOSPIDv1("to be set", "to be set");
-  fPID->GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;    
 }
 
 //____________________________________________________________________________
@@ -88,8 +83,6 @@ AliPHOSTracker::~AliPHOSTracker()
       (fModules[i])->Delete();
       delete fModules[i];
   }
-  delete fTSM ;
-  delete fPID ; 
 }
 
 //____________________________________________________________________________
@@ -146,10 +139,6 @@ Int_t AliPHOSTracker::PropagateBack(AliESDEvent *esd) {
   // Makes the PID
   //--------------------------------------------------------------------
 
-  // The following old function is a bad function: it uses RunLoader ;(
-  PropagateBackOld(esd);   
-
-
   Int_t nt=esd->GetNumberOfTracks();
 
   // *** Select and sort the ESD track in accordance with their quality
@@ -265,76 +254,3 @@ void AliPHOSTracker::UnloadClusters() {
   //--------------------------------------------------------------------
   for (Int_t i=0; i<5; i++) (fModules[i])->Delete();
 }
-
-
-
-// **** The following are bad functions:  they use RunLoader ;(
-// **** To be rewritten.
-
-#include "AliPHOSTrackSegmentMakerv1.h"
-#include "AliPHOSTrackSegmentMakerv2.h"
-#include "AliPHOSPIDv1.h"
-#include "AliRunLoader.h"
-
-//____________________________________________________________________________
-Int_t AliPHOSTracker::PropagateBackOld(AliESDEvent *esd) {
-  // Bad function: it uses RunLoader ;(  
-  // Creates the tracksegments and Recparticles
-  // Makes the PID
-  
-  AliPHOSGetter * gime = AliPHOSGetter::Instance() ;  
-  Int_t eventNumber = gime->PhosLoader()->GetRunLoader()->GetEventNumber() ;
-
-  TString headerFile(gime->PhosLoader()->GetRunLoader()->GetFileName()) ; 
-  TString branchName(gime->PhosLoader()->GetRunLoader()->GetEventFolder()->GetName()) ;  
-
-  // do current event; the loop over events is done by AliReconstruction::Run()
-
-  fTSM->SetTitle(headerFile) ; 
-  fTSM->SetEventFolderName(branchName) ;
-  fTSM->SetESD(esd) ; 
-  fTSM->SetEventRange(eventNumber, eventNumber) ; 
-  if ( Debug() ) 
-   fTSM->ExecuteTask("deb all") ;
-  else 
-    fTSM->ExecuteTask("") ;
-  
-  fTSM->GetQualAssDataMaker()->SetData(gime->TrackSegments()) ; 
-  fTSM->GetQualAssDataMaker()->Exec(AliQualAss::kTRACKSEGMENTS) ; 
-
-  fPID->SetTitle(headerFile) ; 
-  fPID->SetEventFolderName(branchName) ;
-  fPID->SetESD(esd) ; 
-  fPID->SetEventRange(eventNumber, eventNumber) ; 
-  if ( Debug() ) 
-   fPID->ExecuteTask("deb all") ;
-  else 
-    fPID->ExecuteTask("") ;
-
-  fPID->GetQualAssDataMaker()->SetData(gime->RecParticles()) ; 
-  fPID->GetQualAssDataMaker()->Exec(AliQualAss::kRECPARTICLES) ; 
-  
-  if ( eventNumber == gime->MaxEvent()-1 ) {
-       fTSM->GetQualAssDataMaker()->Finish(AliQualAss::kTRACKSEGMENTS) ; 
-       fPID->GetQualAssDataMaker()->Finish(AliQualAss::kRECPARTICLES) ; 
-  }
-       
-  return 0;
-}
-
-//____________________________________________________________________________
-AliPHOSTracker::AliPHOSTracker(AliRunLoader *l) : 
-  AliTracker(), 
-  fRunLoader(0), 
-  fTSM(0x0), 
-  fPID(0x0) 
-{
-  //--------------------------------------------------------------------
-  // Bad constructor:  uses RunLoader ;(
-  //--------------------------------------------------------------------
-  for (Int_t i=0; i<5; i++) 
-      fModules[i]=new TClonesArray("AliPHOSEmcRecPoint",777);
-  fTSM = new AliPHOSTrackSegmentMakerv1("to be set", "to be set");
-  fPID = new AliPHOSPIDv1("to be set", "to be set");
-}
-
index 85977ff9078af19eaa87d57b45b8539d4e468d60..56989af78b76a6776e7243be0e01de2c4ca951db 100644 (file)
@@ -8,6 +8,9 @@
 /* History of cvs commits:
  *
  * $Log$
+ * Revision 1.5  2007/08/07 14:12:03  kharlov
+ * Quality assurance added (Yves Schutz)
+ *
  * Revision 1.4  2007/08/03 13:52:16  kharlov
  * Working skeleton of matching the ESD tracks and ESD clusters (Iouri Belikov)
  *
@@ -28,14 +31,11 @@ class TTree;
 
 class AliCluster;
 class AliESDEvent;
-class AliPHOSTrackSegmentMaker ; 
-class AliPHOSPID ; 
 
 class AliPHOSTracker : public AliTracker
 {
 public:
   AliPHOSTracker();
-  AliPHOSTracker(AliRunLoader *loader);  // Bad !
   virtual ~AliPHOSTracker();
   
   Int_t LoadClusters(TTree *ct);
@@ -54,19 +54,13 @@ protected:
   AliPHOSTracker(const AliPHOSTracker & rhs): AliTracker(rhs){}
 
 private:
-  Int_t PropagateBackOld(AliESDEvent *ev); //Bad function: uses RunLoader ;(
-
   AliPHOSTracker &operator=(const AliPHOSTracker &rhs);
 
-  AliRunLoader *fRunLoader;  //! Bad !
-
   static Bool_t fgDebug ;    //! Verbosity controller
 
   TClonesArray *fModules[5];
   
-  AliPHOSTrackSegmentMaker * fTSM ; //! the track segment maker 
-  AliPHOSPID * fPID ;               //! the pid maker 
-  ClassDef(AliPHOSTracker,1)
+  ClassDef(AliPHOSTracker,2)
 };
 
 #endif