]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSOnlineSPDscanMeanTh.cxx
### files: AliTPCTempMap.h (.cxx)
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscanMeanTh.cxx
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 AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const Char_t *fileName) {
12   // constructor
13   fFileName=fileName;
14   // look for a previously saved info object 
15   // (if file not found create a new one and return, else read)
16   FILE* fp0 = fopen(fFileName.Data(), "r");
17   if (fp0 == NULL) {
18     fScanInfo = new AliITSOnlineSPDscanInfoMeanTh();
19     fFile = new TFile(fFileName.Data(), "RECREATE");
20     fWrite=kTRUE;
21   }
22   else {
23     fclose(fp0);
24     fFile = new TFile(fFileName.Data(), "READ");
25     fWrite=kFALSE;
26     fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
27   }
28   Init();
29 }
30
31 AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const AliITSOnlineSPDscanMeanTh& scan) :
32   AliITSOnlineSPDscanMultiple(scan)
33 {}
34
35 AliITSOnlineSPDscanMeanTh::~AliITSOnlineSPDscanMeanTh() {}
36
37 AliITSOnlineSPDscanMeanTh& AliITSOnlineSPDscanMeanTh::operator=(const AliITSOnlineSPDscanMeanTh& scan) {
38   // assignment operator (should not be used)
39   printf("This object should not be copied!");
40   if (this!=&scan) {
41     // still do nothing...
42   }
43   return *this;
44 }
45
46 UInt_t AliITSOnlineSPDscanMeanTh::AddScanStep() {
47   CreateNewStep();
48   return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->AddScanStep();
49 }
50
51 void AliITSOnlineSPDscanMeanTh::SetDacLow(UInt_t nsi, UInt_t hs, Int_t val) {
52   // set dac low value for step nsi and half stave hs
53   SwitchToStep(nsi);
54   ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetDacLow(nsi,hs,val); 
55   fInfoModified=kTRUE;
56 }
57 void AliITSOnlineSPDscanMeanTh::SetDacHigh(UInt_t nsi, UInt_t hs, Int_t val) {
58   // set dac high value for step nsi and half stave hs
59   SwitchToStep(nsi);
60   ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetDacHigh(nsi,hs,val); 
61   fInfoModified=kTRUE;
62 }
63 void AliITSOnlineSPDscanMeanTh::SetTPAmp(UInt_t nsi, UInt_t hs, Int_t val) {
64   // set test pulse amplitude for step nsi and half stave hs
65   SwitchToStep(nsi);
66   ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->SetTPAmp(nsi,hs,val); 
67   fInfoModified=kTRUE;
68 }
69
70 Int_t AliITSOnlineSPDscanMeanTh::GetDacLow(UInt_t nsi, UInt_t hs) {
71   return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacLow(nsi,hs);
72 }
73 Int_t AliITSOnlineSPDscanMeanTh::GetDacHigh(UInt_t nsi, UInt_t hs) {
74   return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacHigh(nsi,hs);
75 }
76 Int_t AliITSOnlineSPDscanMeanTh::GetTPAmp(UInt_t nsi, UInt_t hs) {
77   return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetTPAmp(nsi,hs);
78 }