1. Re-organization of function calls in TestPreprocessor to make it more meaningful.
[u/mrichter/AliRoot.git] / SHUTTLE / test / TestTPCPreprocessor.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 // Example of a Shuttle Preprocessor
18 //
19
20 #include "TestTPCPreprocessor.h"
21
22 #include "AliCDBMetaData.h"
23 #include "AliDCSValue.h"
24 #include "AliLog.h"
25
26 #include <TTimeStamp.h>
27 #include <TObjString.h>
28 #include <TH2F.h>
29 #include <TList.h>
30
31 ClassImp(TestTPCPreprocessor)
32
33 //________________________________________________________________________________________
34 TestTPCPreprocessor::TestTPCPreprocessor():
35         AliPreprocessor("TPC",0)
36 {
37 // default constructor - Don't use this!
38
39         fData = 0;
40 }
41
42 //________________________________________________________________________________________
43 TestTPCPreprocessor::TestTPCPreprocessor(AliShuttleInterface* shuttle):
44         AliPreprocessor("TPC", shuttle)
45 {
46 // constructor - shuttle must be instantiated!
47
48         fData = 0;
49
50 }
51
52 //________________________________________________________________________________________
53 TestTPCPreprocessor::~TestTPCPreprocessor()
54 {
55 // destructor
56
57         delete fData;
58         fData = 0;
59
60 }
61
62 //________________________________________________________________________________________
63 void TestTPCPreprocessor::Initialize(Int_t run, UInt_t startTime,
64         UInt_t endTime)
65 {
66 // Initialize preprocessor
67
68         fRun=run;
69         fStartTime = startTime;
70         fEndTime = endTime;
71         AliInfo(Form("\n\tRun %d \n\tStartTime %s \n\tEndTime %s", run,
72                 TTimeStamp(startTime).AsString(),
73                 TTimeStamp(endTime).AsString()));
74
75         fData = new AliTPCDataDCS(fRun, fStartTime, fEndTime);
76 }
77
78 //________________________________________________________________________________________
79 UInt_t TestTPCPreprocessor::Process(TMap* aliasMap)
80 {
81 // Process data
82
83         fData->ProcessData(*aliasMap);
84         AliCDBMetaData metaData;
85         metaData.SetBeamPeriod(0);
86         metaData.SetResponsible("Alberto Colla");
87         metaData.SetComment("This preprocessor fills an AliTPCDataDCS object.");
88
89         return Store("Calib", "TPCData", fData, &metaData);
90         delete fData;
91         fData = 0;
92 }
93