1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 Revision 1.5 2006/09/04 17:42:34 hristov
19 Changes required by Effective C++
21 Revision 1.4 2006/08/08 14:20:49 jgrosseo
22 Update to shuttle classes (Alberto)
24 - Possibility to set the full object's path in the Preprocessor's and
25 Shuttle's Store functions
26 - Possibility to extend the object's run validity in the same classes
27 ("startValidity" and "validityInfinite" parameters)
28 - Implementation of the StoreReferenceData function to store reference
29 data in a dedicated CDB storage.
31 Revision 1.3 2006/07/11 12:42:43 jgrosseo
32 adding parameters for extended validity range of data produced by preprocessor
34 Revision 1.2 2006/06/06 16:36:49 jgrosseo
35 minor changes in AliShuttleInterface and AliPreprocessor
37 Revision 1.1 2006/06/02 14:14:36 hristov
38 Separate library for CDB (Jan)
40 Revision 1.2 2006/03/07 07:52:34 hristov
41 New version (B.Yordanov)
43 Revision 1.3 2005/11/17 17:47:34 byordano
44 TList changed to TObjArray
46 Revision 1.2 2005/11/17 14:43:22 byordano
49 Revision 1.1.1.1 2005/10/28 07:33:58 hristov
50 Initial import as subdirectory in AliRoot
52 Revision 1.1.1.1 2005/09/12 22:11:40 byordano
55 Revision 1.2 2005/08/29 21:15:47 byordano
61 // This class is the CDBPreProcessor interface,
62 // supposed to be implemented by any detector
63 // interested in immediate processing of data
64 // which is retrieved from DCS.
65 // For every particular run set of aliases and
66 // their corespoding value sets are returned.
68 // 1) virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
69 // This method is called at the begining of data retrieval.
71 // startTime: when the run started
72 // endTime: when the run finished
74 // 2) virtual void Process()
76 // This method is called and passed a list of retrieved values from DCS
81 #include "AliPreprocessor.h"
88 #include "AliCDBMetaData.h"
89 #include "AliCDBStorage.h"
91 #include "AliCDBPath.h"
92 #include "AliShuttleInterface.h"
94 ClassImp(AliPreprocessor)
96 //______________________________________________________________________________________________
97 AliPreprocessor::AliPreprocessor(const char* detector, AliShuttleInterface* shuttle) :
104 SetTitle(Form("AliPreprocessor for %s subdetector.", detector));
108 AliFatal("Initialized without Shuttle instance.");
112 fShuttle->RegisterPreprocessor(this);
115 //______________________________________________________________________________________________
116 AliPreprocessor::~AliPreprocessor()
120 //______________________________________________________________________________________________
121 void AliPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
123 // Sets the information of the run which is currently processed
124 // can be overriden for special behaviour, make sure that you call base class
128 fStartTime = startTime;
132 //______________________________________________________________________________________________
133 UInt_t AliPreprocessor::Store(const char* pathLevel2, const char* pathLevel3, TObject* object,
134 AliCDBMetaData* metaData, Int_t validityStart, Bool_t validityInfinite)
136 // Stores a CDB object in the storage for offline reconstruction. Objects that are not needed for
137 // offline reconstruction, but should be stored anyway (e.g. for debugging) should NOT be stored
138 // using this function. Use StoreReferenceData instead!
140 // This function should be called at the end of the preprocessor cycle
142 // The parameters are
143 // 1, 2) the 2nd and 3rd level of the object's path. The first level is the detector name which is provided
144 // by the Preprocessor. Thus the object's path is "DET/level2/level3"
145 // 3) the object to be stored
146 // 4) the metaData to be associated with the object
147 // 5) the validity start run number w.r.t. the current run,
148 // if the data is valid only for this run leave the default 0
149 // 6) specifies if the calibration data is valid for infinity (this means until updated),
150 // typical for calibration runs, the default is kFALSE
152 // The call is delegated to AliShuttleInterface
154 return fShuttle->Store(AliCDBPath(GetName(), pathLevel2, pathLevel3), object,
155 metaData, validityStart, validityInfinite);
158 //______________________________________________________________________________________________
159 UInt_t AliPreprocessor::StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object,
160 AliCDBMetaData* metaData)
162 // Stores a CDB object in the storage for reference data. This objects will not be available during
163 // offline reconstrunction. Use this function for reference data only!
165 // This function should be called at the end of the preprocessor cycle
167 // The parameters are
168 // 1, 2) the 2nd and 3rd level of the object's path. The first level is the detector name which is provided
169 // by the Preprocessor. Thus the object's path is "DET/level2/level3"
170 // 3) the object to be stored
171 // 4) the metaData to be associated with the object
173 // The call is delegated to AliShuttleInterface
175 return fShuttle->StoreReferenceData(AliCDBPath(GetName(), pathLevel2, pathLevel3), object,
179 //______________________________________________________________________________________________
180 const char* AliPreprocessor::GetFile(Int_t system, const char* id, const char* source)
182 // This function retrieves a file from the given system (kDAQ, kDCS, kHLT) with the given file id
183 // and from the given source in the system.
184 // The function returnes the path to the local file.
186 // The call is delegated to AliShuttleInterface
188 return fShuttle->GetFile(system, GetName(), id, source);
191 //______________________________________________________________________________________________
192 TList* AliPreprocessor::GetFileSources(Int_t system, const char* id)
194 // Returns a list of sources in a given system that saved a file with the given id
196 // The call is delegated to AliShuttleInterface
198 return fShuttle->GetFileSources(system, GetName(), id);
201 //______________________________________________________________________________________________
202 void AliPreprocessor::Log(const char* message)
204 // Adds a log message to the Shuttle log of this preprocessor
206 // The call is delegated to AliShuttleInterface
208 fShuttle->Log(GetName(), message);