]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTModulePreprocessor.h
- cleaning up debug output
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTModulePreprocessor.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTMODULEPREPROCESSOR_H
5 #define ALIHLTMODULEPREPROCESSOR_H
6 //* This file is property of and copyright by the ALICE HLT Project        * 
7 //* ALICE Experiment at CERN, All rights reserved.                         *
8 //* See cxx source for full Copyright notice                               *
9
10 /**
11  * @file   AliHLTModulePreprocessor.h
12  * @author Matthias Richter
13  * @date   2008-01-22
14  * @brief  Base class for HLT module preprocessors
15  */
16
17 // see below for class documentation
18 // or
19 // refer to README to build package
20 // or
21 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
22
23 #include "TObject.h"
24
25 class AliHLTPreprocessor;
26 class TMap;
27 class AliCDBMetaData;
28 class AliCDBEntry;
29 class AliHLTShuttleInterface;
30
31 /**
32  * @class AliHLTModulePreprocessor
33  * Implementation of the HLT version for the Shuttle Preprocessor.
34  * This class implements the same interface as the AliPreprocessor and
35  * allows multiple preprocessors for the HLT. All methods are redirected
36  * to the AliHLTPreprocessor, which acts as the HLT preprocessor
37  * to the outside, and a container for all module preprocessors to the
38  * inside.
39  *
40  * @author Matthias Richter
41  */
42 class AliHLTModulePreprocessor : public TObject
43 {
44 public:
45   /** Constructor*/
46   AliHLTModulePreprocessor();
47   /** Destructor */
48   virtual ~AliHLTModulePreprocessor();
49
50   /**
51    * Set the container class which is the gateway to the shuttle.
52    */
53   void SetShuttleInterface(AliHLTShuttleInterface* pInterface);
54
55   /**
56    * Initialize the Preprocessor.
57    *
58    * @param run run number
59    * @param startTime start time of data
60    * @param endTime end time of data
61    */
62   virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime) = 0;
63
64   /**
65    * Function to process data. Inside the preparation and storing to OCDB
66    * should be handled.
67    *
68    * @param dcsAliasMap the map containing aliases and corresponding DCS
69    *                    values and timestamps
70    *
71    * @return 0 on success; error code otherwise
72    */
73   virtual UInt_t Process(TMap* dcsAliasMap) = 0;
74
75   /** Get the run no */
76   Int_t GetRun();
77
78   /** Get the start time */
79   UInt_t GetStartTime();
80
81   /** Get the end time */
82   UInt_t GetEndTime();
83
84  /**
85    * Get the id of the module
86    * Each module preprocessor is identified by a unique id.
87    * The function is pure virtual and must be implemented by the child class.
88    * @return module id (string)
89    */
90   virtual const char* GetModuleID() = 0;
91
92  /**
93    * Get all detectors the module process
94    * Detectors are determined in the bit mask as provided by "detectorMask"
95    * implement: GetModuleNumber() {return AliHLTModulePreprocessor::DetetorID("detectorname");}
96    * The function is pure virtual and must be implemented by the child class.
97    * @return bit mask for active detectors (Int_t)
98    */
99   virtual Int_t GetModuleNumber() = 0;
100
101   /** Get detector bit mask (bit mask comparable to the detectorMask but for the respective detector only)
102    *  out of detector name
103    *@param detectorName const char* of the detector
104    *@return Int_t for the detector bit mask
105    */
106   Int_t DetectorBitMask(const char *detectorName);
107
108  /** Get the information whether detector was active (return value: 1 = active, 0 = inactive) 
109       @param detectorbitmask bitmask of the detector to be checked (s. DetectorBitMask)
110       @return 1 if active 0 if inactive
111  */
112   Bool_t GetDetectorStatus(Int_t detectorbitmask);
113
114   /** Get detector name out of detector id (bit position in detectorMask of the resp. detector)
115    *@param detectorID integer ID of the detector
116    *@return const char* name of the detector corresponding to the ID
117    */
118   const char *DetectorName(Int_t detectorID);
119
120   /** number of detectors */
121   static const Int_t kNDetectors;    // Number of detectors
122
123 protected:
124   // the AliPreprocessor interface, all functions redirected via the
125   // AliHLTShuttleInterface to the AliHLTPreprocessor
126   Bool_t Store(const char* pathLevel2, const char* pathLevel3, TObject* object,
127                AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE);
128   Bool_t StoreReferenceData(const char* pathLevel2, const char* pathLevel3, TObject* object,
129                             AliCDBMetaData* metaData);
130   Bool_t StoreReferenceFile(const char* localFile, const char* gridFileName);
131
132   Bool_t StoreRunMetadataFile(const char* localFile, const char* gridFileName);
133
134   const char* GetFile(Int_t system, const char* id, const char* source);
135
136   TList* GetFileSources(Int_t system, const char* id = 0);
137
138   TList* GetFileIDs(Int_t system, const char* source);
139
140   const char* GetRunParameter(const char* param);
141
142   AliCDBEntry* GetFromOCDB(const char* pathLevel2, const char* pathLevel3);
143
144   const char* GetRunType();
145
146   void Log(const char* message);
147
148 private:
149   /** copy constructor prohibited */
150   AliHLTModulePreprocessor(const AliHLTModulePreprocessor& preproc);
151   /** assignment operator prohibited */
152   AliHLTModulePreprocessor& operator=(const AliHLTModulePreprocessor& rhs);
153
154   /** the interface class which is the gateway to the shuttle */
155   AliHLTShuttleInterface* fpInterface;                             //! transient
156
157  /** determine which which detectors were active */
158   Int_t fActiveDetectors; // bit array of active detectors
159
160   /** array of detector names */
161   static const char *fgkDetectorName[]; // Detector names
162
163   ClassDef(AliHLTModulePreprocessor, 1);
164 };
165 #endif