1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 ////////////////////////////////////////////////////////////
19 // Author: Henrik Tydesjo //
20 // Interface class to the containers of an online scan //
21 // with only one step. //
22 ////////////////////////////////////////////////////////////
26 #include "AliITSOnlineSPDscanSingle.h"
27 #include "AliITSOnlineSPDscanInfo.h"
29 AliITSOnlineSPDscanSingle::AliITSOnlineSPDscanSingle(const Char_t *fileName, Bool_t readFromGridFile) {
34 // look for a previously saved info object
35 // (if file not found create a new one and return, else read)
37 Bool_t bRead = readFromGridFile;
40 FILE* fp0 = fopen(fFileName.Data(), "r");
47 if (bRead) { // open file for reading
48 fFile = TFile::Open(fFileName.Data(), "READ");
49 if (fFile==NULL) { // grid file not found, create new local default file
50 printf("ERROR: AliITSOnlineSPDscan: File %s not found! Creating 'test999.root' file instead\n",fFileName.Data());
51 // create default empty file:
52 fFileName = "test999.root";
53 fScanInfo = new AliITSOnlineSPDscanInfo();
55 fFile = new TFile(fFileName.Data(), "RECREATE");
58 else { // read from file (grid or local)
60 fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
63 else { // create new local file
64 fScanInfo = new AliITSOnlineSPDscanInfo();
66 fFile = new TFile(fFileName.Data(), "RECREATE");
72 AliITSOnlineSPDscanSingle::~AliITSOnlineSPDscanSingle() {}
74 // call the corresponding methods in SPDscan with nsi=0 ******************
75 void AliITSOnlineSPDscanSingle::SetTriggers(UInt_t val)
76 {AliITSOnlineSPDscan::SetTriggers(0,val);}
77 void AliITSOnlineSPDscanSingle::SetHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi, UInt_t val)
78 {AliITSOnlineSPDscan::SetHits(0,hs,chipi,coli,rowi,val);}
79 void AliITSOnlineSPDscanSingle::IncrementTriggers()
80 {AliITSOnlineSPDscan::IncrementTriggers(0);}
81 void AliITSOnlineSPDscanSingle::IncrementHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
82 {AliITSOnlineSPDscan::IncrementHits(0,hs,chipi,coli,rowi);}
83 void AliITSOnlineSPDscanSingle::SetHitEvents(UInt_t hs, UInt_t chipi, UInt_t val)
84 {AliITSOnlineSPDscan::SetHitEvents(0,hs,chipi,val);}
85 void AliITSOnlineSPDscanSingle::SetHitEventsTot(UInt_t hs, UInt_t val)
86 {AliITSOnlineSPDscan::SetHitEventsTot(0,hs,val);}
87 void AliITSOnlineSPDscanSingle::IncrementHitEvents(UInt_t hs, UInt_t chipi)
88 {AliITSOnlineSPDscan::IncrementHitEvents(0,hs,chipi);}
89 void AliITSOnlineSPDscanSingle::IncrementHitEventsTot(UInt_t hs)
90 {AliITSOnlineSPDscan::IncrementHitEventsTot(0,hs);}
91 UInt_t AliITSOnlineSPDscanSingle::GetTriggers() const
92 {return AliITSOnlineSPDscan::GetTriggers(0);}
93 UInt_t AliITSOnlineSPDscanSingle::GetHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
94 {return AliITSOnlineSPDscan::GetHits(0,hs,chipi,coli,rowi);}
95 Float_t AliITSOnlineSPDscanSingle::GetHitsEfficiency(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
96 {return AliITSOnlineSPDscan::GetHitsEfficiency(0,hs,chipi,coli,rowi);}
97 Float_t AliITSOnlineSPDscanSingle::GetHitsEfficiencyError(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
98 {return AliITSOnlineSPDscan::GetHitsEfficiencyError(0,hs,chipi,coli,rowi);}
99 UInt_t AliITSOnlineSPDscanSingle::GetHitEvents(UInt_t hs, UInt_t chipi)
100 {return AliITSOnlineSPDscan::GetHitEvents(0,hs,chipi);}
101 UInt_t AliITSOnlineSPDscanSingle::GetHitEventsTot(UInt_t hs)
102 {return AliITSOnlineSPDscan::GetHitEventsTot(0,hs);}
103 Float_t AliITSOnlineSPDscanSingle::GetHitEventsEfficiency(UInt_t hs, UInt_t chipi)
104 {return AliITSOnlineSPDscan::GetHitEventsEfficiency(0,hs,chipi);}
105 Float_t AliITSOnlineSPDscanSingle::GetHitEventsTotEfficiency(UInt_t hs)
106 {return AliITSOnlineSPDscan::GetHitEventsTotEfficiency(0,hs);}
107 Float_t AliITSOnlineSPDscanSingle::GetHitEventsEfficiencyError(UInt_t hs, UInt_t chipi)
108 {return AliITSOnlineSPDscan::GetHitEventsEfficiencyError(0,hs,chipi);}
109 Float_t AliITSOnlineSPDscanSingle::GetHitEventsTotEfficiencyError(UInt_t hs)
110 {return AliITSOnlineSPDscan::GetHitEventsTotEfficiencyError(0,hs);}
111 Float_t AliITSOnlineSPDscanSingle::GetAverageMultiplicity(UInt_t hs, UInt_t chipi)
112 {return AliITSOnlineSPDscan::GetAverageMultiplicity(0,hs,chipi);}
113 Float_t AliITSOnlineSPDscanSingle::GetAverageMultiplicityTot(UInt_t hs)
114 {return AliITSOnlineSPDscan::GetAverageMultiplicityTot(0,hs);}