]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSOnlineSPDscanMultiple.cxx
bugfix: stopwatches for HLT benchmarks had been resumed at wrong point and measuremen...
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscanMultiple.cxx
CommitLineData
b15de2d2 1////////////////////////////////////////////////////////////
2// Author: Henrik Tydesjo //
3// Interface class to the containers of an online scan //
4// with multiple steps. //
5////////////////////////////////////////////////////////////
6
7#include <TFile.h>
8#include "AliITSOnlineSPDscanMultiple.h"
9#include "AliITSOnlineSPDscanInfoMultiple.h"
10
b15de2d2 11AliITSOnlineSPDscanMultiple::AliITSOnlineSPDscanMultiple():AliITSOnlineSPDscan(){
12// Default constructor
13}
53ae21ce 14AliITSOnlineSPDscanMultiple::AliITSOnlineSPDscanMultiple(const Char_t *fileName) {
b15de2d2 15 // constructor
53ae21ce 16 fFileName=fileName;
b15de2d2 17 // look for a previously saved info object
18 // (if file not found create a new one and return, else read)
53ae21ce 19 FILE* fp0 = fopen(fFileName.Data(), "r");
b15de2d2 20 if (fp0 == NULL) {
21 fScanInfo = new AliITSOnlineSPDscanInfoMultiple();
53ae21ce 22 fFile = new TFile(fFileName.Data(), "RECREATE");
b15de2d2 23 fWrite=kTRUE;
24 }
25 else {
26 fclose(fp0);
53ae21ce 27 fFile = new TFile(fFileName.Data(), "READ");
b15de2d2 28 fWrite=kFALSE;
29 fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
30 }
31 Init();
32}
33
34AliITSOnlineSPDscanMultiple::AliITSOnlineSPDscanMultiple(const AliITSOnlineSPDscanMultiple& scan) :
35 AliITSOnlineSPDscan(scan)
36{}
37
38AliITSOnlineSPDscanMultiple::~AliITSOnlineSPDscanMultiple() {}
39
40AliITSOnlineSPDscanMultiple& AliITSOnlineSPDscanMultiple::operator=(const AliITSOnlineSPDscanMultiple& scan) {
41 // Assignment operator, should not be called!!!
42 printf("This object should not be copied!");
43 if (this!=&scan) {
44 // still do nothing...
45 }
46 return *this;
47}
48
b15de2d2 49UInt_t AliITSOnlineSPDscanMultiple::AddScanStep() {
50 CreateNewStep();
51 return ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->AddScanStep();
52}
53
54void AliITSOnlineSPDscanMultiple::SetDacId(Int_t val) {
55 ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->SetDacId(val);
56 fInfoModified=kTRUE;
57}
58void AliITSOnlineSPDscanMultiple::SetDacValue(UInt_t nsi, Int_t val) {
59 // set dac value for step nsi
60 SwitchToStep(nsi);
61 ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->SetDacValue(nsi,val);
62 fInfoModified=kTRUE;
63}
64Int_t AliITSOnlineSPDscanMultiple::GetDacId() {
65 return ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->GetDacId();
66}
67Int_t AliITSOnlineSPDscanMultiple::GetDacValue(UInt_t nsi) {
68 return ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->GetDacValue(nsi);
69}