]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSClusterizerv1.cxx
Redefinition of the photons identification.
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.cxx
index 75a4420c623620169d9b020eeca8c837671b8d5e..56252f2ebd0e9e12c6a15f7633f99fca5f0f8f62 100644 (file)
 //  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")  
+//  root [0] AliPHOSClusterizerv1 * cl = new AliPHOSClusterizerv1("galice.root", "recpointsname", "digitsname")  
 //  Warning in <TDatabasePDG::TDatabasePDG>: object already instantiated
-//               //reads gAlice from header file "..."                      
+//               // 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 [2] cl->SetDigitsBranch("digits2") 
@@ -88,66 +89,60 @@ ClassImp(AliPHOSClusterizerv1)
 {
   // default ctor (to be used mainly by Streamer)
   
-  fNumberOfCpvClusters     = 0 ; 
-  fNumberOfEmcClusters     = 0 ; 
-  
-  fCpvClusteringThreshold  = 0.0;
-  fEmcClusteringThreshold  = 0.2;   
-  
-  fEmcLocMaxCut            = 0.03 ;
-  fCpvLocMaxCut            = 0.03 ;
-  
-  fW0                      = 4.5 ;
-  fW0CPV                   = 4.0 ;
-
-  fEmcTimeGate             = 1.e-8 ; 
-
-  fToUnfold                = kTRUE ;
-
-  fHeaderFileName          = "" ; 
-  fDigitsBranchTitle       = "" ;
-  fRecPointsInRun          = 0 ;   
+  InitParameters() ; 
 }
 
 //____________________________________________________________________________
-AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* name)
+AliPHOSClusterizerv1::AliPHOSClusterizerv1(const char* headerFile,const char* name, const char * from)
 :AliPHOSClusterizer(headerFile, name)
 {
   // ctor with the indication of the file where header Tree and digits Tree are stored
   
-
-  fNumberOfCpvClusters     = 0 ; 
-  fNumberOfEmcClusters     = 0 ; 
-  
-  fCpvClusteringThreshold  = 0.0;
-  fEmcClusteringThreshold  = 0.2;   
-  
-  fEmcLocMaxCut            = 0.03 ;
-  fCpvLocMaxCut            = 0.03 ;
-  
-  fW0                      = 4.5 ;
-  fW0CPV                   = 4.0 ;
-
-  fEmcTimeGate             = 1.e-8 ; 
+  InitParameters() ;
   
-  fToUnfold                = kTRUE ;
-  
-  fHeaderFileName          = GetTitle() ; 
-  fDigitsBranchTitle       = GetName() ;
-  
-  TString clusterizerName( GetName()) ; 
-  clusterizerName.Append(":") ; 
-  clusterizerName.Append(Version()) ; 
-  SetName(clusterizerName) ;
-  fRecPointsInRun          = 0 ; 
-
+  if ( from == 0 ) 
+    fFrom = name ; 
+  else
+    fFrom = from ; 
   Init() ;
 
 }
+
 //____________________________________________________________________________
   AliPHOSClusterizerv1::~AliPHOSClusterizerv1()
 {
+  // dtor
+  // gime=0 if Clusterizer created by default ctor (to get just the parameters)
+
+  AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+  
+  if (gime) {
+    // remove the task from the folder list
+    gime->RemoveTask("C",GetName()) ;
+    
+    // remove the data from the folder list
+    TString name(GetName()) ; 
+    name.Remove(name.Index(":")) ; 
+    gime->RemoveObjects("D", name) ;  //  Digits
+    gime->RemoveObjects("RE", name) ; // EMCARecPoints
+    gime->RemoveObjects("RC", name) ; // CPVRecPoints
+    
+    // Delete gAlice
+    gime->CloseFile() ; 
+    
+    fSplitFile = 0 ; 
+  }
+}
+
+//____________________________________________________________________________
+const TString AliPHOSClusterizerv1::BranchName() const 
+{  
+  TString branchName(GetName() ) ;
+  branchName.Remove(branchName.Index(Version())-1) ;
+  return branchName ;
 }
 //____________________________________________________________________________
 Float_t  AliPHOSClusterizerv1::Calibrate(Int_t amp, Int_t absId) const
 {
@@ -173,31 +168,33 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
   gAlice->GetEvent(0) ;
   
  //check, if the branch with name of this" already exits?
-  TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
-  TIter next(lob) ; 
-  TBranch * branch = 0 ;  
-  Bool_t phosemcfound = kFALSE, phoscpvfound = kFALSE, clusterizerfound = kFALSE ; 
-
-  TString branchname = GetName() ;
-  branchname.Remove(branchname.Index(Version())-1) ;
-  
-  while ( (branch = (TBranch*)next()) && (!phosemcfound || !phoscpvfound || !clusterizerfound) ) {
-    if ( (strcmp(branch->GetName(), "PHOSEmcRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) ) 
-      phosemcfound = kTRUE ;
+  if(gAlice->TreeR()) { 
+    TObjArray * lob = (TObjArray*)gAlice->TreeR()->GetListOfBranches() ;
+    TIter next(lob) ; 
+    TBranch * branch = 0 ;  
+    Bool_t phosemcfound = kFALSE, phoscpvfound = kFALSE, clusterizerfound = kFALSE ; 
     
-    else if ( (strcmp(branch->GetName(), "PHOSCpvRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) ) 
-      phoscpvfound = kTRUE ;
-   
-    else if ((strcmp(branch->GetName(), "AliPHOSClusterizer")==0) && (strcmp(branch->GetTitle(), GetName())==0) ) 
-      clusterizerfound = kTRUE ; 
+    TString branchname = GetName() ;
+    branchname.Remove(branchname.Index(Version())-1) ;
+    
+    while ( (branch = (TBranch*)next()) && (!phosemcfound || !phoscpvfound || !clusterizerfound) ) {
+      if ( (strcmp(branch->GetName(), "PHOSEmcRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) ) 
+       phosemcfound = kTRUE ;
+      
+      else if ( (strcmp(branch->GetName(), "PHOSCpvRP")==0) && (strcmp(branch->GetTitle(), branchname.Data())==0) ) 
+       phoscpvfound = kTRUE ;
+      
+      else if ((strcmp(branch->GetName(), "AliPHOSClusterizer")==0) && (strcmp(branch->GetTitle(), GetName())==0) ) 
+       clusterizerfound = kTRUE ; 
+    }
+    
+    if ( phoscpvfound || phosemcfound || clusterizerfound ) {
+      cerr << "WARNING: AliPHOSClusterizer::Exec -> Emc(Cpv)RecPoints and/or Clusterizer branch with name " 
+          << branchname.Data() << " already exits" << endl ;
+      return ; 
+    }       
   }
-
-  if ( phoscpvfound || phosemcfound || clusterizerfound ) {
-    cerr << "WARNING: AliPHOSClusterizer::Exec -> Emc(Cpv)RecPoints and/or Clusterizer branch with name " 
-        << branchname.Data() << " already exits" << endl ;
-    return ; 
-  }       
-
+  
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
   Int_t nevents = (Int_t) gAlice->TreeE()->GetEntries() ;
   Int_t ievent ;
@@ -215,7 +212,8 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
     
     MakeClusters() ;
     
-    if(fToUnfold)             MakeUnfolding() ;
+    if(fToUnfold)             
+      MakeUnfolding() ;
 
     WriteRecPoints(ievent) ;
 
@@ -223,8 +221,8 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
       PrintRecPoints(option) ;
 
     //increment the total number of digits per run 
-    fRecPointsInRun += gime->EmcRecPoints()->GetEntriesFast() ;  
-    fRecPointsInRun += gime->CpvRecPoints()->GetEntriesFast() ;  
+    fRecPointsInRun += gime->EmcRecPoints(BranchName())->GetEntriesFast() ;  
+    fRecPointsInRun += gime->CpvRecPoints(BranchName())->GetEntriesFast() ;  
  }
   
   if(strstr(option,"tim")){
@@ -238,7 +236,7 @@ void AliPHOSClusterizerv1::Exec(Option_t * option)
 }
 
 //____________________________________________________________________________
-Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, int * maxAt, Float_t * maxAtEnergy,
+Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** maxAt, Float_t * maxAtEnergy,
                                    Int_t nPar, Float_t * fitparameters) const
 { 
   // Calls TMinuit to fit the energy distribution of a cluster with several maxima 
@@ -246,7 +244,7 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, int * maxAt, Fl
   // Cluster will be fitted as a superposition of nPar/3 electromagnetic showers
 
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
-  TClonesArray * digits = gime->Digits() ; 
+  TClonesArray * digits = gime->Digits(fFrom) ; 
   
 
   gMinuit->mncler();                     // Reset Minuit's list of paramters
@@ -272,7 +270,7 @@ Bool_t AliPHOSClusterizerv1::FindFit(AliPHOSEmcRecPoint * emcRP, int * maxAt, Fl
   const AliPHOSGeometry * geom = gime->PHOSGeometry() ; 
 
   for(iDigit = 0; iDigit < nDigits; iDigit++){
-    digit = (AliPHOSDigit *) maxAt[iDigit]; 
+    digit = maxAt[iDigit]; 
 
     Int_t relid[4] ;
     Float_t x = 0.;
@@ -336,7 +334,7 @@ void AliPHOSClusterizerv1::GetCalibrationParameters()
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
   TString branchname = GetName() ;
   branchname.Remove(branchname.Index(Version())-1) ;
-  AliPHOSDigitizer * dig = gime->Digitizer(branchname) ;
+  AliPHOSDigitizer * dig = gime->Digitizer(fFrom) ;
   fADCchanelEmc   = dig->GetEMCchannel() ;
   fADCpedestalEmc = dig->GetEMCpedestal();
 
@@ -356,7 +354,7 @@ void AliPHOSClusterizerv1::Init()
   TString branchname = GetName() ;
   branchname.Remove(branchname.Index(Version())-1) ;
 
-  AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), branchname) ; 
+  AliPHOSGetter * gime = AliPHOSGetter::GetInstance(GetTitle(), fFrom.Data()) ; 
   if ( gime == 0 ) {
     cerr << "ERROR: AliPHOSClusterizerv1::Init -> Could not obtain the Getter object !" << endl ; 
     return ;
@@ -367,16 +365,48 @@ void AliPHOSClusterizerv1::Init()
 
   if(!gMinuit) 
     gMinuit = new TMinuit(100) ;
-
   gime->PostClusterizer(this) ;
   // create a folder on the white board //YSAlice/WhiteBoard/RecPoints/PHOS/recpointsName
-  gime->PostRecPoints(branchname ) ;
+  gime->PostRecPoints(branchname) ;
 
-  gime->PostDigits(branchname) ;
-  gime->PostDigitizer(branchname) ;
+  gime->PostDigits(fFrom) ;
+  gime->PostDigitizer(fFrom) ;
   
 }
 
+//____________________________________________________________________________
+void AliPHOSClusterizerv1::InitParameters()
+{
+
+  fNumberOfCpvClusters     = 0 ; 
+  fNumberOfEmcClusters     = 0 ; 
+  
+  fCpvClusteringThreshold  = 0.0;
+  fEmcClusteringThreshold  = 0.2;   
+  
+  fEmcLocMaxCut            = 0.03 ;
+  fCpvLocMaxCut            = 0.03 ;
+  
+  fW0                      = 4.5 ;
+  fW0CPV                   = 4.0 ;
+
+  fEmcTimeGate             = 1.e-8 ; 
+  
+  fToUnfold                = kTRUE ;
+  
+  fHeaderFileName          = GetTitle() ; 
+  fDigitsBranchTitle       = GetName() ;
+   
+  TString clusterizerName( GetName()) ;
+  if (clusterizerName.IsNull() ) 
+    clusterizerName = "Default" ; 
+  clusterizerName.Append(":") ; 
+  clusterizerName.Append(Version()) ; 
+  SetName(clusterizerName) ;
+  fRecPointsInRun          = 0 ;
+
+}
+
 //____________________________________________________________________________
 Int_t AliPHOSClusterizerv1::AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const
 {
@@ -459,21 +489,23 @@ void AliPHOSClusterizerv1::WriteRecPoints(Int_t event)
   // Creates new branches with given title
   // fills and writes into TreeR.
 
-  TString branchName(GetName() ) ;
-  branchName.Remove(branchName.Index(Version())-1) ;
 
   AliPHOSGetter *gime = AliPHOSGetter::GetInstance() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints(branchName) ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints(branchName) ; 
-  TClonesArray * digits = gime->Digits(branchName) ; 
-
+  TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ; 
+  TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ; 
+  TClonesArray * digits = gime->Digits(fFrom) ; 
+  TTree * treeR = gAlice->TreeR();
+ if (!gAlice->TreeR() ) 
+    gAlice->MakeTree("R", fSplitFile);
+ treeR = gAlice->TreeR() ;
   Int_t index ;
   //Evaluate position, dispersion and other RecPoint properties...
   for(index = 0; index < emcRecPoints->GetEntries(); index++)
     ((AliPHOSEmcRecPoint *)emcRecPoints->At(index))->EvalAll(fW0,digits) ;
 
   emcRecPoints->Sort() ;
-
   for(index = 0; index < emcRecPoints->GetEntries(); index++)
     ((AliPHOSEmcRecPoint *)emcRecPoints->At(index))->SetIndexInList(index) ;
 
@@ -490,66 +522,28 @@ void AliPHOSClusterizerv1::WriteRecPoints(Int_t event)
 
   cpvRecPoints->Expand(cpvRecPoints->GetEntriesFast()) ;
   
-  //Make branches in TreeR for RecPoints and Clusterizer
-  char * filename = 0;
-  if(gSystem->Getenv("CONFIG_SPLIT_FILE")!=0){   //generating file name
-    filename = new char[strlen(gAlice->GetBaseFile())+20] ;
-    sprintf(filename,"%s/PHOS.Reco.root",gAlice->GetBaseFile()) ;
-  }
-  
-  //Make new branches
-  TDirectory *cwd = gDirectory;
-  
   Int_t bufferSize = 32000 ;    
   Int_t splitlevel = 0 ;
-
   //First EMC
-  TBranch * emcBranch = gAlice->TreeR()->Branch("PHOSEmcRP","TObjArray",&emcRecPoints,bufferSize,splitlevel);
-  emcBranch->SetTitle(branchName);
-  if (filename) {
-    emcBranch->SetFile(filename);
-    TIter next( emcBranch->GetListOfBranches());
-    TBranch * sb ;
-    while ((sb=(TBranch*)next())) {
-      sb->SetFile(filename);
-    }   
-    
-    cwd->cd();
-  }
+  TBranch * emcBranch = treeR->Branch("PHOSEmcRP","TObjArray",&emcRecPoints,bufferSize,splitlevel);
+  emcBranch->SetTitle(BranchName());
     
   //Now CPV branch
-  TBranch * cpvBranch = gAlice->TreeR()->Branch("PHOSCpvRP","TObjArray",&cpvRecPoints,bufferSize,splitlevel);
-  cpvBranch->SetTitle(branchName);
-  if (filename) {
-    cpvBranch->SetFile(filename);
-    TIter next( cpvBranch->GetListOfBranches());
-    TBranch * sb;
-    while ((sb=(TBranch*)next())) {
-      sb->SetFile(filename);
-    }   
-    cwd->cd();
-  } 
+  TBranch * cpvBranch = treeR->Branch("PHOSCpvRP","TObjArray",&cpvRecPoints,bufferSize,splitlevel);
+  cpvBranch->SetTitle(BranchName());
     
   //And Finally  clusterizer branch
-  AliPHOSClusterizerv1 * cl = (AliPHOSClusterizerv1*)gime->Clusterizer(branchName) ;
-  TBranch * clusterizerBranch = gAlice->TreeR()->Branch("AliPHOSClusterizer","AliPHOSClusterizerv1",
+  AliPHOSClusterizerv1 * cl = this ;
+  TBranch * clusterizerBranch = treeR->Branch("AliPHOSClusterizer","AliPHOSClusterizerv1",
                                              &cl,bufferSize,splitlevel);
-  clusterizerBranch->SetTitle(branchName);
-  if (filename) {
-    clusterizerBranch->SetFile(filename);
-    TIter next( clusterizerBranch->GetListOfBranches());
-    TBranch * sb ;
-    while ((sb=(TBranch*)next())) {
-      sb->SetFile(filename);
-    }   
-    cwd->cd();
-  }
+  clusterizerBranch->SetTitle(BranchName());
+
   emcBranch        ->Fill() ;
   cpvBranch        ->Fill() ;
   clusterizerBranch->Fill() ;
 
-  gAlice->TreeR()->Write(0,kOverwrite) ;  
+  treeR->AutoSave() ; //Write(0,kOverwrite) ;
   
 }
 
@@ -558,17 +552,20 @@ 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
-  TString branchName(GetName()) ; 
-  branchName.Remove(branchName.Index(Version())-1) ; 
 
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
 
-  TObjArray * emcRecPoints = gime->EmcRecPoints(branchName) ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints(branchName) ; 
+  TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ; 
+  TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ; 
   emcRecPoints->Delete() ;
   cpvRecPoints->Delete() ;
   
-  TClonesArray * digits = gime->Digits(branchName) ; 
+  TClonesArray * digits = gime->Digits(fFrom) ; 
+   if ( !digits ) {
+    cerr << "ERROR:  AliPHOSClusterizerv1::MakeClusters -> Digits with name " 
+        << fFrom << " not found ! " << endl ; 
+    abort() ; 
+  } 
   TClonesArray * digitsC =  (TClonesArray*)digits->Clone() ;
   
  
@@ -594,7 +591,7 @@ void AliPHOSClusterizerv1::MakeClusters()
        if(fNumberOfEmcClusters >= emcRecPoints->GetSize()) 
          emcRecPoints->Expand(2*fNumberOfEmcClusters+1) ;
        
-       emcRecPoints->AddAt(new  AliPHOSEmcRecPoint(), fNumberOfEmcClusters) ;
+       emcRecPoints->AddAt(new  AliPHOSEmcRecPoint(""), fNumberOfEmcClusters) ;
        clu = (AliPHOSEmcRecPoint *) emcRecPoints->At(fNumberOfEmcClusters) ; 
        fNumberOfEmcClusters++ ; 
        clu->AddDigit(*digit, Calibrate(digit->GetAmp(),digit->GetId())) ; 
@@ -608,7 +605,7 @@ void AliPHOSClusterizerv1::MakeClusters()
        if(fNumberOfCpvClusters >= cpvRecPoints->GetSize()) 
          cpvRecPoints->Expand(2*fNumberOfCpvClusters+1);
 
-       cpvRecPoints->AddAt(new AliPHOSCpvRecPoint(), fNumberOfCpvClusters) ;
+       cpvRecPoints->AddAt(new AliPHOSCpvRecPoint(""), fNumberOfCpvClusters) ;
 
        clu =  (AliPHOSCpvRecPoint *) cpvRecPoints->At(fNumberOfCpvClusters)  ;  
        fNumberOfCpvClusters++ ; 
@@ -678,10 +675,11 @@ void AliPHOSClusterizerv1::MakeUnfolding()
 
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
   
+
   const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
-  TClonesArray * digits = gime->Digits() ; 
+  TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ; 
+  TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ; 
+  TClonesArray * digits = gime->Digits(fFrom) ; 
   
   // Unfold first EMC clusters 
   if(fNumberOfEmcClusters > 0){
@@ -697,7 +695,7 @@ void AliPHOSClusterizerv1::MakeUnfolding()
        break ;
       
       Int_t nMultipl = emcRecPoint->GetMultiplicity() ; 
-      Int_t * maxAt = new Int_t[nMultipl] ;
+      AliPHOSDigit ** maxAt = new AliPHOSDigit*[nMultipl] ;
       Float_t * maxAtEnergy = new Float_t[nMultipl] ;
       Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fEmcLocMaxCut,digits) ;
       
@@ -734,7 +732,7 @@ void AliPHOSClusterizerv1::MakeUnfolding()
       AliPHOSEmcRecPoint * emcRecPoint = (AliPHOSEmcRecPoint*) recPoint ; 
       
       Int_t nMultipl = emcRecPoint->GetMultiplicity() ; 
-      Int_t * maxAt = new Int_t[nMultipl] ;
+      AliPHOSDigit ** maxAt = new AliPHOSDigit*[nMultipl] ;
       Float_t * maxAtEnergy = new Float_t[nMultipl] ;
       Int_t nMax = emcRecPoint->GetNumberOfLocalMax(maxAt, maxAtEnergy,fCpvLocMaxCut,digits) ;
       
@@ -770,16 +768,17 @@ Double_t  AliPHOSClusterizerv1::ShowerShape(Double_t r)
 //____________________________________________________________________________
 void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc, 
                                                 Int_t nMax, 
-                                                int * maxAt, 
+                                                AliPHOSDigit ** maxAt, 
                                                 Float_t * maxAtEnergy)
 { 
   // Performs the unfolding of a cluster with nMax overlapping showers 
 
   AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ; 
+
   const AliPHOSGeometry * geom = gime->PHOSGeometry() ;
-  TClonesArray * digits = gime->Digits() ; 
-  TObjArray * emcRecPoints = gime->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = gime->CpvRecPoints() ; 
+  const TClonesArray * digits = gime->Digits(fFrom) ; 
+  TObjArray * emcRecPoints = gime->EmcRecPoints(BranchName()) ; 
+  TObjArray * cpvRecPoints = gime->CpvRecPoints(BranchName()) ; 
 
   Int_t nPar = 3 * nMax ;
   Float_t * fitparameters = new Float_t[nPar] ;
@@ -845,7 +844,7 @@ void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,
       if(fNumberOfEmcClusters >= emcRecPoints->GetSize())
        emcRecPoints->Expand(2*fNumberOfEmcClusters) ;
       
-      (*emcRecPoints)[fNumberOfEmcClusters] = new AliPHOSEmcRecPoint() ;
+      (*emcRecPoints)[fNumberOfEmcClusters] = new AliPHOSEmcRecPoint("") ;
       emcRP = (AliPHOSEmcRecPoint *) emcRecPoints->At(fNumberOfEmcClusters);
       fNumberOfEmcClusters++ ;
     }
@@ -853,7 +852,7 @@ void  AliPHOSClusterizerv1::UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,
       if(fNumberOfCpvClusters >= cpvRecPoints->GetSize())
        cpvRecPoints->Expand(2*fNumberOfCpvClusters) ;
       
-      (*cpvRecPoints)[fNumberOfCpvClusters] = new AliPHOSCpvRecPoint() ;
+      (*cpvRecPoints)[fNumberOfCpvClusters] = new AliPHOSCpvRecPoint("") ;
       emcRP = (AliPHOSEmcRecPoint *) cpvRecPoints->At(fNumberOfCpvClusters);
       fNumberOfCpvClusters++ ;
     }
@@ -882,7 +881,6 @@ void AliPHOSClusterizerv1::UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Dou
   // Calculates the Chi square for the cluster unfolding minimization
   // Number of parameters, Gradient, Chi squared, parameters, what to do
 
-
   TList * toMinuit = (TList*) gMinuit->GetObjectFit() ;
 
   AliPHOSEmcRecPoint * emcRP = (AliPHOSEmcRecPoint*) toMinuit->At(0)  ;
@@ -1014,8 +1012,8 @@ void AliPHOSClusterizerv1::PrintRecPoints(Option_t * option)
 {
   // Prints list of RecPoints produced at the current pass of AliPHOSClusterizer
 
-  TObjArray * emcRecPoints = AliPHOSGetter::GetInstance()->EmcRecPoints() ; 
-  TObjArray * cpvRecPoints = AliPHOSGetter::GetInstance()->CpvRecPoints() ; 
+  TObjArray * emcRecPoints = AliPHOSGetter::GetInstance()->EmcRecPoints(BranchName()) ; 
+  TObjArray * cpvRecPoints = AliPHOSGetter::GetInstance()->CpvRecPoints(BranchName()) ; 
 
   cout << "AliPHOSClusterizerv1: : event "<<gAlice->GetEvNumber() << endl ;
   cout << "       Found "<< emcRecPoints->GetEntriesFast() << " EMC Rec Points and "