Implemented a new version of cluster (with its store and iterator):
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 6 Oct 2007 20:32:36 +0000 (20:32 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 6 Oct 2007 20:32:36 +0000 (20:32 +0000)
--> contains only important informations (including an unique ID for each cluster)
--> keeps backward compatibility with old clusters

Philippe P., Laurent

EVE/Alieve/MUONData.cxx
HLT/MUON/OfflineInterface/AliHLTMUONRecHitsSource.cxx

index b9b3865..08e103a 100644 (file)
@@ -22,7 +22,8 @@
 
 #include <AliMUONDigitMaker.h>
 #include <AliMUONHit.h>
-#include <AliMUONRawCluster.h>
+#include <AliMUONVCluster.h>
+#include "AliMUONVClusterStore.h"
 #include <AliMUONVDigit.h>
 #include "AliMUONDigitStoreV1.h"
 #include "AliMUONVDigitStore.h"
@@ -204,39 +205,40 @@ void MUONData::LoadRecPoints(TTree* tree)
   // load local trigger information
   //
 
-  Char_t branchname[30];
-  TClonesArray *clusters = 0;
-  Int_t nclusters;
-  AliMUONRawCluster  *mcls;
+  AliMUONVClusterStore *clusterStore = AliMUONVClusterStore::Create(*tree);
+  clusterStore->Clear();
+  clusterStore->Connect(*tree,kFALSE);
+  
+  tree->GetEvent(0);
+  
+  AliMUONVCluster *cluster;
   Int_t detElemId;
-  Float_t clsX, clsY, clsZ, charge;
-
-  for (Int_t c = 0; c < 10; ++c) {
-
-    if (fChambers[c] == 0) continue;
-    sprintf(branchname,"MUONRawClusters%d",c+1);
-    tree->SetBranchAddress(branchname,&clusters);
-    tree->GetEntry(0);
+  Double_t clsX, clsY, clsZ, charge;
 
-    nclusters = clusters->GetEntriesFast(); 
+  for (Int_t ch = 0; ch < 10; ++ch) {
 
-    for (Int_t ic = 0; ic < nclusters; ic++) {
-      mcls  = (AliMUONRawCluster*)clusters->UncheckedAt(ic);
+    if (fChambers[ch] == 0) continue;
+    
+    TIter next(clusterStore->CreateChamberIterator(ch,ch));
+    
+    while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) ) {
 
-      detElemId = mcls->GetDetElemId();
-      for (Int_t icath = 0; icath < 2; icath++) {
-       clsX   = mcls->GetX(icath);
-       clsY   = mcls->GetY(icath);
-       clsZ   = mcls->GetZ(icath);
-       charge = mcls->GetCharge(icath);
+      detElemId = cluster->GetDetElemId();
+      
+      clsX   = cluster->GetX();
+      clsY   = cluster->GetY();
+      clsZ   = cluster->GetZ();
+      charge = cluster->GetCharge();
 
-       fChambers[c]->RegisterCluster(detElemId,icath,clsX,clsY,clsZ,charge);
-      }
+      fChambers[ch]->RegisterCluster(detElemId,0,clsX,clsY,clsZ,charge);
+      fChambers[ch]->RegisterCluster(detElemId,1,clsX,clsY,clsZ,charge);
 
     }
 
   }
 
+  delete clusterStore;
+  
 }
 
 //______________________________________________________________________
index fffaa1e..f795e5f 100644 (file)
@@ -30,7 +30,7 @@
 #include "AliMUONMCDataInterface.h"
 #include "AliMUONDataInterface.h"
 #include "AliMUONHit.h"
-#include "AliMUONRawCluster.h"
+#include "AliMUONVCluster.h"
 #include "AliMUONConstants.h"
 #include "AliMUONVClusterStore.h"
 #include "AliMUONVHitStore.h"
@@ -493,8 +493,8 @@ int AliHLTMUONRecHitsSource::GetEvent(
                        if (not fServeChamber[chamber]) continue;
                        
                        TIter next(clusterStore->CreateChamberIterator(chamber,chamber));
-                       AliMUONRawCluster* cluster;
-                       while ( ( cluster = static_cast<AliMUONRawCluster*>(next()) ) )
+                       AliMUONVCluster* cluster;
+                       while ( ( cluster = static_cast<AliMUONVCluster*>(next()) ) )
                        {
                                // Only select hits from the given part of the plane
                                if (fSelection == kLeftPlane and not (cluster->GetX() < 0)) continue;
@@ -519,7 +519,7 @@ int AliHLTMUONRecHitsSource::GetEvent(
                                rechit->fZ = cluster->GetZ();
                                
                                // Workout which DDL this hit will be readout of.
-                               AliMpDetElement* de = AliMpDEManager::GetDetElement(cluster->DetElemId());
+                               AliMpDetElement* de = AliMpDEManager::GetDetElement(cluster->GetDetElemId());
                                if (de != NULL and (0 <= de->GetDdlId() and de->GetDdlId() < 22))
                                        ddlList[de->GetDdlId()] = true;
                                else