Changes related to the extraction of the V0 finder into a separate class (A. Dainese...
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineSPDscanSingle.cxx
... / ...
CommitLineData
1/**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18////////////////////////////////////////////////////////////
19// Author: Henrik Tydesjo //
20// Interface class to the containers of an online scan //
21// with only one step. //
22////////////////////////////////////////////////////////////
23
24
25#include <TFile.h>
26#include "AliITSOnlineSPDscanSingle.h"
27#include "AliITSOnlineSPDscanInfo.h"
28
29AliITSOnlineSPDscanSingle::AliITSOnlineSPDscanSingle(const Char_t *fileName, Bool_t readFromGridFile) {
30 // constructor
31 fFileName=fileName;
32 fModified=kFALSE;
33 fInfoModified=kFALSE;
34 // look for a previously saved info object
35 // (if file not found create a new one and return, else read)
36
37 Bool_t bRead = readFromGridFile;
38
39 if (!bRead) {
40 FILE* fp0 = fopen(fFileName.Data(), "r");
41 if (fp0 != NULL) {
42 bRead=kTRUE;
43 fclose(fp0);
44 }
45 }
46
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();
54 fInfoModified=kTRUE;
55 fFile = new TFile(fFileName.Data(), "RECREATE");
56 fWrite=kTRUE;
57 }
58 else { // read from file (grid or local)
59 fWrite=kFALSE;
60 fFile->GetObject("AliITSOnlineSPDscanInfo", fScanInfo);
61 }
62 }
63 else { // create new local file
64 fScanInfo = new AliITSOnlineSPDscanInfo();
65 fInfoModified=kTRUE;
66 fFile = new TFile(fFileName.Data(), "RECREATE");
67 fWrite=kTRUE;
68 }
69
70 Init();
71}
72AliITSOnlineSPDscanSingle::~AliITSOnlineSPDscanSingle() {}
73
74// call the corresponding methods in SPDscan with nsi=0 ******************
75void AliITSOnlineSPDscanSingle::SetTriggers(UInt_t val)
76 {AliITSOnlineSPDscan::SetTriggers(0,val);}
77void 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);}
79void AliITSOnlineSPDscanSingle::IncrementTriggers()
80 {AliITSOnlineSPDscan::IncrementTriggers(0);}
81void AliITSOnlineSPDscanSingle::IncrementHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
82 {AliITSOnlineSPDscan::IncrementHits(0,hs,chipi,coli,rowi);}
83void AliITSOnlineSPDscanSingle::SetHitEvents(UInt_t hs, UInt_t chipi, UInt_t val)
84 {AliITSOnlineSPDscan::SetHitEvents(0,hs,chipi,val);}
85void AliITSOnlineSPDscanSingle::SetHitEventsTot(UInt_t hs, UInt_t val)
86 {AliITSOnlineSPDscan::SetHitEventsTot(0,hs,val);}
87void AliITSOnlineSPDscanSingle::IncrementHitEvents(UInt_t hs, UInt_t chipi)
88 {AliITSOnlineSPDscan::IncrementHitEvents(0,hs,chipi);}
89void AliITSOnlineSPDscanSingle::IncrementHitEventsTot(UInt_t hs)
90 {AliITSOnlineSPDscan::IncrementHitEventsTot(0,hs);}
91UInt_t AliITSOnlineSPDscanSingle::GetTriggers()
92 {return AliITSOnlineSPDscan::GetTriggers(0);}
93UInt_t AliITSOnlineSPDscanSingle::GetHits(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
94 {return AliITSOnlineSPDscan::GetHits(0,hs,chipi,coli,rowi);}
95Float_t AliITSOnlineSPDscanSingle::GetHitsEfficiency(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
96 {return AliITSOnlineSPDscan::GetHitsEfficiency(0,hs,chipi,coli,rowi);}
97Float_t AliITSOnlineSPDscanSingle::GetHitsEfficiencyError(UInt_t hs, UInt_t chipi, UInt_t coli, UInt_t rowi)
98 {return AliITSOnlineSPDscan::GetHitsEfficiencyError(0,hs,chipi,coli,rowi);}
99UInt_t AliITSOnlineSPDscanSingle::GetHitEvents(UInt_t hs, UInt_t chipi)
100 {return AliITSOnlineSPDscan::GetHitEvents(0,hs,chipi);}
101UInt_t AliITSOnlineSPDscanSingle::GetHitEventsTot(UInt_t hs)
102 {return AliITSOnlineSPDscan::GetHitEventsTot(0,hs);}
103Float_t AliITSOnlineSPDscanSingle::GetHitEventsEfficiency(UInt_t hs, UInt_t chipi)
104 {return AliITSOnlineSPDscan::GetHitEventsEfficiency(0,hs,chipi);}
105Float_t AliITSOnlineSPDscanSingle::GetHitEventsTotEfficiency(UInt_t hs)
106 {return AliITSOnlineSPDscan::GetHitEventsTotEfficiency(0,hs);}
107Float_t AliITSOnlineSPDscanSingle::GetHitEventsEfficiencyError(UInt_t hs, UInt_t chipi)
108 {return AliITSOnlineSPDscan::GetHitEventsEfficiencyError(0,hs,chipi);}
109Float_t AliITSOnlineSPDscanSingle::GetHitEventsTotEfficiencyError(UInt_t hs)
110 {return AliITSOnlineSPDscan::GetHitEventsTotEfficiencyError(0,hs);}
111Float_t AliITSOnlineSPDscanSingle::GetAverageMultiplicity(UInt_t hs, UInt_t chipi)
112 {return AliITSOnlineSPDscan::GetAverageMultiplicity(0,hs,chipi);}
113Float_t AliITSOnlineSPDscanSingle::GetAverageMultiplicityTot(UInt_t hs)
114 {return AliITSOnlineSPDscan::GetAverageMultiplicityTot(0,hs);}