#ifndef ALI_ITS_ONLINESPDPHYS_H
#define ALI_ITS_ONLINESPDPHYS_H
#include <TString.h>
class TFile;
class AliITSOnlineSPDphysInfo;
class AliITSOnlineSPDHitArray;
class AliITSOnlineSPDphys {
public:
AliITSOnlineSPDphys():fFile(NULL),fWrite(kFALSE),fModified(kFALSE),fInfoModified(kFALSE),fPhysInfo(NULL),fFileName("."){for(Int_t ihs=0; ihs<6; ihs++) fHitArray[ihs]=0x0;}
AliITSOnlineSPDphys(const Char_t *fileName, Bool_t readFromGridFile=kFALSE);
AliITSOnlineSPDphys(const AliITSOnlineSPDphys& phys);
virtual ~AliITSOnlineSPDphys();
AliITSOnlineSPDphys& operator=(const AliITSOnlineSPDphys& phys);
virtual void AddPhys(AliITSOnlineSPDphys* phys2);
virtual void ClearThis();
void InitializeHitMap() {InitHitmap();}
void AddRunNr(UInt_t val);
void SetEqNr(UInt_t val);
void SetNrEvents(UInt_t val);
void AddNrEvents(Int_t val);
void IncrementNrEvents();
void SetHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi, UInt_t val);
void AddHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi, Int_t val);
void IncrementHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
UInt_t GetNrRuns() const;
UInt_t GetRunNr(UInt_t posi) const;
UInt_t GetEqNr() const;
UInt_t GetNrEvents() const;
UInt_t GetHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
Float_t GetHitsEfficiency(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
Float_t GetHitsEfficiencyError(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
Float_t GetAverageMultiplicity(UInt_t hs, UInt_t chipi);
Float_t GetAverageMultiplicityTot(UInt_t hs);
protected:
TFile *fFile;
Bool_t fWrite;
Bool_t fModified;
Bool_t fInfoModified;
AliITSOnlineSPDphysInfo *fPhysInfo;
AliITSOnlineSPDHitArray *fHitArray[6];
TString fFileName;
void InitHitmap();
void ReadHitmap();
void SaveHitmap();
};
#endif