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

/* $Id: AliTPCROC.h,v */

//////////////////////////////////////////////////
//                                              //
//  TPC geometry class for   ROC                //
//                                              //
//////////////////////////////////////////////////

#include <TObject.h>

//_____________________________________________________________________________
class AliTPCROC : public TObject {
 public:
  static AliTPCROC* Instance();
  AliTPCROC();
  AliTPCROC(const AliTPCROC &roc);
  AliTPCROC &operator = (const AliTPCROC & roc); //assignment operator
  void Init(); 
  virtual           ~AliTPCROC();
  void GetPositionLocal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos);
  void GetPositionGlobal(UInt_t sector, UInt_t row, UInt_t pad, Float_t *pos);
  //
  //    numbering
  UInt_t GetNSectors() const          { return fNSectorsAll;}
  UInt_t GetNRows(UInt_t sector) const { return (sector<fNSectors[1]) ? fNRows[0]:fNRows[1];}
  UInt_t GetNChannels(UInt_t sector) const { return (sector<fNSectors[1]) ? fNChannels[0]:fNChannels[1];}
  UInt_t GetNPads(UInt_t sector,UInt_t row) const { 
    UInt_t irow=(row<GetNRows(sector))?row:(GetNRows(sector)-1);
    return (sector<fNSectors[1]) ? fNPads[0][irow]:fNPads[1][irow];}
  const UInt_t * GetRowIndexes(UInt_t sector) const {return (sector<fNSectors[1]) ? fRowPosIndex[0]:fRowPosIndex[1];}  
  //
  //get sector parameters
  //
  Float_t  GetInnerRadiusLow() const {return fInnerRadiusLow;}
  Float_t  GetInnerRadiusUp() const {return fInnerRadiusUp;} 
  Float_t  GetOuterRadiusLow() const {return fOuterRadiusLow;} 
  Float_t  GetOuterRadiusUp() const {return fOuterRadiusUp;} 
  Float_t  GetInnerFrameSpace() const {return fInnerFrameSpace;}
  Float_t  GetOuterFrameSpace() const {return fOuterFrameSpace;}
  Float_t  GetInnerWireMount() const {return fInnerWireMount;}
  Float_t  GetOuterWireMount() const {return fOuterWireMount;}
  Float_t  GetInnerAngle() const {return fInnerAngle;}
  Float_t  GetOuterAngle() const {return fOuterAngle;}
  UInt_t    GetNInnerSector() const {return fNSectors[0];}
  UInt_t    GetNOuterSector() const {return fNSectors[1];}
  UInt_t    GetNSector() const {return fNSectorsAll;}
  Float_t  GetZLength(Int_t sector) const {return (sector<35) ? fZLength-0.275 : fZLength-0.302;}
  //
  // get pad row parameters
  //
  Float_t GetPadRowRadiiLow(UInt_t irow) const {return ( irow<fNRowLow ) ? fPadRowLow[irow]: 0;} //get the pad row (irow) radii
  Float_t GetPadRowRadiiUp(UInt_t irow) const {return ( irow<fNRowUp ) ? fPadRowUp[irow]: 0;}   //get the pad row (irow) radii   
  Float_t GetPadRowRadii(UInt_t isec, UInt_t irow) const {
    return ( (isec < fNSectors[0]) ?GetPadRowRadiiLow(irow):GetPadRowRadiiUp(irow));}
  //
  static UInt_t GetTPCUniqueID(UInt_t sector, UInt_t row, UInt_t pad){UInt_t uid=pad+row*140+sector*140*159; return uid; }  // unique Id can be used for absolute adressing of the TPC element 
protected:
  //
  //     number of pads
  //
  void   SetGeometry();    // set geometry parameters
  UInt_t  fNSectorsAll;     // number of sectors
  UInt_t  fNSectors[2];     // number of sectors - inner outer
  UInt_t  fNRows[2];        // number of row     - inner outer
  UInt_t  fNChannels[2];    // total number of pads   - inner sector - outer sector
  UInt_t *fNPads[2];        // number of pads in row  - inner - outer      
  UInt_t *fRowPosIndex[2];  // index array            - inner - outer
  //
  //
  //---------------------------------------------------------------------
  //   ALICE TPC sector geometry
  //--------------------------------------------------------------------  
  Float_t fInnerRadiusLow;    // lower radius of inner sector-IP
  Float_t fInnerRadiusUp;     // upper radius of inner  sector-IP
  Float_t fOuterRadiusUp;     // upper radius of outer  sector-IP
  Float_t fOuterRadiusLow;    // lower radius of outer sector-IP
  Float_t fInnerFrameSpace;   //space for inner frame in the phi direction 
  Float_t fOuterFrameSpace;   //space for outer frame in the phi direction 
  Float_t fInnerWireMount;    //space for wire mount, inner sector
  Float_t fOuterWireMount;    //space for wire mount, outer sector
  Float_t fZLength;           //length of the drift region of the TPC
  Float_t fInnerAngle;        //angular coverage
  Float_t fOuterAngle;        //angular coverage
  //
  //---------------------------------------------------------------------
  //   ALICE TPC wires  geometry - for GEM we can consider that it is gating  
  //--------------------------------------------------------------------
  UInt_t   fNInnerWiresPerPad; //Number of wires per pad
  Float_t fInnerWWPitch;      //pitch between wires  in inner sector     - calculated
  UInt_t   fInnerDummyWire;    //number of wires without pad readout
  Float_t fInnerOffWire;      //oofset of first wire to the begining of the sector
  Float_t fRInnerFirstWire;   //position of the first wire                -calculated
  Float_t fRInnerLastWire;    //position of the last wire                 -calculated
  Float_t fLastWireUp1;     //position of the last wire in outer1 sector
  UInt_t   fNOuter1WiresPerPad; //Number of wires per pad
  UInt_t   fNOuter2WiresPerPad; // Number of wires per pad
  Float_t fOuterWWPitch;      //pitch between wires in outer sector      -calculated
  UInt_t   fOuterDummyWire;    //number of wires without pad readout
  Float_t fOuterOffWire;      //oofset of first wire to the begining of the sector
  Float_t fROuterFirstWire;   //position of the first wire                -calulated
  Float_t fROuterLastWire;    //position of the last wire                 -calculated 
  //---------------------------------------------------------------------
  //   ALICE TPC pad parameters
  //--------------------------------------------------------------------
  Float_t   fInnerPadPitchLength;    //Inner pad pitch length
  Float_t   fInnerPadPitchWidth;     //Inner pad pitch width
  Float_t   fInnerPadLength;         //Inner pad  length
  Float_t   fInnerPadWidth;          //Inner pad  width
  Float_t   fOuter1PadPitchLength;    //Outer pad pitch length
  Float_t   fOuter2PadPitchLength;    //Outer pad pitch length
  Float_t   fOuterPadPitchWidth;     //Outer pad pitch width
  Float_t   fOuter1PadLength;         //Outer pad  length
  Float_t   fOuter2PadLength;         //Outer pad length
  Float_t   fOuterPadWidth;          //Outer pad  width
  // 
  UInt_t     fNRowLow;           //number of pad rows per low sector        -set
  UInt_t     fNRowUp1;            //number of short pad rows per sector up  -set
  UInt_t     fNRowUp2;            //number of long pad rows per sector up   -set
  UInt_t     fNRowUp;            //number of pad rows per sector up     -calculated
  UInt_t     fNtRows;            //total number of rows in TPC          -calculated
  Float_t   fPadRowLow[100]; //Lower sector, pad row radii          -calculated
  Float_t   fPadRowUp[100];  //Upper sector, pad row radii          -calculated 
  UInt_t     fNPadsLow[100];  //Lower sector, number of pads per row -calculated
  UInt_t     fNPadsUp[100];   //Upper sector, number of pads per row -calculated
  Float_t   fYInner[100];     //Inner sector, wire-length
  Float_t   fYOuter[100];     //Outer sector, wire-length   
 protected:
  static AliTPCROC*   fgInstance; //! Instance of this class (singleton implementation)
  ClassDef(AliTPCROC,0)    //  TPC ROC class
};

#endif
 AliTPCROC.h:1
 AliTPCROC.h:2
 AliTPCROC.h:3
 AliTPCROC.h:4
 AliTPCROC.h:5
 AliTPCROC.h:6
 AliTPCROC.h:7
 AliTPCROC.h:8
 AliTPCROC.h:9
 AliTPCROC.h:10
 AliTPCROC.h:11
 AliTPCROC.h:12
 AliTPCROC.h:13
 AliTPCROC.h:14
 AliTPCROC.h:15
 AliTPCROC.h:16
 AliTPCROC.h:17
 AliTPCROC.h:18
 AliTPCROC.h:19
 AliTPCROC.h:20
 AliTPCROC.h:21
 AliTPCROC.h:22
 AliTPCROC.h:23
 AliTPCROC.h:24
 AliTPCROC.h:25
 AliTPCROC.h:26
 AliTPCROC.h:27
 AliTPCROC.h:28
 AliTPCROC.h:29
 AliTPCROC.h:30
 AliTPCROC.h:31
 AliTPCROC.h:32
 AliTPCROC.h:33
 AliTPCROC.h:34
 AliTPCROC.h:35
 AliTPCROC.h:36
 AliTPCROC.h:37
 AliTPCROC.h:38
 AliTPCROC.h:39
 AliTPCROC.h:40
 AliTPCROC.h:41
 AliTPCROC.h:42
 AliTPCROC.h:43
 AliTPCROC.h:44
 AliTPCROC.h:45
 AliTPCROC.h:46
 AliTPCROC.h:47
 AliTPCROC.h:48
 AliTPCROC.h:49
 AliTPCROC.h:50
 AliTPCROC.h:51
 AliTPCROC.h:52
 AliTPCROC.h:53
 AliTPCROC.h:54
 AliTPCROC.h:55
 AliTPCROC.h:56
 AliTPCROC.h:57
 AliTPCROC.h:58
 AliTPCROC.h:59
 AliTPCROC.h:60
 AliTPCROC.h:61
 AliTPCROC.h:62
 AliTPCROC.h:63
 AliTPCROC.h:64
 AliTPCROC.h:65
 AliTPCROC.h:66
 AliTPCROC.h:67
 AliTPCROC.h:68
 AliTPCROC.h:69
 AliTPCROC.h:70
 AliTPCROC.h:71
 AliTPCROC.h:72
 AliTPCROC.h:73
 AliTPCROC.h:74
 AliTPCROC.h:75
 AliTPCROC.h:76
 AliTPCROC.h:77
 AliTPCROC.h:78
 AliTPCROC.h:79
 AliTPCROC.h:80
 AliTPCROC.h:81
 AliTPCROC.h:82
 AliTPCROC.h:83
 AliTPCROC.h:84
 AliTPCROC.h:85
 AliTPCROC.h:86
 AliTPCROC.h:87
 AliTPCROC.h:88
 AliTPCROC.h:89
 AliTPCROC.h:90
 AliTPCROC.h:91
 AliTPCROC.h:92
 AliTPCROC.h:93
 AliTPCROC.h:94
 AliTPCROC.h:95
 AliTPCROC.h:96
 AliTPCROC.h:97
 AliTPCROC.h:98
 AliTPCROC.h:99
 AliTPCROC.h:100
 AliTPCROC.h:101
 AliTPCROC.h:102
 AliTPCROC.h:103
 AliTPCROC.h:104
 AliTPCROC.h:105
 AliTPCROC.h:106
 AliTPCROC.h:107
 AliTPCROC.h:108
 AliTPCROC.h:109
 AliTPCROC.h:110
 AliTPCROC.h:111
 AliTPCROC.h:112
 AliTPCROC.h:113
 AliTPCROC.h:114
 AliTPCROC.h:115
 AliTPCROC.h:116
 AliTPCROC.h:117
 AliTPCROC.h:118
 AliTPCROC.h:119
 AliTPCROC.h:120
 AliTPCROC.h:121
 AliTPCROC.h:122
 AliTPCROC.h:123
 AliTPCROC.h:124
 AliTPCROC.h:125
 AliTPCROC.h:126
 AliTPCROC.h:127
 AliTPCROC.h:128
 AliTPCROC.h:129
 AliTPCROC.h:130
 AliTPCROC.h:131
 AliTPCROC.h:132
 AliTPCROC.h:133
 AliTPCROC.h:134
 AliTPCROC.h:135
 AliTPCROC.h:136
 AliTPCROC.h:137