1 // $Id: AliHLTSamplePreprocessor.cxx 23039 2007-12-13 20:53:02Z richterm $
3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Sebastian Bablok <Sebastian.Bablok@ift.uib.no> *
9 * for The ALICE HLT Project. *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
21 * @file AliHLTSamplePreprocessor.cxx
22 * @author Kenneth Aamodt, Sebastian Bablok
24 * @brief HLT Preprocessor plugin for the AliHLTComp library
27 #include "AliHLTSamplePreprocessor.h"
28 #include "AliPreprocessor.h"
30 #include <AliCDBMetaData.h>
31 #include <TObjString.h>
36 ClassImp(AliHLTSamplePreprocessor)
38 AliHLTSamplePreprocessor::AliHLTSamplePreprocessor()
40 // see header file for class documentation
42 // refer to README to build package
44 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
47 const char* AliHLTSamplePreprocessor::fgkTempHistoFileName = "HLTTemperatureHistograms.root";
49 AliHLTSamplePreprocessor::~AliHLTSamplePreprocessor()
51 // see header file for function documentation
54 void AliHLTSamplePreprocessor::Initialize(Int_t /*run*/, UInt_t /*startTime*/,
57 // see header file for function documentation
61 UInt_t AliHLTSamplePreprocessor::Process(TMap* /*dcsAliasMap*/)
63 // see header file for function documentation
65 if (GetTempHisto() != 0) {
66 // unable to fetch the temperature histogram from HLT
68 // but if set to 1, then also file from GetHuffmanTables won't be saved !!!
74 UInt_t AliHLTSamplePreprocessor::GetTempHisto()
76 // see header file for function documentation
79 // get Temp Histogram map
80 TList* HLTlist = GetFileSources(AliPreprocessor::kHLT, fgkTempHistoFileName);
82 Log("Missing list for the HLT");
87 if (HLTlist->GetSize() == 0) {
88 Log("No Temperature histogram produced inside the HLT by a DA for this run.");
90 // return no error -> DA might not have run, but other file shall be saved.
91 } else if (HLTlist->GetSize() > 1) {
92 Log(Form("Problem on the size of the list: %d (HLT)", HLTlist->GetSize()));
93 return 0; // might have to be changed, when there will be more than one histogram file
96 TObjString* location = (TObjString*) HLTlist->At(0);
98 Log("Error in location HLT list.");
101 TString localFileName = GetFile(AliPreprocessor::kHLT, fgkTempHistoFileName,
102 location->String().Data());
103 if (!(localFileName.Length() > 0)) {
104 Log("Local file name for Temperature Histogram has zero length.");
109 TFile localFile(localFileName);
110 AliCDBMetaData meta("Sebastian Bablok");
112 if (!(Store("Calib", kTempHistoFileName, (TObject*) &localFile, &meta, 0, kTRUE))) {
114 if (!(StoreReferenceFile(localFileName.Data(), fgkTempHistoFileName))) {
115 TString msg("Storing of object '");
116 msg += fgkTempHistoFileName;
117 msg += "' to Reference Storage failed!";