]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDscan.h
warning fix
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscan.h
1 #ifndef ALIITSONLINESPDSCAN_H
2 #define ALIITSONLINESPDSCAN_H
3
4 ////////////////////////////////////////////////////////////
5 // Author: Henrik Tydesjo                                 //
6 // Interface class to the containers of an online scan.   //
7 // Directly connected to a TFile with all containers.     //
8 // Handles reading and writing of this TFile.             //
9 // Hitmaps and information on nr of events with hits      //
10 // is stored in this file (AliITSOnlineSPDHitArray and    //
11 // AliITSOnlineSPDHitEvent). Also some general            //
12 // information is stored (AliITSOnlineSPDscanInfo).       //
13 ////////////////////////////////////////////////////////////
14
15 #include <TString.h>
16
17 class TFile;
18 class AliITSOnlineSPDscanInfo;
19 class AliITSOnlineSPDHitArray;
20 class AliITSOnlineSPDHitEvent;
21
22 class AliITSOnlineSPDscan {
23
24  public:
25   AliITSOnlineSPDscan():fFile(NULL),fWrite(kFALSE),fCurrentStep(-1),fModified(kFALSE),fInfoModified(kFALSE),fScanInfo(NULL),fFileName("./test.root"){for(Int_t ihs=0; ihs<6; ihs++){fCurrentHitArray[ihs]=0x0; fCurrentHitEvent[ihs]=0x0;}}
26   AliITSOnlineSPDscan(const Char_t *fileName, Bool_t readFromGridFile=kFALSE);
27   AliITSOnlineSPDscan(const AliITSOnlineSPDscan& scan);
28   virtual ~AliITSOnlineSPDscan();
29   AliITSOnlineSPDscan& operator=(const AliITSOnlineSPDscan& scan);
30
31   virtual UInt_t     AddScanStep(); // returns the index (nsi) of the added step
32   virtual void       ClearThis();       // clear all steps
33   // SET METHODS ***********************************
34   void     SetType(UInt_t val);
35   void     SetRunNr(UInt_t val);
36   void     SetRouterNr(UInt_t val);
37   void     SetHalfStaveScanned(UInt_t val, Bool_t b);
38   void     SetDataFormat(UInt_t val);
39   void     SetTriggers(UInt_t nsi, UInt_t val);
40   void     SetChipPresent(UInt_t hs, UInt_t chipi, Bool_t val);
41   void     SetRowStart(UInt_t val);
42   void     SetRowEnd(UInt_t val);
43   void     SetDacStart(UInt_t val);
44   void     SetDacEnd(UInt_t val);
45   void     SetDacStep(UInt_t val);
46   void     SetDCSVersion(UInt_t val);
47
48   void     SetHits(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi, UInt_t val);
49   void     IncrementTriggers(UInt_t nsi);
50   void     IncrementHits(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
51   void     SetHitEvents(UInt_t nsi, UInt_t hs, UInt_t chipi, Int_t val);
52   void     SetHitEventsTot(UInt_t nsi, UInt_t hs, Int_t val);
53   void     IncrementHitEvents(UInt_t nsi, UInt_t hs, UInt_t chipi);
54   void     IncrementHitEventsTot(UInt_t nsi, UInt_t hs);
55   // GET METHODS ***********************************
56   UInt_t   GetNSteps() const;
57   UInt_t   GetType() const;
58   UInt_t   GetRunNr() const;
59   UInt_t   GetRouterNr() const;
60   Bool_t   GetHalfStaveScanned(UInt_t val) const;
61   UInt_t   GetDataFormat() const;
62   UInt_t   GetTriggers(UInt_t nsi) const;
63   Bool_t   GetChipPresent(UInt_t hs, UInt_t chipi) const;
64   UInt_t   GetRowStart() const;
65   UInt_t   GetRowEnd() const;
66   UInt_t   GetDacStart() const;
67   UInt_t   GetDacEnd() const;
68   UInt_t   GetDacStep() const;
69   UInt_t   GetDCSVersion() const;
70
71   UInt_t   GetHits(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi) ;
72   Float_t  GetHitsEfficiency(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi) ;
73   Float_t  GetHitsEfficiencyError(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
74   UInt_t   GetHitEvents(UInt_t nsi, UInt_t hs, UInt_t chipi) ;
75   UInt_t   GetHitEventsTot(UInt_t nsi, UInt_t hs) ;
76   Float_t  GetHitEventsEfficiency(UInt_t nsi, UInt_t hs, UInt_t chipi) ;
77   Float_t  GetHitEventsTotEfficiency(UInt_t nsi, UInt_t hs) ;
78   Float_t  GetHitEventsEfficiencyError(UInt_t nsi, UInt_t hs, UInt_t chipi) ;
79   Float_t  GetHitEventsTotEfficiencyError(UInt_t nsi, UInt_t hs) ;
80   Float_t  GetAverageMultiplicity(UInt_t nsi, UInt_t hs, UInt_t chipi) ;
81   Float_t  GetAverageMultiplicityTot(UInt_t nsi, UInt_t hs) ;
82
83  protected:
84   TFile    *fFile;                  // file to read and write from
85   Bool_t   fWrite;                  // is file opened for writing?
86   Int_t    fCurrentStep;            // index of current step (kept in memory)
87   Bool_t   fModified;               // is the current step modified (needs saving)?
88   Bool_t   fInfoModified;           // is the overall scan information modified (needs saving)?
89   AliITSOnlineSPDscanInfo *fScanInfo;           // overall scan information
90   AliITSOnlineSPDHitArray *fCurrentHitArray[6]; // hit array, one for each halfstave
91   AliITSOnlineSPDHitEvent *fCurrentHitEvent[6]; // hit events, one for each halfstave
92   TString  fFileName;                           // filename of file to read write
93
94   void     Init();
95   void     CreateNewStep();
96   void     SwitchToStep(UInt_t nsi) ;
97   void     FillGap(UInt_t nsi);
98   void     ReadCurrentStep();
99   void     SaveCurrentStep();
100   
101 };
102
103 #endif