ROOT logo
#ifndef AliMFTSegmentation_H
#define AliMFTSegmentation_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

//====================================================================================================================================================
//
//      Segmentation class for the planes of the ALICE Muon Forward Tracker
//
//      Contact author: antonio.uras@cern.ch
//
//====================================================================================================================================================

#include "TFile.h"
#include "TNtuple.h"
#include "TClonesArray.h"
#include "TMath.h"
#include "AliMFTPlane.h"
#include "TMath.h"
#include "AliMFTConstants.h"

//====================================================================================================================================================

class AliMFTSegmentation : public TObject {

public:
  
  AliMFTSegmentation();
  AliMFTSegmentation(const Char_t *nameGeomFile);
  
  virtual ~AliMFTSegmentation();
  virtual void Clear(const Option_t* /*opt*/);

  THnSparseC* GetDetElem(Int_t detElemID) const;

  Int_t GetDetElemGlobalID(Int_t plane, Int_t detElem) const { return fNMaxDetElemPerPlane*plane + detElem; }
  Int_t GetDetElemLocalID(Int_t detElem) const { return detElem%fNMaxDetElemPerPlane; }
    
  Bool_t Hit2PixelID(Double_t xHit, Double_t yHit, Int_t detElemID, Int_t &xPixel, Int_t &yPixel);  

  Double_t GetPixelSizeX(Int_t detElemID) const { THnSparseC *detElem = GetDetElem(detElemID); return detElem->GetAxis(0)->GetBinWidth(1); }
  Double_t GetPixelSizeY(Int_t detElemID) const { THnSparseC *detElem = GetDetElem(detElemID); return detElem->GetAxis(1)->GetBinWidth(1); }
  Double_t GetPixelSizeZ(Int_t detElemID) const { THnSparseC *detElem = GetDetElem(detElemID); return detElem->GetAxis(2)->GetBinWidth(1); }

  Double_t GetPixelCenterX(Int_t detElemID, Int_t iPixel) const { THnSparseC *detElem = GetDetElem(detElemID); return detElem->GetAxis(0)->GetBinCenter(iPixel+1); }
  Double_t GetPixelCenterY(Int_t detElemID, Int_t iPixel) const { THnSparseC *detElem = GetDetElem(detElemID); return detElem->GetAxis(1)->GetBinCenter(iPixel+1); }
  Double_t GetPixelCenterZ(Int_t detElemID, Int_t iPixel) const { THnSparseC *detElem = GetDetElem(detElemID); return -1.*(detElem->GetAxis(2)->GetBinCenter(iPixel+1)); }

  Int_t GetNPlanes() const { return fMFTPlanes->GetEntries(); }

  AliMFTPlane* GetPlane(Int_t iPlane) const { if (iPlane>=0 && iPlane<fMFTPlanes->GetEntries()) return (AliMFTPlane*) fMFTPlanes->At(iPlane); else return NULL; }

  Bool_t DoesPixelExist(Int_t detElemID, Int_t xPixel, Int_t yPixel);
 
protected:

  static const Int_t fNMaxPlanes          = AliMFTConstants::fNMaxPlanes;                // max number of MFT planes
  static const Int_t fNMaxDetElemPerPlane = AliMFTConstants::fNMaxDetElemPerPlane;

  TClonesArray *fMFTPlanes;

private:

  AliMFTSegmentation(const AliMFTSegmentation &source);
  AliMFTSegmentation& operator=(const AliMFTSegmentation &source);

  ClassDef(AliMFTSegmentation,1)
    
};

//====================================================================================================================================================

#endif

 AliMFTSegmentation.h:1
 AliMFTSegmentation.h:2
 AliMFTSegmentation.h:3
 AliMFTSegmentation.h:4
 AliMFTSegmentation.h:5
 AliMFTSegmentation.h:6
 AliMFTSegmentation.h:7
 AliMFTSegmentation.h:8
 AliMFTSegmentation.h:9
 AliMFTSegmentation.h:10
 AliMFTSegmentation.h:11
 AliMFTSegmentation.h:12
 AliMFTSegmentation.h:13
 AliMFTSegmentation.h:14
 AliMFTSegmentation.h:15
 AliMFTSegmentation.h:16
 AliMFTSegmentation.h:17
 AliMFTSegmentation.h:18
 AliMFTSegmentation.h:19
 AliMFTSegmentation.h:20
 AliMFTSegmentation.h:21
 AliMFTSegmentation.h:22
 AliMFTSegmentation.h:23
 AliMFTSegmentation.h:24
 AliMFTSegmentation.h:25
 AliMFTSegmentation.h:26
 AliMFTSegmentation.h:27
 AliMFTSegmentation.h:28
 AliMFTSegmentation.h:29
 AliMFTSegmentation.h:30
 AliMFTSegmentation.h:31
 AliMFTSegmentation.h:32
 AliMFTSegmentation.h:33
 AliMFTSegmentation.h:34
 AliMFTSegmentation.h:35
 AliMFTSegmentation.h:36
 AliMFTSegmentation.h:37
 AliMFTSegmentation.h:38
 AliMFTSegmentation.h:39
 AliMFTSegmentation.h:40
 AliMFTSegmentation.h:41
 AliMFTSegmentation.h:42
 AliMFTSegmentation.h:43
 AliMFTSegmentation.h:44
 AliMFTSegmentation.h:45
 AliMFTSegmentation.h:46
 AliMFTSegmentation.h:47
 AliMFTSegmentation.h:48
 AliMFTSegmentation.h:49
 AliMFTSegmentation.h:50
 AliMFTSegmentation.h:51
 AliMFTSegmentation.h:52
 AliMFTSegmentation.h:53
 AliMFTSegmentation.h:54
 AliMFTSegmentation.h:55
 AliMFTSegmentation.h:56
 AliMFTSegmentation.h:57
 AliMFTSegmentation.h:58
 AliMFTSegmentation.h:59
 AliMFTSegmentation.h:60
 AliMFTSegmentation.h:61
 AliMFTSegmentation.h:62
 AliMFTSegmentation.h:63
 AliMFTSegmentation.h:64
 AliMFTSegmentation.h:65
 AliMFTSegmentation.h:66
 AliMFTSegmentation.h:67
 AliMFTSegmentation.h:68
 AliMFTSegmentation.h:69
 AliMFTSegmentation.h:70
 AliMFTSegmentation.h:71
 AliMFTSegmentation.h:72
 AliMFTSegmentation.h:73
 AliMFTSegmentation.h:74
 AliMFTSegmentation.h:75