]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDscan.h
New SPD pre-processor (H. Tydesjo)
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscan.h
1 #ifndef ALI_ITS_ONLINESPDSCAN_H
2 #define ALI_ITS_ONLINESPDSCAN_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 <Rtypes.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){}
26   AliITSOnlineSPDscan(Char_t *fileName);
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     SetTriggers(UInt_t nsi, UInt_t val);
38   void     SetChipPresent(UInt_t hs, UInt_t chipi, Bool_t val);
39   void     SetRowStart(UInt_t val);
40   void     SetRowEnd(UInt_t val);
41   void     SetDacStart(UInt_t val);
42   void     SetDacEnd(UInt_t val);
43   void     SetDacStep(UInt_t val);
44
45   void     SetHits(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi, UInt_t val);
46   void     IncrementTriggers(UInt_t nsi);
47   void     IncrementHits(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
48   void     SetHitEvents(UInt_t nsi, UInt_t hs, UInt_t chipi, Int_t val);
49   void     SetHitEventsTot(UInt_t nsi, UInt_t hs, Int_t val);
50   void     IncrementHitEvents(UInt_t nsi, UInt_t hs, UInt_t chipi);
51   void     IncrementHitEventsTot(UInt_t nsi, UInt_t hs);
52   // GET METHODS ***********************************
53   UInt_t   GetNSteps() const;
54   UInt_t   GetType() const;
55   UInt_t   GetRunNr() const;
56   UInt_t   GetRouterNr() const;
57   UInt_t   GetTriggers(UInt_t nsi) const;
58   Bool_t   GetChipPresent(UInt_t hs, UInt_t chipi) const;
59   UInt_t   GetRowStart() const;
60   UInt_t   GetRowEnd() const;
61   UInt_t   GetDacStart() const;
62   UInt_t   GetDacEnd() const;
63   UInt_t   GetDacStep() const;
64
65   UInt_t   GetHits(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
66   Float_t  GetHitsEfficiency(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
67   Float_t  GetHitsEfficiencyError(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
68   UInt_t   GetHitEvents(UInt_t nsi, UInt_t hs, UInt_t chipi);
69   UInt_t   GetHitEventsTot(UInt_t nsi, UInt_t hs);
70   Float_t  GetHitEventsEfficiency(UInt_t nsi, UInt_t hs, UInt_t chipi);
71   Float_t  GetHitEventsTotEfficiency(UInt_t nsi, UInt_t hs);
72   Float_t  GetHitEventsEfficiencyError(UInt_t nsi, UInt_t hs, UInt_t chipi);
73   Float_t  GetHitEventsTotEfficiencyError(UInt_t nsi, UInt_t hs);
74   Float_t  GetAverageMultiplicity(UInt_t nsi, UInt_t hs, UInt_t chipi);
75   Float_t  GetAverageMultiplicityTot(UInt_t nsi, UInt_t hs);
76
77  protected:
78   TFile    *fFile;                  // file to read and write from
79   Bool_t   fWrite;                  // is file opened for writing?
80   Int_t    fCurrentStep;            // index of current step (kept in memory)
81   Bool_t   fModified;               // is the current step modified (needs saving)?
82   Bool_t   fInfoModified;           // is the overall scan information modified (needs saving)?
83   AliITSOnlineSPDscanInfo *fScanInfo;           // overall scan information
84   AliITSOnlineSPDHitArray *fCurrentHitArray[6]; // hit array, one for each halfstave
85   AliITSOnlineSPDHitEvent *fCurrentHitEvent[6]; // hit events, one for each halfstave
86   Char_t   fFileName[200];                      // filename of file to read write
87
88   void     Init();
89   void     CreateNewStep();
90   void     SwitchToStep(UInt_t nsi);
91   void     FillGap(UInt_t nsi);
92   void     ReadCurrentStep();
93   void     SaveCurrentStep();
94   
95 };
96
97 #endif