]> git.uio.no Git - u/mrichter/AliRoot.git/blob - SHUTTLE/AliCDBPreProcessor.cxx
Updated LUT for the TOF alignable volumes
[u/mrichter/AliRoot.git] / SHUTTLE / AliCDBPreProcessor.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 /*
17 $Log$
18 Revision 1.3  2005/11/17 17:47:34  byordano
19 TList changed to TObjArray
20
21 Revision 1.2  2005/11/17 14:43:22  byordano
22 import to local CVS
23
24 Revision 1.1.1.1  2005/10/28 07:33:58  hristov
25 Initial import as subdirectory in AliRoot
26
27 Revision 1.1.1.1  2005/09/12 22:11:40  byordano
28 SHUTTLE package
29
30 Revision 1.2  2005/08/29 21:15:47  byordano
31 some docs added
32
33 */
34
35 // Description:
36 // This class is the CDBPreProcessor interface,
37 // supposed to be implemented by any detector
38 // interested in immediate processing of data 
39 // which is retrieved from DCS.
40 // For every particular run set of aliases and
41 // their corespoding value sets are returned.
42 // Usage schema:
43 //      1) virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime) 
44 //      This method is called at the begining of data retrieval.
45 //      run: run number
46 //      startTime: when the run started
47 //      endTime: when the run finished  
48 //
49 //      2) virtual void Process(const char* alias, TObjArray& valueSet,
50 //                       Bool_t hasError)       
51 //      
52 //      This method is called for every particular alias which the detector
53 //      is registered in the configuration (see AliShuttleConfig).
54 //      alias: alias name
55 //      valueSet: collection of AliDCSValue
56 //      hasError: flag indicating if some error has happened during
57 //              the retrieaval of the data for this alias.
58 //
59 //      3) virtual void Finalize()
60 //      This method is called after the last alias has been processed.
61 //
62
63
64 #include "AliCDBPreProcessor.h"
65
66 #include "AliShuttle.h"
67 #include "AliLog.h"
68
69 ClassImp(AliCDBPreProcessor)
70
71 AliCDBPreProcessor::AliCDBPreProcessor(const char* detector):
72         TNamed(detector, "")
73 {
74         SetTitle(Form("AliCDBPreProcessor for %s subdetector.", detector));
75 }
76
77 AliCDBPreProcessor::~AliCDBPreProcessor() {
78
79 }
80
81 Int_t AliCDBPreProcessor::GetRun() const {
82         //
83         // Returns current run number.
84         //
85
86         if (!fShuttle) {
87                 AliError(Form("Not registered AliCDBPreProcessor: %s",
88                                 GetName()));
89                 return -1;
90         }
91
92         return fShuttle->GetCurrentRun();
93 }
94
95 UInt_t AliCDBPreProcessor::GetStartTime() const {
96         //
97         // Returns currernt run start time.
98         //
99         if (!fShuttle) {
100                 AliError(Form("Not registered AliCDBPreProcessor: %s",
101                                 GetName()));
102                 return 0;
103         }
104
105         return fShuttle->GetCurrentStartTime();
106 }
107
108 UInt_t AliCDBPreProcessor::GetEndTime() const {
109         //
110         // Returns current run end time.
111         //
112         if (!fShuttle) {
113                 AliError(Form("Not registered AliCDBPreProcessor: %s",
114                                 GetName()));
115                 return 0;
116         }
117
118         return fShuttle->GetCurrentEndTime();
119 }
120
121 Bool_t AliCDBPreProcessor::Store(const char* specType, TObject* object,
122                 AliCDBMetaData* metaData)
123 {
124         //
125         // Store object and metaData into the default AliCDBStorage.
126         // Storage path: <detector>/DCS/<specType>
127         //
128
129         if (!fShuttle) {
130                 AliError(Form("Not registered AliCDBPreProcessor: %s",
131                                 GetName()));
132                 return kFALSE;
133         }
134
135         return fShuttle->Store(GetName(), specType, object, metaData);
136 }
137