| 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 |
|
|---|
| 15 | int merpp()
|
|---|
| 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 | MTaskList tasks;
|
|---|
| 22 | MParList plist;
|
|---|
| 23 |
|
|---|
| 24 | plist.AddToList(&tasks);
|
|---|
| 25 |
|
|---|
| 26 | //
|
|---|
| 27 | // create the tasks which should be executed and add them to the list
|
|---|
| 28 | // in the case you don't need parameter containers, all of them can
|
|---|
| 29 | // be created by MRawFileRead::PreProcess
|
|---|
| 30 | //
|
|---|
| 31 | // REMARK: Don't change the order of the two instantiations.
|
|---|
| 32 | // I don't have an idea why, but here it crashes the
|
|---|
| 33 | // Interpreter.
|
|---|
| 34 | // (Using root 2.25/03, with Cint 5.14.50 on OSF1)
|
|---|
| 35 | //
|
|---|
| 36 |
|
|---|
| 37 | MRawFileRead reader("/home/tbretz/data/20010219-00020-d-octobertest-e");
|
|---|
| 38 | MRawFileWrite writer("otest.root", "RECREATE");
|
|---|
| 39 | tasks.AddToList(&reader);
|
|---|
| 40 | tasks.AddToList(&writer);
|
|---|
| 41 |
|
|---|
| 42 | //
|
|---|
| 43 | // create the looping object and thell it about the parameters to use
|
|---|
| 44 | // and the tasks to execute
|
|---|
| 45 | //
|
|---|
| 46 | MEvtLoop magic;
|
|---|
| 47 |
|
|---|
| 48 | magic.SetParList(&plist);
|
|---|
| 49 |
|
|---|
| 50 | //
|
|---|
| 51 | // Start the eventloop which reads the raw file (MRawFileRead) and
|
|---|
| 52 | // write all the information into a root file (MRawFileWrite)
|
|---|
| 53 | //
|
|---|
| 54 | // between reading and writing we can do, transformations, checks, etc.
|
|---|
| 55 | // (I'm think of a task like MRawDataCheck)
|
|---|
| 56 | //
|
|---|
| 57 | magic.Eventloop();
|
|---|
| 58 |
|
|---|
| 59 | return 0;
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|