source: trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc@ 6378

Last change on this file since 6378 was 450, checked in by harald, 24 years ago
added a few for functionalities. Also some spectras for TDCs are implemented.
File size: 9.3 KB
Line 
1#include <stdlib.h>
2
3
4#include "MOctTest.h"
5
6
7MOctTest::MOctTest()
8{
9 // default constructor
10}
11
12MOctTest::~MOctTest()
13{
14 // default destructor
15}
16
17
18// ================================================================================
19// ================================================================================
20// ================================================================================
21// ================================================================================
22
23
24Bool_t MOctTest::PedAdcSpectra ( Char_t *inputfile )
25{
26 //
27 //
28
29 printf ("PedAdcSpectra:: Analyse the file %s \n", inputfile ) ;
30
31 // create a loop for this specific job.
32
33 MEvtLoop loop ;
34
35 // open input file
36
37 MRootFile *fileIn = new MRootFile( inputfile );
38
39 // set up the ParameterList,
40 // connect it to the loop
41
42 MParList *plist = new MParList;
43 loop.SetParList(plist);
44
45 // set up the TaskList for this program
46 // and connect it to the loop
47
48 MTaskList *tasks = new MTaskList;
49 tasks->SetEventType("PedTree") ;
50
51 loop.SetTaskList(tasks);
52
53 // now set up all parameter(data) containers and put them
54 // in the parameter list
55
56 // the buffer for the RawEvts, here for the Pedestals
57
58 MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("PedTree")); /* this buffer contains
59 * only one entry
60 */
61 pedbuf->SetAsInput(fileIn);
62 plist->AddToList(pedbuf);
63
64 // now it is neccessary to define the input stream, that means
65 // we set the input only to PedTree
66
67 MInputStreamID *inputStream = new MInputStreamID() ;
68 inputStream->SetEvtType("PedTree") ;
69 plist->AddToList(inputStream);
70
71 //
72 // the data container for the histograms
73
74 MHistosAdc *his = new MHistosAdc;
75
76 plist->AddToList(his);
77 // his->SetAsOutput();
78 // This tells the writer that this is an Output Container, which should
79 // be written to a file ( not working yet)
80
81
82 // set up the tasks and add them to the list
83
84 MParRead *readin = new MParRead;
85 tasks->AddToList(readin, "PedTree");
86
87 MAdcSpect *fillAdc = new MAdcSpect ("PedTree" ) ;
88 tasks->AddToList(fillAdc, "PedTree");
89
90 MShowSpect *showAdc = new MShowSpect ("MHistosAdc") ;
91 tasks->AddToList(showAdc, "PedTree");
92
93 // MParWrite *write = new MParWrite;
94 // tasks->AddToList(write);
95
96 cout << endl;
97
98 //
99 // Print the structure of the parameter list plist
100 //
101 tasks->Print();
102
103 cout << endl;
104
105 //////////////////////////////////////////////////////////////
106 //
107 // call the event loop for 5000 Events
108 //
109
110 loop.Eventloop (50);
111
112 cout << endl << "THE END." << endl ;
113
114
115
116 return ( kTRUE ) ;
117}
118
119// ================================================================================
120// ================================================================================
121// ================================================================================
122// ================================================================================
123
124
125Bool_t MOctTest::CrAdcSpectra ( Char_t *inputfile )
126{
127 //
128 //
129
130 printf ("MOctTest::CrAdcSpectra -- Analyse the file %s \n", inputfile ) ;
131 // create a loop for this specific job.
132
133 MEvtLoop loop ;
134
135 // open input file
136
137 MRootFile *fileIn = new MRootFile( inputfile );
138
139 // set up the ParameterList,
140 // connect it to the loop
141
142 MParList *plist = new MParList;
143 loop.SetParList(plist);
144
145 // set up the TaskList for this program
146 // and connect it to the loop
147
148 MTaskList *tasks = new MTaskList;
149 loop.SetTaskList(tasks);
150
151 // now set up all parameter(data) containers and put them
152 // in the parameter list
153
154 // the buffer for the RawEvts, here for the Pedestals
155
156 MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("EvtTree")); /* this buffer contains
157 * only one entry
158 */
159 pedbuf->SetAsInput(fileIn);
160 plist->AddToList(pedbuf);
161
162 // now it is neccessary to define the input stream, that means
163 // we set the input only to EvtTree
164
165 MInputStreamID *inputStream = new MInputStreamID() ;
166 inputStream->SetEvtType("EvtTree") ;
167 plist->AddToList(inputStream);
168
169 // the data container for the histograms
170
171 MHistosAdc *his = new MHistosAdc;
172
173 plist->AddToList(his);
174 // his->SetAsOutput();
175 // This tells the writer that this is an Output Container, which should
176 // be written to a file ( not working yet)
177
178
179 // set up the tasks and add them to the list
180
181 MParRead *readin = new MParRead;
182 tasks->AddToList(readin, "EvtTree");
183
184 MAdcSpect *fillAdc = new MAdcSpect ("EvtTree" ) ;
185 tasks->AddToList(fillAdc, "EvtTree");
186
187 MShowSpect *showAdc = new MShowSpect ("MHistosAdc") ;
188 tasks->AddToList(showAdc, "PedTree");
189
190 // MParWrite *write = new MParWrite;
191 // tasks->AddToList(write);
192
193 cout << endl;
194
195 //
196 // Print the structure of the parameter list plist
197 //
198 tasks->Print();
199
200 cout << endl;
201
202 //////////////////////////////////////////////////////////////
203 //
204 // call the event loop for 5000 Events
205 //
206
207 loop.Eventloop (5000);
208
209 cout << endl << "THE END." << endl ;
210
211
212
213 return ( kTRUE ) ;
214}
215
216
217
218Bool_t MOctTest::PedTdcSpectra ( Char_t *inputfile )
219{
220 //
221 //
222
223 printf ("PedTdcSpectra:: Analyse the file %s \n", inputfile ) ;
224
225 // create a loop for this specific job.
226
227 MEvtLoop loop ;
228
229 // open input file
230
231 MRootFile *fileIn = new MRootFile( inputfile );
232
233 // set up the ParameterList,
234 // connect it to the loop
235
236 MParList *plist = new MParList;
237 loop.SetParList(plist);
238
239 // set up the TaskList for this program
240 // and connect it to the loop
241
242 MTaskList *tasks = new MTaskList;
243 tasks->SetEventType("PedTree") ;
244
245 loop.SetTaskList(tasks);
246
247 // now set up all parameter(data) containers and put them
248 // in the parameter list
249
250 // the buffer for the RawEvts, here for the Pedestals
251
252 MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("PedTree")); /* this buffer contains
253 * only one entry
254 */
255 pedbuf->SetAsInput(fileIn);
256 plist->AddToList(pedbuf);
257
258 // now it is neccessary to define the input stream, that means
259 // we set the input only to PedTree
260
261 MInputStreamID *inputStream = new MInputStreamID() ;
262 inputStream->SetEvtType("PedTree") ;
263 plist->AddToList(inputStream);
264
265 //
266 // the data container for the histograms
267
268 MHistosTdc *his = new MHistosTdc;
269
270 plist->AddToList(his);
271
272 // his->SetAsOutput();
273 // This tells the writer that this is an Output Container, which should
274 // be written to a file ( not working yet)
275
276
277 // set up the tasks and add them to the list
278
279 MParRead *readin = new MParRead;
280 tasks->AddToList(readin, "PedTree");
281
282 MTdcSpect *fillTdc = new MTdcSpect ("PedTree" ) ;
283 tasks->AddToList(fillTdc, "PedTree");
284
285 MShowSpect *showTdc = new MShowSpect ("MHistosTdc") ;
286 tasks->AddToList(showTdc, "PedTree");
287
288 // MParWrite *write = new MParWrite;
289 // tasks->AddToList(write);
290
291 cout << endl;
292
293 //
294 // Print the structure of the parameter list plist
295 //
296 tasks->Print();
297
298 cout << endl;
299
300 //////////////////////////////////////////////////////////////
301 //
302 // call the event loop for 5000 Events
303 //
304
305 loop.Eventloop (500);
306
307 cout << endl << "THE END." << endl ;
308
309
310
311 return ( kTRUE ) ;
312}
313
314
315
316Bool_t MOctTest::CrTdcSpectra ( Char_t *inputfile )
317{
318 //
319 //
320
321 printf ("CrTdcSpectra:: Analyse the file %s \n", inputfile ) ;
322
323 // create a loop for this specific job.
324
325 MEvtLoop loop ;
326
327 // open input file
328
329 MRootFile *fileIn = new MRootFile( inputfile );
330
331 // set up the ParameterList,
332 // connect it to the loop
333
334 MParList *plist = new MParList;
335 loop.SetParList(plist);
336
337 // set up the TaskList for this program
338 // and connect it to the loop
339
340 MTaskList *tasks = new MTaskList;
341 tasks->SetEventType("EvtTree") ;
342
343 loop.SetTaskList(tasks);
344
345 // now set up all parameter(data) containers and put them
346 // in the parameter list
347
348 // the buffer for the RawEvts, here for the Pedestals
349
350 MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("EvtTree")); /* this buffer contains
351 * only one entry
352 */
353 pedbuf->SetAsInput(fileIn);
354 plist->AddToList(pedbuf);
355
356 // now it is neccessary to define the input stream, that means
357 // we set the input only to PedTree
358
359 MInputStreamID *inputStream = new MInputStreamID() ;
360 inputStream->SetEvtType("EvtTree") ;
361 plist->AddToList(inputStream);
362
363 //
364 // the data container for the histograms
365
366 MHistosTdc *his = new MHistosTdc;
367
368 plist->AddToList(his);
369
370 // his->SetAsOutput();
371 // This tells the writer that this is an Output Container, which should
372 // be written to a file ( not working yet)
373
374
375 // set up the tasks and add them to the list
376
377 MParRead *readin = new MParRead;
378 tasks->AddToList(readin, "EvtTree");
379
380 MTdcSpect *fillTdc = new MTdcSpect ("EvtTree" ) ;
381 tasks->AddToList(fillTdc, "EvtTree");
382
383 MShowSpect *showTdc = new MShowSpect ("MHistosTdc") ;
384 tasks->AddToList(showTdc, "EvtTree");
385
386 // MParWrite *write = new MParWrite;
387 // tasks->AddToList(write);
388
389 cout << endl;
390
391 //
392 // Print the structure of the parameter list plist
393 //
394 tasks->Print();
395
396 cout << endl;
397
398 //////////////////////////////////////////////////////////////
399 //
400 // call the event loop for 5000 Events
401 //
402
403 loop.Eventloop (5000);
404
405 cout << endl << "THE END." << endl ;
406
407
408
409 return ( kTRUE ) ;
410}
Note: See TracBrowser for help on using the repository browser.