Last change
on this file since 9415 was 447, checked in by harald, 24 years ago |
Bringing the sources for the octobertest under CVS controll.
(november, 3rd, 2000)
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Line | |
---|
1 | #include "MEvtLoop.h"
|
---|
2 |
|
---|
3 | #include <iostream.h>
|
---|
4 |
|
---|
5 | #include <TStopwatch.h>
|
---|
6 |
|
---|
7 | #include "MParList.h"
|
---|
8 | #include "MTaskList.h"
|
---|
9 |
|
---|
10 | MEvtLoop::MEvtLoop() : fTasks(NULL), fParlist(NULL)
|
---|
11 | {
|
---|
12 | }
|
---|
13 |
|
---|
14 | MEvtLoop::~MEvtLoop()
|
---|
15 | {
|
---|
16 | }
|
---|
17 |
|
---|
18 | void MEvtLoop::SetTaskList(MTaskList *t)
|
---|
19 | {
|
---|
20 | fTasks = t;
|
---|
21 | }
|
---|
22 |
|
---|
23 | void MEvtLoop::SetParList(MParList *p)
|
---|
24 | {
|
---|
25 | fParlist = p;
|
---|
26 | }
|
---|
27 |
|
---|
28 | void MEvtLoop::Eventloop(Int_t maxcnt)
|
---|
29 | {
|
---|
30 | if (!fTasks || !fParlist)
|
---|
31 | {
|
---|
32 | cout << "Error: either tasklist or parlist not initialized" << endl;
|
---|
33 | return;
|
---|
34 | }
|
---|
35 | //
|
---|
36 | // execute the preprocess of all tasks
|
---|
37 | // connect the different tasks with the right containers in
|
---|
38 | // the parameter list
|
---|
39 |
|
---|
40 | if (!fTasks->PreProcess(fParlist))
|
---|
41 | {
|
---|
42 | cout << "Error detected while PreProcessing" << endl;
|
---|
43 | return;
|
---|
44 | }
|
---|
45 |
|
---|
46 | //
|
---|
47 | // loop over all events and process all tasks for
|
---|
48 | // each event
|
---|
49 | //
|
---|
50 | cout << endl << "Eventloop running (";
|
---|
51 |
|
---|
52 | if (maxcnt<0) cout << "all";
|
---|
53 | else cout << maxcnt;
|
---|
54 |
|
---|
55 | cout << " events)..." << flush;
|
---|
56 |
|
---|
57 | Int_t dummy = maxcnt<0?0:maxcnt;
|
---|
58 |
|
---|
59 | TStopwatch clock;
|
---|
60 | clock.Start();
|
---|
61 |
|
---|
62 | if (maxcnt<0)
|
---|
63 | while (fTasks->Process() && ++dummy);
|
---|
64 | else
|
---|
65 | while (fTasks->Process() && dummy--);
|
---|
66 |
|
---|
67 | clock.Stop();
|
---|
68 |
|
---|
69 | cout << "Ready!" << endl << endl;
|
---|
70 |
|
---|
71 | clock.Print();
|
---|
72 |
|
---|
73 | cout << endl
|
---|
74 | << "Time: " << clock.CpuTime() << "s"
|
---|
75 | << " for " << (maxcnt<0?dummy:maxcnt) << " Events"
|
---|
76 | << " --> " << (maxcnt<0?dummy:maxcnt)/clock.CpuTime() << " Events/s"
|
---|
77 | << endl << endl;
|
---|
78 |
|
---|
79 | //
|
---|
80 | // execute the post process of all tasks
|
---|
81 | //
|
---|
82 | fTasks->PostProcess();
|
---|
83 | }
|
---|
84 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.