Line data Source code
1 : #ifndef ALIITSONLINESPDFO_H
2 : #define ALIITSONLINESPDFO_H
3 : /* Copyright(c) 2008-2010, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id$ */
7 : ////////////////////////////////////////////////////////////////
8 : // Author: A. Mastroserio //
9 : // This class is used within the detector algorithm framework //
10 : // to write and read FO scan data. //
11 : ////////////////////////////////////////////////////////////////
12 :
13 : #include <TString.h>
14 : #include <THashList.h>
15 :
16 : class TFile;
17 : class TArrayS;
18 : class AliITSOnlineSPDfoInfo;
19 :
20 : class AliITSOnlineSPDfo {
21 :
22 : public:
23 : AliITSOnlineSPDfo();//ctor
24 : AliITSOnlineSPDfo(TString inputfile, Int_t runNr, Int_t eqId);
25 : AliITSOnlineSPDfo(const AliITSOnlineSPDfo &c);
26 :
27 0 : virtual ~AliITSOnlineSPDfo(){ delete fArray; delete fDACnames;} //dctor
28 :
29 : enum {kFOPOL=0, kCONVPOL=1, kCOMPREF=2, kCGPOL =3, kPreVTH=4, kIdFOPOL=20, kIdCONVPOL=17, kIdCOMPREF=16, kIdCGPOL=14, kIdPreVTH=39};
30 :
31 : // GENERAL METHODS
32 : void AddMeasurement(const TArrayS dac, Short_t measure[3], Int_t hs, Int_t chipId);
33 : Int_t CheckDACEntry(const TArrayS dac);
34 : TString CreateDACEntry(const TArrayS dacs) const;
35 : TArrayS CreateDACArray(const TArrayS dacs, const TArrayS dacId) const;
36 : void CreateOutputFile();
37 : void WriteToFile();
38 :
39 : // SETTER
40 0 : void SetNdacs(UInt_t ndacs) {fNdacs=ndacs;}
41 0 : void SetFOscanParams(AliITSOnlineSPDfoInfo *info) {fInfo=info;}
42 : void SetFile(TString inputfile);
43 0 : void SetDACArray(TObjArray *obj) {if(!fArray) fArray = obj; else printf("The fArray is alreay available, no need to set it again.\n");}
44 :
45 : // GETTER
46 0 : TFile* GetFile() const {return fFile;}
47 0 : UInt_t GetNdacs() const {return fNdacs;}
48 :
49 0 : TObjArray *GetDACArray() const {return fArray;}
50 0 : THashList * GetDACnameList() const {return fDACnames;}
51 :
52 : TArrayI GetDACscanParams() const; // retrieves per each DAC the range and the step used in the scan
53 0 : AliITSOnlineSPDfoInfo * GetFOscanInfo() const {return fInfo;}
54 : Int_t *GetDACvalues(TString s, const Int_t ndacs) const; // translates the string in the corresponding DACS // the user has to delete the pointer after use!
55 : Double_t *GetDACvaluesD(TString s, const Int_t ndacs) const; // translates the string in the corresponding DACS
56 :
57 :
58 : protected:
59 : Int_t fRunNr;
60 : Int_t fNdacs;
61 : TString fFileName;
62 : TFile *fFile;
63 : AliITSOnlineSPDfoInfo *fInfo;
64 : THashList *fDACnames;
65 : TObjArray *fArray; // array of the 10 chips in the 6 HS per DAC set
66 : Double_t fCheckIndex; // check array index (to speed up)
67 : Int_t fIndex;
68 : TString fInitialConfiguration;
69 :
70 : private:
71 : AliITSOnlineSPDfo& operator= (const AliITSOnlineSPDfo& c);
72 :
73 116 : ClassDef(AliITSOnlineSPDfo,1)
74 : };
75 :
76 : #endif
|