introducing strict run ordering flag
[u/mrichter/AliRoot.git] / SHUTTLE / test / TestZDCPreprocessor.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
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
16 //
17 // Prototype of ZDC Preprocessor
18 //
19
20 #include "TestZDCPreprocessor.h"
21
22 #include "AliCDBMetaData.h"
23 #include "AliDCSValue.h"
24 #include "AliLog.h"
25 #include "AliShuttleInterface.h"
26
27 #include <TTimeStamp.h>
28 #include <TObjString.h>
29 #include <TSystem.h>
30
31 ClassImp(TestZDCPreprocessor)
32
33 //________________________________________________________________________________________
34 TestZDCPreprocessor::TestZDCPreprocessor():
35         AliPreprocessor("ZDC",0)
36 {
37 // default constructor - Don't use this!
38
39 }
40
41 //________________________________________________________________________________________
42 TestZDCPreprocessor::TestZDCPreprocessor(AliShuttleInterface* shuttle):
43         AliPreprocessor("ZDC",shuttle)
44 {
45 // constructor - shuttle must be instantiated!
46
47 }
48
49 //________________________________________________________________________________________
50 void TestZDCPreprocessor::Initialize(Int_t run, UInt_t startTime,
51         UInt_t endTime)
52 {
53 // Initialize preprocessor
54
55         AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
56                 TTimeStamp(startTime).AsString(),
57                 TTimeStamp(endTime).AsString()));
58
59         fRun = run;
60         fStartTime = startTime;
61         fEndTime = endTime;
62         AliInfo("This preprocessor is to test the GetRunParameter function.");
63 }
64
65 //________________________________________________________________________________________
66 UInt_t TestZDCPreprocessor::Process(TMap* /*valueMap*/)
67 {
68 // process data retrieved by the Shuttle
69
70         Int_t result=0;
71
72         const char* dataRate = GetRunParameter("averageDataRate");
73         if (dataRate) {
74                 Log(Form("Average data rate for run %d: %s",fRun, dataRate));
75         } else {
76                 Log(Form("Average data rate not put in logbook!"));
77         }
78
79         return dataRate !=0;
80 }
81