1 ////////////////////////////////////////////////////////////
2 // Author: Henrik Tydesjo //
3 // Interface class to the containers of an online mean //
5 ////////////////////////////////////////////////////////////
8 #include "AliITSOnlineSPDscanMeanTh.h"
9 #include "AliITSOnlineSPDscanInfoMeanTh.h"
11 AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const Char_t *fileName, Bool_t readFromGridFile) {
16 // look for a previously saved info object
17 // (if file not found create a new one and return, else read)
19 Bool_t bRead = readFromGridFile;
22 FILE* fp0 = fopen(fFileName.Data(), "r");
29 if (bRead) { // open file for reading
30 fFile = TFile::Open(fFileName.Data(), "READ");
31 if (fFile==NULL) { // grid file not found, create new local default file
32 printf("ERROR: AliITSOnlineSPDscan: File %s not found! Creating 'test999.root' file instead\n",fFileName.Data());
33 // create default empty file:
34 fFileName = "test999.root";
35 fScanInfo = new AliITSOnlineSPDscanInfoMeanTh();
37 fFile = new TFile(fFileName.Data(), "RECREATE");
40 else { // read from file (grid or local)
42 fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
45 else { // create new local file
46 fScanInfo = new AliITSOnlineSPDscanInfoMeanTh();
48 fFile = new TFile(fFileName.Data(), "RECREATE");
55 AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const AliITSOnlineSPDscanMeanTh& scan) :
56 AliITSOnlineSPDscanMultiple(scan)
59 AliITSOnlineSPDscanMeanTh::~AliITSOnlineSPDscanMeanTh() {}
61 AliITSOnlineSPDscanMeanTh& AliITSOnlineSPDscanMeanTh::operator=(const AliITSOnlineSPDscanMeanTh& scan) {
62 // assignment operator (should not be used)
63 printf("This object should not be copied!");
65 // still do nothing...
70 UInt_t AliITSOnlineSPDscanMeanTh::AddScanStep() {
72 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->AddScanStep();
75 void AliITSOnlineSPDscanMeanTh::SetDacLow(UInt_t nsi, UInt_t hs, Int_t val) {
76 // set dac low value for step nsi and half stave hs
78 ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetDacLow(nsi,hs,val);
81 void AliITSOnlineSPDscanMeanTh::SetDacHigh(UInt_t nsi, UInt_t hs, Int_t val) {
82 // set dac high value for step nsi and half stave hs
84 ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetDacHigh(nsi,hs,val);
87 void AliITSOnlineSPDscanMeanTh::SetTPAmp(UInt_t nsi, UInt_t hs, Int_t val) {
88 // set test pulse amplitude for step nsi and half stave hs
90 ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetTPAmp(nsi,hs,val);
94 Int_t AliITSOnlineSPDscanMeanTh::GetDacLow(UInt_t nsi, UInt_t hs) {
95 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacLow(nsi,hs);
97 Int_t AliITSOnlineSPDscanMeanTh::GetDacHigh(UInt_t nsi, UInt_t hs) {
98 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacHigh(nsi,hs);
100 Int_t AliITSOnlineSPDscanMeanTh::GetTPAmp(UInt_t nsi, UInt_t hs) {
101 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetTPAmp(nsi,hs);