| 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 | 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("rawtest.root", "RECREATE");
|
|---|
| 35 | MRawFileRead *reader = new MRawFileRead("rawtest.bin");
|
|---|
| 36 | tasks->AddToList(reader);
|
|---|
| 37 | tasks->AddToList(writer);
|
|---|
| 38 |
|
|---|
| 39 | //
|
|---|
| 40 | // create the looping object and thell it about the parameters to use
|
|---|
| 41 | // and the tasks to execute
|
|---|
| 42 | //
|
|---|
| 43 | MEvtLoop magic;
|
|---|
| 44 |
|
|---|
| 45 | magic.SetParList(plist);
|
|---|
| 46 | magic.SetTaskList(tasks);
|
|---|
| 47 |
|
|---|
| 48 | //
|
|---|
| 49 | // Start the eventloop which reads the raw file (MRawFileRead) and
|
|---|
| 50 | // write all the information into a root file (MRawFileWrite)
|
|---|
| 51 | //
|
|---|
| 52 | // between reading and writing we can do, transformations, checks, etc.
|
|---|
| 53 | // (I'm think of a task like MRawDataCheck)
|
|---|
| 54 | //
|
|---|
| 55 | magic.Eventloop();
|
|---|
| 56 |
|
|---|
| 57 | return 0;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|