]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/SampleLib/AliHLTSamplePreprocessor.cxx
Using TMath (Stefan Rossegger)
[u/mrichter/AliRoot.git] / HLT / SampleLib / AliHLTSamplePreprocessor.cxx
CommitLineData
12ec5482 1// $Id: AliHLTSamplePreprocessor.cxx 23039 2007-12-13 20:53:02Z richterm $
2
3/**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
6 * *
7 * Primary Authors: Sebastian Bablok <Sebastian.Bablok@ift.uib.no> *
8 * Kenneth Aamodt *
9 * for The ALICE HLT Project. *
10 * *
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 **************************************************************************/
19
20/**
21 * @file AliHLTSamplePreprocessor.cxx
22 * @author Kenneth Aamodt, Sebastian Bablok
23 * @date 2007-12-06
12ec5482 24 * @brief HLT Preprocessor plugin for the AliHLTComp library
25 */
26
27#include "AliHLTSamplePreprocessor.h"
28#include "AliPreprocessor.h"
29
30#include <AliCDBMetaData.h>
31#include <TObjString.h>
32#include <TString.h>
33#include <TList.h>
34#include <TFile.h>
35
36ClassImp(AliHLTSamplePreprocessor)
37
38AliHLTSamplePreprocessor::AliHLTSamplePreprocessor()
39{
40 // see header file for class documentation
41 // or
42 // refer to README to build package
43 // or
44 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
45}
46
47const char* AliHLTSamplePreprocessor::fgkTempHistoFileName = "HLTTemperatureHistograms.root";
48
49AliHLTSamplePreprocessor::~AliHLTSamplePreprocessor()
50{
51 // see header file for function documentation
52}
53
54void AliHLTSamplePreprocessor::Initialize(Int_t run, UInt_t startTime,
55 UInt_t endTime)
56{
57}
58
59
60UInt_t AliHLTSamplePreprocessor::Process(TMap* dcsAliasMap)
61{
62 // see header file for function documentation
63 UInt_t retVal = 0;
64 if (GetTempHisto() != 0) {
65 // unable to fetch the temperature histogram from HLT
66 retVal = 1;
67 // but if set to 1, then also file from GetHuffmanTables won't be saved !!!
68 }
69
70 return retVal;
71}
72
73UInt_t AliHLTSamplePreprocessor::GetTempHisto()
74{
75 // see header file for function documentation
76
77 UInt_t retVal = 0;
78 // get Temp Histogram map
79 TList* HLTlist = GetFileSources(AliPreprocessor::kHLT, fgkTempHistoFileName);
80 if (!HLTlist) {
81 Log("Missing list for the HLT");
82
83 return 1;
84 }
85
86 if (HLTlist->GetSize() == 0) {
87 Log("No Temperature histogram produced inside the HLT by a DA for this run.");
88 return retVal;
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
93 }
94
95 TObjString* location = (TObjString*) HLTlist->At(0);
96 if (location == 0) {
97 Log("Error in location HLT list.");
98 return 0;
99 }
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.");
104 return 1;
105 }
106
107/*
108 TFile localFile(localFileName);
109 AliCDBMetaData meta("Sebastian Bablok");
110
111 if (!(Store("Calib", kTempHistoFileName, (TObject*) &localFile, &meta, 0, kTRUE))) {
112*/
113 if (!(StoreReferenceFile(localFileName.Data(), fgkTempHistoFileName))) {
114 TString msg("Storing of object '");
115 msg += fgkTempHistoFileName;
116 msg += "' to Reference Storage failed!";
117 Log(msg.Data());
118 retVal = 1;
119 }
120
121 return retVal;
122}