]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Removing obsoleted classes (Laurent)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 17 Jun 2007 21:09:29 +0000 (21:09 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 17 Jun 2007 21:09:29 +0000 (21:09 +0000)
56 files changed:
MUON/AliMUONClusterDrawAZ.cxx [deleted file]
MUON/AliMUONClusterDrawAZ.h [deleted file]
MUON/AliMUONClusterFinderVS.cxx [deleted file]
MUON/AliMUONClusterFinderVS.h [deleted file]
MUON/AliMUONClusterInput.cxx [deleted file]
MUON/AliMUONClusterInput.h [deleted file]
MUON/AliMUONData.cxx [deleted file]
MUON/AliMUONData.h [deleted file]
MUON/AliMUONDataDigitIterator.cxx [deleted file]
MUON/AliMUONDataDigitIterator.h [deleted file]
MUON/AliMUONDataIterator.cxx [deleted file]
MUON/AliMUONDataIterator.h [deleted file]
MUON/AliMUONDetElement.cxx [deleted file]
MUON/AliMUONDetElement.h [deleted file]
MUON/AliMUONDigitMapA1.cxx [deleted file]
MUON/AliMUONDigitMapA1.h [deleted file]
MUON/AliMUONDisplay.cxx [deleted file]
MUON/AliMUONDisplay.h [deleted file]
MUON/AliMUONEventRecoCombi.cxx [deleted file]
MUON/AliMUONEventRecoCombi.h [deleted file]
MUON/AliMUONGeometrySegmentation.cxx [deleted file]
MUON/AliMUONGeometrySegmentation.h [deleted file]
MUON/AliMUONHitMapA1.cxx [deleted file]
MUON/AliMUONHitMapA1.h [deleted file]
MUON/AliMUONPoints.cxx [deleted file]
MUON/AliMUONPoints.h [deleted file]
MUON/AliMUONRecData.cxx [deleted file]
MUON/AliMUONRecData.h [deleted file]
MUON/AliMUONRecLoader.cxx [deleted file]
MUON/AliMUONRecLoader.h [deleted file]
MUON/AliMUONSegFactory.cxx [deleted file]
MUON/AliMUONSegFactory.h [deleted file]
MUON/AliMUONSegmentation.cxx [deleted file]
MUON/AliMUONSegmentation.h [deleted file]
MUON/AliMUONSimData.cxx [deleted file]
MUON/AliMUONSimData.h [deleted file]
MUON/AliMUONSimLoader.cxx [deleted file]
MUON/AliMUONSimLoader.h [deleted file]
MUON/AliMUONSt12QuadrantSegmentation.cxx [deleted file]
MUON/AliMUONSt12QuadrantSegmentation.h [deleted file]
MUON/AliMUONSt345SlatSegmentation.cxx [deleted file]
MUON/AliMUONSt345SlatSegmentation.h [deleted file]
MUON/AliMUONStopwatchGroupElement.h [new file with mode: 0644]
MUON/AliMUONTriggerSegmentation.cxx [deleted file]
MUON/AliMUONTriggerSegmentation.h [deleted file]
MUON/AliMUONV1DStore.cxx [deleted file]
MUON/AliMUONV1DStore.h [deleted file]
MUON/AliMUONV2DStore.cxx [deleted file]
MUON/AliMUONV2DStore.h [deleted file]
MUON/AliMUONVDataIterator.cxx [deleted file]
MUON/AliMUONVDataIterator.h [deleted file]
MUON/AliMUONVGeometryDESegmentation.cxx [deleted file]
MUON/AliMUONVGeometryDESegmentation.h [deleted file]
MUON/Doxyfile
MUON/Doxymain.h [new file with mode: 0644]
MUON/MUONCDB.h [deleted file]

diff --git a/MUON/AliMUONClusterDrawAZ.cxx b/MUON/AliMUONClusterDrawAZ.cxx
deleted file mode 100644 (file)
index 3576c5d..0000000
+++ /dev/null
@@ -1,741 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -------------------------------------
-// Class AliMUONClusterDrawAZ
-// -------------------------------------
-// Cluster drawing for AZ cluster finder 
-// Author: Alexander Zinchenko, JINR Dubna
-
-#include <stdlib.h>
-#include <Riostream.h>
-#include <TROOT.h>
-#include <TCanvas.h>
-#include <TLine.h>
-#include <TH2.h>
-#include <TView.h>
-#include <TStyle.h>
-
-#include "AliMUONClusterDrawAZ.h"
-#include "AliMUONClusterFinderAZ.h"
-#include "AliMUONGeometryModuleTransformer.h"
-#include "AliMUONGeometrySegmentation.h"
-#include "AliHeader.h"
-#include "AliRun.h"
-#include "AliMUONDigit.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONClusterInput.h"
-#include "AliMUONPixel.h"
-#include "AliMUONRecLoader.h"
-#include "AliMUONRecData.h"
-#include "AliLog.h"
-
-ClassImp(AliMUONClusterDrawAZ)
-//_____________________________________________________________________________
-AliMUONClusterDrawAZ::AliMUONClusterDrawAZ()
-  : TObject(),
-    fData(0x0),
-    fFind(0x0),
-    fnMu(0),
-    fEvent(0),
-    fChamber(0),
-    fidDE(0),
-    fDebug(0),
-    fModif(0)
-{
-/// Default constructor
-  for (Int_t i=0; i<4; i++) fHist[i] = NULL;
-}
-
-//_____________________________________________________________________________
-AliMUONClusterDrawAZ::AliMUONClusterDrawAZ(AliMUONClusterFinderAZ *clusFinder)
-  : TObject(),
-    fData(0x0),
-    fFind(clusFinder),
-    fnMu(0),
-    fEvent(0),
-    fChamber(0),
-    fidDE(0),
-    fDebug(1),
-    fModif(0)
-{
-/// Constructor
-  for (Int_t i=0; i<4; i++) fHist[i] = NULL;
-  Init();
-}
-
-//_____________________________________________________________________________
-AliMUONClusterDrawAZ::~AliMUONClusterDrawAZ()
-{
-/// Destructor
-}
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::Init()
-{
-/// Initialization
-
-  TCanvas *c1 = new TCanvas("c1","Clusters",0,0,600,700);
-  //c1->SetFillColor(10);
-  c1->Divide(1,2);
-  new TCanvas("c2","Mlem",700,0,600,350);
-
-  // Get pointer to Alice detectors
-  //AliMUON *muon  = (AliMUON*) gAlice->GetModule("MUON");
-  //if (!muon) return;
-  //Loaders
-  AliRunLoader *rl = AliRunLoader::GetRunLoader();
-  AliLoader *gime = rl->GetLoader("MUONLoader");
-  fData = ((AliMUONRecLoader*)gime)->GetMUONData();
-
-  // gime->LoadHits("READ"); 
-  gime->LoadRecPoints("READ"); 
-}
-
-//_____________________________________________________________________________
-Bool_t AliMUONClusterDrawAZ::FindEvCh(Int_t nev, Int_t ch)
-{
-/// Find requested event and chamber (skip the ones before the selected)
-
-  if (nev < fEvent) return kFALSE;
-  else if (nev == fEvent) {
-    if (ch < fChamber) return kFALSE;
-    if (AliMUONClusterInput::Instance()->DetElemId() < fidDE) return kFALSE;
-  }
-  fEvent = nev;
-  fChamber = ch;
-  fidDE = AliMUONClusterInput::Instance()->DetElemId();
-  return kTRUE;
-}
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::DrawCluster()
-{
-/// Draw preclusters
-
-  TCanvas *c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("c1");
-
-  cout << " nev         " << fEvent << endl;
-    
-  char hName[4];
-  for (Int_t cath = 0; cath < 2; cath++) {
-    // Build histograms
-    //if (fHist[cath*2]) {fHist[cath*2]->Delete(); fHist[cath*2] = 0;}
-    //if (fHist[cath*2+1]) {fHist[cath*2+1]->Delete(); fHist[cath*2+1] = 0;}
-    if (fHist[cath*2]) fHist[cath*2] = 0;
-    if (fHist[cath*2+1]) fHist[cath*2+1] = 0;
-    if (fFind->GetNPads(cath) == 0) continue; // cluster on one cathode only
-    Float_t wxMin = 999, wxMax = 0, wyMin = 999, wyMax = 0; 
-    Int_t minDx = 0, maxDx = 0, minDy = 0, maxDy = 0;
-    for (Int_t i = 0; i < fFind->GetNPads(0)+fFind->GetNPads(1); i++) {
-      if (fFind->GetIJ(0,i) != cath) continue;
-      if (fFind->GetXyq(3,i) < wxMin) { wxMin = fFind->GetXyq(3,i); minDx = i; }
-      if (fFind->GetXyq(3,i) > wxMax) { wxMax = fFind->GetXyq(3,i); maxDx = i; }
-      if (fFind->GetXyq(4,i) < wyMin) { wyMin = fFind->GetXyq(4,i); minDy = i; }
-      if (fFind->GetXyq(4,i) > wyMax) { wyMax = fFind->GetXyq(4,i); maxDy = i; }
-    }
-    cout << minDx << " " << maxDx << " " << minDy << " " << maxDy << endl;
-    Int_t nx, ny, padSize;
-    Float_t xmin = 9999, xmax = -9999, ymin = 9999, ymax = -9999;
-    if (TMath::Nint(fFind->GetXyq(3,minDx)*1000) == TMath::Nint(fFind->GetXyq(3,maxDx)*1000) &&
-       TMath::Nint(fFind->GetXyq(4,minDy)*1000) == TMath::Nint(fFind->GetXyq(4,maxDy)*1000)) {
-      // the same segmentation
-      cout << " Same" << endl;
-      cout << fFind->GetXyq(3,minDx) << " " << fFind->GetXyq(3,maxDx) << " " 
-          << fFind->GetXyq(4,minDy) << " " << fFind->GetXyq(4,maxDy) << endl;
-      for (Int_t i = 0; i < fFind->GetNPads(0)+fFind->GetNPads(1); i++) {
-       if (fFind->GetIJ(0,i) != cath) continue;
-       if (fFind->GetXyq(0,i) < xmin) xmin = fFind->GetXyq(0,i);
-       if (fFind->GetXyq(0,i) > xmax) xmax = fFind->GetXyq(0,i);
-       if (fFind->GetXyq(1,i) < ymin) ymin = fFind->GetXyq(1,i);
-       if (fFind->GetXyq(1,i) > ymax) ymax = fFind->GetXyq(1,i);
-      }
-      xmin -= fFind->GetXyq(3,minDx); xmax += fFind->GetXyq(3,minDx);
-      ymin -= fFind->GetXyq(4,minDy); ymax += fFind->GetXyq(4,minDy);
-      nx = TMath::Nint ((xmax-xmin)/wxMin/2);
-      ny = TMath::Nint ((ymax-ymin)/wyMin/2);
-      cout << xmin << " " << xmax << " " << nx << " " << ymin << " " << ymax << " " << ny << endl;
-      sprintf(hName,"h%d",cath*2);
-      fHist[cath*2] = new TH2D(hName,"cluster",nx,xmin,xmax,ny,ymin,ymax);
-      for (Int_t i = 0; i < fFind->GetNPads(0)+fFind->GetNPads(1); i++) {
-       if (fFind->GetIJ(0,i) != cath) continue;
-       fHist[cath*2]->Fill(fFind->GetXyq(0,i),fFind->GetXyq(1,i),fFind->GetXyq(2,i));
-      }
-    } else {
-      // different segmentation in the cluster
-      cout << " Different" << endl;
-      cout << fFind->GetXyq(3,minDx) << " " << fFind->GetXyq(3,maxDx) << " " 
-          << fFind->GetXyq(4,minDy) << " " << fFind->GetXyq(4,maxDy) << endl;
-      Int_t nOK = 0;
-      Int_t indx, locMin, locMax;
-      if (TMath::Nint(fFind->GetXyq(3,minDx)*1000) != TMath::Nint(fFind->GetXyq(3,maxDx)*1000)) {
-       // different segmentation along x
-       indx = 0;
-       locMin = minDx;
-       locMax = maxDx;
-      } else {
-       // different segmentation along y
-       indx = 1;
-       locMin = minDy;
-       locMax = maxDy;
-      }
-      Int_t loc = locMin;
-      for (Int_t i = 0; i < 2; i++) {
-       // loop over different pad sizes
-       if (i > 0) loc = locMax;
-       padSize = TMath::Nint(fFind->GetXyq(indx+3,loc)*1000);
-       xmin = 9999; xmax = -9999; ymin = 9999; ymax = -9999;
-       for (Int_t j = 0; j < fFind->GetNPads(0)+fFind->GetNPads(1); j++) {
-         if (fFind->GetIJ(0,j) != cath) continue;
-         if (TMath::Nint(fFind->GetXyq(indx+3,j)*1000) != padSize) continue;
-         nOK++;
-         xmin = TMath::Min (xmin,fFind->GetXyq(0,j));
-         xmax = TMath::Max (xmax,fFind->GetXyq(0,j));
-         ymin = TMath::Min (ymin,fFind->GetXyq(1,j));
-         ymax = TMath::Max (ymax,fFind->GetXyq(1,j));
-       }
-       xmin -= fFind->GetXyq(3,loc); xmax += fFind->GetXyq(3,loc);
-       ymin -= fFind->GetXyq(4,loc); ymax += fFind->GetXyq(4,loc);
-       nx = TMath::Nint ((xmax-xmin)/fFind->GetXyq(3,loc)/2);
-       ny = TMath::Nint ((ymax-ymin)/fFind->GetXyq(4,loc)/2);
-       sprintf(hName,"h%d",cath*2+i);
-       fHist[cath*2+i] = new TH2D(hName,"cluster",nx,xmin,xmax,ny,ymin,ymax);
-       for (Int_t j = 0; j < fFind->GetNPads(0)+fFind->GetNPads(1); j++) {
-         if (fFind->GetIJ(0,j) != cath) continue;
-         if (TMath::Nint(fFind->GetXyq(indx+3,j)*1000) != padSize) continue;
-         fHist[cath*2+i]->Fill(fFind->GetXyq(0,j),fFind->GetXyq(1,j),fFind->GetXyq(2,j));
-       }
-      } // for (Int_t i=0;
-      if (nOK != fFind->GetNPads(cath)) cout << " *** Too many segmentations: nPads, nOK " 
-                                            << fFind->GetNPads(cath) << " " << nOK << endl;
-    } // if (TMath::Nint(fFind->GetXyq(3,minDx)*1000)
-  } // for (Int_t cath = 0;
-       
-  // Draw histograms and coordinates
-  //TH2D *hFake = 0x0;
-  TH2D *hFake = (TH2D*) gROOT->FindObject("hFake");
-  if (hFake) hFake->Delete();
-  if (fModif) {
-    // This part works only after a modification of THistPainter::PaintLego(Option_t *) 
-    // in ROOT
-    Double_t xmin = 9999, ymin = 9999, xmax = -9999, ymax = -9999, aMax = -1;
-    for (Int_t i = 0; i < 4; i++) {
-      if (!fHist[i]) continue;
-      xmin = TMath::Min (xmin, fHist[i]->GetXaxis()->GetXmin());
-      xmax = TMath::Max (xmax, fHist[i]->GetXaxis()->GetXmax());
-      ymin = TMath::Min (ymin, fHist[i]->GetYaxis()->GetXmin());
-      ymax = TMath::Max (ymax, fHist[i]->GetYaxis()->GetXmax());
-      aMax = TMath:: Max (aMax, fHist[i]->GetMaximum());
-    }
-    //if (c1->FindObject("hFake")) delete c1->FindObject("hFake");
-    hFake = new TH2D ("hFake", "hFake", 1, xmin, xmax, 1, ymin, ymax);
-    hFake->SetMaximum(aMax);
-    hFake->SetNdivisions(505,"Z");
-    hFake->SetStats(kFALSE);
-  }
-
-  TObject *stats = 0x0;
-  for (Int_t cath = 0; cath < 2; cath++) {
-    if (cath == 0) ModifyHistos();
-    if (fFind->GetNPads(cath) == 0) continue; // cluster on one cathode only
-    c1->cd(cath+1);
-    gPad->SetTheta(55);
-    gPad->SetPhi(30);
-    if (fModif) {
-      if (fHist[cath*2]) { 
-       fHist[cath*2]->Draw();
-       gPad->Update();
-       stats = fHist[cath*2]->GetListOfFunctions()->FindObject("stats");
-      }
-      hFake->Draw("legoFb");
-    }
-
-    Double_t x, y, x0, y0, r1 = 999, r2 = 0;
-    if (fHist[cath*2+1]) {
-      // 
-      x0 = fHist[cath*2]->GetXaxis()->GetXmin() - 1000*TMath::Cos(30*TMath::Pi()/180);
-      y0 = fHist[cath*2]->GetYaxis()->GetXmin() - 1000*TMath::Sin(30*TMath::Pi()/180);
-      r1 = 0;
-      Int_t ihist=cath*2;
-      for (Int_t iy = 1; iy <= fHist[ihist]->GetNbinsY(); iy++) {
-       y = fHist[ihist]->GetYaxis()->GetBinCenter(iy) 
-         + fHist[ihist]->GetYaxis()->GetBinWidth(iy);
-       for (Int_t ix = 1; ix <= fHist[ihist]->GetNbinsX(); ix++) {
-         if (fHist[ihist]->GetCellContent(ix,iy) > 0.1) {
-           x = fHist[ihist]->GetXaxis()->GetBinCenter(ix)
-             + fHist[ihist]->GetXaxis()->GetBinWidth(ix);
-           r1 = TMath::Max (r1,TMath::Sqrt((x-x0)*(x-x0)+(y-y0)*(y-y0)));
-         }
-       }
-      }
-      ihist = cath*2 + 1 ;
-      for (Int_t iy = 1; iy <= fHist[ihist]->GetNbinsY(); iy++) {
-       y = fHist[ihist]->GetYaxis()->GetBinCenter(iy)
-         + fHist[ihist]->GetYaxis()->GetBinWidth(iy);
-       for (Int_t ix = 1; ix <= fHist[ihist]->GetNbinsX(); ix++) {
-         if (fHist[ihist]->GetCellContent(ix,iy) > 0.1) {
-           x = fHist[ihist]->GetXaxis()->GetBinCenter(ix)
-             + fHist[ihist]->GetXaxis()->GetBinWidth(ix);
-           r2 = TMath::Max (r2,TMath::Sqrt((x-x0)*(x-x0)+(y-y0)*(y-y0)));
-         }
-       }
-      }
-      cout << r1 << " " << r2 << endl;
-    } // if (fHist[cath*2+1])
-    if (r1 > r2) {
-      if (fModif) fHist[cath*2]->Draw("lego1FbSame");
-      else fHist[cath*2]->Draw("lego1Fb");
-      // Draw background contaminated charges
-      //TH2D *hBkg = GetBackground(cath*2);
-      //if (hBkg) hBkg->Draw("lego1FbBbSameAxis");
-      if (fHist[cath*2+1]) fHist[cath*2+1]->Draw("lego1SameAxisBbFb");
-    } else {
-      if (fModif) fHist[cath*2+1]->Draw("lego1FbSame");
-      else fHist[cath*2+1]->Draw("lego1Fb");
-      fHist[cath*2]->Draw("lego1SameAxisFbBb");
-    }
-    c1->Update();
-    if (fModif) stats->Draw();
-  } // for (Int_t cath = 0;
-
-  // Draw simulated and reconstructed hits 
-  // DrawHits();
-}
-/*
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::DrawHits()
-{
-/// Draw simulated and reconstructed hits 
-
-  TView *view[2] = { 0x0, 0x0 };
-  Double_t p1[3]={0}, p2[3], xNDC[6], xl, yl, zl;
-  TLine *line[199] = {0};
-  TCanvas *c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("c1");
-  if (c1) {
-    c1->cd(1);
-    view[0] = c1->Pad()->GetView();
-    c1->cd(2);
-    view[1] = c1->Pad()->GetView();
-  }
-  fData->SetTreeAddress("H RC");
-
-  TH2D *hist = fHist[0] ? fHist[0] : fHist[2];
-  p2[2] = hist->GetMaximum();
-
-  // Draw simulated hits
-  cout << " *** Simulated hits *** " << endl;
-  Int_t ntracks = 0;
-  if (fData->TreeH()) ntracks = (Int_t) fData->GetNtracks();
-  fnMu = 0;
-  Int_t ix, iy, iok, nLine = 0;
-  TClonesArray *hits = NULL;
-  for (Int_t i = 0; i < ntracks; i++) {
-    fData->GetTrack(i);
-    hits = fData->Hits();
-    Int_t nhits = (Int_t) hits->GetEntriesFast();
-    AliMUONHit* mHit;
-    for (Int_t ihit = 0; ihit < nhits; ihit++) {
-      mHit = (AliMUONHit*) hits->UncheckedAt(ihit);
-      if (mHit->Chamber() != fChamber+1) continue;  // chamber number
-      if (mHit->DetElemId() != fidDE) continue;  // det. elem. Id
-      AliMUONClusterInput::Instance()->Segmentation2(0)->GetTransformer()->
-                        Global2Local(fidDE, mHit->X(), mHit->Y(), mHit->Z(), xl, yl, zl);
-      //if (TMath::Abs(zl-fFind->GetZpad()) > 1) continue; // different slat
-      p2[0] = p1[0] = xl;        // x-pos of hit
-      p2[1] = p1[1] = yl;        // y-pos
-      if (p1[0] < hist->GetXaxis()->GetXmin() || 
-         p1[0] > hist->GetXaxis()->GetXmax()) continue;
-      if (p1[1] < hist->GetYaxis()->GetXmin() || 
-         p1[1] > hist->GetYaxis()->GetXmax()) continue;
-      // Check if track comes thru pads with signal
-      iok = 0;
-      for (Int_t ihist = 0; ihist < 4; ihist++) {
-       if (!fHist[ihist]) continue;
-       ix = fHist[ihist]->GetXaxis()->FindBin(p1[0]);
-       iy = fHist[ihist]->GetYaxis()->FindBin(p1[1]);
-       if (fHist[ihist]->GetCellContent(ix,iy) > 0.5) {iok = 1; break;}
-      }
-      if (!iok) continue;
-      gStyle->SetLineColor(1);
-      if (TMath::Abs((Int_t)mHit->Particle()) == 13) {
-       gStyle->SetLineColor(4);
-       if (fnMu < 2) {
-         fxyMu[fnMu][0] = p1[0];
-         fxyMu[fnMu++][1] = p1[1];
-       }
-      }            
-      printf(" Local coord.:  X=%10.4f, Y=%10.4f\n",p1[0],p1[1]);
-      printf(" Global coord.: X=%10.4f, Y=%10.4f, Z=%10.4f\n",mHit->X(),mHit->Y(),mHit->Z());
-      if (view[0] || view[1]) {
-       // Take into account track angles
-       p2[0] += mHit->Tlength() * TMath::Sin(mHit->Theta()/180*TMath::Pi()) 
-                                * TMath::Cos(mHit->Phi()/180*TMath::Pi()) / 2;
-       p2[1] += mHit->Tlength() * TMath::Sin(mHit->Theta()/180*TMath::Pi()) 
-                                * TMath::Sin(mHit->Phi()/180*TMath::Pi()) / 2;
-       for (Int_t ipad = 1; ipad < 3; ipad++) {
-         c1->cd(ipad);
-         if (!view[ipad-1]) continue;
-         view[ipad-1]->WCtoNDC(p1, &xNDC[0]);
-         view[ipad-1]->WCtoNDC(p2, &xNDC[3]);
-         //c1->DrawLine(xpad[0],xpad[1],xpad[3],xpad[4]);
-         line[nLine] = new TLine(xNDC[0],xNDC[1],xNDC[3],xNDC[4]);
-         line[nLine++]->Draw();
-       }
-      }
-    } // for (Int_t ihit = 0; ihit < nhits;
-  } // for (Int_t i = 0; i < ntracks;
-  fData->ResetHits();
-
-  // Draw reconstructed coordinates
-  if (fData->TreeR()) fData->GetRawClusters();
-  TClonesArray *rawclust = fData->RawClusters(fChamber);
-  AliMUONRawCluster *mRaw;
-  gStyle->SetLineColor(3);
-  cout << " *** Reconstructed hits *** " << endl;
-  if (rawclust) {
-    for (Int_t i = 0; i < rawclust ->GetEntriesFast(); i++) {
-      mRaw = (AliMUONRawCluster*)rawclust ->UncheckedAt(i);
-      AliMUONClusterInput::Instance()->Segmentation2(0)->GetTransformer()->
-                   Global2Local(fidDE, mRaw->GetX(0), mRaw->GetY(0), mRaw->GetZ(0), xl, yl, zl);
-      if (TMath::Abs(zl-fFind->GetZpad()) > 1) continue; // different slat
-      p2[0] = p1[0] = xl;        // x-pos of hit
-      p2[1] = p1[1] = yl;        // y-pos
-      if (p1[0] < hist->GetXaxis()->GetXmin() || 
-         p1[0] > hist->GetXaxis()->GetXmax()) continue;
-      if (p1[1] < hist->GetYaxis()->GetXmin() || 
-         p1[1] > hist->GetYaxis()->GetXmax()) continue;
-
-       //treeD->GetEvent(cath);
-       //cout << mRaw->fMultiplicity[0] << mRaw->fMultiplicity[1] << endl;
-       //for (Int_t j=0; j<mRaw->fMultiplicity[cath]; j++) {
-       //Int_t digit = mRaw->fIndexMap[j][cath];
-       //cout << ((AliMUONDigit*)fMuonDigits->UncheckedAt(digit))->Signal() << endl;
-       //}
-
-      // Check if track comes thru pads with signal
-      iok = 0;
-      for (Int_t ihist = 0; ihist < 4; ihist++) {
-       if (!fHist[ihist]) continue;
-       ix = fHist[ihist]->GetXaxis()->FindBin(p1[0]);
-       iy = fHist[ihist]->GetYaxis()->FindBin(p1[1]);
-       if (fHist[ihist]->GetCellContent(ix,iy) > 0.5) {iok = 1; break;}
-      }
-      if (!iok) continue;
-      printf(" Local coord.:  X=%10.4f, Y=%10.4f\n",p1[0],p1[1]);
-      printf(" Global coord.: X=%10.4f, Y=%10.4f, Z=%10.4f\n",mRaw->GetX(0),mRaw->GetY(0),mRaw->GetZ(0));
-      if (view[0] || view[1]) {
-       for (Int_t ipad = 1; ipad < 3; ipad++) {
-         c1->cd(ipad);
-         if (!view[ipad-1]) continue;
-         view[ipad-1]->WCtoNDC(p1, &xNDC[0]);
-         view[ipad-1]->WCtoNDC(p2, &xNDC[3]);
-         line[nLine] = new TLine(xNDC[0],xNDC[1],xNDC[3],xNDC[4]);
-         line[nLine++]->Draw();
-       }
-      }
-    } // for (Int_t i = 0; i < rawclust ->GetEntries();
-  } // if (rawclust)
-  if (fData->TreeR()) fData->ResetRawClusters();
-  c1->Update();
-}
-*/
-//_____________________________________________________________________________
-Int_t AliMUONClusterDrawAZ::Next()
-{
-/// What to do next?
-
-  // File
-  FILE *lun = 0;
-  //lun = fopen("pull.dat","w");
-
-  for (Int_t i = 0; i < fnMu; i++) {
-    // Check again if muon comes thru the used pads (due to extra splitting)
-    for (Int_t j = 0; j < fFind->GetNPads(0)+fFind->GetNPads(1); j++) {
-      if (TMath::Abs(fxyMu[i][0]-fFind->GetXyq(0,j))<fFind->GetXyq(3,j) && 
-         TMath::Abs(fxyMu[i][1]-fFind->GetXyq(1,j))<fFind->GetXyq(4,j)) {
-       if (fDebug) printf("%12.3e %12.3e %12.3e %12.3e\n",fxyMu[i][2],fxyMu[i][3],fxyMu[i][4],fxyMu[i][5]);
-       if (lun) fprintf(lun,"%4d %2d %12.3e %12.3e %12.3e %12.3e\n",fEvent,fChamber,fxyMu[i][2],fxyMu[i][3],fxyMu[i][4],fxyMu[i][5]);
-       break;
-      }
-    }
-  } // for (Int_t i=0; i<fnMu;
-
-  // What's next?
-  char command[8];
-  cout << " What is next? " << endl;
-  command[0] = ' '; 
-  gets(command);
-  if (command[0] == 'n' || command[0] == 'N') { fEvent++; fChamber = fidDE = 0; } // next event
-  else if (command[0] == 'q' || command[0] == 'Q') { if (lun) fclose(lun); } // exit display 
-  else if (command[0] == 'c' || command[0] == 'C') sscanf(command+1,"%d",&fChamber); // new chamber
-  else if (command[0] == 'e' || command[0] == 'E') { sscanf(command+1,"%d",&fEvent); fChamber = fidDE = 0; } // new event
-  else if (command[0] == 'd' || command[0] == 'D') { sscanf(command+1,"%d",&fidDE); fChamber = fidDE / 100 - 1; } // new DetElem.
-  else return 1; // Next precluster
-  return 0;
-}
-
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::ModifyHistos(void)
-{
-/// Modify histograms to bring them to (approximately) the same size
-
-  Int_t nhist = 0;
-  Float_t hlim[4][4], hbin[4][4]; // first index - xmin, xmax, ymin, ymax
-
-  Float_t binMin[4] = {999,999,999,999};
-
-  for (Int_t i = 0; i < 4; i++) {
-    if (!fHist[i]) {
-      hlim[0][i] = hlim[2][i] = 999;
-      hlim[1][i] = hlim[3][i] = -999;
-      continue;
-    }
-    hlim[0][i] = fHist[i]->GetXaxis()->GetXmin(); // xmin
-    hlim[1][i] = fHist[i]->GetXaxis()->GetXmax(); // xmax
-    hlim[2][i] = fHist[i]->GetYaxis()->GetXmin(); // ymin
-    hlim[3][i] = fHist[i]->GetYaxis()->GetXmax(); // ymax
-    hbin[0][i] = hbin[1][i] = fHist[i]->GetXaxis()->GetBinWidth(1);
-    hbin[2][i] = hbin[3][i] = fHist[i]->GetYaxis()->GetBinWidth(1);
-    binMin[0] = TMath::Min(binMin[0],hbin[0][i]);
-    binMin[2] = TMath::Min(binMin[2],hbin[2][i]);
-    nhist++;
-  }
-  binMin[1] = binMin[0];
-  binMin[3] = binMin[2];
-  cout << " Nhist: " << nhist << endl;
-
-  // Adjust histo limits for cathode with different segmentation
-  for (Int_t i = 0; i < 4; i+=2) {
-    if (!fHist[i+1]) continue;
-    Int_t imin, imax, i1 = i + 1;
-    for (Int_t lim = 0; lim < 4; lim++) {
-      while (1) {
-       if (hlim[lim][i] < hlim[lim][i1]) {
-         imin = i;
-         imax = i1;
-       } else {
-         imin = i1;
-         imax = i;
-       }
-       if (TMath::Abs(hlim[lim][imin]-hlim[lim][imax])<0.01*binMin[lim]) break;
-       if (lim == 0 || lim == 2) {
-         // find lower limit
-         hlim[lim][imax] -= hbin[lim][imax];
-       } else {
-         // find upper limit
-         hlim[lim][imin] += hbin[lim][imin];
-       }
-      } // while (1)
-    }
-  }
-    
-
-  Int_t imnmx = 0, nExtra = 0;
-  for (Int_t lim = 0; lim < 4; lim++) {
-    if (lim == 0 || lim == 2) imnmx = TMath::LocMin(4,hlim[lim]); // find lower limit
-    else imnmx = TMath::LocMax(4,hlim[lim]); // find upper limit
-
-    // Adjust histogram limit
-    for (Int_t i = 0; i < 4; i++) {
-      if (!fHist[i]) continue;
-      nExtra = TMath::Nint ((hlim[lim][imnmx]-hlim[lim][i]) / hbin[lim][i]);
-      hlim[lim][i] += nExtra * hbin[lim][i];
-    }
-  }
-    
-  // Rebuild histograms 
-  TH2D *hist = 0;
-  Int_t nx, ny;
-  Double_t x, y, cont, cmax=0;
-  char hName[4];
-  for (Int_t ihist = 0; ihist < 4; ihist++) {
-    if (!fHist[ihist]) continue;
-    nx = TMath::Nint((hlim[1][ihist]-hlim[0][ihist])/hbin[0][ihist]);
-    ny = TMath::Nint((hlim[3][ihist]-hlim[2][ihist])/hbin[2][ihist]);
-    cout << ihist << " " << hlim[0][ihist] << " " << hlim[1][ihist] << " " << nx;
-    cout << " " << hlim[2][ihist] << " " << hlim[3][ihist] << " " << ny << endl;
-    sprintf(hName,"hh%d",ihist);
-    hist =  new TH2D(hName,"hist",nx,hlim[0][ihist],hlim[1][ihist],ny,hlim[2][ihist],hlim[3][ihist]);
-    for (Int_t i=1; i<=fHist[ihist]->GetNbinsX(); i++) {
-      x = fHist[ihist]->GetXaxis()->GetBinCenter(i);
-      for (Int_t j=1; j<=fHist[ihist]->GetNbinsY(); j++) {
-       y = fHist[ihist]->GetYaxis()->GetBinCenter(j);
-       cont = fHist[ihist]->GetCellContent(i,j);
-       hist->Fill(x,y,cont);
-      }
-    }
-    cmax = TMath::Max (cmax,hist->GetMaximum());
-    sprintf(hName,"%s%d",fHist[ihist]->GetName(),ihist);
-    fHist[ihist]->Delete();
-    fHist[ihist] = new TH2D(*hist);
-    fHist[ihist]->SetName(hName);
-    fHist[ihist]->SetNdivisions(505,"Z");
-    hist->Delete(); 
-  }
-  if (fDebug) printf("%f \n",cmax);
-
-  for (Int_t ihist = 0; ihist < 4; ihist++) {
-    if (!fHist[ihist]) continue;
-    fHist[ihist]->SetMaximum(cmax);
-    fHist[ihist]->SetMinimum(0);
-  }
-}
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::AdjustHist(Double_t *xylim, const AliMUONPixel *pixPtr)
-{
-/// Adjust histogram limits for pixel drawing
-
-  Float_t xypads[4];
-  if (fHist[0]) {
-    xypads[0] = fHist[0]->GetXaxis()->GetXmin();
-    xypads[1] = -fHist[0]->GetXaxis()->GetXmax();
-    xypads[2] = fHist[0]->GetYaxis()->GetXmin();
-    xypads[3] = -fHist[0]->GetYaxis()->GetXmax();
-    for (Int_t i = 0; i < 4; i++) {
-      while(1) {
-       if (xylim[i] < xypads[i]) break;
-       xylim[i] -= 2*pixPtr->Size(i/2);
-      }
-    }
-  } 
-}
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::DrawHist(const char* canvas, TH2D *hist)
-{
-/// Draw histogram in given canvas 
-
-  Int_t ix = 0;
-  //((TCanvas*)gROOT->FindObject("c2"))->cd();
-  ((TCanvas*)gROOT->FindObject(canvas))->cd();
-  gPad->SetTheta(55);
-  gPad->SetPhi(30);
-  hist->Draw("lego1Fb");
-  gPad->Update();
-  //gets((char*)&ix);
-  if (fnMu) gets((char*)&ix);
-}
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::FillMuon(Int_t nfit, const Double_t *parOk, const Double_t *errOk)
-{
-/// Fill muon information
-
-  Int_t indx, imax;
-  Double_t cmax, rad;
-  for (Int_t i = 0; i < fnMu; i++) {
-    cmax = fxyMu[i][6];
-    for (Int_t j = 0; j < nfit; j++) {
-      indx = j<2 ? j*2 : j*2+1;  
-      rad = (fxyMu[i][0]-parOk[indx])*(fxyMu[i][0]-parOk[indx]) +
-            (fxyMu[i][1]-parOk[indx+1])*(fxyMu[i][1]-parOk[indx+1]);
-      if (rad < cmax) {
-       cmax = rad; 
-       imax = indx;
-       fxyMu[i][6] = cmax;
-       fxyMu[i][2] = parOk[imax] - fxyMu[i][0];
-       fxyMu[i][4] = parOk[imax+1] - fxyMu[i][1];
-       fxyMu[i][3] = errOk[imax];
-       fxyMu[i][5] = errOk[imax+1];
-      }
-    }      
-  }
-}
-
-//_____________________________________________________________________________
-void AliMUONClusterDrawAZ::UpdateCluster(Int_t npad)
-{
-/// Update cluster after removing non-overlapped pads
-
-  Int_t cath = 0, ix = 0, iy = 0;
-  cout << " Update cluster " << endl;
-  gets((char*)&ix);
-  for (Int_t i = 0; i < npad; i++) {
-    if (TMath::Nint (fFind->GetXyq(2,i)) != -2) continue;
-    cath = fFind->GetIJ(0,i);
-    for (Int_t j = 0; j < 2; j++) {
-      Int_t ihist = cath * 2 + j;
-      if (!fHist[ihist]) continue;
-      ix = fHist[ihist]->GetXaxis()->FindBin(fFind->GetXyq(0,i));
-      iy = fHist[ihist]->GetYaxis()->FindBin(fFind->GetXyq(1,i));
-      Double_t cont = fHist[ihist]->GetCellContent(ix, iy);
-      if (cont < 0.1) continue;
-      fHist[ihist]->Fill(fFind->GetXyq(0,i), fFind->GetXyq(1,i), -cont);
-    }
-  }
-  TCanvas *c1 = (TCanvas*) gROOT->GetListOfCanvases()->FindObject("c1");
-  if (c1) {
-    c1->cd(1);
-    gPad->Modified();
-    gPad->Update();
-    c1->cd(2);
-    gPad->Modified();
-    gPad->Update();
-  }  
-}
-
-//_____________________________________________________________________________
-TH2D* AliMUONClusterDrawAZ::GetBackground(Int_t iHist)
-{
-/// Build histogram with pads from the cluster contaminated by the background
-
-  //return 0x0;
-  Int_t cath = iHist / 2;
-  Double_t xmin = fHist[iHist]->GetXaxis()->GetXmin();
-  Double_t xmax = fHist[iHist]->GetXaxis()->GetXmax();
-  Double_t ymin = fHist[iHist]->GetYaxis()->GetXmin();
-  Double_t ymax = fHist[iHist]->GetYaxis()->GetXmax();
-  
-  // Create histogram
-  char hName[4];
-  sprintf(hName,"Bkg%1d",iHist);
-  TH2D *hist = (TH2D*) gROOT->FindObject(hName);
-  if (hist) hist->Delete();
-  hist = (TH2D*) fHist[iHist]->Clone(hName);
-  hist->Reset();
-
-  // Loop over pads
-  Int_t digit = 0, iok = 0, ix = 0, iy = 0; 
-  AliMUONDigit *mdig = 0x0;
-  Double_t cont = 0, x = 0, y = 0; 
-  for (Int_t i = 0; i < fFind->GetNPads(0)+fFind->GetNPads(1); i++) {
-    if (fFind->GetIJ(0,i) != cath) continue;
-    x = fFind->GetXyq(0,i);
-    y = fFind->GetXyq(1,i);
-    if (x < xmin || x > xmax) continue;
-    if (y < ymin || y > ymax) continue;
-    digit = fFind->GetIJ(4,i);
-    if (digit >= 0) mdig = AliMUONClusterInput::Instance()->Digit(cath, digit);
-    else mdig = AliMUONClusterInput::Instance()->Digit(TMath::Even(cath), -digit-1);
-    if (mdig->Track(1) >= 0 || mdig->Track(0) >= 10000000) {
-      ix = fHist[iHist]->GetXaxis()->FindBin(x);
-      iy = fHist[iHist]->GetYaxis()->FindBin(y);
-      cont = fHist[iHist]->GetCellContent(ix, iy);
-      hist->Fill(x, y, cont);
-      iok = 1;
-    }
-  }
-  if (iok) { 
-    hist->SetFillColor(5); 
-    hist->SetMaximum(fHist[iHist]->GetMaximum());
-    return hist; 
-  }
-  return 0x0;
-}
diff --git a/MUON/AliMUONClusterDrawAZ.h b/MUON/AliMUONClusterDrawAZ.h
deleted file mode 100644 (file)
index 8c3f030..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef ALIMUONCLUSTERDRAWAZ_H
-#define ALIMUONCLUSTERDRAWAZ_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup rec
-/// \class AliMUONClusterDrawAZ
-/// \brief Cluster drawing object for AZ cluster finder in MUON arm of ALICE
-///
-/// \author Alexander Zinchenko, JINR Dubna
-
-#include "AliMUONClusterDrawAZ.h"
-
-class TH2D;
-class AliMUONRecData;
-class AliMUONPixel;
-class AliMUONClusterFinderAZ;
-
-class AliMUONClusterDrawAZ : public TObject 
-{
-public:
-  AliMUONClusterDrawAZ(); // default constructor
-  AliMUONClusterDrawAZ(AliMUONClusterFinderAZ *clusFinder); // Constructor
-  virtual ~AliMUONClusterDrawAZ(); // Destructor
-
-  void     DrawCluster(); // draw precluster
-  void     AdjustHist(Double_t *xylim, const AliMUONPixel *pixPtr);
-  void     DrawHist(const char* canvas, TH2D *hist); // draw histogram in canvas
-  Int_t    Next(); // commands for drawing
-  Bool_t   FindEvCh(Int_t nev, Int_t ch); // find requested event and chamber
-  void     FillMuon(Int_t nfit, const Double_t *parOk, const Double_t *errOk); // fill muon info
-  void     ResetMuon() { fxyMu[0][6] = fxyMu[1][6] = 9999; } ///< reset muons
-  void     UpdateCluster(Int_t npad); // update cluster after removing non-overlapped pads
-
-private:
-  AliMUONRecData *fData; //!<  pointer to muon data container
-  AliMUONClusterFinderAZ* fFind; //!<  pointer to ClusterFinder
-  TH2D*      fHist[4]; //!<  histograms
-  Int_t      fnMu; //!<  number of muons passing thru the selected area
-  Double_t   fxyMu[2][7]; //!<  muon information
-  Int_t      fEvent; //!<  current event
-  Int_t      fChamber; //!<  current chamber
-  Int_t      fidDE; //!<  current Det. Elem.
-  Int_t      fDebug; //!<  debug level
-  Int_t      fModif; //!<  modification flag (modified ROOT)
-
-  // Functions
-
-  /// Not implemented
-  AliMUONClusterDrawAZ(const AliMUONClusterDrawAZ& rhs);
-  /// Not implemented
-  AliMUONClusterDrawAZ& operator=(const AliMUONClusterDrawAZ& rhs);
-
-  void   Init(); // initialization
-  void   ModifyHistos(); // modify histograms
-  // void   DrawHits(); // draw simulated and reconstructed hits
-  TH2D*  GetBackground(Int_t iHist); // build histogram with bkg. contaminated pads
-
-ClassDef(AliMUONClusterDrawAZ,0) // cluster drawing for MUON arm of ALICE
-};
-
-#endif
diff --git a/MUON/AliMUONClusterFinderVS.cxx b/MUON/AliMUONClusterFinderVS.cxx
deleted file mode 100644 (file)
index 883d3c3..0000000
+++ /dev/null
@@ -1,2102 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -------------------------------
-// Class AliMUONClusterFinderVS
-// -------------------------------
-// Class for clustering and reconstruction of space points
-// (Not used by default)
-
-#include "AliMUONClusterFinderVS.h"
-#include "AliMUONDigit.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONGeometrySegmentation.h"
-#include "AliMUONMathieson.h"
-#include "AliMUONClusterInput.h"
-#include "AliMUONDigitMapA1.h"
-
-#include "AliLog.h"
-
-#include <TMinuit.h> 
-#include <TF1.h>
-#include <TMinuit.h> 
-#include <Riostream.h>
-
-
-//_____________________________________________________________________
-// This function is minimized in the double-Mathieson fit
-void fcnS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
-void fcnS1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
-void fcnCombiS1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
-void fcnCombiS2(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
-
-/// \cond CLASSIMP
-ClassImp(AliMUONClusterFinderVS)
-/// \endcond
-
-AliMUONClusterFinderVS::AliMUONClusterFinderVS()
-  : TObject(),
-    fInput(AliMUONClusterInput::Instance()),
-    fDeclusterFlag(0),
-    fClusterSize(0),
-    fNperMax(0),
-    fGhostChi2Cut(1e6),
-    fNPeaks(0),
-    fNRawClusters(0),
-    fRawClusters(0x0),
-    fZPlane(0.),
-    fSector(0),
-    fFitStat(0),
-    fEvtNumber(0)
-{
-/// Default constructor
-    fDigitMap[0] = 0;
-    fDigitMap[1] = 0;
-    fTrack[0]=fTrack[1]=-1;
-    fSeg2[0]    = 0;
-    fSeg2[1]    = 0;
-
-    for(Int_t i=0; i<100; i++) {
-      for (Int_t j=0; j<2; j++) {
-        fDig[i][j] = 0;
-      }
-    } 
-    fRawClusters = new TClonesArray("AliMUONRawCluster",1000);
-}
- //____________________________________________________________________________
-AliMUONClusterFinderVS::~AliMUONClusterFinderVS()
-{
-/// Destructor
-
-  // Reset tracks information
-   fNRawClusters = 0;
-   if (fRawClusters) {
-     fRawClusters->Delete();
-     delete fRawClusters;
-   }
-}
-
-//____________________________________________________________________________
-void AliMUONClusterFinderVS::ResetRawClusters()
-{
-/// Reset tracks information
-  fNRawClusters = 0;
-  if (fRawClusters) fRawClusters->Clear();
-}
-//____________________________________________________________________________
-void AliMUONClusterFinderVS::Decluster(AliMUONRawCluster *cluster)
-{
-/// Decluster by local maxima
-    SplitByLocalMaxima(cluster);
-}
-//____________________________________________________________________________
-void AliMUONClusterFinderVS::SplitByLocalMaxima(AliMUONRawCluster *c)
-{
-/// Split complex cluster by local maxima 
-    Int_t cath, i;
-
-    fInput->SetCluster(c);
-
-    fMul[0]=c->GetMultiplicity(0);
-    fMul[1]=c->GetMultiplicity(1);
-
-//
-//  dump digit information into arrays
-//
-
-    Float_t qtot;
-    
-    for (cath=0; cath<2; cath++) {
-      qtot=0;
-
-      for (i=0; i<fMul[cath]; i++) {
-       // pointer to digit
-       fDig[i][cath]=fInput->Digit(cath, c->GetIndex(i, cath));
-       // pad coordinates
-       fIx[i][cath]= fDig[i][cath]->PadX();
-       fIy[i][cath]= fDig[i][cath]->PadY();
-       // pad charge
-       fQ[i][cath] = fDig[i][cath]->Signal();
-       // pad centre coordinates
-         fSeg2[cath]->
-           GetPadC(fInput->DetElemId(), fIx[i][cath], fIy[i][cath], fX[i][cath], fY[i][cath], fZ[i][cath]);
-      } // loop over cluster digits
-
-    }  // loop over cathodes
-
-
-    FindLocalMaxima(c);
-
-//
-//  Initialise and perform mathieson fits
-    Float_t chi2, oldchi2;
-//  ++++++++++++++++++*************+++++++++++++++++++++
-//  (1) No more than one local maximum per cathode plane 
-//  +++++++++++++++++++++++++++++++*************++++++++
-    if ((fNLocal[0]==1 && (fNLocal[1]==0 ||  fNLocal[1]==1)) || 
-       (fNLocal[0]==0 && fNLocal[1]==1)) {
-// Perform combined single Mathieson fit
-// Initial values for coordinates (x,y) 
-
-       // One local maximum on cathodes 1 and 2 (X->cathode 2, Y->cathode 1)
-       if (fNLocal[0]==1 &&  fNLocal[1]==1) {
-           fXInit[0]=c->GetX(1);
-           fYInit[0]=c->GetY(0);
-           // One local maximum on cathode 1 (X,Y->cathode 1)
-       } else if (fNLocal[0]==1) {
-           fXInit[0]=c->GetX(0);
-           fYInit[0]=c->GetY(0);
-           // One local maximum on cathode 2  (X,Y->cathode 2)
-       } else {
-           fXInit[0]=c->GetX(1);
-           fYInit[0]=c->GetY(1);
-       }
-       AliDebug(1,"cas (1) CombiSingleMathiesonFit(c)");
-       chi2=CombiSingleMathiesonFit(c);
-//     Int_t ndf = fgNbins[0]+fgNbins[1]-2;
-//     Float_t prob = TMath::Prob(Double_t(chi2),ndf);
-//     prob1->Fill(prob);
-//     chi2_1->Fill(chi2);
-       oldchi2=chi2;
-       AliDebug(1,Form(" chi2 %f ",chi2));        
-
-       c->SetX(0, fXFit[0]);
-       c->SetY(0, fYFit[0]);
-
-       c->SetX(1,fXFit[0]);
-       c->SetY(1,fYFit[0]);
-       c->SetChi2(0,chi2);
-       c->SetChi2(1,chi2);
-        // Force on anod
-
-       c->SetX(0, fSeg2[0]->GetAnod(fInput->DetElemId(), c->GetX(0)));
-       c->SetX(1, fSeg2[1]->GetAnod(fInput->DetElemId(), c->GetX(1)));
-
-       //      c->SetDetElemId(fInput->DetElemId());
-       // If reasonable chi^2 add result to the list of rawclusters
-       if (chi2 < 0.3) {
-           AddRawCluster(*c);
-           // If not try combined double Mathieson Fit
-       } else {
-               AliDebug(1," MAUVAIS CHI2 !!!\n");
-           if (fNLocal[0]==1 &&  fNLocal[1]==1) {
-               fXInit[0]=fX[fIndLocal[0][1]][1];
-               fYInit[0]=fY[fIndLocal[0][0]][0];
-               fXInit[1]=fX[fIndLocal[0][1]][1];
-               fYInit[1]=fY[fIndLocal[0][0]][0];
-           } else if (fNLocal[0]==1) {
-               fXInit[0]=fX[fIndLocal[0][0]][0];
-               fYInit[0]=fY[fIndLocal[0][0]][0];
-               fXInit[1]=fX[fIndLocal[0][0]][0];
-               fYInit[1]=fY[fIndLocal[0][0]][0];
-           } else {
-               fXInit[0]=fX[fIndLocal[0][1]][1];
-               fYInit[0]=fY[fIndLocal[0][1]][1];
-               fXInit[1]=fX[fIndLocal[0][1]][1];
-               fYInit[1]=fY[fIndLocal[0][1]][1];
-           }
-           
-//  Initial value for charge ratios
-           fQrInit[0]=0.5;
-           fQrInit[1]=0.5;
-           AliDebug(1,"\n cas (1) CombiDoubleMathiesonFit(c)\n");
-           chi2=CombiDoubleMathiesonFit(c);
-//         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//         Float_t prob = TMath::Prob(chi2,ndf);
-//         prob2->Fill(prob);
-//         chi2_2->Fill(chi2);
-           
-// Was this any better ??
-           AliDebug(1,Form(" Old and new chi2 %f %f ", oldchi2, chi2));
-           if (fFitStat!=0 && chi2>0 && (2.*chi2 < oldchi2)) {
-             AliDebug(1,"Split");
-               // Split cluster into two according to fit result
-               Split(c);
-           } else {
-             AliDebug(1,"Do not Split");
-               // Don't split
-             AddRawCluster(*c);
-           }
-       }
-
-//  +++++++++++++++++++++++++++++++++++++++
-//  (2) Two local maxima per cathode plane 
-//  +++++++++++++++++++++++++++++++++++++++
-    } else if (fNLocal[0]==2 &&  fNLocal[1]==2) {
-//
-//  Let's look for ghosts first 
-
-       Float_t xm[4][2], ym[4][2];
-       Float_t dpx, dpy, dx, dy;
-       Int_t ixm[4][2], iym[4][2];
-       Int_t isec, im1, im2, ico;
-//
-//  Form the 2x2 combinations
-//  0-0, 0-1, 1-0, 1-1 
-        ico=0;
-       for (im1=0; im1<2; im1++) {
-           for (im2=0; im2<2; im2++) {     
-               xm[ico][0]=fX[fIndLocal[im1][0]][0];
-               ym[ico][0]=fY[fIndLocal[im1][0]][0];
-               xm[ico][1]=fX[fIndLocal[im2][1]][1];
-               ym[ico][1]=fY[fIndLocal[im2][1]][1];
-
-               ixm[ico][0]=fIx[fIndLocal[im1][0]][0];
-               iym[ico][0]=fIy[fIndLocal[im1][0]][0];
-               ixm[ico][1]=fIx[fIndLocal[im2][1]][1];
-               iym[ico][1]=fIy[fIndLocal[im2][1]][1];
-               ico++;
-           }
-       }
-// ico = 0 : first local maximum on cathodes 1 and 2
-// ico = 1 : fisrt local maximum on cathode 1 and second on cathode 2
-// ico = 2 : second local maximum on cathode 1 and first on cathode 1
-// ico = 3 : second local maximum on cathodes 1 and 2
-
-// Analyse the combinations and keep those that are possible !
-// For each combination check consistency in x and y   
-       Int_t   iacc;
-       Bool_t  accepted[4];
-       Float_t dr[4] = {1.e4, 1.e4, 1.e4, 1.e4};
-       iacc=0;
-
-// In case of staggering maxima are displaced by exactly half the pad-size in y. 
-// We have to take into account the numerical precision in the consistency check;      
-       Float_t eps = 1.e-5;
-//
-       for (ico=0; ico<4; ico++) {
-           accepted[ico]=kFALSE;
-// cathode one: x-coordinate
-           isec=fSeg2[0]->Sector(fInput->DetElemId(), ixm[ico][0], iym[ico][0]);
-           dpx=fSeg2[0]->Dpx(fInput->DetElemId(), isec)/2.;
-          
-           dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
-// cathode two: y-coordinate
-
-           isec=fSeg2[1]->Sector(fInput->DetElemId(), ixm[ico][1], iym[ico][1]);
-           dpy=fSeg2[1]->Dpy(fInput->DetElemId(), isec)/2.;
-           
-           dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
-           AliDebug(2,Form("\n %i %f %f %f %f %f %f \n", ico, ym[ico][0], ym[ico][1], dy, dpy, dx, dpx ));
-           if ((dx <= dpx) && (dy <= dpy+eps)) {
-               // consistent
-               accepted[ico]=kTRUE;
-               dr[ico] = TMath::Sqrt(dx*dx+dy*dy);
-               iacc++;
-           } else {
-               // reject
-               accepted[ico]=kFALSE;
-           }
-       }
-       AliDebug(1,Form("\n iacc= %d:\n", iacc));
-       if (iacc == 3) {
-           if (accepted[0] && accepted[1]) {
-               if (dr[0] >= dr[1]) {
-                   accepted[0]=kFALSE;
-               } else {
-                   accepted[1]=kFALSE;
-               }
-           }
-
-           if (accepted[2] && accepted[3]) {
-               if (dr[2] >= dr[3]) {
-                   accepted[2]=kFALSE;
-               } else {
-                   accepted[3]=kFALSE;
-               }
-           }
-/*         
-// eliminate one candidate
-           Float_t drmax = 0;
-           Int_t icobad = -1;
-
-           for (ico=0; ico<4; ico++) {
-               if (accepted[ico] && dr[ico] > drmax) {
-                   icobad = ico;
-                   drmax  = dr[ico];
-               }
-           }
-           
-           accepted[icobad] = kFALSE;
-*/
-           iacc = 2;
-       }
-       
-       
-       AliDebug(1,Form("\n iacc= %d:\n", iacc));
-       if (iacc==2) {
-               AliDebug(1,"\n iacc=2: No problem ! \n");
-       } else if (iacc==4) {
-               AliDebug(1,"\n iacc=4: Ok, but ghost problem !!! \n");
-       } else if (iacc==0) {
-               AliDebug(1,"\n iacc=0: I don't know what to do with this !!!!!!!!! \n");
-       }
-
-//  Initial value for charge ratios
-       fQrInit[0]=Float_t(fQ[fIndLocal[0][0]][0])/
-           Float_t(fQ[fIndLocal[0][0]][0]+fQ[fIndLocal[1][0]][0]);
-       fQrInit[1]=Float_t(fQ[fIndLocal[0][1]][1])/
-           Float_t(fQ[fIndLocal[0][1]][1]+fQ[fIndLocal[1][1]][1]);
-       
-// ******* iacc = 0 *******
-// No combinations found between the 2 cathodes
-// We keep the center of gravity of the cluster
-       if (iacc==0) {
-         AddRawCluster(*c);
-       }
-
-// ******* iacc = 1 *******
-// Only one combination found between the 2 cathodes
-       if (iacc==1) {
-// Initial values for the 2 maxima (x,y)
-
-// 1 maximum is initialised with the maximum of the combination found (X->cathode 2, Y->cathode 1)
-// 1 maximum is initialised with the other maximum of the first cathode  
-           if (accepted[0]){
-               AliDebug(1,"ico=0");
-               fXInit[0]=xm[0][1];
-               fYInit[0]=ym[0][0];
-               fXInit[1]=xm[3][0];
-               fYInit[1]=ym[3][0];
-           } else if (accepted[1]){
-               AliDebug(1,"ico=1");
-               fXInit[0]=xm[1][1];
-               fYInit[0]=ym[1][0];
-               fXInit[1]=xm[2][0];
-               fYInit[1]=ym[2][0];
-           } else if (accepted[2]){
-               AliDebug(1,"ico=2");
-               fXInit[0]=xm[2][1];
-               fYInit[0]=ym[2][0];
-               fXInit[1]=xm[1][0];
-               fYInit[1]=ym[1][0];
-           } else if (accepted[3]){
-               AliDebug(1,"ico=3");
-               fXInit[0]=xm[3][1];
-               fYInit[0]=ym[3][0];
-               fXInit[1]=xm[0][0];
-               fYInit[1]=ym[0][0];
-           }
-               AliDebug(1,"cas (2) CombiDoubleMathiesonFit(c)");
-           chi2=CombiDoubleMathiesonFit(c);
-//         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//         Float_t prob = TMath::Prob(chi2,ndf);
-//         prob2->Fill(prob);
-//         chi2_2->Fill(chi2);
-           AliDebug(1,Form(" chi2 %f\n",chi2));
-
-// If reasonable chi^2 add result to the list of rawclusters
-           if (chi2<10) {
-               Split(c);
-
-           } else {
-// 1 maximum is initialised with the maximum of the combination found (X->cathode 2, Y->cathode 1)
-// 1 maximum is initialised with the other maximum of the second cathode  
-               if (accepted[0]){
-                       AliDebug(1,"ico=0");
-                   fXInit[0]=xm[0][1];
-                   fYInit[0]=ym[0][0];
-                   fXInit[1]=xm[3][1];
-                   fYInit[1]=ym[3][1];
-               } else if (accepted[1]){
-                       AliDebug(1,"ico=1");
-                   fXInit[0]=xm[1][1];
-                   fYInit[0]=ym[1][0];
-                   fXInit[1]=xm[2][1];
-                   fYInit[1]=ym[2][1];
-               } else if (accepted[2]){
-                       AliDebug(1,"ico=2");
-                   fXInit[0]=xm[2][1];
-                   fYInit[0]=ym[2][0];
-                   fXInit[1]=xm[1][1];
-                   fYInit[1]=ym[1][1];
-               } else if (accepted[3]){
-                       AliDebug(1,"ico=3");
-                   fXInit[0]=xm[3][1];
-                   fYInit[0]=ym[3][0];
-                   fXInit[1]=xm[0][1];
-                   fYInit[1]=ym[0][1];
-               }
-               AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
-               chi2=CombiDoubleMathiesonFit(c);
-//             Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//             Float_t prob = TMath::Prob(chi2,ndf);
-//             prob2->Fill(prob);
-//             chi2_2->Fill(chi2);
-               AliDebug(1,Form(" chi2 %f\n",chi2));
-
-// If reasonable chi^2 add result to the list of rawclusters
-               if (chi2<10) {
-                   Split(c);
-               } else {
-//We keep only the combination found (X->cathode 2, Y->cathode 1)
-                   for (Int_t ico=0; ico<2; ico++) {
-                       if (accepted[ico]) {
-                           AliMUONRawCluster cnew;
-                           Int_t cath;    
-                           for (cath=0; cath<2; cath++) {
-                               cnew.SetX(cath, Float_t(xm[ico][1]));
-                               cnew.SetY(cath, Float_t(ym[ico][0]));
-                               cnew.SetZ(cath, fZPlane);
-                               cnew.SetMultiplicity(cath,c->GetMultiplicity(cath));
-                               for (i=0; i<fMul[cath]; i++) {
-                                 cnew.SetIndex(i, cath, c->GetIndex(i,cath));
-                                 fSeg2[cath]->SetPad(fInput->DetElemId(), fIx[i][cath], fIy[i][cath]);
-                               }
-                               AliDebug(1,Form("\nRawCluster %d cath %d\n",ico,cath));
-                               AliDebug(1,Form("mult_av %d\n",c->GetMultiplicity(cath)));
-                               FillCluster(&cnew,cath);
-                           } 
-                           cnew.SetClusterType(cnew.PhysicsContribution());
-                           AddRawCluster(cnew);
-                           fNPeaks++;
-                       }
-                   }
-               }
-           }
-       }
-       
-// ******* iacc = 2 *******
-// Two combinations found between the 2 cathodes
-       if (iacc==2) {
-// Was the same maximum taken twice
-           if ((accepted[0]&&accepted[1]) || (accepted[2]&&accepted[3])) {
-               AliDebug(1,"\n Maximum taken twice !!!\n");
-
-// Have a try !! with that
-               if (accepted[0]&&accepted[3]) {
-                   fXInit[0]=xm[0][1];
-                   fYInit[0]=ym[0][0];
-                   fXInit[1]=xm[1][1];
-                   fYInit[1]=ym[1][0];
-               } else {
-                   fXInit[0]=xm[2][1];
-                   fYInit[0]=ym[2][0];
-                   fXInit[1]=xm[3][1];
-                   fYInit[1]=ym[3][0];
-               }
-               AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
-               chi2=CombiDoubleMathiesonFit(c);
-//                 Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//                 Float_t prob = TMath::Prob(chi2,ndf);
-//                 prob2->Fill(prob);
-//                 chi2_2->Fill(chi2);
-               Split(c);
-               
-           } else {
-// No ghosts ! No Problems ! -  Perform one fit only !
-               if (accepted[0]&&accepted[3]) {
-                   fXInit[0]=xm[0][1];
-                   fYInit[0]=ym[0][0];
-                   fXInit[1]=xm[3][1];
-                   fYInit[1]=ym[3][0];
-               } else {
-                   fXInit[0]=xm[1][1];
-                   fYInit[0]=ym[1][0];
-                   fXInit[1]=xm[2][1];
-                   fYInit[1]=ym[2][0];
-               }
-               AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
-               chi2=CombiDoubleMathiesonFit(c);
-//                 Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//                 Float_t prob = TMath::Prob(chi2,ndf);
-//                 prob2->Fill(prob);
-//                 chi2_2->Fill(chi2);
-               AliDebug(1,Form(" chi2 %f\n",chi2));
-               Split(c);
-           }
-           
-// ******* iacc = 4 *******
-// Four combinations found between the 2 cathodes
-// Ghost !!
-       } else if (iacc==4) {
-// Perform fits for the two possibilities !!   
-// Accept if charges are compatible on both cathodes
-// If none are compatible, keep everything
-           fXInit[0]=xm[0][1];
-           fYInit[0]=ym[0][0];
-           fXInit[1]=xm[3][1];
-           fYInit[1]=ym[3][0];
-           AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
-           chi2=CombiDoubleMathiesonFit(c);
-//             Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//             Float_t prob = TMath::Prob(chi2,ndf);
-//             prob2->Fill(prob);
-//             chi2_2->Fill(chi2);
-           AliDebug(1,Form(" chi2 %f\n",chi2));
-           // store results of fit and postpone decision
-           Double_t sXFit[2],sYFit[2],sQrFit[2];
-           Float_t sChi2[2];
-           for (Int_t i=0;i<2;i++) {
-               sXFit[i]=fXFit[i];
-               sYFit[i]=fYFit[i];
-               sQrFit[i]=fQrFit[i];
-               sChi2[i]=fChi2[i];
-           }
-           fXInit[0]=xm[1][1];
-           fYInit[0]=ym[1][0];
-           fXInit[1]=xm[2][1];
-           fYInit[1]=ym[2][0];
-           AliDebug(1,"\n cas (2) CombiDoubleMathiesonFit(c)\n");
-           chi2=CombiDoubleMathiesonFit(c);
-//             ndf = fgNbins[0]+fgNbins[1]-6;
-//             prob = TMath::Prob(chi2,ndf);
-//             prob2->Fill(prob);
-//             chi2_2->Fill(chi2);
-           AliDebug(1,Form(" chi2 %f\n",chi2));
-           // We have all informations to perform the decision
-           // Compute the chi2 for the 2 possibilities
-           Float_t chi2fi,chi2si,chi2f,chi2s;
-
-           chi2f = (TMath::Log(fInput->TotalCharge(0)*fQrFit[0]
-                 /  (fInput->TotalCharge(1)*fQrFit[1]) )
-                 / fInput->ChargeCorrel() );
-           chi2f *=chi2f;
-           chi2fi = (TMath::Log(fInput->TotalCharge(0)*(1-fQrFit[0])
-                 /  (fInput->TotalCharge(1)*(1-fQrFit[1])) )
-                 / fInput->ChargeCorrel() );
-           chi2f += chi2fi*chi2fi;
-
-           chi2s = (TMath::Log(fInput->TotalCharge(0)*sQrFit[0]
-                 /  (fInput->TotalCharge(1)*sQrFit[1]) )
-                 / fInput->ChargeCorrel() );
-           chi2s *=chi2s;
-           chi2si = (TMath::Log(fInput->TotalCharge(0)*(1-sQrFit[0])
-                 /  (fInput->TotalCharge(1)*(1-sQrFit[1])) )
-                 / fInput->ChargeCorrel() );
-           chi2s += chi2si*chi2si;
-
-           // usefull to store the charge matching chi2 in the cluster
-           // fChi2[0]=sChi2[1]=chi2f;
-           // fChi2[1]=sChi2[0]=chi2s;
-
-           if (chi2f<=fGhostChi2Cut && chi2s<=fGhostChi2Cut)
-               c->SetGhost(1);
-           if   (chi2f>fGhostChi2Cut && chi2s>fGhostChi2Cut) {
-               // we keep the ghost
-               c->SetGhost(2);
-               chi2s=-1;
-               chi2f=-1;
-           }
-           if (chi2f<=fGhostChi2Cut)
-               Split(c);
-           if (chi2s<=fGhostChi2Cut) {
-               // retreive saved values
-               for (Int_t i=0;i<2;i++) {
-                   fXFit[i]=sXFit[i];
-                   fYFit[i]=sYFit[i];
-                   fQrFit[i]=sQrFit[i];
-                   fChi2[i]=sChi2[i];
-               }
-               Split(c);
-           }
-           c->SetGhost(0);
-       }
-
-    } else if (fNLocal[0]==2 &&  fNLocal[1]==1) {
-//  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//  (3) Two local maxima on cathode 1 and one maximum on cathode 2 
-//  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//
-       Float_t xm[4][2], ym[4][2];
-       Float_t dpx, dpy, dx, dy;
-       Int_t ixm[4][2], iym[4][2];
-       Int_t isec, im1, ico;
-//
-//  Form the 2x2 combinations
-//  0-0, 0-1, 1-0, 1-1 
-        ico=0;
-       for (im1=0; im1<2; im1++) {
-           xm[ico][0]=fX[fIndLocal[im1][0]][0];
-           ym[ico][0]=fY[fIndLocal[im1][0]][0];
-           xm[ico][1]=fX[fIndLocal[0][1]][1];
-           ym[ico][1]=fY[fIndLocal[0][1]][1];
-           
-           ixm[ico][0]=fIx[fIndLocal[im1][0]][0];
-           iym[ico][0]=fIy[fIndLocal[im1][0]][0];
-           ixm[ico][1]=fIx[fIndLocal[0][1]][1];
-           iym[ico][1]=fIy[fIndLocal[0][1]][1];
-           ico++;
-       }
-// ico = 0 : first local maximum on cathodes 1 and 2
-// ico = 1 : second local maximum on cathode 1 and first on cathode 2
-
-// Analyse the combinations and keep those that are possible !
-// For each combination check consistency in x and y   
-       Int_t iacc;
-       Bool_t accepted[4];
-       iacc=0;
-       // In case of staggering maxima are displaced by exactly half the pad-size in y. 
-        // We have to take into account the numerical precision in the consistency check;
-       
-       Float_t eps = 1.e-5;
-
-       for (ico=0; ico<2; ico++) {
-           isec=fSeg2[0]->Sector(fInput->DetElemId(), ixm[ico][0], iym[ico][0]);
-           dpx=fSeg2[0]->Dpx(fInput->DetElemId(), isec)/2.;
-           
-           dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
-           isec=fSeg2[1]->Sector(fInput->DetElemId(), ixm[ico][1], iym[ico][1]);
-           dpy=fSeg2[1]->Dpy(fInput->DetElemId(), isec)/2.;
-          
-           dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
-           AliDebug(2,Form("\n %i %f %f %f %f \n", ico, ym[ico][0], ym[ico][1], dy, dpy ));
-           if ((dx <= dpx) && (dy <= dpy+eps)) {
-               // consistent
-               accepted[ico]=kTRUE;
-               iacc++;
-           } else {
-               // reject
-               accepted[ico]=kFALSE;
-           }
-       }
-       
-       Float_t chi21 = 100;
-       Float_t chi22 = 100;
-       Float_t chi23 = 100;
-
-       //  Initial value for charge ratios
-       fQrInit[0]=Float_t(fQ[fIndLocal[0][0]][0])/
-           Float_t(fQ[fIndLocal[0][0]][0]+fQ[fIndLocal[1][0]][0]);
-       fQrInit[1]=fQrInit[0];
-       
-       if (accepted[0] && accepted[1]) {
-           
-           fXInit[0]=0.5*(xm[0][1]+xm[0][0]);
-           fYInit[0]=ym[0][0];
-           fXInit[1]=0.5*(xm[0][1]+xm[1][0]);
-           fYInit[1]=ym[1][0];
-           fQrInit[0]=0.5;
-           fQrInit[1]=0.5;
-           chi23=CombiDoubleMathiesonFit(c);
-           if (chi23<10) {
-               Split(c);
-               Float_t yst;
-               yst = fYFit[0];
-               fYFit[0] = fYFit[1];
-               fYFit[1] = yst;
-               Split(c);
-           }
-       } else if (accepted[0]) {
-           fXInit[0]=xm[0][1];
-           fYInit[0]=ym[0][0];
-           fXInit[1]=xm[1][0];
-           fYInit[1]=ym[1][0];
-           chi21=CombiDoubleMathiesonFit(c);
-//         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//         Float_t prob = TMath::Prob(chi2,ndf);
-//         prob2->Fill(prob);
-//         chi2_2->Fill(chi21);
-           AliDebug(1,Form(" chi2 %f\n",chi21));
-           if (chi21<10) Split(c);
-       } else if (accepted[1]) {
-           fXInit[0]=xm[1][1];
-           fYInit[0]=ym[1][0];
-           fXInit[1]=xm[0][0];
-           fYInit[1]=ym[0][0];
-           chi22=CombiDoubleMathiesonFit(c);
-//         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//         Float_t prob = TMath::Prob(chi2,ndf);
-//         prob2->Fill(prob);
-//         chi2_2->Fill(chi22);
-           AliDebug(1,Form(" chi2 %f\n",chi22));
-           if (chi22<10) Split(c);
-       }
-
-       if (chi21 > 10 && chi22 > 10 && chi23 > 10) {
-// We keep only the combination found (X->cathode 2, Y->cathode 1)
-           for (Int_t ico=0; ico<2; ico++) {
-               if (accepted[ico]) {
-                   AliMUONRawCluster cnew;
-                   Int_t cath;    
-                   for (cath=0; cath<2; cath++) {
-                       cnew.SetX(cath, Float_t(xm[ico][1]));
-                       cnew.SetY(cath, Float_t(ym[ico][0]));
-                       cnew.SetZ(cath, fZPlane);
-                       cnew.SetMultiplicity(cath, c->GetMultiplicity(cath));
-                       for (i=0; i<fMul[cath]; i++) {
-                           cnew.SetIndex(i, cath, c->GetIndex(i, cath));
-                           fSeg2[cath]->SetPad(fInput->DetElemId(), fIx[i][cath], fIy[i][cath]);
-
-                       }
-                       AliDebug(1,Form("\nRawCluster %d cath %d\n",ico,cath));
-                       AliDebug(1,Form("mult_av %d\n",c->GetMultiplicity(cath)));
-                       
-                       FillCluster(&cnew,cath);
-                   } 
-                   cnew.SetClusterType(cnew.PhysicsContribution());
-                   AddRawCluster(cnew);
-                   fNPeaks++;
-               }
-           }
-       }
-       
-//  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//  (3') One local maximum on cathode 1 and two maxima on cathode 2 
-//  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-    } else if (fNLocal[0]==1 && fNLocal[1]==2) {
-       Float_t xm[4][2], ym[4][2];
-       Float_t dpx, dpy, dx, dy;
-       Int_t ixm[4][2], iym[4][2];
-       Int_t isec, im1, ico;
-//
-//  Form the 2x2 combinations
-//  0-0, 0-1, 1-0, 1-1 
-        ico=0;
-       for (im1=0; im1<2; im1++) {
-           xm[ico][0]=fX[fIndLocal[0][0]][0];
-           ym[ico][0]=fY[fIndLocal[0][0]][0];
-           xm[ico][1]=fX[fIndLocal[im1][1]][1];
-           ym[ico][1]=fY[fIndLocal[im1][1]][1];
-           
-           ixm[ico][0]=fIx[fIndLocal[0][0]][0];
-           iym[ico][0]=fIy[fIndLocal[0][0]][0];
-           ixm[ico][1]=fIx[fIndLocal[im1][1]][1];
-           iym[ico][1]=fIy[fIndLocal[im1][1]][1];
-           ico++;
-       }
-// ico = 0 : first local maximum on cathodes 1 and 2
-// ico = 1 : first local maximum on cathode 1 and second on cathode 2
-
-// Analyse the combinations and keep those that are possible !
-// For each combination check consistency in x and y   
-       Int_t iacc;
-       Bool_t accepted[4];
-       iacc=0;
-        // In case of staggering maxima are displaced by exactly half the pad-size in y. 
-        // We have to take into account the numerical precision in the consistency check;      
-       Float_t eps = 1.e-5;
-
-       
-       for (ico=0; ico<2; ico++) {
-           accepted[ico]=kFALSE;
-           isec=fSeg2[0]->Sector(fInput->DetElemId(), ixm[ico][0], iym[ico][0]);
-           dpx=fSeg2[0]->Dpx(fInput->DetElemId(), isec)/2.;
-          
-           dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
-           isec=fSeg2[1]->Sector(fInput->DetElemId(), ixm[ico][1], iym[ico][1]);
-           dpy=fSeg2[1]->Dpy(fInput->DetElemId(), isec)/2.;
-           
-           dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
-           AliDebug(1,Form("\n %i %f %f %f %f \n", ico, ym[ico][0], ym[ico][1], dy, dpy ));
-           if ((dx <= dpx) && (dy <= dpy+eps)) {
-               // consistent
-               accepted[ico]=kTRUE;
-               AliDebug(1,Form("ico %d\n",ico));
-               iacc++;
-           } else {
-               // reject
-               accepted[ico]=kFALSE;
-           }
-       }
-
-       Float_t chi21 = 100;
-       Float_t chi22 = 100;
-       Float_t chi23 = 100;
-
-       fQrInit[1]=Float_t(fQ[fIndLocal[0][1]][1])/
-           Float_t(fQ[fIndLocal[0][1]][1]+fQ[fIndLocal[1][1]][1]);
-       
-       fQrInit[0]=fQrInit[1];
-
-       
-       if (accepted[0] && accepted[1]) {
-           fXInit[0]=xm[0][1];
-           fYInit[0]=0.5*(ym[0][0]+ym[0][1]);
-           fXInit[1]=xm[1][1];
-           fYInit[1]=0.5*(ym[0][0]+ym[1][1]);
-           fQrInit[0]=0.5;
-           fQrInit[1]=0.5;
-           chi23=CombiDoubleMathiesonFit(c);
-           if (chi23<10) {
-               Split(c);
-               Float_t yst;
-               yst = fYFit[0];
-               fYFit[0] = fYFit[1];
-               fYFit[1] = yst;
-               Split(c);
-           }
-       } else if (accepted[0]) {
-           fXInit[0]=xm[0][0];
-           fYInit[0]=ym[0][1];
-           fXInit[1]=xm[1][1];
-           fYInit[1]=ym[1][1];
-           chi21=CombiDoubleMathiesonFit(c);
-//         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//         Float_t prob = TMath::Prob(chi2,ndf);
-//         prob2->Fill(prob);
-//         chi2_2->Fill(chi21);
-           AliDebug(1,Form(" chi2 %f\n",chi21));
-           if (chi21<10) Split(c);
-       } else if (accepted[1]) {
-           fXInit[0]=xm[1][0];
-           fYInit[0]=ym[1][1];
-           fXInit[1]=xm[0][1];
-           fYInit[1]=ym[0][1];
-           chi22=CombiDoubleMathiesonFit(c);
-//         Int_t ndf = fgNbins[0]+fgNbins[1]-6;
-//         Float_t prob = TMath::Prob(chi2,ndf);
-//         prob2->Fill(prob);
-//         chi2_2->Fill(chi22);
-           AliDebug(1,Form(" chi2 %f\n",chi22));
-           if (chi22<10) Split(c);
-       }
-
-       if (chi21 > 10 && chi22 > 10 && chi23 > 10) {
-//We keep only the combination found (X->cathode 2, Y->cathode 1)
-           for (Int_t ico=0; ico<2; ico++) {
-               if (accepted[ico]) {
-                   AliMUONRawCluster cnew;
-                   Int_t cath;    
-                   for (cath=0; cath<2; cath++) {
-                       cnew.SetX(cath, Float_t(xm[ico][1]));
-                       cnew.SetY(cath, Float_t(ym[ico][0]));
-                       cnew.SetZ(cath, fZPlane);
-                       cnew.SetMultiplicity(cath, c->GetMultiplicity(cath));
-                       for (i=0; i<fMul[cath]; i++) {
-                         cnew.SetIndex(i, cath, c->GetIndex(i, cath));
-                         fSeg2[cath]->SetPad(fInput->DetElemId(), fIx[i][cath], fIy[i][cath]);
-                       }
-                       AliDebug(1,Form("\nRawCluster %d cath %d\n",ico,cath));
-                       AliDebug(1,Form("mult_av %d\n",c->GetMultiplicity(cath)));
-                       FillCluster(&cnew,cath);
-                   } 
-                   cnew.SetClusterType(cnew.PhysicsContribution());
-                   AddRawCluster(cnew);
-                   fNPeaks++;
-               }
-           }
-       }
-
-//  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-//  (4) At least three local maxima on cathode 1 or on cathode 2 
-//  ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-    } else if (fNLocal[0]>2 || fNLocal[1]>2) {
-       Int_t param = fNLocal[0]*fNLocal[1];
-       Int_t ii;
-
-       Float_t ** xm = new Float_t * [param];
-       for (ii=0; ii<param; ii++) xm[ii]=new Float_t [2];
-       Float_t ** ym = new Float_t * [param];
-       for (ii=0; ii<param; ii++) ym[ii]=new Float_t [2];
-       Int_t ** ixm = new Int_t * [param];
-       for (ii=0; ii<param; ii++) ixm[ii]=new Int_t [2];
-       Int_t ** iym = new Int_t * [param];
-       for (ii=0; ii<param; ii++) iym[ii]=new Int_t [2];
-       
-       Int_t isec, ico;
-       Float_t dpx, dpy, dx, dy;
-
-        ico=0;
-       for (Int_t im1=0; im1<fNLocal[0]; im1++) {
-           for (Int_t im2=0; im2<fNLocal[1]; im2++) {
-               xm[ico][0]=fX[fIndLocal[im1][0]][0];
-               ym[ico][0]=fY[fIndLocal[im1][0]][0];
-               xm[ico][1]=fX[fIndLocal[im2][1]][1];
-               ym[ico][1]=fY[fIndLocal[im2][1]][1];
-
-               ixm[ico][0]=fIx[fIndLocal[im1][0]][0];
-               iym[ico][0]=fIy[fIndLocal[im1][0]][0];
-               ixm[ico][1]=fIx[fIndLocal[im2][1]][1];
-               iym[ico][1]=fIy[fIndLocal[im2][1]][1];
-               ico++;
-           }
-       }
-       
-       Int_t nIco = ico;
-       AliDebug(1,Form("nIco %d\n",nIco));
-       for (ico=0; ico<nIco; ico++) {
-           AliDebug(1,Form("ico = %d\n",ico));
-           isec=fSeg2[0]->Sector(fInput->DetElemId(), ixm[ico][0], iym[ico][0]);
-           dpx=fSeg2[0]->Dpx(fInput->DetElemId(), isec)/2.;
-           
-           dx=TMath::Abs(xm[ico][0]-xm[ico][1]);
-           isec=fSeg2[1]->Sector(fInput->DetElemId(), ixm[ico][1], iym[ico][1]);
-           dpy=fSeg2[1]->Dpy(fInput->DetElemId(), isec)/2.;
-           
-           dy=TMath::Abs(ym[ico][0]-ym[ico][1]);
-               AliDebug(1,Form("dx %f dpx %f dy %f dpy %f\n",dx,dpx,dy,dpy));
-               AliDebug(1,Form("  X %f Y %f\n",xm[ico][1],ym[ico][0]));
-           if ((dx <= dpx) && (dy <= dpy)) {
-                       AliDebug(1,"ok\n");
-               Int_t cath;    
-               AliMUONRawCluster cnew;
-               for (cath=0; cath<2; cath++) {
-                   cnew.SetX(cath, Float_t(xm[ico][1]));
-                   cnew.SetY(cath, Float_t(ym[ico][0]));
-                   cnew.SetZ(cath, fZPlane);
-                   cnew.SetMultiplicity(cath, c->GetMultiplicity(cath));
-                   for (i=0; i<fMul[cath]; i++) {
-                       cnew.SetIndex(i, cath, c->GetIndex(i, cath));
-                       fSeg2[cath]->SetPad(fInput->DetElemId(), fIx[i][cath], fIy[i][cath]);
-                   }
-                   FillCluster(&cnew,cath);
-               } 
-               cnew.SetClusterType(cnew.PhysicsContribution());
-               //              cnew.SetDetElemId(fInput->DetElemId());
-               AddRawCluster(cnew);
-               fNPeaks++;
-           }
-       }
-       delete [] xm;
-       delete [] ym;
-       delete [] ixm;
-       delete [] iym;
-    }
-}
-
-void AliMUONClusterFinderVS::FindLocalMaxima(AliMUONRawCluster* /*c*/)
-{
-/// Find all local maxima of a cluster
-    AliDebug(1,"\n Find Local maxima  !");
-    
-    AliMUONDigit* digt;
-    
-    Int_t cath, cath1; // loops over cathodes
-    Int_t i;           // loops over digits
-    Int_t j;           // loops over cathodes
-//
-//  Find local maxima
-//
-//  counters for number of local maxima
-    fNLocal[0]=fNLocal[1]=0;
-//  flags digits as local maximum
-    Bool_t isLocal[100][2];
-    for (i=0; i<100;i++) {
-       isLocal[i][0]=isLocal[i][1]=kFALSE;
-    }
-//  number of next neighbours and arrays to store them 
-    Int_t nn;
-    Int_t x[10], y[10];
-    // loop over cathodes
-    for (cath=0; cath<2; cath++) {
-      // loop over cluster digits
-      for (i=0; i<fMul[cath]; i++) {
-       // get neighbours for that digit and assume that it is local maximum
-       Int_t isec;
-       Float_t a0;
-
-       fSeg2[cath]->Neighbours(fInput->DetElemId(), fIx[i][cath], fIy[i][cath], &nn, x, y);
-         
-       isLocal[i][cath]=kTRUE;
-       isec = fSeg2[cath]->Sector(fInput->DetElemId(), fIx[i][cath], fIy[i][cath]);
-       a0   = fSeg2[cath]->Dpx(fInput->DetElemId(), isec)*fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
-       
-       // loop over next neighbours, if at least one neighbour has higher charger assumption
-       // digit is not local maximum 
-       for (j=0; j<nn; j++) {
-         if (fDigitMap[cath]->TestHit(x[j], y[j])==kEmpty) continue;
-         digt=(AliMUONDigit*) fDigitMap[cath]->GetHit(x[j], y[j]);
-         Float_t a1;
-         isec=fSeg2[cath]->Sector(fInput->DetElemId(), x[j], y[j]);
-         a1 = fSeg2[cath]->Dpx(fInput->DetElemId(),isec)*fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
-        
-         if (digt->Signal()/a1 > fQ[i][cath]/a0) {
-           isLocal[i][cath]=kFALSE;
-           break;
-           //
-           // handle special case of neighbouring pads with equal signal
-         } else if (digt->Signal() == fQ[i][cath]) {
-           if (fNLocal[cath]>0) {
-             for (Int_t k=0; k<fNLocal[cath]; k++) {
-               if (x[j]==fIx[fIndLocal[k][cath]][cath] 
-                   && y[j]==fIy[fIndLocal[k][cath]][cath])
-                 {
-                   isLocal[i][cath]=kFALSE;
-                 } 
-             } // loop over local maxima
-           } // are there already local maxima
-         } // same charge ? 
-       } // loop over next neighbours
-       if (isLocal[i][cath]) {
-         fIndLocal[fNLocal[cath]][cath]=i;
-         fNLocal[cath]++;
-       } 
-      } // loop over all digits
-    } // loop over cathodes
-
-    AliDebug(1,Form("\n Found %d %d %d %d local Maxima\n",
-              fNLocal[0], fNLocal[1], fMul[0], fMul[1]));
-       AliDebug(1,Form("\n Cathode 1 local Maxima %d Multiplicite %d\n",fNLocal[0], fMul[0]));
-       AliDebug(1,Form(" Cathode 2 local Maxima %d Multiplicite %d\n",fNLocal[1], fMul[1]));
-    Int_t ix, iy, isec;
-    Float_t dpx, dpy;
-    
-    
-    if (fNLocal[1]==2 &&  (fNLocal[0]==1 || fNLocal[0]==0)) {
-       Int_t iback=fNLocal[0];
-       
-//  Two local maxima on cathode 2 and one maximum on cathode 1 
-//  Look for local maxima considering up and down neighbours on the 1st cathode only
-//
-//  Loop over cluster digits
-       cath=0;
-       cath1=1;
-       
-       for (i=0; i<fMul[cath]; i++) {
-         isec=fSeg2[cath]->Sector(fInput->DetElemId(), fIx[i][cath],fIy[i][cath]);
-         dpy=fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
-         dpx=fSeg2[cath]->Dpx(fInput->DetElemId(), isec);
-         
-           if (isLocal[i][cath]) continue;
-// Pad position should be consistent with position of local maxima on the opposite cathode
-           if ((TMath::Abs(fX[i][cath]-fX[fIndLocal[0][cath1]][cath1]) > dpx/2.) && 
-               (TMath::Abs(fX[i][cath]-fX[fIndLocal[1][cath1]][cath1]) > dpx/2.))
-               continue;
-
-// get neighbours for that digit and assume that it is local maximum       
-           isLocal[i][cath]=kTRUE;
-// compare signal to that on the two neighbours on the left and on the right
-// iNN counts the number of neighbours with signal, it should be 1 or 2
-           Int_t iNN=0;
-
-
-           for (fSeg2[cath]->FirstPad(fInput->DetElemId(), fX[i][cath], fY[i][cath], fZPlane, 0., dpy);
-                  fSeg2[cath]->MorePads(fInput->DetElemId());
-                  fSeg2[cath]->NextPad(fInput->DetElemId()))
-               {
-                 ix = fSeg2[cath]->Ix();
-                 iy = fSeg2[cath]->Iy();
-                 // skip the current pad
-                 if (iy == fIy[i][cath]) continue;
-               
-                 if (fDigitMap[cath]->TestHit(ix, iy)!=kEmpty) {
-                   iNN++;
-                   digt=(AliMUONDigit*) fDigitMap[cath]->GetHit(ix,iy);
-                   if (digt->Signal() > fQ[i][cath]) isLocal[i][cath]=kFALSE;
-                 }
-               } // Loop over pad neighbours in y
-           
-           if (isLocal[i][cath] && iNN>0) {
-               fIndLocal[fNLocal[cath]][cath]=i;
-               fNLocal[cath]++;
-           } 
-       } // loop over all digits
-// if one additional maximum has been found we are happy 
-// if more maxima have been found restore the previous situation
-       AliDebug(1,Form("\n New search gives %d local maxima for cathode 1 \n",
-                   fNLocal[0]));
-       AliDebug(1,Form("                  %d local maxima for cathode 2 \n",
-                   fNLocal[1]));
-       if (fNLocal[cath]>2) {
-           fNLocal[cath]=iback;
-       }
-       
-    } // 1,2 local maxima
-    
-    if (fNLocal[0]==2 &&  (fNLocal[1]==1 || fNLocal[1]==0)) {
-       Int_t iback=fNLocal[1];
-       
-//  Two local maxima on cathode 1 and one maximum on cathode 2 
-//  Look for local maxima considering left and right neighbours on the 2nd cathode only
-       cath=1;
-       Int_t cath1 = 0;
-       Float_t eps = 1.e-5;
-       
-//
-//  Loop over cluster digits
-       for (i=0; i<fMul[cath]; i++) {
-           isec=fSeg2[cath]->Sector(fInput->DetElemId(), fIx[i][cath],fIy[i][cath]);
-           dpx=fSeg2[cath]->Dpx(fInput->DetElemId(), isec);
-           dpy=fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
-         
-       
-           if (isLocal[i][cath]) continue;
-// Pad position should be consistent with position of local maxima on the opposite cathode
-           if ((TMath::Abs(fY[i][cath]-fY[fIndLocal[0][cath1]][cath1]) > dpy/2.+eps) && 
-               (TMath::Abs(fY[i][cath]-fY[fIndLocal[1][cath1]][cath1]) > dpy/2.+eps))
-               continue;
-           
-//
-// get neighbours for that digit and assume that it is local maximum       
-           isLocal[i][cath]=kTRUE;
-// compare signal to that on the two neighbours on the left and on the right
-
-// iNN counts the number of neighbours with signal, it should be 1 or 2
-           Int_t iNN=0;
-           for (fSeg2[cath]->FirstPad(fInput->DetElemId(), fX[i][cath], fY[i][cath], fZPlane, dpx, 0.);
-                  fSeg2[cath]->MorePads(fInput->DetElemId());
-                  fSeg2[cath]->NextPad(fInput->DetElemId()))
-               {
-
-                 ix = fSeg2[cath]->Ix();
-                 iy = fSeg2[cath]->Iy();
-
-                 // skip the current pad
-                 if (ix == fIx[i][cath]) continue;
-               
-                 if (fDigitMap[cath]->TestHit(ix, iy)!=kEmpty) {
-                   iNN++;
-                   digt=(AliMUONDigit*) fDigitMap[cath]->GetHit(ix,iy);
-                   if (digt->Signal() > fQ[i][cath]) isLocal[i][cath]=kFALSE;
-                 }
-               } // Loop over pad neighbours in x
-           
-           if (isLocal[i][cath] && iNN>0) {
-               fIndLocal[fNLocal[cath]][cath]=i;
-               fNLocal[cath]++;
-           } 
-       } // loop over all digits
-// if one additional maximum has been found we are happy 
-// if more maxima have been found restore the previous situation
-       AliDebug(1,Form("\n New search gives %d local maxima for cathode 1 \n",fNLocal[0]));
-       AliDebug(1,Form("\n                  %d local maxima for cathode 2 \n",fNLocal[1]));
-       AliDebug(1,Form("\n New search gives %d %d \n",fNLocal[0],fNLocal[1]));
-       if (fNLocal[cath]>2) {
-           fNLocal[cath]=iback;
-       }
-    } // 2,1 local maxima
-}
-
-
-void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t flag, Int_t cath) 
-{
-///  Completes cluster information starting from list of digits
-
-  AliMUONDigit* dig;
-  Float_t x, y, z;
-  Int_t  ix, iy;
-  
-  if (cath==1) {
-    c->SetPeakSignal(cath,c->GetPeakSignal(0));        
-  } else {
-    c->SetPeakSignal(cath,0);
-  }
-  
-  
-  if (flag) {
-    c->SetX(cath,0.);
-    c->SetY(cath,0.);
-    c->SetCharge(cath,0);
-  }
-  
-  AliDebug(1,Form("\n fPeakSignal %d\n",c->GetPeakSignal(cath)));
-  for (Int_t i=0; i<c->GetMultiplicity(cath); i++)
-    {
-      dig= fInput->Digit(cath,c->GetIndex(i,cath));
-      ix=dig->PadX()+c->GetOffset(i,cath);
-      iy=dig->PadY();
-      Float_t q=dig->Signal();
-      if (!flag) q *= c->GetContrib(i,cath);
-      //       fprintf(stderr,"q %d c->fPeakSignal[ %d ] %d\n",q,cath,c->fPeakSignal[cath]);
-      if (dig->Physics() >= dig->Signal()) {
-       c->SetPhysics(i,2);
-      } else if (dig->Physics() == 0) {
-       c->SetPhysics(i,0);
-      } else  c->SetPhysics(i,1);
-      //
-      // 
-      AliDebug(2,Form("q %d c->fPeakSignal[cath] %d\n",q,c->GetPeakSignal(cath)));
-      // peak signal and track list
-      if (q>c->GetPeakSignal(cath)) {
-       c->SetPeakSignal(cath, q);
-       c->SetTrack(0,dig->Hit());
-       c->SetTrack(1,dig->Track(0));
-       c->SetTrack(2,dig->Track(1));
-       //          fprintf(stderr," c->fTracks[0] %d c->fTracks[1] %d\n",dig->fHit,dig->fTracks[0]);
-      }
-      //
-      if (flag) {
-       fSeg2[cath]->GetPadC(fInput->DetElemId(), ix, iy, x, y, z);
-       
-       c->AddX(cath, q*x);
-       c->AddY(cath, q*y);
-       c->AddCharge(cath, q);
-      }
-    } // loop over digits
-  AliDebug(1," fin du cluster c\n");
-  
-  
-  if (flag) {
-    c->SetX(cath, c->GetX(cath)/c->GetCharge(cath));
-    // Force on anod
-    c->SetX(cath, fSeg2[cath]->GetAnod(fInput->DetElemId(), c->GetX(cath)));
-    c->SetY(cath, c->GetY(cath)/c->GetCharge(cath)); 
-    //
-    //  apply correction to the coordinate along the anode wire
-    //
-    x=c->GetX(cath);   
-    y=c->GetY(cath);
-    TF1* cogCorr;
-    Int_t isec;
-    fSeg2[cath]->GetPadI(fInput->DetElemId(), x, y, fZPlane, ix, iy);
-    fSeg2[cath]->GetPadC(fInput->DetElemId(), ix, iy, x, y, z);
-    isec=fSeg2[cath]->Sector(fInput->DetElemId(), ix,iy);
-    cogCorr = fSeg2[cath]->CorrFunc(fInput->DetElemId(), isec-1);
-    
-    
-    if (cogCorr) {
-      Float_t yOnPad;
-      yOnPad=(c->GetY(cath)-y)/fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
-      
-      c->SetY(cath, c->GetY(cath)-cogCorr->Eval(yOnPad, 0, 0));
-      // slat ID from digit
-      
-    }
-  }
-}
-
-void  AliMUONClusterFinderVS::FillCluster(AliMUONRawCluster* c, Int_t cath) 
-{
-///  Completes cluster information starting from list of digits
-
-  static Float_t dr0;
-  
-  AliMUONDigit* dig;
-  
-  if (cath==0) {
-    dr0 = 10000;
-  }
-  
-  Float_t xpad, ypad, zpad;
-  Float_t dx, dy, dr;
-  
-  for (Int_t i=0; i<c->GetMultiplicity(cath); i++)
-    {
-      dig = fInput->Digit(cath,c->GetIndex(i,cath));
-      fSeg2[cath]->
-         GetPadC(fInput->DetElemId(),dig->PadX(),dig->PadY(),xpad,ypad, zpad);
-      AliDebug(1,Form("x %f y %f cx %f cy %f\n",xpad,ypad,c->GetX(0),c->GetY(0)));
-      dx = xpad - c->GetX(0);
-      dy = ypad - c->GetY(0);
-      dr = TMath::Sqrt(dx*dx+dy*dy);
-      
-      if (dr < dr0) {
-       dr0 = dr;
-       AliDebug(1,Form(" dr %f\n",dr));
-       Float_t q=dig->Signal();
-       if (dig->Physics() >= dig->Signal()) {
-         c->SetPhysics(i,2);
-       } else if (dig->Physics() == 0) {
-         c->SetPhysics(i,0);
-       } else  c->SetPhysics(i,1);
-       c->SetPeakSignal(cath,q);
-       c->SetTrack(0,dig->Hit());
-       c->SetTrack(1,dig->Track(0));
-       c->SetTrack(2,dig->Track(1));
-       
-       AliDebug(1,Form(" c->fTracks[0] %d c->fTracks[1] %d\n",dig->Hit(),
-                       dig->Track(0)));
-      }
-      //
-    } // loop over digits
-  
-  //  apply correction to the coordinate along the anode wire
-  // Force on anod
-    c->SetX(cath,fSeg2[cath]->GetAnod(fInput->DetElemId(), c->GetX(cath)));
-}
-
-void  AliMUONClusterFinderVS::FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONRawCluster &c)
-{
-///  Find a super cluster on both cathodes
-///  Add i,j as element of the cluster
-    
-    Int_t idx = fDigitMap[cath]->GetHitIndex(i,j);
-    AliMUONDigit* dig = (AliMUONDigit*) fDigitMap[cath]->GetHit(i,j);
-    Float_t q=dig->Signal();
-    Int_t theX=dig->PadX();
-    Int_t theY=dig->PadY(); 
-   
-    if (q > TMath::Abs(c.GetPeakSignal(0)) && q > TMath::Abs(c.GetPeakSignal(1))) {
-       c.SetPeakSignal(cath,q);
-       c.SetTrack(0,dig->Hit());
-       c.SetTrack(1,dig->Track(0));
-       c.SetTrack(2,dig->Track(1));
-    }
-
-//
-//  Make sure that list of digits is ordered 
-// 
-    Int_t mu=c.GetMultiplicity(cath);
-    c.SetIndex(mu, cath, idx);
-    
-    if (dig->Physics() >= dig->Signal()) {
-        c.SetPhysics(mu,2);
-    } else if (dig->Physics() == 0) {
-        c.SetPhysics(mu,0);
-    } else  c.SetPhysics(mu,1);
-
-    
-    if (mu > 0) {
-       for (Int_t ind = mu-1; ind >= 0; ind--) {
-           Int_t ist=c.GetIndex(ind,cath);
-           Float_t ql=fInput->Digit(cath, ist)->Signal();
-           Int_t ix=fInput->Digit(cath, ist)->PadX();
-           Int_t iy=fInput->Digit(cath, ist)->PadY();
-           
-           if (q>ql || (q==ql && theX > ix && theY < iy)) {
-               c.SetIndex(ind, cath, idx);
-               c.SetIndex(ind+1, cath, ist);
-           } else {
-               
-               break;
-           }
-       }
-    }
-
-    c.SetMultiplicity(cath, c.GetMultiplicity(cath)+1);
-    if (c.GetMultiplicity(cath) >= 50 ) {
-      AliDebug(1,Form("FindCluster - multiplicity >50  %d \n",c.GetMultiplicity(0)));
-       c.SetMultiplicity(cath, 49);
-    }
-
-// Prepare center of gravity calculation
-    Float_t x, y, z;
-    fSeg2[cath]->GetPadC(fInput->DetElemId(), i, j, x, y, z);
-    c.AddX(cath,q*x);
-    c.AddY(cath,q*y);
-    c.AddCharge(cath,q);
-//
-// Flag hit as "taken"  
-    fDigitMap[cath]->FlagHit(i,j);
-//
-//  Now look recursively for all neighbours and pad hit on opposite cathode
-//
-//  Loop over neighbours
-    Int_t ix,iy;
-    ix=iy=0;
-    Int_t nn;
-    Int_t xList[10], yList[10];
-    fSeg2[cath]->Neighbours(fInput->DetElemId(), i,j,&nn,xList,yList);
-    for (Int_t in=0; in<nn; in++) {
-       ix=xList[in];
-       iy=yList[in];
-       
-       if (fDigitMap[cath]->TestHit(ix,iy)==kUnused) {
-           AliDebug(2,Form("\n Neighbours %d %d %d", cath, ix, iy));
-           FindCluster(ix, iy, cath, c);
-       }
-       
-   }
-    Int_t nOpp=0;
-    Int_t iXopp[50], iYopp[50];
-    
-//  Neighbours on opposite cathode 
-//  Take into account that several pads can overlap with the present pad
-    Int_t isec;
-    isec=fSeg2[cath]->Sector(fInput->DetElemId(), i,j);    
-
-    Int_t iop;
-    Float_t dx, dy;
-  
-    if (cath==0) {
-      iop = 1;
-      dx  = (fSeg2[cath]->Dpx(fInput->DetElemId(), isec))/2.;
-      dy  = 0.;
-    } else {
-      iop = 0;
-      dx  = 0.;
-      dy  = (fSeg2[cath]->Dpy(fInput->DetElemId(), isec))/2;
-    }
-   
-
-    
-    // loop over pad neighbours on opposite cathode
-    for (fSeg2[iop]->FirstPad(fInput->DetElemId(), x, y, fZPlane, dx, dy);
-        fSeg2[iop]->MorePads(fInput->DetElemId());
-        fSeg2[iop]->NextPad(fInput->DetElemId()))
-      {
-       
-       ix = fSeg2[iop]->Ix(); iy = fSeg2[iop]->Iy();
-       AliDebug(2,Form("\n ix, iy: %f %f %f %d %d %d", x,y,z,ix, iy, fSector));
-       if (fDigitMap[iop]->TestHit(ix,iy)==kUnused){
-         iXopp[nOpp]=ix;
-         iYopp[nOpp++]=iy;
-         AliDebug(2,Form("\n Opposite %d %d %d", iop, ix, iy));
-       }
-       
-      } // Loop over pad neighbours
-    //  This had to go outside the loop since recursive calls inside the iterator are not possible
-    //
-    Int_t jopp;
-    for (jopp=0; jopp<nOpp; jopp++) {
-      if (fDigitMap[iop]->TestHit(iXopp[jopp],iYopp[jopp]) == kUnused) 
-       FindCluster(iXopp[jopp], iYopp[jopp], iop, c);
-    }
-
-}
-
-//_____________________________________________________________________________
-
-void AliMUONClusterFinderVS::FindRawClusters()
-{
-/// MUON cluster finder from digits -- finds neighbours on both cathodes and 
-/// fills the tree with raw clusters
-
-    ResetRawClusters();
-//  Return if no input datad available
-    if (!fInput->NDigits(0) && !fInput->NDigits(1)) return;
-
-    fSeg2[0] = fInput->Segmentation2(0);
-    fSeg2[1] = fInput->Segmentation2(1);
-    
-    Int_t detElemId = fInput->DetElemId();
-    
-    Int_t npx0  = fSeg2[0]->Npx(detElemId)+1;
-    Int_t npy0  = fSeg2[0]->Npy(detElemId)+1;
-    fDigitMap[0]  = new AliMUONDigitMapA1(detElemId, npx0, npy0);
-
-    Int_t npx1  = fSeg2[0]->Npx(detElemId)+1;
-    Int_t npy1  = fSeg2[0]->Npy(detElemId)+1;
-    fDigitMap[1]  = new AliMUONDigitMapA1(detElemId, npx1, npy1);
-    
-    AliMUONDigit *dig;
-
-    Int_t ndig, cath;
-    Int_t nskip=0;
-    Int_t ncls=0;
-
-    fDigitMap[0]->FillHits(fInput->Digits(0));
-    fDigitMap[1]->FillHits(fInput->Digits(1));
-//
-//  Outer Loop over Cathodes
-    for (cath = 0; cath < 2; cath++) {
-      
-       for (ndig=0; ndig<fInput->NDigits(cath); ndig++) {
-         dig = fInput->Digit(cath, ndig);
-         Int_t padx = dig->PadX();
-         Int_t pady = dig->PadY();
-         if (fDigitMap[cath]->TestHit(padx,pady)==kUsed ||fDigitMap[0]->TestHit(padx,pady)==kEmpty) {
-           nskip++;
-           continue;
-         }
-         AliDebug(1,Form("\n CATHODE %d CLUSTER %d\n",cath,ncls));
-         AliMUONRawCluster clus;
-         clus.SetMultiplicity(0, 0);
-         clus.SetMultiplicity(1, 0);
-         clus.SetPeakSignal(cath,dig->Signal());
-         clus.SetTrack(0, dig->Hit());
-         clus.SetTrack(1, dig->Track(0));
-         clus.SetTrack(2, dig->Track(1));
-         
-         AliDebug(1,Form("idDE %d Padx %d Pady %d", fInput->DetElemId(), padx, pady));
-         
-         // tag the beginning of cluster list in a raw cluster
-         clus.SetNcluster(0,-1);
-         Float_t xcu, ycu;
-         fSeg2[cath]->GetPadC(fInput->DetElemId(), padx, pady, xcu, ycu, fZPlane);
-         fSector= fSeg2[cath]->Sector(fInput->DetElemId(), padx, pady)/100;
-         
-         
-         
-         
-         FindCluster(padx,pady,cath,clus);
-         //^^^^^^^^^^^^^^^^^^^^^^^^
-         // center of gravity
-         if (clus.GetX(0)!=0.) clus.SetX(0, clus.GetX(0)/clus.GetCharge(0)); // clus.fX[0] /= clus.fQ[0];
-         
-         // Force on anod
-         clus.SetX(0,fSeg2[0]->GetAnod(fInput->DetElemId(), clus.GetX(0)));
-         if (clus.GetY(0)!=0.) clus.SetY(0, clus.GetY(0)/clus.GetCharge(0)); // clus.fY[0] /= clus.fQ[0];
-         
-         if(clus.GetCharge(1)!=0.) clus.SetX(1, clus.GetX(1)/clus.GetCharge(1));  // clus.fX[1] /= clus.fQ[1];
-         
-         // Force on anod
-         clus.SetX(1, fSeg2[0]->GetAnod(fInput->DetElemId(),clus.GetX(1)));
-         if(clus.GetCharge(1)!=0.) clus.SetY(1, clus.GetY(1)/clus.GetCharge(1));// clus.fY[1] /= clus.fQ[1];
-         
-         clus.SetZ(0, fZPlane);
-         clus.SetZ(1, fZPlane);            
-         
-         AliDebug(1,Form("\n Cathode 1 multiplicite %d X(CG) %f Y(CG) %f\n",
-                         clus.GetMultiplicity(0),clus.GetX(0),clus.GetY(0)));
-         AliDebug(1,Form(" Cathode 2 multiplicite %d X(CG) %f Y(CG) %f\n",
-                         clus.GetMultiplicity(1),clus.GetX(1),clus.GetY(1)));
-         //      Analyse cluster and decluster if necessary
-         //    
-         ncls++;
-         clus.SetNcluster(1,fNRawClusters);
-         clus.SetClusterType(clus.PhysicsContribution());
-         
-         fNPeaks=0;
-         //
-         //
-         Decluster(&clus);
-         //
-         //      reset Cluster object
-         { // begin local scope
-           for (int k=0;k<clus.GetMultiplicity(0);k++) clus.SetIndex(k, 0, 0);
-         } // end local scope
-         
-         { // begin local scope
-           for (int k=0;k<clus.GetMultiplicity(1);k++) clus.SetIndex(k, 1, 0);
-         } // end local scope
-         
-         clus.SetMultiplicity(0,0);
-         clus.SetMultiplicity(1,0);
-         
-       
-       } // end loop ndig
-    } // end loop cathodes
-    delete fDigitMap[0];
-    delete fDigitMap[1];
-}
-
-Float_t AliMUONClusterFinderVS::SingleMathiesonFit(AliMUONRawCluster *c, Int_t cath)
-{
-/// Performs a single Mathieson fit on one cathode
-
-    Double_t arglist[20];
-    Int_t ierflag=0;
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
-    
-    clusterInput.Fitter()->SetFCN(fcnS1);
-    clusterInput.Fitter()->mninit(2,10,7);
-    clusterInput.Fitter()->SetPrintLevel(-1 + AliLog::GetGlobalDebugLevel());
-    arglist[0]=-1;
-    clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
-// Set starting values 
-    static Double_t vstart[2];
-    vstart[0]=c->GetX(1);
-    vstart[1]=c->GetY(0);
-    
-    
-// lower and upper limits
-    static Double_t lower[2], upper[2];
-    Int_t ix,iy, isec;
-    fSeg2[cath]->GetPadI(fInput->DetElemId(), c->GetX(cath), c->GetY(cath), fZPlane, ix, iy);
-    isec=fSeg2[cath]->Sector(fInput->DetElemId(), ix, iy);
-
-    lower[0]=vstart[0]-fSeg2[cath]->Dpx(fInput->DetElemId(), isec)/2;
-    lower[1]=vstart[1]-fSeg2[cath]->Dpy(fInput->DetElemId(), isec)/2;
-    
-    upper[0]=lower[0]+fSeg2[cath]->Dpx(fInput->DetElemId(), isec);
-    upper[1]=lower[1]+fSeg2[cath]->Dpy(fInput->DetElemId(), isec);
-    
-
-// step sizes
-    static Double_t step[2]={0.0005, 0.0005};
-    
-    clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
-    clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
-// ready for minimisation      
-    arglist[0]= -1;
-    arglist[1]= 0;
-    
-    clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
-    clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
-    //    clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
-    Double_t fmin, fedm, errdef;
-    Int_t   npari, nparx, istat;
-      
-    clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);  
-    fFitStat=istat;
-    
-// Print results
-// Get fitted parameters
-    Double_t xrec, yrec;
-    TString chname;
-    Double_t epxz, b1, b2;
-    Int_t ierflg;
-    clusterInput.Fitter()->mnpout(0, chname, xrec, epxz, b1, b2, ierflg);      
-    clusterInput.Fitter()->mnpout(1, chname, yrec, epxz, b1, b2, ierflg);      
-    fXFit[cath]=xrec;
-    fYFit[cath]=yrec;
-    return fmin;
-}
-
-Float_t AliMUONClusterFinderVS::CombiSingleMathiesonFit(AliMUONRawCluster * /*c*/)
-{
-/// Perform combined Mathieson fit on both cathode planes
-
-    Double_t arglist[20];
-    Int_t ierflag=0;
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
-    clusterInput.Fitter()->SetFCN(fcnCombiS1);
-    clusterInput.Fitter()->mninit(2,10,7);
-    clusterInput.Fitter()->SetPrintLevel(-1 + AliLog::GetGlobalDebugLevel());
-    arglist[0]=-1;
-    clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
-    static Double_t vstart[2];
-    vstart[0]=fXInit[0];
-    vstart[1]=fYInit[0];
-    
-    
-// lower and upper limits
-    static Float_t lower[2], upper[2];
-    Int_t ix,iy,isec;
-    Float_t dpy, dpx;
-
-    fSeg2[0]->GetPadI(fInput->DetElemId(), fXInit[0], fYInit[0], fZPlane, ix, iy);
-    isec=fSeg2[0]->Sector(fInput->DetElemId(), ix, iy);
-    dpy=fSeg2[0]->Dpy(fInput->DetElemId(), isec);
-    fSeg2[1]->GetPadI(fInput->DetElemId(), fXInit[0], fYInit[0], fZPlane, ix, iy);
-    isec=fSeg2[1]->Sector(fInput->DetElemId(), ix, iy);
-    dpx=fSeg2[1]->Dpx(fInput->DetElemId(), isec);
-      
-    Int_t icount;
-    Float_t xdum, ydum, zdum;
-
-//  Find save upper and lower limits    
-    
-    icount = 0;
-    for (fSeg2[1]->FirstPad(fInput->DetElemId(),fXInit[0], fYInit[0], fZPlane, dpx, 0.); 
-        fSeg2[1]->MorePads(fInput->DetElemId()); 
-        fSeg2[1]->NextPad(fInput->DetElemId()))
-       {
-         ix=fSeg2[1]->Ix(); iy=fSeg2[1]->Iy();
-         fSeg2[1]->GetPadC(fInput->DetElemId(), ix,iy, upper[0], ydum, zdum);  
-         if (icount ==0) lower[0]=upper[0];
-         icount++;
-       }
-    
-    if (lower[0]>upper[0]) {xdum=lower[0]; lower[0]=upper[0]; upper[0]=xdum;}
-       
-    icount=0;
-    AliDebug(1,Form("\n single y %f %f", fXInit[0], fYInit[0]));
-    
-    for (fSeg2[0]->FirstPad(fInput->DetElemId(), fXInit[0], fYInit[0], fZPlane, 0., dpy); 
-        fSeg2[0]->MorePads(fInput->DetElemId()); 
-        fSeg2[0]->NextPad(fInput->DetElemId()))
-       {
-         ix=fSeg2[0]->Ix(); iy=fSeg2[0]->Iy();
-         fSeg2[0]->GetPadC(fInput->DetElemId(), ix,iy,xdum,upper[1],zdum);     
-         if (icount ==0) lower[1]=upper[1];
-         icount++;
-         AliDebug(1,Form("\n upper lower %d %f %f", icount, upper[1], lower[1]));
-       }
-    
-    if (lower[1]>upper[1]) {xdum=lower[1]; lower[1]=upper[1]; upper[1]=xdum;}
-
-// step sizes
-    static Double_t step[2]={0.00001, 0.0001};
-    
-    clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
-    clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
-// ready for minimisation      
-    arglist[0]= -1;
-    arglist[1]= 0;
-    
-    clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
-    clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
-    //    clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
-    Double_t fmin, fedm, errdef;
-    Int_t   npari, nparx, istat;
-      
-    clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);  
-    fFitStat=istat;
-    
-// Print results
-// Get fitted parameters
-    Double_t xrec, yrec;
-    TString chname;
-    Double_t epxz, b1, b2;
-    Int_t ierflg;
-    clusterInput.Fitter()->mnpout(0, chname, xrec, epxz, b1, b2, ierflg);      
-    clusterInput.Fitter()->mnpout(1, chname, yrec, epxz, b1, b2, ierflg);      
-    fXFit[0]=xrec;
-    fYFit[0]=yrec;
-    return fmin;
-}
-
-Bool_t AliMUONClusterFinderVS::DoubleMathiesonFit(AliMUONRawCluster * /*c*/, Int_t cath)
-{
-/// Performs a double Mathieson fit on one cathode 
-
-//
-//  Initialise global variables for fit
-    Double_t arglist[20];
-    Int_t ierflag=0;
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
-    clusterInput.Fitter()->SetFCN(fcnS2);
-    clusterInput.Fitter()->mninit(5,10,7);
-    clusterInput.Fitter()->SetPrintLevel(-1 + AliLog::GetGlobalDebugLevel());
-    arglist[0]=-1;
-    clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
-// Set starting values 
-    static Double_t vstart[5];
-    vstart[0]=fX[fIndLocal[0][cath]][cath];
-    vstart[1]=fY[fIndLocal[0][cath]][cath];    
-    vstart[2]=fX[fIndLocal[1][cath]][cath];
-    vstart[3]=fY[fIndLocal[1][cath]][cath];    
-    vstart[4]=Float_t(fQ[fIndLocal[0][cath]][cath])/
-       Float_t(fQ[fIndLocal[0][cath]][cath]+fQ[fIndLocal[1][cath]][cath]);
-// lower and upper limits
-    static Float_t lower[5], upper[5];
-    Int_t isec;
-
-    isec=fSeg2[cath]->Sector(fInput->DetElemId(),fIx[fIndLocal[0][cath]][cath], 
-                            fIy[fIndLocal[0][cath]][cath]);
-    lower[0]=vstart[0]-fSeg2[cath]->Dpx(fInput->DetElemId(),isec);
-    lower[1]=vstart[1]-fSeg2[cath]->Dpy(fInput->DetElemId(),isec);
-    
-    upper[0]=lower[0]+2.*fSeg2[cath]->Dpx(fInput->DetElemId(),isec);
-    upper[1]=lower[1]+2.*fSeg2[cath]->Dpy(fInput->DetElemId(),isec);
-    
-    isec=fSeg2[cath]->Sector(fInput->DetElemId(),fIx[fIndLocal[1][cath]][cath], 
-                            fIy[fIndLocal[1][cath]][cath]);
-    lower[2]=vstart[2]-fSeg2[cath]->Dpx(fInput->DetElemId(),isec)/2;
-    lower[3]=vstart[3]-fSeg2[cath]->Dpy(fInput->DetElemId(),isec)/2;
-    
-    upper[2]=lower[2]+fSeg2[cath]->Dpx(fInput->DetElemId(),isec);
-    upper[1]=lower[1]+2.*fSeg2[cath]->Dpy(fInput->DetElemId(),isec);
-
-    
-
-    lower[4]=0.;
-    upper[4]=1.;
-// step sizes
-    static Double_t step[5]={0.0005, 0.0005, 0.0005, 0.0005, 0.0001};
-    
-    clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
-    clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
-    clusterInput.Fitter()->mnparm(2,"x2",vstart[2],step[2],lower[2],upper[2],ierflag);
-    clusterInput.Fitter()->mnparm(3,"y2",vstart[3],step[3],lower[3],upper[3],ierflag);
-    clusterInput.Fitter()->mnparm(4,"a0",vstart[4],step[4],lower[4],upper[4],ierflag);
-// ready for minimisation      
-    arglist[0]= -1;
-    arglist[1]= 0;
-    
-    clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
-    clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
-    //    clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
-// Get fitted parameters
-    Double_t xrec[2], yrec[2], qfrac;
-    TString chname;
-    Double_t epxz, b1, b2;
-    Int_t ierflg;
-    clusterInput.Fitter()->mnpout(0, chname, xrec[0], epxz, b1, b2, ierflg);   
-    clusterInput.Fitter()->mnpout(1, chname, yrec[0], epxz, b1, b2, ierflg);   
-    clusterInput.Fitter()->mnpout(2, chname, xrec[1], epxz, b1, b2, ierflg);   
-    clusterInput.Fitter()->mnpout(3, chname, yrec[1], epxz, b1, b2, ierflg);   
-    clusterInput.Fitter()->mnpout(4, chname, qfrac,   epxz, b1, b2, ierflg);   
-
-    Double_t fmin, fedm, errdef;
-    Int_t   npari, nparx, istat;
-      
-    clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);  
-    fFitStat=istat;
-    return kTRUE;
-}
-
-Float_t AliMUONClusterFinderVS::CombiDoubleMathiesonFit(AliMUONRawCluster * /*c*/)
-{
-/// Perform combined double Mathieson fit on both cathode planes
-
-    Double_t arglist[20];
-    Int_t ierflag=0;
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
-    clusterInput.Fitter()->SetFCN(fcnCombiS2);
-    clusterInput.Fitter()->mninit(6,10,7);
-    clusterInput.Fitter()->SetPrintLevel(-1 + AliLog::GetGlobalDebugLevel());
-    arglist[0]=-1;
-    clusterInput.Fitter()->mnexcm("SET NOW", arglist, 0, ierflag);
-// Set starting values 
-    static Double_t vstart[6];
-    vstart[0]=fXInit[0];
-    vstart[1]=fYInit[0];
-    vstart[2]=fXInit[1];
-    vstart[3]=fYInit[1];
-    vstart[4]=fQrInit[0];
-    vstart[5]=fQrInit[1];
-// lower and upper limits
-    static Float_t lower[6], upper[6];
-    Int_t ix,iy,isec;
-    Float_t dpx, dpy;
-
-    fSeg2[1]->GetPadI(fInput->DetElemId(),fXInit[0], fYInit[0], fZPlane, ix, iy);
-    isec=fSeg2[1]->Sector(fInput->DetElemId(),ix, iy);
-    dpx=fSeg2[1]->Dpx(fInput->DetElemId(), isec);
-
-    fSeg2[0]->GetPadI(fInput->DetElemId(), fXInit[0], fYInit[0], fZPlane, ix, iy);
-    isec=fSeg2[0]->Sector(fInput->DetElemId(), ix, iy);
-    dpy=fSeg2[0]->Dpy(fInput->DetElemId(), isec);
-
-  
-
-    Int_t icount;
-    Float_t xdum, ydum, zdum;
-    AliDebug(1,Form("\n Cluster Finder: %f %f %f %f  ", fXInit[0], fXInit[1],fYInit[0], fYInit[1] ));
-
-    //  Find save upper and lower limits    
-    icount = 0;
-    
-    for (fSeg2[1]->FirstPad(fInput->DetElemId(),fXInit[0], fYInit[0], fZPlane, dpx, 0.); 
-        fSeg2[1]->MorePads(fInput->DetElemId()); 
-        fSeg2[1]->NextPad(fInput->DetElemId()))
-      {
-       ix=fSeg2[1]->Ix(); iy=fSeg2[1]->Iy();
-       //      if (fDigitMap[1]->TestHit(ix, iy) == kEmpty) continue;
-       fSeg2[1]->GetPadC(fInput->DetElemId(),ix,iy,upper[0],ydum,zdum);        
-       if (icount ==0) lower[0]=upper[0];
-       icount++;
-      }
-    if (lower[0]>upper[0]) {xdum=lower[0]; lower[0]=upper[0]; upper[0]=xdum;}    
-    //    vstart[0] = 0.5*(lower[0]+upper[0]);
-
-    
-    icount=0;
-    
-    for (fSeg2[0]->FirstPad(fInput->DetElemId(),fXInit[0], fYInit[0], fZPlane, 0., dpy); 
-        fSeg2[0]->MorePads(fInput->DetElemId()); 
-        fSeg2[0]->NextPad(fInput->DetElemId()))
-      {
-       ix=fSeg2[0]->Ix(); iy=fSeg2[0]->Iy();
-       //      if (fDigitMap[0]->TestHit(ix, iy) == kEmpty) continue;
-       fSeg2[0]->GetPadC(fInput->DetElemId(),ix,iy,xdum,upper[1],zdum);        
-       if (icount ==0) lower[1]=upper[1];
-       icount++;
-      }
-    
-    if (lower[1]>upper[1]) {xdum=lower[1]; lower[1]=upper[1]; upper[1]=xdum;}    
-    //     vstart[1] = 0.5*(lower[1]+upper[1]);
-
-
-    fSeg2[1]->GetPadI(fInput->DetElemId(),fXInit[1], fYInit[1], fZPlane, ix, iy);
-    isec=fSeg2[1]->Sector(fInput->DetElemId(),ix, iy);
-    dpx=fSeg2[1]->Dpx(fInput->DetElemId(),isec);
-    fSeg2[0]->GetPadI(fInput->DetElemId(),fXInit[1], fYInit[1], fZPlane, ix, iy);
-    isec=fSeg2[0]->Sector(fInput->DetElemId(),ix, iy);
-    dpy=fSeg2[0]->Dpy(fInput->DetElemId(),isec);
-
-
-    //  Find save upper and lower limits    
-
-    icount=0;
-    
-    for (fSeg2[1]->FirstPad(fInput->DetElemId(),fXInit[1], fYInit[1], fZPlane, dpx, 0); 
-        fSeg2[1]->MorePads(fInput->DetElemId()); 
-        fSeg2[1]->NextPad(fInput->DetElemId()))
-      {
-       ix=fSeg2[1]->Ix(); iy=fSeg2[1]->Iy();
-       //      if (fDigitMap[1]->TestHit(ix, iy) == kEmpty) continue;
-       fSeg2[1]->GetPadC(fInput->DetElemId(),ix,iy,upper[2],ydum,zdum);        
-       if (icount ==0) lower[2]=upper[2];
-       icount++;
-      }
-    if (lower[2]>upper[2]) {xdum=lower[2]; lower[2]=upper[2]; upper[2]=xdum;}    
-    //    vstart[2] = 0.5*(lower[2]+upper[2]);
-
-    icount=0;
-    
-    for (fSeg2[0]->FirstPad(fInput->DetElemId(),fXInit[1], fYInit[1], fZPlane, 0, dpy); 
-        fSeg2[0]-> MorePads(fInput->DetElemId()); 
-        fSeg2[0]->NextPad(fInput->DetElemId()))
-      {
-       ix=fSeg2[0]->Ix(); iy=fSeg2[0]->Iy();
-       //      if (fDigitMap[0]->TestHit(ix, iy) != kEmpty) continue;
-       
-       fSeg2[0]->GetPadC(fInput->DetElemId(),ix,iy,xdum,upper[3],zdum);        
-       if (icount ==0) lower[3]=upper[3];
-       icount++;
-
-      }
-    if (lower[3]>upper[3]) {xdum=lower[3]; lower[3]=upper[3]; upper[3]=xdum;}  
-    
-    lower[4]=0.;
-    upper[4]=1.;
-    lower[5]=0.;
-    upper[5]=1.;
-
-// step sizes
-    static Double_t step[6]={0.0005, 0.0005, 0.0005, 0.0005, 0.001, 0.001};
-    clusterInput.Fitter()->mnparm(0,"x1",vstart[0],step[0],lower[0],upper[0],ierflag);
-    clusterInput.Fitter()->mnparm(1,"y1",vstart[1],step[1],lower[1],upper[1],ierflag);
-    clusterInput.Fitter()->mnparm(2,"x2",vstart[2],step[2],lower[2],upper[2],ierflag);
-    clusterInput.Fitter()->mnparm(3,"y2",vstart[3],step[3],lower[3],upper[3],ierflag);
-    clusterInput.Fitter()->mnparm(4,"a0",vstart[4],step[4],lower[4],upper[4],ierflag);
-    clusterInput.Fitter()->mnparm(5,"a1",vstart[5],step[5],lower[5],upper[5],ierflag);
-// ready for minimisation      
-    arglist[0]= -1;
-    arglist[1]= 0;
-    
-    clusterInput.Fitter()->mnexcm("SET NOGR", arglist, 0, ierflag);
-    clusterInput.Fitter()->mnexcm("MIGRAD", arglist, 0, ierflag);
-    //    clusterInput.Fitter()->mnexcm("EXIT" , arglist, 0, ierflag);
-// Get fitted parameters
-    TString chname;
-    Double_t epxz, b1, b2;
-    Int_t ierflg;
-    clusterInput.Fitter()->mnpout(0, chname, fXFit[0],  epxz, b1, b2, ierflg); 
-    clusterInput.Fitter()->mnpout(1, chname, fYFit[0],  epxz, b1, b2, ierflg); 
-    clusterInput.Fitter()->mnpout(2, chname, fXFit[1],  epxz, b1, b2, ierflg); 
-    clusterInput.Fitter()->mnpout(3, chname, fYFit[1],  epxz, b1, b2, ierflg); 
-    clusterInput.Fitter()->mnpout(4, chname, fQrFit[0], epxz, b1, b2, ierflg); 
-    clusterInput.Fitter()->mnpout(5, chname, fQrFit[1], epxz, b1, b2, ierflg); 
-
-    Double_t fmin, fedm, errdef;
-    Int_t   npari, nparx, istat;
-      
-    clusterInput.Fitter()->mnstat(fmin, fedm, errdef, npari, nparx, istat);  
-    fFitStat=istat;
-    
-    fChi2[0]=fmin;
-    fChi2[1]=fmin;
-    return fmin;
-}
-
-void AliMUONClusterFinderVS::Split(AliMUONRawCluster* c)
-{
-/// One cluster for each maximum
-
-    Int_t i, j, cath;
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());
-    for (j=0; j<2; j++) {
-       AliMUONRawCluster cnew;
-       cnew.SetGhost(c->GetGhost());
-       for (cath=0; cath<2; cath++) {
-           cnew.SetChi2(cath,fChi2[0]);
-           // ?? why not cnew.fChi2[cath]=fChi2[cath];
-           
-           if (fNPeaks == 0) {
-               cnew.SetNcluster(0,-1);
-               cnew.SetNcluster(1,fNRawClusters);
-           } else {
-               cnew.SetNcluster(0,fNPeaks);
-               cnew.SetNcluster(1,0);
-           }
-           cnew.SetMultiplicity(cath,0);
-           cnew.SetX(cath, Float_t(fXFit[j]));
-           cnew.SetY(cath, Float_t(fYFit[j]));
-           cnew.SetZ(cath, fZPlane);
-           if (j==0) {
-               cnew.SetCharge(cath, Int_t(clusterInput.TotalCharge(cath)*fQrFit[cath]));
-           } else {
-               cnew.SetCharge(cath, Int_t(clusterInput.TotalCharge(cath)*(1-fQrFit[cath])));
-           }
-           fSeg2[cath]->SetHit(fInput->DetElemId(), fXFit[j],fYFit[j],fZPlane);
-
-           for (i=0; i<fMul[cath]; i++) {
-             Float_t q1;
-               cnew.SetIndex(cnew.GetMultiplicity(cath), cath, c->GetIndex(i,cath));
-
-               fSeg2[cath]->SetPad(fInput->DetElemId(),fIx[i][cath], fIy[i][cath]);
-               q1 = fInput->Mathieson()->IntXY(fInput->DetElemId(),fSeg2[cath]);
-               
-               cnew.SetContrib(i, cath, q1*Float_t(cnew.GetCharge(cath))/Float_t(fQ[i][cath]));
-               cnew.SetMultiplicity(cath, cnew.GetMultiplicity(cath)+1 );
-           }
-           FillCluster(&cnew,0,cath);
-       } // cathode loop
-       cnew.SetClusterType(cnew.PhysicsContribution());
-       if (cnew.GetCharge(0)>0 && cnew.GetCharge(1)>0) AddRawCluster(cnew);
-       fNPeaks++;
-    }
-}
-void AliMUONClusterFinderVS::AddRawCluster(AliMUONRawCluster& c)
-{
-/// Add a raw cluster copy to the list
-
-  // Setting detection element in raw cluster for alignment
-  // BB 19/05/05
-  c.SetDetElemId(fInput->DetElemId());
-  
-  TClonesArray &lrawcl = *fRawClusters;
-  new(lrawcl[fNRawClusters++]) AliMUONRawCluster(c);
-  AliDebug(1,Form("\nfNRawClusters %d\n",fNRawClusters));
-}
-
-AliMUONClusterFinderVS& AliMUONClusterFinderVS
-::operator = (const AliMUONClusterFinderVS& rhs)
-{
-// Protected assignement operator
-
-  if (this == &rhs) return *this;
-
-  AliFatal("Not implemented.");
-    
-  return *this;  
-}
-
-//
-// Minimisation functions
-// Single Mathieson
-void fcnS1(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
-{
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());    
-    Int_t i;
-    Float_t delta;
-    Float_t chisq=0;
-    Float_t qcont=0;
-    Float_t qtot=0;
-
-    for (i=0; i<clusterInput.Nmul(0); i++) {
-       Float_t q0=clusterInput.Charge(i,0);
-       Float_t q1=clusterInput.DiscrChargeS1(i,par);
-       delta=(q0-q1)/q0;
-       chisq+=delta*delta;
-       qcont+=q1;
-       qtot+=q0;
-    }
-    f=chisq;
-}
-
-void fcnCombiS1(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
-{
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());    
-    Int_t i, cath;
-    Float_t delta;
-    Float_t chisq=0;
-    Float_t qcont=0;
-    Float_t qtot=0;
-
-    for (cath=0; cath<2; cath++) {
-       for (i=0; i<clusterInput.Nmul(cath); i++) {
-           Float_t q0=clusterInput.Charge(i,cath);
-           Float_t q1=clusterInput.DiscrChargeCombiS1(i,par,cath);
-           delta=(q0-q1)/q0;
-           chisq+=delta*delta;
-           qcont+=q1;
-           qtot+=q0;
-       }
-    }
-    f=chisq;
-}
-
-// Double Mathieson
-void fcnS2(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
-{
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());    
-    Int_t i;
-    Float_t delta;
-    Float_t chisq=0;
-    Float_t qcont=0;
-    Float_t qtot=0;
-    
-    for (i=0; i<clusterInput.Nmul(0); i++) {
-
-       Float_t q0=clusterInput.Charge(i,0);
-       Float_t q1=clusterInput.DiscrChargeS2(i,par);
-       delta=(q0-q1)/q0;
-       chisq+=delta*delta;
-       qcont+=q1;
-       qtot+=q0;
-    }
-    f=chisq;
-}
-
-// Double Mathieson
-void fcnCombiS2(Int_t & /*npar*/, Double_t * /*gin*/, Double_t &f, Double_t *par, Int_t /*iflag*/)
-{
-    AliMUONClusterInput& clusterInput = *(AliMUONClusterInput::Instance());    
-    Int_t i, cath;
-    Float_t delta;
-    Float_t chisq=0;
-    Float_t qcont=0;
-    Float_t qtot=0;
-    for (cath=0; cath<2; cath++) {
-       for (i=0; i<clusterInput.Nmul(cath); i++) {
-           Float_t q0=clusterInput.Charge(i,cath);
-           Float_t q1=clusterInput.DiscrChargeCombiS2(i,par,cath);
-           delta=(q0-q1)/q0;
-           chisq+=delta*delta;
-           qcont+=q1;
-           qtot+=q0;
-       }
-    }
-    f=chisq;
-}
diff --git a/MUON/AliMUONClusterFinderVS.h b/MUON/AliMUONClusterFinderVS.h
deleted file mode 100644 (file)
index 0cedb06..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef ALIMUONCLUSTERFINDERVS_H
-#define ALIMUONCLUSTERFINDERVS_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-
-/// \ingroup rec
-/// \class AliMUONClusterFinderVS
-/// \brief Class for clustering and reconstruction of space points
-///
-/// (Not used by default)
-
-#include <TObject.h>
-
-class TClonesArray;
-
-class AliMUONClusterInput;
-class AliMUONDigitMapA1;
-class AliMUONGeometrySegmentation;
-class AliMUONRawCluster;
-class AliMUONDigit;
-
-
-class AliMUONClusterFinderVS : public TObject 
-{
- public:
-    AliMUONClusterFinderVS();
-    virtual ~AliMUONClusterFinderVS();
-/// Decluster ?
-    virtual void SetDeclusterFlag(Int_t flag=1) {fDeclusterFlag =flag;}
-/// Set max. cluster size ; bigger clusters will deconvoluted
-    virtual void SetClusterSize(Int_t clsize=5) {fClusterSize = clsize;}
-/// Set max. number of pads per local cluster
-    virtual void SetNperMax(Int_t npermax=5) {fNperMax = npermax;}
-// Search for raw clusters
-    virtual void  FindRawClusters();
-// Find cluster    
-    virtual void  FindCluster(Int_t i, Int_t j, Int_t cath, AliMUONRawCluster &c);
-// Decluster
-    virtual void Decluster(AliMUONRawCluster *cluster);
-//  Perform split by local maxima  
-    virtual void   SplitByLocalMaxima(AliMUONRawCluster *cluster);
-    virtual void   FindLocalMaxima(AliMUONRawCluster *cluster);
-    virtual void   Split(AliMUONRawCluster * cluster);
-//  Perform Double Mathieson Fit
-    Bool_t  DoubleMathiesonFit(AliMUONRawCluster *c, Int_t cath);
-    Float_t CombiDoubleMathiesonFit(AliMUONRawCluster *c);
-    Float_t SingleMathiesonFit(AliMUONRawCluster *c, Int_t cath);
-    Float_t CombiSingleMathiesonFit(AliMUONRawCluster *c);    
-//  Build up full cluster information    
-    virtual void   FillCluster(AliMUONRawCluster *cluster, Int_t flag, Int_t cath);
-    virtual void   FillCluster(AliMUONRawCluster *cluster, Int_t cath);
-/// \todo add comment    
-    virtual void   FillCluster(AliMUONRawCluster *cluster) {FillCluster(cluster,1,0);}
-// Add a new raw cluster    
-    virtual void AddRawCluster(AliMUONRawCluster& cluster);
-/// Set tracks for debugging    
-    virtual void SetTracks(Int_t t1, Int_t t2) {fTrack[0]=t1; fTrack[1]=t2;}
-/// Set cut in charge matching chi2
-    void SetGhostChi2Cut(Float_t cut) {fGhostChi2Cut = cut;}
-/// Get raw cluster pointer 
-    TClonesArray*  GetRawClusters() {return fRawClusters;}
-/// Reset raw clusters
-    void ResetRawClusters();
-/// Set evt number
-    void SetEventNumber(Int_t evtNumber) {fEvtNumber = evtNumber;}
-
- protected:
-
-    AliMUONClusterInput*          fInput;        //!< AliMUONClusterInput instance
-    AliMUONDigitMapA1*            fDigitMap[2];  ///< Hit Maps for cathode 1 and 2
-    AliMUONGeometrySegmentation*  fSeg2[2];      ///< New Segmentations for cathode 1 and 2
-
-    
-// Configuration    
-    Int_t                   fDeclusterFlag;      ///< flag for declusterin
-    Int_t                   fClusterSize;        ///< cluster size 
-    Int_t                   fNperMax;            ///< Maximum number of pads per peak
-    Float_t                 fGhostChi2Cut;       ///< \brief Cut in charge matching chi2
-                                                /// (2 degrees of freedom)
-                                                 /// Used by ghost removal
-    // Current decluster result    
-    Int_t                   fMul[2];             ///< current multiplicity
-    Int_t                   fNPeaks;             ///< number of local maxima
-    Int_t                   fNRawClusters;       ///< Number of Raw Clusters
-    TClonesArray*           fRawClusters;        ///< array of cluster per ch.
-
-    // Local data store    
-    AliMUONDigit*           fDig[100][2];        ///< current list of digits 
-    Int_t                   fIx[100][2];         ///< current list of x-pad-coord.
-    Int_t                   fIy[100][2];         ///< current list of y-pad-coord.
-    Float_t                 fX[100][2];          ///< current list of x-coord.
-    Float_t                 fY[100][2];          ///< current list of y-coord.
-    Float_t                 fZ[100][2];          ///< current list of z-coord.
-    Int_t                   fIndLocal[100][2];   ///< indices of local maxima
-    Int_t                   fNLocal[2];          ///< Number of local maxima
-    Float_t                   fQ[100][2];          ///< current list of charges
-    Float_t                 fZPlane;             ///< currenz z-plane position
-    Int_t                   fSector;             ///< current sector
-    
-    // Current Fit
-    Double_t                 fXFit[2];         ///< x-coordinate
-    Double_t                 fYFit[2];         ///< y-coordinate
-    Double_t                 fQrFit[2];        ///< charge ratio
-    Float_t                  fChi2[2];         ///< chi2 of fit
-    Float_t                  fXInit[2];        ///< start values
-    Float_t                  fYInit[2];        ///< start values
-    Float_t                  fQrInit[2];       ///< start values
-    Int_t                    fFitStat;         ///< status of fit
-    
-    // Selected track for debugging
-    Int_t                    fTrack[2];        ///< Only digits with main contributions from these tracks are
-    // considered 
-    
-    Int_t                    fEvtNumber;       ///< evt number for AZ
-    
- private:
-    /// Not implemented
-    AliMUONClusterFinderVS(const AliMUONClusterFinderVS& clusterFinder);
-    /// Not implemented assignment operator
-    AliMUONClusterFinderVS & operator = (const AliMUONClusterFinderVS& rhs);
-
-    ClassDef(AliMUONClusterFinderVS,3) //Class for clustering and reconstruction of space points
-      };
-#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/MUON/AliMUONClusterInput.cxx b/MUON/AliMUONClusterInput.cxx
deleted file mode 100644 (file)
index 159473f..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// ----------------------------
-// Class AliMUONClusterInput
-// ----------------------------
-// Global data service for hit reconstruction
-// Author: to be added
-
-#include "AliMUONClusterInput.h"
-
-#include "AliMUONGeometryTransformer.h"
-#include "AliMUONGeometrySegmentation.h"
-#include "AliMUONSegFactory.h"
-#include "AliMUONSegmentation.h"
-#include "AliMUONConstants.h"
-#include "AliMUONMathieson.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONDigit.h"
-
-#include "AliLog.h"
-
-#include <TClonesArray.h>
-#include <TClass.h>
-#include <TMinuit.h>
-#include <TGeoManager.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONClusterInput)
-/// \endcond
-
-AliMUONClusterInput*        AliMUONClusterInput::fgClusterInput = 0; 
-TMinuit*                    AliMUONClusterInput::fgMinuit = 0; 
-AliMUONMathieson*           AliMUONClusterInput::fgMathieson = 0; 
-AliMUONGeometryTransformer* AliMUONClusterInput::fgTransformer = 0; 
-AliMUONSegmentation*        AliMUONClusterInput::fgSegmentation = 0; 
-
-//______________________________________________________________________________
-AliMUONClusterInput::AliMUONClusterInput()
-  : TObject(),
-    fNseg(0),
-    fChamber(0),
-    fCluster(0),
-    fZ(0.),
-    fChargeCorrel(1.),
-    fDetElemId(0)
-  
-{
-/// Default constructor
-
-  fDigits[0]=0;
-  fDigits[1]=0;
-  fSegmentation2[0]=0;
-  fSegmentation2[1]=0;
-}
-
-//______________________________________________________________________________
-AliMUONClusterInput* AliMUONClusterInput::Instance()
-{
-/// return pointer to the singleton instance
-    if (fgClusterInput == 0) {
-       fgClusterInput = new AliMUONClusterInput();
-       fgMinuit = new TMinuit(8);
-       
-       // Create segmentation with activated Root geometry  
-       if ( ! gGeoManager ) {
-         AliFatalClass("Geometry not loaded.");
-         return fgClusterInput;
-       }  
-        fgTransformer = new AliMUONGeometryTransformer(true);
-        fgTransformer->ReadGeometryData("volpath.dat", gGeoManager);
-        AliMUONSegFactory factory(fgTransformer);
-       fgSegmentation = factory.CreateSegmentation(); 
-    }
-    
-    return fgClusterInput;
-}
-
-//______________________________________________________________________________
-AliMUONClusterInput::~AliMUONClusterInput()
-{
-/// Destructor
-    delete fgMinuit;
-    delete fgMathieson;
-    delete fgTransformer;
-    delete fgSegmentation;
-    fgMinuit = 0;
-    fgMathieson = 0;
-}
-
-//______________________________________________________________________________
-void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig1, TClonesArray* dig2)
-{
-  /// Set pointer to digits with corresponding segmentations and responses (two cathode planes)
-    fChamber = chamber;
-    fDetElemId = idDE;
-    fDigits[0]  = dig1;
-    fDigits[1]  = dig2; 
-    fNDigits[0] = dig1->GetEntriesFast();
-    fNDigits[1] = dig2->GetEntriesFast();
-    
-    delete fgMathieson;
-    fgMathieson = new AliMUONMathieson();
-
-    fSegmentation2[0]= fgSegmentation->GetModuleSegmentationByDEId(fDetElemId, 0);
-    fSegmentation2[1]= fgSegmentation->GetModuleSegmentationByDEId(fDetElemId, 1);
-
-    fNseg = 2;
-    if (chamber < AliMUONConstants::NTrackingCh()) {
-      if (chamber > 1 ) {
-       fgMathieson->SetPitch(AliMUONConstants::Pitch());
-       fgMathieson->SetSqrtKx3AndDeriveKx2Kx4(AliMUONConstants::SqrtKx3());
-       fgMathieson->SetSqrtKy3AndDeriveKy2Ky4(AliMUONConstants::SqrtKy3());
-       fChargeCorrel = AliMUONConstants::ChargeCorrel();
-      } else {
-       fgMathieson->SetPitch(AliMUONConstants::PitchSt1());
-       fgMathieson->SetSqrtKx3AndDeriveKx2Kx4(AliMUONConstants::SqrtKx3St1());
-       fgMathieson->SetSqrtKy3AndDeriveKy2Ky4(AliMUONConstants::SqrtKy3St1());
-       fChargeCorrel = AliMUONConstants::ChargeCorrelSt1();
-      }
-    }
-}
-
-//______________________________________________________________________________
-void AliMUONClusterInput::SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig)
-{
-/// Set pointer to digits with corresponding segmentations and responses (one cathode plane)
-
-    fChamber = chamber;
-    fDetElemId = idDE;
-    fDigits[0] = dig;
-
-    fSegmentation2[0]= fgSegmentation->GetModuleSegmentationByDEId(fDetElemId, 0);
-    fNseg=1;
-}
-
-//______________________________________________________________________________
-void  AliMUONClusterInput::SetCluster(AliMUONRawCluster* cluster)
-{
-/// Set the current cluster
-  //PH printf("\n %p \n", cluster);
-  fCluster=cluster;
-  Float_t qtot;
-  Int_t   i, cath, ix, iy;
-  AliMUONDigit* digit;
-  fNmul[0]=cluster->GetMultiplicity(0);
-  fNmul[1]=cluster->GetMultiplicity(1);
-  //PH printf("\n %p %p ", fDigits[0], fDigits[1]);
-  
-  for (cath=0; cath<2; cath++) {
-    qtot=0;
-    for (i=0; i<fNmul[cath]; i++) {
-      // pointer to digit
-      digit =(AliMUONDigit*)
-               (fDigits[cath]->UncheckedAt(cluster->GetIndex(i,cath)));
-           // pad coordinates
-           ix = digit->PadX();
-           iy = digit->PadY();
-           // pad charge
-           fCharge[i][cath] = digit->Signal();
-           // pad centre coordinates
-//         fSegmentation[cath]->GetPadCxy(ix, iy, x, y);
-            // globals kUsed in fitting functions
-           fix[i][cath]=ix;
-           fiy[i][cath]=iy;
-           // total charge per cluster
-           qtot+=fCharge[i][cath];
-           // Current z
-           Float_t xc, yc;
-           fSegmentation2[cath]->GetPadC(fDetElemId,ix,iy,xc,yc,fZ);
-       } // loop over cluster digits
-       fQtot[cath]=qtot;
-       fChargeTot[cath]=Int_t(qtot);  
-    }  // loop over cathodes
-}
-
-//______________________________________________________________________________
-Float_t AliMUONClusterInput::DiscrChargeS1(Int_t i,Double_t *par) 
-{
-/// Compute the charge on first cathod only.
-return DiscrChargeCombiS1(i,par,0);
-}
-
-//______________________________________________________________________________
-Float_t AliMUONClusterInput::DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath) 
-{
-/// \todo add comment
-/// - par[0]    x-position of cluster
-/// - param par[1]    y-position of cluster
-
-   Float_t q1;
-   fSegmentation2[cath]-> SetPad(fDetElemId, fix[i][cath], fiy[i][cath]);
-   //  First Cluster
-   fSegmentation2[cath]-> SetHit(fDetElemId, par[0],par[1],fZ);
-   q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
-       
-   Float_t value = fQtot[cath]*q1;
-   return value;
-}
-
-
-//______________________________________________________________________________
-Float_t AliMUONClusterInput::DiscrChargeS2(Int_t i,Double_t *par) 
-{
-/// \todo add comment
-/// - par[0]    x-position of first  cluster
-/// - par[1]    y-position of first  cluster
-/// - par[2]    x-position of second cluster
-/// - par[3]    y-position of second cluster
-/// - par[4]    charge fraction of first  cluster
-/// - 1-par[4]  charge fraction of second cluster
-
-  Float_t q1, q2;
-  
-  fSegmentation2[0]->SetPad(fDetElemId, fix[i][0], fiy[i][0]);
-  //  First Cluster
-  fSegmentation2[0]->SetHit(fDetElemId, par[0],par[1],fZ);
-  q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]);
-
-  //  Second Cluster
-  fSegmentation2[0]->SetHit(fDetElemId,par[2],par[3],fZ);
-  q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[0]);
-  
-  Float_t value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
-  return value;
-}
-
-//______________________________________________________________________________
-Float_t AliMUONClusterInput::DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath) 
-{
-/// \todo add comment
-/// - par[0]    x-position of first  cluster
-/// - par[1]    y-position of first  cluster
-/// - par[2]    x-position of second cluster
-/// - par[3]    y-position of second cluster
-/// - par[4]    charge fraction of first  cluster - first cathode
-/// - 1-par[4]  charge fraction of second cluster 
-/// - par[5]    charge fraction of first  cluster - second cathode
-
-  Float_t q1, q2;
-
-  fSegmentation2[cath]->SetPad(fDetElemId,fix[i][cath], fiy[i][cath]);
-  //  First Cluster
-  fSegmentation2[cath]->SetHit(fDetElemId,par[0],par[1],fZ);
-  q1 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
-  
-  //  Second Cluster
-  fSegmentation2[cath]->SetHit(fDetElemId,par[2],par[3],fZ);
-  q2 = fgMathieson->IntXY(fDetElemId, fSegmentation2[cath]);
-  
-  Float_t value;
-  if (cath==0) {
-    value = fQtot[0]*(par[4]*q1+(1.-par[4])*q2);
-  } else {
-    value = fQtot[1]*(par[5]*q1+(1.-par[5])*q2);
-  }
-  return value;
-}
diff --git a/MUON/AliMUONClusterInput.h b/MUON/AliMUONClusterInput.h
deleted file mode 100644 (file)
index 8aec46f..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef ALIMUONCLUSTERINPUT_H
-#define ALIMUONCLUSTERINPUT_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id $*/
-// Revision of includes 07/04/2006
-
-/// \ingroup rec
-/// \class AliMUONClusterInput
-/// \brief Global data service for hit reconstruction
-
-#include <TObject.h>
-#include <TClonesArray.h> // needed for inline function Digit
-
-class AliMUONDigit;
-class AliMUONRawCluster;
-class AliMUONMathieson;
-class AliMUONGeometryTransformer;
-class AliMUONSegmentation;
-class AliMUONGeometrySegmentation;
-
-class TMinuit;
-
-class AliMUONClusterInput : public TObject 
-{
- public:
-    virtual ~AliMUONClusterInput();
-    static AliMUONClusterInput* Instance();
-//  Configuration
-    void SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig1, TClonesArray* dig2);
-    void SetDigits(Int_t chamber, Int_t idDE, TClonesArray* dig);
-    void SetCluster(AliMUONRawCluster* cluster);
-// Access functions
-    /// Return the current chamber number
-    Int_t Chamber() const {return fChamber;}
-    /// Return i-th digit for given cath
-    AliMUONDigit* Digit(Int_t cath, Int_t i) const {return (AliMUONDigit*) (fDigits[cath]->UncheckedAt(i));}
-    /// Return the array of digits for given cathod 
-    TClonesArray* Digits(Int_t cath) const {return fDigits[cath];}
-    /// Return number of digits for given cathod 
-    Int_t NDigits(Int_t cath) const {return fNDigits[cath];}
-    /// Return geometry segmentation for given cathod 
-    AliMUONGeometrySegmentation* Segmentation2(Int_t cath) const {return fSegmentation2[cath];}
-
-    /// Return Mathieson    
-    AliMUONMathieson* Mathieson() const {return fgMathieson;}    
-    /// Return charge correlation
-    Float_t ChargeCorrel() const {return fChargeCorrel;}    
-    /// Return detection elt id
-    Int_t DetElemId() const {return fDetElemId;}
-
-// Fitting    
-    /// Return the fitter
-    TMinuit*      Fitter() const {return fgMinuit;}
-// Current cluster information    
-    /// Return the total charge for given cathod 
-    Float_t       TotalCharge(Int_t cath) const {return fChargeTot[cath];}
-    /// Return the charge for the given cluster and cathod
-    Float_t       Charge(Int_t dig, Int_t cath) const {return fCharge[dig][cath];}
-    /// Return the x-position for the given cluster and cathod
-    Int_t         Ix(Int_t dig, Int_t cath) const {return fix[dig][cath];}
-    /// Return the y-position for the given cluster and cathod
-    Int_t         Iy(Int_t dig, Int_t cath) const {return fiy[dig][cath];}
-    /// Return the cluster multiplicity for given cathod 
-    Int_t         Nmul(Int_t cath) const {return fNmul[cath];}
-
-//  Helpers for Fit     
-    Float_t DiscrChargeS1(Int_t i,Double_t *par);
-    Float_t DiscrChargeCombiS1(Int_t i,Double_t *par, Int_t cath);
-    Float_t DiscrChargeS2(Int_t i,Double_t *par);
-    Float_t DiscrChargeCombiS2(Int_t i,Double_t *par, Int_t cath);
-// 
- private:
-    /// Not implemented
-    AliMUONClusterInput();
-    /// Not implemented
-    AliMUONClusterInput(const AliMUONClusterInput& clusterInput);
-    /// Not implemented
-    AliMUONClusterInput & operator = (const AliMUONClusterInput& rhs);
-
-    static AliMUONClusterInput*  fgClusterInput;  //!< singleton instance
-    static AliMUONMathieson*     fgMathieson;     //!< Mathieson
-    static AliMUONGeometryTransformer*  fgTransformer;  //!< Geometry transformer
-    static AliMUONSegmentation*  fgSegmentation;  //!< Segmentation
-
-    // Digits
-    TClonesArray*        fDigits[2];       //!< Array of pointers to digits
-    Int_t                fNDigits[2];      //!< Number of digits
-    AliMUONGeometrySegmentation*     fSegmentation2[2]; //!< Geometry Segmentation per cathode
-
-    Int_t                fNseg;            //!< number of cathode planes
-    Int_t                fChamber;         //!< Current chamber number
-    
-    // Current cluster
-    AliMUONRawCluster*   fCluster;         //!< current cluster
-    Int_t                fNmul[2];         //!< current cluster multiplicity
-    // Digits contribuing to current cluster
-    Int_t                fix[500][2];      //!< List of x-positions for current cluster
-    Int_t                fiy[500][2];      //!< List of y-positions for current cluster
-    Float_t              fCharge[500][2];  //!< List of charges for current cluster
-    Int_t                fChargeTot[2];    //!< Total charge
-    Float_t              fQtot[2];         //!< Total charge
-    Float_t              fZ;               //!< Current z-position
-    Float_t              fChargeCorrel;    //!< charge correlation 
-    Int_t                fDetElemId;       //!< detection elt id    
-
-    // Fitter
-    static TMinuit*      fgMinuit;          //!< Fitter
-    ClassDef(AliMUONClusterInput, 0)        // Global data service for hit reconstruction
-};
-#endif
-
diff --git a/MUON/AliMUONData.cxx b/MUON/AliMUONData.cxx
deleted file mode 100644 (file)
index e0d5bfd..0000000
+++ /dev/null
@@ -1,744 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-/// \class AliMUONData
-///
-/// Class containing MUON data: hits, digits, rawclusters, globaltrigger, localtrigger, etc ..
-/// The classe makes the lik between the MUON data lists and the event trees from loaders
-///
-/// \author Gines Martinez, Subatech,  September 2003
-///
-
-#include "AliMUONData.h"
-#include "AliMUONDataIterator.h"
-#include "AliMUONConstants.h"
-#include "AliMUONDigit.h"
-#include "AliMUONGlobalTrigger.h"
-#include "AliMUONLocalTrigger.h"
-#include "AliMUONRegionalTrigger.h"
-#include "AliMUONTriggerCrateStore.h"
-#include "AliMUONTriggerCircuit.h"
-#include "AliMUONGeometryTransformer.h"
-#include "AliMUONRawCluster.h"
-
-#include "AliRunLoader.h"
-#include "AliStack.h"
-#include "AliLog.h"
-
-#include <TString.h>
-#include <TParticle.h>
-#include <TNtuple.h>
-#include <Riostream.h>
-#include <TFile.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONData)
-/// \endcond
-//_____________________________________________________________________________
-  AliMUONData::AliMUONData():
-    TNamed(),
-    fRunLoader(0x0),
-    fLoader(0x0),
-    fSDigits(0x0),
-    fDigits(0x0),
-    fGlobalTrigger(0x0),
-    fLocalTrigger(0x0),
-    fRegionalTrigger(0x0),
-    fNSdigits(0x0),
-    fNdigits(0x0),
-    fNglobaltrigger(0),
-    fNlocaltrigger(0),
-    fNregionaltrigger(0),
-    fSplitLevel(0),
-    fCurrentEvent(-1)
-{
-/// Default constructor
-}
-//_____________________________________________________________________________
-AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title):
-  TNamed(name,title),
-    fRunLoader(0x0),
-    fLoader(loader),
-    fSDigits(0x0),
-    fDigits(0x0),
-    fGlobalTrigger(0x0),
-    fLocalTrigger(0x0),
-    fRegionalTrigger(0x0),
-    fNSdigits(0x0),
-    fNdigits(0x0),
-    fNglobaltrigger(0),
-    fNlocaltrigger(0),
-    fNregionaltrigger(0),
-    fSplitLevel(0),
-    fCurrentEvent(-1)
-{
-/// Standard constructor
-}
-
-//_____________________________________________________________________________
-AliMUONData::AliMUONData(const char* galiceFile, const char* folderName):
-  TNamed("MUON", "MUON"),
-    fRunLoader(0x0),
-    fLoader(0x0),
-    fSDigits(0x0),
-    fDigits(0x0),
-    fGlobalTrigger(0x0),
-    fLocalTrigger(0x0),
-    fRegionalTrigger(0x0),
-    fNSdigits(0x0),
-    fNdigits(0x0),
-    fNglobaltrigger(0),
-    fNlocaltrigger(0),
-    fNregionaltrigger(0),
-    fSplitLevel(0),
-    fCurrentEvent(-1)
-{
-/// Constructor for loading data from gAlice file
-
-  fRunLoader = AliRunLoader::Open(galiceFile, folderName, "READ");
-  if (!fRunLoader) {
-    AliError(Form("Error opening %s file \n", galiceFile));
-    return;
-  }  
-
-  fLoader = fRunLoader->GetLoader("MUONLoader");
-  if ( ! fLoader ) {
-    AliError(Form("Could get MUONLoader"));
-    return;
-  }  
-}
-
-//_____________________________________________________________________________
-AliMUONData::~AliMUONData()
-{
-/// Destructor for AliMUONData
-  
-  if (fSDigits) {
-    fSDigits->Delete();
-    delete fSDigits;
-  }
-
-  if (fDigits) {
-    fDigits->Delete();
-    delete fDigits;
-  }
-  if (fGlobalTrigger){
-    fGlobalTrigger->Delete();
-    delete fGlobalTrigger;
-  }  
-  if (fRegionalTrigger){
-    fRegionalTrigger->Delete();
-    delete fRegionalTrigger;
-  }
-  if (fLocalTrigger){
-    fLocalTrigger->Delete();
-    delete fLocalTrigger;
-  }
-
-  if (fRunLoader) {
-    fRunLoader->UnloadAll();
-    delete fRunLoader;
-  }  
-}
-//_____________________________________________________________________________
-void AliMUONData::AddSDigit(Int_t id, const AliMUONDigit& Sdigit)
-{
-/// Add a MUON Sdigit to the list of SDigits of the detection plane id
-
-  TClonesArray &lSdigits = * SDigits(id) ; 
-  new(lSdigits[fNSdigits[id]++]) AliMUONDigit(Sdigit);
-}
-//_____________________________________________________________________________
-void AliMUONData::AddDigit(Int_t id, const AliMUONDigit& digit)
-{
-/// Add a MUON digit to the list of Digits of the detection plane id
-
-  TClonesArray &ldigits = * Digits(id) ; 
-  new(ldigits[fNdigits[id]++]) AliMUONDigit(digit);
-}
-
-//_____________________________________________________________________________
-void AliMUONData::AddGlobalTrigger(const AliMUONGlobalTrigger& trigger )
-{
-/// Add a MUON Global Trigger to the list (only one GlobalTrigger per event !);
-
-  TClonesArray &globalTrigger = *fGlobalTrigger;
-  new(globalTrigger[fNglobaltrigger++]) AliMUONGlobalTrigger(trigger);
-}
-
-//____________________________________________________________________________
-void AliMUONData::AddRegionalTrigger(const  AliMUONRegionalTrigger& trigger)
-{
-/// add a MUON regional Trigger to the list
-  TClonesArray &regionalTrigger = *fRegionalTrigger;
-  new(regionalTrigger[fNregionaltrigger++]) AliMUONRegionalTrigger(trigger);
-}
-//____________________________________________________________________________
-void AliMUONData::AddLocalTrigger(const  AliMUONLocalTrigger& trigger)
-{
-/// add a MUON Local Trigger to the list
-
-  TClonesArray &localTrigger = *fLocalTrigger;
-  new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(trigger);
-}
-
-//____________________________________________________________________________
-TClonesArray*  AliMUONData::SDigits(Int_t DetectionPlane) const
-{
-/// Getting List of SDigits
-
-  if (fSDigits)
-    return ( (TClonesArray*) fSDigits->At(DetectionPlane) );
-  else
-    return NULL;
-}
-//____________________________________________________________________________
-TClonesArray*  AliMUONData::Digits(Int_t DetectionPlane) const
-{
-/// Getting List of Digits
-
-  if (fDigits)
-    return ( (TClonesArray*) fDigits->At(DetectionPlane) );
-  else
-    return NULL;
-}
-//____________________________________________________________________________
-Bool_t   AliMUONData::IsDigitsBranchesInTree()
-{
-/// Checking if there are Digits Branches In TreeD
-
-  if (TreeD()==0x0) {
-    AliError("No treeD in memory");
-    return kFALSE;
-  }
-  else {
-     char branchname[30];
-     sprintf(branchname,"%sDigits1",GetName());
-     TBranch * branch = 0x0;
-     branch = TreeD()->GetBranch(branchname);
-     if (branch)  return kTRUE;
-     else return kFALSE;    
-  }
-}
-//____________________________________________________________________________
-Bool_t   AliMUONData::IsTriggerBranchesInTreeD()
-{
-/// Checking if there are Trigger Branches In TreeD
- if (TreeD()==0x0) {
-    AliError("No treeD in memory");
-    return kFALSE;
-  }
-  else {
-     char branchname[30];
-     sprintf(branchname,"%sLocalTrigger",GetName());
-     TBranch * branch = 0x0;
-     branch = TreeD()->GetBranch(branchname);
-     if (branch)  return kTRUE;
-     else return kFALSE;    
-  }
-}
-
-//____________________________________________________________________________
-void AliMUONData::Fill(Option_t* option)
-{
-/// Method to fill the trees
-
-  const char *cS   = strstr(option,"S");   // SDigits branches in TreeS
-  const char *cD   = strstr(option,"D");   // Digits branches in TreeD
-  const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeD
-  
-  char branchname[30];
-  TBranch * branch = 0x0;
-
-  // Filling TreeS
-  if ( TreeS() && cS) 
-  {
-    TreeS()->Fill();
-  }
-
-  // Filling TreeD
-
-  if ( TreeD() && cD && cGLT )
-  {
-    // Writing digits and (global+local) trigger at once.
-    TreeD()->Fill();
-  }
-  else
-  {
-    if ( TreeD() && cD ) 
-    {
-      if ( IsTriggerBranchesInTreeD() ) 
-      {
-        for (int i=0; i<AliMUONConstants::NCh(); i++) 
-        {
-          sprintf(branchname,"%sDigits%d",GetName(),i+1);
-          branch = TreeD()->GetBranch(branchname);
-          branch->Fill();
-        }
-      } 
-      else
-      {
-        TreeD()->Fill();
-      }
-    }
-    
-    if ( TreeD() && cGLT ) 
-    {
-      if ( IsDigitsBranchesInTree() ) 
-      {
-        sprintf(branchname,"%sLocalTrigger",GetName());
-        branch = TreeD()->GetBranch(branchname); 
-        branch->Fill();
-       sprintf(branchname,"%sRegionalTrigger",GetName());
-        branch = TreeD()->GetBranch(branchname);
-        branch->Fill();
-        sprintf(branchname,"%sGlobalTrigger",GetName());
-        branch = TreeD()->GetBranch(branchname);
-        branch->Fill();
-
-      } 
-      else
-      {
-        TreeD()->Fill();
-      }
-    }
-  } // end of TreeD() handling.
-}
-
-//_____________________________________________________________________________
-void AliMUONData::MakeBranch(Option_t* option)
-{
-/// Create Tree branches for the MUON.
-
-  const Int_t kBufferSize = 4000;
-  char branchname[30];
-  
-  //Setting Data Container
-  SetDataContainer(option);  
-
-  const char *cS   = strstr(option,"S");   // Digits branches in TreeS
-  const char *cD   = strstr(option,"D");   // Digits branches in TreeD
-  const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeD
-  
-  TBranch * branch = 0x0;
-  
-  //Creating Branches for SDigits
-  if (TreeS() && cS ) {
-    // one branch for Sdigits per chamber
-    for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
-      sprintf(branchname,"%sSDigits%d",GetName(),iDetectionPlane+1);
-      branch = 0x0;
-      branch = TreeS()->GetBranch(branchname);
-      if (branch) {  
-        AliInfo(Form("Branch %s is already in tree.",branchname));
-        return;
-      }
-      TClonesArray * sdigits = SDigits(iDetectionPlane); 
-      branch = TreeS()->Branch(branchname, &sdigits, kBufferSize,1);
-      //Info("MakeBranch","Making Branch %s for sdigits in detection plane %d\n",branchname,iDetectionPlane+1);
-    }
-  }
-
-  //Creating Branches for Digits
-  TTree* treeD = 0x0;
-  if ( cD || cGLT )
-  {
-    treeD = TreeD();
-  }
-
-  if ( treeD && cD ) 
-  {
-    // one branch for digits per chamber
-    for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) 
-    {
-      sprintf(branchname,"%sDigits%d",GetName(),iDetectionPlane+1);
-      branch = treeD->GetBranch(branchname);
-      if (branch) 
-      {  
-        AliInfo(Form("Branch %s is already in tree.",branchname));
-        return;
-      }
-      TClonesArray * digits = Digits(iDetectionPlane); 
-      branch = treeD->Branch(branchname, &digits, kBufferSize,1);
-    }
-  }
-  
-  if ( treeD && cGLT ) 
-  {
-    //
-    // one branch for global trigger
-    //
-    sprintf(branchname,"%sGlobalTrigger",GetName());
-    branch = treeD->GetBranch(branchname);
-    if (branch) 
-    {  
-      AliInfo(Form("Branch GlobalTrigger is already in treeD."));
-      return ;
-    }
-    branch = treeD->Branch(branchname, &fGlobalTrigger, kBufferSize);
-
-  //
-    // one branch for regional trigger
-    //  
-    sprintf(branchname,"%sRegionalTrigger",GetName());
-    branch = 0x0;
-    branch = treeD->GetBranch(branchname);
-    if (branch) 
-    {  
-      AliInfo(Form("Branch RegionalTrigger is already in treeD."));
-      return;
-    }
-    branch = treeD->Branch(branchname, &fRegionalTrigger, kBufferSize);
-  
-
-    //
-    // one branch for local trigger
-    //  
-    sprintf(branchname,"%sLocalTrigger",GetName());
-    branch = 0x0;
-    branch = treeD->GetBranch(branchname);
-    if (branch) 
-    {  
-      AliInfo(Form("Branch LocalTrigger is already in treeD."));
-      return;
-    }
-    branch = treeD->Branch(branchname, &fLocalTrigger, kBufferSize);
-  }
-}
-
-//____________________________________________________________________________
-TClonesArray*  
-AliMUONData::LocalTrigger() const
-{
-/// Getting local trigger
-
-  return fLocalTrigger;
-}
-
-//____________________________________________________________________________
-TClonesArray*  
-AliMUONData::RegionalTrigger() const
-{
-/// Getting regional trigger
-
-  return fRegionalTrigger;
-}
-
-//____________________________________________________________________________
-void
-AliMUONData::GetDigits() const 
-{
-/// Load the digits from TreeD for the current event.
-
-  Int_t event = fLoader->GetRunLoader()->GetEventNumber();
-  if ( fCurrentEvent != event )
-  {
-    if (fLoader->TreeD()) {
-      fLoader->TreeD()->GetEvent(0);
-      fCurrentEvent = event;
-    }
-  }
-}
-
-//____________________________________________________________________________
-TClonesArray*  
-AliMUONData::GlobalTrigger() const
-{
-/// Return the global trigger 
-
-  return fGlobalTrigger;
-}
-
-//____________________________________________________________________________
-void AliMUONData::ResetSDigits()
-{
-/// Reset number of Sdigits and the Sdigits array for this detector
-
-    if (fSDigits == 0x0) return;
-    for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
-      if ((*fSDigits)[i])    ((TClonesArray*)fSDigits->At(i))->Clear();
-      if (fNSdigits)  fNSdigits[i]=0;
-    }
-}
-//____________________________________________________________________________
-void AliMUONData::ResetDigits()
-{
-/// Reset number of digits and the digits array for this detector
-
-    if (fDigits == 0x0) return;
-    for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
-      if ((*fDigits)[i])    ((TClonesArray*)fDigits->At(i))->Clear("C");
-      if (fNdigits)  fNdigits[i]=0;
-    }
-}
-//_______________________________________________________________________________
-void AliMUONData::ResetTrigger()
-{
-/// Reset Local and Global Trigger 
-
-  fNglobaltrigger = 0;
-  if (fGlobalTrigger) fGlobalTrigger->Clear();
-  fNregionaltrigger = 0;
-  if (fRegionalTrigger) fRegionalTrigger->Clear();
-  fNlocaltrigger = 0;
-  if (fLocalTrigger) fLocalTrigger->Clear();
-
-}
-//____________________________________________________________________________
-void AliMUONData::SetDataContainer(Option_t* option)
-{
-/// Setting data containers of muon data
-
-  const char *cS   = strstr(option,"S");   // SDigits
-  const char *cD   = strstr(option,"D");   // Digits
-  const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger
-
-  AliDebug(1,Form("option=%s",option));
-  
-  //
-  // Container for Sdigits
-  if (cS) {
-    if (fSDigits == 0x0) { 
-      AliDebug(1,"Creating fSDigits TObjArray");
-      fSDigits = new TObjArray(AliMUONConstants::NCh());
-      fNSdigits= new Int_t[AliMUONConstants::NCh()];
-      for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
-       TClonesArray* a = new TClonesArray("AliMUONDigit",10000);
-       a->SetOwner();
-       fSDigits->AddAt(a,i);
-       AliDebug(1,Form("fSDigits[%d]=%p",i,a));
-        fNSdigits[i]=0;
-      }
-    }
-    else {
-      AliDebug(1,Form("fSDigits already there = %p",fSDigits));
-    }
-    ResetSDigits();
-  }  
-
-  //
-  // ObjArray of ClonesArrays for Digits
-  if ( cD ) {      
-    if (fDigits == 0x0 ) {
-      fDigits = new TObjArray(AliMUONConstants::NCh());
-      fNdigits= new Int_t[AliMUONConstants::NCh()];
-      for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
-       TClonesArray * tca = new TClonesArray("AliMUONDigit",10000);
-       tca->SetOwner();
-        fDigits->AddAt(tca,i); 
-        fNdigits[i]=0;
-      }
-    } 
-    else {
-      AliDebug(1,Form("fDigits already there = %p",fDigits));
-    }
-    ResetDigits();
-  }
-
-  //
-  // ClonesArrays for Trigger
-  if ( cGLT ) { 
-    if (fLocalTrigger == 0x0) {
-      fLocalTrigger  = new TClonesArray("AliMUONLocalTrigger",234);
-    }
-    if (fRegionalTrigger == 0x0) {
-      fRegionalTrigger  = new TClonesArray("AliMUONRegionalTrigger",16);
-    }
-    if (fGlobalTrigger== 0x0) {
-      fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1); 
-    }
-    ResetTrigger();
-  }
-}
-
-//____________________________________________________________________________
-void AliMUONData::SetTreeAddress(Option_t* option)
-{
-/// Setting Addresses to the events trees
-
-  // Setting Data containers
-  SetDataContainer(option);
-
-  const char *cS   = strstr(option,"S");   // SDigits branches in TreeS
-  const char *cD   = strstr(option,"D");   // Digits branches in TreeD
-  const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeD
-  
-  // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
-  char branchname[30];
-  TBranch * branch = 0x0;
-  
-  AliDebug(1,Form("option=%s",option));
-  
-  //
-  // Branch address for Sdigit tree
-  if (TreeS() && fSDigits && cS) {
-    AliDebug(1,"Setting branch addresses");
-    for (int i=0; i<AliMUONConstants::NCh(); i++) {
-      sprintf(branchname,"%sSDigits%d",GetName(),i+1);
-      if (fSDigits) {
-        AliDebug(1,Form("TreeS=%p for ich=%d branchname=%s",
-                        TreeS(),i,branchname));
-        branch = TreeS()->GetBranch(branchname);
-        TClonesArray * sdigits = SDigits(i);
-        if (branch) branch->SetAddress( &sdigits );
-        else AliWarning(Form("(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i));
-      }
-    }
-  }
-
-  //
-  // Branch address for digit tree
-  if (TreeD() && fDigits && cD) {
-    for (int i=0; i<AliMUONConstants::NCh(); i++) {
-      sprintf(branchname,"%sDigits%d",GetName(),i+1);
-      if (fDigits) {
-        branch = TreeD()->GetBranch(branchname);
-        TClonesArray * digits = Digits(i);
-        if (branch) {
-          branch->SetAddress( &digits );
-        }
-        else AliWarning(Form("(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i));
-      }
-    }
-  }
-  if ( TreeD()  && fLocalTrigger && cGLT) {
-    sprintf(branchname,"%sLocalTrigger",GetName());
-    branch = TreeD()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fLocalTrigger);
-    else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeD.",GetName()));
-  }
- if ( TreeD()  && fRegionalTrigger && cGLT) {
-    sprintf(branchname,"%sRegionalTrigger",GetName());
-    branch = TreeD()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fRegionalTrigger);
-    else AliWarning(Form("(%s) Failed for RegionalTrigger. Can not find branch in treeD.",GetName()));
-  }
-  if ( TreeD() && fGlobalTrigger && cGLT) {
-    sprintf(branchname,"%sGlobalTrigger",GetName());
-    branch = TreeD()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fGlobalTrigger);
-    else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName()));
-  }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONData::Print(Option_t* opt) const
-{
-/// Dump object on screen
-
-  TString options(opt);
-  options.ToUpper();
-  
-  if ( options.Contains("D") )
-  {
-    for ( Int_t ich = 0; ich < AliMUONConstants::NCh(); ++ich)
-    {
-      TClonesArray* digits = Digits(ich);
-      Int_t ndigits = digits->GetEntriesFast();
-      for ( Int_t id = 0; id < ndigits; ++id )
-      {
-        AliMUONDigit* digit = 
-          static_cast<AliMUONDigit*>(digits->UncheckedAt(id));
-        digit->Print();
-      }
-    }
-  }
-
-  if ( options.Contains("S") )
-  {
-    for ( Int_t ich = 0; ich < AliMUONConstants::NCh(); ++ich)
-    {
-      TClonesArray* digits = SDigits(ich);
-      Int_t ndigits = digits->GetEntriesFast();
-      for ( Int_t id = 0; id < ndigits; ++id )
-      {
-        AliMUONDigit* digit = 
-        static_cast<AliMUONDigit*>(digits->UncheckedAt(id));
-        digit->Print();
-      }
-    }
-  }  
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONData::DumpSDigits(Int_t event2Check, Option_t* opt)
-{
-/// Dump SDigits
-
-  fLoader->LoadSDigits("READ");
-  
-  // Event loop
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  for (Int_t ievent=0; ievent<nevents; ievent++) {
-    if (event2Check!=0) ievent=event2Check;
-    printf(">>> Event %d \n",ievent);
-
-    // Getting event ievent
-    fRunLoader->GetEvent(ievent);
-    SetTreeAddress("S");
-    GetSDigits();
-
-    // Loop on chambers
-    Int_t nchambers = AliMUONConstants::NCh(); ;
-    for (Int_t ichamber=0; ichamber<nchambers; ichamber++) {
-      TClonesArray* digits = SDigits(ichamber);
-
-      // Loop on Sdigits
-      Int_t ndigits = (Int_t)digits->GetEntriesFast();
-      for (Int_t idigit=0; idigit<ndigits; idigit++) {
-        AliMUONDigit* mDigit = static_cast<AliMUONDigit*>(digits->At(idigit));
-        mDigit->Print(opt);
-      }
-    }
-    ResetSDigits();
-    if (event2Check!=0) ievent=nevents;
-  }
-  fLoader->UnloadSDigits();
-}
-//_____________________________________________________________________________
-void 
-AliMUONData::DumpDigits(Int_t event2Check, Option_t* opt)
-{
-/// Dump digits
-
-  fLoader->LoadDigits("READ");
-  
-  // Event loop
-  Int_t firstEvent = 0;
-  Int_t lastEvent = fRunLoader->GetNumberOfEvents()-1;
-  if ( event2Check != 0 ) {
-    firstEvent = event2Check;
-    lastEvent = event2Check;
-  }  
-  
-  for ( Int_t ievent = firstEvent; ievent <= lastEvent; ++ievent ) {
-    printf(">>> Event %d \n",ievent);
-    fRunLoader->GetEvent(ievent);
-
-    AliMUONDataIterator it(this, "digit", AliMUONDataIterator::kTrackingChambers);
-    AliMUONDigit* digit;
-     while ( ( digit = (AliMUONDigit*)it.Next() ) )
-     {
-       digit->Print(opt);
-     }
-  } 
-  fLoader->UnloadDigits();
-}
diff --git a/MUON/AliMUONData.h b/MUON/AliMUONData.h
deleted file mode 100644 (file)
index baff514..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef ALIMUONDATA_H
-#define ALIMUONDATA_H
-//
-/*  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-//
-/// \ingroup base
-/// \class AliMUONData
-/// \brief Class containing MUON data: hits, digits, rawclusters, globaltrigger, 
-/// localtrigger, etc ...
-///
-//  Author: Gines Martinez, Subatech,  September 2003
-
-#include <TNamed.h>
-
-#include "AliLoader.h"
-
-class AliMUONDigit;
-class AliMUONLocalTrigger;
-class AliMUONRegionalTrigger;
-class AliMUONGlobalTrigger;
-
-class AliRunLoader;
-
-class TClonesArray;
-class TObjArray;
-class TTree;
-
-
-//__________________________________________________________________
-/////////////////////////////////////////////////////////////////////
-//                                                                 //
-//  class AliMUONData                                              //
-//                                                                 //
-/////////////////////////////////////////////////////////////////////
-
-class AliMUONData : public TNamed 
-{
-  public:
-  
-  //  enum EChamberIteration { kAllChambers, kTrackingChambers, kTriggerChambers };
-  
-    AliMUONData();
-    AliMUONData(AliLoader * loader, const char* name, const char* title);
-    AliMUONData(const char* galiceFile, const char* folderName);
-    virtual ~AliMUONData();  
-    virtual void   AddSDigit(Int_t id, const AliMUONDigit& digit); // use copy constructor
-    virtual void   AddDigit(Int_t id, const AliMUONDigit& digit); // use copy constructor
-
-    
-    virtual void   AddGlobalTrigger(const AliMUONGlobalTrigger& trigger); // use copy constructor
-
-    virtual void   AddLocalTrigger(const AliMUONLocalTrigger& trigger); // use copy constructor
-    virtual void   AddRegionalTrigger(const AliMUONRegionalTrigger& trigger); // use copy constructor
-
-
-    TClonesArray*  SDigits(Int_t DetectionPlane) const;
-    TClonesArray*  Digits(Int_t DetectionPlane) const;
-    TClonesArray*  LocalTrigger() const;
-    TClonesArray*  RegionalTrigger() const;
-    TClonesArray*  GlobalTrigger() const;    
-
-    void           GetSDigits() const;
-    void           GetDigits() const;
-    void           GetTriggerD() const;
-
-                   /// Return split level
-    Int_t          GetSplitLevel() const {return fSplitLevel;}
-
-                   /// Set split level
-    void           SetSplitLevel(Int_t SplitLevel) {fSplitLevel=SplitLevel;}
-
-    Bool_t        IsDigitsBranchesInTree();
-    Bool_t        IsTriggerBranchesInTreeD();
-
-                       /// Get loader
-    virtual AliLoader* GetLoader() const { return fLoader; }
-                       /// Set loader
-    virtual void       SetLoader(AliLoader * loader) {fLoader=loader;}    
-    
-    virtual void   Fill(Option_t* opt=" ");
-    virtual void   MakeBranch(Option_t *opt=" ");
-    virtual void   SetDataContainer(Option_t *opt=" ");
-    virtual void   SetTreeAddress(Option_t *opt=" ");
-    
-    virtual void Print(Option_t* opt="") const;
-    
-    virtual void   ResetSDigits();
-    virtual void   ResetDigits();
-    virtual void   ResetTrigger();
-  
-                   /// Return tree with summable digits
-    TTree*         TreeS() {return fLoader->TreeS(); }
-                   /// Return tree with digits
-    TTree*         TreeD() {return fLoader->TreeD(); }
-
-                   // Methods to dump data
-    void DumpSDigits(Int_t event2Check=0, Option_t* opt="tracks");
-    void DumpDigits(Int_t event2Check=0, Option_t* opt="tracks");
-    
-  protected: 
-    /// Not implemented
-    AliMUONData(const AliMUONData& rhs);
-    /// Not implemented
-    AliMUONData& operator=(const AliMUONData& rhs);
-
-    AliRunLoader*   fRunLoader; //!< Run loader pointer
-    AliLoader*      fLoader;  //!< Detector Loader pointer
-
-    TObjArray*      fSDigits; ///< One event in treeS and one branch per detection plane
-    TObjArray*      fDigits;  ///< One event in treeD and one branch per detection plane
-    TClonesArray*   fGlobalTrigger; ///< List of Global Trigger One event in TreeR/GlobalTriggerBranch
-    TClonesArray*   fLocalTrigger;  ///< List of Local Trigger, One event in TreeR/LocalTriggerBranch
-    TClonesArray*   fRegionalTrigger;  ///< List of Regional Trigger, One event in TreeR/LocalTriggerBranch
-
-    Int_t*          fNSdigits;//!< Number of Digits
-    Int_t*          fNdigits; //!< Number of Digits
-    Int_t           fNglobaltrigger;//!< Number of Global trigger
-    Int_t           fNlocaltrigger; //!< Number of Local trigger
-    Int_t           fNregionaltrigger; //!< Number of regional trigger
-    Int_t           fSplitLevel;   ///< Splitting of branches 0 no spitting (root files are smaller) 1 splitting (larger output files)
-
-    mutable Int_t fCurrentEvent; ///< Current event we're dealing with
-    
-private:  
-
-  ClassDef(AliMUONData,4) // Data accessor for MUON module
-      
-};
-// inline functions
-
-
-/// Load sdigits tree
-inline void AliMUONData::GetSDigits() const {
-  if (fLoader && fLoader->TreeS())
-    fLoader->TreeS()->GetEvent(0);
-}
-
-/// Load trigger D tree
-inline void AliMUONData::GetTriggerD() const {
-  if (fLoader && fLoader->TreeD())
-    fLoader->TreeD()->GetEvent(0);
-}
-
-
-#endif
-
diff --git a/MUON/AliMUONDataDigitIterator.cxx b/MUON/AliMUONDataDigitIterator.cxx
deleted file mode 100644 (file)
index 142c55a..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-// $Id$
-
-#include "AliMUONDataDigitIterator.h"
-
-#include "AliMUONData.h"
-#include "TClonesArray.h"
-
-///
-/// \class AliMUONDataDigitIterator
-///
-/// An iterator to access digits (stored into AliMUONData).
-///
-/// Iteration can occur on tracking chambers only, trigger chambers only,
-/// or both.
-///
-/// \author L. Aphecetche
-///
-
-/// \cond CLASSIMP
-ClassImp(AliMUONDataDigitIterator)
-/// \endcond
-
-//_____________________________________________________________________________
-AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONData* data,
-                                                   Int_t firstChamber, 
-                                                   Int_t lastChamber)
-: 
-AliMUONVDataIterator(),
-fData(data),
-fFirstChamber(firstChamber),
-fLastChamber(lastChamber),
-fDigits(0x0),
-fCurrentDigit(-1),
-fCurrentChamber(-1)
-{
-  /// Standard constructor
-  Reset();
-}
-
-//_____________________________________________________________________________
-AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONDataDigitIterator& rhs)
-: 
-AliMUONVDataIterator(),
-fData(0x0),
-fFirstChamber(-1),
-fLastChamber(-1),
-fDigits(0x0),
-fCurrentDigit(-1),
-fCurrentChamber(-1)
-{
-  /// Copy constructor
-
-  rhs.CopyTo(*this);
-}
-
-//_____________________________________________________________________________
-AliMUONDataDigitIterator::~AliMUONDataDigitIterator()
-{
-  /// Destructor
-}
-
-//_____________________________________________________________________________
-AliMUONDataDigitIterator&
-AliMUONDataDigitIterator::operator=(const AliMUONDataDigitIterator& rhs)
-{
-  /// Assignment operator
-
-  rhs.CopyTo(*this);
-  return *this;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONDataDigitIterator::CopyTo(AliMUONDataDigitIterator& destination) const
-{
-  /// Copy *this to destination
-  destination.fData=fData;
-  destination.fFirstChamber=fFirstChamber;
-  destination.fLastChamber=fLastChamber;
-  destination.fCurrentDigit=fCurrentDigit;
-  destination.fCurrentChamber=fCurrentChamber;
-  destination.fDigits=fDigits;
-}
-
-//_____________________________________________________________________________
-TObject*
-AliMUONDataDigitIterator::Next()
-{
-  /// Return current element and self-position to the next one.
-  
-  TObject* rv(0x0);
-  
-  if ( fDigits ) 
-  {
-    // get the pointer to be returned
-    rv = fDigits->At(fCurrentDigit);
-    // prepare for the next position, if it exists
-    if ( fCurrentDigit < fDigits->GetLast() ) 
-    {
-      ++fCurrentDigit;
-    }
-    else
-    {
-      fCurrentDigit = 0;
-      ++fCurrentChamber;
-      if ( fCurrentChamber <= fLastChamber )
-      {
-        fDigits = fData->Digits(fCurrentChamber);
-      }
-      else
-      {
-        fDigits = 0x0;
-      }
-    }
-  }
-  
-  return rv;
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliMUONDataDigitIterator::Remove()
-{
-  /// Remove current element.
-  
-  if ( fDigits ) 
-  {
-    fDigits->RemoveAt(fCurrentDigit);
-    fDigits->Compress();
-    return kTRUE;
-  }
-  
-  return kFALSE;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONDataDigitIterator::Reset()
-{
-  /// Reset the iterator
-  fData->GetDigits();
-  fCurrentDigit = 0;
-  fCurrentChamber = fFirstChamber;
-  fDigits = fData->Digits(fCurrentChamber);
-}
diff --git a/MUON/AliMUONDataDigitIterator.h b/MUON/AliMUONDataDigitIterator.h
deleted file mode 100644 (file)
index f2c651c..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef ALIMUONDATADIGITITERATOR_H
-#define ALIMUONDATADIGITITERATOR_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup base
-/// \class AliMUONDataDigitIterator
-/// \brief Iterator on digits (handled by AliMUONData).
-/// 
-//  Author: Laurent Aphecetche
-
-#ifndef ALIMUONVDATAITERATOR_H
-#  include "AliMUONVDataIterator.h"
-#endif
-
-class AliMUONData;
-class TClonesArray;
-
-class AliMUONDataDigitIterator : public AliMUONVDataIterator
-{
-public:
-  AliMUONDataDigitIterator(const AliMUONData* data, Int_t firstChamber, Int_t lastChamber);
-  AliMUONDataDigitIterator(const AliMUONDataDigitIterator& rhs);
-  AliMUONDataDigitIterator& operator=(const AliMUONDataDigitIterator& rhs);
-  virtual ~AliMUONDataDigitIterator();
-    
-  TObject* Next();
-  
-  void Reset(); 
-  
-  Bool_t Remove();
-  
-  Bool_t IsOwner() const { return kFALSE; }
-  
-private:
-    void CopyTo(AliMUONDataDigitIterator& destination) const;
-  
-private:
-  const AliMUONData* fData; //!< Pointer to data accessor
-  Int_t fFirstChamber;      //!< First chamber to iterate on
-  Int_t fLastChamber;       //!< Last chamber to iterate on      
-  TClonesArray* fDigits;    //!< Digits of the current chamber
-  Int_t fCurrentDigit;      //!< Current position within fDigits array
-  Int_t fCurrentChamber;    //!< Current chamber
-  
-  ClassDef(AliMUONDataDigitIterator,0) // Iterator on digits
-};      
-
-#endif
diff --git a/MUON/AliMUONDataIterator.cxx b/MUON/AliMUONDataIterator.cxx
deleted file mode 100644 (file)
index 79711c5..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-// $Id$
-
-#include "AliMUONDataIterator.h"
-
-#include "AliMUONConstants.h"
-#include "AliMUONData.h"
-#include "AliMUONDataDigitIterator.h"
-#include "TString.h"
-
-/// \class AliMUONDataIterator
-/// A wrapper to various iterators used to loop over
-/// objects handled by AliMUONData, like sdigits, digits, rawclusters, 
-/// and so on.
-/// Currently only implemented for digits, as a proof-of-principle.
-///
-/// \author Laurent Aphecetche
-
-/// \cond CLASSIMP
-ClassImp(AliMUONDataIterator)
-/// \endcond
-
-namespace
-{
-  void GetChamberNumbers(AliMUONDataIterator::EIterationStyle type, 
-                         Int_t& firstChamber, Int_t& lastChamber)
-{
-    switch ( type )
-    {
-      case AliMUONDataIterator::kAllChambers:
-        firstChamber=0;
-        lastChamber=AliMUONConstants::NCh()-1;
-        break;
-      case AliMUONDataIterator::kTrackingChambers:
-        firstChamber=0;
-        lastChamber=AliMUONConstants::NCh()-1;
-        break;
-      case AliMUONDataIterator::kTriggerChambers:
-        firstChamber=AliMUONConstants::NTrackingCh();
-        lastChamber=AliMUONConstants::NCh()-1;
-        break;
-      default:
-        firstChamber=lastChamber=-1;
-        break;
-    }
-}
-}
-
-//_____________________________________________________________________________
-AliMUONDataIterator::AliMUONDataIterator() 
-: 
-TObject(),
-fIterator(0x0)
-{
-/// Default constructor
-}
-
-//_____________________________________________________________________________
-AliMUONDataIterator::AliMUONDataIterator(AliMUONData* data,
-                                         const char* onWhatToIterate,
-                                         EIterationStyle howToIterate) 
-: 
-TObject(),
-fIterator(0x0)
-{
-/// Standard constructor
-
-  TString opt(onWhatToIterate);
-  opt.ToLower();
-  if ( opt.Contains("digit") || opt.Contains("d") )
-  {
-      Int_t firstChamber;
-      Int_t lastChamber;
-      GetChamberNumbers(howToIterate,firstChamber,lastChamber); 
-      if ( firstChamber >= 0 && lastChamber >= 0 )
-      {
-        data->GetLoader()->LoadDigits("READ");
-        data->SetTreeAddress("D,GLT");
-        fIterator = new AliMUONDataDigitIterator(data,firstChamber,lastChamber);
-      }
-  }
-}
-
-//_____________________________________________________________________________
-AliMUONDataIterator::~AliMUONDataIterator()
-{
-/// Destructor
-
-  delete fIterator;
-}
-
-//_____________________________________________________________________________
-TObject* 
-AliMUONDataIterator::Next() 
-{ 
-/// Set iterator to the next element
-
-  if (fIterator) return fIterator->Next(); 
-  return 0x0;
-}
-
-//_____________________________________________________________________________
-Bool_t 
-AliMUONDataIterator::Remove() 
-{
-/// Remove current element
-  if (fIterator) return fIterator->Remove(); 
-  return kFALSE;
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONDataIterator::Reset() 
-{ 
-/// Reset 
-
-  if (fIterator) fIterator->Reset(); 
-}
diff --git a/MUON/AliMUONDataIterator.h b/MUON/AliMUONDataIterator.h
deleted file mode 100644 (file)
index 0c3bf6d..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup base
-/// \class AliMUONDataIterator
-/// \brief An iterator on MUON data structures (so far only Digits).
-/// 
-//  Author Laurent Aphecetche
-
-#ifndef ALIMUONDATAITERATOR_H
-#define ALIMUONDATAITERATOR_H
-
-#ifndef ROOT_TObject
-#  include "TObject.h"
-#endif
-
-class AliMUONData;
-class AliMUONVDataIterator;
-
-class AliMUONDataIterator : public TObject
-{
-public:
-  /// Iteration style
-  enum EIterationStyle { kAllChambers, kTrackingChambers, kTriggerChambers };
-  
-  AliMUONDataIterator();
-  AliMUONDataIterator(AliMUONData* data, const char* onWhatToIterate,
-                      EIterationStyle howToIterate);
-  virtual ~AliMUONDataIterator();
-    
-  TObject* Next();
-  
-  Bool_t Remove();
-  
-  void Reset();
-  
-private:
-  AliMUONVDataIterator* fIterator; //!< the real worker   
-
-private:
-  /// Not implemented
-  AliMUONDataIterator(const AliMUONDataIterator& rhs);
-  /// Not implemented
-  AliMUONDataIterator& operator=(const AliMUONDataIterator& rhs);
-  
-  ClassDef(AliMUONDataIterator,0) // Iterator on MUON data structures.
-};
-
-#endif
diff --git a/MUON/AliMUONDetElement.cxx b/MUON/AliMUONDetElement.cxx
deleted file mode 100644 (file)
index 81fe1a7..0000000
+++ /dev/null
@@ -1,366 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// --------------------------
-// Class AliMUONDetElement
-// --------------------------
-// Detection element object containing information for combined 
-// cluster / track finder in the MUON arm 
-// Author: Alexander Zinchenko, JINR Dubna
-#include "AliMUONDetElement.h"
-#include "AliMUONSegmentation.h"
-#include "AliMUONDigit.h"
-#include "AliMUONHitMapA1.h"
-#include "AliMUONData.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONHitForRec.h"
-#include "AliMUONClusterInput.h"
-#include "AliMUONClusterFinderAZ.h"
-#include "AliMUONGeometryModuleTransformer.h" 
-#include "AliMUONSegmentation.h"
-#include "AliMUONGeometrySegmentation.h" 
-#include "AliMUONVGeometryDESegmentation.h" 
-#include "AliMpVSegmentation.h" 
-
-#include "AliRun.h"
-#include "AliLog.h"
-
-#include <TObjArray.h>
-#include <TClonesArray.h>
-#include <TVector2.h> 
-
-/// \cond CLASSIMP
-ClassImp(AliMUONDetElement) // Class implementation in ROOT context
-/// \endcond
-  FILE *lun = 0x0; //fopen("hitmap.dat","w");
-
-//_________________________________________________________________________
-AliMUONDetElement::AliMUONDetElement()
-  : TObject(),
-    fidDE(0),
-    fIndex(0),
-    fChamber(0),
-    fZ(0.),
-    fNHitsForRec(0),
-    fRawClus(0x0),
-    fHitsForRec(0x0),
-    fRecModel(0x0)
-{
-  /// Default constructor
-  for (Int_t i = 0; i < 2; i++) {
-    fHitMap[i] = NULL;
-    fDigits[i] = NULL;
-    fSeg[i] = NULL;
-  }
-} 
-
-//_________________________________________________________________________
-AliMUONDetElement::AliMUONDetElement(Int_t idDE, AliMUONDigit *dig, AliMUONClusterFinderAZ *recModel,
-                                     AliMUONSegmentation* segmentation) 
-  : TObject(),
-    fidDE(idDE),
-    fIndex(0),
-    fChamber(idDE / 100 - 1),
-    fZ(0.),
-    fNHitsForRec(0),
-    fRawClus(new TObjArray(10)),
-    fHitsForRec(new TObjArray(10)),
-    fRecModel(recModel)
-{
-  /// Constructor
-  fRawClus->SetOwner(kTRUE);
-  fHitsForRec->SetOwner(kTRUE);
-  fDigits[0] = new TObjArray(20);
-  fDigits[1] = new TObjArray(20);
-  fDigits[0]->SetOwner(kTRUE);
-  fDigits[1]->SetOwner(kTRUE);
-
-  // Segmentations
-  fSeg[0] = segmentation->GetModuleSegmentationByDEId(idDE, 0);
-  fSeg[1] = segmentation->GetModuleSegmentationByDEId(idDE, 1);
-  
-  /*
-  Float_t x, y, z;
-  fSeg[dig->Cathode()]->GetPadC(fidDE, dig->PadX(), dig->PadY(), x, y, z);
-  fZ = z;
-  */
-  AddDigit(dig);
-}
-
-//_________________________________________________________________________
-AliMUONDetElement::~AliMUONDetElement()
-{
-  /// Destructor
-  for (Int_t i = 0; i < 2; i++) {
-    delete fHitMap[i]; 
-    delete fDigits[i]; 
-  }
-  delete fRawClus;
-  for (Int_t i = 0; i < fNHitsForRec; i++) {
-    Int_t ntracks = ((AliMUONHitForRec*)fHitsForRec->UncheckedAt(i))->GetNTrackHits();
-    //cout << ntracks << endl;
-    if (ntracks) fHitsForRec->RemoveAt(i);
-  }
-  delete fHitsForRec;
-  //fHitsForRec->SetOwner(kFALSE);
-  //fHitsForRec->Clear(); cout << " here " << fHitsForRec->GetEntriesFast() << endl; delete fHitsForRec; fHitsForRec = 0;
-}
-
-//_________________________________________________________________________
-Int_t AliMUONDetElement::Compare(const TObject* detElem) const
-{
-  /// "Compare" function to sort in Z (towards interaction point)
-  /// Returns -1 (0, +1) if charge of current pixel
-  /// is greater than (equal to, less than) charge of pixel
-  if (fZ > ((AliMUONDetElement*)detElem)->Z()) return(+1);
-  else if (fZ == ((AliMUONDetElement*)detElem)->Z()) return( 0);
-  else return(-1);
-}
-
-//_________________________________________________________________________
-void AliMUONDetElement::Fill(AliMUONData */*data*/)
-{
-  /// Fill hit maps
-  fLeft[0] = fDigits[0]->GetEntriesFast();
-  fLeft[1] = fDigits[1]->GetEntriesFast();
-
-  Int_t  npx0  = fSeg[0]->Npx(fidDE)+1;
-  Int_t  npy0  = fSeg[0]->Npy(fidDE)+1;
-  fHitMap[0] = new AliMUONHitMapA1(npx0, npy0, fDigits[0]);
-  fHitMap[0]->FillHits();
-
-  Int_t  npx1  = fSeg[1]->Npx(fidDE)+1;
-  Int_t  npy1  = fSeg[1]->Npy(fidDE)+1;
-  fHitMap[1] = new AliMUONHitMapA1(npx1, npy1, fDigits[1]);
-  fHitMap[1]->FillHits();
-
-  // The part below is just for debugging (fill rec. points already found)
-  /*
-  fLeft[0] = fLeft[1] = 0;
-  TClonesArray *rawClus = data->RawClusters(fChamber);
-  cout << rawClus << " " << rawClus->GetEntriesFast() << endl;
-  for (Int_t i = 0; i < rawClus->GetEntriesFast(); i++) {
-    AliMUONRawCluster *recP = (AliMUONRawCluster*) rawClus->UncheckedAt(i);
-    cout << fChamber << " " << recP->GetZ(0) << " " << recP->GetZ(1) << " " << fZ << endl;
-    if (TMath::Abs(recP->GetZ(0)-fZ) > 0.5) continue;
-    if (!Inside(recP->GetX(0), recP->GetY(0), recP->GetZ(0))) continue;
-    AddHitForRec(recP); // add hit for rec.
-    rawClus->RemoveAt(i); // remove
-  }
-  cout << fHitsForRec->GetEntriesFast() << endl;
-  rawClus->Compress();
-  */
-}
-
-//_________________________________________________________________________
-void AliMUONDetElement::AddDigit(AliMUONDigit *dig)
-{
-  /// Add digit
-
-  //fDigits[dig->Cathode()]->Add(dig);
-  fDigits[dig->Cathode()]->Add(new AliMUONDigit(*dig));
-  Float_t x, y, z;
-  fSeg[dig->Cathode()]->GetPadC(fidDE, dig->PadX(), dig->PadY(), x, y, z);
-  fZ += z;
-  /*
-  Int_t ndig = fDigits[dig->Cathode()]->GetEntriesFast();
-  new((*fDigits[dig->Cathode()])[ndig]) AliMUONDigit(*dig);
-  */
-}
-
-//_________________________________________________________________________
-Bool_t AliMUONDetElement::Inside(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy) const
-{
-  /// Check if point is inside detection element
-
-  dx = TMath::Max (dx, 1.);
-  dy = TMath::Max (dy, 1.);
-  Int_t ix, iy;
-  ix = iy = 0;
-  Double_t xl, yl, zl;
-  for (Int_t i = 0; i < 2; i++) {
-    if (!fSeg[i]) continue;
-    if (i == 0 || fSeg[0] == 0x0) {
-      fSeg[i]->GetTransformer()->Global2Local(fidDE, x, y, z, xl, yl, zl);
-      //cout << xl << " " << yl << " " << zl << endl;
-      if (TMath::Abs (zl) > 0.5) return kFALSE;
-      //if (fChamber < 4 && (xl < 0 || yl < 0)) return kFALSE;
-    }
-    fSeg[i]->GetPadI(fidDE, x, y, z, ix, iy);
-    //cout << x << " " << y << " " << z << " " << fChamber << " " << ix << " " << iy << " " << fSeg[i]->Npx(fidDE) << " " << fSeg[i]->Npy(fidDE) /*<< " " << fSeg[i]->GetPadI(fidDE, x, y, z, ix, iy)*/ << " " << fSeg[i]->HasPad(fidDE, (Float_t)x, (Float_t)y, (Float_t)z) << endl; 
-    //if (ix > 0 && iy > 0 && ix <= fSeg[i]->Npx(fidDE) && iy <= fSeg[i]->Npy(fidDE)) return kTRUE;
-    if (fSeg[i]->HasPad(fidDE, (Float_t)x, (Float_t)y, (Float_t)z)) return kTRUE;
-  }
-  //Double_t xl, yl, zl;
-  //fSeg[0]->GetTransformer()->Global2Local(fidDE, x, y, z, xl, yl, zl);
-  //cout << xl << " " << yl << " " << zl << endl;
-
-  Int_t cath = fSeg[0] ? 0 : 1;
-  const AliMpVSegmentation *mpSeg = fSeg[cath]->GetDESegmentation(fidDE)->GetMpSegmentation();
-  TVector2 dim = mpSeg->Dimensions(); 
-  if (fChamber < 4) dim *= 2.; // quadrants
-  //cout << fChamber << " " << dim.X() << " " << dim.Y() << endl;
-  if (TMath::Abs (xl) - dim.X() > dx) return kFALSE;
-  if (TMath::Abs (yl) - dim.Y() > dy) return kFALSE;
-
-  Int_t flagX = 0, flagY = 0;
-  if (TMath::Abs (xl) - dim.X() < -2) flagX = 1;
-  if (TMath::Abs (yl) - dim.Y() < -2) flagY = 1;
-  if (flagX && flagY) flagX = flagY = 0; // both coordinates "inside" det. elem. limits
-
-  // Check for edge effect (extrapolated track "right outside" det. elem. boundaries 
-  // (+- dx * cath in X and Y)
-  dx /= 2;
-  dy /= 2;
-  for (Int_t i = 0; i < 2; i++) {
-    if (!fSeg[i]) continue;
-    for (Int_t idx = -1; idx < 2; idx++) {
-      if (flagX && idx) continue;
-      Double_t x1 = x + dx * idx * (i + 1);
-      for (Int_t idy = -1; idy < 2; idy++) {
-       if (idx == 0 && idy == 0) continue;
-       if (flagY && idy) continue;
-       Double_t y1 = y + dy * idy * (i + 1);
-       fSeg[i]->GetPadI(fidDE, x1, y1, z, ix, iy);
-       //cout << x1 << " " << y1 << " " << z << " " << fChamber << " " << ix << " " << iy << " " << fSeg[i]->Npx(fidDE) << " " << fSeg[i]->Npy(fidDE) /*<< " " << fSeg[i]->GetPadI(fidDE, x, y, z, ix, iy)*/ << " " << fSeg[i]->HasPad(fidDE, (Float_t)x1, (Float_t)y1, (Float_t)z) << endl; 
-       //if (ix > 0 && iy > 0 && ix <= fSeg[i]->Npx(fidDE) && iy <= fSeg[i]->Npy(fidDE)) return kTRUE;
-       if (fSeg[i]->HasPad(fidDE, (Float_t)x1, (Float_t)y1, (Float_t)z)) return kTRUE;
-      }
-    }
-  }
-  return kFALSE;
-}
-
-//_________________________________________________________________________
-void AliMUONDetElement::ClusterReco(Double_t xTrack, Double_t yTrack, Double_t dx, Double_t dy)
-{
-  /// Run cluster reconstruction around point (x,y) inside window (dx,dy)
-
-  if (fLeft[0] == 0 && fLeft[1] == 0) return; // all digits have been used 
-  AliMUONClusterInput::Instance()->SetDigits(fChamber, fidDE, 
-             (TClonesArray*)fDigits[0], (TClonesArray*)fDigits[1]);
-
-  // Mark used pads
-  for (Int_t cath = 0; cath < 2; cath++) {
-    Int_t ndig = fDigits[cath]->GetEntriesFast();
-    if (ndig == 0) continue; // empty cathode
-    //cout << fidDE << " " << cath << " " << ndig << endl; 
-    for (Int_t i = 0; i < ndig; i++) {
-      if (fLeft[cath] == 0) { fRecModel->SetUsed(cath,i); continue; }
-      AliMUONDigit *dig = (AliMUONDigit*) fDigits[cath]->UncheckedAt(i);
-      //cout << i << " " << dig << " " /*<< dig->PadX() << " " << dig->PadY() << " " << fHitMap[cath]->TestHit(dig->PadX(), dig->PadY()) */<< endl;
-      if (fHitMap[cath]->TestHit(dig->PadX(), dig->PadY()) == kUsed) fRecModel->SetUsed(cath,i);
-      else fRecModel->SetUnused(cath,i);
-    }
-  }
-
-  fRecModel->ResetRawClusters();
-
-  for (Int_t cath = 0; cath < 2; cath++) {
-    Int_t ndig = fDigits[cath]->GetEntriesFast();
-    if (ndig == 0) continue; // empty cathode
-    // Loop over pads
-    for (fSeg[cath]->FirstPad(fidDE, xTrack, yTrack, fZ, dx, dy);
-        fSeg[cath]->MorePads(fidDE);
-        fSeg[cath]->NextPad(fidDE)) {
-      if (fLeft[cath] == 0) break;
-      //cout << cath << " " << fSeg[cath]->Ix() << " " << fSeg[cath]->Iy() << " " << fSeg[cath]->DetElemId() << " " << fHitMap[cath]->TestHit(fSeg[cath]->Ix(), fSeg[cath]->Iy()) << endl;
-      if (fHitMap[cath]->TestHit(fSeg[cath]->Ix(), fSeg[cath]->Iy()) == kEmpty ||
-         fHitMap[cath]->TestHit(fSeg[cath]->Ix(), fSeg[cath]->Iy()) == kUsed) continue;
-
-      Int_t iOK = 0;
-      // Set starting pad
-      for (Int_t j = 0; j < ndig; j++) {
-       AliMUONDigit *dig = (AliMUONDigit*) fDigits[cath]->UncheckedAt(j);
-       if (dig->PadX() != fSeg[cath]->Ix() || dig->PadY() != fSeg[cath]->Iy()) continue;
-       //cout << fidDE << " " << j << " " << fDigits[cath]->GetEntriesFast() << " " << fSeg[cath]->Ix() << " " << fSeg[cath]->Iy() << endl;
-       fRecModel->SetStart(cath, j);
-       iOK = 1;
-       break;
-      }
-      if (!iOK) continue;
-
-      fRecModel->FindRawClusters();
-      Int_t nClusEnd = fRecModel->GetRawClusters()->GetEntriesFast();
-      //cout << " ***nclus: " << nClusEnd << endl;
-      for (Int_t i = 0; i < nClusEnd; i++) {
-       AliMUONRawCluster *clus = (AliMUONRawCluster*) fRecModel->GetRawClusters()->UncheckedAt(i);
-       AddHitForRec(clus); // add hit for rec.
-       //cout << clus->GetX(0) << " " << clus->GetY(0) << endl;
-      }
-      // Mark used pads
-      for (Int_t cath1 = 0; cath1 < 2; cath1++) {
-       Int_t ndig1 = fDigits[cath1]->GetEntriesFast();
-       for (Int_t j = 0; j < ndig1; j++) {
-         if (fLeft[cath1] == 0) break;
-         AliMUONDigit *dig = (AliMUONDigit*) fDigits[cath1]->UncheckedAt(j);
-         Float_t x, y, z;
-         fSeg[cath1]->GetPadC(fidDE,dig->PadX(),dig->PadY(),x,y,z);
-         //cout << "clus " << cath1 << " " << fLeft[cath1] << " " << dig->PadX() << " " << dig->PadY() << " " << x << " " << y << " " << z << " " << fRecModel->GetUsed(cath1,j) << endl;
-         if (!fRecModel->GetUsed(cath1,j)) continue;
-         if (fHitMap[cath1]->TestHit(dig->PadX(), dig->PadY()) == kUsed) continue;
-         fHitMap[cath1]->FlagHit(dig->PadX(), dig->PadY());
-         if (lun) fprintf(lun," %d %d %d %d \n", cath1, fidDE, dig->PadX(), dig->PadY());
-         fLeft[cath1]--;
-       }
-      }
-    } // for (fSeg[cath]->FirstPad(...
-  } // for (Int_t cath = 0;
-}
-
-//_________________________________________________________________________
-void AliMUONDetElement::AddHitForRec(AliMUONRawCluster *clus)
-{
-  /// Make HitForRec from raw cluster (rec. point)
-
-  fRawClus->Add(new AliMUONRawCluster(*clus));
-  //AliMUONHitForRec *hitForRec = 
-  //new ((*fHitsForRec)[fNHitsForRec++]) AliMUONHitForRec(clus);
-  AliMUONHitForRec *hitForRec = new AliMUONHitForRec(clus);
-  fHitsForRec->Add(hitForRec);
-  fNHitsForRec++;
-
-  // more information into HitForRec
-  //  resolution: info should be already in raw cluster and taken from it ????
-  //hitForRec->SetBendingReso2(-1); //fBendingResolution * fBendingResolution);
-  //hitForRec->SetNonBendingReso2(-1); //fNonBendingResolution * fNonBendingResolution);
-  hitForRec->SetBendingReso2(clus->GetErrY() * clus->GetErrY());
-  hitForRec->SetNonBendingReso2(clus->GetErrX() * clus->GetErrX());
-  //  original raw cluster
-  hitForRec->SetChamberNumber(fChamber);
-  hitForRec->SetZ(clus->GetZ(0));
-  //hitForRec->SetHitNumber(-(fIndex+1)*100000-fNHitsForRec+1);
-  hitForRec->SetHitNumber(-(fIndex+1)*100000-fRawClus->GetEntriesFast()+1);
-  //delete clus; // for now
-}
-
-/*
-//_________________________________________________________________________
-Int_t AliMUONDetElement::GetMapElem(AliMUONDigit *digit)
-{
-  Int_t cath = digit->Cathode();
-  return 0;
-
-}
-
-//_________________________________________________________________________
-void AliMUONDetElement::SetMapElem(const AliMUONDigit *digit, Int_t flag)
-{
-  Int_t cath = digit->Cathode();
-}
-*/
diff --git a/MUON/AliMUONDetElement.h b/MUON/AliMUONDetElement.h
deleted file mode 100644 (file)
index a17ddfd..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef ALIMUONDETELEMENT_H
-#define ALIMUONDETELEMENT_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup rec
-/// \class AliMUONDetElement
-/// \brief Detection element object containing information for combined 
-/// cluster / track finder in the MUON arm 
-///
-/// \author Alexander Zinchenko, JINR Dubna
-#include <TObject.h>
-class TObjArray;
-class TClonesArray;
-class AliMUONDigit;
-class AliMUONHitMapA1;
-class AliMUONSegmentation;
-class AliMUONGeometrySegmentation;
-class AliMUONData;
-class AliMUONRawCluster;
-class AliMUONClusterFinderAZ;
-
-class AliMUONDetElement : public TObject 
-{
- public:
-
-  AliMUONDetElement();
-  AliMUONDetElement(Int_t idDE, AliMUONDigit *dig, 
-                    AliMUONClusterFinderAZ *recModel, AliMUONSegmentation* segmentation); // constructor
-  virtual ~AliMUONDetElement(); // Destructor
-
-  Int_t IdDE(void) const { return fidDE; } ///< det. elem. ID
-  Int_t Chamber(void) const { return fChamber; } ///< chamber No
-  Double_t Z(void) const { return fZ; } ///< Z-coordinate
-  Int_t Left(Int_t cath) const { return fLeft[cath]; } ///< number of unused digits
-  //Int_t GetMapElem(AliMUONDigit *digit) const; ///< get map element
-  TObjArray *Digits(Int_t cath) const { return fDigits[cath]; } ///< array of digits
-  TObjArray *RawClusters() const { return fRawClus; } ///< array of raw clusters
-  TObjArray *HitsForRec() const { return fHitsForRec; } ///< hits for rec.
-  Int_t NHitsForRec() const { return fNHitsForRec; } ///< No. of hits for rec.
-  //Bool_t Inside(Double_t x, Double_t y, Double_t z) const; // check if point inside DE
-  Bool_t Inside(Double_t x, Double_t y, Double_t z, Double_t dx, Double_t dy) const; // check if point inside DE
-  
-  void SetID(Int_t idDE) { fidDE = idDE; } ///< set det. elem. ID
-  void SetIndex(Int_t index) { fIndex = index; } ///< set position index
-  void SetZ(Double_t z) { fZ = z; } ///< set Z-coord.
-  void SetLeft(Int_t cath, Int_t left) { fLeft[cath] = left; } ///< set No. of digits
-  //void SetMapElem(const AliMUONDigit *digit, Int_t flag); ///< set map element 
-  void AddDigit(AliMUONDigit *dig); ///< add digit
-  void Fill(AliMUONData *data); ///< fill hit maps 
-  void ClusterReco(Double_t x, Double_t y, Double_t dx, Double_t dy); ///< run cluster reco around (x,y)
-  void AddHitForRec(AliMUONRawCluster *clus); ///< make HitForRec
-  /// What is necessary for sorting TObjArray's
-  Bool_t IsSortable() const { return kTRUE; }
-  Int_t Compare(const TObject* detElem) const; ///< "Compare" function for sorting
-
- private:
-  Int_t fidDE; ///< det. elem. ID
-  Int_t fIndex; ///< det. elem. position index in container
-  Int_t fChamber; ///< chamber No
-  Double_t fZ; ///< det. elem. Z-coordinate
-  Int_t fLeft[2]; ///< numbers of digits not used for clustering
-  Int_t fNHitsForRec; ///< number of hits for rec.
-  AliMUONGeometrySegmentation* fSeg[2]; ///< segmentation
-  AliMUONHitMapA1 *fHitMap[2]; ///< map of digits
-  TObjArray *fDigits[2]; ///< container of digits from this det. elem.
-  TObjArray *fRawClus; ///< raw clusters
-  TObjArray *fHitsForRec; ///< HitForRec's
-  AliMUONClusterFinderAZ *fRecModel; ///< cluster finder
-
-  // Functions
-  /// Not implemented
-  AliMUONDetElement(const AliMUONDetElement & rhs); // copy constructor
-  /// Not implemented
-  AliMUONDetElement& operator = (const AliMUONDetElement& rhs); // assignment operator
-
-  ClassDef(AliMUONDetElement,0) // detection element object
-    };
-#endif
diff --git a/MUON/AliMUONDigitMapA1.cxx b/MUON/AliMUONDigitMapA1.cxx
deleted file mode 100644 (file)
index ac92f2b..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// ---------------------------
-// Class AliMUONDigitMapA1
-// ---------------------------
-// Implements cluster Map as a 1-dim array
-// Author: Christian Finck
-
-#include "AliMUONDigitMapA1.h"
-#include "AliMUONDigit.h"
-
-#include "AliLog.h"
-
-#include <TObjArray.h>
-#include <TMath.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONDigitMapA1)
-/// \endcond
-
-AliMUONDigitMapA1::AliMUONDigitMapA1() 
-  : fIdDE(0),
-    fNpx(0),
-    fNpy(0),
-    fDigits(0),
-    fMaxIndex(0),
-    fHitMap(0)
-{
-/// Default constructor
-
-}
-//________________________________________________________________________________
-AliMUONDigitMapA1::AliMUONDigitMapA1(Int_t idDE, Int_t npx, Int_t npy )
-  : fIdDE(idDE),
-    fNpx(npx),
-    fNpy(npy),
-    fDigits(0),
-    fMaxIndex(fNpx * fNpy + fNpx),
-    fHitMap(new Int_t[fMaxIndex])
-{
-/// Standard constructor
-   Clear();
-}
-
-//_________________________________
-AliMUONDigitMapA1::~AliMUONDigitMapA1()
-{
-/// Destructor
-    if (fHitMap) delete[] fHitMap;
-}
-//______________________________________
-void AliMUONDigitMapA1::Clear(const char *)
-{
-/// Clear hitmap
-    memset(fHitMap,0,sizeof(int)*fMaxIndex);
-}
-
-//_________________________________________________________
-Int_t AliMUONDigitMapA1::CheckedIndex(Int_t ix, Int_t iy) const
-{
-/// Return checked indices ix, iy
-  Int_t index =  iy * fNpx + ix;
-    if ( index < 0 || index >= fMaxIndex ) {
-      AliWarning(Form("index outside array idDE %d ix %d iy %d MaxIndex %d index %d Npx %d Npy %d",
-                     fIdDE, ix,iy, fMaxIndex, index, fNpx, fNpy));
-       return  fMaxIndex-1;
-    } else {
-       return index;
-    }
-}
-//_____________________________
-void  AliMUONDigitMapA1::FillHits(TObjArray* digits)
-{
-/// Fill hits from digits list  
-    fDigits = digits;
-    Int_t ndigits = fDigits->GetEntriesFast();
-    if (!ndigits) return;
-    AliMUONDigit *dig;
-    for (Int_t ndig = 0; ndig < ndigits; ndig++) {
-       dig = (AliMUONDigit*)fDigits->UncheckedAt(ndig);
-       SetHit(dig->PadX(),dig->PadY(),ndig);
-    }
-}
-//___________________________________________________________
-void  AliMUONDigitMapA1::SetHit(Int_t ix, Int_t iy, Int_t idigit)
-{
-/// Assign digit to hit cell ix,iy
-
-    fHitMap[CheckedIndex(ix, iy)] = idigit + 1;
-}
-//_______________________________________________
-void AliMUONDigitMapA1::DeleteHit(Int_t ix, Int_t iy)
-{
-/// Delete hit at cell ix,iy
-
-    fHitMap[CheckedIndex(ix, iy)]=0;
-}
-//_____________________________________________
-void AliMUONDigitMapA1::FlagHit(Int_t ix, Int_t iy)
-{
-/// Flag hit as used
-    fHitMap[CheckedIndex(ix, iy)]=
-       -TMath::Abs(fHitMap[CheckedIndex(ix, iy)]);
-}
-//________________________________________________________
-Int_t AliMUONDigitMapA1::GetHitIndex(Int_t ix, Int_t iy) const
-{
-/// Get absolute value of contents of hit cell ix,iy
-    return TMath::Abs(fHitMap[CheckedIndex(ix, iy)])-1;
-}
-//_______________________________________________________
-TObject* AliMUONDigitMapA1::GetHit(Int_t ix, Int_t iy) const
-{
-/// Get pointer to object at hit cell ix, iy
-/// Force crash if index does not exist ! (Manu)
-    Int_t index = GetHitIndex(ix,iy);
-    return (index <0) ? 0 : fDigits->UncheckedAt(GetHitIndex(ix,iy));
-}
-//_________________________________________________
-FlagType AliMUONDigitMapA1::TestHit(Int_t ix, Int_t iy) const
-{
-/// Check if hit cell is empty, used or unused
-
-    Int_t index = CheckedIndex(ix, iy);
-    if (index<0 || index >= fMaxIndex) return kEmpty;
-
-    Int_t inf = fHitMap[index];
-    if (inf < 0) {
-       return kUsed;
-    } else if (inf == 0) {
-       return kEmpty;
-    } else {
-       return kUnused;
-    }
-}
diff --git a/MUON/AliMUONDigitMapA1.h b/MUON/AliMUONDigitMapA1.h
deleted file mode 100644 (file)
index 54eeb24..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef ALIMUONDIGITMAPA1_H
-#define ALIMUONDIGITMAPA1_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-
-/// \ingroup rec
-/// \class AliMUONDigitMapA1
-/// \brief Implements cluster Map as a 1-dim array
-/// 
-/// \author Christian Finck
-
-#include "AliHitMap.h"
-
-#include <TObject.h>
-
-class TObjArray;
-
-class AliMUONDigitMapA1 : public TObject
-{
- public:
-    AliMUONDigitMapA1();
-    AliMUONDigitMapA1(Int_t idDE, Int_t npx, Int_t npy);
-    virtual ~AliMUONDigitMapA1();
-
-    // Fill hits from list of digits into hit map
-    virtual  void  FillHits(TObjArray* dig);
-    // Clear the hit map
-    virtual  void  Clear(const char *opt = "");
-    // Set a single hit
-    virtual  void  SetHit(Int_t ix, Int_t iy, Int_t idigit);
-    // Delete a single hit
-    virtual  void  DeleteHit(Int_t ix, Int_t iy);
-    // Get index of hit in the list of digits
-    virtual Int_t  GetHitIndex(Int_t ix, Int_t iy) const;
-    // Get pointer to digit
-    virtual TObject*  GetHit(Int_t ix, Int_t iy) const;
-    // Flag a hit as used
-    virtual  void  FlagHit(Int_t ix, Int_t iy);
-    // Test hit status
-    virtual FlagType TestHit(Int_t ix, Int_t iy) const;
-
- private:
-    /// Not implemented
-    AliMUONDigitMapA1(const AliMUONDigitMapA1 & hitMap);
-    /// Not implemented
-    AliMUONDigitMapA1& operator = (const AliMUONDigitMapA1& rhs);
-
-    // Check index
-    Int_t CheckedIndex(Int_t ix, Int_t iy) const;
- private:
-    Int_t fIdDE;                          ///< id DE
-    Int_t fNpx;                           ///< Maximum number of pads in x
-    Int_t fNpy;                           ///< Maximum number of pads in y
-    TObjArray *fDigits;                   ///< Pointer to digits
-    Int_t fMaxIndex;                      ///< maximum index in hit map
-    
-    /// The array of hits
-    Int_t *fHitMap;                       // ! [fMaxIndex]         
-
-    ClassDef(AliMUONDigitMapA1,0) // Implements HitMap as a 1-dim array
-};
-#endif 
diff --git a/MUON/AliMUONDisplay.cxx b/MUON/AliMUONDisplay.cxx
deleted file mode 100644 (file)
index d889216..0000000
+++ /dev/null
@@ -1,1693 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-/// \class AliMUONDisplay
-/// Create an event display object.
-/// A canvas named "edisplay" is created with a vertical size in pixels  \n
-///
-///    A QUICK Overview of the Event Display functions                   \n
-///    ===============================================                   \n
-///
-/// The event display can ve invoked by executing the macro "display.C"  \n
-/// A canvas like in the picture below will appear.
-///
-///  On the left side of the canvas, the following buttons appear:
-///  - *Next*       to move to the next event
-///  - *Previous*   to move to the previous event
-///  - *Pick*       Select this option to be able to point on a track with the
-///                 mouse. Once on the track, use the right button to select
-///                 an action. For example, select SetMarkerAttributes to
-///                 change the marker type/color/size for the track.
-///  - *Zoom*       Select this option (default) if you want to zoom.
-///                 To zoom, simply select the selected area with the left button.
-///  - *UnZoom*     To revert to the previous picture size.
-///
-///  - slider R     On the left side, the vertical slider can be used to
-///                 set the default picture size.
-///
-///  When you are in Zoom mode, you can click on the black part of the canvas
-///  to select special options with the right mouse button.
-///
-/// When you are in pick mode, you can "Inspect" the object pointed by the mouse.
-/// When you are on a track, select the menu item "InspectParticle"
-/// to display the current particle attributes.
-///
-/// You can activate the Root browser by selecting the Inspect menu
-/// in the canvas tool bar menu. Then select "Start Browser"
-/// This will open a new canvas with the browser. At this point, you may want
-/// to display some histograms (from the Trees). Go to the "File" menu
-/// of the browser and click on "New canvas".
-/// In the browser, click on item "ROOT files" in the left pane.
-/// Click on galice.root.
-/// Click on TH
-/// Click on TPC for example
-/// Click on any variable (eg TPC.fX) to histogram the variable.
-///
-/// If you are lost, you can click on HELP in any Root canvas or browser.
-
-//Begin_Html
-/*
-<img src="gif/AliMUONDisplay.gif">
-*/
-//End_Html
-
-#include "AliMUONDisplay.h"
-#include "AliMUON.h"
-#include "AliMUONPoints.h"
-#include "AliMUONGlobalTrigger.h"
-#include "AliMUONHit.h"
-#include "AliMUONDigit.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONTrack.h"
-#include "AliMUONTrackParam.h"
-#include "AliMUONGeometryTransformer.h"
-#include "AliMUONSegmentation.h"
-#include "AliMUONGeometrySegmentation.h"
-#include "AliMUONConstants.h"
-#include "AliMUONTriggerSegmentation.h"
-#include "AliMUONSimData.h"
-#include "AliMUONRecData.h"
-
-#include "AliMpDEIterator.h"
-#include "AliMpSegmentation.h"
-#include "AliMpSlatSegmentation.h"
-#include "AliMpSlat.h"
-#include "AliMpSectorSegmentation.h"
-#include "AliMpSector.h"
-#include "AliMpTriggerSegmentation.h"
-#include "AliMpTrigger.h"
-#include "AliMpStationType.h"
-#include "AliMpCathodType.h"
-#include "AliMpDEManager.h"
-
-#include "AliMC.h"
-#include "AliLog.h"
-#include "AliRun.h"
-#include "AliHeader.h"
-
-#include <TButton.h>
-#include <TColor.h>
-#include <TCanvas.h>
-#if ROOT_VERSION_CODE>= 331523
-#include <TView3D.h>
-#else
-#include <TView.h>
-#endif
-#include <TText.h>
-#include <TPaveLabel.h>
-#include <TPaveText.h>
-#include <TDiamond.h>
-#include <TNode.h>
-#include <TArc.h>
-#include <TSlider.h>
-#include <TVirtualX.h>
-#include <TMath.h>
-#include <TGeometry.h>
-#include <TMarker3DBox.h>
-#include <TParticle.h>
-#include <TPolyLine3D.h>
-#include <TBox.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONDisplay)
-/// \endcond
-
-//_____________________________________________________________________________
-AliMUONDisplay::AliMUONDisplay()
-  : AliDisplay(),
-    fEvent(0),
-    fChamber(0),
-    fCathode(0),
-    fDrawClusters(kTRUE),
-    fDrawCoG(kTRUE),
-    fDrawTracks(kFALSE),
-    fClustersCuts(0),
-    fColPad(0),
-    fPoints(0),
-    fPhits(0),
-    fRpoints(0),
-    fNextCathode(0),
-    fSimLoader(0), 
-    fRecLoader(0), 
-    fMUONSimData(0),
-    fMUONRecData(0)
-{
-/// Default constructor
-}
-
-//_____________________________________________________________________________
-AliMUONDisplay::AliMUONDisplay(Int_t size, 
-                               AliLoader * simLoader, AliLoader * recLoader)
-  : AliDisplay(),
-    fEvent(0),
-    fChamber(1),
-    fCathode(1),
-    fDrawClusters(kTRUE),
-    fDrawCoG(kTRUE),
-    fDrawTracks(kFALSE),
-    fClustersCuts(0),
-    fColPad(0),
-    fPoints(0),
-    fPhits(0),
-    fRpoints(0),
-    fNextCathode(kFALSE),
-    fSimLoader(simLoader), 
-    fRecLoader(recLoader), 
-    fMUONSimData(0),
-    fMUONRecData(0)
-  
-{
-/// Standard constructor to create an event display object.
-
-    fPad = 0;
-    
-    gAlice->SetDisplay(this);
-   
-   // Initialize display default parameters
-    SetRange(200,2000);
-
-   // Set front view by default
-    fTheta =   0;
-    fPhi   = -90;
-    fPsi   =   0;
-    fZoomMode      = 1;
-    fZooms         = 0;
-
-    // Create colors
-    CreateColors();
-    // Create display canvas
-    Int_t ysize = size;
-    if (ysize < 100) ysize = 750;
-    Int_t xsize = Int_t(size*830./ysize);
-    fCanvas = new TCanvas("Canvas", "MUON Display",14,47,xsize,ysize);
-    fCanvas->ToggleEventStatus();
-    
-   // Create main display pad
-    fPad = new TPad("viewpad", "MUON display",0.15,0,0.9,1);
-    fPad->Draw();
-    fPad->Modified();
-    fPad->SetFillColor(30);
-    fPad->SetBorderSize(2);
-
-    fCanvas->cd();
-
-   // Create colors pad
-    fColPad = new TPad("colpad", "Colors pad",0.9,0,1,1);
-    fColPad->Draw();
-    fColPad->SetFillColor(17);
-    fColPad->SetBorderSize(2);
-    fColPad->cd();
-    DisplayColorScale();
-
-    fCanvas->cd();
-   // Create user interface control pad
-    DisplayButtons();
-    fCanvas->cd();
-
-   // Create Range and mode pad
-    Float_t dxtr     = 0.15;
-    Float_t dytr     = 0.45;
-    fTrigPad = new TPad("trigger", "range and mode pad",0,0,dxtr,dytr);
-    fTrigPad->Draw();
-    fTrigPad->cd();
-    fTrigPad->SetFillColor(22);
-    fTrigPad->SetBorderSize(2);
-    fRangeSlider = new TSlider("range","range",0.7,0.42,0.9,0.98);
-    fRangeSlider->SetObject(this);
-    char pickmode[] = "gAlice->Display()->SetPickMode()";
-    Float_t db = 0.09;
-    fPickButton = new TButton("Pick",pickmode,0.05,0.32,0.65,0.32+db);
-    fPickButton->SetFillColor(38);
-    fPickButton->Draw();
-    char zoommode[] = "gAlice->Display()->SetZoomMode()";
-    fZoomButton = new TButton("Zoom",zoommode,0.05,0.21,0.65,0.21+db);
-    fZoomButton->SetFillColor(38);
-    fZoomButton->Draw();
-    fArcButton = new TArc(.8,fZoomButton->GetYlowNDC()+0.5*db,0.33*db);
-    fArcButton->SetFillColor(kGreen);
-    fArcButton->Draw();
-    char butUnzoom[] = "gAlice->Display()->UnZoom()";
-    TButton *button = new TButton("UnZoom",butUnzoom,0.05,0.05,0.95,0.15);
-    button->SetFillColor(38);
-    button->Draw();
-    AppendPad(); // append display object as last object to force selection
-    
-    fCanvas->cd();
-    fTrigPad->SetEditable(kFALSE);
-    fButtons->SetEditable(kFALSE);
-    fCanvas->Update();
-    // initialize container
-    if(fSimLoader) 
-      fMUONSimData = new AliMUONSimData(fSimLoader,"MUON","MUON");
-    if(fRecLoader) 
-      fMUONRecData = new AliMUONRecData(fRecLoader,"MUON","MUON");
-}
-
-//_____________________________________________________________________________
-AliMUONDisplay::~AliMUONDisplay()
-{
-/// Destructor
-
-  // Delete space point structure
-    if (fPoints) fPoints->Delete();
-    delete fPoints;
-    fPoints     = 0;
-    //
-    if (fPhits) fPhits->Delete();
-    delete fPhits;
-    fPhits     = 0;
-    //
-    if (fRpoints) fRpoints->Delete();
-    delete fRpoints;
-    fRpoints     = 0;
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::Clear(Option_t *)
-{
-/// Delete graphics temporary objects
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DisplayButtons()
-{
-/// Create the user interface buttons
-
-
-    fButtons = new TPad("buttons", "newpad",0,0.45,0.15,1);
-    fButtons->Draw();
-    fButtons->SetFillColor(38);
-    fButtons->SetBorderSize(2);
-    fButtons->cd();
-    
-//   Int_t butcolor = 33;
-    Float_t dbutton = 0.08;
-    Float_t y  = 0.96;
-    Float_t dy = 0.014;
-    Float_t x0 = 0.05;
-    Float_t x1 = 0.95;
-    
-    TButton *button;
-    char but1[] = "gAlice->Display()->ShowNextEvent(1)";
-    button = new TButton("Event +", but1, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-    
-    y -= dbutton + dy;
-    char but2[] = "gAlice->Display()->ShowNextEvent(-1)";
-    button = new TButton("Event -", but2, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-   
-    y -= dbutton + dy;
-    char but3[] = "((AliMUONDisplay*)(gAlice->Display()))->NextChamber(1)";
-    button = new TButton("Chamber +", but3, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-    
-    y -= dbutton + dy;
-    char but4[] = "((AliMUONDisplay*)(gAlice->Display()))->NextChamber(-1)";
-    button = new TButton("Chamber -", but4, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-    
-    y -= dbutton + dy;
-    char but5[] = "((AliMUONDisplay*)(gAlice->Display()))->SetChamberAndCathode(1,1)";
-    button = new TButton("Chamber 1", but5, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-   
-    y -= dbutton + dy;
-    char but6[] = "((AliMUONDisplay*)(gAlice->Display()))->NextCathode()";
-    button = new TButton("Cathode <>", but6, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-
-    y -= dbutton + dy;
-    char but7[] = "((AliMUONDisplay*)(gAlice->Display()))->Trigger()";
-    button = new TButton("Trigger", but7, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-    
-    y -= dbutton + dy;
-    char but8[] = "((AliMUONDisplay*)(gAlice->Display()))->DrawReco()";
-    button = new TButton("Tracking", but8, x0, y - dbutton, x1, y);
-    button->SetFillColor(38);
-    button->Draw();
-
-   // display logo
-    TDiamond *diamond = new TDiamond(0.05,0.015,0.95,0.22);
-    diamond->SetFillColor(50);
-    diamond->SetTextAlign(22);
-    diamond->SetTextColor(5);
-    diamond->SetTextSize(0.11);
-    diamond->Draw();
-    diamond->AddText(".. ");
-    diamond->AddText("ROOT");
-    diamond->AddText("MUON");
-    diamond->AddText("... ");
-    diamond->AddText(" ");
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::CreateColors() const
-{
-/// Create the colors palette used to display clusters
-
-    Int_t k,i;
-    Int_t color;
-    Float_t r,g,b;
-    
-    for (k=1;k<=5;k++) {
-       switch(k) {
-       case 1:
-           for (i=1;i<=5;i++) {
-               r=1.;
-               g=i*0.2;  
-               b=0.;
-               color=i;
-               color=260+23-color;
-               new TColor(color,r,g,b);
-           } 
-           break;
-       case 2:
-           for (i=1;i<=4;i++) {
-               r=1.1-i*0.2;
-               g=1.;  
-               b=0.;
-               color=i+5;
-               color=260+23-color;
-               new TColor(color,r,g,b);
-           } 
-           break;
-       case 3:
-           for (i=1;i<=4;i++) {
-               r=0.;
-               g=1.;  
-               b=i*0.2+0.2;
-               color=i+9;
-               color=260+23-color;
-               new TColor(color,r,g,b);
-           } 
-           break;
-       case 4:
-           for (i=1;i<=4;i++) {
-               r=0.;
-               g=1.1-i*0.2;  
-               b=1.;
-               color=i+13;
-               color=260+23-color;
-               new TColor(color,r,g,b);
-           } 
-           break;
-       case 5:
-           for (i=1;i<=5;i++) {
-               r=i*0.2;
-               g=0.;  
-               b=1.;
-               color=i+17;
-               color=260+23-color;
-               new TColor(color,r,g,b);
-           } 
-           break;
-       }
-    }
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DisplayColorScale()
-{
-/// Display pulse height color scale
-
-    Int_t i;
-    Int_t color;
-    Float_t xlow, ylow, xup, yup, hs;
-    Float_t x1, y1, x2, y2;
-    x1 = y1 = 0;
-    x2 = y2 = 1.0;
-    
-    TText *text = new TText(0,0,"");
-    text->SetTextFont(61);
-    text->SetTextSize(0.2);
-    text->SetTextAlign(22);
-    
-
-    Int_t adcmax=4096; // default 12 bits ADC
-
-    
-
-    TBox *box;
-    char label[8];
-//*-* draw colortable boxes
-    hs = (y2-y1)/Float_t(22);
-    xlow=x1+.05;
-    xup=x2-0.5;
-    for (i=0;i<22;i++) {
-       ylow = y1 + hs*(Float_t(i));
-       yup  = y1 + hs*(Float_t(i+1));
-       color = 261+i;
-       Double_t logscale=Double_t(i+1)*(TMath::Log(adcmax)/22);
-       Int_t scale=(Int_t)TMath::Exp(logscale);
-       sprintf(label,"%d",scale);
-       box = new TBox(xlow, ylow, xup, yup);
-       box->Draw();
-       box->SetFillColor(color);
-       text->DrawText(xlow+0.7, 0.5*(ylow+yup),label);
-    }
-}
-
-//______________________________________________________________________________
-Int_t AliMUONDisplay::DistancetoPrimitive(Int_t px, Int_t)
-{
-/// Compute distance from point px,py to objects in event
-
-    gPad->SetCursor(kCross);
-    
-    if (gPad == fTrigPad) return 9999;
-    
-    const Int_t kBig = 9999;
-    Int_t dist   = kBig;
-    Float_t xmin = gPad->GetX1();
-    Float_t xmax = gPad->GetX2();
-    Float_t dx   = 0.02*(xmax - xmin);
-    Float_t x    = gPad->AbsPixeltoX(px);
-    if (x < xmin+dx || x > xmax-dx) return dist;
-    
-    if (fZoomMode) return 0;
-    else           return 7;
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::Draw(Option_t *)
-{
-/// Display current event
-
-    if (!fDrawTracks) 
-      DrawChamber();   
-    else 
-      DrawReco();
-    
-}
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawChamber()
-{
-/// Display current event
-
-  fDrawTracks = kFALSE;
-  fPad->cd();
-  DrawView(fTheta, fPhi, fPsi);   
-  // Display the event number and title
-  fPad->cd();
-  DrawTitle();
-}
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawReco(Option_t *)
-{
-/// Display current event
-
-  fDrawTracks = kTRUE;
-  // print kinematics of generated particles
-    PrintKinematics();
-    // Draw global view of muon system
-    fPad->cd();
-    DrawGlobalView(135, -50, -140); 
-  
-    // Display the event number and title
-    fPad->cd();
-    DrawTitle();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::PrintKinematics()
-{
-/// Print kinematic tree
-
-  if ( !fSimLoader || !fRecLoader ) {
-    AliErrorStream() << "Detector loaders are not defined." << endl;
-    return;
-  }  
-
-  AliRunLoader* runLoader = fSimLoader->GetRunLoader();
-  TParticle *particle = new TParticle();
-  Int_t nPart;
-  Float_t vertex[3], momentum[3];
-
-  printf("******  Event # %d ******\n",runLoader->GetEventNumber());
-  runLoader->TreeK()->GetBranch("Particles")->SetAddress(&particle);
-  nPart = (Int_t)runLoader->TreeK()->GetEntries();
-  for(Int_t iPart = 0; iPart < nPart; iPart++) {
-    runLoader->TreeK()->GetEvent(iPart);
-    vertex[0] = particle->Vx();
-    vertex[1] = particle->Vy();
-    vertex[2] = particle->Vz();
-    momentum[0] = particle->Px();
-    momentum[1] = particle->Py();
-    momentum[2] = particle->Pz();
-    
-    printf("===================================================\n");
-    printf(" Generated particle # %d \n",iPart);
-    printf(" name: %s \n",particle->GetName());
-    printf(" vertex x,y,z (cm): %f %f %f \n",vertex[0],vertex[1],vertex[2]); 
-    printf(" momentum Px,Py,Pz (GeV/c): %f %f %f \n",momentum[0],momentum[1],momentum[2]);
-  }
-  delete particle;    
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawSegmentation()
-{
-/// \todo to be re-written for new seg
-/// Draw graphical representation of segmenatation
-/// Attention: still experimental code
-//     Int_t icat=1;
-    
-//     AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");
-//     AliMUONChamber*   iChamber;
-
-//     AliSegmentation*  seg;
-//     iChamber = &(pMUON->Chamber(fChamber));
-//     seg=iChamber->SegmentationModel(icat);
-
-//     Float_t zpos=iChamber->Z();
-//     Float_t r=iChamber->ROuter();
-    
-//     TMarker3DBox *marker;
-//     if (icat == 1) {
-//     for (Int_t j=0; j<seg->Npy(); j++) {
-//         Float_t y0;
-//         y0=j*seg->Dpy()-seg->Dpy()/2.;
-//         for (seg->FirstPad(0.,y0,0,300,0.); 
-//              seg->MorePads();
-//              seg->NextPad())
-//         {
-//             if (seg->ISector()==0) continue;
-//             Float_t x,y,z;
-//             seg->GetPadC(seg->Ix(), seg->Iy(), x, y, z);
-//             Float_t dpx=seg->Dpx(seg->ISector())/2;
-//             Float_t dpy=seg->Dpy(seg->ISector())/2;
-//             marker=new TMarker3DBox(x,y,zpos,dpx,dpy,0,0,0);
-//             marker->SetLineColor(seg->ISector()+1);
-//             marker->SetFillStyle(1001);
-//             marker->SetFillColor(0);
-//             marker->Draw();
-//         }
-//     }
-//     } else {
-//     for (Int_t j=0; j<250; j++) {
-//         Float_t x0=j*seg->Dpx();
-//         Float_t y0=TMath::Sqrt(r*r-x0*x0);
-           
-//         for (seg->FirstPad(x0,0,0,0,y0); 
-//              seg->MorePads();
-//              seg->NextPad())
-//         {
-//             if (seg->ISector()==0) continue;
-               
-//             Float_t x,y,z;
-//             seg->GetPadC(seg->Ix(), seg->Iy(), x, y, z);
-//             Float_t dpx=seg->Dpx(seg->ISector())/2;
-//             Float_t dpy=seg->Dpy(seg->ISector())/2;
-//             marker=new TMarker3DBox(x,y,zpos,dpx,dpy,0,0,0);
-//             marker->SetLineColor(seg->ISector()+1);
-//             marker->SetFillStyle(1001);
-//             marker->SetFillColor(0);
-//             marker->Draw();
-//         }
-//     }
-//     }
- }
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawClusters()
-{
-/// Draw clusters for MUON chambers
-
-    Int_t ndigits, digit;
-    TObjArray *points;
-    AliMUONPoints *pm;
-
-      
-    fClustersCuts = 0;
-    points = Points();
-    if (!points) return;
-    ndigits = points->GetEntriesFast();
-    for (digit=0;digit<ndigits;digit++){
-       pm = (AliMUONPoints*)points->UncheckedAt(digit);
-       if (!pm) continue;
-       Float_t *pxyz;
-       pxyz=pm->GetP();
-       for (Int_t im=0;im<3;im++) {
-           TMarker3DBox *marker=pm->GetMarker(im);
-           if (marker)
-               marker->Draw();
-       }
-       pm->Draw();
-       fClustersCuts += pm->GetN();
-    }
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawHits()
-{
-/// Draw hits for MUON chambers
-
-    LoadHits(fChamber);
-
-    Int_t ntracks, track;
-    TObjArray *points;
-    AliMUONPoints *pm;
-    
-    fHitsCuts = 0;
-    points = Phits();
-    if (!points) return;
-    ntracks = points->GetEntriesFast();
-    for (track=0;track<ntracks;track++) {
-       pm = (AliMUONPoints*)points->UncheckedAt(track);
-       if (!pm) continue;
-       pm->Draw();
-       fHitsCuts += pm->GetN();
-    }
-}
-
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawCoG()
-{
-/// Draw hits for MUON chambers
-
-    if (!fDrawCoG) return;
-    if (fChamber > 10) return;
-    LoadCoG(fChamber,fCathode);
-    
-    Int_t ncog, icog;
-    TObjArray *points;
-    AliMUONPoints *pm;
-
-    points = Rpoints();
-    if (!points) return;
-    ncog = points->GetEntriesFast();
-    for (icog=0;icog<ncog;icog++) {
-       pm = (AliMUONPoints*)points->UncheckedAt(icog);
-       if (!pm) continue;
-       pm->Draw();
-    }
-}
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawTracks()
-{
-/// Draw tracks
-
-    if (!fDrawTracks) return;
-    LoadTracks();
-    
-    Int_t nTrack, iTrack;
-    TObjArray *points;
-    TPolyLine3D *pm;
-
-    points = Rpoints();
-    if (!points) return;
-    nTrack = points->GetEntriesFast();
-    for ( iTrack = 0; iTrack < nTrack; iTrack++) {
-       pm = (TPolyLine3D*)points->UncheckedAt(iTrack);
-       if (!pm) continue;
-       pm->Draw();
-    }
-}
-//_____________________________________________________________________________
-
-void AliMUONDisplay::DrawTitle(Option_t *option)
-{
-/// Draw the event title
-
-  if ( !fSimLoader || !fRecLoader ) {
-    AliErrorStream() << "Detector loaders are not defined." << endl;
-    return;
-  }  
-
-    Float_t xmin = gPad->GetX1();
-    Float_t xmax = gPad->GetX2();
-    Float_t ymin = gPad->GetY1();
-    Float_t ymax = gPad->GetY2();
-    Float_t dx   = xmax-xmin;
-    Float_t dy   = ymax-ymin;
-    
-    AliRunLoader * runLoader = fSimLoader->GetRunLoader();
-
-    if (strlen(option) == 0) {
-       TPaveText *title = new TPaveText(xmin +0.01*dx, ymax-0.09*dy, xmin +0.5*dx, ymax-0.01*dy);
-//      title->SetTextSize(0.023932);
-       title->SetTextSize(0.02);
-       title->SetBit(kCanDelete);
-       title->SetFillColor(42);
-       title->Draw();
-       char ptitle[100];
-       sprintf(ptitle, "Alice event:%d Run:%d Chamber:%d Cathode:%d",
-               runLoader->GetEventNumber(),
-               gAlice->GetHeader()->GetRun(),
-               fChamber,
-               fCathode);
-       title->AddText(ptitle);
-       Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
-       sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
-               nparticles, fHitsCuts,fClustersCuts);
-       title->AddText(ptitle);
-    } else {
-       TPaveLabel *label = new TPaveLabel(xmin +0.01*dx, ymax-0.07*dy, xmin +0.2*dx, ymax-0.01*dy,option);
-       label->SetBit(kCanDelete);
-       label->SetFillColor(42);
-       label->Draw();
-    }
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawView(Float_t theta, Float_t phi, Float_t psi)
-{
-/// Draw a view of MUON clusters
-
-  AliInfo(" Draw View");
-  
-  gPad->SetCursor(kWatch);
-  // gPad->SetFillColor(39);
-  gPad->SetFillColor(1);
-  gPad->Clear();
-  // gPad->SetFillColor(39);
-  gPad->SetFillColor(1);
-  
-  Int_t iret=0;
-#if ROOT_VERSION_CODE>= 331523
-   Double_t rmin[]={-1,-1,-1};
-   Double_t rmax[]={ 1, 1, 1};
-   TView *view = new TView3D(1,rmin,rmax);
-#else
-  TView *view = new TView(1);
-#endif
-  
-  Float_t range = fRrange*fRangeSlider->GetMaximum();
-  view->SetRange(-range,-range,-range,range, range, range);
-  // zoom back to full scale only if DrawView not called from NextCathode
-  if (!fNextCathode) {
-    fZoomX0[0] = -1;
-    fZoomY0[0] = -1;
-    fZoomX1[0] =  1;
-    fZoomY1[0] =  1;
-    fZooms = 0;
-  }
-  
-  Float_t xg1, xg2, yg1, yg2, zg1, zg2;
-  
-  // Recovering the chamber 
-  AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");
-  
-  const AliMUONGeometryTransformer* kGeomTransformer 
-    = pMUON->GetGeometryTransformer();
-  
-  AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
-  
-  // Display MUON Chamber Geometry
-  char nodeName[7];
-  sprintf(nodeName,"MUON%d",100+fChamber);
-  printf(">>>> chamber is %d\n",fChamber);
-  
-  if(fChamber < 5) {
-    AliMpDEIterator it;
-    for ( it.First(fChamber-1); ! it.IsDone(); it.Next() ) {
-      
-      Int_t detElemId = it.CurrentDEId();
-      AliMpSectorSegmentation * seg =   
-        (AliMpSectorSegmentation *) AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, AliMp::kCath0);
-      const AliMpSector * sector = seg->GetSector();
-      
-      // get sector measurements
-      TVector2 position  = sector->Position(); 
-      TVector2 dimension = sector->Dimensions(); // half length
-      
-      Float_t xlocal1 =  position.Px(); // FIXME: not really needed as it's 0 ?
-      Float_t ylocal1 =  position.Py(); // FIXME: not really needed as it's 0 ?
-      Float_t xlocal2 =  dimension.Px() * 2.;
-      Float_t ylocal2 =  dimension.Px() * 2.;
-      
-      kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
-      kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2);
-      
-      // drawing 
-      TPolyLine3D* poly = new  TPolyLine3D();
-      Int_t nPoint = 0;
-      
-      poly->SetPoint(nPoint++, xg1, yg1, 0.);
-      for (Float_t d = 0; d < TMath::Pi()/2.; d+= 0.01) {
-        Float_t x = xg1 + xg2 * TMath::Cos(d);
-        Float_t y = yg1 + yg2 * TMath::Sin(d);
-        poly->SetPoint(nPoint++, x, y, 0.);
-      }
-      poly->SetPoint(nPoint++, xg1, yg1, 0.);
-      
-      poly->SetLineColor(2);
-      poly->Draw("s");
-    }
-    
-  }
-  
-  if (fChamber>4) 
-  {
-    AliMpDEIterator it;
-    for ( it.First(fChamber-1); ! it.IsDone(); it.Next() ) 
-    {
-      Int_t detElemId = it.CurrentDEId();
-      AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
-
-      if (  segmentation->HasDE(detElemId) ) 
-      {
-        const AliMpVSegmentation* seg 
-         = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, AliMp::kCath0);
-        if (seg) 
-        {  
-          Float_t deltax = seg->Dimensions().X();
-          Float_t deltay = seg->Dimensions().Y();
-          Float_t xlocal1 =  -deltax;
-          Float_t ylocal1 =  -deltay;
-          Float_t xlocal2 =  +deltax;
-          Float_t ylocal2 =  +deltay;
-          kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
-          kGeomTransformer->Local2Global(detElemId, xlocal2, ylocal2, 0, xg2, yg2, zg2);
-          
-          // drawing slat active volumes
-          Float_t xCenter = (xg1 + xg2)/2.;
-          Float_t yCenter = (yg1 + yg2)/2.;
-          
-          TMarker3DBox* box = new TMarker3DBox(xCenter,yCenter,0,xlocal1,ylocal2,0,0,0);
-          
-          box->SetFillStyle(0);
-          box->SetLineColor( stationType == AliMp::kStationTrigger ? 4 : 2);
-          box->Draw("s");
-          
-          if ( stationType == AliMp::kStation345 )
-          {
-            // drawing inner circle + disc
-            TPolyLine3D* poly  = new  TPolyLine3D();
-            TPolyLine3D* poly1 = new  TPolyLine3D();
-            
-            Int_t nPoint = 0;
-            Int_t nPoint1 = 0;
-            for (Float_t d = 0; d < 6.24; d+= 0.005) 
-            {
-              Double_t x = AliMUONConstants::Dmin((fChamber-1)/2) * TMath::Cos(d)/2.;
-              Double_t y = AliMUONConstants::Dmin((fChamber-1)/2) * TMath::Sin(d)/2.;
-              if (nPoint % 2 == 0) poly->SetPoint(nPoint++, 0., 0., 0.);
-              poly->SetPoint(nPoint++, x, y, 0.);
-              poly1->SetPoint(nPoint1++, x, y, 0.);            
-            }
-            poly->SetLineColor(1);
-            poly->Draw("s");
-            poly1->SetLineColor(2);
-            poly1->Draw("s");
-          }
-        }  
-      }
-    }
-  }
-  
-  //add clusters to the pad
-  DrawClusters();
-  DrawHits();
-  DrawCoG();
-  //     DrawSegmentation();
-  // add itself to the list (must be last)
-  AppendPad();
-  view->SetView(phi, theta, psi, iret);
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::DrawGlobalView(Float_t theta, Float_t phi, Float_t psi)
-{
-/// Draw a view of muons chambers with tracks
-    
-    gPad->SetCursor(kWatch);
-    // gPad->SetFillColor(39);
-    gPad->SetFillColor(1);
-    gPad->Clear();
-    // gPad->SetFillColor(39);
-    gPad->SetFillColor(1);
-    
-
-    Int_t iret=0;
-#if ROOT_VERSION_CODE>= 331523
-    Double_t rmin[]={-1,-1,-1};
-    Double_t rmax[]={ 1, 1, 1};
-    TView *view = new TView3D(1,rmin,rmax);
-#else
-    TView *view = new TView(1);
-#endif
-    
-    Float_t range = fRrange*fRangeSlider->GetMaximum()*3.;
-    view->SetRange(-range,-range,-range,range,range,range);
-
-// Display all MUON Chambers segmentation
-    char nodeName[7];
-    TNode *node1;
-    sprintf(nodeName,"alice");
-    
-    node1=gAlice->GetGeometry()->GetNode(nodeName);
-    if (node1) node1->Draw("same"); 
-     
-      
-// Draw clusters for all chambers
-    Int_t chamberSave = fChamber;
-    for (fChamber = 1; fChamber <= 10; fChamber++){
-      DrawCoG();
-    }
-    fChamber = chamberSave;
-// Draw reconstructed tracks
-    DrawTracks();
-
-    AppendPad();
-
-    Float_t zoom = 2.;
-    Float_t shift = 0.9;
-    Float_t x0 = (-1+shift)/zoom;
-    Float_t y0 = (-1+shift)/zoom;
-    Float_t x1 = (1+shift)/zoom;
-    Float_t y1 = (1+shift)/zoom;
-    gPad->Range(x0,y0,x1,y1);
-    view->SetView(phi, theta, psi, iret);
-
-}
-
-//______________________________________________________________________________
-void AliMUONDisplay::ExecuteEvent(Int_t event, Int_t px, Int_t py)
-{
-/// Execute action corresponding to the mouse event
-
-    static Float_t x0, y0, x1, y1;
-    
-    static Int_t pxold, pyold;
-    static Int_t px0, py0;
-    static Int_t linedrawn;
-    Float_t temp;
-    
-    if (px == 0 && py == 0) { //when called by sliders
-       if (event == kButton1Up) {
-           Draw();
-       }
-       return;
-    }
-    if (!fZoomMode && gPad->GetView()) {
-       gPad->GetView()->ExecuteRotateView(event, px, py);
-       return;
-    }
-
-    // something to zoom ?
-    gPad->SetCursor(kCross);
-    
-    switch (event) {
-
-    case kButton1Down:
-       gVirtualX->SetLineColor(-1);
-       gPad->TAttLine::Modify();  //Change line attributes only if necessary
-       x0 = gPad->AbsPixeltoX(px);
-       y0 = gPad->AbsPixeltoY(py);
-       px0   = px; py0   = py;
-       pxold = px; pyold = py;
-       linedrawn = 0;
-       return;
-       
-    case kButton1Motion:
-       if (linedrawn) gVirtualX->DrawBox(px0, py0, pxold, pyold, TVirtualX::kHollow);
-       pxold = px;
-       pyold = py;
-       linedrawn = 1;
-       gVirtualX->DrawBox(px0, py0, pxold, pyold,  TVirtualX::kHollow);
-       return;
-       
-    case kButton1Up:
-       gPad->GetCanvas()->FeedbackMode(kFALSE);
-       if (px == px0) return;
-       if (py == py0) return;
-       x1 = gPad->AbsPixeltoX(px);
-       y1 = gPad->AbsPixeltoY(py);
-       
-       if (x1 < x0) {temp = x0; x0 = x1; x1 = temp;}
-       if (y1 < y0) {temp = y0; y0 = y1; y1 = temp;}
-       gPad->Range(x0,y0,x1,y1);
-       if (fZooms < AliMUONConstants::MaxZoom()-1) {
-           fZooms++;
-           fZoomX0[fZooms] = x0;
-           fZoomY0[fZooms] = y0;
-           fZoomX1[fZooms] = x1;
-           fZoomY1[fZooms] = y1;
-       }
-       gPad->Modified(kTRUE);
-       return;
-    }
-}
-//___________________________________________
-void AliMUONDisplay::LoadDigits(Int_t chamber, Int_t cathode)
-{
-/// Read digits info and store x,y,z info in arrays fPoints.
-/// Loop on all detectors
-
-    if (chamber > 14) return;
-    fChamber = chamber;
-    fCathode = cathode;
-    
-    ResetPoints();
-    
-    AliMUON *pMUON  =     (AliMUON*)gAlice->GetModule("MUON");
-
-    GetMUONSimData()->SetTreeAddress("D");
-
-    TClonesArray *muonDigits  = GetMUONSimData()->Digits(chamber-1);
-    if (muonDigits == 0) return;
-
-    gAlice->ResetDigits();
-    Int_t nent = 0;
-    if (GetSimLoader()->TreeD()) {
-       nent = (Int_t) GetSimLoader()->TreeD()->GetEntries();
-       //     gAlice->TreeD()->GetEvent(nent-2+cathode-1);
-       GetMUONSimData()->GetDigits();
-    }
-    
-    Int_t ndigits = muonDigits->GetEntriesFast();    
-    if (ndigits == 0) return;  
-    if (fPoints == 0) fPoints = new TObjArray(ndigits);
-    
-    Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber-1);
-
-    AliMUONDigit  *mdig;
-    AliMUONPoints *points  = 0;
-    TMarker3DBox  *marker  = 0;
-
-    Int_t npoints  = 1;
-    Float_t adcmax = 1024; // default
-    if (chamber<11) adcmax = 4096;
-
-// check if trigger is using new or old segmentation
-    Bool_t old = true;
-    AliMUONSegmentation* segmentation = pMUON->GetSegmentation();
-    const AliMUONVGeometryDESegmentation* kdeSegmentation 
-      = segmentation->GetDESegmentation(1100, cathode-1);
-    if ( dynamic_cast<const AliMUONTriggerSegmentation*>(kdeSegmentation) ) old = false;
-
-    if ( old  && chamber > 10) {
-       if (chamber > 10) printf(">>> old segmentation for trigger \n");
-       else printf(">>> old segmentation for tracking \n");
-
-       for (Int_t digit = 0; digit < ndigits; digit++) {
-           mdig    = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
-           if (mdig->Cathode() != cathode-1) continue;
-           
-           //
-           // First get all needed parameters
-           //
-           Float_t charge = mdig->Signal();
-           Int_t index  = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
-           Int_t color  = 261+index;
-           Int_t colorTrigger = 2;   
-           if (color > 282) color = 282;
-           
-           if (chamber > 10) { // trigger chamber 
-               
-               Float_t sumCharge = 0;
-               for (Int_t icharge = 0; icharge < 10; icharge++) {
-                   sumCharge = sumCharge+mdig->TrackCharge(icharge);
-               }
-               Float_t testCharge = sumCharge-(Int_t(sumCharge/10))*10;
-               if(sumCharge <= 10 || testCharge > 0) {
-                   colorTrigger = color; 
-               } else {
-                   colorTrigger = 5; 
-               }
-           }
-           
-           // get the center of the pad - add on x and y half of pad size
-           Float_t xpad, ypad, zpad;
-           Int_t isec;
-           Float_t dpx, dpy;
-           
-           Int_t detElemId = mdig->DetElemId();
-           AliMUONGeometrySegmentation* segmentation2
-             = pMUON->GetSegmentation()->GetModuleSegmentationByDEId(detElemId, cathode-1);
-           segmentation2->GetPadC(detElemId, mdig->PadX(), mdig->PadY(), xpad, ypad, zpad);
-           isec = segmentation2->Sector(detElemId, mdig->PadX(), mdig->PadY());
-           dpx = segmentation2->Dpx(detElemId, isec)/2;
-           dpy = segmentation2->Dpy(detElemId, isec)/2;
-           
-           // Then set the objects
-           points = new AliMUONPoints(npoints);
-           fPoints->AddAt(points,digit);
-           if (chamber > 10) {
-               points->SetMarkerColor(colorTrigger);
-           } else {  
-               points->SetMarkerColor(color);
-           }
-           points->SetMarkerStyle(21);
-           points->SetMarkerSize(0.5);
-           points->SetParticle(-1);
-           points->SetHitIndex(-1);
-           points->SetTrackIndex(-1);
-           points->SetDigitIndex(digit);
-           points->SetPoint(0,xpad,ypad,zpos);
-           
-           Int_t lineColor = (zpad-zpos > 0) ? 2:3;
-           marker=new TMarker3DBox(xpad,ypad,zpos,dpx,dpy,0,0,0);
-           
-           
-           marker->SetLineColor(lineColor);
-           marker->SetFillStyle(1001);
-           marker->SetFillColor(color);
-           marker->SetRefObject((TObject*)points);
-           points->Set3DMarker(0, marker);
-       } // end loop on digits     
-       
-    } else {   
-       if (chamber > 10) printf(">>> new segmentation for trigger \n");
-       else printf(">>> new segmentation for tracking \n");
-       
-       const AliMUONGeometryTransformer* kGeomTransformer 
-           = pMUON->GetGeometryTransformer();
-       
-       //loop over all digits and store their position
-       for (Int_t digit = 0; digit < ndigits; digit++) {
-           mdig    = (AliMUONDigit*)muonDigits->UncheckedAt(digit);
-           if (mdig->Cathode() != cathode-1) continue;
-           
-           // get all needed parameters
-           Int_t ix=mdig->PadX();
-           Int_t iy=mdig->PadY();
-           Int_t detElemId=mdig->DetElemId();      
-           Float_t charge = mdig->Signal();
-           Int_t index  = Int_t(TMath::Log(charge)/(TMath::Log(adcmax)/22));
-           Int_t color  = 261+index;
-           Int_t colorTrigger = 2;   
-           if (color > 282) color = 282;
-           
-           const AliMpVSegmentation* seg = 
-              AliMpSegmentation::Instance()
-                ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cathode-1));
-           
-           AliMpPad pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
-           
-           if (chamber > 10) { // trigger chamber
-               Float_t sumCharge = 0;
-    Int_t n = mdig->Ntracks();
-               for (Int_t icharge = 0; icharge < n; icharge++) {
-                   sumCharge = sumCharge+mdig->TrackCharge(icharge);
-               }
-               Float_t testCharge = sumCharge-(Int_t(sumCharge/n))*n;
-               if(sumCharge <= n || testCharge > 0) {
-                   colorTrigger = color; 
-               } else {
-                   colorTrigger = 5; 
-               }
-           }
-           
-           // get the pad position and dimensions
-           Float_t xlocal1 = pad.Position().X();
-           Float_t ylocal1 = pad.Position().Y();
-           Float_t xlocal2 = pad.Dimensions().X();
-           Float_t ylocal2 = pad.Dimensions().Y();
-           
-           Float_t xg1, xg2, yg1, yg2, zg1;
-           
-           kGeomTransformer->Local2Global(detElemId, xlocal1, ylocal1, 0, xg1, yg1, zg1);
-           // (no transformation for pad dimensions)
-           xg2 = xlocal2;
-           yg2 = ylocal2;
-           
-           // Then set the objects
-           points = new AliMUONPoints(npoints);
-           fPoints->AddAt(points,digit);
-           if (chamber > 10) {
-               points->SetMarkerColor(colorTrigger);
-           } else {  
-               points->SetMarkerColor(color);
-           }
-           points->SetMarkerStyle(21);
-           points->SetMarkerSize(0.5);
-           points->SetParticle(-1);
-           points->SetHitIndex(-1);
-           points->SetTrackIndex(-1);
-           points->SetDigitIndex(digit);
-           points->SetPoint(0,xg1,yg1,zpos);
-           
-           Int_t lineColor = (zg1-zpos > 0) ? 2:3;
-           marker=new TMarker3DBox(xg1,yg1,zpos,xg2,yg2,0,0,0);
-           
-           marker->SetLineColor(lineColor);
-           marker->SetFillStyle(1001);
-           marker->SetFillColor(color);
-           marker->SetRefObject((TObject*)points);
-           points->Set3DMarker(0, marker);
-           
-       } // end loop on digits
-    } // end of new segmentation    
-}
-//___________________________________________
-void AliMUONDisplay::LoadCoG(Int_t chamber, Int_t /*cathode*/)
-{
-/// Read raw clusters info and store x,y,z info in arrays fRpoints.
-/// Loop on all detectors
-
-    if (chamber > 10) return;
-    
-    ResetRpoints();
-    
-    GetMUONRecData()->SetTreeAddress("RC");
-    TClonesArray *muonRawClusters  = GetMUONRecData()->RawClusters(chamber-1);
-
-    if (muonRawClusters == 0) return;
-
-    Int_t nent = 0;
-    if (GetMUONRecData()->TreeR()) {
-       nent=(Int_t) GetMUONRecData()->TreeR()->GetEntries();
-       GetMUONRecData()->TreeR()->GetEvent(0);
-    }
-    
-    Int_t nrawcl = muonRawClusters->GetEntriesFast();
-    if (nrawcl == 0) return;
-    if (fRpoints == 0) fRpoints = new TObjArray(nrawcl);
-    
-    Float_t zpos = AliMUONConstants::DefaultChamberZ(chamber-1);  
-    AliMUONRawCluster  *mRaw;
-    AliMUONPoints *points = 0;
-    //
-    //loop over all raw clusters and store their position
-    points = new AliMUONPoints(nrawcl);
-    for (Int_t iraw=0;iraw<nrawcl;iraw++) {
-       mRaw   = (AliMUONRawCluster*)muonRawClusters->UncheckedAt(iraw);
-        points->SetMarkerColor(51);
-        points->SetMarkerStyle(2);
-        points->SetMarkerSize(1.);
-        points->SetParticle(-1);
-        points->SetHitIndex(-1);
-        points->SetTrackIndex(-1);
-        points->SetDigitIndex(-1);
-        points->SetPoint(iraw,mRaw->GetX(0),mRaw->GetY(0),zpos);
-       fRpoints->AddAt(points,iraw);
-       //      printf("%f and %f and %f\n",mRaw->GetX(0),mRaw->GetY(0),mRaw->GetZ(0));
-    }
-}
-
-//___________________________________________
-void AliMUONDisplay::LoadTracks()
-{
-/// Load tracks
-
-  AliMUONTrack* recTrack = 0;
-  AliMUONTrackParam* trackParam = 0;
-  TClonesArray *  trackParamAtHit = 0;   
-
-  ResetRpoints();
-
-  GetMUONRecData()->SetTreeAddress("RT");
-  TClonesArray* recTracksArray = GetMUONRecData()->RecTracks();
-  if (recTracksArray == NULL) return;
-  GetMUONRecData()->GetRecTracks();
-
-  Int_t nRecTracks = 0;
-  if (recTracksArray)
-    nRecTracks = (Int_t) recTracksArray->GetEntriesFast();
-
-
-  if (fRpoints == 0) fRpoints = new TObjArray(nRecTracks);
-
-  for (Int_t iRecTracks = 0; iRecTracks <  nRecTracks;  iRecTracks++) {
-    // reading info from tracks
-    recTrack = (AliMUONTrack*) recTracksArray->At(iRecTracks);
-
-    Int_t nTrackHits = recTrack->GetNTrackHits();
-
-    if (nTrackHits == 0) continue;
-
-    Int_t iPoint = 0;
-    TPolyLine3D *points = new TPolyLine3D(nTrackHits+1); 
-    points->SetLineColor(6);
-    points->SetLineWidth(1);
-    fRpoints->AddAt(points,iRecTracks);
-
-    Float_t xRec=0;
-    Float_t yRec=0;
-    Float_t zRec=0;
-
-    // vertex unknown at the tracking level -> put it at (0,0,0)
-    points->SetPoint(iPoint,0.,0.,0.);
-    iPoint++;  
-
-    for (Int_t iHit = 0; iHit < nTrackHits; iHit++){
-      trackParamAtHit = recTrack->GetTrackParamAtHit();
-      trackParam = (AliMUONTrackParam*) trackParamAtHit->At(iHit); 
-      xRec  = trackParam->GetNonBendingCoor();
-      yRec  = trackParam->GetBendingCoor();
-      zRec  = trackParam->GetZ();
-      points->SetPoint(iPoint,xRec,yRec,zRec);
-      iPoint++;        
-    } // end loop rec. hits
-    PrintTrack(iRecTracks,recTrack);
-  } // end loop tracks
-  
-
-}
-
-//___________________________________________
-void AliMUONDisplay::PrintTrack(Int_t iRecTracks, AliMUONTrack *recTrack)
-{
-/// Print reconstructed track
-  
-  AliMUONTrackParam *trackParam;
-  Float_t vertex[3], momentum[3];
-  Float_t pYZ, bendingSlope, nonBendingSlope, chi2dof;
-  Int_t charge;
-
-  trackParam = recTrack->GetTrackParamAtVertex(); // meaningless since the vertex is not known at the tracking level
-  vertex[0] = trackParam->GetNonBendingCoor();
-  vertex[1] = trackParam->GetBendingCoor();
-  vertex[2] = trackParam->GetZ();
-  charge = Int_t(TMath::Sign(1.,trackParam->GetInverseBendingMomentum()));
-
-  printf("===================================================\n");
-  printf("//*****************************************************************//\n");
-  printf("// meaningless since the vertex is not known at the tracking level //\n");
-  printf("//*****************************************************************//\n");
-  printf(" Reconstructed track # %d \n",iRecTracks);
-  printf(" charge: %d \n",charge);
-  printf(" vertex x,y,z (cm): %f %f %f \n",vertex[0],vertex[1],vertex[2]); 
-
-  if ( trackParam->GetInverseBendingMomentum() != 0. ) {
-    pYZ =  1./TMath::Abs(trackParam->GetInverseBendingMomentum());
-    bendingSlope = trackParam->GetBendingSlope();
-    nonBendingSlope = trackParam->GetNonBendingSlope();
-    momentum[2] = -pYZ / TMath::Sqrt(1.0 + bendingSlope*bendingSlope);
-    momentum[0] = momentum[2] * nonBendingSlope;
-    momentum[1] = momentum[2] * bendingSlope;
-    printf(" momentum Px,Py,Pz (GeV/c): %f %f %f \n",momentum[0],momentum[1],momentum[2]);
-  }
-  else { 
-    AliErrorStream() << "Cannot calculate momentum: pYZ = inf" << endl;
-  }  
-  chi2dof = recTrack->GetFitFMin()/(2.0 * recTrack->GetNTrackHits() - 5.);
-  printf(" track chi2/dof: %f \n",chi2dof); 
-}
-
-//___________________________________________
-void AliMUONDisplay::LoadHits(Int_t chamber)
-{
-/// Read hits info and store x,y,z info in arrays fPhits.
-/// Loop on all detectors
-
-    if (chamber > 14) return;
-    Int_t track;
-
-    fChamber=chamber;
-    ResetPhits();
-    
-    Float_t zpos=AliMUONConstants::DefaultChamberZ(chamber-1);
-
-    if (GetMUONSimData()->TreeH()) {
-      GetMUONSimData()->SetTreeAddress("H");
-      Int_t ntracks = (Int_t)GetMUONSimData()->TreeH()->GetEntries(); //skowron
-      Int_t nthits  = 0;
-      for (track = 0; track < ntracks; track++) {
-       GetMUONSimData()->ResetHits();
-       GetMUONSimData()->GetTrack(track);//skowron
-       TClonesArray *muonHits  = GetMUONSimData()->Hits();
-       if (muonHits == 0) return;
-       nthits += muonHits->GetEntriesFast();
-      } 
-      if (fPhits == 0) fPhits = new TObjArray(nthits);
-      Int_t nhold=0;
-      for (track=0; track<ntracks;track++) {
-       GetMUONSimData()->ResetHits();
-       GetMUONSimData()->GetTrack(track);//skowron
-       TClonesArray *muonHits  = GetMUONSimData()->Hits();
-       if (muonHits == 0) return;
-       Int_t nhits = muonHits->GetEntriesFast();
-       if (nhits == 0) continue;
-       AliMUONHit *mHit;
-       AliMUONPoints *points = 0;
-       Int_t npoints=1;
-       for (Int_t hit=0;hit<nhits;hit++) {
-         mHit = (AliMUONHit*)muonHits->UncheckedAt(hit);
-         Int_t nch  = mHit->Chamber();              // chamber number
-         if (nch != chamber) continue;
-         //
-         // Retrieve info and set the objects
-         //
-         points = new AliMUONPoints(npoints);
-         fPhits->AddAt(points,nhold+hit);
-         points->SetMarkerColor(kRed);
-         points->SetMarkerStyle(5);
-         points->SetMarkerSize(1.);
-         points->SetParticle(mHit->Track());
-         points->SetHitIndex(hit);
-         points->SetTrackIndex(track);
-         points->SetDigitIndex(-1);
-         points->SetPoint(0,mHit->X(),mHit->Y(),zpos);
-         //        printf("%f and %f and %f\n",mHit->X(),mHit->Y(),mHit->Z());
-       }
-       nhold+=nhits;
-      }
-    }
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::Paint(Option_t *)
-{
-/// Paint miscellaneous items
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::SetPickMode()
-{
-/// Set parameters for pick mode.
-    fZoomMode = 0;
-
-    fArcButton->SetY1(fPickButton->GetYlowNDC()+0.5*fPickButton->GetHNDC());
-    fTrigPad->Modified();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::SetZoomMode()
-{
-/// Set parameters for zoom mode
-
-    fZoomMode = 1;
-    
-    fArcButton->SetY1(fZoomButton->GetYlowNDC()+0.5*fZoomButton->GetHNDC());
-    fTrigPad->Modified();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::NextChamber(Int_t delta)
-{
-/// To go from chamber to next chamber if delta = 1
-/// or previous chamber otherwise
-    if (delta == 1) {
-       if (fChamber < AliMUONConstants::NCh()) fChamber++;
-    } else {
-       if (fChamber > 1) fChamber--;
-    }
-    if (!fPad) return;
-    fPad->Clear();
-    LoadDigits(fChamber, fCathode);
-    DrawChamber();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::NextCathode()
-{
-/// To switch to other cathode plane
-
-    if (!fPad) return;
-    fPad->Clear();
-    if (fCathode == 1) {
-       LoadDigits(fChamber, 2);        
-    } else {
-       LoadDigits(fChamber, 1);
-    }
-    fNextCathode = kTRUE; // to keep the same zoom
-    DrawChamber();
-    fNextCathode = kFALSE;
-    TPad *pad = (TPad*)gPad->GetPadSave();
-    pad->Range(fZoomX0[fZooms], fZoomY0[fZooms],
-              fZoomX1[fZooms], fZoomY1[fZooms]);
-    pad->Modified();
-    fPad->cd();
-    DrawTitle();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::Trigger()
-{
-/// Print global trigger output
-
-  AliMUONGlobalTrigger* globalTrig;
-
-  GetMUONRecData()->SetTreeAddress("GLT");
-  GetMUONRecData()->GetTriggerD();
-
-  globalTrig =  (AliMUONGlobalTrigger*)GetMUONRecData()->GlobalTrigger()->UncheckedAt(0);
-  if (globalTrig == 0) return;
-
-  globalTrig->Print("full");
-
- //  // returns Trigger Decision for current event
-//   AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(GetLoader(),1);
-
-//   //  AliMUONTriggerDecision* decision= new AliMUONTriggerDecision(1);
-//   AliMUONData* muonData = decision->GetMUONRecData();
-//   muonData->SetTreeAddress("D");
-//   decision->Trigger(); 
-}
-//_____________________________________________________________________________
-void AliMUONDisplay::SetChamberAndCathode(Int_t chamber, Int_t cathode)
-{
-/// Set chamber and cathode number
-
-   fChamber = chamber;
-   fCathode = cathode;
-
-   if (!fPad) return;
-   fPad->Clear();
-   LoadDigits(chamber,cathode);
-   DrawChamber();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::SetEvent(Int_t newevent)
-{
-/// Chose event 
-
-    gAlice->GetEvent(newevent);
-    fEvent=newevent;
-    if (!gAlice->TreeD()) return; 
-    if (!fPad) return;
-    fPad->Clear();
-    LoadDigits(fChamber,fCathode);
-    Draw();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::SetRange(Float_t rrange, Float_t zrange)
-{
-/// Set view range along R and Z
-
-    fRrange = rrange;
-    fZrange = zrange;
-
-    if (!fPad) return;
-    fPad->Clear();
-    Draw();
-}
-   
-//_____________________________________________________________________________
-void AliMUONDisplay::SetView(Float_t theta, Float_t phi, Float_t psi)
-{
-/// Change viewing angles for current event
-
-    fPad->cd();
-    fPhi   = phi;
-    fTheta = theta;
-    fPsi   = psi;
-    Int_t iret = 0;
-    
-    TView *view = gPad->GetView();
-    if (view) view->SetView(fPhi, fTheta, fPsi, iret);
-    else      Draw();
-    gPad->Modified();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::ShowNextEvent(Int_t delta)
-{
-/// Display (current event_number + delta)
-///  -  delta =  1  shown next event
-///  -  delta = -1 show previous event
-
-   if ( !fSimLoader || !fRecLoader ) {
-     AliErrorStream() << "Detector loaders are not defined." << endl;
-     return;
-   }  
-    
-   AliRunLoader* runSimLoader =  fSimLoader->GetRunLoader();
-   AliRunLoader* runRecLoader =  fRecLoader->GetRunLoader();
-   
-    
-   if (delta) {
-      //runLoader->CleanDetectors();
-      //runLoader->CleanKinematics();
-      Int_t currentEvent = runSimLoader->GetEventNumber();
-      Int_t newEvent     = currentEvent + delta;
-      runSimLoader->GetEvent(newEvent);
-      runRecLoader->GetEvent(newEvent);
-      fEvent=newEvent;
-    }
-    LoadDigits(fChamber, fCathode);
-    fPad->cd(); 
-    Draw();
-}
-
-//______________________________________________________________________________
-void AliMUONDisplay::UnZoom()
-{
-/// Unzoom 
-
-    if (fZooms <= 0) return;
-    fZooms--;
-    TPad *pad = (TPad*)gPad->GetPadSave();
-    pad->Range(fZoomX0[fZooms],fZoomY0[fZooms], fZoomX1[fZooms],fZoomY1[fZooms]);
-    pad->Modified();
-}
-
-//_____________________________________________________________________________
-void AliMUONDisplay::ResetPoints()
-{
-/// Reset array of points
-
-    if (fPoints) {
-       fPoints->Delete();
-       delete fPoints;
-       fPoints = 0;
-    }
-}
-//_____________________________________________________________________________
-void AliMUONDisplay::ResetPhits()
-{
-/// Reset array of points
-
-    if (fPhits) {
-       fPhits->Delete();
-       delete fPhits;
-       fPhits = 0;
-    }
-}
-//_____________________________________________________________________________
-void AliMUONDisplay::ResetRpoints()
-{
-/// Reset array of points
-
-    if (fRpoints) {
-       fRpoints->Clear();
-       //      delete fRpoints;
-       fRpoints = 0;
-    }
-}
diff --git a/MUON/AliMUONDisplay.h b/MUON/AliMUONDisplay.h
deleted file mode 100644 (file)
index 126d052..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef ALIMUONDISPLAY_H
-#define ALIMUONDISPLAY_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-
-/// \ingroup evaluation
-/// \class AliMUONDisplay
-/// \brief Utility class to display MUON events
-
-#include "AliDisplay.h"
-
-class AliLoader;
-class AliMUONSimData;
-class AliMUONRecData;
-class AliMUONTrack;
-class TCanvas;
-class TPad;
-class TList;
-class TSlider;
-class TButton;
-class TArc;
-
-class AliMUONDisplay : public AliDisplay 
-{
-public:
-                     AliMUONDisplay();
-                     AliMUONDisplay(Int_t size, 
-                                    AliLoader * simLoader, AliLoader * recLoader);
-                    
-   virtual          ~AliMUONDisplay();
-   virtual void      Clear(Option_t *option="");
-   virtual void      DisplayButtons();
-   virtual void      CreateColors() const;
-   virtual void      DisplayColorScale();
-   virtual Int_t     DistancetoPrimitive(Int_t px, Int_t py);
-   virtual void      DrawReco(Option_t *option="");
-   virtual void      PrintTrack(Int_t iRecTracks, AliMUONTrack *recTrack); 
-   virtual void      PrintKinematics(); 
-   virtual void      Draw(Option_t *option="");
-   virtual void      DrawChamber();
-   virtual void      DrawClusters();
-   virtual void      DrawHits();
-   virtual void      DrawCoG();
-   virtual void      DrawTracks();
-   virtual void      DrawSegmentation();
-   virtual void      DrawTitle(Option_t *option="");
-   virtual void      DrawView(Float_t theta, Float_t phi, Float_t psi=0);
-   virtual void      DrawGlobalView(Float_t theta, Float_t phi, Float_t psi=0);
-                     /// Not implemented function
-   virtual void      DrawP(Float_t,Float_t,Float_t,Float_t,Float_t,Int_t){}
-   virtual void      ExecuteEvent(Int_t event, Int_t px, Int_t py);
-   Int_t             GetZoomMode() const {return fZoomMode;}  ///< Return zoom mode
-   Int_t             GetChamber() const {return fChamber;}    ///< Return current chamber
-   Int_t             GetCathode() const {return fCathode;}    ///< Return current cathode
-
-   AliMUONSimData*   GetMUONSimData() {return fMUONSimData;}        ///< Return MUON data
-   AliMUONRecData*   GetMUONRecData() {return fMUONRecData;}        ///< Return MUON data
-   AliLoader*        GetSimLoader()  {return fSimLoader;}           ///< Return loader
-   AliLoader*        GetRecLoader()  {return fRecLoader;}           ///< Return loader
-
-   virtual void      LoadDigits(Int_t chamber, Int_t cathode);
-   virtual void      LoadHits(Int_t chamber);
-   virtual void      LoadCoG(Int_t chamber, Int_t cathode);
-   virtual void      LoadTracks();
-   TPad             *Pad() {return fPad;}         ///< Return pad
-   TObjArray        *Points() {return fPoints;}   ///< Return points for each cathode
-   TObjArray        *Phits() {return fPhits;}     ///< Return hit points for each chamber
-   TObjArray        *Rpoints() {return fRpoints;} ///< Return cog points for each cathode
-   virtual void      Paint(Option_t *option="");
-   virtual void      SetDrawClusters(Bool_t draw=kTRUE) {fDrawClusters=draw;}   ///< Set flag to draw clusters
-   virtual void      SetChamberAndCathode(Int_t chamber=1, Int_t cathode=1);    ///< Set chamber and cathod
-   virtual void      SetDrawCoG(Bool_t draw=kTRUE) {fDrawCoG=draw;}             ///< Set flag to draw CoG 
-   virtual void      SetDrawTracks(Bool_t draw=kTRUE) {fDrawTracks=draw;}       ///< Set flag to draw tracks
-   virtual void      SetRange(Float_t rrange=250., Float_t zrange=1050.);      
-   virtual void      SetEvent(Int_t newevent=0);                                  
-   virtual void      SetView(Float_t theta=0, Float_t phi=-90, Float_t psi=0);
-   virtual void      SetPickMode();
-   virtual void      SetZoomMode();
-   virtual void      ShowNextEvent(Int_t delta=1);
-   virtual void      UnZoom();                                                
-   virtual void      ResetPoints();
-   virtual void      ResetPhits();
-   virtual void      ResetRpoints();
-   virtual void      NextChamber(Int_t delta=1);
-   virtual void      NextCathode();
-           void      Trigger();
-
-protected:
-                     /// Not implemented
-                    AliMUONDisplay(const AliMUONDisplay& display);
-                     /// Not implemented
-   AliMUONDisplay&   operator = (const AliMUONDisplay& rhs);
-          
-
-private:
-   Int_t             fEvent;                ///< Current event
-   Int_t             fChamber;              ///< Current Chamber
-   Int_t             fCathode;              ///< Current cathode plane
-   Bool_t            fDrawClusters;         ///< Flag True if Clusters to be drawn
-   Bool_t            fDrawCoG;              ///< Flag True if CoG to be drawn
-   Bool_t            fDrawTracks;           ///< Flag True if tracks to be drawn
-                                           
-   Int_t             fClustersCuts;         ///< Number of clusters surviving cuts
-   TPad             *fColPad;               ///< Pointer to the colors pad 
-   TObjArray        *fPoints;               ///< Array of points for each cathode
-   TObjArray        *fPhits;                ///< Array of hit points for each chamber
-   TObjArray        *fRpoints;              ///< Array of cog points for each cathode
-   Int_t            fNextCathode;           ///< Flagging next cathode
-
-   AliLoader*        fSimLoader;            //!< MUON loader to get data
-   AliLoader*        fRecLoader;            //!< MUON loader to get data
-   AliMUONSimData*   fMUONSimData;          //!< Data container for MUON subsystem 
-   AliMUONRecData*   fMUONRecData;          //!< Data container for MUON subsystem 
-
-   ClassDef(AliMUONDisplay, 0)   //Utility class to display MUON events
-};
-
-#endif
-
-
-
-
-
-
-
-
diff --git a/MUON/AliMUONEventRecoCombi.cxx b/MUON/AliMUONEventRecoCombi.cxx
deleted file mode 100644 (file)
index 899d7b6..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -------------------------------------
-// Class AliMUONEventRecoCombi
-// -------------------------------------
-// Steering class for the combined cluster / track reconstructor
-// Author: Alexander Zinchenko, JINR Dubna
-
-#include "AliMUONEventRecoCombi.h"
-
-#include "AliMUONRecData.h"
-#include "AliMUONDetElement.h"
-#include "AliMUONDigit.h"
-#include "AliMUONHitForRec.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONTrackK.h"
-#include "AliMUONTrackReconstructorK.h"
-#include "AliMUONConstants.h"
-
-#include "AliLoader.h"
-#include "AliLog.h"
-
-#include <Riostream.h>
-#include <TClonesArray.h>
-#include <TArrayS.h>
-#include <TArrayD.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONEventRecoCombi)
-/// \endcond
-
-AliMUONEventRecoCombi* AliMUONEventRecoCombi::fgRecoCombi = 0; 
-
-//_________________________________________________________________________
-AliMUONEventRecoCombi::AliMUONEventRecoCombi(AliMUONSegmentation* segmentation) 
-  : TObject(),
-    fSegmentation(segmentation),
-    fDetElems(0x0),
-    fZ(new TArrayD(20)),
-    fNZ(0),
-    fDEvsZ(0x0)
-{
-  /// Ctor
-
-  fDetElems = new TClonesArray("AliMUONDetElement", 20);
-}
-
-//_________________________________________________________________________
-AliMUONEventRecoCombi* AliMUONEventRecoCombi::Instance(AliMUONSegmentation* segmentation)
-{
-/// Return pointer to the singleton instance
-
-  if (fgRecoCombi == 0) {
-    fgRecoCombi = new AliMUONEventRecoCombi(segmentation);
-  }
-  return fgRecoCombi;
-}
-
-//_________________________________________________________________________
-AliMUONEventRecoCombi::~AliMUONEventRecoCombi()
-{
-  /// Destructor
-  delete fDetElems;
-  delete fZ;
-  delete [] fDEvsZ;
-}
-
-//_________________________________________________________________________
-void AliMUONEventRecoCombi::FillEvent(AliMUONRecData *data, AliMUONClusterFinderAZ *recModel)
-{
-  /// Fill event information
-
-  // Clear previous event
-  fDetElems->Delete();
-  for (Int_t i = 0; i < fNZ; i++) delete [] fDEvsZ[i];
-  delete [] fDEvsZ; fDEvsZ = NULL;
-  fNZ = -1;
-
-  Int_t nDetElem = 0;
-  for (Int_t ich = 0; ich < 6; ich++) {
-    // loop over chambers 0-5
-    TClonesArray *digs = data->Digits(ich);
-    digs->Sort(); //AZ
-    //cout << ich << " " << digs << " " << digs->GetEntriesFast() << endl;
-    Int_t idDE = -1;
-    for (Int_t i = 0; i < digs->GetEntriesFast(); i++) {
-      AliMUONDigit *dig = (AliMUONDigit*) digs->UncheckedAt(i);
-      if (dig->DetElemId() != idDE) {
-       idDE = dig->DetElemId();
-       new ((*fDetElems)[nDetElem++]) AliMUONDetElement(idDE, dig, recModel, fSegmentation);
-      }
-      else ((AliMUONDetElement*)fDetElems->UncheckedAt(nDetElem-1))->AddDigit(dig);
-    }
-  }
-
-  // Compute average Z-position
-  for (Int_t i = 0; i < nDetElem; i++) {
-    AliMUONDetElement *detElem = (AliMUONDetElement*) fDetElems->UncheckedAt(i);
-    Int_t nDigs = detElem->Digits(0)->GetEntriesFast() + 
-                  detElem->Digits(1)->GetEntriesFast();
-    detElem->SetZ(detElem->Z() / nDigs);
-  }
-  
-  // Sort according to Z
-  fDetElems->Sort();
-  //cout << nDetElem << endl;
-  // Fill det. elems. position index in the container
-  for (Int_t i = 0; i < nDetElem; i++) 
-    ((AliMUONDetElement*)fDetElems->UncheckedAt(i))->SetIndex(i);
-
-  // Find groups of det. elements with the same Z
-  Double_t z0 = -99999;
-  TArrayS *nPerZ = new TArrayS(20);
-  for (Int_t i = 0; i < nDetElem; i++) {
-    AliMUONDetElement *detElem = (AliMUONDetElement*) fDetElems->UncheckedAt(i);
-    detElem->Fill(data);
-    //cout << i << " " << detElem->IdDE() << " " << detElem->Z() << endl;
-    if (detElem->Z() - z0 < 0.05) { 
-      // the same Z
-      (*nPerZ)[fNZ]++;
-    } else {
-      if (fZ->GetSize() <= fNZ+1) fZ->Set(fZ->GetSize()+10);
-      if (nPerZ->GetSize() <= fNZ+1) nPerZ->Set(nPerZ->GetSize()+10);
-      (*fZ)[++fNZ] = detElem->Z();
-      z0 = detElem->Z();
-      (*nPerZ)[fNZ]++;
-    }
-  }
-  fNZ++;
-  /*
-  cout << fNZ << endl;
-  for (Int_t i = 0; i < 7; i++) {
-    cout << i << " " << data->RawClusters(i)->GetEntriesFast() << endl;
-  }
-  */
-
-  // Build list of DE locations vs Z
-  fDEvsZ = new Int_t* [fNZ];
-  Int_t iPos = 0;
-  for (Int_t i = 0; i < fNZ; i++) {
-    Int_t *idPerZ = new Int_t[(*nPerZ)[i]+1]; 
-    for (Int_t j = 1; j < (*nPerZ)[i]+1; j++) idPerZ[j] = iPos++;
-    idPerZ[0] = (*nPerZ)[i]; // number of DE's as first element of array
-    fDEvsZ[i] = idPerZ;
-    //cout << (*nPerZ)[i] << " ";
-  }
-  //cout << endl;
-  delete nPerZ;
-
-  // Fill rec. point container for stations 4 and 5
-  //cout << data->TreeR() << endl;
-  //data->MakeBranch("RC");
-  /*
-  data->SetTreeAddress("RCC");
-  for (Int_t ch = 6; ch < 10; ch++) {
-    TClonesArray *raw = data->RawClusters(ch);
-    cout << ch << " " << raw->GetEntriesFast() << " " << data->RawClusters(ch) << endl;
-    //for (Int_t i = 0; i < raw->GetEntriesFast(); i++) {
-    for (Int_t i = 0; i < TMath::Min(raw->GetEntriesFast(),1000); i++) {
-      AliMUONRawCluster *clus = (AliMUONRawCluster*) raw->UncheckedAt(i);
-      data->AddRawCluster(ch, *clus);
-      cout << i << " " << raw->GetEntriesFast() << endl;
-    }
-  }
-  */
-  //data->SetTreeAddress("RC");
-}
-
-//_________________________________________________________________________
-void AliMUONEventRecoCombi::FillRecP(AliMUONRecData *dataCluster, AliMUONTrackReconstructorK *recoTrack) const
-{
-  /// Fill rec. points used for tracking from det. elems
-
-  TClonesArray *tracks = recoTrack->GetRecTracksPtr();
-  for (Int_t i = 0; i < recoTrack->GetNRecTracks(); i++) {
-    AliMUONTrackK *track = (AliMUONTrackK*) tracks->UncheckedAt(i);
-    TObjArray *hits = track->GetTrackHits();
-    for (Int_t j = 0; j < track->GetNTrackHits(); j++) {
-      AliMUONHitForRec *hit = (AliMUONHitForRec*) hits->UncheckedAt(j);
-      if (hit->GetHitNumber() >= 0) continue;
-      // Combined cluster / track finder
-      Int_t index = -hit->GetHitNumber() / 100000;
-      Int_t iPos = -hit->GetHitNumber() - index * 100000;
-      AliMUONRawCluster *clus = (AliMUONRawCluster*) DetElem(index-1)->RawClusters()->UncheckedAt(iPos);
-      //cout << j << " " << iPos << " " << clus << " " << index << " " << DetElem(index-1)->Chamber() << endl; 
-      dataCluster->AddRawCluster(DetElem(index-1)->Chamber(), *clus);
-    }
-  }
-  /*
-  for (Int_t ch = 0; ch < 10; ch++) {
-    TClonesArray *raw = dataCluster->RawClusters(ch);
-    cout << ch << " " << raw->GetEntriesFast() << endl;
-  }
-  */
-  // Reset raw cluster tree
-  /*
-  char branchname[30];
-  TBranch * branch = 0x0;
-  if ( dataCluster->TreeR()) {
-    if ( dataCluster->IsTriggerBranchesInTree() ) {
-      // Branch per branch filling
-      for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
-        sprintf(branchname,"%sRawClusters%d",dataCluster->GetName(),i+1);
-        branch = dataCluster->TreeR()->GetBranch(branchname);
-        //branch->Fill();
-        //branch->Reset();
-        //branch->Clear();
-        branch->Delete();
-      }
-    }
-    //else  TreeR()->Fill();
-    else  dataCluster->TreeR()->Reset();
-  }
-  */
-}
-
-//_________________________________________________________________________
-Int_t AliMUONEventRecoCombi::IZfromHit(AliMUONHitForRec *hit) const
-{
-  /// Get Iz of det. elem. from the hit
-
-  Int_t index = -hit->GetHitNumber() / 100000 - 1, iz0 = -1;
-  for (Int_t iz = 0; iz < fNZ; iz++) {
-    Int_t *pDEatZ = DEatZ(iz);
-    Int_t nDetElem = pDEatZ[-1];
-    for (Int_t j = 0; j < nDetElem; j++) {
-      if (pDEatZ[j] != index) continue;
-      iz0 = iz;
-      break;
-    }
-    if (iz0 >= 0) break;
-  }
-  return iz0;
-}
diff --git a/MUON/AliMUONEventRecoCombi.h b/MUON/AliMUONEventRecoCombi.h
deleted file mode 100644 (file)
index d4625d2..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef ALIMUONEVENTRECOCOMBI_H
-#define ALIMUONEVENTRECOCOMBI_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup rec
-/// \class AliMUONEventRecoCombi
-/// \brief Combined cluster / track finder in the MUON arm of ALICE
-/// \author Alexander Zinchenko, JINR Dubna
-#include <TObject.h>
-#include <TArrayD.h>
-#include <TClonesArray.h>
-
-class AliMUONRecData;
-class AliMUONDetElement;
-class AliMUONTrackReconstructorK;
-class AliMUONClusterFinderAZ;
-class AliMUONHitForRec;
-class AliMUONSegmentation;
-class AliLoader;
-
-class AliMUONEventRecoCombi : public TObject 
-{
- public:
-    virtual ~AliMUONEventRecoCombi();
-    static AliMUONEventRecoCombi* Instance(AliMUONSegmentation* segmentation = 0);
-    void FillEvent(AliMUONRecData *data, AliMUONClusterFinderAZ *recModel); // fill event info
-    void FillRecP(AliMUONRecData *dataCluster, AliMUONTrackReconstructorK *recoTrack) const; // fill used rec. points from det. elems
-
-    Int_t Nz() const { return fNZ; } ///< number of DE different Z-positions
-    Double_t Z(Int_t iz) const { return (*fZ)[iz]; } ///< Z of DE
-    Int_t *DEatZ(Int_t iz) const { return fDEvsZ[iz]+1; } ///< list of DE's at Z
-    AliMUONDetElement *DetElem(Int_t iPos) const { return (AliMUONDetElement*) fDetElems->UncheckedAt(iPos); } ///< Det element
-    Int_t IZfromHit(AliMUONHitForRec *hit) const; // IZ from Hit
-
- protected:
-    AliMUONEventRecoCombi(AliMUONSegmentation* segmentation = 0);
-
- private:
-    /// Not implemented
-    AliMUONEventRecoCombi(const AliMUONEventRecoCombi& rhs);
-    /// Not implemented
-    AliMUONEventRecoCombi & operator = (const AliMUONEventRecoCombi& rhs);
-
-    static AliMUONEventRecoCombi* fgRecoCombi; //!< singleton instance
-    AliMUONSegmentation*  fSegmentation;  //!< Segmentation
-    TClonesArray *fDetElems; //!< array of Det. Elem. objects
-    TArrayD *fZ; //!< array of det. elem. Z-coordinates
-    Int_t fNZ; //!< number of different Z's
-    Int_t **fDEvsZ; //!< list of DE's vs Z-coordinates
-
-    ClassDef(AliMUONEventRecoCombi, 0) // Combined cluster/track finder steering class
-      };
-#endif
diff --git a/MUON/AliMUONGeometrySegmentation.cxx b/MUON/AliMUONGeometrySegmentation.cxx
deleted file mode 100644 (file)
index 16a908d..0000000
+++ /dev/null
@@ -1,685 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-//
-// Class AliMUONGeometrySegmentation
-// -------------------------------
-// New class for the module segmentation 
-// composed of the segmentations of detection elements.
-// Applies transformations defined in geometry.
-//
-// Author:Ivana Hrivnacova, IPN Orsay
-
-#include "AliMUONGeometrySegmentation.h"
-#include "AliMUONVGeometryDESegmentation.h"
-#include "AliMUONGeometryModuleTransformer.h"
-#include "AliMUONGeometryDetElement.h"
-
-#include "AliMpExMap.h"
-
-#include "AliLog.h"
-
-#include <Riostream.h>
-#include <TObjString.h>
-#include <TClass.h>
-
-const Float_t  AliMUONGeometrySegmentation::fgkMaxDistance = 1.0e6;
-
-/// \cond CLASSIMP
-ClassImp(AliMUONGeometrySegmentation)
-/// \endcond
-
-//______________________________________________________________________________
-AliMUONGeometrySegmentation::AliMUONGeometrySegmentation(
-                             const AliMUONGeometryModuleTransformer* transformer) 
-: TObject(),
-  fCurrentDetElemId(0),
-  fCurrentDetElement(0),
-  fCurrentSegmentation(0),
-  fkModuleTransformer(transformer),
-  fDESegmentations(0),
-  fDENames(0)
-  
-{
-/// Standard constructor
-
-  fDESegmentations = new AliMpExMap(true);
-  fDESegmentations->SetOwner(false);
-  fDENames = new AliMpExMap(true);
-
-  AliDebug(1, Form("ctor this = %p", this) ); 
-}
-
-//______________________________________________________________________________
-AliMUONGeometrySegmentation::AliMUONGeometrySegmentation() 
-: TObject(),
-  fCurrentDetElemId(0),
-  fCurrentDetElement(0),
-  fCurrentSegmentation(0),
-  fkModuleTransformer(0),
-  fDESegmentations(0),
-  fDENames(0)
-  
-{
-/// Default Constructor
-
-  AliDebug(1, Form("default (empty) ctor this = %p", this));
-}
-
-//______________________________________________________________________________
-AliMUONGeometrySegmentation::~AliMUONGeometrySegmentation() 
-{
-/// Destructor
-
-  AliDebug(1, Form("dtor this = %p", this));
-
-  delete fDESegmentations;
-  delete fDENames;
-} 
-
-//
-// private methods
-//
-
-//______________________________________________________________________________
-Bool_t AliMUONGeometrySegmentation::OwnNotify(Int_t detElemId, Bool_t warn) const
-{
-/// Update current detection element and segmentation,
-/// and checks if they exist.
-/// Return true if success.
-
-  if (detElemId != fCurrentDetElemId) {
-
-    // Find detection element and its segmentation
-    AliMUONGeometryDetElement* detElement
-      = fkModuleTransformer->GetDetElement(detElemId, warn);
-    if (!detElement) {
-      if (warn)
-        AliError(Form("Detection element %d not defined", detElemId));
-      return false;
-    }     
-
-    AliMUONVGeometryDESegmentation* segmentation 
-      = (AliMUONVGeometryDESegmentation*) fDESegmentations->GetValue(detElemId);
-    if (!segmentation) {
-      if (warn)
-        AliError(Form("Segmentation for detection element %d not defined",
-                       detElemId));
-      return false;                 
-    }
-  
-    fCurrentDetElemId = detElemId;
-    fCurrentDetElement = detElement;
-    fCurrentSegmentation = segmentation;
-  }  
-  return true;
-}        
-
-//
-// public methods
-//
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::Add(Int_t detElemId, const TString& detElemName,
-                                      AliMUONVGeometryDESegmentation* segmentation)
-{
-/// Add detection element segmentation
-
-  fDESegmentations->Add(detElemId, segmentation); 
-  fDENames->Add(detElemId, new TObjString(detElemName)); 
-}  
-
-
-//______________________________________________________________________________
-const AliMUONVGeometryDESegmentation* 
-AliMUONGeometrySegmentation::GetDESegmentation(Int_t detElemId, Bool_t warn) const
-{
-/// Return the DE segmentation 
-
-  if (!OwnNotify(detElemId, warn)) return 0;
-
-  return fCurrentSegmentation;
-}
-
-//______________________________________________________________________________
-AliMUONGeometryDirection 
-AliMUONGeometrySegmentation::GetDirection(Int_t detElemId) const
-{
-/// Return direction with a constant pad size. 
-/// (Direction or coordinate where the resolution is the best)
-
-  if (!OwnNotify(detElemId)) return kDirUndefined;
-
-  return fCurrentSegmentation->GetDirection();
-}
-
-//______________________________________________________________________________
-TString AliMUONGeometrySegmentation::GetDEName(Int_t detElemId) const
-{
-/// Return name of the given detection element
-
-  TObjString* deName = (TObjString*)fDENames->GetValue(detElemId);
-  
-  if (deName)
-    return deName->GetString();
-  else {  
-    AliWarningStream()
-         << "Detection element " << detElemId  << " not defined. " << endl;
-    return "Undefined";
-  }
-}    
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::Print(Option_t* opt) const
-{
-/// Print DE segmentations
-
-  std::cout << "fDESegmentations (class " 
-           << fDESegmentations->Class()->GetName() << ") entries=" 
-           << fDESegmentations->GetSize() 
-           << std::endl;
-  fDESegmentations->Print(opt);        
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::SetPadSize(Float_t p1, Float_t p2)
-{
-/// Set pad size Dx*Dy to all detection element segmentations 
-
-  for (Int_t i=0; i<fDESegmentations->GetSize(); i++) {
-     AliMUONVGeometryDESegmentation* segmentation
-       = (AliMUONVGeometryDESegmentation*)fDESegmentations->GetObject(i);
-     segmentation->SetPadSize(p1, p2);
-  }   
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::SetDAnod(Float_t d)
-{
-/// Set anod pitch to all detection element segmentations
-
-  for (Int_t i=0; i<fDESegmentations->GetSize(); i++) {
-     AliMUONVGeometryDESegmentation* segmentation
-       = (AliMUONVGeometryDESegmentation*)fDESegmentations->GetObject(i);
-     segmentation->SetDAnod(d);
-  }   
-}
-
-//______________________________________________________________________________
-Float_t AliMUONGeometrySegmentation::GetAnod(Int_t detElemId, Float_t xhit) const
-{
-/// Anod wire coordinate closest to xhit
-/// Returns for a hit position xhit the position of the nearest anode wire
-/// !!! xhit is understand a a distance, not as a position in the space
-/// CHECK
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  return fCurrentSegmentation->GetAnod(xhit);
-}
-
-//______________________________________________________________________________
-Bool_t  AliMUONGeometrySegmentation::GetPadI(Int_t detElemId,
-                                        Float_t xg, Float_t yg, Float_t zg, 
-                                        Int_t& ix, Int_t& iy)
-{                                      
-/// Return pad coordinates (ix,iy) for given real coordinates (x,y)
-
-  if (!OwnNotify(detElemId)) return false;
-  
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xg, yg, zg, xl, yl, zl); 
-
-  if (!fCurrentSegmentation->HasPad(xl, yl, zl)) return false;
-
-  fCurrentSegmentation->GetPadI(xl, yl, zl, ix, iy);
-  return true;
-}
-
-//______________________________________________________________________________
-Bool_t
-AliMUONGeometrySegmentation::HasPad(Int_t detElemId, Int_t ix, Int_t iy)
-{
-/// Tell if a given pad exists in a given detector element
-
-  if (!OwnNotify(detElemId)) return false;
-       
-  return fCurrentSegmentation->HasPad(ix,iy);
-}
-                                    
-//______________________________________________________________________________
-Bool_t
-AliMUONGeometrySegmentation::HasPad(Int_t detElemId, 
-                                    Float_t xg, Float_t yg, Float_t zg)
-{
-/// Tell if a given pad exists in a given detector element
-
-  if (!OwnNotify(detElemId)) return false;
-       
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xg, yg, zg, xl, yl, zl); 
-
-  return fCurrentSegmentation->HasPad(xl, yl, zl);
-}
-                                    
-//______________________________________________________________________________
-Bool_t  
-AliMUONGeometrySegmentation::GetPadC(Int_t detElemId,
-                                     Int_t ix, Int_t iy, 
-                                     Float_t& xg, Float_t& yg, Float_t& zg)
-{                                      
-/// Transform from pad to real coordinates
-
-  if (!OwnNotify(detElemId)) return false;
-  if (!fCurrentSegmentation->HasPad(ix, iy)) {
-    xg = yg = zg = fgkMaxDistance;
-    return false;
-  }
-  
-  Float_t xl, yl, zl;
-  fCurrentSegmentation->GetPadC(ix, iy, xl , yl, zl);
-
-  fkModuleTransformer->Local2Global(detElemId, xl, yl, zl, xg, yg, zg); 
-  return true;
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::Init(Int_t chamber)
-{
-/// Initialize segmentation.
-/// Check that all detection elements have segmanetation set
-
-  // Loop over detection elements
-  AliMpExMap* detElements = fkModuleTransformer->GetDetElementStore();
-
-  for (Int_t i=0; i<detElements->GetSize(); i++) {
-
-    // Skip not filled entries
-    if (!detElements->GetObject(i)) continue;
-
-    // Get detction element Id
-    Int_t detElemId = detElements->GetObject(i)->GetUniqueID();
-
-    // Check segmentation
-    if (! fDESegmentations->GetValue(detElemId) ) {
-      AliErrorStream()
-        << "Detection element " << detElemId << " has not a segmentation set." 
-       << endl;
-    }
-    else {             
-      // Initialize DE Segmentation
-      ((AliSegmentation*)fDESegmentations->GetValue(detElemId))->Init(chamber);
-    }                 
-  }               
-}
-//______________________________________________________________________________
-Float_t AliMUONGeometrySegmentation::Dpx(Int_t detElemId) const
-{
-/// Get pad size in x
-
-  if (!OwnNotify(detElemId)) return 0.;
-  
-  return fCurrentSegmentation->Dpx();
-}
-
-//______________________________________________________________________________
-Float_t AliMUONGeometrySegmentation::Dpy(Int_t detElemId) const
-{
-/// Get pad size in y
-
-  if (!OwnNotify(detElemId)) return 0.;
-
-  return fCurrentSegmentation->Dpy();
-}
-//______________________________________________________________________________
-Float_t AliMUONGeometrySegmentation::Dpx(Int_t detElemId, Int_t isector) const
-{
-/// Pad size in x by sector
-
-  if (!OwnNotify(detElemId)) return 0.;
-
-  return fCurrentSegmentation->Dpx(isector);
-} 
-
-//______________________________________________________________________________
-Float_t AliMUONGeometrySegmentation::Dpy(Int_t detElemId, Int_t isector) const
-{
-/// Pad size in y by Sector 
-
-  if (!OwnNotify(detElemId)) return 0.;
-
-  return fCurrentSegmentation->Dpy(isector);
-}
-
-//______________________________________________________________________________
-Int_t AliMUONGeometrySegmentation::Npx(Int_t detElemId) const
-{
-/// Maximum number of Pads in x
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  return fCurrentSegmentation->Npx();
-}
-
-//______________________________________________________________________________
-Int_t AliMUONGeometrySegmentation::Npy(Int_t detElemId) const
-{
-/// Maximum number of Pads in y
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  return fCurrentSegmentation->Npy();
-}
-
-//______________________________________________________________________________
-void  AliMUONGeometrySegmentation::SetPad(Int_t detElemId, Int_t ix, Int_t iy)
-{
-/// Set pad position.
-/// Sets virtual pad coordinates, needed for evaluating pad response 
-/// outside the tracking program.
-/// From AliMUONGeometrySegmentationV01.
-
-  if (!OwnNotify(detElemId)) return;
-
-  fCurrentSegmentation->SetPad(ix, iy);
-}
-
-//______________________________________________________________________________
-void  AliMUONGeometrySegmentation::SetHit(Int_t detElemId, 
-                                        Float_t xghit, Float_t yghit, Float_t zghit)
-{
-/// Set hit position.
-/// Sets virtual hit position, needed for evaluating pad response 
-/// outside the tracking program 
-/// From AliMUONGeometrySegmentationV01.
-
-  if (!OwnNotify(detElemId)) return;
-
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xghit, yghit, zghit, xl, yl, zl); 
-
-  fCurrentSegmentation->SetHit(xl, yl, zl);
-}
-    
-//______________________________________________________________________________
-void  AliMUONGeometrySegmentation::FirstPad(Int_t detElemId,
-                                        Float_t xghit, Float_t yghit, Float_t zghit, 
-                                        Float_t dx, Float_t dy) 
-{                                       
-/// Iterate over pads - initialiser
-
-  if (!OwnNotify(detElemId)) return;
-
-  AliDebug(1,Form("xghit, yghit, zghit, dx, dy = %e,%e,%e,%e, %e",
-                   xghit, yghit, zghit, dx, dy));
-  
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xghit, yghit, zghit, xl, yl, zl); 
-
-  fCurrentSegmentation->FirstPad(xl, yl, zl, dx, dy);
-}
-//______________________________________________________________________________
-void  AliMUONGeometrySegmentation::NextPad(Int_t detElemId)
-{
-/// Iterate over pads - stepper
-
-  if (!OwnNotify(detElemId)) return;
-  
-  fCurrentSegmentation->NextPad();
-}
-
-//______________________________________________________________________________
-Int_t AliMUONGeometrySegmentation::MorePads(Int_t detElemId)
-{
-/// Iterate over pads - condition
-
-  if (!OwnNotify(detElemId)) return 0;
-  
-  return fCurrentSegmentation->MorePads();
-}
-
-//______________________________________________________________________________
-Float_t AliMUONGeometrySegmentation::Distance2AndOffset(Int_t detElemId,
-                                           Int_t ix, Int_t iy, 
-                                          Float_t xg, Float_t yg,  Float_t zg,
-                                          Int_t* dummy)
-{                                         
-/// Return the square of the distance between 1 pad
-/// labelled by its channel numbers and a coordinate
-
-  if (!OwnNotify(detElemId)) return 0.;
-
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xg, yg, zg, xl, yl, zl); 
-
-  return fCurrentSegmentation->Distance2AndOffset(ix, iy, xl, yl, dummy);
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::GetNParallelAndOffset(Int_t detElemId,
-                                            Int_t ix, Int_t iy,
-                                           Int_t* nparallel, Int_t* offset)
-{                                         
-/// Number of pads read in parallel and offset to add to x 
-/// (specific to LYON, but mandatory for display)
-/// CHECK
-
-  if (!OwnNotify(detElemId)) return;
-
-  fCurrentSegmentation->GetNParallelAndOffset(ix, iy, nparallel, offset);  
-}
-
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::Neighbours(Int_t detElemId,
-                                           Int_t ix, Int_t iy, 
-                                           Int_t* nlist, 
-                                          Int_t xlist[10], Int_t ylist[10])
-{                                        
-/// Get next neighbours 
-
-  if (!OwnNotify(detElemId)) return;
-
-  fCurrentSegmentation->Neighbours(ix, iy, nlist, xlist, ylist);
-}
-
-//______________________________________________________________________________
-Int_t  AliMUONGeometrySegmentation::Ix()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  return fCurrentSegmentation->Ix();
-}
-
-//______________________________________________________________________________
-Int_t  AliMUONGeometrySegmentation::Iy()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  return fCurrentSegmentation->Iy();
-}
-
-//______________________________________________________________________________
-Int_t  AliMUONGeometrySegmentation::DetElemId()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  return fCurrentDetElemId;
-}
-
-//______________________________________________________________________________
-Int_t  AliMUONGeometrySegmentation::ISector()
-{
-/// Current sector
-
-  return fCurrentSegmentation->ISector();
-}
-
-//______________________________________________________________________________
-Int_t AliMUONGeometrySegmentation::Sector(Int_t detElemId, Int_t ix, Int_t iy)
-{
-/// Calculate sector from pad indices
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  return fCurrentSegmentation->Sector(ix, iy);
-}
-
-//______________________________________________________________________________
-Int_t AliMUONGeometrySegmentation::Sector(Int_t detElemId,
-                                        Float_t xg, Float_t yg, Float_t zg)
-{
-/// Calculate sector from pad coordinates
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xg, yg, zg, xl, yl, zl); 
-
-  return fCurrentSegmentation->Sector(xl, yl);
-}
-
-//______________________________________________________________________________
-void  AliMUONGeometrySegmentation::IntegrationLimits(Int_t detElemId,
-                                        Float_t& x1, Float_t& x2,
-                                        Float_t& y1, Float_t& y2)
-{                                                
-/// Current integration limits 
-  if (!OwnNotify(detElemId)) return;
-
-  fCurrentSegmentation->IntegrationLimits(x1, x2, y1, y2);
-}
-
-//______________________________________________________________________________
-Int_t AliMUONGeometrySegmentation::SigGenCond(Int_t detElemId,
-                                        Float_t xg, Float_t yg, Float_t zg)
-{
-/// Signal Generation Condition during Stepping
-///  0: don't generate signal                                                 \n
-///  1: generate signal                                                       \n
-///  Comments:                                                                \n
-///                                                                           \n
-///  Crossing of pad boundary and mid plane between neighbouring wires is checked.
-///  To correctly simulate the dependence of the spatial resolution on the angle 
-///  of incidence signal must be generated for constant steps on 
-///  the projection of the trajectory along the anode wire.
-///                                                                           \n
-///  Signal will be generated if particle crosses pad boundary or
-///  boundary between two wires. 
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xg, yg, zg, xl, yl, zl); 
-
-  return fCurrentSegmentation->SigGenCond(xl, yl, zl);
- }
-
-//______________________________________________________________________________
-void  AliMUONGeometrySegmentation::SigGenInit(Int_t detElemId,
-                                       Float_t xg, Float_t yg, Float_t zg)
-{
-/// Initialise signal generation at coord (x,y,z)
-/// Initialise pad and wire position during stepping.
-/// From AliMUONGeometrySegmentationV01
-
-  if (!OwnNotify(detElemId)) return;
-
-  Float_t xl, yl, zl;
-  fCurrentDetElement->Global2Local(xg, yg, zg, xl, yl, zl); 
-
-  if (!fCurrentSegmentation->HasPad(xl, yl, zl)) {
-    AliWarningStream()
-         << "No pad at " << detElemId 
-         << " global position: " << xg << "  " << yg << "  " << zg
-         << " local position: " << xl << "  " << yl << "  " << zl << endl;
-    return ;
-  }  
-
-  fCurrentSegmentation->SigGenInit(xl, yl, zl);
-}                  
-    
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::GiveTestPoints(Int_t /*detElemId*/,
-                                       Int_t& /*n*/, 
-                                      Float_t* /*xg*/, Float_t* /*yg*/) const
-{                                            
-/// Test points for auto calibration
-/// Return test point on the pad plane.
-/// Used during determination of the segmoid correction of the COG-method
-/// From AliMUONGeometrySegmentationV01
-
-  // Requires change of interface
-  // to convert points from local to global we need z coordinate
-  AliError("Not implemented.");
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::Draw(const char* opt)
-{
-/// Draw the segmentation zones for all detElemId 
-
-  for (Int_t i=0; i<fDESegmentations->GetSize(); i++) {
-     AliMUONVGeometryDESegmentation* segmentation
-       = (AliMUONVGeometryDESegmentation*)fDESegmentations->GetObject(i);
-     segmentation->Draw(opt);
-  }   
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::Draw(Int_t detElemId, const char* opt)
-{
-/// Draw the segmentation zones for a given detElemId.
-
-  if (!OwnNotify(detElemId)) return;
-
-  fCurrentSegmentation->Draw(opt);
-}
-
-//______________________________________________________________________________
-void AliMUONGeometrySegmentation::SetCorrFunc(Int_t detElemId, 
-                                              Int_t isec, TF1* func)
-{
-/// Set the correction function.
-/// From AliMUONGeometrySegmentationV01
-
-  if (!OwnNotify(detElemId)) return;
-
-  fCurrentSegmentation->SetCorrFunc(isec, func);
-}
-
-//______________________________________________________________________________
-TF1* AliMUONGeometrySegmentation::CorrFunc(Int_t detElemId, Int_t isec) const
-{
-/// Get the correction Function.
-/// From AliMUONGeometrySegmentationV01
-
-  if (!OwnNotify(detElemId)) return 0;
-
-  return  fCurrentSegmentation->CorrFunc(isec);
-} 
-
diff --git a/MUON/AliMUONGeometrySegmentation.h b/MUON/AliMUONGeometrySegmentation.h
deleted file mode 100644 (file)
index 91d1bef..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup geometry
-/// \class AliMUONGeometrySegmentation
-/// \brief Segmentation for a geometry module 
-/// 
-/// New class for the geometry segmentation 
-/// composed of the segmentations of detection elements.
-/// Applies transformations defined in geometry.
-///
-/// \author Ivana Hrivnacova, IPN Orsay
-
-#ifndef ALI_MUON_GEOMETRY_SEGMENTATION_H
-#define ALI_MUON_GEOMETRY_SEGMENTATION_H
-
-#include "AliMUONGeometryDirection.h"
-
-#include <TObject.h>
-#include <TString.h>
-
-class TObjArray;
-class TF1;
-
-class AliMUONGeometryModuleTransformer;
-class AliMUONGeometryDetElement;
-class AliMUONVGeometryDESegmentation;
-class AliMUONSegmentManuIndex;
-
-class AliMpExMap;
-
-class AliMUONGeometrySegmentation : public TObject
-{
-  public:
-    AliMUONGeometrySegmentation(
-           const AliMUONGeometryModuleTransformer* geometry);
-    AliMUONGeometrySegmentation();
-    virtual ~AliMUONGeometrySegmentation();
-
-    // Methods
-    //
-    void Add(Int_t detElemId, const TString& detElemName,
-             AliMUONVGeometryDESegmentation* segmentation); 
-    // Get methods
-    //
-    const AliMUONGeometryModuleTransformer* GetTransformer() const;
-                       // Geometry transformer       
-    const AliMUONVGeometryDESegmentation* GetDESegmentation(
-                        Int_t detElemId, Bool_t warn = true) const;
-                       // DE segmentation
-    
-    AliMUONGeometryDirection GetDirection(Int_t detElemId) const;
-                       // Direction with a constant pad size  
-                      // (Direction or coordinate where the resolution 
-                      // is the best)
-    
-    TString GetDEName(Int_t detElemId) const;                 
-                       // DE name
-
-    // Redefined methods from AliSegmentation interface
-    // 
-
-    // Set Chamber Segmentation Parameters
-    //
-    virtual void SetPadSize(Float_t p1, Float_t p2);
-                       // Pad size Dx*Dy 
-    virtual void SetDAnod(Float_t D);
-                       // Anode Pitch
-
-    // Transform from pad (wire) to real coordinates and vice versa
-    //
-    virtual Float_t GetAnod(Int_t detElemId, Float_t xlhit) const;
-                       // Anode wire coordinate closest to xhit
-    virtual Bool_t  GetPadI(Int_t detElemId,
-                          Float_t xg, Float_t yg, Float_t  zg, 
-                          Int_t& ix, Int_t& iy);
-                       // Transform from pad to real coordinates
-    virtual Bool_t  GetPadC(Int_t detElemId,
-                          Int_t ix, Int_t iy,
-                          Float_t& x, Float_t& y, Float_t& z);
-                       // Transform from real to pad coordinates
-
-    virtual Bool_t HasPad(Int_t detElemId, 
-                          Int_t ix, Int_t iy);
-    virtual Bool_t HasPad(Int_t detElemId, 
-                          Float_t x, Float_t y, Float_t z);
-  
-    // Initialisation
-    //
-    virtual void Init(Int_t chamber);
-    // Get member data
-    //
-    virtual Float_t Dpx(Int_t detElemId) const;
-    virtual Float_t Dpy(Int_t detElemId) const ;
-                      // Pad size in x, y 
-    virtual Float_t Dpx(Int_t detElemId, Int_t isector) const;
-    virtual Float_t Dpy(Int_t detElemId, Int_t isector) const;
-                      // Pad size in x, y by Sector 
-    virtual Int_t   Npx(Int_t detElemId) const;
-    virtual Int_t   Npy(Int_t detElemId) const;
-                      // Maximum number of Pads in y
-
-    virtual void  SetPad(Int_t detElemId, Int_t ix, Int_t iy);
-                      // Set pad position
-    virtual void  SetHit(Int_t detElemId, Float_t xghit, Float_t yghit, Float_t zghit);
-                      // Set hit position
-    
-    // Iterate over pads
-    //    
-    virtual void  FirstPad(Int_t detElemId, 
-                           Float_t xghit, Float_t yghit, Float_t zghit, 
-                           Float_t dx, Float_t dy);
-    virtual void  NextPad(Int_t detElemId);
-    virtual Int_t MorePads(Int_t detElemId);
-
-    virtual Float_t Distance2AndOffset(Int_t detElemId,
-                           Int_t ix, Int_t iy, 
-                           Float_t xg, Float_t yg, Float_t zg, 
-                          Int_t* dummy);
-                      // Distance between 1 pad and a position
-    virtual void GetNParallelAndOffset(Int_t detElemId,
-                           Int_t ix, Int_t iy,
-                          Int_t* nparallel, Int_t* offset);
-                      // Number of pads read in parallel and offset to add to x 
-                      // (specific to LYON, but mandatory for display)
-    virtual void Neighbours(Int_t detElemId,
-                            Int_t ix, Int_t iy,
-                            Int_t* nlist, Int_t xlist[10], Int_t ylist[10]);
-                      // Get next neighbours 
-
-    // Current values
-    //
-    virtual Int_t  Ix();
-    virtual Int_t  Iy();
-    virtual Int_t  DetElemId();
-                     // Current pad cursor during disintegration
-                     // x, y-coordinate
-    virtual Int_t  ISector();
-                    // current sector
-
-    virtual Int_t  Sector(Int_t detElemId,
-                          Int_t ix, Int_t iy);
-    virtual Int_t  Sector(Int_t detElemId,
-                          Float_t xg, Float_t yg, Float_t zg);
-                    // calculate sector from pad coordinates
-
-    virtual void  IntegrationLimits(Int_t detElemId,
-                          Float_t& x1, Float_t& x2,
-                          Float_t& y1, Float_t& y2);
-                   // Current integration limits 
-
-    // Signal Generation
-    //
-    virtual Int_t SigGenCond(Int_t detElemId,
-                          Float_t xg, Float_t yg, Float_t zg);
-                    // Signal Generation Condition during Stepping
-    virtual void  SigGenInit(Int_t detElemId,
-                          Float_t xg, Float_t yg, Float_t zg);
-                    // Initialise signal generation at coord (x,y,z)
-                   
-    
-    virtual void GiveTestPoints(Int_t detElemId,
-                          Int_t& n, Float_t* xg, Float_t* yg) const;
-                   // Test points for auto calibration
-    virtual void Draw(const char *opt = "");
-    virtual void Draw(Int_t detElemId, const char *opt = "");
-                   // Draw the segmentation zones
-
-    // Function for systematic corrections
-    //
-    virtual void SetCorrFunc(Int_t detElemId,
-                          Int_t isec,  TF1* func);
-                   // Set the correction function
-    virtual TF1* CorrFunc(Int_t detElemId, Int_t isec) const;
-                   // Get the correction Function
-    // Printing
-    //
-    virtual void Print(Option_t* opt = "") const;
-       
-  protected:
-    /// Not implemented
-    AliMUONGeometrySegmentation(const AliMUONGeometrySegmentation& rhs);
-    /// Not implemented
-    AliMUONGeometrySegmentation& operator=(const AliMUONGeometrySegmentation & rhs);
-
-  private:
-    // methods
-    Bool_t OwnNotify(Int_t detElemId, Bool_t warn = true) const;
-
-    // static data members
-    static  const Float_t  fgkMaxDistance; ///< \brief the big value passed to pad coordinates
-                                           /// if pad does not exist
-  
-    // data members
-    mutable  Int_t                           fCurrentDetElemId;   ///< current DE ID 
-    mutable  AliMUONGeometryDetElement*      fCurrentDetElement;  ///< current detection element 
-    mutable  AliMUONVGeometryDESegmentation* fCurrentSegmentation;///< current DE segmentation
-   
-    const AliMUONGeometryModuleTransformer*  fkModuleTransformer; ///< associated geometry transformer
-    AliMpExMap*  fDESegmentations; ///< DE segmentations
-    AliMpExMap*  fDENames;         ///< DE names
-    
-   ClassDef(AliMUONGeometrySegmentation,3) // Geometry segmentation
-};
-
-// inline functions
-
-/// Return associated geometry transformer
-inline 
-const AliMUONGeometryModuleTransformer* 
-AliMUONGeometrySegmentation::GetTransformer() const
-{ return fkModuleTransformer; }              
-
-#endif //ALI_MUON_GEOMETRY_SEGMENTATION_H
-
-
-
-
-
-
-
-
diff --git a/MUON/AliMUONHitMapA1.cxx b/MUON/AliMUONHitMapA1.cxx
deleted file mode 100644 (file)
index a202a71..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -----------------------
-// Class AliMUONHitMapA1
-// -----------------------
-// Implements AliHitMap as a 1-dim array
-// ...
-
-#include "AliMUONHitMapA1.h"
-#include "AliMUONDigit.h"
-
-#include "AliLog.h"
-
-#include <TObjArray.h>
-#include <TMath.h>
-
-ClassImp(AliMUONHitMapA1)
-
-AliMUONHitMapA1::AliMUONHitMapA1()
-  : AliHitMap(),
-    fNpx(0),
-    fNpy(0),
-    fDigits(0),
-    fMaxIndex(0),
-    fHitMap(0)
-{
-/// Default constructor
-}
-
-//________________________________________________________________________________
-AliMUONHitMapA1::AliMUONHitMapA1(Int_t npx, Int_t npy, TObjArray* dig)
-  : AliHitMap(),
-    fNpx(npx),
-    fNpy(npy),
-    fDigits(dig),
-    fMaxIndex(2*(fNpx+1)*2*(fNpy+1)+2*fNpy),
-    fHitMap(new Int_t[fMaxIndex])
-{
-/// Standard constructor
-    Clear();
-}
-//_________________________________
-AliMUONHitMapA1::~AliMUONHitMapA1()
-{
-/// Destructor
-    if (fHitMap) delete[] fHitMap;
-}
-//______________________________________
-void AliMUONHitMapA1::Clear(const char *)
-{
-/// Clear hitmap
-    memset(fHitMap,0,sizeof(int)*fMaxIndex);
-}
-//___________________________________________________
-Bool_t AliMUONHitMapA1::ValidateHit(Int_t ix, Int_t iy)
-{
-/// Check if pad coordinates are within boundaries
-
-//    printf("\n Validate %d %d %d %d", ix, iy, fNpx, fNpy);
-    
-    return (TMath::Abs(ix) <= fNpx && TMath::Abs(iy) <= fNpy); 
-}
-//_________________________________________________________
-Int_t AliMUONHitMapA1::CheckedIndex(Int_t ix, Int_t iy) const
-{
-/// Return checked indices ix, iy
-    Int_t index=2*fNpy*(ix+fNpx)+(iy+fNpy);
-    if ( index < 0 || index >= fMaxIndex ) {
-        AliWarning(Form("index outside array ix %d iy %d MaxIndex %d index %d Npx %d Npy %d",
-                     ix, iy, fMaxIndex, index, fNpx, fNpy));
-       return  fMaxIndex-1;
-    } else {
-       return index;
-    }
-}
-//_____________________________
-void  AliMUONHitMapA1::FillHits()
-{
-/// Fill hits from digits list  
-    Int_t ndigits = fDigits->GetEntriesFast();
-    //printf("\n Filling hits into HitMap\n");
-    //printf("FindRawClusters -- ndigits %d \n",ndigits);
-    if (!ndigits) return;
-    AliMUONDigit *dig;
-    for (Int_t ndig=0; ndig<ndigits; ndig++) {
-       dig = (AliMUONDigit*)fDigits->UncheckedAt(ndig);
-       SetHit(dig->PadX(),dig->PadY(),ndig);
-    }
-}
-//___________________________________________________________
-void  AliMUONHitMapA1::SetHit(Int_t ix, Int_t iy, Int_t idigit)
-{
-/// Assign digit to hit cell ix,iy
-
-//    fHitMap[kMaxNpady*(ix+fNpx)+(iy+fNpy)]=idigit+1;
-    fHitMap[CheckedIndex(ix, iy)]=idigit+1;
-}
-//_______________________________________________
-void AliMUONHitMapA1::DeleteHit(Int_t ix, Int_t iy)
-{
-/// Delete hit at cell ix,iy
-
-//    fHitMap[kMaxNpady*(ix+fNpx)+(iy+fNpy)]=0;
-    fHitMap[CheckedIndex(ix, iy)]=0;
-}
-//_____________________________________________
-void AliMUONHitMapA1::FlagHit(Int_t ix, Int_t iy)
-{
-/// Flag hit as used
-    fHitMap[CheckedIndex(ix, iy)]=
-       -TMath::Abs(fHitMap[CheckedIndex(ix, iy)]);
-}
-//________________________________________________________
-Int_t AliMUONHitMapA1::GetHitIndex(Int_t ix, Int_t iy) const
-{
-/// Get absolute value of contents of hit cell ix,iy
-    return TMath::Abs(fHitMap[CheckedIndex(ix, iy)])-1;
-}
-//_______________________________________________________
-TObject* AliMUONHitMapA1::GetHit(Int_t ix, Int_t iy) const
-{
-/// Get pointer to object at hit cell ix, iy
-/// Force crash if index does not exist ! (Manu)
-    Int_t index=GetHitIndex(ix,iy);
-    return (index <0) ? 0 : fDigits->UncheckedAt(GetHitIndex(ix,iy));
-}
-//_________________________________________________
-FlagType AliMUONHitMapA1::TestHit(Int_t ix, Int_t iy)
-{
-/// Check if hit cell is empty, used or unused
-
-    Int_t index = CheckedIndex(ix, iy);
-    if (index<0 || index >= fMaxIndex) return kEmpty;
-
-    Int_t inf=fHitMap[index];
-    if (inf < 0) {
-       return kUsed;
-    } else if (inf == 0) {
-       return kEmpty;
-    } else {
-       return kUnused;
-    }
-}
diff --git a/MUON/AliMUONHitMapA1.h b/MUON/AliMUONHitMapA1.h
deleted file mode 100644 (file)
index b1da3d9..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef ALIMUONHITMAPA1_H
-#define ALIMUONHITMAPA1_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-
-/// \ingroup base
-/// \class AliMUONHitMapA1
-/// \brief Implements AliHitMap as a 1-dim array
-
-#include "AliHitMap.h"
-
-class TObjArray;
-
-class AliMUONHitMapA1 : public AliHitMap 
-{
- public:
-    AliMUONHitMapA1();
-    //AliMUONHitMapA1(Int_t idDE, AliMUONGeometrySegmentation* seg, TObjArray* dig);
-    AliMUONHitMapA1(Int_t npx, Int_t npy, TObjArray* dig);
-    virtual ~AliMUONHitMapA1();
-
-    // Fill hits from list of digits into hit map
-    virtual  void  FillHits();
-    // Clear the hit map
-    virtual  void  Clear(const char *opt = "");
-    // Set a single hit
-    virtual  void  SetHit(Int_t ix, Int_t iy, Int_t idigit);
-    // Delete a single hit
-    virtual  void  DeleteHit(Int_t ix, Int_t iy);
-    // Get index of hit in the list of digits
-    virtual Int_t  GetHitIndex(Int_t ix, Int_t iy) const;
-    // Get pointer to digit
-    virtual TObject*  GetHit(Int_t ix, Int_t iy) const;
-    // Flag a hit as used
-    virtual  void  FlagHit(Int_t ix, Int_t iy);
-    // Validate
-    virtual  Bool_t ValidateHit(Int_t ix, Int_t iy);
-    // Test hit status
-    virtual FlagType TestHit(Int_t ix, Int_t iy);
-
- private:
-    /// Not implemented
-    AliMUONHitMapA1(const AliMUONHitMapA1 & hitMap);
-    /// Not implemented
-    AliMUONHitMapA1& operator = (const AliMUONHitMapA1& rhs);
-
-    // Check index
-    Int_t CheckedIndex(Int_t ix, Int_t iy) const;
- private:
-    Int_t fNpx;                           ///< Maximum number of pads in x
-    Int_t fNpy;                           ///< Maximum number of pads in y
-    TObjArray *fDigits;                   ///< Pointer to digits
-    Int_t fMaxIndex;                      ///< maximum index in hit map
-
-    /// The array of digits
-    Int_t *fHitMap;                       // ! [fMaxIndex]         
-
-    ClassDef(AliMUONHitMapA1,0) // Implements HitMap as a 1-dim array
-};
-#endif 
diff --git a/MUON/AliMUONPoints.cxx b/MUON/AliMUONPoints.cxx
deleted file mode 100644 (file)
index 089fc6a..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  This class contains the points for the ALICE event display               //
-//                                                                           //
-//Begin_Html
-/*
-<img src="gif/AliMUONPointsClass.gif">
-*/
-//End_Html
-//                                                                           //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
-
-#include <TClonesArray.h>
-#include <TROOT.h>
-#include <TPolyMarker3D.h>
-#include <TVirtualPad.h>
-#include <TPaveText.h>
-#include <TMarker3DBox.h>
-#include "AliMUONPoints.h"
-#include "AliMUONDisplay.h"
-#include "AliRun.h"
-#include "AliMUON.h"
-#include "AliMUONHit.h"
-#include "AliMUONDigit.h"
-#include "AliLog.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONPoints)
-/// \endcond
-
-//_____________________________________________________________________________
-AliMUONPoints::AliMUONPoints()
-  : AliPoints(),
-    fHitIndex(0),
-    fTrackIndex(0),
-    fDigitIndex(0),
-    fMatrix(0)
-
-{
-  /// Default constructor
-
-  fMarker[0] = fMarker[1] = fMarker[2]=0;
-}
-
-//_____________________________________________________________________________
-AliMUONPoints::AliMUONPoints(Int_t npoints)
-  : AliPoints(npoints),
-    fHitIndex(0),
-    fTrackIndex(0),
-    fDigitIndex(0),
-    fMatrix(0)
-{
-  /// Standard constructor
-
-  fMarker[0] = fMarker[1] = fMarker[2]=0;
-}
-
-//_____________________________________________________________________________
-AliMUONPoints::~AliMUONPoints()
-{
-  /// Destructor
-
-  fHitIndex = 0;
-  fTrackIndex = 0;
-  fDigitIndex = 0;
-  for (Int_t i=0;i<3;i++){
-      if (fMarker[i]) delete fMarker[i];
-  }
-  fMatrix = 0;
-}
-
-//_____________________________________________________________________________
-void AliMUONPoints::DumpHit() const
-{
-  /// Dump hit corresponding to this point
-  AliMUONHit *hit = GetHit();
-  if (hit) hit->Dump();
-}
-
-//_____________________________________________________________________________
-void AliMUONPoints::DumpDigit() const
-{
-  /// Dump digit corresponding to this point
-
-  AliMUONDigit *digit = GetDigit();
-  if (digit) digit->Dump();
-}
-
-//_____________________________________________________________________________
-void AliMUONPoints::InspectHit()
-{
-  /// Inspect hit corresponding to this point
-
-  if (fHitIndex < 0 ) return;
-  TVirtualPad *padsav = gPad;
-  AliMUONHit *hit = GetHit();
-  if (hit) hit->Inspect();
-  TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
-   padinspect->cd();
-   Float_t xmin = gPad->GetX1();
-   Float_t xmax = gPad->GetX2();
-   Float_t ymin = gPad->GetY1();
-   Float_t ymax = gPad->GetY2();
-   Float_t dy   = ymax-ymin;
-
-      TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.15*dy);
-      pad->SetBit(kCanDelete);
-      pad->SetFillColor(42);
-      pad->Draw();
-      char ptitle[100];
-      sprintf(ptitle," %s , fTrack: %d  fTrackIndex: %d ",GetName(),fIndex,fTrackIndex);
-      pad->AddText(ptitle);
-      padinspect->cd();
-      padinspect->Update();
-  if (padsav) padsav->cd();
-
-}
-
-//_____________________________________________________________________________
-void AliMUONPoints::InspectDigit()
-{
-  /// Inspect digit corresponding to this point
-
-  if (fDigitIndex < 0) return;
-  TVirtualPad *padsav = gPad;
-  AliMUONDigit *digit = GetDigit();
-  if (digit) digit->Inspect();
-  TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
-   padinspect->cd();
-   Float_t xmin = gPad->GetX1();
-   Float_t xmax = gPad->GetX2();
-   Float_t ymin = gPad->GetY1();
-   Float_t ymax = gPad->GetY2();
-   Float_t dy   = ymax-ymin;
-
-      TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.25*dy);
-      pad->SetBit(kCanDelete);
-      pad->SetFillColor(42);
-      pad->Draw();
-      char ptitle[11][100];
-      //      sprintf(ptitle[11],"Tracks making this digit");
-      //      pad->AddText(ptitle[11]);
-  for (int i=0;i<digit->Ntracks();i++) {
-      if (digit->Track(i) == 0) continue;  
-      sprintf(ptitle[i],"fTrackIndex: %d  Charge: %e",
-             digit->Track(i), digit->TrackCharge(i));
-      pad->AddText(ptitle[i]);
-  }
-      padinspect->cd();
-      padinspect->Update();
-  if (padsav) padsav->cd();
-      
-}
-
-//_____________________________________________________________________________
-Int_t AliMUONPoints::GetTrackIndex() const
-{
-  /// Dump digit corresponding to this point
-
-  Inspect();
-  /*
-  if (fDigitIndex != 0) {
-    Int_t ncol=this->fMatrix->GetNcols();
-    for (int i=0;i<ncol;i++) {
-        printf(" track charge %f %f \n",(*(this->fMatrix))(0,i),(*(this->fMatrix))(1,i));
-    }
-  }
-  */
-  return fTrackIndex;
-}
-
-//_____________________________________________________________________________
-AliMUONHit *AliMUONPoints::GetHit() const
-{
-  /// Returns pointer to hit index in AliRun::fParticles
-
-  AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");
-  
-  pMUON->TreeH()->GetEvent(fTrackIndex);
-  TClonesArray *muonHits  = pMUON->Hits();
-  Int_t nhits = muonHits->GetEntriesFast();
-  if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
-  return (AliMUONHit*)muonHits->UncheckedAt(fHitIndex);
-}
-
-//_____________________________________________________________________________
-AliMUONDigit *AliMUONPoints::GetDigit() const
-{
-  /// Returns pointer to digit index in AliRun::fParticles
-
-  AliMUONDisplay *display=(AliMUONDisplay*)gAlice->Display();
-  Int_t chamber=display->GetChamber();
-   
-  AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");
-  TClonesArray *muonDigits  = pMUON->GetMUONData()->Digits(chamber-1);
-  pMUON->GetMUONData()->GetDigits();
-  //gAlice->TreeD()->GetEvent(cathode);
-  Int_t ndigits = muonDigits->GetEntriesFast();
-  if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0;
-  return (AliMUONDigit*)muonDigits->UncheckedAt(fDigitIndex);
-}
diff --git a/MUON/AliMUONPoints.h b/MUON/AliMUONPoints.h
deleted file mode 100644 (file)
index a037d9b..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef ALIMUONPOINTS_H
-#define ALIMUONPOINTS_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-//
-/// \ingroup evaluation
-/// \class AliMUONPoints
-/// \brief Class to draw detector clusters (is PolyMarker3D)
-
-class TMarker3DBox;
-#include <TMatrixFfwd.h>
-
-class AliMUONDigit;
-class AliMUONHit;
-#include "AliPoints.h"
-
-class AliMUONPoints : public AliPoints 
-{
-public:
-  AliMUONPoints();
-  AliMUONPoints(Int_t npoints);
-  virtual ~AliMUONPoints();
-                        
-                       /// Return hit index
-  Int_t                 GetHitIndex() const {return fHitIndex;}
-  Int_t                 GetTrackIndex() const; // *MENU*
-                       /// Return digit index
-  Int_t                 GetDigitIndex() const {return fDigitIndex;}
-                       /// Return associated 3D-marker
-  TMarker3DBox         *GetMarker(Int_t i) const {return fMarker[i];}
-  AliMUONHit           *GetHit() const;
-  AliMUONDigit         *GetDigit() const;
-  virtual void          InspectHit(); // *MENU*
-  virtual void          DumpHit() const; // *MENU*
-  virtual void          InspectDigit(); // *MENU*
-  virtual void          DumpDigit() const; // *MENU*
-                        /// Set hit index
-  virtual void          SetHitIndex(Int_t hitindex) {fHitIndex = hitindex;}
-                        /// Set track index
-  virtual void          SetTrackIndex(Int_t trackindex) {fTrackIndex = trackindex;}
-                        /// Set digit index
-  virtual void          SetDigitIndex(Int_t digitindex) {fDigitIndex = digitindex;}
-                        /// Set associated 3D-marker
-  virtual void          Set3DMarker(Int_t i,TMarker3DBox *marker) {fMarker[i] = marker;}
-                        /// Set matrix
-  virtual void          SetMatrix(TMatrixF *matrix) {fMatrix = matrix;}
-  
-protected:
-  /// Not implemented
-  AliMUONPoints(const AliMUONPoints& points);  
-  /// Not implemented
-  AliMUONPoints& operator = (const AliMUONPoints& rhs);
-
-   Int_t            fHitIndex;         ///< Link to hit number 
-   Int_t            fTrackIndex;       ///< Link to track number 
-   Int_t            fDigitIndex;       ///< Link to digit 
-   TMarker3DBox    *fMarker[3];        ///< pointer to  associated 3D-marker
-   TMatrixF        *fMatrix;           ///< test
-   
-  ClassDef(AliMUONPoints,1) //Class to draw detector clusters (is PolyMarker3D) for MUON
-};
-#endif
-
-
diff --git a/MUON/AliMUONRecData.cxx b/MUON/AliMUONRecData.cxx
deleted file mode 100644 (file)
index 6a9667c..0000000
+++ /dev/null
@@ -1,838 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-/// \class AliMUONRecData
-///
-/// Class containing MUON data: hits, digits, rawclusters, globaltrigger, localtrigger, etc ..
-/// The classe makes the lik between the MUON data lists and the event trees from loaders
-///
-/// \author Gines Martinez, Subatech,  September 2003
-///
-
-#include "AliMUONRecData.h"
-#include "AliMUONDataIterator.h"
-#include "AliMUONConstants.h"
-#include "AliMUONDigit.h"
-#include "AliMUONGlobalTrigger.h"
-#include "AliMUONLocalTrigger.h"
-#include "AliMUONRegionalTrigger.h"
-#include "AliMUONTriggerCrateStore.h"
-#include "AliMUONTriggerCircuit.h"
-#include "AliMUONGeometryTransformer.h"
-#include "AliMUONRawCluster.h"
-#include "AliMUONTrack.h"
-#include "AliMUONTriggerTrack.h"
-
-#include "AliRunLoader.h"
-#include "AliStack.h"
-#include "AliLog.h"
-
-#include <TString.h>
-#include <TParticle.h>
-#include <TNtuple.h>
-#include <Riostream.h>
-#include <TFile.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONRecData)
-/// \endcond
-//_____________________________________________________________________________
-AliMUONRecData::AliMUONRecData()
-  : AliMUONData(),
-    fRawClusters(0x0),
-    fRecTracks(0x0),
-    fRecTriggerTracks(0x0),
-    fNrawclusters(0x0),
-    fNrectracks(0),
-    fNrectriggertracks(0)
-{
-/// Default constructor
-}
-//_____________________________________________________________________________
-AliMUONRecData::AliMUONRecData(AliLoader * loader, const char* name, const char* title)
-  : AliMUONData(loader, name, title),
-    fRawClusters(0x0),
-    fRecTracks(0x0),
-    fRecTriggerTracks(0x0),
-    fNrawclusters(0x0),
-    fNrectracks(0),
-    fNrectriggertracks(0)
-{
-/// Standard constructor
-}
-
-//_____________________________________________________________________________
-AliMUONRecData::AliMUONRecData(const char* galiceFile)
-  : AliMUONData(galiceFile, "MUONFolder"),
-    fRawClusters(0x0),
-    fRecTracks(0x0),
-    fRecTriggerTracks(0x0),
-    fNrawclusters(0x0),
-    fNrectracks(0),
-    fNrectriggertracks(0)
-{
-/// Constructor for loading data from gAlice file
-}
-
-//_____________________________________________________________________________
-AliMUONRecData::~AliMUONRecData()
-{
-/// Destructor for AliMUONRecData
-
-  if (fRawClusters) {
-    fRawClusters->Delete();
-    delete fRawClusters;
-  }
-  if (fRecTracks){
-    fRecTracks->Delete();
-    delete fRecTracks;
-  }
-  if (fRecTriggerTracks){
-    fRecTriggerTracks->Delete();
-    delete fRecTriggerTracks;
-  }
-}
-//_____________________________________________________________________________
-void AliMUONRecData::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
-{
-/// Add a MUON rawcluster to the list in the detection plane id
-
-  TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id));
-  new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c);
-}
-//_____________________________________________________________________________
-void AliMUONRecData::AddRecTrack(const AliMUONTrack& track)
-{
-/// Add a MUON rectrack
-
-  TClonesArray &lrectracks = *fRecTracks;
-  new(lrectracks[fNrectracks++]) AliMUONTrack(track);
-}
-//_____________________________________________________________________________
-void AliMUONRecData::AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack)
-{
-/// Add a MUON triggerrectrack
-
-  TClonesArray &lrectriggertracks = *fRecTriggerTracks;  
-  new(lrectriggertracks[fNrectriggertracks++]) AliMUONTriggerTrack(triggertrack);
-}
-//____________________________________________________________________________
-Bool_t   AliMUONRecData::IsRawClusterBranchesInTree()
-{
-/// Checking if there are RawCluster Branches In TreeR
-
-  if (TreeR()==0x0) {
-    AliError("No treeR in memory");
-    return kFALSE;
-  }
-  else {
-     char branchname[30];
-     sprintf(branchname,"%sRawClusters1",GetName());
-     TBranch * branch = 0x0;
-     branch = TreeR()->GetBranch(branchname);
-     if (branch)  return kTRUE;
-     else return kFALSE;    
-  }
-}
-//____________________________________________________________________________
-Bool_t   AliMUONRecData::IsTrackBranchesInTree()
-{
-/// Checking if there are Track Branches In TreeT
-  if (TreeT()==0x0) {
-    AliError("No treeT in memory");
-    return kFALSE;
-  }
-  else {
-     char branchname[30];
-     sprintf(branchname,"%sTrack",GetName());
-     TBranch * branch = 0x0;
-     branch = TreeT()->GetBranch(branchname);
-     if (branch)  return kTRUE;
-     else return kFALSE;    
-  }
-}
-//____________________________________________________________________________
-Bool_t   AliMUONRecData::IsTriggerBranchesInTree()
-{
-/// Checking if there are Trigger Branches In TreeR
- if (TreeR()==0x0) {
-    AliError("No treeR in memory");
-    return kFALSE;
-  }
-  else {
-     char branchname[30];
-     sprintf(branchname,"%sLocalTrigger",GetName());
-     TBranch * branch = 0x0;
-     branch = TreeR()->GetBranch(branchname);
-     if (branch)  return kTRUE;
-     else return kFALSE;    
-  }
-}
-//____________________________________________________________________________
-Bool_t   AliMUONRecData::IsTriggerTrackBranchesInTree()
-{
-/// Checking if there are TriggerTrack Branches In TreeT
-  if (TreeT()==0x0) {
-    AliError("No treeT in memory");
-    return kFALSE;
-  }
-  else {
-     char branchname[30];
-     sprintf(branchname,"%sTriggerTrack",GetName());
-     TBranch * branch = 0x0;
-     branch = TreeT()->GetBranch(branchname);
-     if (branch)  return kTRUE;
-     else return kFALSE;    
-  }
-}
-//____________________________________________________________________________
-void AliMUONRecData::FillOwn(Option_t* option)
-{
-/// Method to fill the trees
-
-  const char *cRC  = strstr(option,"RC");  // RawCluster branches in TreeR
-  const char *cRT  = strstr(option,"RT");  // Reconstructed Track in TreeT
-  const char *cRL = strstr(option,"RL");   // Reconstructed Trigger Track in TreeT
-  const char *cTC = strstr(option,"TC");   // global and local Trigger branches Copy in TreeR
-  
-  char branchname[30];
-  TBranch * branch = 0x0;
-
-  // Filling TreeR
-  
-  if ( TreeR() && cRC && cTC )
-  {
-    TreeR()->Fill();
-  }
-  else
-  {  
-    if ( TreeR()  && cRC ) 
-    {
-      if ( IsTriggerBranchesInTree() ) 
-      {
-      // Branch per branch filling
-        for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) 
-        {
-          sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
-          branch = TreeR()->GetBranch(branchname);
-          branch->Fill();
-        }
-      }
-      else  
-      {
-        TreeR()->Fill();
-      }
-    }
-    
-    if ( TreeR()  && cTC) 
-    {
-      if (IsRawClusterBranchesInTree()) 
-      {
-        // Branch per branch filling
-        sprintf(branchname,"%sLocalTrigger",GetName());
-        branch = TreeR()->GetBranch(branchname); 
-        branch->Fill();
-       sprintf(branchname,"%sRegionalTrigger",GetName());
-        branch = TreeR()->GetBranch(branchname); 
-        branch->Fill();
-        sprintf(branchname,"%sGlobalTrigger",GetName());
-        branch = TreeR()->GetBranch(branchname);
-        branch->Fill();
-      }
-      else
-      {
-        TreeR()->Fill();
-      }
-    }
-  }
-
-  // Filling TreeT
-  
-  if ( TreeT() && cRT && cRL )
-  {
-    TreeT()->Fill();
-  }
-  else
-  {
-    if ( TreeT() && cRT ) 
-    {
-      if (IsTriggerTrackBranchesInTree()) 
-      {
-        sprintf(branchname,"%sTrack",GetName());  
-        branch = TreeT()->GetBranch(branchname);
-        branch->Fill();
-      }
-      else 
-      {
-        TreeT()->Fill();
-      }
-    }
-
-    if ( TreeT() && cRL ) 
-    {
-      if (IsTrackBranchesInTree()) 
-      {
-        sprintf(branchname,"%sTriggerTrack",GetName());  
-        branch = TreeT()->GetBranch(branchname);
-        branch->Fill();
-      }    
-      else 
-      {
-        TreeT()->Fill();
-      }
-    }
-  }
-}
-
-//_____________________________________________________________________________
-void AliMUONRecData::MakeOwnBranch(Option_t* option)
-{
-/// Create Tree branches for the MUON.
-
-  const Int_t kBufferSize = 4000;
-  char branchname[30];
-  
-  //Setting Data Container
-  SetDataContainer(option);  
-
-  const char *cRC  = strstr(option,"RC");  // RawCluster branches in TreeR
-  const char *cRT  = strstr(option,"RT");  // Reconstructed Track in TreeT
-  const char *cRL  = strstr(option,"RL");  // Reconstructed Trigger Track in TreeT
-                                           //const char *cRP  = strstr(option,"RP");  // Reconstructed Particle in TreeP
-  const char *cTC = strstr(option,"TC");   // global and local Trigger branches Copy in TreeR
-  
-  TBranch * branch = 0x0;
-  
-  if (TreeR() && cRC ) {
-    //  one branch for raw clusters per tracking detection plane
-    //        
-    Int_t i; 
-    for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
-      sprintf(branchname,"%sRawClusters%d",GetName(),i+1);     
-      branch = 0x0;
-      branch = TreeR()->GetBranch(branchname);
-      if (branch) {  
-        AliInfo(Form("Branch %s is already in tree.",branchname));
-        return;
-      }
-      branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
-      //Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1);
-    }
-  }
-  
-  if (TreeR() && cTC ) {
-    //
-    // one branch for global trigger
-    //
-    sprintf(branchname,"%sGlobalTrigger",GetName());
-    branch = 0x0;
-    branch = TreeR()->GetBranch(branchname);
-    if (branch) {  
-      AliInfo(Form("Branch GlobalTrigger is already in treeR."));
-      return ;
-    }
-    branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
-    //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
-
-  //
-    // one branch for regional trigger
-    //  
-    sprintf(branchname,"%sRegionalTrigger",GetName());
-    branch = 0x0;
-    branch = TreeR()->GetBranch(branchname);
-    if (branch) {  
-      AliInfo(Form("Branch RegionalTrigger is already in treeR."));
-      return;
-    }
-    branch = TreeR()->Branch(branchname, &fRegionalTrigger, kBufferSize);
-     
-    //
-    // one branch for local trigger
-    //  
-    sprintf(branchname,"%sLocalTrigger",GetName());
-    branch = 0x0;
-    branch = TreeR()->GetBranch(branchname);
-    if (branch) {  
-      AliInfo(Form("Branch LocalTrigger is already in treeR."));
-      return;
-    }
-    branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
-    //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);  
-  }
-  
-  if (TreeT() && cRT ) {
-    sprintf(branchname,"%sTrack",GetName());  
-    branch = TreeT()->GetBranch(branchname);
-    if (branch) {  
-      AliInfo(Form("Branch %s is already in tree.",GetName()));
-      return ;
-    }
-    branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
-    //Info("MakeBranch","Making Branch %s for tracks \n",branchname);
-  }  
-  // trigger tracks
-  if (TreeT() && cRL ) {
-    sprintf(branchname,"%sTriggerTrack",GetName());  
-    branch = TreeT()->GetBranch(branchname);
-    if (branch) {  
-      AliInfo(Form("Branch %s is already in tree.",GetName()));
-      return ;
-    }
-    branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
-    //Info("MakeBranch","Making Branch %s for trigger tracks \n",branchname);
-  }  
-}
-//____________________________________________________________________________
-void AliMUONRecData::SetOwnDataContainer(Option_t* option)
-{
-/// Setting data containers of muon data
-
-  const char *cRC  = strstr(option,"RC");  // RawCluster
-  const char *cRT  = strstr(option,"RT");  // Reconstructed Tracks
-  const char *cRL  = strstr(option,"RL");  // Reconstructed Trigger Tracks
-                                           //const char *cRP  = strstr(option,"RP");  // Reconstructed Particles  
-  const char *cTC = strstr(option,"TC");   // global and local Trigger branches Copy in TreeR
-
-  AliDebug(1,Form("option=%s",option));
-
-  //
-  // Containers for rawclusters, globaltrigger and local trigger tree
-  if (cRC ) {
-    if (fRawClusters == 0x0) {
-      fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
-      fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
-      for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
-       TClonesArray* tca = new TClonesArray("AliMUONRawCluster",10000);
-       tca->SetOwner();
-        fRawClusters->AddAt(tca,i); 
-        fNrawclusters[i]=0;
-      }
-    }
-    // ResetRawClusters(); 
-    // It breaks the correct functioning of the combined reconstruction (AZ)
-    
-  }
-  if (cTC ) {
-    if (fLocalTrigger == 0x0) {
-      fLocalTrigger  = new TClonesArray("AliMUONLocalTrigger",234);
-    }
-   if (fRegionalTrigger == 0x0) {
-      fRegionalTrigger  = new TClonesArray("AliMUONRegionalTrigger",16);
-    }
-    if (fGlobalTrigger== 0x0) {
-      fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1); 
-    }
-    // ResetTrigger(); 
-    // This is not necessary here since trigger info ins copied from digits info on flight to RecPoint output
-  }
-
-  //
-  // Containers for rectracks and rectrigger tracks
-  if ( cRT ) {
-    if (fRecTracks == 0x0)  {
-      fRecTracks  = new TClonesArray("AliMUONTrack",100);
-    }
-    ResetRecTracks();
-  }
-  if (cRL) {
-    if (fRecTriggerTracks == 0x0 && cRL)  {
-      fRecTriggerTracks  = new TClonesArray("AliMUONTriggerTrack",100);
-    }
-    ResetRecTriggerTracks();
-  }  
-}
-
-//____________________________________________________________________________
-void AliMUONRecData::SetOwnTreeAddress(Option_t* option)
-{
-  // Setting Data containers
-  SetOwnDataContainer(option);
-
-/// Setting Addresses to the events trees
-
-  const char *cRC  = strstr(option,"RC");  // RawCluster branches in TreeR
-  const char *cRT  = strstr(option,"RT");  // Reconstructed Track in TreeT
-  const char *cRL  = strstr(option,"RL");  // Reconstructed Trigger Track in TreeT
-                                           //const char *cRP  = strstr(option,"RP");  // Reconstructed Particle in TreeP
-  const char *cTC = strstr(option,"TC");   // global and local Trigger branches Copy in TreeR
-  
-  // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
-  char branchname[30];
-  TBranch * branch = 0x0;
-  
-  AliDebug(1,Form("option=%s",option));
-
-  //
-  // Branch address for rawclusters, globaltrigger and local trigger tree
-  if ( TreeR()  && fRawClusters && cRC && !strstr(cRC,"RCC")) {
-    for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
-      sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
-      if (fRawClusters) {
-        branch = TreeR()->GetBranch(branchname);
-        if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
-        else AliWarning(Form("(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i));
-      }
-    }
-  }
-  if ( TreeR()  && fLocalTrigger && cTC) {
-    sprintf(branchname,"%sLocalTrigger",GetName());
-    branch = TreeR()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fLocalTrigger);
-    else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeR.",GetName()));
-  }
-  if ( TreeR()  && fRegionalTrigger && cTC) {
-    sprintf(branchname,"%sRegionalTrigger",GetName());
-    branch = TreeR()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fRegionalTrigger);
-    else AliWarning(Form("(%s) Failed for RegionalTrigger. Can not find branch in treeR.",GetName()));
-  }
-  if ( TreeR() && fGlobalTrigger && cTC) {
-    sprintf(branchname,"%sGlobalTrigger",GetName());
-    branch = TreeR()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fGlobalTrigger);
-    else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName()));
-  }
-
-  // Rec Trakcs
-  if ( TreeT() && fRecTracks && cRT ) {
-    sprintf(branchname,"%sTrack",GetName());  
-    branch = TreeT()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fRecTracks);
-    else AliWarning(Form("(%s) Failed for Tracks. Can not find branch in tree.",GetName()));
-  }
-  // Trigger tracks
-  if ( TreeT() && fRecTriggerTracks && cRL ) {
-    sprintf(branchname,"%sTriggerTrack",GetName());  
-    branch = TreeT()->GetBranch(branchname);
-    if (branch) branch->SetAddress(&fRecTriggerTracks);
-    else AliWarning(Form("(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName()));
-  }
-}
-
-//____________________________________________________________________________
-void AliMUONRecData::Fill(Option_t* option)
-{
-/// Method to fill the trees
-
-  AliMUONData::Fill(option);
-  FillOwn(option);
-}  
-
-//_____________________________________________________________________________
-void AliMUONRecData::MakeBranch(Option_t* option)
-{
-/// Create Tree branches for the MUON.
-
-  AliMUONData::MakeBranch(option);
-  MakeOwnBranch(option);
-}  
-
-//____________________________________________________________________________
-void AliMUONRecData::SetDataContainer(Option_t* option)
-{
-/// Setting data containers of muon data
-  AliMUONData::SetDataContainer(option);
-  SetOwnDataContainer(option);
-}
-
-//____________________________________________________________________________
-void AliMUONRecData::SetTreeAddress(Option_t* option)
-{
-/// Setting Addresses to the events trees
-
-  AliMUONData::SetTreeAddress(option);
-  SetOwnTreeAddress(option);
-}  
-
-//____________________________________________________________________________
-TClonesArray*  AliMUONRecData::RawClusters(Int_t DetectionPlane)
-{
-/// Getting Raw Clusters
-
-  if (fRawClusters) 
-    return ( (TClonesArray*) fRawClusters->At(DetectionPlane) );
-  else
-    return NULL;
-}
-
-//_______________________________________________________________________________
-void AliMUONRecData::ResetRawClusters()
-{
-/// Reset number of raw clusters and the raw clust array for this detector
-
-  for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
-    if ((*fRawClusters)[i])    ((TClonesArray*)fRawClusters->At(i))->Clear();
-    if (fNrawclusters)  fNrawclusters[i]=0;
-  }
-}
-
-//____________________________________________________________________________
-void AliMUONRecData::ResetRecTracks()
-{
-/// Reset tracks information
-
-  fNrectracks = 0;
-  if (fRecTracks) fRecTracks->Delete(); // necessary to delete in case of memory allocation
-}
-
-//____________________________________________________________________________
-void AliMUONRecData::ResetRecTriggerTracks()
-{
-/// Reset tracks information
-
-  fNrectriggertracks = 0;
-  if (fRecTriggerTracks) fRecTriggerTracks->Delete(); // necessary to delete in case of memory allocation
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONRecData::DumpRecPoints(Int_t event2Check, Option_t* opt) 
-{
-/// Dump rec points
-
-  fLoader->LoadRecPoints("READ");
-
-  // Event loop
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  for (Int_t ievent=0; ievent<nevents; ievent++) {
-    if (event2Check!=0) ievent=event2Check;
-    printf(">>> Event %d \n",ievent);
-
-    // Getting event ievent
-    fRunLoader->GetEvent(ievent);
-    Int_t nchambers = AliMUONConstants::NTrackingCh();
-    SetTreeAddress("RC,TC"); 
-    GetRawClusters();
-
-    // Loop on chambers
-    for (Int_t ichamber=0; ichamber<nchambers; ichamber++) {
-      char branchname[30];    
-      sprintf(branchname,"MUONRawClusters%d",ichamber+1);
-      //printf(">>>  branchname %s\n",branchname);
-
-      // Loop on rec points
-      Int_t nrecpoints = (Int_t) RawClusters(ichamber)->GetEntriesFast();
-      // printf(">>> Chamber %2d, Number of recpoints = %6d \n",ichamber+1, nrecpoints);
-      for (Int_t irecpoint=0; irecpoint<nrecpoints; irecpoint++) {
-       AliMUONRawCluster* mRecPoint = static_cast<AliMUONRawCluster*>(RawClusters(ichamber)->At(irecpoint));
-       mRecPoint->Print(opt);
-      }
-    }
-    ResetRawClusters();
-    if (event2Check!=0) ievent=nevents;
-  }
-  fLoader->UnloadRecPoints();
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONRecData::DumpTracks(Int_t event2Check, Option_t* opt) 
-{
-  /// Dump tracks
-  
-  fLoader->LoadTracks("READ");
-  
-  // Event loop
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  
-  for (Int_t ievent=0; ievent<nevents; ievent++) 
-  {
-    if (event2Check!=0) ievent=event2Check;
-  
-    printf(">>> Event %d \n",ievent);
-    
-    // Getting event ievent
-    fRunLoader->GetEvent(ievent);
-    
-    SetTreeAddress("RT"); 
-    GetRecTracks();
-    
-    // Loop on tracks
-    TClonesArray* tracks = RecTracks();
-    Int_t ntracks = (Int_t) tracks->GetEntriesFast();
-
-    for (Int_t i=0; i<ntracks; ++i) 
-    {
-      AliMUONTrack* mTrack = static_cast<AliMUONTrack*>(tracks->At(i));
-      mTrack->Print(opt);
-    }
-    ResetRecTracks();
-    if (event2Check!=0) ievent=nevents;
-  }
-  fLoader->UnloadTracks();
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONRecData::DumpRecTrigger(Int_t event2Check, 
-                            Int_t write, Bool_t readFromRP)
-{
-/// Reads and dumps trigger objects from MUON.RecPoints.root
-
-  TClonesArray * globalTrigger;
-  TClonesArray * localTrigger;
-  
-  // Do NOT print out all the info if the loop runs over all events 
-  Int_t printout = (event2Check == 0 ) ? 0 : 1 ;  
-
-  // Book a ntuple for more detailled studies
-  TNtuple *tupleGlo = new TNtuple("TgtupleGlo","Global Trigger Ntuple","ev:global:slpt:shpt:uplpt:uphpt:lplpt:lplpt");
-  TNtuple *tupleLoc = new TNtuple("TgtupleLoc","Local Trigger Ntuple","ev:LoCircuit:LoStripX:LoDev:StripY:LoLpt:LoHpt:y11:y21:x11");
-
-  // counters
-  Int_t sLowpt=0,sHighpt=0;
-  Int_t uSLowpt=0,uSHighpt=0;
-  Int_t lSLowpt=0,lSHighpt=0;
-
-  AliMUONTriggerCrateStore* crateManager = new AliMUONTriggerCrateStore();   
-  crateManager->ReadFromFile();
-
-  AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer(kFALSE);
-  transformer->ReadGeometryData("volpath.dat", "geometry.root");
-
-  TClonesArray*  triggerCircuit = new TClonesArray("AliMUONTriggerCircuit", 234);
-
-  for (Int_t i = 0; i < AliMUONConstants::NTriggerCircuit(); i++)  {
-      AliMUONTriggerCircuit* c = new AliMUONTriggerCircuit();
-      c->SetTransformer(transformer);
-      c->Init(i,*crateManager);
-      TClonesArray& circuit = *triggerCircuit;
-      new(circuit[circuit.GetEntriesFast()])AliMUONTriggerCircuit(*c);
-      delete c;
-  }
-  
-  Char_t fileName[30];
-  if (!readFromRP) {
-      AliInfoStream() << " reading from digits \n";
-      fLoader->LoadDigits("READ");
-      sprintf(fileName,"TriggerCheckFromDigits.root");
-  } else {
-      AliInfoStream() << " reading from RecPoints \n";
-      fLoader->LoadRecPoints("READ");
-      sprintf(fileName,"TriggerCheckFromRP.root");
-  }
-
-  
-  AliMUONGlobalTrigger *gloTrg(0x0);
-  AliMUONLocalTrigger *locTrg(0x0);
-
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  for (Int_t ievent=0; ievent<nevents; ievent++) {
-    if (event2Check!=0) ievent=event2Check;
-    if (ievent%100==0 || event2Check) 
-      AliInfoStream() << "Processing event " << ievent << endl;
-    fRunLoader->GetEvent(ievent);
-    
-    if (!readFromRP) {
-       SetTreeAddress("D,GLT"); 
-       GetTriggerD();
-    } else {    
-       SetTreeAddress("RC,TC"); 
-       GetTrigger();
-    }
-
-    globalTrigger = GlobalTrigger();
-    localTrigger = LocalTrigger();
-    
-    Int_t nglobals = (Int_t) globalTrigger->GetEntriesFast(); // should be 1
-    Int_t nlocals  = (Int_t) localTrigger->GetEntriesFast(); // up to 234
-    if (printout) printf("###################################################\n");
-    if (printout) printf("event %d nglobal %d nlocal %d \n",ievent,nglobals,nlocals);
-
-    for (Int_t iglobal=0; iglobal<nglobals; iglobal++) { // Global Trigger
-      gloTrg = static_cast<AliMUONGlobalTrigger*>(globalTrigger->At(iglobal));
-      
-      sLowpt+=gloTrg->SingleLpt() ;
-      sHighpt+=gloTrg->SingleHpt() ;
-      uSLowpt+=gloTrg->PairUnlikeLpt(); 
-      uSHighpt+=gloTrg->PairUnlikeHpt();
-      lSLowpt+=gloTrg->PairLikeLpt(); 
-      lSHighpt+=gloTrg->PairLikeHpt();
-      
-      if (printout) gloTrg->Print("full");
-
-    } // end of loop on Global Trigger
-
-    for (Int_t ilocal=0; ilocal<nlocals; ilocal++) { // Local Trigger
-      locTrg = static_cast<AliMUONLocalTrigger*>(localTrigger->At(ilocal));
-
-      Bool_t xTrig=kFALSE;
-      Bool_t yTrig=kFALSE;
-
-      if ( locTrg->LoSdev()==1 && locTrg->LoDev()==0 && 
-          locTrg->LoStripX()==0) xTrig=kFALSE; // no trigger in X
-      else xTrig=kTRUE;                         // trigger in X
-      if (locTrg->LoTrigY()==1 && 
-         locTrg->LoStripY()==15 ) yTrig = kFALSE; // no trigger in Y
-      else yTrig = kTRUE;                          // trigger in Y
-
-      if (xTrig && yTrig) { // make Trigger Track if trigger in X and Y
-         
-         if (printout) locTrg->Print("full");
-         
-         AliMUONTriggerCircuit* circuit = (AliMUONTriggerCircuit*)triggerCircuit->At(locTrg->LoCircuit()-1); 
-         
-         tupleLoc->Fill(ievent,locTrg->LoCircuit(),locTrg->LoStripX(),locTrg->LoDev(),locTrg->LoStripY(),locTrg->LoLpt(),locTrg->LoHpt(),circuit->GetY11Pos(locTrg->LoStripX()),circuit->GetY21Pos(locTrg->LoStripX()+locTrg->LoDev()+1),circuit->GetX11Pos(locTrg->LoStripY()));
-      }
-      
-    } // end of loop on Local Trigger
-    
-    // fill ntuple
-    tupleGlo->Fill(ievent,nglobals,gloTrg->SingleLpt(),gloTrg->SingleHpt(),gloTrg->PairUnlikeLpt(),gloTrg->PairUnlikeHpt(),gloTrg->PairLikeLpt(),gloTrg->PairLikeHpt());
-    
-    ResetTrigger();
-    if (event2Check!=0) ievent=nevents;
-  } // end loop on event  
-  
-  // Print out summary if loop ran over all event
-  if (!event2Check){
-
-    printf("\n");
-    printf("=============================================\n");
-    printf("================  SUMMARY  ==================\n");
-    printf("\n");
-    printf("Total number of events processed %d \n", (event2Check==0) ? nevents : 1);
-    printf("\n");
-    printf(" Global Trigger output       Low pt  High pt\n");
-    printf(" number of Single           :\t");
-    printf("%i\t%i\t",sLowpt,sHighpt);
-    printf("\n");
-    printf(" number of UnlikeSign pair  :\t"); 
-    printf("%i\t%i\t",uSLowpt,uSHighpt);
-    printf("\n");
-    printf(" number of LikeSign pair    :\t");  
-    printf("%i\t%i\t",lSLowpt,lSHighpt);
-    printf("\n");
-    printf("=============================================\n");
-    fflush(stdout);
-  }
-  
-  if (write){
-      TFile *myFile = new TFile(fileName, "RECREATE");
-      tupleGlo->Write();
-      tupleLoc->Write();
-      myFile->Close();
-  }
-
-  fLoader->UnloadRecPoints();
-
-  delete crateManager;
-  delete transformer;
-  delete triggerCircuit;
-  
-}
diff --git a/MUON/AliMUONRecData.h b/MUON/AliMUONRecData.h
deleted file mode 100644 (file)
index f46bdf8..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-#ifndef ALIMUONRECDATA_H
-#define ALIMUONRECDATA_H
-//
-/*  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-//
-/// \ingroup rec
-/// \class AliMUONRecData
-/// \brief Class containing MUON data: hits, digits, rawclusters, globaltrigger, 
-/// localtrigger, etc ...
-///
-//  Author: Gines Martinez, Subatech,  September 2003
-
-#include "AliLoader.h"
-
-#include "AliMUONData.h"
-
-class AliMUONRawCluster;
-class AliMUONTrack;
-class AliMUONTriggerTrack;
-
-class AliRunLoader;
-
-class TClonesArray;
-class TObjArray;
-class TTree;
-
-
-//__________________________________________________________________
-/////////////////////////////////////////////////////////////////////
-//                                                                 //
-//  class AliMUONData                                              //
-//                                                                 //
-/////////////////////////////////////////////////////////////////////
-
-class AliMUONRecData : public AliMUONData
-{
-  public:
-  
-  //  enum EChamberIteration { kAllChambers, kTrackingChambers, kTriggerChambers };
-  
-    AliMUONRecData();
-    AliMUONRecData(AliLoader * loader, const char* name, const char* title);
-    AliMUONRecData(const char* galiceFile);
-    virtual ~AliMUONRecData();  
-    
-    virtual void   AddRawCluster(Int_t id, const AliMUONRawCluster& clust);
-    virtual void   AddRecTrack(const AliMUONTrack& track);
-    virtual void   AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack);
-
-    TClonesArray*  RawClusters(Int_t DetectionPlane);
-    
-                    /// Return reconstructed tracks
-    TClonesArray*  RecTracks() {return fRecTracks;} 
-                   /// Return reconstructed trigger tracks
-    TClonesArray*  RecTriggerTracks() {return fRecTriggerTracks;}
-
-    void           GetRawClusters() const;
-    void           GetTrigger() const;
-    void           GetRecTracks() const;
-    void           GetRecTriggerTracks() const;
-
-    Bool_t        IsRawClusterBranchesInTree();
-    Bool_t        IsTrackBranchesInTree();
-    Bool_t        IsTriggerBranchesInTree();
-    Bool_t        IsTriggerTrackBranchesInTree();
-    
-    virtual void   Fill(Option_t* opt=" ");
-    virtual void   MakeBranch(Option_t *opt=" ");
-    virtual void   SetDataContainer(Option_t *opt=" ");
-    virtual void   SetTreeAddress(Option_t *opt=" ");
-    
-    virtual void   ResetRawClusters();
-    virtual void   ResetRecTracks();
-    virtual void   ResetRecTriggerTracks();
-  
-                   /// Return tree with raw clusters
-    TTree*         TreeR() {return fLoader->TreeR(); }
-                   /// Return tree with tracks
-    TTree*         TreeT() {return fLoader->TreeT(); }
-
-                   // Methods to dump data
-    void DumpRecPoints(Int_t event2Check=0, Option_t* opt="full");
-    void DumpTracks(Int_t event2Check=0, Option_t* opt="full");
-    void DumpRecTrigger(Int_t event2Check=0, Int_t write = 0, Bool_t readFromRP = kTRUE);
-    
-  protected: 
-    /// Not implemented
-    AliMUONRecData(const AliMUONRecData& rhs);
-    /// Not implemented
-    AliMUONRecData& operator=(const AliMUONRecData& rhs);
-
-    TObjArray*      fRawClusters; ///< One event in TreeR/Rawcluster and one branch per tracking detection plane
-    TClonesArray*   fRecTracks; ///< pointer to array of reconstructed tracks
-    TClonesArray*   fRecTriggerTracks; ///< pointer to array of reconstructed trigger tracks
-
-    Int_t*          fNrawclusters;  //!< Number of Raw Clusters
-    Int_t           fNrectracks;    //!< Number of reconstructed tracks
-    Int_t           fNrectriggertracks; //!< Number of reconstructed tracks
-    Int_t           fSplitLevel;   ///< Splitting of branches 0 no spitting (root files are smaller) 1 splitting (larger output files)
-
-    mutable Int_t fCurrentEvent; ///< Current event we're dealing with
-    
-private:  
-    void   FillOwn(Option_t* opt=" ");
-    void   MakeOwnBranch(Option_t *opt=" ");
-    void   SetOwnDataContainer(Option_t *opt=" ");
-    void   SetOwnTreeAddress(Option_t *opt=" ");
-    
-
-  ClassDef(AliMUONRecData,3) // Data accessor for MUON module
-      
-};
-// inline functions
-
-
-/// Load raw clusters tree
-inline void AliMUONRecData::GetRawClusters() const {
-  if (fLoader && fLoader->TreeR())
-    fLoader->TreeR()->GetEvent(0);
-}
-
-/// Load trigger tree
-inline void AliMUONRecData::GetTrigger() const {
-  if (fLoader && fLoader->TreeR())
-    fLoader->TreeR()->GetEvent(0);
-}
-
-/// Load reconstructed tracks
-inline void AliMUONRecData::GetRecTracks() const {
-  if (fLoader && fLoader->TreeT())
-    fLoader->TreeT()->GetBranch("MUONTrack")->GetEvent(0);
-}
-
-/// Load reconstructed trigger tracks
-inline void AliMUONRecData::GetRecTriggerTracks() const {
-  if (fLoader && fLoader->TreeT())
-    fLoader->TreeT()->GetBranch("MUONTriggerTrack")->GetEvent(0);
-}
-
-
-
-#endif
-
diff --git a/MUON/AliMUONRecLoader.cxx b/MUON/AliMUONRecLoader.cxx
deleted file mode 100644 (file)
index a22d555..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -------------------------
-// Class AliMUONDataLoader
-// -------------------------
-// Implements AliLoader for MUON subsystem
-// Author: Gines Martinez
-
-#include "AliMUONRecLoader.h"
-#include "AliMUONConstants.h"
-#include "AliLog.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONRecLoader)
-/// \endcond
-
-//___________________________________________________________________
-AliMUONRecLoader::AliMUONRecLoader()
-  : AliLoader(),
-    fMUONData(0)
-{
-/// Default constructor
-}
-//_______________________________________________________________________________
-AliMUONRecLoader::AliMUONRecLoader(const Char_t* detname,const Char_t* eventfoldername)
-  : AliLoader(detname,eventfoldername),
-    fMUONData(0)
-{
-/// Standard contructor with name of the top folder of the tree
-}
-//_______________________________________________________________________________
-AliMUONRecLoader::AliMUONRecLoader(const Char_t * detname,TFolder* eventfolder)
-  : AliLoader(detname,eventfolder),
-    fMUONData(0)
-{
-/// Constructor
-}
-
-//_______________________________________________________________________________
-AliMUONRecLoader::~AliMUONRecLoader()
-{
-/// Destructor 
-}
-
-//_______________________________________________________________________________
-void AliMUONRecLoader::SetMUONData(AliMUONRecData * MUONData)
-{
-/// Set MUON data
-
-  fMUONData = MUONData;
-}
-//_______________________________________________________________________________
-AliMUONRecData * AliMUONRecLoader::GetMUONData()
-{
-/// Get MUON data
-
-  return fMUONData;
-}
-
diff --git a/MUON/AliMUONRecLoader.h b/MUON/AliMUONRecLoader.h
deleted file mode 100644 (file)
index 94137cc..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef ALIMUONRECLOADER_H
-#define ALIMUONRECLOADER_H
-
-/*  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-//
-/// \ingroup rec
-/// \class AliMUONRecLoader
-/// \brief Implements AliLoader for MUON subsystem
-///
-/// \author Gines Martinez
-
-#include "AliLoader.h"
-
-class AliMUONRecData;
-
-
-class AliMUONRecLoader : public AliLoader 
-{
-  public:
-    AliMUONRecLoader();
-    AliMUONRecLoader(const Char_t *detname,const Char_t *eventfoldername); //contructor with name of the top folder of the tree
-    AliMUONRecLoader(const Char_t *detname,TFolder* eventfolder);
-    virtual ~AliMUONRecLoader();
-
-    void              SetMUONData(AliMUONRecData * MUONData);
-    AliMUONRecData *  GetMUONData();
-  protected:
-    /// Not implemented
-    AliMUONRecLoader(const AliMUONRecLoader& rhs);
-    /// Not implemented
-    AliMUONRecLoader& operator=(const AliMUONRecLoader& rhs);
-
-    AliMUONRecData * fMUONData; ///< data for MUON subsystem 
-
-  ClassDef(AliMUONRecLoader,1)
-};
-
-#endif
diff --git a/MUON/AliMUONSegFactory.cxx b/MUON/AliMUONSegFactory.cxx
deleted file mode 100644 (file)
index e00661b..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-////////////////////////////////////////////////////////////
-//  Factory for muon chambers, segmentations and response //
-////////////////////////////////////////////////////////////
-
-/* $Id$ */
-
-// --------------------------
-// Class AliMUONSegFactory
-// --------------------------
-// New factory for building segmentations at all levels
-// Authors: Ivana Hrivnacova, IPN Orsay
-
-#include "AliMUONSegFactory.h"
-#include "AliMUONConstants.h"
-#include "AliMUONGeometryTransformer.h"
-#include "AliMUONGeometryModule.h"
-#include "AliMUONSegmentation.h"
-#include "AliMUONGeometrySegmentation.h"
-#include "AliMUONSt12QuadrantSegmentation.h"
-#include "AliMUONSt345SlatSegmentation.h"
-#include "AliMUONTriggerSegmentation.h"
-
-#include "AliMpDEManager.h"
-#include "AliMpDEIterator.h"
-#include "AliMpSegmentation.h"
-#include "AliMpDetElement.h"
-#include "AliMpCathodType.h"
-
-#include "AliLog.h"
-
-#include <Riostream.h>
-#include <TSystem.h>
-#include <TObjString.h>
-#include <TMap.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONSegFactory)
-/// \endcond
-
-//______________________________________________________________________________
-AliMUONSegFactory::AliMUONSegFactory(const AliMUONGeometryTransformer* geometry)
-    : TObject(),
-      fDESegmentations(),
-      fSegmentation(0),
-      fkTransformer(geometry)
-{  
-/// Standard constructor
-
-}
-
-//______________________________________________________________________________
-AliMUONSegFactory::AliMUONSegFactory(const TString& volPathsFileName,
-                                     const TString& transformsFileName)
-    : TObject(),
-      fDESegmentations(),
-      fSegmentation(0),
-      fkTransformer(0)
-{  
-/// Standard constructor
-
-  // Transformer
-  AliMUONGeometryTransformer* transformer = new AliMUONGeometryTransformer(true);
-  transformer->ReadGeometryData(volPathsFileName, transformsFileName);
-  fkTransformer = transformer;  
-}
-
-//______________________________________________________________________________
-  AliMUONSegFactory::AliMUONSegFactory()
-    : TObject(),      
-      fDESegmentations(),
-      fSegmentation(0),
-      fkTransformer(0)
-{
-/// Default constructor
-}
-
-//______________________________________________________________________________
-
-AliMUONSegFactory::~AliMUONSegFactory()
-{
-/// Destructor
-
-  //delete fSegmentation;
-        // The segmentation is supposed to be deleted in the client code
-}
-
-//
-// Private methods
-//
-
-//______________________________________________________________________________
-Bool_t AliMUONSegFactory::IsGeometryDefined(Int_t ichamberId)
-{
-/// Return true, if det elements for the chamber with the given ichamber Id
-/// are defined in geometry (the geometry builder for this chamber was activated)
-
-  AliMpDEIterator it;
-  it.First(ichamberId);
-  Int_t firstDE = it.CurrentDEId(); 
-  
-  if ( ! fkTransformer ||
-       ! fkTransformer->GetModuleTransformerByDEId(firstDE, false) )
-       
-    return kFALSE;
-  
-  return kTRUE;
-}  
-
-//__________________________________________________________________________
-AliMUONSegmentation* AliMUONSegFactory::Segmentation()
-{ 
-/// Return the segmentation container, create it if it does not yet exist
-
-  if ( ! fSegmentation ) 
-    fSegmentation = new AliMUONSegmentation(AliMUONConstants::NGeomModules());
-
-  return fSegmentation; 
-}
-
-//
-// public methods
-//
-
-//______________________________________________________________________________
-AliMUONVGeometryDESegmentation*  
-AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, AliMp::CathodType cath)
-{ 
-/// Create DE segmentation, operating in local DE reference frame
-
-  // Check detElemId & cath  
-  if ( ! AliMpDEManager::IsValidDetElemId(detElemId, true) ) return 0;
-  
-  // Check if transformer is defined
-  if ( ! fkTransformer) {
-    AliErrorStream() << "Geometry transformer not defined" << endl;
-    return 0;
-  }  
-
-  // Only return it, if DE segmentation for this detElemId and cath
-  // was already defined
-  //
-  const AliMUONVGeometryDESegmentation* kdeSegmentation
-    = Segmentation()->GetDESegmentation(detElemId, cath, false);
-  if ( kdeSegmentation ) 
-    return const_cast<AliMUONVGeometryDESegmentation*>(kdeSegmentation);
-  
-  // Get module, create it if it does not exist 
-  //
-  AliMUONGeometrySegmentation* moduleSegmentation
-    = Segmentation()->GetModuleSegmentationByDEId(detElemId, cath, false);
-  if (! moduleSegmentation) {
-    Int_t moduleId = AliMpDEManager::GetGeomModuleId(detElemId);              
-    moduleSegmentation 
-      = new AliMUONGeometrySegmentation(
-               fkTransformer->GetModuleTransformer(moduleId));
-    Segmentation()->AddModuleSegmentation(moduleId, cath, moduleSegmentation);
-  }        
-   
-  // Get DE segmentation for this DE type, create it if it does not exist 
-  // 
-  AliMUONVGeometryDESegmentation* deSegmentation = 0;
-  AliMpDetElement* detElement = AliMpDEManager::GetDetElement(detElemId);
-  TString deSegName = detElement->GetSegName(cath);
-  TObject* objSegmentation = fDESegmentations.Get(deSegName);
-  if ( objSegmentation ) 
-    deSegmentation = (AliMUONVGeometryDESegmentation*)objSegmentation;  
-    
-  if ( !deSegmentation ) {
-
-    
-
-    // Get/Create mapping segmentation via mapping manager
-    const AliMpVSegmentation* kmpSegmentation 
-      = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, cath);
-    AliMpVSegmentation* mpSegmentation 
-      = const_cast<AliMpVSegmentation*>(kmpSegmentation);
-
-    AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
-    AliMp::PlaneType planeType = AliMpDEManager::GetPlaneType(detElemId, cath);
-    
-    switch (stationType) {
-
-      case AliMp::kStation1:
-      case AliMp::kStation2:
-        deSegmentation = new AliMUONSt12QuadrantSegmentation(
-                                mpSegmentation, stationType, planeType);
-        //cout << "   new AliMUONSt12QuadrantSegmentation "
-       //     << StationTypeName(stationType) << "  "  
-       //     << PlaneTypeName(planeType) << "  "
-       //     << deName << endl;
-                                         
-        break;
-        
-      case AliMp::kStation345:                   
-        deSegmentation = new AliMUONSt345SlatSegmentation(
-                                mpSegmentation, detElemId, planeType); 
-        //cout << "   new AliMUONSt345SlatSegmentationV2 "                       
-       //     << StationTypeName(stationType) << "  "  
-       //     << PlaneTypeName(planeType) << "  "
-       //     << deName << endl;                                 
-        break;
-    
-      case AliMp::kStationTrigger:               
-        deSegmentation = new AliMUONTriggerSegmentation(
-                                mpSegmentation, detElemId, planeType); 
-        //cout << "   new AliMUONTriggerSegmentation "                   
-       //     << StationTypeName(stationType) << "  "  
-       //     << PlaneTypeName(planeType) << "  "                        
-       //     << deName << endl;                                 
-        break;
-    }
-    
-    // Map new DE segmentation
-    fDESegmentations.Add(deSegName, deSegmentation);
-    Segmentation()->AddDESegmentation(deSegmentation);
-  }
-  
-  // Add  DE segmentation to module
-  //
-  moduleSegmentation->Add(detElemId, deSegName, deSegmentation);  
-  
-  return deSegmentation;
-}        
-  
-
-//______________________________________________________________________________
-void
-AliMUONSegFactory::CreateModuleSegmentations(Int_t chamberId, AliMp::CathodType cath)
-{ 
-/// Create module segmentation(s), operating in the global reference frame
-/// Detection elements are defined via DE names map.
-
-  // Check module Id 
-  if ( ! AliMpDEManager::IsValidChamberId(chamberId, true) ) return;
-
-  AliMpDEIterator it;
-  for ( it.First(chamberId); ! it.IsDone(); it.Next() )
-    CreateDESegmentation(it.CurrentDEId(), cath);
-}  
-    
-//______________________________________________________________________________
-AliMUONSegmentation*  
-AliMUONSegFactory::CreateSegmentation()
-{
-/// Create segmentations on all levels and return their container.
-
-  for (Int_t chamberId = 0; chamberId<AliMUONConstants::NCh(); chamberId++)
-    for (Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; cath++) {
-      if ( IsGeometryDefined(chamberId) )
-        CreateModuleSegmentations( chamberId, AliMp::GetCathodType(cath));
-  }
-
-  return Segmentation();
-}
-
diff --git a/MUON/AliMUONSegFactory.h b/MUON/AliMUONSegFactory.h
deleted file mode 100644 (file)
index e3fd0fd..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup base
-/// \class AliMUONSegFactory
-/// \brief New factory for building segmentations at all levels
-///
-/// The factory is associated with the AliMUONGeometryTransformer
-/// object, used in geometry (module) segmentations for performing
-/// trasformation between the global reference frame and the local DE one.
-/// This transformer object can be passed by pointer or can be created 
-/// by a factory and filled from the transformations data file.               
-/// The transformer need not to be set if factory is used only
-/// to create mapping segmentation:                                           \n
-///
-/// Construction:
-/// - AliMUONSegFactory  factory(kTransformer);
-/// - AliMUONSegFactory  factory("volpath.dat", "transform.dat");
-/// - AliMUONSegFactory  factory(0);                                          \n
-///
-/// All created objects are registered in the AliMUONSegmentation
-/// object, which can be accessed via GetSegmentation() method.
-/// A repetetive call to the same Create.. method does not create
-/// a new object but returns the existing one.                                \n                
-/// 
-/// Factory does not delete the created segmentation objects.
-/// They have to be deleted in the client code via the AliMUONSegmentation
-/// container:                                                                \n
-/// delete factory.GetSegmentation();
-///
-/// \author Ivana Hrivnacova, IPN Orsay
-
-#ifndef ALI_MUON_SEG_FACTORY_H
-#define ALI_MUON_SEG_FACTORY_H
-
-#include "AliMpStringObjMap.h"
-#include "AliMpCathodType.h"
-
-#include <TObject.h>
-
-class AliMpVSegmentation;
-class AliMUONVGeometryDESegmentation;
-class AliMUONGeometrySegmentation;
-class AliMUONSegmentation;
-class AliMUONGeometryTransformer;
-
-class AliMUONSegFactory : public  TObject {
-
-  public:
-    AliMUONSegFactory(const AliMUONGeometryTransformer* geometry);
-    AliMUONSegFactory(const TString& volPathsFileName,
-                      const TString& transformsFileName);
-    AliMUONSegFactory();
-    virtual ~AliMUONSegFactory();
-    
-    //
-    // Build methods
-    //
-    
-    AliMUONSegmentation* CreateSegmentation(); 
-              // Create segmentations on all levels and return their container.
-    
-    //
-    // Get method
-    //
-    AliMUONSegmentation* GetSegmentation() const;
-              // Returned segmentation contains all the lower level segmentations
-             // created with the factory
-
-  private:
-    /// Not implemented
-    AliMUONSegFactory(const AliMUONSegFactory& rhs);
-    /// Not implemented
-    AliMUONSegFactory& operator=(const AliMUONSegFactory& rhs);
-
-    AliMUONVGeometryDESegmentation*  
-      CreateDESegmentation(Int_t detElemId, AliMp::CathodType cath);
-              // Create DE segmentation, operating in local reference frame
-    
-    void
-      CreateModuleSegmentations(Int_t chamberId, AliMp::CathodType cath); 
-              // Create module segmentation(s) for a given chamber, operating 
-             // in global reference frame
-
-    // methods
-    Bool_t IsGeometryDefined(Int_t ichamber);
-    AliMUONSegmentation* Segmentation();
-    
-    // data members    
-    AliMpStringObjMap     fDESegmentations;///< Map of DE segmentations to DE seg names
-    AliMUONSegmentation*  fSegmentation;   ///< Segmentation container 
-    const AliMUONGeometryTransformer* fkTransformer; ///< Geometry transformer
-
-  ClassDef(AliMUONSegFactory,0)  // MUON Factory for Chambers and Segmentation
-};
-
-/// Return segmentation
-inline AliMUONSegmentation* AliMUONSegFactory::GetSegmentation() const
-{ return fSegmentation; }
-
-#endif //ALI_MUON_SEG_FACTORY_H
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/MUON/AliMUONSegmentation.cxx b/MUON/AliMUONSegmentation.cxx
deleted file mode 100644 (file)
index 5b891c7..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *      SigmaEffect_thetadegrees                                                                  *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpeateose. It is      *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-// $Id$
-//
-// ----------------------------
-// Class AliMUONSegmentation
-// ----------------------------
-// Manager class for geometry construction via geometry builders.
-// Author: Ivana Hrivnacova, IPN Orsay
-
-#include <iostream>
-
-#include <TObjArray.h>
-
-#include "AliMUONSegmentation.h"
-#include "AliMUONVGeometryDESegmentation.h"
-#include "AliMUONGeometrySegmentation.h"
-\
-#include "AliMpVSegmentation.h"
-#include "AliMpDEManager.h"
-
-#include "AliLog.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONSegmentation)
-/// \endcond
-//______________________________________________________________________________
-AliMUONSegmentation::AliMUONSegmentation(Int_t nofModules)
-  : TObject(),
-    fDESegmentations(0)
-{
-/// Standard constructor
-
-  // Create array for DE segmentations
-  fDESegmentations = new TObjArray();
-  fDESegmentations->SetOwner(kTRUE);
-
-  // Create array for modules segmentations
-  for (Int_t cathod = 0; cathod < 2; cathod++) {
-    fModuleSegmentations[cathod] = new TObjArray(nofModules);
-    fModuleSegmentations[cathod]->SetOwner(true);
-    
-    for (Int_t i=0; i<nofModules; i++)
-      fModuleSegmentations[cathod]->AddAt(0, i);
-  }  
-
-  AliDebug(1, Form("ctor this = %p", this) ); 
-}
-
-//______________________________________________________________________________
-AliMUONSegmentation::AliMUONSegmentation() 
-  : TObject(),
-    fDESegmentations(0)
-{
-/// Default constructor
-
-  fModuleSegmentations[0] = 0;
-  fModuleSegmentations[1] = 0;
-
-  AliDebug(1, Form("default (empty) ctor this = %p", this));
-} 
-
-//______________________________________________________________________________
-AliMUONSegmentation::~AliMUONSegmentation()
-{
-/// Destructor
-
-  AliDebug(1, Form("dtor this = %p", this));
-
-  delete fDESegmentations;
-  delete fModuleSegmentations[0];
-  delete fModuleSegmentations[1];
-}
-
-//
-// private functions
-//
-
-//_____________________________________________________________________________
-AliMUONGeometrySegmentation* 
-AliMUONSegmentation::GetModuleSegmentation(
-                        Int_t moduleId, Int_t cathod, Bool_t warn) const
-{
-/// Return the geometry module segmentation specified by moduleId
-
-  if (cathod < 0 || cathod >= 2) {
-    if (warn) {
-      AliWarningStream() 
-        << "Cathod: " << cathod << " outside limits" << std::endl;
-    }                   
-    return 0;  
-  }  
-
-  if (moduleId < 0 || moduleId >= fModuleSegmentations[cathod]->GetEntriesFast()) {
-    if (warn) {
-      AliWarningStream() 
-        << "Index: " << moduleId << " outside limits" << std::endl;
-    }                   
-    return 0;  
-  }  
-
-  return (AliMUONGeometrySegmentation*) 
-            fModuleSegmentations[cathod]->At(moduleId);
-}    
-
-//
-// public functions
-//
-
-//_____________________________________________________________________________
-void AliMUONSegmentation::AddDESegmentation(
-                                AliMUONVGeometryDESegmentation* segmentation)
-{
-/// Add the DE segmentation to the array
-
-  fDESegmentations->Add(segmentation);
-}
-
-//_____________________________________________________________________________
-void AliMUONSegmentation::AddModuleSegmentation(Int_t moduleId, Int_t cathod,
-                             AliMUONGeometrySegmentation* segmentation)
-{
-/// Add the module segmentation to the array
-
-  if (cathod < 0 || cathod >= 2) {
-      AliErrorStream() 
-        << "Cathod: " << cathod << " outside limits" << std::endl;
-      return;  
-  }                     
-
-  if (moduleId < 0 || moduleId >= fModuleSegmentations[cathod]->GetEntriesFast()) {
-    AliErrorStream() 
-        << "Module Id: " << moduleId << " outside limits" << std::endl;
-    return;  
-  }  
-
-  fModuleSegmentations[cathod]->AddAt(segmentation, moduleId);
-}
-
-//_____________________________________________________________________________
-void  AliMUONSegmentation::Init()
-{
-/// Initialize all segmentations
-  for (Int_t cathod = 0; cathod < 2; cathod++) {
-    for (Int_t i = 0; i < fModuleSegmentations[cathod]->GetEntriesFast(); i++) {
-    
-      AliMUONGeometrySegmentation* moduleSegmentation
-        = (AliMUONGeometrySegmentation*)fModuleSegmentations[cathod]->At(i);
-    
-      if (moduleSegmentation) moduleSegmentation->Init(i); 
-    }  
-  }  
-}
-                           
-//_____________________________________________________________________________
-AliMUONGeometrySegmentation* 
-AliMUONSegmentation::GetModuleSegmentationByDEId(
-                        Int_t detElemId, Int_t cathod, Bool_t warn) const
-{
-/// Return the geometry module specified by detElemId/cathod
-
-  // Get moduleId 
-  Int_t moduleId = AliMpDEManager::GetGeomModuleId(detElemId);
-
-  return GetModuleSegmentation(moduleId, cathod, warn);
-}    
-
-//_____________________________________________________________________________
-const AliMUONVGeometryDESegmentation* 
-AliMUONSegmentation::GetDESegmentation(
-                        Int_t detElemId, Int_t cathod, Bool_t warn) const
-{
-/// Return the DE segmentation specified by detElemId/cathod
-
-  // Get geometry segmentation 
-  AliMUONGeometrySegmentation* moduleSegmentation
-    = GetModuleSegmentationByDEId(detElemId, cathod, warn);
-    
-  if ( !moduleSegmentation ) return 0; 
-  
-  return moduleSegmentation->GetDESegmentation(detElemId, warn);
-}    
-
-//_____________________________________________________________________________
-Bool_t 
-AliMUONSegmentation::HasDE(Int_t detElemId, Int_t cathod) const
-{
-/// Return true if segmentation for detElemId and cathod is defined.
-
-  const AliMUONVGeometryDESegmentation* kdeSegmentation
-    = GetDESegmentation(detElemId, cathod, false);
-    
-  return ( kdeSegmentation != 0 ); 
-  
-}
-
-//_____________________________________________________________________________
-TString 
-AliMUONSegmentation::GetDEName(Int_t detElemId, Int_t cathod) const
-{
-/// Get detection element name 
-
-  AliMUONGeometrySegmentation* moduleSegmentation
-    = GetModuleSegmentationByDEId(detElemId, cathod, true);
-    
-  return  moduleSegmentation->GetDEName(detElemId); 
-}
-
-
diff --git a/MUON/AliMUONSegmentation.h b/MUON/AliMUONSegmentation.h
deleted file mode 100644 (file)
index 50b7b67..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup geometry
-/// \class AliMUONSegmentation
-/// \brief Container class for modules segmentations
-///
-/// It provides access to DE segmentations based on the
-/// old AliSegmentation interface:
-/// - DE segmentation (operating in local DE reference frame)
-/// - module segmentation (operating in global reference frame)
-///
-/// As some detection elements are sharing the same objects
-/// (AliMUONVGeometryDESegmentation),
-/// all segmentations objects have to be always deleted
-/// altogether via deleting this container object. 
-/// 
-/// \author Ivana Hrivnacova, IPN Orsay
-
-#ifndef ALI_MUON_SEGMENTATION_H
-#define ALI_MUON_SEGMENTATION_H
-
-#include <TObject.h>
-#include <TGeoMatrix.h>
-
-class TObjArray;
-
-class AliMpVSegmentation;
-
-class AliMUONGeometrySegmentation;
-class AliMUONVGeometryDESegmentation;
-
-class AliMUONSegmentation : public TObject
-{
-  public:
-    AliMUONSegmentation(Int_t nofModules);
-    AliMUONSegmentation();
-    virtual  ~AliMUONSegmentation();
-    
-    // methods
-    void  AddDESegmentation(AliMUONVGeometryDESegmentation* segmentation);
-
-    void  AddModuleSegmentation(Int_t moduleId, Int_t cathod,
-                            AliMUONGeometrySegmentation* segmentation);
-    void  Init();
-            // This function should not be needed;
-           // the segmentations should be built in a valid state
-           // To be revised                        
-
-    //
-    // get methods
-    //
-    
-    // Geometry segmentations
-    //
-
-    AliMUONGeometrySegmentation* GetModuleSegmentationByDEId(
-                     Int_t detElemId, Int_t cathod, Bool_t warn = true) const;
-
-    // DE segmentations
-    //
-    const AliMUONVGeometryDESegmentation* GetDESegmentation(
-                     Int_t detElemId, Int_t cathod, Bool_t warn = true) const;
-
-                        
-    // DE properties
-    //
-    Bool_t   HasDE(Int_t detElemId, Int_t cathod = 0) const;
-    TString  GetDEName(Int_t detElemId, Int_t cathod = 0) const;
-
-  protected:
-    /// Not implemented
-    AliMUONSegmentation(const AliMUONSegmentation& right);
-    /// Not implemented
-    AliMUONSegmentation&  operator = (const AliMUONSegmentation& right);
-     
-  private:
-    AliMUONGeometrySegmentation* GetModuleSegmentation(
-                     Int_t moduleId, Int_t cathod, Bool_t warn = true) const;
-
-    // data members
-    TObjArray*  fDESegmentations;        ///< array of DE segmentations
-    TObjArray*  fModuleSegmentations[2]; ///< \brief array of module segmentations
-                                         /// for two cathods         
-  ClassDef(AliMUONSegmentation,2)  // Container class for module segmentations
-};
-
-#endif //ALI_MUON_SEGMENTATION_H
-
-
-
-
-
-
-
diff --git a/MUON/AliMUONSimData.cxx b/MUON/AliMUONSimData.cxx
deleted file mode 100644 (file)
index 654a366..0000000
+++ /dev/null
@@ -1,477 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-/// \class AliMUONSimData
-///
-/// Class containing MUON data: hits, digits, rawclusters, globaltrigger, localtrigger, etc ..
-/// The classe makes the lik between the MUON data lists and the event trees from loaders
-///
-/// \author Gines Martinez, Subatech,  September 2003
-///
-
-#include "AliMUONSimData.h"
-#include "AliMUONDataIterator.h"
-#include "AliMUONConstants.h"
-#include "AliMUONHit.h"
-#include "AliMUONDigit.h"
-#include "AliMUONGlobalTrigger.h"
-#include "AliMUONLocalTrigger.h"
-#include "AliMUONRegionalTrigger.h"
-#include "AliMUONTriggerCrateStore.h"
-#include "AliMUONTriggerCircuit.h"
-#include "AliMUONGeometryTransformer.h"
-#include "AliMUONRawCluster.h"
-
-// This is from rec, classes in base should not depend on rec !!!
-//#include "AliMUONTrack.h"
-//#include "AliMUONTriggerTrack.h"
-
-#include "AliRunLoader.h"
-#include "AliStack.h"
-#include "AliLog.h"
-
-#include <TString.h>
-#include <TParticle.h>
-#include <TNtuple.h>
-#include <Riostream.h>
-#include <TFile.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONSimData)
-/// \endcond
-//_____________________________________________________________________________
-AliMUONSimData::AliMUONSimData()
-  : AliMUONData(),
-    fHits(0x0),
-    //fSDigits(0x0),
-    fNhits(0)
-    //fNSdigits(0x0)
-{
-/// Default constructor
-}
-//_____________________________________________________________________________
-AliMUONSimData::AliMUONSimData(AliLoader * loader, const char* name, const char* title)
-  : AliMUONData(loader, name, title),
-    fHits(0x0),
-    //fSDigits(0x0),
-    fNhits(0)
-    //fNSdigits(0x0)
-{
-/// Standard constructor
-}
-
-//_____________________________________________________________________________
-AliMUONSimData::AliMUONSimData(const char* galiceFile)
-  : AliMUONData(galiceFile, "MUONFolderSim"),
-    fHits(0x0),
-    //fSDigits(0x0),
-    fNhits(0)
-    //fNSdigits(0x0)
-{
-/// Constructor for loading data from gAlice file
-}
-
-//_____________________________________________________________________________
-AliMUONSimData::~AliMUONSimData()
-{
-/// Destructor for AliMUONSimData
-  if (fHits) {
-    fHits->Delete();
-    delete fHits;
-  }
-/*  
-  if (fSDigits) {
-    fSDigits->Delete();
-    delete fSDigits;
-  }
-*/  
-}
-//____________________________________________________________________________
-void AliMUONSimData::AddHit(Int_t fIshunt, Int_t track, Int_t detElemId, 
-                        Int_t idpart, Float_t X, Float_t Y, Float_t Z, 
-                        Float_t tof, Float_t momentum, Float_t theta, 
-                        Float_t phi, Float_t length, Float_t destep,
-                        Float_t Xref,Float_t Yref,Float_t Zref)
-{
- /// Add new hit to the hit list
-
-  TClonesArray &lhits = *fHits;
-  new(lhits[fNhits++]) AliMUONHit(fIshunt, track, detElemId, 
-                                 idpart, X, Y, Z, 
-                                 tof, momentum, theta, 
-                                 phi, length, destep,
-                                 Xref,Yref,Zref);
-}
-/*
-//_____________________________________________________________________________
-void AliMUONSimData::AddSDigit(Int_t id, const AliMUONDigit& Sdigit)
-{
-/// Add a MUON Sdigit to the list of SDigits of the detection plane id
-
-  TClonesArray &lSdigits = * SDigits(id) ; 
-  new(lSdigits[fNSdigits[id]++]) AliMUONDigit(Sdigit);
-}
-
-//____________________________________________________________________________
-TClonesArray*  AliMUONSimData::SDigits(Int_t DetectionPlane) const
-{
-/// Getting List of SDigits
-
-  if (fSDigits)
-    return ( (TClonesArray*) fSDigits->At(DetectionPlane) );
-  else
-    return NULL;
-}
-*/
-//____________________________________________________________________________
-void AliMUONSimData::FillOwn(Option_t* option)
-{
-/// Method to fill the trees
-
-  const char *cH   = strstr(option,"H");
-  //const char *cS   = strstr(option,"S");   // SDigits branches in TreeS
-
-  //const char *cRP  = strstr(option,"RP");  // Reconstructed Particle in TreeP
-  
-  // Filling TreeH
-  if ( TreeH() && cH ) 
-  {
-    TreeH()->Fill();
-  }  
-/* 
-  // Filling TreeS
-  if ( TreeS() && cS) 
-  {
-    TreeS()->Fill();
-  }
-*/  
-}
-
-//_____________________________________________________________________________
-void AliMUONSimData::MakeOwnBranch(Option_t* option)
-{
-/// Create Tree branches for the MUON.
-
-  const Int_t kBufferSize = 4000;
-  char branchname[30];
-  
-  //Setting Data Container
-  SetDataContainer(option);  
-
-  const char *cH   = strstr(option,"H");
-  //const char *cS   = strstr(option,"S");   // Digits branches in TreeS
-  
-  TBranch * branch = 0x0;
-  
-  // Creating Branches for Hits
-  if (TreeH() && cH) {
-    sprintf(branchname,"%sHits",GetName());  
-    branch = TreeH()->GetBranch(branchname);
-    if (branch) {  
-      AliInfo(Form("MakeBranch","Branch %s is already in tree.",branchname));
-      return ;
-    }
-    branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
-    //Info("MakeBranch","Making Branch %s for hits \n",branchname);
-  }  
-/*  
-  //Creating Branches for SDigits
-  if (TreeS() && cS ) {
-    // one branch for Sdigits per chamber
-    for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
-      sprintf(branchname,"%sSDigits%d",GetName(),iDetectionPlane+1);
-      branch = 0x0;
-      branch = TreeS()->GetBranch(branchname);
-      if (branch) {  
-        AliInfo(Form("Branch %s is already in tree.",branchname));
-        return;
-      }
-      TClonesArray * sdigits = SDigits(iDetectionPlane); 
-      branch = TreeS()->Branch(branchname, &sdigits, kBufferSize,1);
-      //Info("MakeBranch","Making Branch %s for sdigits in detection plane %d\n",branchname,iDetectionPlane+1);
-    }
-  }
-*/  
-}
-
-//____________________________________________________________________________
-void AliMUONSimData::SetOwnDataContainer(Option_t* option)
-{
-/// Setting data containers of muon data
-
-  const char *cH   = strstr(option,"H");
-  //const char *cS   = strstr(option,"S");   // SDigits
-                                           //const char *cRP  = strstr(option,"RP");  // Reconstructed Particles  
-  AliDebug(1,Form("option=%s",option));
-  //
-  // Clones array for hits
-  if ( cH ) {
-    if (fHits == 0x0) {
-      fHits     = new TClonesArray("AliMUONHit",1000);
-    }
-    ResetHits();
-  }
-/*  
-  //
-  // Container for Sdigits
-  if (cS) {
-    if (fSDigits == 0x0) { 
-      AliDebug(1,"Creating fSDigits TObjArray");
-      fSDigits = new TObjArray(AliMUONConstants::NCh());
-      fNSdigits= new Int_t[AliMUONConstants::NCh()];
-      for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
-       TClonesArray* a = new TClonesArray("AliMUONDigit",10000);
-       a->SetOwner();
-       fSDigits->AddAt(a,i);
-       AliDebug(1,Form("fSDigits[%d]=%p",i,a));
-        fNSdigits[i]=0;
-      }
-    }
-    else {
-      AliDebug(1,Form("fSDigits already there = %p",fSDigits));
-    }
-    ResetSDigits();
-  }  
-*/
-}
-
-//____________________________________________________________________________
-void AliMUONSimData::SetOwnTreeAddress(Option_t* option)
-{
-  // Setting Data containers
-  SetOwnDataContainer(option);
-
-/// Setting Addresses to the events trees
-
-  const char *cH   = strstr(option,"H");
-  //const char *cS   = strstr(option,"S");   // SDigits branches in TreeS
-  
-  // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
-  char branchname[30];
-  TBranch * branch = 0x0;
-  
-  AliDebug(1,Form("option=%s",option));
-  //
-  // Branch address for hit tree
-  if (TreeH() && fHits && cH) {
-    sprintf(branchname,"%sHits",GetName());  
-    branch = TreeH()->GetBranch(branchname);
-    if (branch) {
-      //      Info("SetTreeAddress","(%s) Setting for Hits",GetName());
-      branch->SetAddress(&fHits);
-    }
-    else { //can be invoked before branch creation
-      //AliWarning(Form("(%s) Failed for Hits. Can not find branch in tree.",GetName()));
-    }
-  }
-/*    
-  //
-  // Branch address for Sdigit tree
-  if (TreeS() && fSDigits && cS) {
-    AliDebug(1,"Setting branch addresses");
-    for (int i=0; i<AliMUONConstants::NCh(); i++) {
-      sprintf(branchname,"%sSDigits%d",GetName(),i+1);
-      if (fSDigits) {
-        AliDebug(1,Form("TreeS=%p for ich=%d branchname=%s",
-                        TreeS(),i,branchname));
-        branch = TreeS()->GetBranch(branchname);
-        TClonesArray * sdigits = SDigits(i);
-        if (branch) branch->SetAddress( &sdigits );
-        else AliWarning(Form("(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i));
-      }
-    }
-  }
-*/  
-}
-
-//____________________________________________________________________________
-void AliMUONSimData::Fill(Option_t* option)
-{
-/// Method to fill the trees
-
-  AliMUONData::Fill(option);
-  FillOwn(option);
-}
-
-//_____________________________________________________________________________
-void AliMUONSimData::MakeBranch(Option_t* option)
-{
-/// Create Tree branches for the MUON.
-
-  AliMUONData::MakeBranch(option);
-  MakeOwnBranch(option);
-}
-
-//____________________________________________________________________________
-void AliMUONSimData::SetDataContainer(Option_t* option)
-{
-/// Setting data containers of muon data
-
-  AliMUONData::SetDataContainer(option);
-  SetOwnDataContainer(option);
-}
-
-//____________________________________________________________________________
-void AliMUONSimData::SetTreeAddress(Option_t* option)
-{
-/// Setting Addresses to the events trees
-
-  // Setting Data containers
-  SetDataContainer(option);
-  
-  AliMUONData::SetTreeAddress(option);
-  SetOwnTreeAddress(option);
-}
-
-//____________________________________________________________________________
-Int_t          
-AliMUONSimData::GetNtracks() const      
-{
-/// Get number of entries in hits three
-
-  Int_t ntrk = 0;
-  if (fLoader && fLoader->TreeH())
-    ntrk = (Int_t) fLoader->TreeH()->GetEntries();
-  return ntrk;
-}
-/*
-//____________________________________________________________________________
-void AliMUONSimData::ResetSDigits()
-{
-/// Reset number of Sdigits and the Sdigits array for this detector
-
-    if (fSDigits == 0x0) return;
-    for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
-      if ((*fSDigits)[i])    ((TClonesArray*)fSDigits->At(i))->Clear();
-      if (fNSdigits)  fNSdigits[i]=0;
-    }
-}
-*/
-//______________________________________________________________________________
-void AliMUONSimData::ResetHits()
-{
-/// Reset number of clusters and the cluster array for this detector
-
-  fNhits   = 0;
-  if (fHits) fHits->Clear();
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONSimData::DumpKine(Int_t event2Check)
-{
-/// Dump kinematics
-
-  fRunLoader->LoadKinematics("READ");
-
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  for (Int_t ievent=0; ievent<nevents; ievent++) {  // Event loop
-    if ( event2Check != 0 ) ievent=event2Check;
-
-    // Getting event ievent
-    fRunLoader->GetEvent(ievent); 
-
-    // Stack of particle for this event
-    AliStack* stack = fRunLoader->Stack();
-
-    Int_t nparticles = (Int_t) fRunLoader->Stack()->GetNtrack();
-    printf(">>> Event %d, Number of particles is %d \n", ievent, nparticles);
-
-    for (Int_t iparticle=0; iparticle<nparticles; iparticle++) {
-      stack->Particle(iparticle)->Print("");  
-    }
-    if (event2Check!=0) ievent=nevents;
-  }
-  fRunLoader->UnloadKinematics();
-}
-
-
-//_____________________________________________________________________________
-void 
-AliMUONSimData::DumpHits(Int_t event2Check, Option_t* opt)
-{
-/// Dump hits
-
-  fLoader->LoadHits("READ");
-
-  // Event loop
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  for (Int_t ievent=0; ievent<nevents; ievent++) {
-    if (event2Check!=0) ievent=event2Check;
-    printf(">>> Event %d \n",ievent);
-
-    // Getting event ievent
-    fRunLoader->GetEvent(ievent); 
-    SetTreeAddress("H");
-
-    // Track loop
-    Int_t ntracks = (Int_t) GetNtracks();
-    for (Int_t itrack=0; itrack<ntracks; itrack++) {
-      //Getting List of Hits of Track itrack
-      GetTrack(itrack);
-
-      Int_t nhits = (Int_t) Hits()->GetEntriesFast();
-      printf(">>> Track %d, Number of hits %d \n",itrack,nhits);
-      for (Int_t ihit=0; ihit<nhits; ihit++) {
-       AliMUONHit* mHit = static_cast<AliMUONHit*>(Hits()->At(ihit));
-       mHit->Print(opt);
-      }
-      ResetHits();
-    }
-    if (event2Check!=0) ievent=nevents;
-  }
-  fLoader->UnloadHits();
-}
-/*
-//_____________________________________________________________________________
-void 
-AliMUONSimData::DumpSDigits(Int_t event2Check, Option_t* opt)
-{
-/// Dump SDigits
-
-  fLoader->LoadSDigits("READ");
-  
-  // Event loop
-  Int_t nevents = fRunLoader->GetNumberOfEvents();
-  for (Int_t ievent=0; ievent<nevents; ievent++) {
-    if (event2Check!=0) ievent=event2Check;
-    printf(">>> Event %d \n",ievent);
-
-    // Getting event ievent
-    fRunLoader->GetEvent(ievent);
-    SetTreeAddress("S");
-    GetSDigits();
-
-    // Loop on chambers
-    Int_t nchambers = AliMUONConstants::NCh(); ;
-    for (Int_t ichamber=0; ichamber<nchambers; ichamber++) {
-      TClonesArray* digits = SDigits(ichamber);
-
-      // Loop on Sdigits
-      Int_t ndigits = (Int_t)digits->GetEntriesFast();
-      for (Int_t idigit=0; idigit<ndigits; idigit++) {
-        AliMUONDigit* mDigit = static_cast<AliMUONDigit*>(digits->At(idigit));
-        mDigit->Print(opt);
-      }
-    }
-    ResetSDigits();
-    if (event2Check!=0) ievent=nevents;
-  }
-  fLoader->UnloadSDigits();
-}
-*/
diff --git a/MUON/AliMUONSimData.h b/MUON/AliMUONSimData.h
deleted file mode 100644 (file)
index 61a3df5..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef ALIMUONSIMDATA_H
-#define ALIMUONSIMDATA_H
-//
-/*  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-//
-/// \ingroup sim
-/// \class AliMUONSimData
-/// \brief Class containing MUON data from simulation: hits, digits, globaltrigger, 
-/// localtrigger, etc ...
-///
-//  Author: Gines Martinez, Subatech,  September 2003
-
-#include "AliLoader.h"
-
-#include "AliMUONData.h"
-
-class AliRunLoader;
-
-class TClonesArray;
-class TObjArray;
-class TTree;
-
-
-//__________________________________________________________________
-/////////////////////////////////////////////////////////////////////
-//                                                                 //
-//  class AliMUONSimData                                              //
-//                                                                 //
-/////////////////////////////////////////////////////////////////////
-
-class AliMUONSimData : public AliMUONData
-{
-  public:
-  
-  //  enum EChamberIteration { kAllChambers, kTrackingChambers, kTriggerChambers };
-  
-    AliMUONSimData();
-    AliMUONSimData(AliLoader * loader, const char* name, const char* title);
-    AliMUONSimData(const char* galiceFile);
-    virtual ~AliMUONSimData();  
-    //virtual void   AddSDigit(Int_t id, const AliMUONDigit& digit); // use copy constructor
-    virtual void   AddHit(Int_t fIshunt, Int_t track, Int_t detElemId, 
-                         Int_t idpart, Float_t X, Float_t Y, Float_t Z, 
-                         Float_t tof, Float_t momentum, Float_t theta, 
-                         Float_t phi, Float_t length, Float_t destep, 
-                         Float_t Xref,Float_t Yref,Float_t Zref);
-    
-    TClonesArray*  Hits() {return fHits;} ///< Return hits
-    //TClonesArray*  SDigits(Int_t DetectionPlane) const;
-
-    void           GetTrack(Int_t it) const;
-    Int_t          GetNtracks() const;
-    //void           GetSDigits() const;
-
-    
-    virtual void   Fill(Option_t* opt=" ");
-    virtual void   MakeBranch(Option_t *opt=" ");
-    virtual void   SetDataContainer(Option_t *opt=" ");
-    virtual void   SetTreeAddress(Option_t *opt=" ");
-    
-    virtual void   ResetHits();
-    //virtual void   ResetSDigits();
-  
-                   /// Return tree with hits
-    TTree*         TreeH() {return fLoader->TreeH(); }
-                   /// Return tree with summable digits
-    //TTree*         TreeS() {return fLoader->TreeS(); }
-                   /// Return tree with particles
-    TTree*         TreeP() {return fLoader->TreeP(); }
-
-                   // Methods to dump data
-    void DumpKine(Int_t event2Check=0);
-    void DumpHits(Int_t event2Check=0, Option_t* opt="full");
-    //void DumpSDigits(Int_t event2Check=0, Option_t* opt="tracks");
-    
-  protected: 
-    /// Not implemented
-    AliMUONSimData(const AliMUONSimData& rhs);
-    /// Not implemented
-    AliMUONSimData& operator=(const AliMUONSimData& rhs);
-
-    TClonesArray*   fHits;    ///< One event in treeH per primary track
-    //TObjArray*      fSDigits; ///< One event in treeS and one branch per detection plane
-
-    Int_t           fNhits;   //!< Number of Hits
-    //Int_t*          fNSdigits;//!< Number of Digits
-
-    mutable Int_t fCurrentEvent; ///< Current event we're dealing with
-    
-private:  
-    void   FillOwn(Option_t* opt=" ");
-    void   MakeOwnBranch(Option_t *opt=" ");
-    void   SetOwnDataContainer(Option_t *opt=" ");
-    void   SetOwnTreeAddress(Option_t *opt=" ");
-
-  ClassDef(AliMUONSimData,3) // Data accessor for MUON module
-      
-};
-// inline functions
-
-
-/// Load hits for \a i th entry in hits three
-inline void AliMUONSimData::GetTrack(Int_t it) const  {
-  if (fLoader && fLoader->TreeH())
-    fLoader->TreeH()->GetEvent(it);
-}
-/*
-/// Load sdigits tree
-inline void AliMUONSimData::GetSDigits() const {
-  if (fLoader && fLoader->TreeS())
-    fLoader->TreeS()->GetEvent(0);
-}
-*/
-
-
-#endif
-
diff --git a/MUON/AliMUONSimLoader.cxx b/MUON/AliMUONSimLoader.cxx
deleted file mode 100644 (file)
index 8fad895..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -------------------------
-// Class AliMUONDataLoader
-// -------------------------
-// Implements AliLoader for MUON subsystem
-// Author: Gines Martinez
-
-#include "AliMUONSimLoader.h"
-#include "AliMUONConstants.h"
-#include "AliLog.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONSimLoader)
-/// \endcond
-
-//___________________________________________________________________
-AliMUONSimLoader::AliMUONSimLoader()
-  : AliLoader(),
-    fMUONData(0)
-{
-/// Default constructor
-}
-//_______________________________________________________________________________
-AliMUONSimLoader::AliMUONSimLoader(const Char_t* detname,const Char_t* eventfoldername)
-  : AliLoader(detname,eventfoldername),
-    fMUONData(0)
-{
-/// Standard contructor with name of the top folder of the tree
-}
-//_______________________________________________________________________________
-AliMUONSimLoader::AliMUONSimLoader(const Char_t * detname,TFolder* eventfolder)
-  : AliLoader(detname,eventfolder),
-    fMUONData(0)
-{
-/// Constructor
-}
-
-//_______________________________________________________________________________
-AliMUONSimLoader::~AliMUONSimLoader()
-{
-/// Destructor 
-}
-
-//_______________________________________________________________________________
-void AliMUONSimLoader::SetMUONData(AliMUONSimData * MUONData)
-{
-/// Set MUON data
-
-  fMUONData = MUONData;
-}
-//_______________________________________________________________________________
-AliMUONSimData * AliMUONSimLoader::GetMUONData()
-{
-/// Get MUON data
-
-  return fMUONData;
-}
-
diff --git a/MUON/AliMUONSimLoader.h b/MUON/AliMUONSimLoader.h
deleted file mode 100644 (file)
index 6087220..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef ALIMUONSIMLOADER_H
-#define ALIMUONSIMLOADER_H
-
-/*  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-//
-/// \ingroup sim
-/// \class AliMUONSimLoader
-/// \brief Implements AliLoader for MUON subsystem
-///
-/// \author Gines Martinez
-
-#include "AliLoader.h"
-
-class AliMUONSimData;
-
-
-class AliMUONSimLoader : public AliLoader 
-{
-  public:
-    AliMUONSimLoader();
-    AliMUONSimLoader(const Char_t *detname,const Char_t *eventfoldername); //contructor with name of the top folder of the tree
-    AliMUONSimLoader(const Char_t *detname,TFolder* eventfolder);
-    virtual ~AliMUONSimLoader();
-
-    void              SetMUONData(AliMUONSimData * MUONData);
-    AliMUONSimData *  GetMUONData();
-  protected:
-    /// Not implemented
-    AliMUONSimLoader(const AliMUONSimLoader& rhs);
-    /// Not implemented
-    AliMUONSimLoader& operator=(const AliMUONSimLoader& rhs);
-
-    AliMUONSimData * fMUONData; ///< data for MUON subsystem 
-
-  ClassDef(AliMUONSimLoader,1)
-};
-
-#endif
diff --git a/MUON/AliMUONSt12QuadrantSegmentation.cxx b/MUON/AliMUONSt12QuadrantSegmentation.cxx
deleted file mode 100644 (file)
index 6061bc4..0000000
+++ /dev/null
@@ -1,620 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-/* $Id$ */
-
-// -------------------------------------
-// Class AliMUONSt12QuadrantSegmentation
-// -------------------------------------
-// Segmentation for MUON quadrants of stations 1 and 2 using 
-// the mapping package
-// Author: Ivana Hrivnacova, IPN Orsay
-#include "AliMUONSt12QuadrantSegmentation.h"
-#include "AliMUONConstants.h"
-
-#include "AliMpPad.h"
-#include "AliMpArea.h"
-#include "AliMpSectorReader.h"
-#include "AliMpSector.h"
-#include "AliMpVPadIterator.h"
-#include "AliMpSectorSegmentation.h"
-#include "AliMpFiles.h"
-#include "AliMpNeighboursPadIterator.h"
-
-#include "AliLog.h"
-
-#include <TError.h>
-#include <TF1.h>
-#include <TMath.h>
-#include <TObjArray.h>
-#include <TVector2.h>
-#include <TSystem.h>
-
-/// \cond CLASSIMP
-ClassImp(AliMUONSt12QuadrantSegmentation)
-/// \endcond
-
-//______________________________________________________________________________
-AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation(
-                                       AliMpVSegmentation* segmentation,
-                                       AliMp::StationType stationType,
-                                      AliMp::PlaneType planeType) 
-: AliMUONVGeometryDESegmentation(),
-  fStationType(stationType),
-  fPlaneType(planeType),
-  fSector(0),
-  fSectorSegmentation(0),
-  fSectorIterator(0),
-  fWireD(0),
-  fChamber(0),
-  fId(0),
-  fRmin(0.),
-  fRmax(0.),
-  fZ(0.),
-  fIx(0),
-  fIy(0),
-  fX(0.),
-  fY(0.),
-  fZone(0),
-  fXhit(0.),
-  fYhit(0.),
-  fIxt(0),
-  fIyt(0),
-  fIwt(0),
-  fXt(0.),
-  fYt(0.),
-  fCorrA(0)
-{
-/// Standard constructor
-
-  fSectorSegmentation = dynamic_cast<AliMpSectorSegmentation*>(segmentation);
-  if (fSectorSegmentation)
-    fSector = fSectorSegmentation->GetSector();
-  else 
-    AliFatal("Wrong mapping segmentation type");
-    
-  // Anod pitch
-  if ( stationType == AliMp::kStation1 )  
-    fWireD = AliMUONConstants::PitchSt1();
-  else if ( stationType == AliMp::kStation2 )   
-    fWireD = AliMUONConstants::Pitch();
-  else  
-    AliFatal("Wrong station type");
-
-  fCorrA = new TObjArray(3);
-  fCorrA->AddAt(0,0);
-  fCorrA->AddAt(0,1);
-  fCorrA->AddAt(0,2);
-
-  AliDebug(1, Form("ctor this = %p", this) ); 
-}
-
-//______________________________________________________________________________
-AliMUONSt12QuadrantSegmentation::AliMUONSt12QuadrantSegmentation() 
-: AliMUONVGeometryDESegmentation(),
-  fStationType(AliMp::kStation1),
-  fPlaneType(AliMp::kBendingPlane),
-  fSector(0),
-  fSectorSegmentation(0),
-  fSectorIterator(0),
-  fWireD(0),
-  fChamber(0),
-  fId(0),
-  fRmin(0.),
-  fRmax(0.),
-  fZ(0.),
-  fIx(0),
-  fIy(0),
-  fX(0.),
-  fY(0.),
-  fZone(0),
-  fXhit(0.),
-  fYhit(0.),
-  fIxt(0),
-  fIyt(0),
-  fIwt(0),
-  fXt(0.),
-  fYt(0.),
-  fCorrA(0) 
-{
-/// Default Constructor
-
-  AliDebug(1, Form("default (empty) ctor this = %p", this));
-}
-
-//______________________________________________________________________________
-AliMUONSt12QuadrantSegmentation::~AliMUONSt12QuadrantSegmentation() 
-{
-/// Destructor
-
-  AliDebug(1, Form("dtor this = %p", this));
-
-  delete fSectorIterator;  
-} 
-
-//
-// private methods
-//
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::UpdateCurrentPadValues(const AliMpPad& pad)
-{
-/// Updates current pad values.
-
-  fIx = pad.GetIndices().GetFirst();
-  fIy = pad.GetIndices().GetSecond();
-  fX = pad.Position().X();
-  fY = pad.Position().Y();
-  fZone = fSectorSegmentation->Zone(pad);
-}  
-
-
-//
-// public methods
-//
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::SetPadSize(Float_t /*p1*/, Float_t /*p2*/)
-{
-/// Set pad size Dx*Dy 
-
-  AliFatal("Not uniform pad size.");
-}
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::SetDAnod(Float_t d)
-{
-/// Set anod pitch
-
-  fWireD = d;
-}
-
-#include "AliMpMotifMap.h"
-//______________________________________________________________________________
-Bool_t  AliMUONSt12QuadrantSegmentation::HasPad(Float_t x, Float_t y, Float_t /*z*/)
-{ 
-/// Returns true if a pad exists in the given position
-
-  // fSector->GetMotifMap()->Print();
-
-  AliMpPad pad = fSectorSegmentation
-               ->PadByPosition(TVector2(x,y), false);
-
-  return pad.IsValid();
-}  
-
-
-//______________________________________________________________________________
-Bool_t  AliMUONSt12QuadrantSegmentation::HasPad(Int_t ix, Int_t iy)
-{
-/// Returns true if a pad with given indices exists
-
-  AliMpPad pad = fSectorSegmentation->PadByIndices(AliMpIntPair(ix,iy), false);
-
-  return pad.IsValid();
-}  
-
-
-//______________________________________________________________________________
-AliMUONGeometryDirection  AliMUONSt12QuadrantSegmentation::GetDirection()
-{
-/// Returns the direction with a constant pad size  
-/// (Direction or coordinate where the resolution is the best)
-
-  switch ( fSector->GetDirection() ) {
-    case AliMp::kX: return kDirX;
-    case AliMp::kY: return kDirY;
-    default: return kDirUndefined;
-  }  
-}  
-
-//______________________________________________________________________________
-const AliMpVSegmentation*  
-AliMUONSt12QuadrantSegmentation::GetMpSegmentation() const
-{
-/// Returns the mapping segmentation
-/// (provides access to electronics info)
-
-  return fSectorSegmentation;
-}  
-
-//______________________________________________________________________________
-Float_t AliMUONSt12QuadrantSegmentation::GetAnod(Float_t xhit) const
-{
-/// Anod wire coordinate closest to xhit
-/// Returns for a hit position xhit the position of the nearest anode wire    
-/// From AliMUONSegmentationV01.
-
-  Float_t wire= (xhit>0) ? Int_t(xhit/fWireD) + 0.5
-                         : Int_t(xhit/fWireD) - 0.5;
-  return fWireD*wire;
-
-}
-
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::GetPadI(Float_t x, Float_t y, Float_t /*z*/, 
-                                      Int_t& ix, Int_t& iy)
-{                                      
-///  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
-
-  GetPadI(x, y, ix, iy);
-}
-                      
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::GetPadI(Float_t x, Float_t y,
-                                      Int_t& ix, Int_t& iy)
-{                                      
-/// Returns pad coordinates (ix,iy) for given real coordinates (x,y)
-/// If there is no pad, ix = 0, iy = 0 are returned.
-
-  AliMpPad pad = fSectorSegmentation->PadByPosition(TVector2(x,y), true);
-
-  ix = pad.GetIndices().GetFirst();
-  iy = pad.GetIndices().GetSecond();
-}
-                      
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::GetPadC(Int_t ix, Int_t iy, 
-                                      Float_t& x, Float_t& y, Float_t& z)
-{                                      
-/// Transform from pad to real coordinates
-
-  z = fZ;
-  GetPadC(ix, iy, x , y);
-}
-
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::GetPadC(Int_t ix, Int_t iy, 
-                                      Float_t& x, Float_t& y)
-{                                      
-/// Transform from pad to real coordinates
-/// If there is no pad, x = 0., y = 0. are returned.
-
-  AliMpPad pad = fSectorSegmentation->PadByIndices(AliMpIntPair(ix,iy), true);
-
-  x = pad.Position().X();
-  y = pad.Position().Y();
-}
-
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::Init(Int_t chamber)
-{
-/// Initialize segmentation
-
- // find Npx, Npy and save this info
-  
-  // reference to chamber
- fRmin=AliMUONConstants::Rmin(0);
- fRmax=AliMUONConstants::Rmax(0);  
- fZ = 0;
- fId=chamber;
-}
-//______________________________________________________________________________
-Float_t AliMUONSt12QuadrantSegmentation::Dpx() const
-{
-/// Get pad size in x
-
-  AliFatal( "Not uniform pad size.");
-  return 0.;
-}
-
-//______________________________________________________________________________
-Float_t AliMUONSt12QuadrantSegmentation::Dpy() const
-{
-/// Get pad size in y
-
-  AliFatal("Not uniform pad size.");
-  return 0.;
-}
-//______________________________________________________________________________
-Float_t AliMUONSt12QuadrantSegmentation::Dpx(Int_t isector) const
-{
-/// Pad size in x by sector
-
-  return fSectorSegmentation->PadDimensions(isector).X()*2.0;
-} 
-
-//______________________________________________________________________________
-Float_t AliMUONSt12QuadrantSegmentation::Dpy(Int_t isector) const
-{
-/// Pad size in x, y by Sector 
-
-  return fSectorSegmentation->PadDimensions(isector).Y()*2.0;
-}
-
-//______________________________________________________________________________
-Int_t AliMUONSt12QuadrantSegmentation::Npx() const
-{
-/// Maximum number of Pads in x
-/// hard coded for the time being
-
-  return fSectorSegmentation->MaxPadIndexX();
-}
-
-//______________________________________________________________________________
-Int_t AliMUONSt12QuadrantSegmentation::Npy() const
-{
-/// Maximum number of Pads in y
-/// hard coded for the time being
-
-  return fSectorSegmentation->MaxPadIndexY();
-}
-
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::SetPad(Int_t ix, Int_t iy)
-{
-/// Set pad position.
-/// Sets virtual pad coordinates, needed for evaluating pad response 
-/// outside the tracking program.
-/// From AliMUONSegmentationV01.
-
-  GetPadC(ix, iy, fX, fY);
-  fZone = Sector(ix, iy);
-}
-
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/)
-{
-/// Set hit position
-/// Sets virtual hit position, needed for evaluating pad response 
-/// outside the tracking program 
-/// From AliMUONSegmentationV01.
-
-  fXhit = xhit;
-  fYhit = yhit;
-}
-    
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::FirstPad(Float_t xhit, Float_t yhit, Float_t /*zhit*/, 
-                                       Float_t dx, Float_t dy) 
-{                                       
-/// Iterate over pads - initialiser
-
-  // Sets the current pad to that located in the hit position
-  SetHit(GetAnod(xhit), yhit, 0.); 
-  
-  // Enable iterating in one dimension
-  if (dx == 0.)  dx = 0.01;
-  if (dy == 0.)  dy = 0.01;
-  
-  // Delete previous iterator
-  delete  fSectorIterator;
-  
-  fSectorIterator 
-    = fSectorSegmentation
-        ->CreateIterator(AliMpArea(TVector2(fXhit,fYhit),TVector2(dx,dy)));
-
-  AliDebug(1,Form("CreateIterator area=%e,%e +- %e,%e %s",
-                  fXhit,fYhit,dx,dy,PlaneTypeName(fPlaneType).Data()));
-  
-  fSectorIterator->First();            
-
-  if (! fSectorIterator->IsDone())
-    UpdateCurrentPadValues(fSectorIterator->CurrentItem());
-}
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::NextPad()
-{
-/// Iterate over pads - stepper
-
-  fSectorIterator->Next();                             
-
-  if (! fSectorIterator->IsDone())
-    UpdateCurrentPadValues(fSectorIterator->CurrentItem());
-}
-
-//______________________________________________________________________________
-Int_t AliMUONSt12QuadrantSegmentation::MorePads()
-{
-/// Iterate over pads - condition
-
-  if (fSectorIterator->IsDone())
-    return 0;
-  else
-    return 1;  
-}
-
-//______________________________________________________________________________
-Float_t AliMUONSt12QuadrantSegmentation::Distance2AndOffset(Int_t iX, Int_t iY, 
-                                                  Float_t x, Float_t y, Int_t* /*dummy*/)
-{                                         
-/// Returns the square of the distance between 1 pad
-/// labelled by its channel numbers and a coordinate
-
-  AliMpPad pad = fSectorSegmentation->PadByIndices(AliMpIntPair(iX, iY));
-  
-  if (!pad.IsValid())
-    AliFatal("Cannot locate pad.");
-
-  return (pad.Position() - TVector2(x, y)).Mod2();
-}
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/,
-                                                  Int_t* /*Nparallel*/, Int_t* /*Offset*/)
-{                                         
-/// Number of pads read in parallel and offset to add to x 
-/// (specific to LYON, but mandatory for display)
-
-  AliFatal( "Not yet implemented.");
-}
-
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::Neighbours(Int_t iX, Int_t iY, 
-                                        Int_t* Nlist, 
-                                       Int_t Xlist[10], Int_t Ylist[10])
-{                                        
-/// Get next neighbours 
-
-  AliMpPad pad = fSectorSegmentation->PadByIndices(AliMpIntPair(iX,iY));
-  Int_t &i = *Nlist;
-  i=0;
-  AliMpNeighboursPadIterator iter(fSectorSegmentation, pad, kFALSE);
-
-  for( iter.First(); !iter.IsDone() && i<10; iter.Next()) {
-    Xlist[i] = iter.CurrentItem().GetIndices().GetFirst();
-    Ylist[i] = iter.CurrentItem().GetIndices().GetSecond();
-    i++;
-  }
-}
-//______________________________________________________________________________
-Int_t  AliMUONSt12QuadrantSegmentation::Ix()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  return fSectorIterator->CurrentItem().GetIndices().GetFirst();
-}
-
-//______________________________________________________________________________
-Int_t  AliMUONSt12QuadrantSegmentation::Iy()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  return fSectorIterator->CurrentItem().GetIndices().GetSecond();
-}
-
-//______________________________________________________________________________
-Int_t  AliMUONSt12QuadrantSegmentation::ISector()
-{
-/// Current sector
-
-  return fZone;
-}
-
-//______________________________________________________________________________
-Int_t AliMUONSt12QuadrantSegmentation::Sector(Int_t ix, Int_t iy)
-{
-/// Calculate sector from pad coordinates
-
-  return fSectorSegmentation
-           ->Zone(fSectorSegmentation->PadByIndices(AliMpIntPair(ix, iy)));
-}
-
-//______________________________________________________________________________
-Int_t AliMUONSt12QuadrantSegmentation::Sector(Float_t x, Float_t y)
-{
-/// Calculate sector from pad coordinates
-
-  return fSectorSegmentation
-           ->Zone(fSectorSegmentation
-                   ->PadByPosition(TVector2(x,y)));
-}
-
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::IntegrationLimits(Float_t& x1, Float_t& x2,
-                                                Float_t& y1, Float_t& y2)
-{                                                
-/// Current integration limits 
-  x1 = fXhit - fX - Dpx(fZone)/2.;
-  x2 = x1 + Dpx(fZone);
-
-  y1 = fYhit - fY - Dpy(fZone)/2.;
-  y2 = y1 + Dpy(fZone);    
-}
-
-//______________________________________________________________________________
-Int_t AliMUONSt12QuadrantSegmentation::SigGenCond(Float_t x, Float_t y, Float_t /*z*/)
-{
-/// Signal Generation Condition during Stepping
-/// -  0: don't generate signal
-/// -  1: generate signal 
-///
-///  Comments:                                                                  \n 
-///
-///  Crossing of pad boundary and mid plane between neighbouring wires is checked.
-///  To correctly simulate the dependence of the spatial resolution on the angle 
-///  of incidence signal must be generated for constant steps on 
-///  the projection of the trajectory along the anode wire.
-///
-///  Signal will be generated if particle crosses pad boundary or
-///  boundary between two wires. 
-///
-/// From AliMUONSegmentationV01
-
-  Int_t ixt, iyt;
-  GetPadI(x, y, ixt, iyt);
-  Int_t iwt=(x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1;
-  
-  if ((ixt != fIxt) || (iyt !=fIyt) || (iwt != fIwt)) {
-    return 1;
-  } 
-  else {
-    return 0;
-  }
-}
-
-//______________________________________________________________________________
-void  AliMUONSt12QuadrantSegmentation::SigGenInit(Float_t x, Float_t y, Float_t /*z*/)
-{
-/// Initialise signal generation at coord (x,y,z)
-/// Initialises pad and wire position during stepping.
-/// From AliMUONSegmentationV01
-
-  fXt = x;
-  fYt = y;
-  GetPadI(x, y, fIxt, fIyt);
-  fIwt = (x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1 ;
-}                  
-    
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::GiveTestPoints(Int_t& n, Float_t* x, Float_t* y) const
-{                                            
-/// Test points for auto calibration
-/// Returns test point on the pad plane.
-/// Used during determination of the segmoid correction of the COG-method
-/// From AliMUONSegmentationV01
-
-  n=1;
-  x[0] = (fRmax+fRmin)/2/TMath::Sqrt(2.);
-  y[0] = x[0];
-}
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::Draw(const char * /*opt*/)
-{
-/// Draw the segmentation zones.
-/// (Called from AliMUON::BuildGeometry)
-
-  AliWarning("Not yet implemented.");
-}
-
-//______________________________________________________________________________
-void AliMUONSt12QuadrantSegmentation::SetCorrFunc(Int_t isec, TF1* func)
-{
-/// Set the correction function.
-/// From AliMUONSegmentationV01
-
-  fCorrA->AddAt(func, isec);
-}
-
-//______________________________________________________________________________
-TF1* AliMUONSt12QuadrantSegmentation::CorrFunc(Int_t isec) const
-{
-/// Get the correction Function.
-/// From AliMUONSegmentationV01
-
-  return (TF1*) fCorrA->At(isec);
-} 
diff --git a/MUON/AliMUONSt12QuadrantSegmentation.h b/MUON/AliMUONSt12QuadrantSegmentation.h
deleted file mode 100644 (file)
index ff351cd..0000000
+++ /dev/null
@@ -1,219 +0,0 @@
-#ifndef ALI_MUON_ST12_QUADRANT_SEGMENTATION_H
-#define ALI_MUON_ST12_QUADRANT_SEGMENTATION_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-// Revision of includes 07/05/2004
-
-/// \ingroup base
-/// \class AliMUONSt12QuadrantSegmentation
-/// \brief Segmentation for MUON quadrants of stations 1 and 2 using 
-/// the mapping package
-///
-/// \author Ivana Hrivnacova, IPN Orsay
-
-#include "AliMpStationType.h"
-#include "AliMpPlaneType.h"
-
-#include "AliMUONVGeometryDESegmentation.h"
-
-class TObjArray;
-
-class AliMpSector;
-class AliMpSectorSegmentation;
-class AliMpVPadIterator;
-class AliMpPad;
-
-class AliMUONChamber;
-
-class AliMUONSt12QuadrantSegmentation : public AliMUONVGeometryDESegmentation 
-{
-  public:
-    AliMUONSt12QuadrantSegmentation(AliMpVSegmentation* segmentation,
-                                    AliMp::StationType stationType, 
-                                    AliMp::PlaneType planeType);
-    AliMUONSt12QuadrantSegmentation();
-    
-    virtual ~AliMUONSt12QuadrantSegmentation();
-    
-    //    
-    // methods derived from base class    
-    // 
-
-    // Set Chamber Segmentation Parameters
-    //
-    virtual void SetPadSize(Float_t p1, Float_t p2);
-                       // Pad size Dx*Dy 
-    virtual void SetDAnod(Float_t D);
-                       // Anode Pitch
-
-    // Check if pad exists
-    //
-    virtual Bool_t  HasPad(Float_t x, Float_t y, Float_t z); 
-                       // Returns true if a pad exists in the given position
-    virtual Bool_t  HasPad(Int_t ix, Int_t iy);
-                       // Returns true if a pad with given indices exists
-
-    // Quadrant type
-    //
-    virtual AliMUONGeometryDirection  GetDirection();
-                       // Returns the direction with a constant pad size
-    // Access to mapping
-    virtual const AliMpVSegmentation* GetMpSegmentation() const;                      
-
-    // Transform from pad (wire) to real coordinates and vice versa
-    //
-    virtual Float_t GetAnod(Float_t xhit) const;
-                       // Anode wire coordinate closest to xhit
-    virtual void  GetPadI(Float_t x, Float_t y, Float_t  z, Int_t& ix, Int_t& iy);
-    virtual void  GetPadI(Float_t x, Float_t y , Int_t &ix, Int_t &iy) ;
-                       // Transform from pad to real coordinates
-    virtual void  GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y, Float_t& z);
-    virtual void  GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y);
-                       // Transform from real to pad coordinates
-  
-    // Initialisation
-    //
-    virtual void Init(Int_t chamber);
-    // Get member data
-    //
-    virtual Float_t Dpx() const;
-    virtual Float_t Dpy() const;
-                      // Pad size in x, y 
-    virtual Float_t Dpx(Int_t isector) const;
-    virtual Float_t Dpy(Int_t isector) const;
-                      // Pad size in x, y by Sector 
-    virtual Int_t   Npx() const;
-    virtual Int_t   Npy() const;
-                      // Maximum number of Pads in y
-
-    virtual void  SetPad(Int_t ix, Int_t iy);
-                      // Set pad position
-    virtual void  SetHit(Float_t xhit, Float_t yhit, Float_t zhit);
-                      // Set hit position
-    
-    // Iterate over pads
-    //
-    virtual void  FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, 
-                           Float_t dx, Float_t dy);
-    virtual void  NextPad();
-    virtual Int_t MorePads();
-
-    virtual Float_t Distance2AndOffset(Int_t iX, Int_t iY, 
-                                       Float_t X, Float_t Y, Int_t* dummy) ;
-                      // Distance between 1 pad and a position
-    virtual void GetNParallelAndOffset(Int_t iX, Int_t iY,
-                                      Int_t* Nparallel, Int_t* Offset);
-                      // Number of pads read in parallel and offset to add to x 
-                      // (specific to LYON, but mandatory for display)
-    virtual void Neighbours(Int_t iX, Int_t iY, 
-                            Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10]);
-                      // Get next neighbours 
-
-    // Current values
-    //
-    virtual Int_t  Ix();
-    virtual Int_t  Iy();
-                     // Current pad cursor during disintegration
-                     // x, y-coordinate
-    virtual Int_t  ISector();
-                    // current sector
-
-    virtual Int_t  Sector(Int_t ix, Int_t iy);
-    virtual Int_t  Sector(Float_t x, Float_t y);
-                    // calculate sector from pad coordinates
-
-    virtual void  IntegrationLimits(Float_t& x1, Float_t& x2,
-                                    Float_t& y1, Float_t& y2);
-                   // Current integration limits 
-
-    // Signal Generation
-    //
-    virtual Int_t SigGenCond(Float_t x, Float_t y, Float_t z);
-                    // Signal Generation Condition during Stepping
-    virtual void  SigGenInit(Float_t x, Float_t y, Float_t z);
-                    // Initialise signal generation at coord (x,y,z)
-                   
-    
-    virtual void GiveTestPoints(Int_t& n, Float_t* x, Float_t* y) const;
-                   // Test points for auto calibration
-    virtual void Draw(const char *opt = "");
-                   // Draw the segmentation zones
-
-    // Function for systematic corrections
-    //
-    virtual void SetCorrFunc(Int_t isec,  TF1* func);
-                   // Set the correction function
-    virtual TF1* CorrFunc(Int_t isec)  const;
-                   // Get the correction Function
-  private:
-    /// Not implemented
-    AliMUONSt12QuadrantSegmentation(const AliMUONSt12QuadrantSegmentation& rhs);
-    /// Not implemented
-    AliMUONSt12QuadrantSegmentation& operator=(const AliMUONSt12QuadrantSegmentation & rhs);
-
-    // methods
-    void UpdateCurrentPadValues(const AliMpPad& pad);
-  
-    // data members
-
-    // From mapping
-    //
-    AliMp::StationType       fStationType;       ///< Station type
-    AliMp::PlaneType         fPlaneType;         ///< Plane type
-    const AliMpSector*       fSector;            ///< Sector (from mapping)
-    AliMpSectorSegmentation* fSectorSegmentation;///< Sector segmentation (from mapping)
-    AliMpVPadIterator*       fSectorIterator;    //!< Iterator over pads
-
-    // Wire pitch
-    //
-    Float_t         fWireD;  ///< \ brief Wire pitch
-                             ///< (smaller distance between anode wires)
-    
-    // Reference to mother chamber
-    //
-    AliMUONChamber* fChamber; //!< Reference to mother chamber
-    Int_t           fId;      ///< Identifier
-    Float_t         fRmin;    ///< Inner radius
-    Float_t         fRmax;    ///< Outer radius
-    Float_t         fZ;       ///< Z-position of chamber
-
-    // Current pad during integration (cursor for disintegration)
-    //
-    Int_t   fIx;     //!< Pad coord.  x 
-    Int_t   fIy;     //!< Pad coord.  y 
-    Float_t fX;      //!< Real coord. x
-    Float_t fY;      //!< Real ccord. y
-    Int_t   fZone;   //!< Current zone (sector in AliSegmentation naming)
-    
-    // Current pad and wire during tracking (cursor at hit centre)
-    //
-    Float_t fXhit;  //!< X-position of hit
-    Float_t fYhit;  //!< Y-position of hit
-
-    // Reference point to define signal generation condition
-    //
-    Int_t   fIxt;   //!< Pad coord. x
-    Int_t   fIyt;   //!< Pad coord. y
-    Int_t   fIwt;   //!< Wire number
-    Float_t fXt;    //!< X
-    Float_t fYt;    //!< Y
-
-    TObjArray* fCorrA; //!< Array of correction functions
-
-  ClassDef(AliMUONSt12QuadrantSegmentation,2) // Station1 segmentation
-};
-
-#endif //ALI_MUON_ST12_QUADRANT_SEGMENTATION_H
-
-
-
-
-
-
-
-
diff --git a/MUON/AliMUONSt345SlatSegmentation.cxx b/MUON/AliMUONSt345SlatSegmentation.cxx
deleted file mode 100644 (file)
index 3436829..0000000
+++ /dev/null
@@ -1,632 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-/* $Id$ */
-
-#include "AliMUONSt345SlatSegmentation.h"
-#include "AliMUONConstants.h"
-
-#include "AliMpArea.h"
-#include "AliMpSlat.h"
-#include "AliMpSlatSegmentation.h"
-#include "AliMpPCB.h" 
-// FIXME: we should not need access to PCB at this level
-// if the Dpx, Dpy, Sector interface would not be used.
-// Investigate instead to direct use of AliMpVSegmentation and AliMpPad
-// from the clusterFinder ? // :aphecetc:20050722 
-// or, or ... have the AliMpSlat handles the notion of zone, finally
-// (where "zone" in mapping is equivalent to "sector" here), and thus
-// let AliMpSlat offer the interface to get information similar to what
-// Dpx, Dpy, Sector offer now to the clustering. That indeed should be
-// handled directly at the level of AliMpVSegmentation...
-#include "AliMpVPadIterator.h"
-
-#include "AliLog.h"
-
-#include "Riostream.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONSt345SlatSegmentation)
-/// \endcond
-
-namespace
-{
-  Float_t FMAX(1E9);
-}
-
-//_____________________________________________________________________________
-AliMUONSt345SlatSegmentation::AliMUONSt345SlatSegmentation()
-: AliMUONVGeometryDESegmentation(),
-fDetElemId(-1),
-fPlaneType(AliMp::kBendingPlane),
-fSlat(0),
-fSlatSegmentation(0),
-fPadIterator(0),
-fCurrentPad(),
-fXhit(FMAX),
-fYhit(FMAX)
-{
-/// Default ctor
-
-       AliDebug(1,Form("this=%p default (empty) ctor",this));
-}
-
-//_____________________________________________________________________________
-AliMUONSt345SlatSegmentation::AliMUONSt345SlatSegmentation(
-                                   AliMpVSegmentation* segmentation,
-                                   Int_t detElemId, AliMp::PlaneType bendingOrNonBending)
-: AliMUONVGeometryDESegmentation(),
-fDetElemId(detElemId),
-fPlaneType(bendingOrNonBending),
-fSlat(0),
-fSlatSegmentation(0),
-fPadIterator(0),
-fCurrentPad(),
-fXhit(FMAX),
-fYhit(FMAX)
-{ 
-/// Normal ctor.
-
-  fSlatSegmentation = dynamic_cast<AliMpSlatSegmentation*>(segmentation);
-  if (fSlatSegmentation)
-    fSlat = fSlatSegmentation->Slat();
-  else 
-    AliFatal("Wrong mapping segmentation type");
-               
-  AliDebug(1,Form("this=%p detElemId=%3d %s fSlatSegmentation=%p",this,detElemId,
-                                                                       ( (bendingOrNonBending==AliMp::kBendingPlane)?"Bending":"NonBending" ),
-                                                                       fSlatSegmentation));
-}
-
-//_____________________________________________________________________________
-AliMUONSt345SlatSegmentation::~AliMUONSt345SlatSegmentation()
-{
-/// Destructor
-
-       AliDebug(1,Form("dtor this=%p",this));
-  delete fPadIterator;
-}
-
-//_____________________________________________________________________________
-TF1*
-AliMUONSt345SlatSegmentation::CorrFunc(Int_t /*isec*/) const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0x0;
-}
-
-//_____________________________________________________________________________
-Float_t 
-AliMUONSt345SlatSegmentation::Distance2AndOffset(Int_t /*iX*/, Int_t /*iY*/, 
-                                 Float_t /*x*/, Float_t /*y*/, Int_t* /*dummy*/){
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0.0;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::Draw(Option_t* /*opt*/)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONSt345SlatSegmentation::Dpx() const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0.0;
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONSt345SlatSegmentation::Dpy() const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0.0;
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONSt345SlatSegmentation::Dpx(int ipcb) const
-{
-/// Get pad size in x
-
-       AliMpPCB* pcb = fSlat->GetPCB(ipcb);
-       if (!pcb) 
-  {
-    AliFatal("pcb is null!");
-  }
-       return pcb->PadSizeX();
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONSt345SlatSegmentation::Dpy(int ipcb) const
-{
-/// Get pad size in y
-
-       AliMpPCB* pcb = fSlat->GetPCB(ipcb);
-       if (!pcb) 
-  {
-    AliFatal("pcb is null!");
-  }
-       return pcb->PadSizeY();
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::FirstPad(Float_t xhit, Float_t yhit,Float_t /*zhit*/,
-                                         Float_t dx, Float_t dy)
-{
-/// OK. We will do it in 2 steps. First get the area over which to
-/// iterate, based on hit coordinates and (dx,dy). This first step
-/// has nothing to do with segmentation in the first place, but with
-/// how we simulate the fact that at some point the charge is shared
-/// amongst several pads.
-/// The second step is the actual pad iteration and is handled by 
-/// a specific class (which has to do only with iteration...)
-///
-/// \todo FIXME: this method should not be here in the first place, IMHO.
-       
-  // Find the wire position (center of charge distribution)
-  Float_t xwire = GetAnod(xhit);
-  fXhit = xwire;
-  fYhit = yhit;
-       
-  Double_t x01 = xwire - dx;
-  Double_t x02 = xwire + dx;
-  Double_t y01 = yhit - dy;
-  Double_t y02 = yhit + dy;
-       
-  Double_t xext = x02 - x01;
-  Double_t yext = y02 - y01;
-       
-  // we do not check area here, as we assume the iterator
-  // will do it, and will possibly truncate it if needed.
-  // Note that we convert the area position to a reference frame
-  // located in the lower-left corner of the slat, instead of its
-  // center.
-//  AliMpArea area(TVector2((x01+x02)/2.0+fSlat->DX(),
-//                                                                                                     (y01+y02)/2.0+fSlat->DY()),
-//                                                              TVector2(xext/2.0,yext/2.0));
-  AliMpArea area(TVector2((x01+x02)/2.0,(y01+y02)/2.0),
-                                                                TVector2(xext/2.0,yext/2.0));
-       
-  delete fPadIterator;
-       
-  fPadIterator = fSlatSegmentation->CreateIterator(area);
-       
-  fPadIterator->First();
-       
-  fCurrentPad = fPadIterator->CurrentItem();
-       
-  if ( !fCurrentPad.IsValid() ) 
-       {
-               AliError(Form("Cannot get a valid pad for (xhit,yhit,dx,dy)=(%e,%e,%e,%e)",xhit,yhit,dx,dy));
-       }
-       
-  AliDebug(4,Form("xhit,yhit,dx,dy=%e,%e,%e,%e ix,iy=%3d,%3d slat=%s",
-                                                                       xhit,yhit,dx,dy,
-                                                                       fCurrentPad.GetIndices().GetFirst(),
-                                                                       fCurrentPad.GetIndices().GetSecond(),fSlat->GetID()));            
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONSt345SlatSegmentation::GetAnod(Float_t xhit) const
-{
-/// Gets the x-coordinate of the wire which is the closest to xhit.
-       
-  Int_t n = Int_t(xhit/AliMUONConstants::Pitch());
-  Float_t wire = (xhit>0) ? n+0.5 : n-0.5;
-  return AliMUONConstants::Pitch()*wire;
-}
-
-//_____________________________________________________________________________
-AliMUONGeometryDirection
-AliMUONSt345SlatSegmentation::GetDirection()
-{
-/// Not implemented
-
-  //AliWarning("Not Implemented");
-  return kDirUndefined;
-}
-
-//______________________________________________________________________________
-const AliMpVSegmentation*  
-AliMUONSt345SlatSegmentation::GetMpSegmentation() const
-{
-/// Returns the mapping segmentation
-/// (provides access to electronics info)
-
-  return fSlatSegmentation;
-}  
-
-
-//_____________________________________________________________________________
-void 
-AliMUONSt345SlatSegmentation::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/,
-                                        Int_t* /*Nparallel*/, Int_t* /*Offset*/)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::GetPadC(Int_t ix, Int_t iy, 
-                                        Float_t& x, Float_t& y, Float_t& z)
-{                                       
-/// Transform from pad to real coordinates
-
-  z = 0;
-  GetPadC(ix,iy,x,y);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::GetPadC(Int_t ix, Int_t iy, 
-                                        Float_t& x, Float_t& y)
-{
-/// Transform from pad to real coordinates
-
-  AliMpPad pad = 
-  fSlatSegmentation->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
-  x = pad.Position().X();
-  y = pad.Position().Y();
-}
-
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::GetPadI(Float_t x, Float_t y, Float_t /*z*/,
-Int_t& ix, Int_t& iy)
-{
-///  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
-
-  GetPadI(x,y,ix,iy);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::GetPadI(Float_t x, Float_t y,
-                                        Int_t& ix, Int_t& iy)
-{
-///  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
-
-  AliMpPad pad = fSlatSegmentation->PadByPosition(TVector2(x,y), kTRUE);
-       
-  if ( pad != AliMpPad::Invalid() )
-       {
-               ix = pad.GetIndices().GetFirst();
-               iy = pad.GetIndices().GetSecond();
-       }
-  else
-       {
-               ix = iy = -1;
-       }
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONSt345SlatSegmentation::GiveTestPoints(Int_t& /*n*/, 
-                                    Float_t* /*x*/, Float_t* /*y*/) const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliMUONSt345SlatSegmentation::HasPad(Float_t x, Float_t y, Float_t z)
-{
-/// Returns true if a pad exists in the given position
-
-  Int_t ix, iy;
-  GetPadI(x,y,z,ix,iy);
-  return HasPad(ix,iy);
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliMUONSt345SlatSegmentation::HasPad(Int_t ix, Int_t iy)
-{
-/// Returns true if a pad with given indices exists
-
-  return fSlatSegmentation->HasPad(AliMpIntPair(ix,iy));
-}
-
-//_____________________________________________________________________________
-void  
-AliMUONSt345SlatSegmentation::IntegrationLimits(Float_t& x1, Float_t& x2,
-                                                  Float_t& y1, Float_t& y2)
-{
-///  Returns integration limits for current pad
-       
-       //   x1 = fXhit - fX - Dpx(fSector)/2.;
-       //   x2 = x1 + Dpx(fSector);
-       //   y1 = fYhit - fY - Dpy(fSector)/2.;
-       //   y2 = y1 + Dpy(fSector);    
-       
-  Float_t x = fCurrentPad.Position().X();
-  Float_t y = fCurrentPad.Position().Y();
-       
-  Float_t padsizex = fCurrentPad.Dimensions().X() * 2.0;
-  Float_t padsizey = fCurrentPad.Dimensions().Y() * 2.0;
-       
-  x1 = fXhit - x - padsizex/2.0;
-  x2 = x1 + padsizex;
-  y1 = fYhit - y - padsizey/2.0;
-  y2 = y1 + padsizey;
-       
-  AliDebug(4,Form("xhit,yhit=%e,%e x,y=%e,%e, x1,x2,y1,y2=%e,%e,%e,%e",fXhit,fYhit,x,y,x1,x2,y1,y2));
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::ISector()
-{
-/// \todo FIXME: remove the usage of ISector from all the code.
-
-  return -10;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::Ix()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  if ( fPadIterator )
-       {
-               return fPadIterator->CurrentItem().GetIndices().GetFirst();
-       }
-  else
-       {
-               return -1;
-       }
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::Iy()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  if ( fPadIterator ) 
-       {
-               return fPadIterator->CurrentItem().GetIndices().GetSecond();
-       }
-  else
-       {
-               return -1;
-       }
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::MorePads()
-{
-/// Iterate over pads - condition
-
-  return (fPadIterator && !fPadIterator->IsDone());
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONSt345SlatSegmentation::Neighbours(Int_t iX, Int_t iY, Int_t* Nlist,
-                                           Int_t Xlist[10], Int_t Ylist[10])
-{
-/// Find pad at (ix,iy) for which we'll search neighbours.
-
-  AliMpPad pad = 
-       fSlatSegmentation->PadByIndices(AliMpIntPair(iX,iY),kTRUE);
-       
-  // Define the region to look into : a region slightly bigger
-  // than the pad itself (5% bigger), in order to catch first neighbours.
-
-  AliMpArea area(pad.Position(),pad.Dimensions()*1.05); 
-               
-  AliMpVPadIterator* it = fSlatSegmentation->CreateIterator(area);
-  it->First();
-  Int_t n = 0;
-  while ( !it->IsDone() && n < 10 )
-       {
-               AliMpPad p = it->CurrentItem();
-               if ( p != pad ) // skip self
-               {
-                       Xlist[n] = p.GetIndices().GetFirst();
-                       Ylist[n] = p.GetIndices().GetSecond();
-                       ++n;
-               }
-               it->Next();
-       }
-       delete it;
-  *Nlist = n;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::NextPad()
-{
-/// Iterate over pads - stepper
-
-  if ( fPadIterator )
-       {
-               fPadIterator->Next();
-               fCurrentPad = fPadIterator->CurrentItem();
-       }
-  else
-       {
-               AliError("PadIterator not initialized. Please use First() first ;-)");
-       }
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::Npx() const
-{
-/// Maximum number of Pads in x
-
-  return fSlatSegmentation->MaxPadIndexX()+1;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::Npy() const
-{
-/// Maximum number of Pads in y
-
-  return fSlatSegmentation->MaxPadIndexY()+1;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::Print(Option_t* /*opt*/) const
-{
-/// Printing
-
-  cout << "DetElemId=" << fDetElemId << " PlaneType=" 
-  << fPlaneType << " Npx,Npy=" << Npx() << "," << Npy() << " fSlat=" << fSlat 
-  << " fSlatSegmentation=" << fSlatSegmentation
-  << " fSlatSegmentation->Slat()=" << fSlatSegmentation->Slat() << endl;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::Sector(Int_t ix, Int_t /*iy*/)
-{
-/// Calculate sector from pad coordinates
-
-  return fSlat->FindPCBIndex(ix);
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONSt345SlatSegmentation::Sector(Float_t x, Float_t y)
-{
-/// Calculate sector from pad coordinates
-
-  return fSlat->FindPCBIndex(x,y);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::SetCorrFunc(Int_t /*isec*/,TF1* /*func*/)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::SetDAnod(float /*d*/)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::SetHit(Float_t x, Float_t y, Float_t)
-{
-/// Set hit position
-/// Sets virtual hit position, needed for evaluating pad response 
-/// outside the tracking program 
-
-  fXhit = x;
-  fYhit = y;
-       
-  //
-  // insure we're within the slat limits. If not, issue a simple
-  // warning, as this might be correct (due to clustering/fitting algorithm
-  // that is allowed to go a little bit outside limits).
-  // That should only be considered an error in case the point is way
-  // outside (but by how much is the question you'll have to determine
-  // by yourself...)
-  //
-  if ( fXhit < -fSlat->DX() || fXhit > fSlat->DX() ||
-       fYhit < -fSlat->DY() || fYhit > fSlat->DY() )
-       {
-    Double_t dx = - fSlat->DX() + TMath::Abs(fXhit);
-    Double_t dy = - fSlat->DY() + TMath::Abs(fYhit);
-    dx = ( dx > 0 ? dx : 0);
-    dy = ( dy > 0 ? dy : 0);
-               AliWarning(Form("Hit outside slat %s limits (x,y)hit = (%e,%e). "
-                    "Outside by (%e,%e) cm. Might be ok though.",
-                    fSlat->GetID(),fXhit,fYhit,dx,dy));
-       }  
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::SetPad(Int_t ix, Int_t iy)
-{
-/// Set pad position.
-/// Sets virtual pad coordinates, needed for evaluating pad response 
-/// outside the tracking program.
-
-  fCurrentPad = 
-       fSlatSegmentation->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
-  if ( !fCurrentPad.IsValid() )
-       {
-               AliError(Form("Setting current pad to invalid ! (ix,iy)=(%4d,%4d)",ix,iy));
-       }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONSt345SlatSegmentation::SetPadSize(float /*p1*/,float /*p2*/)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONSt345SlatSegmentation::SigGenCond(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0;
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONSt345SlatSegmentation::SigGenInit(Float_t,Float_t,Float_t)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
diff --git a/MUON/AliMUONSt345SlatSegmentation.h b/MUON/AliMUONSt345SlatSegmentation.h
deleted file mode 100644 (file)
index 157f235..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef ALIMUONST345SLATSEGMENTATION_H
-#define ALIMUONST345SLATSEGMENTATION_H
-
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup base
-/// \class AliMUONSt345SlatSegmentation
-/// \brief Segmentation for slat modules
-
-#ifndef ALIMUONVGEOMETRYDESEGMENTATION_H
-#include "AliMUONVGeometryDESegmentation.h"
-#endif
-
-#ifndef ALI_MP_PLANE_TYPE_H
-#include "AliMpPlaneType.h"
-#endif
-
-#ifndef ALI_MP_PAD_H
-#include "AliMpPad.h"
-#endif
-
-class AliMpSlat;
-class AliMpSlatSegmentation;
-class AliMpVPadIterator;
-
-class AliMUONSt345SlatSegmentation : public AliMUONVGeometryDESegmentation
-{
- public:
-
-  AliMUONSt345SlatSegmentation();
-  AliMUONSt345SlatSegmentation(AliMpVSegmentation* segmentation,
-                                 Int_t detElemId,
-                                AliMp::PlaneType bendingOrNonBending);
-  virtual ~AliMUONSt345SlatSegmentation();
-
-  void FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, 
-               Float_t dx, Float_t dy);
-
-  void  NextPad();
-
-  Int_t MorePads();
-
-  Int_t  Ix();
-  Int_t  Iy();
-  Int_t  ISector();
-
-  Float_t Distance2AndOffset(Int_t ix, Int_t iy, 
-                            Float_t X, Float_t Y, 
-                            Int_t* dummy);
-
-  void GetNParallelAndOffset(Int_t iX, Int_t iY,
-                            Int_t* Nparallel, Int_t* Offset);
-
-  void Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, 
-                 Int_t Xlist[10], Int_t Ylist[10]);
-
-  Int_t  Sector(Int_t ix, Int_t iy);
-  Int_t  Sector(Float_t x, Float_t y);
-
-  void  IntegrationLimits(Float_t& x1, Float_t& x2, 
-                         Float_t& y1, Float_t& y2);
-
-  void GiveTestPoints(Int_t& n, Float_t* x, Float_t* y) const;
-
-  Int_t SigGenCond(Float_t x, Float_t y, Float_t z);
-  void SigGenInit(Float_t x, Float_t y, Float_t z);
-
-  void SetCorrFunc(Int_t isec,  TF1* func);
-
-  TF1* CorrFunc(Int_t isec) const;
-
-  void SetPadSize(float x,float y);
-
-  void SetDAnod(float d);
-
-  void Init(int /*chamber*/) {}  ///< Not implemented
-  void Draw(Option_t* opt = "");
-
-  Float_t Dpx() const;
-  Float_t Dpy() const;
-  
-  Float_t Dpx(int ipcb) const;
-  Float_t Dpy(int ipcb) const;
-  
-  Float_t GetAnod(Float_t xhit) const;
-
-  Int_t Npx() const;
-  Int_t Npy() const;
-
-  /// Sets the current pad.
-  void SetPad(Int_t ix,Int_t iy);
-  
-  /// Sets the current hit.
-  void SetHit(Float_t x, Float_t y, Float_t zIsNotUsed);
-  AliMUONGeometryDirection GetDirection();// { return kDirUndefined; }
-
-  const AliMpVSegmentation* GetMpSegmentation() const;
-
-  /// \deprecated. Use the one below w/o z instead.
-  void GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y, Float_t& z);
-
-  /// From pad indices to coordinates (cm).
-  void GetPadC(Int_t ix, Int_t iy, Float_t& x, Float_t& y);
-
-  // Transform from pad to real coordinates
-  void GetPadI(Float_t x ,Float_t y ,Int_t   &ix,Int_t &iy);
-
-  // to be deprecated. Use the one above w/o z instead.
-  void GetPadI(Float_t x, Float_t y , Float_t z, Int_t &ix, Int_t &iy);
-
-
-  /// Whether a pad exists at a given position.
-  Bool_t HasPad(Float_t x, Float_t y, Float_t z);
-
-  /// Whether a pad exists, given its indices.
-  Bool_t HasPad(Int_t ix, Int_t iy);
-  
-  /// Print.
-  void Print(Option_t* opt = "") const;
-
- protected:
-  /// Not implemented
-  AliMUONSt345SlatSegmentation(const AliMUONSt345SlatSegmentation& right);
-  /// Not implemented
-  AliMUONSt345SlatSegmentation&  operator = (const AliMUONSt345SlatSegmentation& right);
-     
- private:
-
-  Int_t fDetElemId;                ///< det element Id
-       AliMp::PlaneType fPlaneType; ///< plane type
-  const AliMpSlat* fSlat;          ///< slat
-  AliMpSlatSegmentation* fSlatSegmentation; ///< slat segmentation
-  AliMpVPadIterator* fPadIterator; //!< pad iterator
-  AliMpPad fCurrentPad; //!< FIXME: should not be needed, if we externalise the SetPad, SetHit, IntegrationLimits methods which have nothing to do here anyway, together with the iteration methods FirstPad, NextPad, MorePads, which have nothing to do here either.
-  Float_t fXhit;        //!<  x-position of hit
-  Float_t fYhit;        //!<  y-position of hit
-  ClassDef(AliMUONSt345SlatSegmentation,4) // St345 segmentation
-};
-
-#endif
diff --git a/MUON/AliMUONStopwatchGroupElement.h b/MUON/AliMUONStopwatchGroupElement.h
new file mode 100644 (file)
index 0000000..cced4b3
--- /dev/null
@@ -0,0 +1,43 @@
+#ifndef ALIMUONSTOPWATCHGROUPELEMENT_H
+#define ALIMUONSTOPWATCHGROUPELEMENT_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+* See cxx source for full Copyright notice                               */
+
+// $Id$
+
+/// \ingroup base
+/// \class AliMUONStopwatchGroupElement
+/// \brief A class to group timers by name
+/// 
+// Author Laurent Aphecetche
+
+#ifndef ALIMUONSTOPWATCHGROUP_H
+#  include "AliMUONStopwatchGroup.h"
+#endif
+
+#ifndef ROOT_TString
+#  include "TString.h"
+#endif
+
+class AliMUONStopwatchGroupElement
+{
+public:
+  AliMUONStopwatchGroupElement(AliMUONStopwatchGroup* group, const char* a, const char *b)
+  : fGroup(group), fA(a), fB(b)
+  { group->Start(a,b); }
+  AliMUONStopwatchGroupElement(const AliMUONStopwatchGroupElement& rhs) : fGroup(0),fA(),fB()
+  { fGroup = rhs.fGroup; fA = rhs.fA; fB=rhs.fB ; }
+  AliMUONStopwatchGroupElement& operator=(const AliMUONStopwatchGroupElement& rhs)
+  { if ( this != &rhs ) { fGroup = rhs.fGroup; fA = rhs.fA; fB=rhs.fB ; } return *this; }
+  
+  ~AliMUONStopwatchGroupElement()
+  { fGroup->Stop(fA.Data(),fB.Data()); }
+  
+private:
+  AliMUONStopwatchGroup* fGroup; // the group for which we're just a proxy
+  TString fA; // first parameter
+  TString fB; // second parameter
+};
+
+#endif
diff --git a/MUON/AliMUONTriggerSegmentation.cxx b/MUON/AliMUONTriggerSegmentation.cxx
deleted file mode 100644 (file)
index a97d7ce..0000000
+++ /dev/null
@@ -1,849 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-/* $Id$ */
-
-// -------------------------------------
-// Class AliMUONTriggerSegmentation
-// -------------------------------------
-// Segmentation for MUON trigger stations using 
-// the mapping package
-
-#include "AliMUONTriggerSegmentation.h"
-
-#include "AliMpPCB.h"
-#include "AliMpTrigger.h"
-#include "AliMpTriggerSegmentation.h"
-#include "AliMpSlat.h"
-
-#include "AliLog.h"
-
-#include "Riostream.h"
-#include "TClass.h"
-#include "TString.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONTriggerSegmentation)
-/// \endcond
-
-namespace
-{
-//  Int_t SPECIAL_SECTOR = 8;
-  Int_t fgIntOffset(1);
-  Float_t FMAX(1E9);
-  Int_t CODEMAKER(1000);
-  
-  Int_t Code(Int_t ixLA, Int_t iyLA)
-  {
-    return iyLA*CODEMAKER + ixLA;
-  }
-  
-  void Decode(Int_t code, Int_t& ixLA, Int_t& iyLA)
-  {
-    iyLA = code/CODEMAKER;
-    ixLA = code - iyLA*CODEMAKER;
-  }
-}
-
-//_____________________________________________________________________________
-AliMUONTriggerSegmentation::AliMUONTriggerSegmentation() 
-: AliMUONVGeometryDESegmentation(),
-  fDetElemId(-1),
-  fPlaneType(AliMp::kBendingPlane),
-  fSlat(0),
-  fSlatSegmentation(0),
-  fCurrentPad(),
-  fXhit(FMAX),
-  fYhit(FMAX),
-  fLineNumber(-1)
-{
-/// Default ctor (empty).
-
-  AliDebug(1,Form("this=%p default (empty) ctor",this));
-}
-
-//_____________________________________________________________________________
-AliMUONTriggerSegmentation::AliMUONTriggerSegmentation(
-                                   AliMpVSegmentation* segmentation,
-                                   Int_t detElemId, AliMp::PlaneType bendingOrNonBending)
-    : AliMUONVGeometryDESegmentation(),
-      fDetElemId(detElemId),
-      fPlaneType(bendingOrNonBending),
-      fSlat(0),
-      fSlatSegmentation(0),
-      fCurrentPad(),
-      fXhit(FMAX),
-      fYhit(FMAX),
-      fLineNumber(-1)
-{
-/// Normal ctor.
-
-  fSlatSegmentation = dynamic_cast<AliMpTriggerSegmentation*>(segmentation);
-  if (fSlatSegmentation)
-    fSlat = fSlatSegmentation->Slat();
-  else 
-    AliFatal("Wrong mapping segmentation type");
-               
-  TString id(fSlat->GetID());
-  Ssiz_t pos = id.Last('L');
-  if ( pos <= 0 )
-  {
-    AliFatal(Form("Cannot infer line number for slat %s",id.Data()));
-  }
-  fLineNumber = TString(id(pos+1),1).Atoi();
-               
-  AliDebug(1,Form("this=%p detElemId=%3d %s fSlatSegmentation=%p",this,detElemId,
-                                                                       ( (bendingOrNonBending==AliMp::kBendingPlane)?"Bending":"NonBending" ),
-                                                                       fSlatSegmentation));
-}
-
-//_____________________________________________________________________________
-AliMUONTriggerSegmentation::~AliMUONTriggerSegmentation() 
-{ 
-/// Destructor
-
-  AliDebug(1,Form("this=%p",this));                    
-}
-
-//_____________________________________________________________________________
-TF1*
-AliMUONTriggerSegmentation::CorrFunc(Int_t) const
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-  return 0x0;
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONTriggerSegmentation::Distance2AndOffset(Int_t, Int_t, 
-                                                 Float_t, Float_t, Int_t*)
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-  return 0;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::Draw(Option_t*)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONTriggerSegmentation::Dpx() const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0.0;
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONTriggerSegmentation::Dpy() const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0.0;
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONTriggerSegmentation::Dpx(Int_t sectorCode) const
-{
-/// Get pad size in x
-
- Int_t ixLA, iyLA;
-  Decode(sectorCode,ixLA,iyLA);
-  AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE);
-  if ( !pad.IsValid() ) return 0.0;
-  return pad.Dimensions().X()*2.0;
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONTriggerSegmentation::Dpy(Int_t sectorCode) const
-{
-/// Get pad size in y
-
-  Int_t ixLA, iyLA;
-  Decode(sectorCode,ixLA,iyLA);
-  AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE);
-  if ( !pad.IsValid() ) return 0.0;
-  return pad.Dimensions().Y()*2.0;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::FirstPad(Float_t /*xhit*/, Float_t /*yhit*/, Float_t /*zhit*/,
-                                       Float_t /*dx*/, Float_t /*dy*/)
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-}
-
-//_____________________________________________________________________________
-Float_t
-AliMUONTriggerSegmentation::GetAnod(Float_t) const
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-  return 0.0;
-}
-
-//_____________________________________________________________________________
-AliMUONGeometryDirection
-AliMUONTriggerSegmentation::GetDirection()
-{
-/// Not implemented
-
-  //AliWarning("Not Implemented");
-  return kDirUndefined;
-}
-
-//______________________________________________________________________________
-const AliMpVSegmentation*  
-AliMUONTriggerSegmentation::GetMpSegmentation() const
-{
-/// Returns the mapping segmentation
-/// (provides access to electronics info)
-
-  return fSlatSegmentation;
-}  
-
-//_____________________________________________________________________________
-void 
-AliMUONTriggerSegmentation::GetNParallelAndOffset(Int_t,Int_t,Int_t*,Int_t*)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::GetPadC(Int_t ix, Int_t iy, 
-                                      Float_t& x, Float_t& y, Float_t& z)
-{
-/// Transform from pad to real coordinates
-
-  z = 0;
-  GetPadC(ix,iy,x,y);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::GetPadC(Int_t ixGlo, Int_t iyGlo, 
-                                      Float_t& x, Float_t& y)
-{
-/// Transform from pad to real coordinates
-
-  Int_t ixLA,iyLA;
-  IGlo2ILoc(ixGlo,iyGlo,ixLA,iyLA);
-  AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kTRUE);
-  x = pad.Position().X();
-  y = pad.Position().Y();
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::GetPadI(Float_t x, Float_t y, Float_t,
-                                      Int_t& ix, Int_t& iy)
-{
-///  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
-
-  GetPadI(x,y,ix,iy);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::GetPadI(Float_t x, Float_t y,
-                                      Int_t& ixGlo, Int_t& iyGlo)
-{
-///  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
-
-  AliDebug(2,Form("%s x=%e y=%e ixGlo,iyGlo=%d,%d\n",
-                  fSlatSegmentation->GetName(),
-                  x,y,ixGlo,iyGlo));
-  
-  AliMpPad pad = 
-    fSlatSegmentation->PadByPosition(TVector2(x,y), kTRUE);
-       
-  if ( pad != AliMpPad::Invalid() )
-       {
-               Int_t ix = pad.GetIndices().GetFirst();
-               Int_t iy = pad.GetIndices().GetSecond();
-    ILoc2IGlo(ix,iy,ixGlo,iyGlo);
-       }
-  else
-       {
-               ixGlo=iyGlo=-1;
-       }
-  AliDebug(2,Form("ixGlo,iyGlo=%d,%d\n",ixGlo,iyGlo));
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::GetPadLoc2Glo(Int_t ix, Int_t iy,
-                                            Int_t& ixGlo, Int_t& iyGlo) const
-{
-/// Converts from local (in PC convention) to (ix,iy) to global (ix,iy)
-
-  ixGlo=iyGlo=-1; // starts with invalid values
-  
-  if ( fPlaneType == AliMp::kBendingPlane )
-  {
-    ixGlo = 10*LineNumber() + ix;
-    iyGlo = iy - fgIntOffset;
-  }
-  else if ( fPlaneType == AliMp::kNonBendingPlane )
-  {
-    Int_t i = fSlat->GetLayer(0)->FindPCBIndex(ix-fgIntOffset);
-    if (i<0)
-    {
-      AliError(Form("Invalid local (ix=%d,iy=%d) ?",ix,iy));
-      return ;
-    }
-    AliMpPCB* pcb = fSlat->GetLayer(0)->FindPCB(ix-fgIntOffset);
-    iyGlo = ix - pcb->Ixmin() - fgIntOffset;
-    if ( LineNumber() == 5 ) ++i;
-    ixGlo = 10*LineNumber() + i + fgIntOffset; 
-  }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::GetPadGlo2Loc(Int_t ixGlo, Int_t iyGlo,
-                                            Int_t& ix, Int_t& iy) const
-{
-/// Converts from global (ix,iy) to local (ix,iy) (in PC convention)
-  
-  ix=iy=-1; // starts with invalid values
-
-  if ( abs(ixGlo) == 51 ) return;
-  
-  Int_t column = ModuleColNum(ixGlo);
-
-  if ( fPlaneType == AliMp::kBendingPlane )
-  {
-    ix = column + fgIntOffset;
-    iy = iyGlo + fgIntOffset;
-  }
-  else if ( fPlaneType == AliMp::kNonBendingPlane )
-  {
-    if ( LineNumber()==5 ) --column;
-    AliMpPCB* pcb = fSlat->GetLayer(0)->GetPCB(column);
-    if (!pcb)
-    {
-      AliError(Form("Invalid global (ix=%d,iy=%d)",ixGlo,iyGlo));
-      return;
-    }
-    ix = pcb->Ixmin() + iyGlo + fgIntOffset;
-    iy = fgIntOffset;
-  }
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONTriggerSegmentation::GiveTestPoints(Int_t& /*n*/, 
-                                             Float_t* /*x*/, Float_t*/*y*/) const
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliMUONTriggerSegmentation::HasPad(Float_t x, Float_t y, Float_t /*z*/)
-{
-/// Returns true if a pad exists in the given position
-///
-/// Well, 2 implementations are possible here
-/// Either reuse HasPad(int,int), or get it from scratch using
-/// underlying fSlatSegmentation.
-/// Took second option, but w/o checking whether this is the faster.
-/// The second option is commented out below, for the record.
-  
-//  Int_t ix, iy;
-//  GetPadI(x,y,z,ix,iy);
-//  Int_t ixLA, iyLA;
-//  IGlo2ILoc(ix,iy,ixLA,iyLA);
-//  Int_t ixPC, iyPC;
-//  LA2PC(ixLA,iyLA,ixPC,iyPC);
-//  Bool_t ok1 = HasPad(ixPC,iyPC);
-
-  AliMpPad pad = 
-  fSlatSegmentation->PadByPosition(TVector2(x,y),kFALSE);
-  return pad.IsValid();
-}
-
-//_____________________________________________________________________________
-Bool_t
-AliMUONTriggerSegmentation::HasPad(Int_t ixGlo, Int_t iyGlo)
-{
-/// Returns true if a pad with given indices exists
-
-  Int_t ixLA, iyLA;
-  IGlo2ILoc(ixGlo,iyGlo,ixLA,iyLA);
-  return fSlatSegmentation->HasPad(AliMpIntPair(ixLA,iyLA));
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::IGlo2ILoc(Int_t ixGlo, Int_t iyGlo,
-                                        Int_t& ixLA, Int_t& iyLA) const
-{
-/// \todo FIXME: add comment
-
-  Int_t ixPC, iyPC;
-  GetPadGlo2Loc(ixGlo,iyGlo,ixPC,iyPC);
-  PC2LA(ixPC,iyPC,ixLA,iyLA);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::ILoc2IGlo(Int_t ixLA, Int_t iyLA,
-                                        Int_t& ixGlo, Int_t& iyGlo) const
-{
-/// \todo FIXME: add comment
-
-  Int_t ixPC, iyPC;
-  LA2PC(ixLA,iyLA,ixPC,iyPC);
-  GetPadLoc2Glo(ixPC,iyPC,ixGlo,iyGlo);
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::ISector()
-{
-/// \todo FIXME: remove the usage of ISector from all the code.
-
-  return -10;
-}
-
-//_____________________________________________________________________________
-void AliMUONTriggerSegmentation::IntegrationLimits(Float_t& x1, 
-                                                     Float_t& x2,
-                                                     Float_t& x3, 
-                                                     Float_t& x4) 
-{
-/// \param x1 : hit x(y) position
-/// \param x2 : x(y) coordinate of the main strip
-/// \param x3 : current strip real x(y) coordinate  
-/// \param x4 : dist. between x(y) hit pos. and the closest border of the current strip
-///
-/// Note : need to return (only) x4.
-  
-  AliFatal("Check me before usage. ResponseTrigger does not use me, while"
-           "ResponseTriggerV1 does ?");
-    
-  AliMpPad strip = 
-  fSlatSegmentation->PadByPosition(TVector2(fXhit,fYhit),kFALSE);
-  if ( !strip.IsValid() )
-  {
-    AliWarning(Form("%s got invalid fXhit,fYhit=%e,%e\n",
-                    fSlatSegmentation->GetName(),fXhit,fYhit));
-    x1=x2=x3=x4=0;
-  }
-  else
-  {
-    Double_t xstrip = strip.Position().X();
-    Double_t ystrip = strip.Position().Y();
-    AliDebug(1,Form("fXhit,Yhit=%e,%e xstrip,ystrip=%e,%e\n",
-                    fXhit,fYhit,xstrip,ystrip));
-    x1 = (fPlaneType==AliMp::kBendingPlane) ? fYhit : fXhit;
-    x2 = (fPlaneType==AliMp::kBendingPlane) ? ystrip : xstrip;
-    x3 = (fPlaneType==AliMp::kBendingPlane) ? 
-      fCurrentPad.Position().Y() : fCurrentPad.Position().X();
-    Double_t xmin = 0.0;
-    Double_t xmax = 0.0;
-    if (fPlaneType==AliMp::kBendingPlane)
-    {
-      xmin = x3 - fCurrentPad.Dimensions().X();
-      xmax = x3 + fCurrentPad.Dimensions().X();
-    }
-    else
-    {
-      xmin = x3 - fCurrentPad.Dimensions().Y();
-      xmax = x3 + fCurrentPad.Dimensions().Y();
-    }
-    // dist. between the hit and the closest border of the current strip
-    x4 = (TMath::Abs(xmax-x1) > TMath::Abs(xmin-x1)) ? 
-      TMath::Abs(xmin-x1):TMath::Abs(xmax-x1);    
-    
-    AliDebug(1,Form("Bending %d x1=%e x2=%e x3=%e x4=%e xmin,max=%e,%e\n",
-                    fPlaneType,x1,x2,x3,x4,xmin,xmax));
-
-  }
-}  
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONTriggerSegmentation::Ix()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  if ( fCurrentPad.IsValid() )
-  {
-    Int_t ixGlo,iyGlo;
-    ILoc2IGlo(fCurrentPad.GetIndices().GetFirst(),
-              fCurrentPad.GetIndices().GetSecond(),ixGlo,iyGlo);
-    return ixGlo;
-  }
-  return -1;
-}
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONTriggerSegmentation::Iy()
-{
-/// Current pad cursor during disintegration
-/// x, y-coordinate
-
-  if ( fCurrentPad.IsValid() )
-  {
-    Int_t ixGlo,iyGlo;
-    ILoc2IGlo(fCurrentPad.GetIndices().GetFirst(),
-              fCurrentPad.GetIndices().GetSecond(),ixGlo,iyGlo);
-    return iyGlo;
-  }
-  return -1;
-}
-
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::LA2PC(Int_t ixLA, Int_t iyLA,
-                                    Int_t& ixPC, Int_t& iyPC) const
-{
-/// From LA to PC conventions for integers indices.
-
-  ixPC=iyPC=-1;
-  
-  if ( ixLA<0 || iyLA<0 ) return;
-  
-  ixPC = ixLA + 1;
-  iyPC = iyLA + 1;
-  
-  if ( fPlaneType == AliMp::kBendingPlane )
-  {
-    if ( LineNumber()==5 )
-    {
-      ++ixPC;
-    }
-    if ( LineNumber()==4 && ixLA==0 )
-    {
-      iyPC -= 16;
-    }
-  }
-  
-  AliDebug(3,Form("ix,iy LA (%d,%d) -> PC (%d,%d)",ixLA,iyLA,ixPC,iyPC));
-  
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::LineNumber() const
-{
-/// \todo FIXME: add comment
-
- return 10-fLineNumber;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::ModuleColNum(Int_t ixGlo) const
-{
-/// returns column number (from 0 to 6) in which the (global) module 
-/// ix is sitting (could return 7 if ix=isec)
-
-  return TMath::Abs(ixGlo)-Int_t(TMath::Abs(ixGlo)/10)*10-1;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::MorePads()
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-  return 0;
-}
-
-//_____________________________________________________________________________
-void AliMUONTriggerSegmentation::Neighbours(Int_t /*iX*/, Int_t /*iY*/, 
-                                              Int_t* /*Nlist*/, 
-                                              Int_t /*Xlist*/[10], 
-                                              Int_t /*Ylist*/[10]) 
-{
-/// Not implemented
-
-  //-----------------BENDING-----------------------------------------
-  // Returns list of 10 next neighbours for given X strip (ix, iy)  
-  // neighbour number 4 in the list -                     
-  // neighbour number 3 in the list  |                    
-  // neighbour number 2 in the list  |_ Upper part             
-  // neighbour number 1 in the list  |            
-  // neighbour number 0 in the list -           
-  //      X strip (ix, iy) 
-  // neighbour number 5 in the list -       
-  // neighbour number 6 in the list  | _ Lower part
-  // neighbour number 7 in the list  |
-  // neighbour number 8 in the list  | 
-  // neighbour number 9 in the list -
-  
-  //-----------------NON-BENDING-------------------------------------
-  // Returns list of 10 next neighbours for given Y strip (ix, iy)  
-  // neighbour number 9 8 7 6 5 (Y strip (ix, iy)) 0 1 2 3 4 in the list
-  //                  \_______/                    \_______/
-  //                    left                         right
-  AliFatal("Please implement me");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::NextPad()
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::Npx() const
-{
-/// Maximum number of Pads in x
-/// hard coded for the time being
-
-  return 124;// FIXME: this should not have to be done, if only we'd stick 
-  // to a local (ix,iy) convention !!! 
-  // return fSlatSegmentation->MaxPadIndexX()+1;
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::Npy() const
-{
-/// Maximum number of Pads in y
-/// hard coded for the time being
-
-  return 64;
-//  return fSlatSegmentation->MaxPadIndexY()+1;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::PC2LA(Int_t ixPC, Int_t iyPC,
-                                    Int_t& ixLA, Int_t& iyLA) const
-{
-/// From PC to LA conventions for integers indices.
-
-  ixLA=iyLA=-1;
-  
-  if ( ixPC<0 || iyPC<0 ) return;
-  
-  ixLA = ixPC - 1;
-  iyLA = iyPC - 1;
-  
-  if ( fPlaneType == AliMp::kBendingPlane )
-  {
-    if ( LineNumber()==5 )
-    {
-      --ixLA;
-    }
-    if ( LineNumber()==4 && ixLA==0 )
-    {
-      iyLA += 16;
-    }
-  }
-  
-  AliDebug(3,Form("ix,iy PC (%d,%d) -> LA (%d,%d)",ixPC,iyPC,ixLA,iyLA));
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::Print(Option_t* opt) const
-{
-/// Printing
-
-  TString sopt(opt);
-  
-  cout << "DetElemId=" << fDetElemId << " PlaneType=" 
-    << fPlaneType << " Npx=" << Npx() << " Npy=" << Npy() << endl;
-  if ( ( sopt.Contains("SEG") || sopt.Contains("ALL") ) && fSlatSegmentation )
-  {
-    fSlatSegmentation->Print();
-  }
-  if ( sopt.Contains("ALL") && fSlat )
-  {
-    fSlat->Print();
-  }
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::Sector(Int_t ix, Int_t iy)
-{
-/// Calculate sector from pad coordinates
-
-  Int_t ixLA, iyLA;
-  IGlo2ILoc(ix,iy,ixLA,iyLA);
-  AliMpPad pad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kFALSE);
-  if ( !pad.IsValid() ) return -1;
-  return Code(ixLA,iyLA);
-  
-//  AliMpPCB* pcb = fSlat->GetLayer(0)->FindPCB(ixLA);
-//  if (!pcb)
-//  {
-//    AliError(Form("Could not find a pcb at (%d,%d) for slat %s",
-//             ix,iy,fSlat->GetName()));
-//    return -1;
-//  }
-//  if ( pcb->PadSizeX()==-1.0 )
-//  {
-//    // special case of column 7 non-bending.
-//    return SPECIAL_SECTOR;
-//  }
-//  return fSlat->GetLayer(0)->FindPCBIndex(ixLA);
-}
-
-//_____________________________________________________________________________
-Int_t
-AliMUONTriggerSegmentation::Sector(Float_t, Float_t)
-{
-/// Not implemented
-
-  AliFatal("Not implemented");
-  return 0;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::SetCorrFunc(Int_t,TF1*)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::SetDAnod(Float_t)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::SetHit(Float_t x, Float_t y)
-{
-/// Set hit position
-/// Sets virtual hit position, needed for evaluating pad response 
-/// outside the tracking program 
-
-  fXhit = x;
-  fYhit = y;
-       
-  //
-  // insure we're within the slat limits. If not, issue an error and sets
-  // the current hit to slat center.
-  // FIXME: this should probably a) not happen at all b) be a fatal error
-  //
-  if ( fXhit < -fSlat->DX() || fXhit > fSlat->DX() ||
-       fYhit < -fSlat->DY() || fYhit > fSlat->DY() )
-       {
-               AliError(Form("Hit outside slat %s limits (x,y)hit = (%e,%e)."
-                  " Forcing to (0,0)",fSlat->GetID(),fXhit,fYhit));
-               fXhit = 0.0;
-               fYhit = 0.0;
-       }
-  
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::SetHit(Float_t x, Float_t y, Float_t)
-{
-/// Set hit position
-/// Sets virtual hit position, needed for evaluating pad response 
-/// outside the tracking program 
-
-  SetHit(x,y);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::SetPad(Int_t ix, Int_t iy)
-{
-/// Set pad position.
-/// Sets virtual pad coordinates, needed for evaluating pad response 
-/// outside the tracking program.
-
-  Int_t ixLA, iyLA;
-  IGlo2ILoc(ix,iy,ixLA,iyLA);
-  fCurrentPad = fSlatSegmentation->PadByIndices(AliMpIntPair(ixLA,iyLA),kTRUE);
-  if ( !fCurrentPad.IsValid() )
-       {
-               AliError(Form("Setting current pad to invalid ! (ix,iy)=(%4d,%4d)",ix,iy));
-       }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONTriggerSegmentation::SetPadSize(Float_t,Float_t)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONTriggerSegmentation::SigGenCond(Float_t,Float_t,Float_t)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-  return 0;
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONTriggerSegmentation::SigGenInit(Float_t,Float_t,Float_t)
-{
-/// Not implemented
-
-  AliFatal("Not Implemented");
-}
-
-
-
-
-
diff --git a/MUON/AliMUONTriggerSegmentation.h b/MUON/AliMUONTriggerSegmentation.h
deleted file mode 100644 (file)
index 1b6d64d..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#ifndef ALIMUONTRIGGERSEGMENTATION_H
-#define ALIMUONTRIGGERSEGMENTATION_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup base
-/// \class AliMUONTriggerSegmentation
-/// \brief Segmentation for trigger modules
-///
-/// New implementation of AliMUONVGeometryDESegmentation, based on  
-/// mapping package.
-
-#ifndef ALIMUONVGEOMETRYDESEGMENTATION_H
-#include "AliMUONVGeometryDESegmentation.h"
-#endif
-
-#ifndef ALI_MP_PLANE_TYPE_H
-#include "AliMpPlaneType.h"
-#endif
-
-#ifndef ALI_MP_PAD_H
-#include "AliMpPad.h"
-#endif
-
-class AliMpTrigger;
-class AliMpTriggerSegmentation;
-
-class AliMUONTriggerSegmentation : public AliMUONVGeometryDESegmentation 
-{
- public:
-
-  AliMUONTriggerSegmentation();
-  AliMUONTriggerSegmentation(AliMpVSegmentation* segmentation,
-                               Int_t detElemId, AliMp::PlaneType bendingOrNonBending);
-  virtual ~AliMUONTriggerSegmentation();
-      
-  /// Distance between 1 pad and a position
-  virtual Float_t Distance2AndOffset(Int_t /*iX*/, Int_t /*iY*/, 
-                                     Float_t /*X*/, Float_t /*Y*/, 
-                                     Int_t * /*dummy*/);
-  
-  virtual Float_t Dpx() const;
-  virtual Float_t Dpy() const;
-  virtual Float_t Dpx(Int_t sectorCode) const;
-  virtual Float_t Dpy(Int_t sectorCode) const;
-  
-  virtual void Draw(Option_t*/*opt*/ = "");
-  
-  void FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, 
-                Float_t dx, Float_t dy);
-
-  virtual Bool_t HasPad(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/);
-  virtual Bool_t HasPad(Int_t ix, Int_t iy);
-  
-  virtual AliMUONGeometryDirection GetDirection();
-  virtual const AliMpVSegmentation* GetMpSegmentation() const;
-
-  virtual Float_t GetAnod(Float_t /*xhit*/) const;
-
-  virtual void GetPadI(Float_t x ,Float_t y ,Int_t   &ix,Int_t &iy);
-  virtual void GetPadI(Float_t x, Float_t y , Float_t z, Int_t &ix, Int_t &iy);
-  virtual void GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y);
-  virtual void GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z);
-                  
-  virtual void Init(Int_t) {} ///< Not implemented
-  
-  virtual void IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& x4);
-  
-  virtual Int_t ISector();
-  virtual Int_t Ix();
-  virtual Int_t Iy();
-  
-  Int_t LineNumber() const;
-  
-  virtual Int_t MorePads();
-  virtual void Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, 
-                          Int_t Xlist[10], Int_t Ylist[10]);
-  virtual void NextPad();
-    
-  virtual Int_t Npx() const;
-  virtual Int_t Npy() const;
-
-  void Print(Option_t* opt="") const;
-  
-  virtual void SetDAnod(Float_t /*D*/);
-
-  virtual Int_t Sector(Int_t ix, Int_t iy);
-  virtual void SetHit(Float_t xhit, Float_t yhit); 
-  virtual void SetHit(Float_t xhit, Float_t yhit, Float_t zhit);
-
-  virtual void SetPad(Int_t ix, Int_t iy);
-  virtual void SetPadSize(Float_t, Float_t);
-  
-  virtual void GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, 
-                                     Int_t */*Nparallel*/, Int_t */*Offset*/);
-  virtual Int_t SigGenCond(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/);
-  virtual void SigGenInit(Float_t /*x*/, Float_t /*y*/, Float_t /*z*/);
-  virtual void GiveTestPoints(Int_t &/*n*/, Float_t * /*x*/, Float_t */*y*/) const;
-  virtual void SetCorrFunc(Int_t /*dum*/, TF1* /*func*/);
-  virtual TF1* CorrFunc(Int_t) const;
-  virtual Int_t Sector(Float_t /*x*/, Float_t /*y*/);
-
-public:
-
-    void GetPadLoc2Glo(Int_t ixLoc, Int_t iyLoc, Int_t& ixGlo, Int_t& iyGlo) const;
-    void GetPadGlo2Loc(Int_t ixLoc, Int_t iyLoc, Int_t& ixGlo, Int_t& iyGlo) const;
-    
-    void PC2LA(Int_t ixPC, Int_t iyPC, Int_t& ixLA, Int_t& iyLA) const;
-    void LA2PC(Int_t ixLA, Int_t iyLA, Int_t& ixPC, Int_t& iyPC) const;
-    
-    void IGlo2ILoc(Int_t ixGlo, Int_t iyGlo, Int_t& ixLA, Int_t& iyLA) const;
-    void ILoc2IGlo(Int_t ixLA, Int_t iyLA, Int_t& ixGlo, Int_t& iyGlo) const;
-    
-    Int_t ModuleColNum(Int_t ixGlo) const;
-    
-private:
-    /// Not implemented
-    AliMUONTriggerSegmentation(const AliMUONTriggerSegmentation& rhs);
-    /// Not implemented
-    AliMUONTriggerSegmentation& operator=(const AliMUONTriggerSegmentation& rhs);
-
-    Int_t fDetElemId;          ///< det elem Id
-    AliMp::PlaneType fPlaneType; ///< plane type
-    const AliMpTrigger* fSlat; ///< slat
-    AliMpTriggerSegmentation* fSlatSegmentation; ///< mapping segmentation
-//    AliMpVPadIterator* fPadIterator; //!
-    AliMpPad fCurrentPad; //!< FIXME: should not be needed, if we externalise the SetPad, SetHit, IntegrationLimits methods which have nothing to do here anyway, together with the iteration methods FirstPad, NextPad, MorePads, which have nothing to do here either.
-    Float_t fXhit;        //!< x-position of hit
-    Float_t fYhit;        //!< y-position of hit
-    Int_t fLineNumber;    ///< Line number of that detection element (from 1 to 9)
-    
-    ClassDef(AliMUONTriggerSegmentation,2) // Trigger segmentation
-};
-#endif
-
-
-
-
-
-
diff --git a/MUON/AliMUONV1DStore.cxx b/MUON/AliMUONV1DStore.cxx
deleted file mode 100644 (file)
index ccfc549..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-// $Id$
-
-#include "AliMUONV1DStore.h"
-
-#include "AliMUONVDataIterator.h"
-#include "AliMUONObjectPair.h"
-#include <TString.h>
-#include <Riostream.h>
-
-/// \class AliMUONV1DStore
-/// Defines an interface equivalent to a list of TObject, indexed
-/// by integer (somehow a vector, except that indices are not necessarily
-/// sequential).
-/// 
-/// It's extremely simple and hopefully allow many implementations.
-/// It also makes the object ownership self-evident.
-///
-/// \author Laurent Aphecetche
-
-/// \cond CLASSIMP
-ClassImp(AliMUONV1DStore)
-/// \endcond
-
-//_____________________________________________________________________________
-AliMUONV1DStore::AliMUONV1DStore()
-{
-/// Default constructor
-}
-
-//_____________________________________________________________________________
-AliMUONV1DStore::~AliMUONV1DStore()
-{
-/// Destructor
-}
-
-//_____________________________________________________________________________
-void
-AliMUONV1DStore::Print(Option_t* opt) const
-{
-  /// Printout
-  /// Si AliMUONVCalibParam concrete implementation for the meaning of opt
-  
-  AliMUONVDataIterator* it = this->Iterator();
-  
-  AliMUONObjectPair* pair;
-  
-  while ( ( pair = static_cast<AliMUONObjectPair*>(it->Next() ) ) )
-  {
-    TObject* o = pair->Second();
-    if (o) 
-    {
-      o->Print(opt);
-    }
-    if ( it->IsOwner() ) delete pair;
-  }
-  
-  delete it;
-}
-
-
-
-
diff --git a/MUON/AliMUONV1DStore.h b/MUON/AliMUONV1DStore.h
deleted file mode 100644 (file)
index 78c5254..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup calib
-/// \class AliMUONV1DStore
-/// \brief Generic container indexed by a single integer.
-/// 
-//  Author Laurent Aphecetche
-
-#ifndef AliMUONV1DSTORE_H
-#define AliMUONV1DSTORE_H
-
-#ifndef ROOT_TObject
-#  include "TObject.h"
-#endif
-
-class AliMUONVDataIterator;
-
-class AliMUONV1DStore : public TObject
-{
-public:
-  AliMUONV1DStore();
-  virtual ~AliMUONV1DStore();
-  
-  /// Return the object stored at i.
-  virtual TObject* Get(Int_t i) const = 0;
-  
-  /// Return iterator
-  virtual AliMUONVDataIterator* Iterator() const { return 0x0; }
-  
-  /** Set the object stored at i.
-    if replace=false and there's already an object there, returns kFALSE
-    */
-  virtual Bool_t Set(Int_t i, TObject*, Bool_t replace) = 0;
-  
-  /// Whether or not this container is the owner of its contents.
-  virtual Bool_t IsOwner() const = 0;
-  
-  virtual void Print(Option_t* opt="") const;
-
-  
-private:  
-  ClassDef(AliMUONV1DStore,0) // Generic container indexed by a single integer
-};
-
-#endif
diff --git a/MUON/AliMUONV2DStore.cxx b/MUON/AliMUONV2DStore.cxx
deleted file mode 100644 (file)
index 577043f..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-// $Id$
-
-#include "AliMUONV2DStore.h"
-
-/// \class AliMUONV2DStore
-/// Defines an interface equivalent to a 2D array of TObject, indexed
-/// by a pair of integers (somehow a matrix, 
-/// except that indices are not necessarily sequential).
-/// 
-/// It's extremely simple and hopefully allow many implementations.
-/// It also makes the object ownership self-evident.
-///
-/// \author Laurent Aphecetche
-
-/// \cond CLASSIMP
-ClassImp(AliMUONV2DStore)
-/// \endcond
-
-#include "AliLog.h"
-#include "AliMUONObjectPair.h"
-#include "AliMUONVDataIterator.h"
-#include "AliMpIntPair.h"
-#include <TMap.h>
-#include <TString.h>
-#include <TObjString.h>
-#include <TObjArray.h>
-#include <Riostream.h>
-
-namespace
-{
-  //_____________________________________________________________________________
-  void Decode(TMap& m, const TString& s, const char* sep)
-{
-    /// Fills the map m with (key,value) extracted from s
-    /// where s is of the form :
-    /// key1=value1;key2=value2;key3=value3
-    
-    TString ss(s);
-    ss.ToUpper();
-    
-    m.SetOwner(true);
-    
-    TObjArray* a = ss.Tokenize(sep);
-    TIter next(a);
-    TObjString* o;
-    
-    while ( ( o = static_cast<TObjString*>(next()) ) )
-    {
-      TString& os(o->String());
-      TObjArray* b = os.Tokenize("=");
-      if (b->GetEntries()==2)
-      {
-        m.Add(b->At(0),b->At(1));
-      }
-    }
-}
-
-//_____________________________________________________________________________
-Bool_t FindValue(const TMap& m, const TString& key, TString& value)
-{
-  /// Find value corresponding to key in map m.
-  /// Return false if key not found.
-  
-  TString skey(key);
-  skey.ToUpper();
-  value = "";
-  TPair* p = static_cast<TPair*>(m.FindObject(skey));
-  if (p) 
-  {
-    value = (static_cast<TObjString*>(p->Value()))->String();
-    return kTRUE;
-  }
-  return kFALSE;
-}
-
-}
-
-//_____________________________________________________________________________
-AliMUONV2DStore::AliMUONV2DStore()
-{
-/// Default constructor
-}
-
-//_____________________________________________________________________________
-AliMUONV2DStore::~AliMUONV2DStore()
-{
-/// Destructor
-}
-
-
-//_____________________________________________________________________________
-void
-AliMUONV2DStore::Print(Option_t* opt) const
-{
-  /// Printout
-  /// opt is used to filter which (i,j) couple you want to see
-  /// e.g opt="I=12;J=1;opt=Full" to see complete values, but only for the 
-  /// (12,1) pair.
-  /// Warning : decoding of opt format is not really bullet-proof (yet?)
-
-  AliMUONVDataIterator* it = this->Iterator();
-  
-  AliMUONObjectPair* pair;
-  
-  TMap m;
-  Decode(m,opt,";");
-  
-  TString si;  
-  Bool_t selectI = FindValue(m,"i",si);
-  TString sj;
-  Bool_t selectJ = FindValue(m,"j",sj);
-  TString sopt;
-  FindValue(m,"opt",sopt);
-  
-  while ( ( pair = static_cast<AliMUONObjectPair*>(it->Next() ) ) )
-  {
-    AliMpIntPair* ip = static_cast<AliMpIntPair*>(pair->First());
-    Int_t i = ip->GetFirst();
-    Int_t j = ip->GetSecond();
-    if ( selectI && i != si.Atoi() ) continue;
-    if ( selectJ && j != sj.Atoi() ) continue;
-    cout << Form("[%d,%d]",i,j) << endl;
-    TObject* o = pair->Second();
-    if (o) 
-    {
-      o->Print(sopt.Data());
-    }
-    if ( it->IsOwner() ) delete pair;
-  }
-  delete it;
-}  
-
-
diff --git a/MUON/AliMUONV2DStore.h b/MUON/AliMUONV2DStore.h
deleted file mode 100644 (file)
index 3f02dcf..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup calib
-/// \class AliMUONV2DStore
-/// \brief Generic container indexed by a pair of integers.
-/// 
-//  Author Laurent Aphecetche
-
-#ifndef AliMUONV2DSTORE_H
-#define AliMUONV2DSTORE_H
-
-#ifndef ROOT_TObject
-#  include "TObject.h"
-#endif
-
-class AliMUONVDataIterator;
-
-class AliMUONV2DStore : public TObject
-{
-public:
-  AliMUONV2DStore();
-  virtual ~AliMUONV2DStore();
-  
-  /// Return an empty copy of self.
-  virtual AliMUONV2DStore* CloneEmpty() const { return 0x0; }
-  
-  /// Return the object stored at (i,j).
-  virtual TObject* Get(Int_t i, Int_t j) const = 0;
-    
-  /// Whether or not this container is the owner of its contents.
-  virtual Bool_t IsOwner() const = 0;
-    
-  /// Return iterator
-  virtual AliMUONVDataIterator* Iterator() const { return 0x0; }
-  
-  /** Set the object stored at (i,j).
-    if replace=false and there's already an object there, returns kFALSE
-    */
-  virtual Bool_t Set(Int_t i, Int_t j, TObject*, Bool_t replace) = 0;
-  
-  virtual void Print(Option_t* opt="") const;
-  
-private:  
-  ClassDef(AliMUONV2DStore,0) // Generic container indexed by a pair of integers
-};
-
-#endif
diff --git a/MUON/AliMUONVDataIterator.cxx b/MUON/AliMUONVDataIterator.cxx
deleted file mode 100644 (file)
index c0376a4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/**************************************************************************
-* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-*                                                                        *
-* Author: The ALICE Off-line Project.                                    *
-* Contributors are mentioned in the code where appropriate.              *
-*                                                                        *
-* Permission to use, copy, modify and distribute this software and its   *
-* documentation strictly for non-commercial purposes is hereby granted   *
-* without fee, provided that the above copyright notice appears in all   *
-* copies and that both the copyright notice and this permission notice   *
-* appear in the supporting documentation. The authors make no claims     *
-* about the suitability of this software for any purpose. It is          *
-* provided "as is" without express or implied warranty.                  *
-**************************************************************************/
-
-// $Id$
-
-#include "AliMUONVDataIterator.h"
-
-///
-/// \class AliMUONVDataIterator
-///
-/// Defines an interface of an iterator over muon data structure(s).
-///
-/// \author L. Aphecetche
-
-/// \cond CLASSIMP
-ClassImp(AliMUONVDataIterator)
-/// \endcond
-
-//_____________________________________________________________________________
-AliMUONVDataIterator::AliMUONVDataIterator() : TObject()
-{
-/// Default ctor
-}
-
-//_____________________________________________________________________________
-AliMUONVDataIterator::~AliMUONVDataIterator()
-{
-/// Dtor
-}
diff --git a/MUON/AliMUONVDataIterator.h b/MUON/AliMUONVDataIterator.h
deleted file mode 100644 (file)
index 9750576..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
-* See cxx source for full Copyright notice                               */
-
-// $Id$
-
-/// \ingroup calib
-/// \class AliMUONVDataIterator
-/// \brief Defines an interface of an iterator over muon data structure(s)
-/// 
-//  Author Laurent Aphecetche
-
-#ifndef ALIMUONVDATAITERATOR_H
-#define ALIMUONVDATAITERATOR_H
-
-#ifndef ROOT_TObject
-#  include "TObject.h"
-#endif
-
-class AliMUONVDataIterator : public TObject
-{
-public:
-  AliMUONVDataIterator();
-  virtual ~AliMUONVDataIterator();
-  
-  /// Return next object in the iteration.
-  /// To know if the client must delete that object, use
-  /// the IsOwner() method
-  virtual TObject* Next() = 0;
-  
-  /// Reset (i.e. Rewind) the iterator
-  virtual void Reset() = 0; 
-  
-  /// Remove the current item (might not be implemented yet)
-  virtual Bool_t Remove() = 0;
-  
-  /// Whether or not the objects returned by this iterator are to be deleted
-  virtual Bool_t IsOwner() const = 0;
-  
-  ClassDef(AliMUONVDataIterator,0) // Interface for an iterator on AliMUONData.
-};
-
-#endif
diff --git a/MUON/AliMUONVGeometryDESegmentation.cxx b/MUON/AliMUONVGeometryDESegmentation.cxx
deleted file mode 100644 (file)
index dbe0473..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
-
-//
-// Class AliVMUONGeometryDESegmentation
-// ----------------------------------
-// Extension for AliSegmentation interface,
-// added functions:
-//  Bool_t  HasPad(Float_t x, Float_t y, Float_t z);
-//  Bool_t  HasPad(Int_t ix, Int_t iy);
-//
-// Author:Ivana Hrivnacova, IPN Orsay
-
-#include "AliLog.h"
-
-#include "AliMUONVGeometryDESegmentation.h"
-
-/// \cond CLASSIMP
-ClassImp(AliMUONVGeometryDESegmentation)
-/// \endcond
-
-
-//______________________________________________________________________________
-AliMUONVGeometryDESegmentation::AliMUONVGeometryDESegmentation() 
-: AliSegmentation()
-{
-/// Normal/default constructor
-}
-
-//______________________________________________________________________________
-AliMUONVGeometryDESegmentation::~AliMUONVGeometryDESegmentation() 
-{
-/// Destructor
-} 
diff --git a/MUON/AliMUONVGeometryDESegmentation.h b/MUON/AliMUONVGeometryDESegmentation.h
deleted file mode 100644 (file)
index 205ec0a..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// \ingroup geometry
-/// \class AliMUONVGeometryDESegmentation
-/// \brief Extension for AliSegmentation interface for detection elements
-///
-/// \deprecated - To be removed with passing to maping segmentation interface
-///
-/// \author Ivana Hrivnacova, IPN Orsay
-
-#ifndef ALI_MUON_V_GEOMETRY_DE_SEGMENTATION_H
-#define ALI_MUON_V_GEOMETRY_DE_SEGMENTATION_H
-
-#include "AliSegmentation.h"
-#include "AliMUONGeometryDirection.h"
-
-class AliMpVSegmentation;
-
-class AliMUONVGeometryDESegmentation : public AliSegmentation
-{
-  public:
-    AliMUONVGeometryDESegmentation();
-    virtual ~AliMUONVGeometryDESegmentation();
-
-    // methods
-                       /// Return true if a pad exists in the given position
-    virtual Bool_t  HasPad(Float_t x, Float_t y, Float_t z) = 0; 
-                       /// Return true if a pad with given indices exists
-    virtual Bool_t  HasPad(Int_t ix, Int_t iy) = 0;
-
-                       /// Return the direction with a constant pad size  
-                      /// (Direction or coordinate where the spatial resolution 
-                      /// is the best) \n
-                       /// Normally kDirY will correspond with cathode segmentation 
-                      /// for the bending plane and kDirX with cathode segmentation 
-                      /// for the non bending plane
-    virtual AliMUONGeometryDirection  GetDirection() = 0;
-                      
-                       /// Access to mapping
-    virtual const AliMpVSegmentation* GetMpSegmentation() const = 0;                  
-
-  protected:
-    /// Not implemented
-    AliMUONVGeometryDESegmentation(const AliMUONVGeometryDESegmentation& rhs);
-    /// Not implemented
-    AliMUONVGeometryDESegmentation& operator=(
-      const AliMUONVGeometryDESegmentation& rhs);
-
-   ClassDef(AliMUONVGeometryDESegmentation,1) // Det element segmentation interface
-};
-
-#endif //ALI_MUON_V_GEOMETRY_DE_SEGMENTATION_H
-
-
-
-
-
-
-
-
index 56655554c3255b8914726688be67411451a11f48..01afc50958cc7a80a4a53161d1f408d980dcd3bb 100644 (file)
@@ -202,8 +202,8 @@ SUBGROUPING            = YES
 # Private class members and static file members will be hidden unless 
 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
-EXTRACT_ALL            = YES
-#EXTRACT_ALL            = NO
+#EXTRACT_ALL            = YES
+EXTRACT_ALL            = NO
 
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
 # will be included in the documentation.
@@ -383,8 +383,8 @@ WARNINGS               = YES
 # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
 # automatically be disabled.
 
-#WARN_IF_UNDOCUMENTED   = YES
 WARN_IF_UNDOCUMENTED   = YES
+#WARN_IF_UNDOCUMENTED   = YES
 
 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
 # potential errors in the documentation, such as not documenting some 
@@ -415,8 +415,8 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories 
 # with spaces.
 
-INPUT                  = . ../STEER ../EVGEN
-#INPUT                  = . 
+#INPUT                  = . ../STEER ../EVGEN
+INPUT                  = . 
 
 # If the value of the INPUT tag contains directories, you can use the 
 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
diff --git a/MUON/Doxymain.h b/MUON/Doxymain.h
new file mode 100644 (file)
index 0000000..ead78bf
--- /dev/null
@@ -0,0 +1,57 @@
+/*! \mainpage Main page
+
+This is the documentation for the MUON simulation and reconstruction code.
+It is a mix of general concepts and code implementation details...
+
+\section ssimulation Simulation
+
+The simulation encompasses the following tasks :
+
+- generation of MC particles (the kinematics of the event ends up in the TreeK
+ of Kinematics#.root)                              
+  
+- tracking particles through the detector using 
+the Virtual Monte Carlo, producing AliMUONHit objects, that end up in 
+ the TreeH of MUON.Hits#.root file(s). This part is steered by AliMUON and its child
+AliMUONv1 classes.
+
+- converting MC hits into AliMUONVDigit, called SDigits, that end up in the TreeS
+ of the MUON.SDigits#.root file(s). A S(ummable)Digit is a pad with its associated
+charge, but no noise or electronics response function applied. Steered by AliMUONSDigitizerV2 class.
+
+- converting SDigits into Digits, by applying electronics calibrations. Actually, we de-calibrate
+ the digits at this stage, by adding a pedestal and dividing by a gain, more or less. Steered
+ by AliMUONDigitizerV3 class. Digits end up in TreeD of MUON.Digits#.root file(s). In addition,
+ for the trigger, we create AliMUONLocalTrigger, AliMUONRegionalTrigger and AliMUONGlobalTrigger objects 
+at this stage, that ends up in TreeD as well.
+
+- convert the Digits into RAW data, in a format that should be exactly the same as real data from the
+DAQ. Performed by AliMUONRawWriter.
+
+From there on, the reconstruction can proceed, in the very same way for real or simulated data,
+ as long as they are in RAW format.
+
+\section sreconstruction Reconstruction
+
+The reconstruction is a multistage process, driven by the AliMUONReconstructor class :
+
+- we read the RAW data, convert them (convert them back for simulated data) to 
+AliMUONDigit. Performed by AliMUONDigitMaker. 
+- we calibrate the digits, by subtracting pedestals and multiplying by gains. Performed
+ by AliMUONDigitCalibrator. Calibrated digits might be saved (back) to TreeD.
+- we make clusters by associating digits, producing AliMUONRawCluster objects that end up
+  in TreeR of MUON.RecPoints#.root file(s). Steered by AliMUONClusterReconstructor. @ref AliMUONVClusterFinder "More..."
+
+Part of the reconstruction, but not really steered by AliMUONReconstructor, is the
+ last stage, the tracking, i.e. associating clusters to form tracks. Steered by AliMUONTracker.
+ Producing AliMUONTrack objects that end up in TreeT of MUON.Tracks#.root and AliESDMuonTrack objects
+that end up in the ESD (Event Summary Data), AliESDs.root file. @ref AliMUONVTrackReconstructor "More..."
+
+\section sdataaccess Data access
+
+All the simulation and reconstruction use containers (called stores in MUON jargon) to hold
+ the data we're dealing with : hits, (s)digits, trigger, clusters, tracks and trigger tracks.
+ All those stores share some commonalities, in particular with respect to how they are read/written from/to
+ TTree. @ref AliMUONVStore "More..."
+
+*/
diff --git a/MUON/MUONCDB.h b/MUON/MUONCDB.h
deleted file mode 100644 (file)
index 4a2d57f..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef MUONCDB_H
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               */
-
-/* $Id$ */
-
-/// By Laurent Aphecetche
-
-#include "Rtypes.h"
-
-class TList;
-class AliMUONV1DStore;
-class AliMUONV2DStore;
-class TMap;
-
-// Use the following for testing the Shuttle preprocessor
-//static const char* CDBPath = "local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB";
-// Or this one for "normal" use
-static const char* CDBPath = "local://$ALICE_ROOT";
-
-void generateTrigger(const char* cdbpath=CDBPath);
-
-void getBoundaries(const AliMUONV2DStore& store,
-                   Float_t& x0min, Float_t& x0max,
-                   Float_t& x1min, Float_t& x1max);
-
-void plot(const AliMUONV2DStore& store, const char* name, Int_t nbins=512);
-
-AliMUONV2DStore* diff(AliMUONV2DStore& store1, AliMUONV2DStore& store2, const char* opt="abs");
-
-void testMakeStores(Int_t readLoop=10);
-
-void writeToCDB(const char* cdbpath, const char* calibpath, TObject* object, 
-                Int_t startRun, Int_t endRun, Bool_t defaultValues);
-
-void writeNeighbours(const char* cdbpath, Int_t startRun=0, Int_t endRun=99999999);
-
-void writeHV(const char* cdbpath, Bool_t defaultValues, 
-             Int_t startRun, Int_t endRun);
-
-void writePedestals(const char* cdbpath, Bool_t defaultValues,
-                    Int_t startRun, Int_t endRun=99999999);
-
-void writeGains(const char* cdbpath, Bool_t defaultValues,
-                Int_t startRun, Int_t endRun=99999999);
-
-void writeCapacitances(const char* cdbpath, Bool_t defaultValues,
-                       Int_t startRun=0, Int_t endRun=99999999);
-
-#endif