1 ////////////////////////////////////////////////////////////
2 // Author: Henrik Tydesjo //
3 // Interface class to the containers of an online scan //
4 // with multiple steps. //
5 ////////////////////////////////////////////////////////////
8 #include "AliITSOnlineSPDscanMultiple.h"
9 #include "AliITSOnlineSPDscanInfoMultiple.h"
11 AliITSOnlineSPDscanMultiple::AliITSOnlineSPDscanMultiple():AliITSOnlineSPDscan(){
12 // Default constructor
14 AliITSOnlineSPDscanMultiple::AliITSOnlineSPDscanMultiple(const Char_t *fileName, Bool_t readFromGridFile) {
19 // look for a previously saved info object
20 // (if file not found create a new one and return, else read)
22 Bool_t bRead = readFromGridFile;
25 FILE* fp0 = fopen(fFileName.Data(), "r");
32 if (bRead) { // open file for reading
33 fFile = TFile::Open(fFileName.Data(), "READ");
34 if (fFile==NULL) { // grid file not found, create new local default file
35 printf("ERROR: AliITSOnlineSPDscan: File %s not found! Creating 'test999.root' file instead\n",fFileName.Data());
36 // create default empty file:
37 fFileName = "test999.root";
38 fScanInfo = new AliITSOnlineSPDscanInfoMultiple();
40 fFile = new TFile(fFileName.Data(), "RECREATE");
43 else { // read from file (grid or local)
45 fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
48 else { // create new local file
49 fScanInfo = new AliITSOnlineSPDscanInfoMultiple();
51 fFile = new TFile(fFileName.Data(), "RECREATE");
58 AliITSOnlineSPDscanMultiple::AliITSOnlineSPDscanMultiple(const AliITSOnlineSPDscanMultiple& scan) :
59 AliITSOnlineSPDscan(scan)
62 AliITSOnlineSPDscanMultiple::~AliITSOnlineSPDscanMultiple() {}
64 AliITSOnlineSPDscanMultiple& AliITSOnlineSPDscanMultiple::operator=(const AliITSOnlineSPDscanMultiple& scan) {
65 // Assignment operator, should not be called!!!
66 printf("This object should not be copied!");
68 // still do nothing...
73 UInt_t AliITSOnlineSPDscanMultiple::AddScanStep() {
75 return ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->AddScanStep();
78 void AliITSOnlineSPDscanMultiple::SetDacId(Int_t val) {
79 ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->SetDacId(val);
82 void AliITSOnlineSPDscanMultiple::SetDacValue(UInt_t nsi, Int_t val) {
83 // set dac value for step nsi
85 ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->SetDacValue(nsi,val);
88 Int_t AliITSOnlineSPDscanMultiple::GetDacId() {
89 return ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->GetDacId();
91 Int_t AliITSOnlineSPDscanMultiple::GetDacValue(UInt_t nsi) {
92 return ((AliITSOnlineSPDscanInfoMultiple*)fScanInfo)->GetDacValue(nsi);