]>
Commit | Line | Data |
---|---|---|
b15de2d2 | 1 | //////////////////////////////////////////////////////////// |
2 | // Author: Henrik Tydesjo // | |
3 | // Interface class to the containers of an online mean // | |
4 | // threshold scan. // | |
5 | //////////////////////////////////////////////////////////// | |
6 | ||
7 | #include <TFile.h> | |
8 | #include "AliITSOnlineSPDscanMeanTh.h" | |
9 | #include "AliITSOnlineSPDscanInfoMeanTh.h" | |
10 | ||
11 | ClassImp(AliITSOnlineSPDscanMeanTh) | |
12 | ||
13 | AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(Char_t *fileName) { | |
14 | // constructor | |
15 | sprintf(fFileName,"%s",fileName); | |
16 | // look for a previously saved info object | |
17 | // (if file not found create a new one and return, else read) | |
18 | FILE* fp0 = fopen(fFileName, "r"); | |
19 | if (fp0 == NULL) { | |
20 | fScanInfo = new AliITSOnlineSPDscanInfoMeanTh(); | |
21 | fFile = new TFile(fFileName, "RECREATE"); | |
22 | fWrite=kTRUE; | |
23 | } | |
24 | else { | |
25 | fclose(fp0); | |
26 | fFile = new TFile(fFileName, "READ"); | |
27 | fWrite=kFALSE; | |
28 | fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo); | |
29 | } | |
30 | Init(); | |
31 | } | |
32 | ||
33 | AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const AliITSOnlineSPDscanMeanTh& scan) : | |
34 | AliITSOnlineSPDscanMultiple(scan) | |
35 | {} | |
36 | ||
37 | AliITSOnlineSPDscanMeanTh::~AliITSOnlineSPDscanMeanTh() {} | |
38 | ||
39 | AliITSOnlineSPDscanMeanTh& AliITSOnlineSPDscanMeanTh::operator=(const AliITSOnlineSPDscanMeanTh& scan) { | |
40 | // assignment operator (should not be used) | |
41 | printf("This object should not be copied!"); | |
42 | if (this!=&scan) { | |
43 | // still do nothing... | |
44 | } | |
45 | return *this; | |
46 | } | |
47 | ||
48 | //void AliITSOnlineSPDscanMeanTh::ReadFromTObjArray(TObjArray *arr) { | |
49 | // ClearThis(); | |
50 | // Int_t nrEntries = arr->GetEntriesFast(); | |
51 | // if (nrEntries>0 && nrEntries%2==1) { | |
52 | // fScanInfo = (AliITSOnlineSPDscanInfoMeanTh*) arr->At(0); | |
53 | // fInfoModified=kTRUE; | |
54 | // FillFromTObjArray(arr,nrEntries); | |
55 | // } | |
56 | //} | |
57 | ||
58 | UInt_t AliITSOnlineSPDscanMeanTh::AddScanStep() { | |
59 | CreateNewStep(); | |
60 | return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->AddScanStep(); | |
61 | } | |
62 | ||
63 | void AliITSOnlineSPDscanMeanTh::SetDacLow(UInt_t nsi, UInt_t hs, Int_t val) { | |
64 | // set dac low value for step nsi and half stave hs | |
65 | SwitchToStep(nsi); | |
66 | ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetDacLow(nsi,hs,val); | |
67 | fInfoModified=kTRUE; | |
68 | } | |
69 | void AliITSOnlineSPDscanMeanTh::SetDacHigh(UInt_t nsi, UInt_t hs, Int_t val) { | |
70 | // set dac high value for step nsi and half stave hs | |
71 | SwitchToStep(nsi); | |
72 | ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetDacHigh(nsi,hs,val); | |
73 | fInfoModified=kTRUE; | |
74 | } | |
75 | void AliITSOnlineSPDscanMeanTh::SetTPAmp(UInt_t nsi, UInt_t hs, Int_t val) { | |
76 | // set test pulse amplitude for step nsi and half stave hs | |
77 | SwitchToStep(nsi); | |
78 | ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetTPAmp(nsi,hs,val); | |
79 | fInfoModified=kTRUE; | |
80 | } | |
81 | ||
82 | Int_t AliITSOnlineSPDscanMeanTh::GetDacLow(UInt_t nsi, UInt_t hs) { | |
83 | return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacLow(nsi,hs); | |
84 | } | |
85 | Int_t AliITSOnlineSPDscanMeanTh::GetDacHigh(UInt_t nsi, UInt_t hs) { | |
86 | return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacHigh(nsi,hs); | |
87 | } | |
88 | Int_t AliITSOnlineSPDscanMeanTh::GetTPAmp(UInt_t nsi, UInt_t hs) { | |
89 | return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetTPAmp(nsi,hs); | |
90 | } |