]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONClusterReconstructor.cxx
Suppressed warning from fkSegmentation->PadByPosition(...)
[u/mrichter/AliRoot.git] / MUON / AliMUONClusterReconstructor.cxx
index 59bc2bc2ad444be1c1a7aa6ce5bd91663431766d..c659f6745eac79783a32c51c14ac19f4ac9e1ebe 100644 (file)
 #include "AliMUONClusterFinderVS.h"
 #include "AliMUONClusterInput.h"
 #include "AliMUONRawCluster.h"
-#include "AliRawReader.h" // for raw data
 #include "AliLog.h"
 
-
-const Int_t AliMUONClusterReconstructor::fgkDefaultPrintLevel = 0;
-
 ClassImp(AliMUONClusterReconstructor) // Class implementation in ROOT context
 
 //__________________________________________________________________________
-AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader)
-  : TObject(),
-    fMUONData(0),
-    fPrintLevel(fgkDefaultPrintLevel),
-    fDebug(0)
+  AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader, AliMUONData* data)
+  : TObject()
 {
   // Standard Constructor
 
@@ -55,8 +48,8 @@ AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader)
   fLoader = loader;
 
   // initialize container
-  fMUONData  = new AliMUONData(fLoader,"MUON","MUON");
-
+  fMUONData = data;
+  
   // reconstruction model
   fRecModel = new AliMUONClusterFinderVS();
   //fRecModel = new AliMUONClusterFinderAZ();
@@ -67,8 +60,7 @@ AliMUONClusterReconstructor::AliMUONClusterReconstructor(AliLoader* loader)
 AliMUONClusterReconstructor::AliMUONClusterReconstructor()
   : TObject(),
     fMUONData(0),
-    fPrintLevel(fgkDefaultPrintLevel),
-    fDebug(0),
+    fRecModel(0),
     fLoader(0)
 {
   // Default Constructor
@@ -100,90 +92,17 @@ AliMUONClusterReconstructor::operator=(const AliMUONClusterReconstructor& rhs)
 AliMUONClusterReconstructor::~AliMUONClusterReconstructor(void)
 {
 
-  if (fMUONData)
-    delete fMUONData;
+  if (fRecModel)
+    delete fRecModel;
 
   return;
 }
 //____________________________________________________________________
-void AliMUONClusterReconstructor::Digits2Clusters()
-{
-//
-//  Perform cluster finding
-//
-
-    AliMUON* pMUON = (AliMUON*) gAlice->GetModule("MUON");
-    if (pMUON->WhichSegmentation() == 1)
-      Digits2ClustersOld();
-    else
-      Digits2ClustersNew();
-
-}
-//____________________________________________________________________
-void AliMUONClusterReconstructor::Digits2ClustersOld()
-{
-
-//
-//  Perform cluster finding
-//
-    TClonesArray *dig1, *dig2;
-    Int_t ndig, k;
-    dig1 = new TClonesArray("AliMUONDigit",1000);
-    dig2 = new TClonesArray("AliMUONDigit",1000);
-    AliMUONDigit *digit;
-
-// Loop on chambers and on cathode planes     
-    TClonesArray * muonDigits;
-
-    for (Int_t ich = 0; ich < 10; ich++) {
-
-        fMUONData->ResetDigits();
-        fMUONData->GetCathode(0);
-        //TClonesArray *
-        muonDigits = fMUONData->Digits(ich); 
-        ndig=muonDigits->GetEntriesFast();
-        AliDebug(1,Form("1 Found %d digits in %p chamber %d", ndig, (void*)muonDigits,ich));
-        TClonesArray &lhits1 = *dig1;
-        Int_t n = 0;
-        for (k = 0; k < ndig; k++) {
-            digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
-           new(lhits1[n++]) AliMUONDigit(*digit);
-        }
-        fMUONData->ResetDigits();
-        fMUONData->GetCathode(1);
-        muonDigits =  fMUONData->Digits(ich);  
-        ndig=muonDigits->GetEntriesFast();
-        AliDebug(1,Form("2 Found %d digits in %p %d", ndig, (void*)muonDigits, ich));
-        TClonesArray &lhits2 = *dig2;
-        n=0;
-        
-        for (k=0; k<ndig; k++) {
-            digit= (AliMUONDigit*) muonDigits->UncheckedAt(k);
-           new(lhits2[n++]) AliMUONDigit(*digit);
-        }
-
-        if (fRecModel) {         
-            AliMUONClusterInput::Instance()->SetDigits(ich, dig1, dig2);
-            fRecModel->FindRawClusters();
-        }
-        // copy into the container
-        TClonesArray* tmp = fRecModel->GetRawClusters();
-        for (Int_t id = 0; id < tmp->GetEntriesFast(); id++) {
-          AliMUONRawCluster* pClus = (AliMUONRawCluster*) tmp->At(id);
-          fMUONData->AddRawCluster(ich, *pClus);
-        }
-        dig1->Delete();
-        dig2->Delete();
-    } // for ich
-    delete dig1;
-    delete dig2;
-}
-//____________________________________________________________________
-void AliMUONClusterReconstructor::Digits2ClustersNew()
+void AliMUONClusterReconstructor::Digits2Clusters(Int_t chBeg)
 {
 
     TClonesArray *dig1, *dig2, *digAll;
-    Int_t ndig, k, idDE, idDE_prev;
+    Int_t ndig, k, idDE, idDEprev;
     dig1 = new TClonesArray("AliMUONDigit",1000);
     dig2 = new TClonesArray("AliMUONDigit",1000);
     digAll = new TClonesArray("AliMUONDigit",2000);
@@ -197,60 +116,32 @@ void AliMUONClusterReconstructor::Digits2ClustersNew()
     TClonesArray* muonDigits;
     Int_t n2;
     Int_t n1;
-    Int_t flag = 0;
 
-    for (Int_t ich = 0; ich < AliMUONConstants::NTrackingCh(); ich++) {
+    for (Int_t ich = chBeg; ich < AliMUONConstants::NTrackingCh(); ich++) {
  
       id.Reset();
       n1 = 0;
       n2 = 0;
-      //cathode 0
-      fMUONData->ResetDigits();
-      fMUONData->GetCathode(0);
+
+      //cathode 0 & 1
       muonDigits = fMUONData->Digits(ich); 
       ndig = muonDigits->GetEntriesFast();
       TClonesArray &lDigit = *digAll;
 
-      idDE_prev = 0;
-
+      idDEprev = 0;
+      muonDigits->Sort();
       for (k = 0; k < ndig; k++) {
 
        digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
        new(lDigit[n1++]) AliMUONDigit(*digit);
        idDE = digit->DetElemId();
-       if (idDE != idDE_prev) {
+       if (idDE != idDEprev) {
          id.AddAt(idDE,n2++);
        }
-       idDE_prev = idDE;
+       idDEprev = idDE;
       }
 
-      //cathode 1
-      fMUONData->ResetDigits();
-      fMUONData->GetCathode(1);
-      muonDigits =  fMUONData->Digits(ich);  
-      ndig = muonDigits->GetEntriesFast();
-
       Int_t idSize = n2;
-    
-      for (k = 0; k < ndig; k++) {
-
-       digit = (AliMUONDigit*) muonDigits->UncheckedAt(k);
-       new(lDigit[n1++]) AliMUONDigit(*digit);
-       idDE = digit->DetElemId();
-       flag = 0;
-
-       // looking for new idDE in cathode 1 (method to be checked CF)
-       for (Int_t n = 0; n < idSize; n++) {
-         if (idDE == id[n]) {
-           flag = 1;
-           break;
-         }
-       }
-       if (flag) continue;
-       id.AddAt(idDE,n2++);
-      }
-
-      idSize = n2;
 
       // loop over id DE
       for (idDE = 0; idDE < idSize; idDE++) {
@@ -271,8 +162,6 @@ void AliMUONClusterReconstructor::Digits2ClustersNew()
          }
        }
 
-       //      if (id[idDE] < 500 && id[idDE] > 299) continue; // temporary patch til St2 geometry is not yet ok (CF)
-
        // cluster finder
        if (fRecModel) {
          AliMUONClusterInput::Instance()->SetDigits(ich, id[idDE], dig1, dig2);
@@ -294,14 +183,6 @@ void AliMUONClusterReconstructor::Digits2ClustersNew()
     delete digAll;
 }
 
-//____________________________________________________________________
-void AliMUONClusterReconstructor::Digits2Clusters(AliRawReader* /*rawReader*/)
-{
-
-//  Perform cluster finding form raw data
-
-   AliFatal("clusterization not implemented for raw data input");
-}
 //_______________________________________________________________________
 void AliMUONClusterReconstructor::Trigger2Trigger() 
 {
@@ -310,11 +191,3 @@ void AliMUONClusterReconstructor::Trigger2Trigger()
   fMUONData->SetTreeAddress("GLT");
   fMUONData->GetTriggerD();
 }
-//_______________________________________________________________________
-void AliMUONClusterReconstructor::Trigger2Trigger(AliRawReader* /*rawReader*/) 
-{
-// call the Trigger Algorithm from raw data and fill TreeR 
-
-   AliFatal("Trigger not implemented for raw data input");
-
-}