]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerMI.cxx
Using new ITS recpoints container class (M.Masera)
[u/mrichter/AliRoot.git] / ITS / AliITStrackerMI.cxx
index 29209e9807838fa4792067cc36655deaa1c3bce5..411b60b830590f4f622b3d8142f41e85cd590b37 100644 (file)
@@ -50,6 +50,7 @@
 #include "AliITSChannelStatus.h"
 #include "AliITSDetTypeRec.h"
 #include "AliITSRecPoint.h"
+#include "AliITSRecPointContainer.h"
 #include "AliITSgeomTGeo.h"
 #include "AliITSReconstructor.h"
 #include "AliITSClusterParam.h"
@@ -346,22 +347,23 @@ Int_t AliITStrackerMI::LoadClusters(TTree *cTree) {
   //--------------------------------------------------------------------
   //This function loads ITS clusters
   //--------------------------------------------------------------------
-  TBranch *branch=cTree->GetBranch("ITSRecPoints");
-  if (!branch) { 
-    Error("LoadClusters"," can't get the branch !\n");
-    return 1;
+  TClonesArray *clusters = NULL;
+  AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
+  clusters=rpcont->FetchClusters(0,cTree);
+  if(!(rpcont->IsSPDActive() || rpcont->IsSDDActive() || rpcont->IsSSDActive())){
+      AliError("ITS is not in a known running configuration: SPD, SDD and SSD are not active");
+      return 1;
   }
-
-  static TClonesArray dummy("AliITSRecPoint",10000), *clusters=&dummy;
-  branch->SetAddress(&clusters);
-
   Int_t i=0,j=0,ndet=0;
   Int_t detector=0;
   for (i=0; i<AliITSgeomTGeo::GetNLayers(); i++) {
     ndet=fgLayers[i].GetNdetectors();
     Int_t jmax = j + fgLayers[i].GetNladders()*ndet;
     for (; j<jmax; j++) {           
-      if (!cTree->GetEvent(j)) continue;
+      //      if (!cTree->GetEvent(j)) continue;
+      clusters = rpcont->UncheckedGetClusters(j);
+      if(!clusters)continue;
       Int_t ncl=clusters->GetEntriesFast();
       SignDeltas(clusters,GetZ());
  
@@ -373,7 +375,6 @@ Int_t AliITStrackerMI::LoadClusters(TTree *cTree) {
 
         fgLayers[i].InsertCluster(new AliITSRecPoint(*c));
       }
-      clusters->Clear();
       // add dead zone "virtual" cluster in SPD, if there is a cluster within 
       // zwindow cm from the dead zone      
       if (i<2 && AliITSReconstructor::GetRecoParam()->GetAddVirtualClustersInDeadZone()) {