source: branches/start/MagicSoft/Mars/macros/test.C@ 9492

Last change on this file since 9492 was 454, checked in by harald, 24 years ago
Import the first sources of the MAGIC Analysis and Reconstruction Software. T. Bretz and H. Kornmayer 20.December 2000
File size: 1.9 KB
Line 
1/////////////////////////////////////////////////////////////////////////////
2//
3// This is an easy implementation of the Merging process (as root Macro)
4//
5// at the moment it reads a binary file ("rawtest.bin") which was written
6// in the DAQ raw format.
7//
8// The data are stored in root container objects (classes derived from
9// TObject like MRawRunHeader)
10//
11// This containers are written to a root file ("rawtest.root")
12//
13/////////////////////////////////////////////////////////////////////////////
14
15int test()
16{
17 //
18 // create a (empty) list of parameters which can be used by the tasks
19 // and an (empty) list of tasks which should be executed
20 //
21 MParList *plist = new MParList;
22 MTaskList *tasks = new MTaskList;
23
24 //
25 // create the tasks which should be executed and add them to the list
26 // in the case you don't need parameter containers, all of them can
27 // be created by MRawFileRead::PreProcess
28 //
29 // REMARK: Don't change the order of the two instantiations.
30 // I don't have an idea why, but here it crashes to
31 // Interpreter.
32 // (Using root 2.25/03, with Cint 5.14.50 on OSF1)
33 //
34 MRawFileWrite *writer = new MRawFileWrite("output.root", "RECREATE");
35 MReadTree *reader = new MReadTree("delme.root", "Data");
36 tasks->AddToList(reader);
37 tasks->AddToList(writer);
38
39 plist->AddToList(tasks);
40
41 //
42 // create the looping object and thell it about the parameters to use
43 // and the tasks to execute
44 //
45 MEvtLoop magic;
46
47 magic.SetParList(plist);
48
49 //
50 // Start the eventloop which reads the raw file (MRawFileRead) and
51 // write all the information into a root file (MRawFileWrite)
52 //
53 // between reading and writing we can do, transformations, checks, etc.
54 // (I'm think of a task like MRawDataCheck)
55 //
56 magic.Eventloop();
57
58 return 0;
59}
60
61
Note: See TracBrowser for help on using the repository browser.