AddTaskFemto for train update
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscan.h
CommitLineData
71abf6b7 1#ifndef ALIITSONLINESPDSCAN_H
2#define ALIITSONLINESPDSCAN_H
b15de2d2 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
53ae21ce 15#include <TString.h>
b15de2d2 16
17class TFile;
18class AliITSOnlineSPDscanInfo;
19class AliITSOnlineSPDHitArray;
20class AliITSOnlineSPDHitEvent;
21
22class AliITSOnlineSPDscan {
23
24 public:
f84d7d19 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;}}
6ddf3d66 26 AliITSOnlineSPDscan(const Char_t *fileName, Bool_t readFromGridFile=kFALSE);
b15de2d2 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);
ad18504e 37 void SetHalfStaveScanned(UInt_t val, Bool_t b);
38 void SetDataFormat(UInt_t val);
b15de2d2 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);
53ae21ce 46 void SetDCSVersion(UInt_t val);
b15de2d2 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;
ad18504e 60 Bool_t GetHalfStaveScanned(UInt_t val) const;
61 UInt_t GetDataFormat() const;
b15de2d2 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;
53ae21ce 69 UInt_t GetDCSVersion() const;
b15de2d2 70
71abf6b7 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) ;
b15de2d2 73 Float_t GetHitsEfficiencyError(UInt_t nsi, UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi);
71abf6b7 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) ;
b15de2d2 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
53ae21ce 92 TString fFileName; // filename of file to read write
b15de2d2 93
94 void Init();
95 void CreateNewStep();
71abf6b7 96 void SwitchToStep(UInt_t nsi) ;
b15de2d2 97 void FillGap(UInt_t nsi);
98 void ReadCurrentStep();
99 void SaveCurrentStep();
100
101};
102
103#endif