1 // $Id: AliHLTSamplePreprocessor.cxx 23039 2007-12-13 20:53:02Z richterm $
3 /**************************************************************************
4 * This file is property of and copyright by the *
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 **************************************************************************/
20 /// @file AliHLTSamplePreprocessor.cxx
21 /// @author Kenneth Aamodt, Sebastian Bablok
23 /// @brief HLT Preprocessor plugin for the AliHLTComp library
26 #include "AliHLTSamplePreprocessor.h"
27 #include "AliPreprocessor.h"
29 #include <AliCDBMetaData.h>
30 #include <TObjString.h>
35 ClassImp(AliHLTSamplePreprocessor)
37 AliHLTSamplePreprocessor::AliHLTSamplePreprocessor()
39 // see header file for class documentation
41 // refer to README to build package
43 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
46 const char* AliHLTSamplePreprocessor::fgkTempHistoFileName = "HLTTemperatureHistograms.root";
48 AliHLTSamplePreprocessor::~AliHLTSamplePreprocessor()
50 // see header file for function documentation
53 void AliHLTSamplePreprocessor::Initialize(Int_t /*run*/, UInt_t /*startTime*/,
56 // see header file for function documentation
60 UInt_t AliHLTSamplePreprocessor::Process(TMap* /*dcsAliasMap*/)
62 // see header file for function documentation
64 if (GetTempHisto() != 0) {
65 // unable to fetch the temperature histogram from HLT
67 // but if set to 1, then also file from GetHuffmanTables won't be saved !!!
73 UInt_t AliHLTSamplePreprocessor::GetTempHisto()
75 // see header file for function documentation
78 // get Temp Histogram map
79 TList* hltList = GetFileSources(AliPreprocessor::kHLT, fgkTempHistoFileName);
81 Log("Missing list for the HLT");
86 if (hltList->GetSize() == 0) {
87 Log("No Temperature histogram produced inside the HLT by a DA for this run.");
89 // return no error -> DA might not have run, but other file shall be saved.
90 } else if (hltList->GetSize() > 1) {
91 Log(Form("Problem on the size of the list: %d (HLT)", hltList->GetSize()));
92 return 0; // might have to be changed, when there will be more than one histogram file
95 TObjString* location = (TObjString*) hltList->At(0);
97 Log("Error in location HLT list.");
100 TString localFileName = GetFile(AliPreprocessor::kHLT, fgkTempHistoFileName,
101 location->String().Data());
102 if (!(localFileName.Length() > 0)) {
103 Log("Local file name for Temperature Histogram has zero length.");
108 TFile localFile(localFileName);
109 AliCDBMetaData meta("Sebastian Bablok");
111 if (!(Store("Calib", kTempHistoFileName, (TObject*) &localFile, &meta, 0, kTRUE))) {
113 if (!(StoreReferenceFile(localFileName.Data(), fgkTempHistoFileName))) {
114 TString msg("Storing of object '");
115 msg += fgkTempHistoFileName;
116 msg += "' to Reference Storage failed!";