DA for calibrating energy by pi0 and MIP and related classes (Hisayuki Torii).
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDATreeCluster.h
CommitLineData
12f6dd57 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 AliPHOSDATreeCluster_H
10#define AliPHOSDATreeCluster_H
11
12#include <iostream>
13#include "AliPHOSDATreeDigit.h"
14
15class AliPHOSDATreeCluster{
16
17 friend std::ostream& operator<<(std::ostream& out,const AliPHOSDATreeCluster& cluster);
18
19 public:
20
21 //AliPHOSDATreeCluster():fEnergy(0),fX(0),fY(0),fZ(0),fNDigits(0),fDigits(0){/**/};
22 //AliPHOSDATreeCluster(float energy,float x,float y,float z):fEnergy(energy),fX(x),fY(y),fZ(z),fNDigits(0),fDigits(0){/**/};
23 //void Set(float energy,float x,float y,float z){fEnergy=energy; fX=x; fY=y; fZ=z;};
24 //float GetX(){ return fX; };
25 //float GetY(){ return fY; };
26 //float GetZ(){ return fZ; };
27 AliPHOSDATreeCluster():fEnergy(0),fRow(-100),fCol(-100),fNDigits(0),fDigits(0){/**/};
28 AliPHOSDATreeCluster(float energy,float row,float col):fEnergy(energy),fRow(row),fCol(col),fNDigits(0),fDigits(0){/**/};
29 virtual ~AliPHOSDATreeCluster(){ if(fNDigits>0) delete[] fDigits; };
30 AliPHOSDATreeCluster(const AliPHOSDATreeCluster& cluster);
31 AliPHOSDATreeCluster& operator=(const AliPHOSDATreeCluster& cluster);
32 void Set(float energy,float row,float col){fEnergy=energy; fRow=row; fCol=col; };
33 void SetEnergy(float energy){fEnergy=energy;};
34 float GetEnergy() const{ return fEnergy; };
35 float GetRow() const{ return fRow; };
36 float GetCol() const{ return fCol; };
37 bool CalculateProperty();
38 int GetNDigits() const{ return fNDigits; };
39 AliPHOSDATreeDigit& GetDigit(int ndigit){
40 if( ndigit >= 0 && ndigit < fNDigits ) return fDigits[ndigit];
41 else std::cout<<" AliPHOSDATreeCluster::GetDigit("<<ndigit<<")::Error. Out of range > "<<fNDigits<<std::endl;
42 };
43 AliPHOSDATreeDigit& GetMaxDigit(){
44 if( fNDigits >= 0 ) return fDigits[0];
45 else std::cout<<" AliPHOSDATreeCluster::GetMaxDigit()::Warning No digit information."<<std::endl;
46 };
47 bool Append(AliPHOSDATreeDigit& digit);
48 bool Append(AliPHOSDATreeCluster& cluster);
49 bool IsNeighbor(const AliPHOSDATreeDigit& digit) const;
50 bool IsNeighbor(const AliPHOSDATreeCluster& cluster) const;
51 void Reset();
52 void Print(char* opt="");
53
54 private:
55
56 float fEnergy; // Energy in GeV
57 float fRow; // PHOS Internal Coordinates, 0 - 63
58 float fCol; // PHOS Internal Coordinates, 0 - 55
59 //float fX, fY, fZ;
60 int fNDigits; // Number of digits
61 AliPHOSDATreeDigit* fDigits; //[fNDigits]
62
63 ClassDef(AliPHOSDATreeCluster,1) // Simple Cluster Structure for PHOS DA
64};
65
66#endif