]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSProcessor.cxx
Selectiv readout and writing to FXS (oystein)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSProcessor.cxx
CommitLineData
56673b84 1/**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
4 * *
5 * Primary Author: Per Thomas Hille <perthi@fys.uio.no> *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
c83e4f55 16#include "AliHLTPHOSProcessor.h"
939c67e7 17#include "unistd.h"
c83e4f55 18
c83e4f55 19
b60bd496 20const AliHLTComponentDataType AliHLTPHOSProcessor::fgkInputDataTypes[]={kAliHLTVoidDataType,{0,"",""}}; //'zero' terminated array
c83e4f55 21
22
25b7f84c 23AliHLTPHOSProcessor::AliHLTPHOSProcessor():AliHLTProcessor(), AliHLTPHOSBase(), fPhosEventCount(0), fModuleID(0), fPrintInfo(0), fPrintInfoFrequncy(1000), fRunNumber(0)
c83e4f55 24{
939c67e7 25 ScanRunNumberFromFile();
c83e4f55 26}
27
c83e4f55 28
9c9d15d6 29
b60bd496 30AliHLTPHOSProcessor::~AliHLTPHOSProcessor()
c83e4f55 31{
c83e4f55 32
c83e4f55 33}
34
35
939c67e7 36void
37AliHLTPHOSProcessor::ScanRunNumberFromFile()
38{
39 char tmpDirectory[512];
40 char tmpFileName[512];
41 sprintf(tmpDirectory, "%s", getenv("HOME"));
42 sprintf(tmpFileName, "%s%s", tmpDirectory, "/rundir/runNumber.txt");
43
44 if(CheckFile(tmpFileName, "r") == true)
45 {
46 FILE *fp = fopen(tmpFileName, "r");
47 fscanf(fp, "%d", &fRunNumber);
48 fclose(fp);
49 }
50
51 else
52 {
53 cout << "ERROR, could not find file " << tmpFileName <<endl;
54 }
55}
25b7f84c 56int
57AliHLTPHOSProcessor::ScanArguments(int argc, const char** argv)
58{
59 fPrintInfo = kFALSE;
60 int iResult=0;
61 TString argument="";
62
63 for(int i=0; i<argc && iResult>=0; i++)
64 {
65 argument=argv[i];
66
67 if (argument.IsNull())
68 {
69 continue;
70 }
71
72 if (argument.CompareTo("-printinfo") == 0)
73 {
74 if(i+1 <= argc)
75 {
76 argument=argv[i+1];
77 fPrintInfoFrequncy = atoi(argv[i+1]);
78 fPrintInfo = kTRUE;
79 }
80 else
81 {
82 cout << "WARNING: asking for event info, but no update frequency is specified, option is ignored" << endl;
83 }
84 }
85
86 }
87 return 0;
88}