3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
8 * for The ALICE HLT Project. *
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 **************************************************************************/
19 /// @file GenerateReadoutListFile.C
20 /// @author Artur Szostak <artursz@iafrica.com>
21 /// @date 25 June 2010
22 /// @brief Macro for generating AliHLTReadoutList readout list objects for testing.
24 /// This macro generates AliHLTReadoutList objects and writes them to a ROOT file
25 /// directly as an object and also in a TTree to check the behaviour of the streamers.
26 /// The generated file should be used by testAliHLTEventDDLBackwardCompatibility.C
27 /// to test the backward compatibility of AliHLTReadoutList objects.
29 /// The macro can be run as follows:
31 /// aliroot -b -q GenerateReadoutListFile.C\(\"myoutputfile.root\"\)
33 /// This will generate the file myoutputfile.root in the current directory.
34 /// By omitting the file name the default file name "output.root" will be used.
36 #if !defined(__CINT__) || defined(__MAKECINT__)
37 #include "AliHLTReadoutList.h"
40 #include "Riostream.h"
43 void GenerateReadoutListFile(const char* filename = "output.root")
45 /// Generates the test file with readout list objects.
47 TFile* file = new TFile(filename, "RECREATE");
50 cerr << "ERROR: Could not create file: " << filename << endl;
54 AliHLTReadoutList* r = new AliHLTReadoutList();
55 TTree* tree = new TTree("rltree","Tree containing readout list objects.");
56 tree->Branch("readoutlist", "AliHLTReadoutList", &r);
58 r->Enable(AliHLTReadoutList::kTRG);
59 r->Write("readoutlist1", TObject::kOverwrite);
61 r->Enable(AliHLTReadoutList::kEMCAL);
62 r->Write("readoutlist2", TObject::kOverwrite);
64 r->Enable(AliHLTReadoutList::kDAQTEST);
65 r->Write("readoutlist3", TObject::kOverwrite);
67 r->Enable(AliHLTReadoutList::kHLT);
68 r->Write("readoutlist4", TObject::kOverwrite);
70 r->Disable(AliHLTReadoutList::kEMCAL);
71 r->Write("readoutlist5", TObject::kOverwrite);
74 tree->Write("rltree", TObject::kOverwrite);