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

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