ROOT logo
#ifndef ALI_ITS_ONLINESPDPHYS_H
#define ALI_ITS_ONLINESPDPHYS_H

////////////////////////////////////////////////////////////
// Author: Henrik Tydesjo                                 //
// Interface class to the containers of an online         //
// physics run.                                           //
// Directly connected to a TFile with all containers.     //
// Handles reading and writing of this TFile. Hitmaps are //
// stored in this file (AliITSOnlineSPDHitArray).         //
// Also some general information is stored                //
// (AliITSOnlineSPDphysInfo).                             //
////////////////////////////////////////////////////////////

#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();} // online monitoring
  // SET METHODS ***********************************
  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);
  // GET METHODS ***********************************
  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;                  // file to read and write from
  Bool_t   fWrite;                  // is file opened for writing?
  Bool_t   fModified;               // is the hitmap modified (needs saving)?
  Bool_t   fInfoModified;           // is the overall phys information modified (needs saving)?
  AliITSOnlineSPDphysInfo *fPhysInfo;    // overall phys information
  AliITSOnlineSPDHitArray *fHitArray[6]; // hit array, one for each halfstave
  TString  fFileName;                    // filename of file to read write

  void     InitHitmap();
  void     ReadHitmap();
  void     SaveHitmap();
  
};

#endif
 AliITSOnlineSPDphys.h:1
 AliITSOnlineSPDphys.h:2
 AliITSOnlineSPDphys.h:3
 AliITSOnlineSPDphys.h:4
 AliITSOnlineSPDphys.h:5
 AliITSOnlineSPDphys.h:6
 AliITSOnlineSPDphys.h:7
 AliITSOnlineSPDphys.h:8
 AliITSOnlineSPDphys.h:9
 AliITSOnlineSPDphys.h:10
 AliITSOnlineSPDphys.h:11
 AliITSOnlineSPDphys.h:12
 AliITSOnlineSPDphys.h:13
 AliITSOnlineSPDphys.h:14
 AliITSOnlineSPDphys.h:15
 AliITSOnlineSPDphys.h:16
 AliITSOnlineSPDphys.h:17
 AliITSOnlineSPDphys.h:18
 AliITSOnlineSPDphys.h:19
 AliITSOnlineSPDphys.h:20
 AliITSOnlineSPDphys.h:21
 AliITSOnlineSPDphys.h:22
 AliITSOnlineSPDphys.h:23
 AliITSOnlineSPDphys.h:24
 AliITSOnlineSPDphys.h:25
 AliITSOnlineSPDphys.h:26
 AliITSOnlineSPDphys.h:27
 AliITSOnlineSPDphys.h:28
 AliITSOnlineSPDphys.h:29
 AliITSOnlineSPDphys.h:30
 AliITSOnlineSPDphys.h:31
 AliITSOnlineSPDphys.h:32
 AliITSOnlineSPDphys.h:33
 AliITSOnlineSPDphys.h:34
 AliITSOnlineSPDphys.h:35
 AliITSOnlineSPDphys.h:36
 AliITSOnlineSPDphys.h:37
 AliITSOnlineSPDphys.h:38
 AliITSOnlineSPDphys.h:39
 AliITSOnlineSPDphys.h:40
 AliITSOnlineSPDphys.h:41
 AliITSOnlineSPDphys.h:42
 AliITSOnlineSPDphys.h:43
 AliITSOnlineSPDphys.h:44
 AliITSOnlineSPDphys.h:45
 AliITSOnlineSPDphys.h:46
 AliITSOnlineSPDphys.h:47
 AliITSOnlineSPDphys.h:48
 AliITSOnlineSPDphys.h:49
 AliITSOnlineSPDphys.h:50
 AliITSOnlineSPDphys.h:51
 AliITSOnlineSPDphys.h:52
 AliITSOnlineSPDphys.h:53
 AliITSOnlineSPDphys.h:54
 AliITSOnlineSPDphys.h:55
 AliITSOnlineSPDphys.h:56
 AliITSOnlineSPDphys.h:57
 AliITSOnlineSPDphys.h:58
 AliITSOnlineSPDphys.h:59
 AliITSOnlineSPDphys.h:60
 AliITSOnlineSPDphys.h:61
 AliITSOnlineSPDphys.h:62
 AliITSOnlineSPDphys.h:63
 AliITSOnlineSPDphys.h:64
 AliITSOnlineSPDphys.h:65
 AliITSOnlineSPDphys.h:66
 AliITSOnlineSPDphys.h:67
 AliITSOnlineSPDphys.h:68
 AliITSOnlineSPDphys.h:69
 AliITSOnlineSPDphys.h:70
 AliITSOnlineSPDphys.h:71