Changeset 6282
- Timestamp:
- 02/07/05 18:16:48 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 8 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6281 r6282 52 52 common code from derived classes into the base-class 53 53 - implemented CheckEnvLocal to handle the resource 'DataType' 54 - changed publicity of some variables and functions 55 to allow setting file type from outside 56 - added new function to set data-type for use in callisto.cc 54 57 55 58 * mjobs/MJCalibTest.[h,cc], mjobs/MJCalibrateSignal.[h,cc], … … 63 66 be able to write a function description about it (simple 64 67 copy&past) 68 69 * callisto.cc: 70 - added option for file-type 71 72 * mjobs/MJOptimize.[h,cc], mjobs/MSequences.[h,cc], 73 mjobs/MJCut.[h,cc], ganymed.[cc,rc]: 74 - added to repository, but not yet to Makefile because 75 there is still some work to be done. But whoever is 76 interested in the new classes/program may already use it. 65 77 66 78 -
trunk/MagicSoft/Mars/callisto.cc
r6253 r6282 52 52 gLog << " -c Calculate the calibration constants" << endl; 53 53 gLog << " -y Extract and calibrate signal" << endl << endl; 54 gLog << " Data Type (exclusive):" << endl; 55 gLog << " -raw Read input from raw-data" << endl; 56 gLog << " -mc Input root-files are monte carlo files" << endl; 57 gLog << " -root Read input from root-files (merpped) <default>" << endl << endl; 54 58 gLog << " Options:" << endl; 55 59 gLog.Usage(); … … 72 76 gLog << " --print-files Print Files taken from Sequence" << endl; 73 77 gLog << " --print-only Do not execute anything except print" << endl; 74 gLog << " --use-test Apply cal. const. to the same cal. file (for testing)" << endl; 78 gLog << " --use-test Apply calibration constants to same calibration" << endl; 79 gLog << " file (for testing, calibration mode only)" << endl; 75 80 gLog << " --config=callisto.rc Resource file [default=callisto.rc]" << endl; 76 81 gLog << endl; … … 141 146 Bool_t kModeY = arg.HasOnlyAndRemove("-y"); 142 147 148 MJCalib::DataType_t kDataType = MJCalib::kIsUseRootData; // root 149 if (arg.HasOnlyAndRemove("-raw")) 150 kDataType = MJCalib::kIsUseRawData; // raw 151 if (arg.HasOnlyAndRemove("-mc")) 152 kDataType = MJCalib::kIsUseMC; // monte carlo 153 143 154 if (!kInpathY.IsNull() || !kOutpathY.IsNull() || !kOutpath.IsNull() || !kPath.IsNull()) 144 155 kModeY = kTRUE; … … 146 157 kModeC = kTRUE; 147 158 148 if (!kModeC && !kModeY )149 { 150 gLog << err << "Neither calibration (-c) nor signal extraction (-y) modespecified!" << endl;159 if (!kModeC && !kModeY /*&& !kUseTest*/) 160 { 161 gLog << err << "Neither calibration (-c) nor signal extraction (-y) or test-mode (--use-test) specified!" << endl; 151 162 Usage(); 152 163 return 0; 153 164 } 154 165 155 if ( kModeC&& kOutpathC.IsNull())166 if ((kModeC/* || kUseTest*/) && kOutpathC.IsNull()) 156 167 kOutpathC = "."; 157 168 if (kModeY) … … 182 193 arg.Print("options"); 183 194 gLog << endl; 195 return -1; 184 196 } 185 197 … … 289 301 d->SetTitle(kSequence); 290 302 291 if (kModeC )303 if (kModeC/* || kUseTest*/) 292 304 { 293 305 // … … 302 314 job1.SetOverwrite(kOverwrite); 303 315 job1.SetPathData(kInpathD); 316 job1.SetDataType(kDataType); 304 317 305 318 job1.SetExtractionFundamental(); … … 330 343 job2.SetOverwrite(kOverwrite); 331 344 job2.SetPathData(kInpathD); 345 job2.SetDataType(kDataType); 332 346 // job1.SetPathOut(kOutpathC); // not yet needed 333 347 // job1.SetPathIn(kInpathC); // not yet needed … … 351 365 } 352 366 353 // 354 // Do calibration 355 // 356 MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence())); 357 job3.SetSequence(seq); 358 job3.SetEnv(kConfig); 359 job3.SetEnvDebug(kDebugEnv); 360 job3.SetDisplay(d);; 361 job3.SetOverwrite(kOverwrite); 362 job3.SetPathOut(kOutpathC); 363 job3.SetPathData(kInpathD); 364 // job2.SetPathIn(kInpathC); // not yet needed 365 366 job3.SetBadPixels(job2.GetBadPixels()); 367 job3.SetExtractor(job2.GetExtractor()); 368 job3.SetExtractorCam(job2.GetPedestalCam()); 369 370 if (!job3.ProcessFile(job1.GetPedestalCam())) 371 { 372 gLog << err << "Calculation of calibration failed." << endl << endl; 373 return -1; 374 } 375 376 if (!job3.GetDisplay()) 377 { 378 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 379 return 1; 367 if (kModeC) 368 { 369 // 370 // Do calibration 371 // 372 MJCalibration job3(Form("MJCalibration #%d", seq.GetSequence())); 373 job3.SetSequence(seq); 374 job3.SetEnv(kConfig); 375 job3.SetEnvDebug(kDebugEnv); 376 job3.SetDisplay(d); 377 job3.SetOverwrite(kOverwrite); 378 job3.SetPathOut(kOutpathC); 379 job3.SetPathData(kInpathD); 380 job3.SetDataType(kDataType); 381 // job2.SetPathIn(kInpathC); // not yet needed 382 383 job3.SetBadPixels(job2.GetBadPixels()); 384 job3.SetExtractor(job2.GetExtractor()); 385 job3.SetExtractorCam(job2.GetPedestalCam()); 386 387 if (!job3.ProcessFile(job1.GetPedestalCam())) 388 { 389 gLog << err << "Calculation of calibration failed." << endl << endl; 390 return -1; 391 } 392 393 if (!job3.GetDisplay()) 394 { 395 gLog << warn << "Display closed by user... execution aborted." << endl << endl; 396 return 1; 397 } 380 398 } 381 399 … … 383 401 { 384 402 MJCalibTest job4(Form("MJCalibTest #%d", seq.GetSequence())); 385 job4.SetBadPixels(job 3.GetBadPixels());403 job4.SetBadPixels(job2.GetBadPixels()); 386 404 job4.SetSequence(seq); 387 405 job4.SetEnv(kConfig); … … 391 409 job4.SetPathOut(kOutpathC); 392 410 job4.SetPathData(kInpathD); 411 job4.SetDataType(kDataType); 393 412 394 413 if (!job4.ProcessFile(job1.GetPedestalCam())) … … 423 442 job1.SetPathData(kInpathD); 424 443 job1.SetPathIn(kInpathY); 444 job1.SetDataType(kDataType); 425 445 //job1.SetPathOut(kOutpathY); // not yet needed 426 446 job1.SetUseData(); … … 452 472 job2.SetPathData(kInpathD); 453 473 job2.SetPathIn(kInpathY); 474 job2.SetDataType(kDataType); 454 475 // job1.SetPathOut(kOutpathC); // not yet needed 455 476 // job1.SetPathIn(kInpathC); // not yet needed … … 486 507 job3.SetPathData(kInpathD); 487 508 job3.SetPathIn(kInpathY); 509 job3.SetDataType(kDataType); 488 510 // job1.SetPathOut(kOutpathC); // not yet needed 489 511 // job1.SetPathIn(kInpathC); // not yet needed … … 519 541 job4.SetPathOut(kOutpathY); 520 542 job4.SetPathData(kInpathD); 543 job4.SetDataType(kDataType); 521 544 522 545 // Where to search for calibration files -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r5971 r6282 140 140 // R use the range specified in the function range 141 141 // Q quiet mode 142 // E Perform better Errors estimation using Minos technique 142 143 h.Fit(fFunc, "NQI", "", bgmin, bgmax); 143 144 … … 175 176 // R use the range specified in the function range 176 177 // Q quiet mode 178 // E Perform better Errors estimation using Minos technique 177 179 h.Fit(fFunc, "NQI", "", 0, sigmax); 178 180 … … 261 263 // R use the range specified in the function range 262 264 // Q quiet mode 265 // E Perform better Errors estimation using Minos technique 263 266 TH1D h(hon); 264 267 h.Add(&hof, -1); … … 317 320 f.fScaleMode = fScaleMode; 318 321 f.fScaleUser = fScaleUser; 322 f.fStrategy = fStrategy; 319 323 f.fCoefficients.Set(fCoefficients.GetSize()); 320 324 f.fCoefficients.Reset(); … … 494 498 } 495 499 500 Double_t MAlphaFitter::GetMinimizationValue() const 501 { 502 switch (fStrategy) 503 { 504 case kSignificance: 505 return -GetSignificance(); 506 case kSignificanceChi2: 507 return -GetSignificance()/GetChiSqSignal(); 508 } 509 return 0; 510 } 511 496 512 Int_t MAlphaFitter::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 497 513 { … … 537 553 } 538 554 539 return rc; 540 } 555 if (IsEnvDefined(env, prefix, "MinimizationStrategy", print)) 556 { 557 TString txt = GetEnvValue(env, prefix, "MinimizationStrategy", ""); 558 txt = txt.Strip(TString::kBoth); 559 txt.ToLower(); 560 if (txt==(TString)"Significance") 561 fStrategy = kSignificance; 562 if (txt==(TString)"SignificanceChi2") 563 fStrategy = kSignificanceChi2; 564 rc = kTRUE; 565 } 566 567 return rc; 568 } -
trunk/MagicSoft/Mars/mjobs/MJCalib.h
r6281 r6282 10 10 class MJCalib : public MJob 11 11 { 12 public: 13 enum DataType_t 14 { 15 kIsUseRootData, 16 kIsUseRawData, 17 kIsUseMC 18 }; 19 12 20 private: 13 Byte_t 21 Byte_t fDataFlag; // Bit-field to store the data type 14 22 15 23 protected: 24 MRunIter *fRuns; // Data files, only used for test applications, default is sequence files! 16 25 17 MRunIter *fRuns; // Data files, only used for test applications, default is sequence files! 18 19 enum DataType_t 20 { 21 kIsUseRawData, 22 kIsUseRootData, 23 kIsUseMC 24 }; 25 26 Bool_t IsUseRawData() const { return fDataFlag==kIsUseRawData; } 27 Bool_t IsUseRootData() const { return fDataFlag==kIsUseRootData; } 28 Bool_t IsUseMC() const { return fDataFlag==kIsUseMC; } 29 30 void SetUseRawData ( const Bool_t b=kTRUE ) { fDataFlag=kIsUseRawData; } 31 void SetUseRootData( const Bool_t b=kTRUE ) { fDataFlag=kIsUseRootData; } 32 void SetUseMC ( const Bool_t b=kTRUE ) { fDataFlag=kIsUseMC; } 33 34 Bool_t CheckEnvLocal(); 26 Bool_t CheckEnvLocal(); 35 27 36 28 public: 29 MJCalib(); 37 30 38 MJCalib(); 31 void SetInput(MRunIter *iter) { fRuns = iter; } 32 33 Bool_t IsUseRawData() const { return fDataFlag==kIsUseRawData; } 34 Bool_t IsUseRootData() const { return fDataFlag==kIsUseRootData; } 35 Bool_t IsUseMC() const { return fDataFlag==kIsUseMC; } 36 37 void SetUseRawData () { fDataFlag=kIsUseRawData; } 38 void SetUseRootData() { fDataFlag=kIsUseRootData; } 39 void SetUseMC () { fDataFlag=kIsUseMC; } 40 41 void SetDataType(DataType_t type) { fDataFlag=type; } 39 42 40 void SetInput ( MRunIter *iter ) { fRuns = iter; } 41 42 ClassDef(MJCalib, 0) // Base class for calibration jobs 43 ClassDef(MJCalib, 0) // Base class for calibration jobs 43 44 }; 44 45
Note:
See TracChangeset
for help on using the changeset viewer.