source: trunk/MagicSoft/Mars/mjobs/MJSimulation.cc@ 9312

Last change on this file since 9312 was 9309, checked in by tbretz, 16 years ago
*** empty log message ***
File size: 20.7 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz, 1/2009 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2009
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MJSimulation
28//
29//
30// Force reading a corsika file even if the footer (RUNE-section) is missing
31// by setting fForceMode to kTRUE or from the resource file by
32//
33// ForceMode: Yes
34//
35//
36// In case of a pedestal or calibration run the artificial trigger can
37// be "switched off" and the cosmics trrigger "switched on" by setting
38// fForceTrigger to kTRUE or from the resource file by
39//
40// ForceTrigger: Yes
41//
42//
43/////////////////////////////////////////////////////////////////////////////
44#include "MJSimulation.h"
45
46#include <TEnv.h>
47
48// Core
49#include "MLog.h"
50#include "MLogManip.h"
51
52#include "MArgs.h"
53//#include "MDirIter.h"
54#include "MParList.h"
55#include "MTaskList.h"
56#include "MEvtLoop.h"
57
58#include "MStatusDisplay.h"
59
60// Tasks
61#include "MCorsikaRead.h"
62#include "MContinue.h"
63#include "MFillH.h"
64#include "MGeomApply.h"
65#include "MHillasCalc.h"
66#include "MImgCleanStd.h"
67#include "MWriteRootFile.h"
68
69#include "MSimAbsorption.h"
70#include "MSimReflector.h"
71#include "MSimPointingPos.h"
72#include "MSimPSF.h"
73#include "MSimGeomCam.h"
74#include "MSimSignalCam.h"
75#include "MSimAPD.h"
76#include "MSimExcessNoise.h"
77#include "MSimCamera.h"
78#include "MSimTrigger.h"
79#include "MSimReadout.h"
80#include "MSimRandomPhotons.h"
81#include "MSimBundlePhotons.h"
82#include "MSimCalibrationSignal.h"
83
84// Histograms
85#include "MBinning.h"
86
87#include "MHn.h"
88#include "MHCamEvent.h"
89#include "MHPhotonEvent.h"
90
91// Container
92#include "MRawRunHeader.h"
93#include "MParameters.h"
94#include "MReflector.h"
95#include "MParEnv.h"
96#include "MPulseShape.h"
97
98#include "MPedestalCam.h"
99#include "MPedestalPix.h"
100
101ClassImp(MJSimulation);
102
103using namespace std;
104
105// --------------------------------------------------------------------------
106//
107// Default constructor.
108//
109// Sets fRuns to 0, fExtractor to NULL, fDataCheck to kFALSE
110//
111MJSimulation::MJSimulation(const char *name, const char *title)
112 : fForceMode(kFALSE), fForceTrigger(kFALSE)
113{
114 fName = name ? name : "MJSimulation";
115 fTitle = title ? title : "Standard analysis and reconstruction";
116}
117
118Bool_t MJSimulation::CheckEnvLocal()
119{
120 fForceMode = GetEnv("ForceMode", fForceMode);
121 fForceTrigger = GetEnv("ForceTrigger", fForceTrigger);
122
123 return kTRUE;
124}
125
126Bool_t MJSimulation::WriteResult()
127{
128 if (fPathOut.IsNull())
129 {
130 *fLog << inf << "No output path specified via SetPathOut - no output written." << endl;
131 return kTRUE;
132 }
133
134 TObjArray cont;
135 cont.Add(const_cast<TEnv*>(GetEnv()));
136 //cont.Add(const_cast<MSequence*>(&fSequence));
137
138 if (fDisplay)
139 {
140// TString title = "-- Reflector: ";
141// title += fSequence.GetSequence();
142// title += " --";
143// fDisplay->SetTitle(title, kFALSE);
144 fDisplay->SetTitle("Ceres", kFALSE);
145
146 cont.Add(fDisplay);
147 }
148
149// const TString oname = Form("reflector%08d.root", fSequence.GetSequence());
150 const TString oname = "ceres.root";
151 return WriteContainer(cont, oname, "RECREATE");
152}
153
154void MJSimulation::SetupHist(MHn &hist) const
155{
156 hist.AddHist("MCorsikaEvtHeader.fTotalEnergy");
157 hist.InitName("Energy");
158 hist.InitTitle("Energy;E [GeV]");
159 hist.SetLog(kTRUE, kTRUE, kFALSE);
160
161 hist.AddHist("MPhotonEvent.GetNumExternal");
162 hist.InitName("Size");
163 hist.InitTitle("Size;S [#]");
164 hist.SetLog(kTRUE, kTRUE, kFALSE);
165
166 hist.AddHist("MCorsikaEvtHeader.fX/100","MCorsikaEvtHeader.fY/100");
167 hist.SetDrawOption("colz");
168 hist.InitName("Impact;Impact;Impact");
169 hist.InitTitle("Impact;West <--> East [m];South <--> North [m]");
170
171 hist.AddHist("MCorsikaEvtHeader.fFirstInteractionHeight/100000");
172 hist.InitName("Height");
173 hist.InitTitle("FirstInteractionHeight;h [km]");
174
175 hist.AddHist("MCorsikaEvtHeader.fAz*TMath::RadToDeg()", "MCorsikaEvtHeader.fZd*TMath::RadToDeg()");
176 hist.InitName("SkyOrigin;Az;Zd");
177 hist.InitTitle("Sky Origin;Az [deg];Zd [deg]");
178 hist.SetDrawOption("colz");
179
180 TString sin2 = "sin(MCorsikaEvtHeader.fZd)*sin(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
181 TString cos2 = "cos(MCorsikaEvtHeader.fZd)*cos(MCorsikaRunHeader.fZdMin*TMath::DegToRad())";
182 TString cos = "cos(MCorsikaEvtHeader.fAz-MCorsikaRunHeader.fAzMin*TMath::DegToRad())";
183
184 TString form = "acos("+sin2+"*"+cos+"+"+cos2+")*TMath::RadToDeg()";
185
186 hist.AddHist(form);
187 hist.InitName("ViewCone");
188 hist.InitTitle("Incident Angle;\\alpha [\\deg]");
189}
190
191Bool_t MJSimulation::Process(const MArgs &args)
192{
193 /*
194 if (!fSequence.IsValid())
195 {
196 *fLog << err << "ERROR - Sequence invalid!" << endl;
197 return kFALSE;
198 }
199 */
200
201 //if (!HasWritePermission(GetPathOut()))
202 // return kFALSE;
203
204 *fLog << inf;
205 fLog->Separator(GetDescriptor());
206
207 if (!CheckEnv())
208 return kFALSE;
209
210 *fLog << warn << "FIXME: Monte Carlo simulation: Sequences not supported yet.";
211 //*fLog << fSequence.GetFileName() << endl;
212 *fLog << endl;
213
214 // --------------------------------------------------------------------------------
215
216 //MDirIter iter;
217 //if (fSequence.GetRuns(iter, MSequence::kCalibrated)<=0)
218 // return kFALSE;
219
220 // Setup Parlist
221 MParList plist;
222 plist.AddToList(this); // take care of fDisplay!
223
224 // setup TaskList
225 MTaskList tasks;
226 plist.AddToList(&tasks);
227
228 // --------------------------------------------------------------------------------
229
230 // ---------- FIXME FIXME FIXME -----------
231 // FIXME: Find a better name (What if both cams are identical?)
232 MParEnv env1("GeomAPDs"); // Inheritance!
233 MParEnv env2("MGeomCam"); // Inheritance!
234 env1.SetClassName("MGeomCam");
235 env2.SetClassName("MGeomCam");
236 plist.AddToList(&env1);
237 plist.AddToList(&env2);
238
239 // FIXME: Allow the user to create other reflectors
240 MReflector reflector;
241 plist.AddToList(&reflector);
242
243 plist.FindCreateObj("MPedPhotCam", "MPedPhotFromExtractorRndm");
244
245 MPulseShape shape;
246 plist.AddToList(&shape);
247
248 MRawRunHeader header;
249 header.SetValidMagicNumber();
250 //header.InitFadcType(3);
251
252 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTData, 1, 1);
253 if (args.GetNumArguments()==1)
254 {
255 if (!args.GetArgumentStr(0).CompareTo("pedestal", TString::kIgnoreCase))
256 {
257 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPedestal, 1, 1);
258 header.SetSourceInfo("Pedestal");
259 }
260 if (!args.GetArgumentStr(0).CompareTo("calibration", TString::kIgnoreCase))
261 {
262 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTCalibration, 1, 1);
263 header.SetSourceInfo("Calibration");
264 }
265 if (!args.GetArgumentStr(0).CompareTo("pointrun", TString::kIgnoreCase))
266 header.SetRunInfo(/*MRawRunHeader::kRTMonteCarlo|*/MRawRunHeader::kRTPointRun, 1, 1);
267 }
268
269 // FIXME: Move to MSimPointingPos, MSimCalibrationSignal
270 header.SetObservation("On", "MonteCarlo");
271 plist.AddToList(&header);
272 // ++++++++ FIXME FIXME FIXME +++++++++++++
273
274 /*
275 MPedestalCam pedcam;
276 pedcam.Init(geomcam.GetNumPixels());
277 for (UInt_t i=0; i<geomcam.GetNumPixels(); i++)
278 pedcam[i].Set(128./header.GetScale(), 22.5/header.GetScale());
279 plist.AddToList(&pedcam);
280 */
281
282 // -------------------------------------------------------------------
283
284 MCorsikaRead read;
285 read.SetForceMode(fForceMode);
286
287 for (int i=0; i<args.GetNumArguments();i ++)
288 read.AddFile(args.GetArgumentStr(i));
289
290 MSimAbsorption absapd("AbsorptionAPDs");
291 MSimAbsorption absmir("AbsorptionMirrors");
292 MSimAbsorption cones("AbsorptionCones");
293 cones.SetUseTheta();
294
295 MSimPointingPos pointing;
296
297 MSimReflector reflect;
298 reflect.SetNameGeomCam("GeomAPDs");
299// MSimStarField stars;
300
301 MContinue cont1("MPhotonEvent.GetNumPhotons<1", "ContEmpty1");
302 MContinue cont2("MPhotonEvent.GetNumPhotons<1", "ContEmpty2");
303
304 // -------------------------------------------------------------------
305
306 MBinning binse( 100, 1, 100000, "BinningEnergy", "log");
307 MBinning binss( 100, 1, 10000000, "BinningSize", "log");
308 MBinning binsi( 50, -250, 250, "BinningImpact");
309 MBinning binsh( 50, 0, 12, "BinningHeight");
310 MBinning binsaz(360, -360, 360, "BinningAz");
311 MBinning binszd( 70, 0, 70, "BinningZd");
312 MBinning binsvc(155, 0, 31, "BinningViewCone");
313 MBinning binsew(150, 0, 25, "BinningEvtWidth");
314 MBinning binstr("BinningTrigPos");
315
316 plist.AddToList(&binse);
317 plist.AddToList(&binss);
318 plist.AddToList(&binsi);
319 plist.AddToList(&binsh);
320 plist.AddToList(&binszd);
321 plist.AddToList(&binsaz);
322 plist.AddToList(&binsvc);
323 plist.AddToList(&binsew);
324 plist.AddToList(&binstr);
325
326 MHn mhn1, mhn2, mhn3;
327 SetupHist(mhn1);
328 SetupHist(mhn2);
329 SetupHist(mhn3);
330
331 MH3 mhtp("TriggerPos.fVal-IntendedPulsePos.fVal-MPulseShape.GetPulseWidth");
332 mhtp.SetName("TrigPos");
333 mhtp.SetTitle("Trigger position w.r.t. the first photon hitting an APD");
334
335 MH3 mhew("MPhotonStatistics.fTimeLast-MPhotonStatistics.fTimeFirst - MRawRunHeader.GetFreqSampling/1000.*MRawRunHeader.fNumSamplesHiGain - 2*MPulseShape.GetPulseWidth");
336 mhew.SetName("EvtWidth");
337 mhew.SetTitle("Time between first and last photon hitting an APD");
338
339 MFillH fillh1(&mhn1, "", "FillH1");
340 MFillH fillh2(&mhn2, "", "FillH2");
341 MFillH fillh3(&mhn3, "", "FillH3");
342 MFillH filltp(&mhtp, "", "FillTriggerPos");
343 MFillH fillew(&mhew, "", "FillEvtWidth");
344 fillh1.SetNameTab("H1", "Distribution of Muons as simulated");
345 fillh2.SetNameTab("H2", "Distribution of Muons as available after all");
346 fillh3.SetNameTab("H3", "Distribution after trigger");
347 filltp.SetNameTab("TrigPos", "TriggerPosition w.r.t the first photon");
348 fillew.SetNameTab("EvtWidth", "Time between first and last photon hitting an APD");
349
350 MHPhotonEvent planeG(1); // Get from MaxImpact
351 MHPhotonEvent plane0(2); // Get from MReflector
352 MHPhotonEvent plane1(2);
353 MHPhotonEvent plane2(2);
354 MHPhotonEvent plane3(2);
355 MHPhotonEvent plane4(2);
356 MHPhotonEvent planeF1(3); // Get from MGeomCam
357 MHPhotonEvent planeF2(header.IsPointRun()?4:3); // Get from MGeomCam
358
359 //MHPSF psf;
360
361 MFillH fillG(&planeG, "MPhotonEvent", "FillGround");
362 MFillH fill0(&plane0, "MirrorPlane0", "FillReflector");
363 MFillH fill1(&plane1, "MirrorPlane1", "FillCamShadow");
364 MFillH fill2(&plane2, "MirrorPlane2", "FillCandidates");
365 MFillH fill3(&plane3, "MirrorPlane3", "FillReflected");
366 MFillH fill4(&plane4, "MirrorPlane4", "FillFocal");
367 MFillH fillF1(&planeF1, "MPhotonEvent", "FillCamera");
368 MFillH fillF2(&planeF2, "MPhotonEvent", "FillAPDs");
369 //MFillH fillP(&psf, "MPhotonEvent", "FillPSF");
370
371 fillG.SetNameTab("Ground", "Photon distribution at ground");
372 fill0.SetNameTab("Reflector", "Photon distribution at reflector plane w/o camera shadow");
373 fill1.SetNameTab("CamShadow", "Photon distribution at reflector plane w/ camera shadow");
374 fill2.SetNameTab("Candidates", "'Can hit' photon distribution at reflector plane w/ camera shadow");
375 fill3.SetNameTab("Reflected", "Photon distribution after reflector projected to reflector plane");
376 fill4.SetNameTab("Focal", "Photon distribution at focal plane");
377 fillF1.SetNameTab("Camera", "Photon distribution which hit the detector");
378 fillF2.SetNameTab("APDs", "Photon distribution after cones");
379 //fillP.SetNameTab("PSF", "Photon distribution after cones for all mirrors");
380
381 // -------------------------------------------------------------------
382
383 const TString rule1(Form("s/cer([0-9]+)/%s\\/ref$1.root/", Esc(fPathOut).Data()));
384 const TString rule2(Form("s/cer([0-9]+)/%s\\/sig$1.root/", Esc(fPathOut).Data()));
385 const TString rule3(Form("s/cer([0-9]+)/%s\\/cam$1.root/", Esc(fPathOut).Data()));
386
387 MWriteRootFile write1( 2, rule1, fOverwrite?"RECREATE":"NEW", "Reflector file");
388 MWriteRootFile write2( 2, rule2, fOverwrite?"RECREATE":"NEW", "Signal file");
389 MWriteRootFile write3( 2, rule3, fOverwrite?"RECREATE":"NEW", "Camera file");
390
391 write1.SetName("WriteRef");
392 write2.SetName("WriteSig");
393 write3.SetName("WriteCam");
394
395 write1.AddContainer("MCorsikaEvtHeader", "Events", kFALSE);
396 write1.AddContainer("MPhotonEvent", "Events");
397
398 write2.AddContainer("MRawRunHeader", "RunHeaders");
399 write2.AddContainer("MGeomCam", "RunHeaders");
400 write2.AddContainer("MSignalCam", "Events");
401 write2.AddContainer("MRawEvtHeader", "Events");
402 write2.AddContainer("MPedPhotFromExtractorRndm", "RunHeaders");
403 /* Monte Carlo Headers
404 write.AddContainer("MMcRunHeader", "RunHeaders", kFALSE);
405 write.AddContainer("MMcFadcHeader", "RunHeaders", kFALSE);
406 write.AddContainer("MMcTrigHeader", "RunHeaders", kFALSE);
407 write.AddContainer("MMcConfigRunHeader", "RunHeaders", kFALSE);
408 write.AddContainer("MMcCorsikaRunHeader", "RunHeaders", kFALSE);
409 // Monte Carlo
410 write.AddContainer("MMcEvt", "Events", kFALSE);
411 write.AddContainer("MMcTrig", "Events", kFALSE);
412 */// Data tree
413 //write.AddContainer("MPedPhotFromExtractor", "Events");
414 //write.AddContainer("MPedPhotFromExtractorRndm", "Events");
415 //write.AddContainer("MTime", "Events", kFALSE);
416 //write.AddContainer("MRawEvtHeader", "Events");
417 //write.AddContainer("MTriggerPattern", "Events");
418
419 write3.AddContainer("MRawEvtData", "Events");
420 write3.AddContainer("MRawRunHeader", "RunHeaders");
421 write3.AddContainer("MGeomCam", "RunHeaders");
422 write3.AddContainer("MRawEvtHeader", "Events");
423 write3.AddContainer("MPedestalCam", "RunHeaders", kFALSE);
424
425 // -------------------------------------------------------------------
426
427 MGeomApply apply;
428
429 MSimPSF simpsf;
430
431 MSimGeomCam simgeom;
432 simgeom.SetNameGeomCam("GeomAPDs");
433
434 MSimCalibrationSignal simcal;
435 simcal.SetNameGeomCam("GeomAPDs");
436
437 // Dark Current: 4MHz = 0.004 GHz
438 // Light of night sky at La Palma: ~ 0.2 ph / cm^2 / sr / ns
439 // 5deg camera: 6e-3 sr
440 // NSB = 0.2*6e-3
441
442 MSimRandomPhotons simnsb;
443// simnsb.SetFreq(0.005, 0.004); // 5MHz/cm^2, 4MHz
444 simnsb.SetFreq(0, 0.04); // 40MHz fixed for each APD
445 simnsb.SetNameGeomCam("GeomAPDs");
446
447 // FIXME: How do we handle star-light? We need the rate but we also
448 // need to process it through the mirror!
449
450 MSimAPD simapd;
451 simapd.SetFreq(0.04); // Must be identical to MSimRanodmPhotons!!
452 simapd.SetNameGeomCam("GeomAPDs");
453
454 MSimExcessNoise simexcnoise;
455 MSimBundlePhotons simsum;
456 MSimSignalCam simsignal;
457 MSimCamera simcam;
458 MSimTrigger simtrig;
459 MSimReadout simdaq;
460
461 MContinue conttrig("TriggerPos.fVal<0", "ContTrigger");
462
463 MParameterD pulpos("IntendedPulsePos");
464// pulpos.SetVal(40); // [ns]
465 plist.AddToList(&pulpos);
466
467 MParameterD trigger("TriggerPos");
468 trigger.SetVal(0);
469 plist.AddToList(&trigger);
470
471 // -------------------------------------------------------------------
472
473 MImgCleanStd clean(7, 4.5);
474 clean.SetMethod(MImgCleanStd::kAbsolute);
475
476 //clean.SetNamePedPhotCam("MPedPhotFromExtractorRndm");
477
478 MHillasCalc hcalc;
479 hcalc.Disable(MHillasCalc::kCalcConc);
480
481 MHCamEvent evt0a(/*10*/0, "Signal", "Average signal;;S [ph]");
482 MHCamEvent evt0c(/*10*/0, "MaxSignal", "Maximum signal;;S [ph]");
483 MHCamEvent evt0d(/*11*/8, "ArrTm", "Time after first photon;;T [ns]");
484 evt0a.SetErrorSpread(kFALSE);
485 evt0c.SetCollectMax();
486
487 MFillH fillx0a(&evt0a, "MSignalCam", "FillAvgSignal");
488 MFillH fillx0c(&evt0c, "MSignalCam", "FillMaxSignal");
489 MFillH fillx0d(&evt0d, "MSignalCam", "FillArrTm");
490 MFillH fillx1("MHHillas", "MHillas", "FillHillas");
491 //MFillH fillx2("MHHillasExt", "", "FillHillasExt");
492 MFillH fillx3("MHHillasSrc", "MHillasSrc", "FillHillasSrc");
493 //MFillH fillx4("MHImagePar", "MImagePar", "FillImagePar");
494 //MFillH fillx5("MHNewImagePar", "MNewImagePar", "FillNewImagePar");
495
496 // -------------------------------------------------------------------
497
498 if (header.IsDataRun())
499 {
500 tasks.AddToList(&read);
501 tasks.AddToList(&pointing);
502 // if (header.IsPointRun())
503 // tasks.AddToList(&stars);
504 //tasks.AddToList(&print);
505 tasks.AddToList(&fillh1);
506 tasks.AddToList(&fillG);
507 if (!header.IsPointRun())
508 {
509 tasks.AddToList(&absapd);
510 tasks.AddToList(&absmir);
511 }
512 tasks.AddToList(&reflect);
513 if (!header.IsPointRun())
514 {
515 tasks.AddToList(&fill0);
516 tasks.AddToList(&fill1);
517 tasks.AddToList(&fill2);
518 tasks.AddToList(&fill3);
519 tasks.AddToList(&fill4);
520 tasks.AddToList(&fillF1);
521 }
522 tasks.AddToList(&cones);
523 tasks.AddToList(&fillF2);
524 //if (header.IsPointRun())
525 // tasks.AddToList(&fillP);
526 tasks.AddToList(&cont1);
527 if (!header.IsPointRun())
528 tasks.AddToList(&fillh2);
529 }
530 // -------------------------------
531 tasks.AddToList(&apply);
532 if (header.IsDataRun())
533 {
534 tasks.AddToList(&simpsf);
535 tasks.AddToList(&simgeom);
536 tasks.AddToList(&cont2);
537 }
538 if (header.IsPedestalRun() || header.IsCalibrationRun())
539 tasks.AddToList(&simcal);
540 tasks.AddToList(&simnsb);
541 tasks.AddToList(&simapd);
542 tasks.AddToList(&simexcnoise);
543 tasks.AddToList(&simsum);
544 tasks.AddToList(&simcam);
545 if (header.IsDataRun() || fForceTrigger)
546 tasks.AddToList(&simtrig);
547 tasks.AddToList(&conttrig);
548 tasks.AddToList(&simsignal); // What do we do if signal<0?
549 tasks.AddToList(&simdaq);
550 if (!fPathOut.IsNull() && !HasNullOut())
551 {
552 tasks.AddToList(&write1);
553 if (!header.IsPedestalRun())
554 tasks.AddToList(&write2);
555 tasks.AddToList(&write3);
556 }
557 // -------------------------------
558 if (header.IsDataRun())
559 tasks.AddToList(&fillh3);
560 tasks.AddToList(&filltp);
561 if (header.IsDataRun())
562 tasks.AddToList(&fillew);
563 if (!header.IsPedestalRun())
564 {
565 tasks.AddToList(&fillx0a);
566 tasks.AddToList(&fillx0c);
567 //tasks.AddToList(&clean);
568 tasks.AddToList(&hcalc);
569 tasks.AddToList(&fillx0d);
570 tasks.AddToList(&fillx1);
571 //tasks.AddToList(&fillx2);
572 tasks.AddToList(&fillx3);
573 //tasks.AddToList(&fillx4);
574 //tasks.AddToList(&fillx5);
575 }
576
577 //-------------------------------------------
578
579 tasks.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
580
581 // Create and setup the eventloop
582 MEvtLoop evtloop(fName);
583 evtloop.SetParList(&plist);
584 evtloop.SetDisplay(fDisplay);
585 evtloop.SetLogStream(&gLog);
586 if (!SetupEnv(evtloop))
587 return kFALSE;
588
589 if (binstr.IsDefault())
590 binstr.SetEdgesLin(150, -shape.GetPulseWidth(),
591 header.GetFreqSampling()/1000.*header.GetNumSamples()+shape.GetPulseWidth());
592
593 header.Print();
594
595 // Execute first analysis
596 if (!evtloop.Eventloop(fMaxEvents))
597 {
598 gLog << err << GetDescriptor() << ": Failed." << endl;
599 return kFALSE;
600 }
601
602 //-------------------------------------------
603 // FIXME: Display Spline in tab
604 // FIXME: Display Reflector in tab
605 // FIXME: Display Routing(?) in tab
606 // FIXME: Display Camera(s) in tab
607 //-------------------------------------------
608
609 if (!WriteResult())
610 return kFALSE;
611
612 *fLog << all << GetDescriptor() << ": Done." << endl << endl << endl;;
613
614 return kTRUE;
615}
Note: See TracBrowser for help on using the repository browser.