4 #ifndef ALIHLTPENDOLINOLISTREADER_H
5 #define ALIHLTPENDOLINOLISTREADER_H
7 /************************************************************************
10 ** This file is property of and copyright by the Department of Physics
11 ** Institute for Physic and Technology, University of Bergen,
12 ** Bergen, Norway, 2007
13 ** This file has been written by Sebastian Bablok,
14 ** sebastian.bablok@ift.uib.no
16 ** Important: This file is provided without any warranty, including
17 ** fitness for any particular purpose.
20 *************************************************************************/
22 // @file AliHLTPendolinoListReader.h
23 // @author Sepastian Bablok
25 // @brief Helper class for pendolino list handling
26 // @note maintained by matthias.richter@cern.ch
37 //namespace alice { namespace hlt { namespace pendolino {
39 //#define MAX_LINE_LENGTH 256
42 * This class reads the file containing the list of calibration objects the
43 * Pendolino shall fetch.
45 * @author Sebastian Bablok
49 class AliHLTPendolinoListReader : public TObject {
53 * Static that defines the maximum line length inside the list file
55 static int kMAX_LINE_LENGTH;
58 * Constructor for the AliHLTPendolinoListReader.
60 AliHLTPendolinoListReader();
63 * Constaructor for AliHLTPendolinoListReader, which also loads the
66 * @param filename of the list file to read given as char*
68 AliHLTPendolinoListReader(const char* filename);
71 * Destructor for the AliHLTPendolinoListReader.
73 virtual ~AliHLTPendolinoListReader();
76 * Reads the list from the file given by filename
77 * and stores the calibration object names in this class/object.
79 * @param filename of the list file to read given as char*
81 * @return false, if file does not exist or file is empty, else true
83 bool ReadListFromFile(const char* filename);
86 * Reads the list from the file given by filename
87 * and stores the calibration object names in this class/object.
89 * @param filename of the list file to read given as string
91 * @return false, if file does not exist or file is empty, else true
93 bool ReadListFromFile(const std::string filename);
96 * Function to get the list of calibration object names.
98 * @return pointer to a TMap containing the the lists grouped by
99 * detector. The Alias names are already included as the key
100 * in a map, so they can be directly used for contacting
101 * the AliDCSClient. Structure of the returned TMap:
103 * TMap( detector name [key], lists of alias names [value] )
104 * {TObjString} {TSeqCollection( Alias names )}
107 * TMap( TRD [key], TRD alias list [value]
109 * -> TRD_low_volt_xyz,
110 * -> TRD_low_volt_123,
112 * -> TRD_temp_1234, )
113 * TPC [key], TPC alias list [value]
115 * -> TPC_low_volt_abc,
117 * -> Pressure_sens_01, )
121 TMap* GetCalibObjList();
124 * Function to retrieve the latest run number
126 * @param path path to the directory containing the lastRunNumber file,
127 * NOTE: the file name must not be included to the path
129 * @return latest run number
131 static int RetrieveLastRunNumber(std::string path);
134 * Function to retrieve the latest run number
136 * @param path path to the directory containing the lastRunNumber file,
137 * NOTE: the file name must not be included to the path
139 * @return latest run number
141 static int RetrieveLastRunNumber(char* path);
144 * Function to print out the content of the Map containing the lists.
150 * Retrieves and returns the value of a given property name.
152 * @param [in] propertyName the name of the requested property (as char)
153 * @param [out] propertyValue pointer to the string representing the
154 * value of the requested property
156 * @return true, if requested property has been found in the class, else
157 * false (false also when PropertyReader is not valid or
158 * propertyName is NULL)
160 // bool retrievePropertyValue(const char* propertyName,
161 // std::string** propertyValue);
164 * Retrieves and returns the value of a given property name.
166 * @param [in] propertyName pointer to the string containing the name of
167 * the requested property
168 * @param [out] propertyValue pointer to the string representing the
169 * value of the requested property
171 * @return true, if requested property has been found in the class, else
172 * false (false also when PropertyReader is not valid or
173 * propertyName is NULL)
175 // bool retrievePropertyValue(const std::string* propertyName,
176 // std::string** propertyValue);
182 * Flag, indicating if list has already been read from file.
184 bool fValid; //! see above
187 * Vector containing the list of calibration objects
189 // std::vector<std::string> mCalibObjList;
194 * Map containing all PropertyName PropertyValue pairs read from the
197 TMap fCalibObjList;//! mProperties;
200 * AliRoot required stuff
202 ClassDef(AliHLTPendolinoListReader, 5);
206 inline TMap* AliHLTPendolinoListReader::GetCalibObjList() {
207 return &fCalibObjList;
211 #endif // ALIHLTPENDOLINOLISTREADER_H