]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/CALO/AliHLTCaloProcessor.cxx
- fixing coverity
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloProcessor.cxx
CommitLineData
c375e15d 1// $Id: AliHLTCaloProcessor.cxx 35966 2009-10-26 12:47:19Z odjuvsla $
2
3/**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * All rights reserved. *
6 * *
7 * Primary Author: Per Thomas Hille <perthi@fys.uio.no> *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18#include "AliHLTCaloProcessor.h"
19#include "unistd.h"
20
21
22
23const AliHLTComponentDataType AliHLTCaloProcessor::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
24
25
26AliHLTCaloProcessor::AliHLTCaloProcessor():AliHLTProcessor(),
27 fCaloEventCount(0),
28 fModuleID(2),
29 fPrintInfoModule(0),
30 fPrintInfoFrequncyModule(1000),
fe4e0365 31 fRunNumber(0)
c375e15d 32{
33 // ScanRunNumberFromFile();
fe4e0365 34 lineNumber[0] = '\0';
35 fFilepath[0] = '\0';
36 fMessage[0] = '\0';
c375e15d 37}
38
39
40
41AliHLTCaloProcessor::~AliHLTCaloProcessor()
42{
43
44}
45
46
47bool
fe4e0365 48AliHLTCaloProcessor::CheckFileLog(const char */*origin*/, const char */*filename*/, const char */*opt*/)
c375e15d 49{
fe4e0365 50 // sprintf(fFilepath, "%s/%s", getenv("PWD"), filename);
51 // FILE *fp = fopen(filename, opt);
c375e15d 52
fe4e0365 53 // if(fp == 0)
54 // {
55 // // if( (opt == "w") || (opt == "a")) \\OD
56 // if( (!strcmp(opt,"w")) || (!strcmp(opt,"a")))
57 // {
58 // sprintf(fMessage, "for writing please check that the directory exists and that you have write access to it" );
59 // }
60 // else
61 // {
62 // sprintf(fMessage, "for reading please check that the directory exists and that you have read access to it" );
63 // }
64 // Logging(kHLTLogFatal, origin , "cannot open file" , "Was not able to open file %s %s", fFilepath, fMessage);
65 // return false;
66 // }
67 // else
68 // {
69 // // if( (opt == "w") || (opt == "a")) \\OD
70 // if( (!strcmp(opt,"w")) || (!strcmp(opt,"a")))
71 // {
72 // sprintf(fMessage, "for writing" );
73 // }
74 // else
75 // {
76 // sprintf(fMessage, "for reading");
77 // }
78 // // Logging(kHLTLogInfo, origin , "opening file" , "Sucessfully opening %s %s", fFilepath, fMessage);
79 // fclose(fp);
80 // return true;
81 // }
82 return false;
c375e15d 83}
84
85
86void
e4d93924 87AliHLTCaloProcessor::DoneWritingLog(const char */*origin*/, const char * /*filename*/)
c375e15d 88{
89 // char filepath[1024];
e4d93924 90 // sprintf(fFilepath, "%s/%s", getenv("PWD"), filename);
91 // Logging(kHLTLogInfo, origin , "finnished writing file" , "wrote file %s", fFilepath);
92
93 // Logging(kHLTLogInfo, igin , "Don't use this function" , "Don't use this function", fFilepath);
94
c375e15d 95}
96
97
98void
99AliHLTCaloProcessor::ScanRunNumberFromFile()
100{
e4d93924 101 printf("AliHLTCaloProcessor::ScanRunNumberFromFile: don't use this function");
102}
c375e15d 103
104const char*
105AliHLTCaloProcessor::IntToChar(int number)
106{
107 sprintf(lineNumber,"%d", number);
108 return lineNumber;
109}
110
111
112
113int
114AliHLTCaloProcessor::ScanArgumentsModule(int argc, const char** argv)
115{
116 fPrintInfoModule = kFALSE;
117 int iResult=0;
118 TString argument="";
119
120 for(int i=0; i<argc && iResult>=0; i++)
121 {
122 argument=argv[i];
123
124 if (argument.IsNull())
125 {
126 continue;
127 }
128
129 if (argument.CompareTo("-printinfo") == 0)
130 {
131 if(i+1 <= argc)
132 {
133 argument=argv[i+1];
134 fPrintInfoFrequncyModule = atoi(argv[i+1]);
135 fPrintInfoModule = kTRUE;
136 }
137 else
138 {
139 Logging(kHLTLogWarning, __FILE__ , "inconsistency during init" , "asking for event info, but no update frequency is specified, option is ignored");
140 }
141 }
142
143 }
144 return 0;
145}
146