New version where the number of events is kept in a histogram for merging purposes
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscanMeanTh.cxx
CommitLineData
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
53ae21ce 11AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const Char_t *fileName) {
b15de2d2 12 // constructor
53ae21ce 13 fFileName=fileName;
b15de2d2 14 // look for a previously saved info object
15 // (if file not found create a new one and return, else read)
53ae21ce 16 FILE* fp0 = fopen(fFileName.Data(), "r");
b15de2d2 17 if (fp0 == NULL) {
18 fScanInfo = new AliITSOnlineSPDscanInfoMeanTh();
53ae21ce 19 fFile = new TFile(fFileName.Data(), "RECREATE");
b15de2d2 20 fWrite=kTRUE;
21 }
22 else {
23 fclose(fp0);
53ae21ce 24 fFile = new TFile(fFileName.Data(), "READ");
b15de2d2 25 fWrite=kFALSE;
26 fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
27 }
28 Init();
29}
30
31AliITSOnlineSPDscanMeanTh::AliITSOnlineSPDscanMeanTh(const AliITSOnlineSPDscanMeanTh& scan) :
32 AliITSOnlineSPDscanMultiple(scan)
33{}
34
35AliITSOnlineSPDscanMeanTh::~AliITSOnlineSPDscanMeanTh() {}
36
37AliITSOnlineSPDscanMeanTh& 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
b15de2d2 46UInt_t AliITSOnlineSPDscanMeanTh::AddScanStep() {
47 CreateNewStep();
48 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->AddScanStep();
49}
50
51void 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}
57void 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}
63void 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
70Int_t AliITSOnlineSPDscanMeanTh::GetDacLow(UInt_t nsi, UInt_t hs) {
71 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacLow(nsi,hs);
72}
73Int_t AliITSOnlineSPDscanMeanTh::GetDacHigh(UInt_t nsi, UInt_t hs) {
74 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetDacHigh(nsi,hs);
75}
76Int_t AliITSOnlineSPDscanMeanTh::GetTPAmp(UInt_t nsi, UInt_t hs) {
77 return ((AliITSOnlineSPDscanInfoMeanTh*)fScanInfo)->GetTPAmp(nsi,hs);
78}