]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSDATreeDigit.h
Merge branch 'master_patch'
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDATreeDigit.h
1 #ifndef AliPHOSDATreeDigit_H
2 #define AliPHOSDATreeDigit_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 // --
9 // --
10 // Implementation for TTree output in PHOS DA
11 // for calibrating energy by pi0 and MIP.
12 // --
13 // -- Author: Hisayuki Torii (Hiroshima Univ.)
14 // --
15
16 class AliPHOSDATreeDigit {
17
18   friend std::ostream& operator<<(std::ostream& out,const AliPHOSDATreeDigit& digit);
19
20  public:
21
22   AliPHOSDATreeDigit():fEnergy(0),fAbsId(-1){/**/};
23   AliPHOSDATreeDigit(float energy,int row,int col):fEnergy(energy),fAbsId(row*56+col){/**/};
24   AliPHOSDATreeDigit(float energy,short absid):fEnergy(energy),fAbsId(absid){/**/};
25   virtual ~AliPHOSDATreeDigit(){/**/};
26   void Set(float energy,int row,int col){fEnergy=energy; fAbsId = row*56 + col;};
27   void Set(float energy,short absid){fEnergy=energy; fAbsId = absid;};
28   void SetEnergy(float energy){ fEnergy=energy; };
29   float GetEnergy() const{return fEnergy;};
30   int GetCol() const{return fAbsId % 56; };     // 0 - 55 : col( z ) number
31   int GetRow() const{return (int) fAbsId/56; }; // 0 - 63 : row( x ) number
32   short GetAbsId() const{return fAbsId; };
33   short GetDigitId() const{return fAbsId; };
34   bool IsValid() const { if( fAbsId>=0 && fAbsId < 3584 ) return true; return false; };
35   bool IsNeighbor(const AliPHOSDATreeDigit &digit) const;
36   void Print(Option_t *opt="") const;
37
38   //AliPHOSDATreeDigit(float energy,int mod,int row,int col):fEnergy(energy),fAbsId(mod*3584+row*56+col){/**/};
39   //void Set(float energy,int mod,int row,int col){
40   //fEnergy=energy; fAbsId = mod * 3584 + row*56 + col;};
41   //int GetMod(){return (int)(fAbsId/3584); };      // 0 -  4 : module number
42   //int GetCol(){return (fAbsId%3584) % 56; };      // 0 - 55 : col( z ) number
43   //int GetRow(){return (int)(fAbsId%3584) / 56; }; // 0 - 63 : row( x ) number
44   //bool IsValid(){ if( fAbsId>=0 && fAbsId < 17920 ) return true; return false; };
45
46  private:
47
48   float fEnergy; // Energy in GeV
49   short fAbsId;  // col + row * 56 [+mod*3584 in some cases]
50
51   ClassDef(AliPHOSDATreeDigit,1) // Simple Digit Structure for PHOS DA
52 };
53
54 #endif