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