]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/util/test/testAliHLTRootSchemaEvolutionComponent.C
attaching file writer to the StreamerInfo component
[u/mrichter/AliRoot.git] / HLT / BASE / util / test / testAliHLTRootSchemaEvolutionComponent.C
1 // $Id$
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: Matthias Richter <Matthias.Richter@ift.uib.no>        *
8  *                  for The ALICE HLT Project.                            *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          *
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 /** @file   testAliHLTRootSchemaEvolutionComponent.C
20     @author Matthias Richter
21     @date   
22     @brief  Test macro/program for the AliHLTRootSchemaEvolutionComponent
23  */
24 int testAliHLTRootSchemaEvolutionComponent(const char* rawfile, int firstevent=0, int lastevent=-1) 
25 {
26   AliRawReader* rawreader=AliRawReader::Create(rawfile);
27   if (!rawreader) {
28     cerr << "error: can not open raw file " << rawfile << endl;
29     return -1;
30   }
31
32   AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();
33   pHLT->SetGlobalLoggingLevel(kHLTLogAll);
34   pHLT->LoadComponentLibraries("libAliHLTUtil.so");
35
36   AliHLTConfiguration publisher("hltout-publisher", "AliHLTOUTPublisher" , NULL, "");
37   AliHLTConfiguration esdfilter("esdfilter", "BlockFilter" , "hltout-publisher", "-datatype ALIESDV0 'HLT ' -prescalar 2 -skip-events 3");  
38   AliHLTConfiguration objfilter("objfilter", "BlockFilter" , "hltout-publisher", "-datatype ROOTTOBJ 'HLT '");  
39   AliHLTConfiguration streamerinfo("streamerinfo", "ROOTSchemaEvolutionComponent" , "esdfilter objfilter", "");
40   AliHLTConfiguration writer("writer", "FileWriter" , "streamerinfo", "-write-all-events -directory streamerinfo");
41
42   pHLT->BuildTaskList("writer");
43   AliHLTOfflineInterface::SetParamsToComponents(NULL, rawreader);
44
45   if (!rawreader->GotoEvent(firstevent)) {
46     cerr << "error: can not access event " << firstevent << endl;
47     return 0;
48   }
49   int event=firstevent;
50   do {
51     pHLT->Run(1,0);
52   } while ((++event<=lastevent || lastevent<0) && rawreader->NextEvent());
53   pHLT->Run(-1);
54 }