source: trunk/MagicSoft/Mars/callisto.cc@ 8408

Last change on this file since 8408 was 8406, checked in by tbretz, 18 years ago
*** empty log message ***
File size: 23.8 KB
Line 
1#include <TROOT.h>
2#include <TClass.h>
3#include <TSystem.h>
4#include <TGClient.h>
5#include <TApplication.h>
6#include <TObjectTable.h>
7
8#include "MLog.h"
9#include "MLogManip.h"
10
11#include "MEnv.h"
12#include "MArgs.h"
13#include "MArray.h"
14#include "MDirIter.h"
15
16#include "MStatusDisplay.h"
17
18#include "MSequence.h"
19#include "MJPedestal.h"
20#include "MJCalibration.h"
21#include "MJCalibrateSignal.h"
22#include "MJCalibTest.h"
23
24using namespace std;
25
26static void StartUpMessage()
27{
28 gLog << all << endl;
29
30 // 1 2 3 4 5
31 // 12345678901234567890123456789012345678901234567890
32 gLog << "========================================================" << endl;
33 gLog << " Callisto - MARS V" << MARSVER << endl;
34 gLog << " MARS -- CALibrate LIght Signals and Time Offsets" << endl;
35 gLog << " Compiled with ROOT v" << ROOT_RELEASE << " on <" << __DATE__ << ">" << endl;
36 gLog << "========================================================" << endl;
37 gLog << endl;
38}
39
40static void Usage()
41{
42 // 1 2 3 4 5 6 7 8
43 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
44 gLog << all << endl;
45 gLog << "Sorry the usage is:" << endl;
46 gLog << " callisto [-c] [-y] [options] sequence.txt|number" << endl << endl;
47 gLog << " Arguments:" << endl;
48 gLog << " sequence.txt: ASCII file defining a sequence of runs" << endl;
49 gLog << " number: The sequence number (using file in the datacenter)" << endl;
50 gLog << " For more details see MSequence" << endl;
51 gLog << " Root Options:" << endl;
52 gLog << " -b Batch mode (no graphical output to screen)" << endl<<endl;
53 gLog << " Operation Modes:" << endl;
54 gLog << " -c Calculate the calibration constants" << endl;
55 gLog << " -y Extract and calibrate signal" << endl << endl;
56 gLog << " Data Type (exclusive):" << endl;
57 gLog << " -raw Read input from raw-data <default>" << endl;
58 gLog << " -mc Input root-files are monte carlo files" << endl;
59 gLog << " -root Read input from root-files (merpped)" << endl << endl;
60 gLog << " Options:" << endl;
61 gLog.Usage();
62 gLog << " --debug-env=0 Disable debugging setting resources <default>" << endl;
63 gLog << " --debug-env[=1] Display untouched resources after program execution" << endl;
64 gLog << " --debug-env=2 Display untouched resources after eventloop setup" << endl;
65 gLog << " --debug-env=3 Debug setting resources from resource file" << endl;
66 gLog << " --debug-mem Debug memory usage" << endl << endl;
67 gLog << endl;
68 gLog << " -q Quit when job is finished" << endl;
69 gLog << " -f Force overwrite of existing files" << endl;
70 gLog << " --ind=path Path where to search for the data files" << endl;
71 gLog << " [default=standard path in datacenter]" << endl;
72 gLog << " --iny=path Path where to search for the calibration files" << endl;
73 gLog << " [default=local path or output path of Mode-C]" << endl;
74 gLog << " --outc=path Path to write Mode-C result to [def=local path]" << endl;
75 gLog << " --outy=path Path to write Mode-Y result to [def=local path]" << endl;
76 gLog << " --out=path Path to write the all results to [def=local path]" << endl;
77 gLog << " (overwrites --outc and --outy)" << endl;
78 gLog << " --path=path Path to write the all results to [def=local path]" << endl;
79 gLog << " (overwrites --iny, --outc and --outy)" << endl;
80 gLog << " --print-seq Print Sequence information" << endl;
81 gLog << " --print-files Print Files taken from Sequence" << endl;
82 gLog << " --print-found Print Files found from Sequence" << endl;
83 gLog << " --use-test Apply calibration constants to same calibration" << endl;
84 gLog << " file (for testing, calibration mode only)" << endl;
85 gLog << " --movie Write a movie in addition to Mode-Y (this might " << endl;
86 gLog << " stop the eventloop before all evts are processed)" << endl;
87 gLog << " --moon Force using pedestal fits instead of calculated RMS" << endl;
88 gLog << " --config=callisto.rc Resource file [default=callisto.rc]" << endl;
89 gLog << endl;
90 gLog << " --version, -V Show startup message with version number" << endl;
91 gLog << " -?, -h, --help This help" << endl << endl;
92 gLog << " Setup of the two jobs run by callisto (MJPedestal and MJCalibration)" << endl;
93 gLog << " can be done with the resource file. See MJPedestal and MJCalibration" << endl;
94 gLog << " especially CheckEnv() for more details. Command line options might" << endl;
95 gLog << " be overwritten by the resource file." << endl << endl;
96 gLog << " If running in Mode-C and Mode-Y --iny= is obsolete, instead --outc=" << endl;
97 gLog << " is used." << endl << endl;
98 gLog << " Using --iny=, --outc=, --outy=, --out= or --path= automatically" << endl;
99 gLog << " enables the corresponding modes. In this case -c/-y are obsolete." << endl << endl;
100 gLog << "Description:" << endl;
101 gLog << " callisto will calculate pedestals from pedestal-files defined in a" << endl;
102 gLog << " sequence-file. This pedestals are used to calculate the calibration" << endl;
103 gLog << " constants. These constants are stored in a so called calibration-file" << endl;
104 gLog << " together with some datacheck plots which can be viewed using either" << endl;
105 gLog << " showplot or MStatusDisplay in the interpreter. A description of a" << endl;
106 gLog << " sequence-file can be found in the class reference of MSequence." << endl << endl;
107 gLog << "Background:" << endl;
108 gLog << " Callisto is a large, icy, dark-colored, low-density outer moon of" << endl;
109 gLog << " Jupiter that is scarred with impact craters and ejecta. It has a" << endl;
110 gLog << " diameter of about 4800km, the second-largest moon of Jupiter; it is" << endl;
111 gLog << " roughly the size of Mercury. Callisto has the largest-known impact" << endl;
112 gLog << " crater in the Solar System, Valhalla, which has a bright patch 600km" << endl;
113 gLog << " across and rings that go out to almost 3000km. Callisto orbits" << endl;
114 gLog << " Jupiter at a mean distance of 1,883,000km. Its mass is 1.1e23 kg. It" << endl;
115 gLog << " takes Callisto 16.7 days to orbit Jupiter in a synchronous orbit." << endl;
116 gLog << " Jupiter's moon Callisto was discovered independently by Galileo and" << endl;
117 gLog << " S.Marius in 1610." << endl << endl;
118 gLog << "Example:" << endl;
119 gLog << " callisto -f --outc=mycal/ --outy=mysignal/ --log sequence02345.txt" << endl;
120 gLog << endl;
121}
122
123static void PrintFiles(const MSequence &seq, const TString &kInpathD, Bool_t raw, Bool_t showall)
124{
125 const char *prep = showall ? "Found" : "Scheduled";
126
127 MDirIter Next1, Next2, Next3;
128 seq.SetupPedRuns(Next1, kInpathD, raw);
129 seq.SetupCalRuns(Next2, kInpathD, raw);
130 seq.SetupDatRuns(Next3, kInpathD, raw);
131
132 gLog << all;
133 gLog.Separator(Form("%s Pedestal Files", prep));
134 Next1.Print(showall?"all":"");
135 gLog << endl;
136 gLog.Separator(Form("%s Calibration Files", prep));
137 Next2.Print(showall?"all":"");
138 gLog << endl;
139 gLog.Separator(Form("%s Data Files", prep));
140 Next3.Print(showall?"all":"");
141 gLog << endl;
142}
143
144int main(int argc, char **argv)
145{
146 if (!MARS::CheckRootVer())
147 return 0xff;
148
149 MLog::RedirectErrorHandler(MLog::kColor);
150
151 //
152 // Evaluate arguments
153 //
154 MArgs arg(argc, argv, kTRUE);
155 gLog.Setup(arg);
156
157 StartUpMessage();
158
159 if (arg.HasOnly("-V") || arg.HasOnly("--version"))
160 return 0;
161
162 if (arg.HasOnly("-?") || arg.HasOnly("-h") || arg.HasOnly("--help"))
163 {
164 Usage();
165 return 2;
166 }
167
168 const TString kConfig = arg.GetStringAndRemove("--config=", "callisto.rc");
169
170 const Bool_t kPrintSeq = arg.HasOnlyAndRemove("--print-seq");
171 const Bool_t kPrintFiles = arg.HasOnlyAndRemove("--print-files");
172 const Bool_t kPrintFound = arg.HasOnlyAndRemove("--print-found");
173 const Bool_t kUseTest = arg.HasOnlyAndRemove("--use-test");
174 const Bool_t kMovie = arg.HasOnlyAndRemove("--movie");
175 const Bool_t kDebugMem = arg.HasOnlyAndRemove("--debug-mem");
176 Bool_t kMoon = arg.HasOnlyAndRemove("--moon");
177 Int_t kDebugEnv = arg.HasOnlyAndRemove("--debug-env") ? 1 : 0;
178 kDebugEnv = arg.GetIntAndRemove("--debug-env=", kDebugEnv);
179
180 const Bool_t kQuit = arg.HasOnlyAndRemove("-q");
181 const Bool_t kBatch = arg.HasOnlyAndRemove("-b");
182 const Bool_t kOverwrite = arg.HasOnlyAndRemove("-f");
183 //const Bool_t kForceExec = arg.HasOnlyAndRemove("-ff");
184
185 const TString kInpathD = arg.GetStringAndRemove("--ind=", "");
186 TString kInpathY = arg.GetStringAndRemove("--iny=", "");
187 TString kOutpathY = arg.GetStringAndRemove("--outy=", "");
188 TString kOutpathC = arg.GetStringAndRemove("--outc=", "");
189 const TString kOutpath = arg.GetStringAndRemove("--out=", "");
190 const TString kPath = arg.GetStringAndRemove("--path=", "");
191
192 Bool_t kModeC = arg.HasOnlyAndRemove("-c");
193 Bool_t kModeY = arg.HasOnlyAndRemove("-y");
194
195 MJCalib::DataType_t kDataType = MJCalib::kIsUseRawData; // root
196 if (arg.HasOnlyAndRemove("-root"))
197 kDataType = MJCalib::kIsUseRootData; // root
198 if (arg.HasOnlyAndRemove("-raw"))
199 kDataType = MJCalib::kIsUseRawData; // raw
200 if (arg.HasOnlyAndRemove("-mc"))
201 kDataType = MJCalib::kIsUseMC; // monte carlo
202
203 if (!kInpathY.IsNull() || !kOutpathY.IsNull() || !kOutpath.IsNull() || !kPath.IsNull())
204 kModeY = kTRUE;
205 if (!kOutpathC.IsNull() || !kOutpath.IsNull() || !kPath.IsNull())
206 kModeC = kTRUE;
207
208 //
209 // check for the right usage of the program
210 //
211 if (arg.GetNumArguments()!=1)
212 {
213 Usage();
214 return 2;
215 }
216
217 if (arg.GetNumOptions()>0)
218 {
219 gLog << warn << "WARNING - Unknown commandline options..." << endl;
220 arg.Print("options");
221 gLog << endl;
222 return 2;
223 }
224
225 if (!kModeC && !kModeY /*&& !kUseTest*/)
226 {
227 gLog << err << "Neither calibration (-c), signal extraction (-y) or test-mode (--use-test)" << endl;
228 gLog << "specified! You can also give the operation mode by the options defining the" << endl;
229 gLog << "output path --outc, --outy or --out." << endl;
230 Usage();
231 return 2;
232 }
233 if (!kModeY && kMovie)
234 {
235 gLog << err << "Signal extraction mode (-y) not switched on but movie requested." << endl;
236 Usage();
237 return 2;
238 }
239
240 if ((kModeC/* || kUseTest*/) && kOutpathC.IsNull())
241 kOutpathC = ".";
242 if (kModeY)
243 {
244 if (kInpathY.IsNull())
245 kInpathY = ".";
246 if (kOutpathY.IsNull())
247 kOutpathY = ".";
248 }
249 if (!kOutpath.IsNull())
250 {
251 kOutpathC = kOutpath;
252 kOutpathY = kOutpath;
253 }
254 if (!kPath.IsNull())
255 {
256 kOutpathC = kOutpath;
257 kOutpathY = kOutpath;
258 kInpathY = kOutpath;
259 }
260
261 if (kModeC && kModeY)
262 kInpathY = kOutpathC;
263
264 //
265 // Setup sequence file and check for its existance
266 //
267 TString kSequence = arg.GetArgumentStr(0);
268
269 if (kSequence.IsDigit())
270 {
271 const Int_t numseq = kSequence.Atoi();
272 kSequence = Form("/magic/sequences/%04d/sequence%08d.txt", numseq/10000, numseq);
273 gLog << inf << "Inflated sequence file: " << kSequence << endl;
274 }
275
276 if (gSystem->AccessPathName(kSequence, kFileExists))
277 {
278 gLog << err << "Sorry, sequence file '" << kSequence << "' doesn't exist." << endl;
279 return 3;
280 }
281
282 if (gSystem->AccessPathName(kConfig, kFileExists))
283 {
284 gLog << err << "Sorry, config file '" << kConfig << "' doesn't exist." << endl;
285 return 4;
286 }
287
288 if (kDebugMem)
289 TObject::SetObjectStat(kTRUE);
290
291 //
292 // Setup sequence and check its validity
293 //
294 MSequence seq(kSequence, kInpathD);
295 if (kPrintSeq)
296 {
297 gLog << all;
298 gLog.Separator(kSequence);
299 seq.Print();
300 gLog << endl;
301 }
302 if (!seq.IsValid())
303 {
304 gLog << err << "Sequence read but not valid!" << endl << endl;
305 return 5;
306 }
307
308 //
309 // Process print options
310 //
311 if (kPrintFiles)
312 PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kFALSE);
313 if (kPrintFound)
314 PrintFiles(seq, kInpathD, kDataType==MJCalib::kIsUseRawData, kTRUE);
315
316 if (seq.HasMoon())
317 kMoon = kTRUE;
318
319
320 /*
321 //
322 // Check for existance of all files
323 //
324 MDirIter iter;
325 const Int_t n0 = seq.SetupAllRuns(iter, kInpathD, "[DPC]");
326 const Int_t n1 = seq.GetNumAllRuns();
327 if (n0 != n1)
328 {
329 if (kForceExec)
330 gLog << warn << "WARNING";
331 else
332 gLog << err << "ERROR";
333 gLog << " - " << n1 << " files in sequence defined, but " << n0 << " found in ";
334 gLog << (kInpathD.IsNull() ? "<defaultpath>" : kInpathD.Data()) << endl;
335 if (!kForceExec)
336 return 2;
337 }
338
339 if (kPrintOnly)
340 return 0;
341 */
342 //
343 // Initialize root
344 //
345 MArray::Class()->IgnoreTObjectStreamer();
346 MParContainer::Class()->IgnoreTObjectStreamer();
347
348 TApplication app("callisto", &argc, argv);
349 if (!gROOT->IsBatch() && !gClient || gROOT->IsBatch() && !kBatch)
350 {
351 gLog << err << "Bombing... maybe your DISPLAY variable is not set correctly!" << endl;
352 return 1;
353 }
354
355 //
356 // Update frequency by default = 1Hz
357 //
358 MStatusDisplay *d = new MStatusDisplay;
359
360 // From now on each 'Exit' means: Terminate the application
361 d->SetBit(MStatusDisplay::kExitLoopOnExit);
362 d->SetTitle(kSequence);
363
364 MEnv env(kConfig);
365 if (!env.IsValid())
366 {
367 gLog << err << "Configuration file " << kConfig << " not found." << endl;
368 return 0xfe;
369 }
370
371 if (kModeC/* || kUseTest*/)
372 {
373 //
374 // Calculate pedestal for pedestal-calculation and calibration
375 //
376 MJPedestal job1(Form("MJPedestalC1 #%d", seq.GetSequence()));
377 job1.SetNoStorage();
378 job1.SetSequence(seq);
379 job1.SetEnv(&env);
380 job1.SetEnvDebug(kDebugEnv);
381 job1.SetDisplay(d);
382 job1.SetOverwrite(kOverwrite);
383 job1.SetDataType(kDataType);
384 job1.SetUseHists(kMoon);
385
386
387 job1.SetExtractionFundamental();
388 // job1.SetPathOut(kOutpathC); // not yet needed
389 // job1.SetPathIn(kInpathC); // DO NOT CALL IT. IT WOULD READ THE XEXTRACTOR FROM calib-file
390
391 if (!job1.Process())
392 {
393 gLog << err << "Calculation of pedestal failed." << endl << endl;
394 return 6;
395 }
396
397 if (!job1.GetDisplay())
398 {
399 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
400 return 1;
401 }
402
403 //
404 // Calculate pedestal and pedestal resolution
405 //
406 MJPedestal job2(Form("MJPedestalC2 #%d", seq.GetSequence()));
407 job2.SetNoStorage();
408 job2.SetSequence(seq);
409 job2.SetEnv(&env);
410 job2.SetEnvDebug(kDebugEnv);
411 job2.SetDisplay(d);;
412 job2.SetOverwrite(kOverwrite);
413 job2.SetDataType(kDataType);
414 job2.SetUseHists(kMoon);
415 job2.SetDeadPixelCheck();
416 // job1.SetPathOut(kOutpathC); // not yet needed
417 // job1.SetPathIn(kInpathC); // DO NOT CALL IT. IT WOULD READ THE XEXTRACTOR FROM calib-file
418
419 //job2.SetExtractorResolution();
420 job2.SetExtractionWithExtractorRndm();
421 job2.SetExtractor(job1.GetExtractor());
422 job2.SetPedestals(job1.GetPedestalCam());
423 job2.SetBadPixels(job1.GetBadPixels());
424
425 // Please check the Changelog of 2005/04/20 about further deatils of the next comment
426 //if (job1.GetExtractor().InheritsFrom("MExtractTimeAndCharge"))
427 if (!job2.Process())
428 {
429 gLog << err << "Calculation of pedestal resolution failed." << endl << endl;
430 return 7;
431 }
432
433 if (!job2.GetDisplay())
434 {
435 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
436 return 1;
437 }
438
439 //
440 // Do calibration
441 //
442 MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence()));
443 job3.SetSequence(seq);
444 job3.SetEnv(&env);
445 job3.SetEnvDebug(kDebugEnv);
446 job3.SetDisplay(d);
447 job3.SetOverwrite(kOverwrite);
448 job3.SetPathOut(kOutpathC);
449 job3.SetDataType(kDataType);
450 // job2.SetPathIn(kInpathC); // not yet needed
451
452 job3.SetBadPixels(job2.GetBadPixels());
453 job3.SetExtractor(job2.GetExtractor());
454 job3.SetExtractorCam(job2.GetPedestalCam());
455
456 if (!job3.Process(job1.GetPedestalCam()))
457 {
458 gLog << err << "Calculation of calibration failed." << endl << endl;
459 return 8;
460 }
461
462 if (kDebugEnv>0)
463 env.PrintUntouched();
464
465 if (!job3.GetDisplay())
466 {
467 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
468 return 1;
469 }
470
471 if (kUseTest)
472 {
473 MJCalibTest job4(Form("MJCalibTest #%d", seq.GetSequence()));
474 job4.SetBadPixels(job2.GetBadPixels());
475 job4.SetSequence(seq);
476 job4.SetEnv(&env);
477 job4.SetEnvDebug(kDebugEnv);
478 job4.SetDisplay(d);;
479 job4.SetOverwrite(kOverwrite);
480 job4.SetPathOut(kOutpathC);
481 job4.SetDataType(kDataType);
482
483 if (!job4.Process(job1.GetPedestalCam()))
484 {
485 gLog << err << "Calibration of calibration failed." << endl << endl;
486 return 9;
487 }
488
489 if (kDebugEnv>0)
490 env.PrintUntouched();
491
492 if (!job4.GetDisplay())
493 {
494 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
495 return 1;
496 }
497 }
498 }
499
500 if (kModeY)
501 {
502 d->Reset();
503
504 //
505 // Calculate starting pedestal for data extraction
506 //
507 MJPedestal job1(Form("MJPedestalY1 #%d", seq.GetSequence()));
508 job1.SetNoStorage();
509 job1.SetSequence(seq);
510 job1.SetEnv(&env);
511 job1.SetEnvDebug(kDebugEnv);
512 job1.SetDisplay(d);
513 job1.SetNoDisplay();
514 job1.SetOverwrite(kOverwrite);
515 job1.SetPathIn(kInpathY); // --> READ Extractor from calib-file
516 job1.SetDataType(kDataType);
517 //job1.SetPathOut(kOutpathY); // not yet needed
518 job1.SetUseData();
519 job1.SetExtractionFundamental();
520 job1.SetUseHists(kMoon);
521
522 if (!job1.Process())
523 {
524 gLog << err << "Calculation of fundamental pedestal failed." << endl << endl;
525 return 10;
526 }
527
528 if (!job1.GetDisplay())
529 {
530 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
531 return 1;
532 }
533
534 //
535 // Calculate pedestal and pedestal resolution
536 //
537 MJPedestal job2(Form("MJPedestalY2 #%d", seq.GetSequence()));
538 job2.SetNoStorage();
539 job2.SetSequence(seq);
540 job2.SetEnv(&env);
541 job2.SetEnvDebug(kDebugEnv);
542 job2.SetDisplay(d);
543 job2.SetNoDisplay();
544 job2.SetOverwrite(kOverwrite);
545 job2.SetPathIn(kInpathY);
546 job2.SetDataType(kDataType);
547 job2.SetPulsePosCheck(kDataType!=MJCalib::kIsUseMC);
548 job2.SetPathOut(kOutpathY); // for updating the extractor
549
550 job2.SetUseData();
551 job2.SetExtractionWithExtractorRndm();
552 job2.SetExtractor(job1.GetExtractor());
553 job2.SetPedestals(job1.GetPedestalCam());
554 job2.SetBadPixels(job1.GetBadPixels());
555 job2.SetUseHists(kMoon);
556
557 // Please check the Changelog of 2005/04/20 about further deatils of the next comment
558 //if (job1.GetExtractor().InheritsFrom("MExtractTimeAndCharge"))
559 const Int_t rc = job2.Process();
560 if (rc<=0)
561 {
562 // rc==0: Error
563 // rc==-1: too much to the left
564 // rc==-2: too much to the right
565 // rc==-3: too much to the right (beyond limits)
566
567 gLog << err << "Calculation of pedestal from extractor (random) failed." << endl << endl;
568
569 //error coding for the automatic analysis (to be filled into the database)
570 switch (rc)
571 {
572 case 0:
573 return 11;
574 case -1:
575 return 12;
576 case -2:
577 return 13;
578 case -3:
579 return 14;
580 }
581 return 2;
582 }
583
584 if (!job2.GetDisplay())
585 {
586 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
587 return 1;
588 }
589
590 //
591 // Calculate pedestal and pedestal resolution
592 //
593 MJPedestal job3(Form("MJPedestalY3 #%d", seq.GetSequence()));
594 job3.SetNoStorage();
595 job3.SetSequence(seq);
596 job3.SetEnv(&env);
597 job3.SetEnvDebug(kDebugEnv);
598 job3.SetDisplay(d);
599 job3.SetNoDisplay();
600 job3.SetOverwrite(kOverwrite);
601 job3.SetPathIn(kInpathY);
602 job3.SetDataType(kDataType);
603 // job1.SetPathOut(kOutpathC); // not yet needed
604 // job1.SetPathIn(kInpathC); // not yet needed
605
606 job3.SetUseData();
607 job3.SetExtractionWithExtractor();
608 job3.SetExtractor(job2.GetExtractor());
609 job3.SetPedestals(job1.GetPedestalCam());
610 job3.SetBadPixels(job1.GetBadPixels());
611 job3.SetUseHists(kMoon);
612
613 if (!job3.Process())
614 {
615 gLog << err << "Calculation of pedestal from extractor failed." << endl << endl;
616 return 15;
617 }
618
619 if (!job3.GetDisplay())
620 {
621 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
622 return 1;
623 }
624
625 //
626 // Extract signal and calibrate it
627 //
628 MJCalibrateSignal job4(Form("MJCalibrateSignal #%d", seq.GetSequence()));
629 job4.SetSequence(seq);
630 job4.SetDisplay(d);;
631 job4.SetEnv(&env);
632 job4.SetEnvDebug(kDebugEnv);
633 job4.SetOverwrite(kOverwrite);
634 job4.SetPathIn(kInpathY);
635 job4.SetPathOut(kOutpathY);
636 job4.SetDataType(kDataType);
637 job4.SetMovieMode(kMovie);
638 if (kDataType!=MJCalib::kIsUseMC)
639 job4.SetExtractor(job2.GetExtractor());
640
641 // Where to search for calibration files
642 if (!job4.Process(job1.GetPedestalCam(), job3.GetPedestalCam(), job2.GetPedestalCam()))
643 return 16;
644
645 if (kDebugEnv>0)
646 env.PrintUntouched();
647
648 if (!job4.GetDisplay())
649 {
650 gLog << warn << "Display closed by user... execution aborted." << endl << endl;
651 return 1;
652 }
653 }
654
655 if (kBatch || kQuit)
656 delete d;
657 else
658 {
659 // From now on each 'Close' means: Terminate the application
660 d->SetBit(MStatusDisplay::kExitLoopOnClose);
661
662 // Wait until the user decides to exit the application
663 app.Run(kFALSE);
664 }
665
666 if (TObject::GetObjectStat())
667 {
668 TObject::SetObjectStat(kFALSE);
669 gObjectTable->Print();
670 }
671
672 return 0;
673}
674
Note: See TracBrowser for help on using the repository browser.