- Timestamp:
- 04/18/05 10:35:54 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6948 r6949 54 54 - fixed a typo in output 55 55 - allow to exchange Test-/Train-Sample 56 57 * ganymed.cc: 58 - implemented "-mc" option to allow cutting MC samples 59 60 * showlog.cc: 61 - implemented real treatment of debug-levels 62 - return 1 instead of 0 in cae of normal finish 63 64 * manalysis/MEnergyEstimate.h, mbase/MContinue.h, 65 mhflux/MAlphaFitter.h: 66 - added Print() to context //*MENU* 67 68 * manalysis/MMatrixLoop.cc: 69 - fixed returning of number of entries if using split mode 70 71 * mbase/MContinue.cc: 72 - implemented Print() function 73 74 * mbase/MParContainer.[h,cc]: 75 - in Read set name of object to argument name if argument!=NULL 76 - reordered some checks for Method calls 77 78 * mdata/MDataFormula.cc: 79 - fixed a problem with the replacement if using [?] for 80 fits 81 82 * mfbase/MFEventSelector2.cc: 83 - replaced some +=1 and -=1 by ++ and -- 84 85 * mfileio/MReadMarsFile.cc: 86 - fixed a bug which caused Preprocess to crahs if instatiated 87 with default constructor 88 89 * mhbase/MH.cc, mhflux/MHEffectiveOnTime.cc: 90 - use dynamic_cast if getting "stats" 91 92 * mhflux/MAlphaFitter.cc: 93 - small updates to output 94 95 * mhflux/MHEnergyEst.cc: 96 - fixed all axis lables 97 - implemented fit of resolution 98 - initialize fBias=0 in SetupFill 99 - enhances Print() output 100 101 * mjobs/MJCalibrateSignal.cc: 102 - added all tasks for interleaved calibration events to 103 a third tasklist. Skip all following tasks for these events 104 105 * mjobs/MJCut.[h,cc]: 106 - implemented correct treatment of MC files 107 - write resulting events to result file if no filename set 108 - moved energy estimator behind cuts 109 110 * mjobs/MJOptimize.cc: 111 - changed RunEnergy such, that it can correctly treat 112 MC files written by ganymed using wobble-mode 56 113 57 114 -
trunk/MagicSoft/Mars/NEWS
r6948 r6949 1 1 -*-*- END -*-*- 2 2 *** Version <cvs> 3 4 - Do NOT further process interleaved calibration events in 5 MJCalibrateSignal - exspecially do not write them to output! 3 6 4 7 -
trunk/MagicSoft/Mars/ganymed.cc
r6932 r6949 49 49 gLog << " -b Batch mode (no graphical output to screen)" << endl<<endl; 50 50 gLog << " Operation Mode:" << endl; 51 gLog << " -mc Monte Carlo dataset (no times)" << endl; 51 52 gLog << " --wobble Force wobble mode (overwrites dataset)" << endl; 52 53 gLog << " --no-wobble Force normal mode (overwrites dataset)" << endl << endl; … … 120 121 //const Bool_t kForceExec = arg.HasOnlyAndRemove("-ff"); 121 122 123 const Bool_t kIsMc = arg.HasOnlyAndRemove("-mc"); 122 124 const Bool_t kWobbleModeOn = arg.HasOnlyAndRemove("--wobble"); 123 125 const Bool_t kWobbleModeOff = arg.HasOnlyAndRemove("--no-wobble"); … … 239 241 job.EnableWobbleMode(iswobble); 240 242 job.EnableFullDisplay(kFullDisplay); 243 job.EnableMonteCarloMode(kIsMc); 241 244 if (kWriteSummary) // Don't change flag set in SetNameSummaryFile 242 245 job.EnableStorageOfSummary(); -
trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h
r6932 r6949 28 28 void SetVariables(const TArrayD &); 29 29 30 void Print(Option_t *o="") const; 30 void Print(Option_t *o="") const; //*MENU* 31 31 32 32 ClassDef(MEnergyEstimate, 1) // Task to estimate the energy by a rule -
trunk/MagicSoft/Mars/manalysis/MMatrixLoop.cc
r6924 r6949 58 58 UInt_t MMatrixLoop::GetEntries() 59 59 { 60 return fMatrix ? fMatrix->GetNumRows() : 0; 60 if (!fMatrix) 61 return 0; 62 63 return fOperationMode==kDefault ? fMatrix->GetNumRows() : (fMatrix->GetNumRows()+1)/2; 61 64 } 62 65 -
trunk/MagicSoft/Mars/mbase/MContinue.cc
r5994 r6949 227 227 } 228 228 229 void MContinue::Print(Option_t *o) const 230 { 231 *fLog << all << GetDescriptor() << ":"; 232 if (GetFilter()) 233 *fLog << " <" << GetFilter()->GetDescriptor() << ">"; 234 *fLog << endl; 235 if (GetFilter()) 236 Getfilter()->Print(); 237 } 238 229 239 // -------------------------------------------------------------------------- 230 240 // -
trunk/MagicSoft/Mars/mbase/MContinue.h
r5994 r6949 42 42 Bool_t IsAllowEmpty() const { return TestBit(kAllowEmpty); } 43 43 44 45 44 void SetInverted(Bool_t i=kTRUE); 46 45 Bool_t IsInverted() const; … … 51 50 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 52 51 52 // TObject 53 void Print(Option_t *o="") const; //*MENU* 54 53 55 ClassDef(MContinue, 1) //Task returning kCONTINUE 54 56 }; -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r6500 r6949 321 321 } 322 322 323 Int_t MParContainer::Read(const char *name) 324 { 325 const Int_t rc = TObject::Read(name?name:(const char*)fName); 326 if (name) 327 SetName(name); 328 return rc; 329 } 330 323 331 // -------------------------------------------------------------------------- 324 332 // … … 640 648 641 649 *fLog << "Trying to find MethodCall '" << ClassName(); 642 *fLog << ":: Get" << part1 << "' instead..." << flush;643 call = new TMethodCall(IsA(), (TString)"Get"+part1, "");650 *fLog << "::" << part1 << "' instead..." << flush; 651 call = new TMethodCall(IsA(), part1, ""); 644 652 if (call->GetMethod()) 645 653 { … … 653 661 654 662 *fLog << "Trying to find MethodCall '" << ClassName(); 655 *fLog << ":: " << part1 << "' instead..." << flush;656 call = new TMethodCall(IsA(), part1, "");663 *fLog << "::Get" << part1 << "' instead..." << flush; 664 call = new TMethodCall(IsA(), (TString)"Get"+part1, ""); 657 665 if (call->GetMethod()) 658 666 { -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r6500 r6949 122 122 virtual Bool_t AsciiWrite(ostream &out) const; 123 123 124 Int_t Read(const char *name=NULL) { return TObject::Read(name?name:(const char*)fName); }124 Int_t Read(const char *name=NULL); 125 125 126 126 virtual void GetNames(TObjArray &arr) const; -
trunk/MagicSoft/Mars/mdata/MDataFormula.cc
r6894 r6949 108 108 fMembers.AddLast(chain); 109 109 110 txt.ReplaceAll(arg, Form("[%d]", num++));110 args.Remove(0, len+1); 111 111 pos1 += len; 112 112 113 args.Remove(0, len+1);113 txt.Replace(txt.Index(arg), len, Form("[%d]", num++)); 114 114 } 115 115 -
trunk/MagicSoft/Mars/mfbase/MFEventSelector2.cc
r6916 r6949 481 481 { 482 482 // how many events do we still want to read in this bin 483 fNom[bin] -= 1;483 fNom[bin]--; 484 484 rc = kTRUE; 485 485 … … 491 491 492 492 // how many events are still pending to be read 493 fIs[bin] -= 1;493 fIs[bin]--; 494 494 495 495 return rc; … … 530 530 { 531 531 fResult = kFALSE; 532 fCounter[1] += 1;532 fCounter[1]++; 533 533 return kTRUE; 534 534 } … … 539 539 if (!fResult) 540 540 { 541 fCounter[2] += 1;541 fCounter[2]++; 542 542 return kTRUE; 543 543 } 544 544 545 fCounter[0] += 1;545 fCounter[0]++; 546 546 547 547 return kTRUE; -
trunk/MagicSoft/Mars/mfileio/MReadMarsFile.cc
r6513 r6949 142 142 // returns the number of file which were added 143 143 // 144 if (!fRun) 145 return -1; 146 144 147 Int_t n1 = fRun->AddFile(fname); 145 148 Int_t n2 = MReadTree::AddFile(fname, entries); … … 231 234 Int_t MReadMarsFile::PreProcess(MParList *pList) 232 235 { 236 if (!fRun) 237 { 238 *fLog << err << "Error - Cannot use MReadMarsFile instantiated with default constructor... aborting." << endl; 239 return kFALSE; 240 } 241 233 242 fParList = pList; 234 243 -
trunk/MagicSoft/Mars/mhbase/MH.cc
r6948 r6949 771 771 // Rename first statistics box 772 772 // 773 TPaveStats *s1 = (TPaveStats*)gPad->FindObject("stats");773 TPaveStats *s1 = dynamic_cast<TPaveStats*>(gPad->FindObject("stats")); 774 774 if (!s1) 775 s1 = (TPaveStats*)hist1.GetListOfFunctions()->FindObject("stats");775 s1 = dynamic_cast<TPaveStats*>(hist1.GetListOfFunctions()->FindObject("stats")); 776 776 else 777 777 s1->SetName((TString)"Stat"+hist1.GetTitle()); … … 793 793 // Draw Legend 794 794 // 795 TPaveStats *s2 = (TPaveStats*)gPad->FindObject("stats");795 TPaveStats *s2 = dynamic_cast<TPaveStats*>(gPad->FindObject("stats")); 796 796 if (!s2) 797 s2 = (TPaveStats*)hist2.GetListOfFunctions()->FindObject("stats");797 s2 = dynamic_cast<TPaveStats*>(hist2.GetListOfFunctions()->FindObject("stats")); 798 798 799 799 if (s2) … … 866 866 // 867 867 // Where to get the TPaveStats depends on the root version 868 TPaveStats *s1 = (TPaveStats*)gPad->FindObject("stats");868 TPaveStats *s1 = dynamic_cast<TPaveStats*>(gPad->FindObject("stats")); 869 869 if (!s1) 870 s1 = (TPaveStats*)hist1.GetListOfFunctions()->FindObject("stats");870 s1 = dynamic_cast<TPaveStats*>(hist1.GetListOfFunctions()->FindObject("stats")); 871 871 else 872 872 s1->SetName((TString)"Stat"+hist1.GetTitle()); … … 889 889 // 890 890 // Where to get the TPaveStats depends on the root version 891 TPaveStats *s2 = (TPaveStats*)gPad->FindObject("stats");891 TPaveStats *s2 = dynamic_cast<TPaveStats*>(gPad->FindObject("stats")); 892 892 if (!s2) 893 s2 = (TPaveStats*)hist2.GetListOfFunctions()->FindObject("stats");893 s2 = dynamic_cast<TPaveStats*>(hist2.GetListOfFunctions()->FindObject("stats")); 894 894 895 895 if (s2) -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r6926 r6949 347 347 { 348 348 *fLog << "Result:" << endl; 349 *fLog << " - Significance 350 *fLog << " - Excess Events " << fEventsExcess << endl;351 *fLog << " - Signal Events " << fEventsSignal << endl;352 *fLog << " - Background Events " << fEventsBackground << endl;353 *fLog << " - Chi^2/ndf (Signal) " << fChiSqSignal << endl;354 *fLog << " - Chi^2/ndf (Background) " << fChiSqBg << endl;355 *fLog << " - Signal integrated 356 *fLog << " - Scale Factor (Off) " << fScaleFactor << endl;349 *fLog << " - Significance (Li/Ma) " << fSignificance << endl; 350 *fLog << " - Excess Events " << fEventsExcess << endl; 351 *fLog << " - Signal Events " << fEventsSignal << endl; 352 *fLog << " - Background Events " << fEventsBackground << endl; 353 *fLog << " - Chi^2/ndf (Signal) " << fChiSqSignal << endl; 354 *fLog << " - Chi^2/ndf (Background) " << fChiSqBg << endl; 355 *fLog << " - Signal integrated up to " << fIntegralMax << "°" << endl; 356 *fLog << " - Scale Factor (Off) " << fScaleFactor << endl; 357 357 } 358 358 } -
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.h
r6892 r6949 86 86 87 87 void Clear(Option_t *o=""); 88 void Print(Option_t *o="") const; 88 void Print(Option_t *o="") const; //*MENU* 89 89 void Copy(TObject &o) const; 90 90 /* -
trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
r6283 r6949 660 660 { 661 661 TVirtualPad *p=gPad->GetPad(x+1)->GetPad(y+1); 662 if (!(st = (TPaveStats*)p->GetPrimitive("stats")))662 if (!(st = dynamic_cast<TPaveStats*>(p->GetPrimitive("stats")))) 663 663 continue; 664 664 -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
r6932 r6949 36 36 37 37 #include <TLine.h> 38 #include <TCanvas.h> 38 #include <TCanvas.h> 39 #include <TStyle.h> 39 40 #include <TProfile.h> 41 #include <TPaveStats.h> 40 42 41 43 #include "MString.h" … … 78 80 fHResolution.SetDirectory(NULL); 79 81 fHResolution.SetName("EnergyRes"); 80 fHResolution.SetTitle("Histogram in \\ frac{\\Delta lg(E)}{lg(E_{mc})}vs E_{est} and E_{mc}");82 fHResolution.SetTitle("Histogram in \\Delta lg(E) vs E_{est} and E_{mc}"); 81 83 fHResolution.SetXTitle("E_{est} [GeV]"); 82 84 fHResolution.SetYTitle("E_{mc} [GeV]"); 83 fHResolution.SetZTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");85 fHResolution.SetZTitle("lg(E_{est}) - lg(E_{mc})"); 84 86 85 87 fHImpact.SetDirectory(NULL); 86 88 fHImpact.SetName("Impact"); 87 fHImpact.SetTitle("\\ frac{\\Delta lg(E)}{lg(E)}vs Impact parameter");89 fHImpact.SetTitle("\\Delta lg(E) vs Impact parameter"); 88 90 fHImpact.SetXTitle("Impact parameter [m]"); 89 fHImpact.SetYTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");91 fHImpact.SetYTitle("lg(E_{est}) - lg(E_{mc})"); 90 92 91 93 fHEnergy.Sumw2(); … … 147 149 148 150 fChisq = 0; 151 fBias = 0; 149 152 fHEnergy.Reset(); 150 153 fHImpact.Reset(); … … 164 167 const Double_t imp = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100; 165 168 const Double_t theta = fMatrix ? GetVal(2) : fMcEvt->GetTelescopeTheta()*TMath::RadToDeg(); 166 const Double_t res = (log10(eest)-log10(etru));///log10(etru);167 const Double_t resE 169 const Double_t res = log10(eest)-log10(etru);///log10(etru); 170 const Double_t resE = (eest-etru)/etru; 168 171 169 172 fHEnergy.Fill(eest, etru, theta, w); … … 171 174 fHImpact.Fill(imp, resE, w); 172 175 173 fChisq += res*res; 174 fBias += res; 176 //if (etru>125 && etru<750) 177 // return kCONTINUE; 178 179 // lg(N) = 4.3*lg(E)-6 180 // lg(N0) = 4.3*2.2-6 181 182 const Double_t n = 2; //pow(10, -4.3*(log10(etru)-2.2)); 183 184 fChisq += log10(etru)<2.2? res*res*n/2:res*res; 185 fBias += log10(etru)<2.2? res*sqrt(n/2):res; 175 186 176 187 return kTRUE; … … 192 203 void MHEnergyEst::Print(Option_t *o) const 193 204 { 205 const Double_t res = TMath::Sqrt(fChisq-fBias*fBias); 206 const Double_t resp = TMath::Power(10, res)-1; 207 const Double_t resm = 1-TMath::Power(10, -res); 208 209 if (TMath::IsNaN(res)) 210 { 211 *fLog << all << "MHEnergyEst::Print: ERROR - Resolution is NaN (not a number)." << endl; 212 return; 213 } 214 194 215 *fLog << all; 195 *fLog << "Mean log10(Energy) Resoltion: " << Form("%5.2f%%", TMath::Sqrt(fChisq-fBias*fBias)) << endl; 196 *fLog << "Mean log10(Energy) Bias: " << Form("%5.2f%%", fBias) << endl; 216 *fLog << "Mean log10(Energy) Resoltion: +/- " << Form("%4.2f", res) << endl; 217 *fLog << "Mean log10(Energy) Bias: " << Form("%+4.2f", fBias) << endl; 218 *fLog << "Asymmetric Energy Resoltion: +" << Form("%4.1f%%", resp*100) << " -" << Form("%4.1f%%", resm*100) << endl; 197 219 } 198 220 … … 246 268 247 269 pad->GetPad(1)->GetPad(2)->cd(2); 248 /*=*/fHResolution.ProjectionZ("Resolution"); 249 ///*h =*/ fHImpact.ProjectionX("Impact", -1, 9999, "e"); 270 hx = (TH1D*)fHResolution.ProjectionZ("Resolution"); 271 TPaveStats *stats = dynamic_cast<TPaveStats*>(hx->FindObject("stats")); 272 if (stats) 273 { 274 stats->SetBit(BIT(17)); // TStyle.cxx: kTakeStyle=BIT(17) 275 stats->SetX1NDC(0.63); 276 stats->SetY1NDC(0.68); 277 } 278 279 hx->Fit("gaus", "Q"); 280 gPad=NULL; 281 gStyle->SetOptFit(101); 250 282 } 251 283 } … … 325 357 // h1->Draw("Chistsame"); 326 358 327 return h 1;359 return h2; 328 360 } 329 361 … … 415 447 //h->SetXTitle("\\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}"); 416 448 h->SetYTitle("Counts"); 417 h->SetTitle("Distribution of \\Delta lg(E) / lg(E_{mc})");449 h->SetTitle("Distribution of \\Delta lg(E)"); 418 450 h->SetDirectory(NULL); 419 451 h->SetBit(kCanDelete); 420 452 h->GetXaxis()->SetRangeUser(-1.3, 1.3); 421 453 h->Draw(""); 454 //h->Fit("gaus"); 422 455 // ---------------------------------------- 423 456 … … 440 473 h = MakePlot(fHResolution, "zy"); 441 474 h->SetXTitle("E_{mc} [GeV]"); 442 h->SetYTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");443 h->SetTitle("Energy resolution \\Delta lg(E) / lg(E)vs Monte Carlo energy E_{mc}");475 h->SetYTitle("lg(E_{est}) - lg(E_{mc})"); 476 h->SetTitle("Energy resolution \\Delta lg(E) vs Monte Carlo energy E_{mc}"); 444 477 h->SetMinimum(-1.3); 445 478 h->SetMaximum(1.3); … … 448 481 h = MakePlot(fHResolution, "zx"); 449 482 h->SetXTitle("E_{est} [GeV]"); 450 h->SetYTitle(" \\frac{lg(E_{est}) - lg(E_{mc})}{lg(E_{mc})}");451 h->SetTitle("Energy Resolution \\Delta lg(E) / lg(E)vs estimated Energy E_{est}");483 h->SetYTitle("lg(E_{est}) - lg(E_{mc})"); 484 h->SetTitle("Energy Resolution \\Delta lg(E) vs estimated Energy E_{est}"); 452 485 h->SetMinimum(-1.3); 453 486 h->SetMaximum(1.3); -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r6919 r6949 726 726 tlist2.AddToList(&pedlo3); 727 727 //----------------------------------------------------------- 728 729 MTaskList tlist3; 730 tlist3.SetFilter(&fcalib); 731 732 MContinue contcal; 728 733 if (fIsInterlaced) 729 734 { 730 pinext.SetFilter(&fcalib);731 bldext.SetFilter(&fcalib);732 taskenv3.SetFilter(&fcalib);733 pacalc.SetFilter(&fcalib);734 filcam.SetFilter(&fcalib);735 filtme.SetFilter(&fcalib);736 filbnd.SetFilter(&fcalib);737 filpin.SetFilter(&fcalib);738 chcalc.SetFilter(&fcalib);739 recalc.SetFilter(&fcalib);740 741 735 tlist2.AddToList(&fcalib); 742 tlist2.AddToList(&pinext); 743 tlist2.AddToList(&bldext); 744 tlist2.AddToList(&taskenv3); 745 tlist2.AddToList(&pacalc); 746 tlist2.AddToList(&filcam); 736 tlist2.AddToList(&tlist3); 737 738 tlist3.AddToList(&pinext); 739 tlist3.AddToList(&bldext); 740 tlist3.AddToList(&taskenv3); 741 tlist3.AddToList(&pacalc); 742 tlist3.AddToList(&filcam); 747 743 if (fIsRelTimesUpdate) 748 tlist 2.AddToList(&filtme);744 tlist3.AddToList(&filtme); 749 745 if (IsUseBlindPixel()) 750 tlist 2.AddToList(&filbnd);746 tlist3.AddToList(&filbnd); 751 747 if (IsUsePINDiode()) 752 tlist 2.AddToList(&filpin);753 tlist 2.AddToList(&chcalc);748 tlist3.AddToList(&filpin); 749 tlist3.AddToList(&chcalc); 754 750 if (fIsRelTimesUpdate) 755 tlist2.AddToList(&recalc); 756 } 751 tlist3.AddToList(&recalc); 752 tlist3.AddToList(&fill8); 753 tlist3.AddToList(&contcal); 754 } 757 755 758 756 tlist2.AddToList(&conttp); … … 772 770 if (extractor2 || extractor1->InheritsFrom("MExtractTimeAndCharge")) 773 771 tlist2.AddToList(&caltm); 774 if (fIsInterlaced)775 tlist2.AddToList(&fill8);776 772 tlist2.AddToList(&bpcal); 777 773 tlist2.AddToList(&treat); -
trunk/MagicSoft/Mars/mjobs/MJCut.cc
r6948 r6949 45 45 46 46 #include "MReadReports.h" 47 #include "MReadMarsFile.h" 47 48 #include "MPrint.h" 48 49 #include "MContinue.h" … … 74 75 MJCut::MJCut(const char *name, const char *title) 75 76 : fStoreSummary(kFALSE), fStoreResult(kFALSE), fWriteOnly(kFALSE), 76 fIsWobble(kFALSE), f FullDisplay(kFALSE), /*fSubstraction(kFALSE),*/77 fIsWobble(kFALSE), fIsMonteCarlo(kFALSE), fFullDisplay(kFALSE), /*fSubstraction(kFALSE),*/ 77 78 fEstimateEnergy(0), fCalcHadronness(0) 78 79 { … … 181 182 return kFALSE; 182 183 } 183 env1 = o ? (MTask*)o->Clone() : NULL;184 env1 = o ? (MTask*)o->Clone() : FNULL; 184 185 185 186 o = file.Get("CalcHadronness"); … … 212 213 *fLog << inf << "Writing to file: " << oname << endl; 213 214 214 TFile file(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCut", 9); 215 if (!file.IsOpen()) 215 TFile *file = 0; 216 if (fNameResult.IsNull()) 217 { 218 file = (TFile*)gROOT->GetListOfFiles()->FindObject(oname); 219 if (file) 220 file->cd(); 221 } 222 else 223 file = TFile::Open(oname, fOverwrite?"RECREATE":"NEW", "File created by MJCut", 9); 224 225 if (!file) 216 226 { 217 227 *fLog << err << "ERROR - Couldn't open file " << oname << " for writing..." << endl; … … 219 229 } 220 230 221 return WriteContainer(cont); 231 const Bool_t rc = WriteContainer(cont); 232 233 if (!fNameResult.IsNull()) 234 delete file; 235 236 return rc; 222 237 } 223 238 … … 260 275 EnableStorageOfResult(GetEnv("ResultFile", fStoreResult)); 261 276 EnableWobbleMode(GetEnv("WobbleMode", fIsWobble)); 277 EnableMonteCarloMode(GetEnv("MonteCarlo", fIsMonteCarlo)); 262 278 EnableFullDisplay(GetEnv("FullDisplay", fFullDisplay)); 263 279 //EnableSubstraction(GetEnv("HistogramSubstraction", fSubstraction)); … … 292 308 write->AddContainer("MHadronness", "Events", kFALSE); 293 309 write->AddContainer("MEnergyEst", "Events", kFALSE); 310 write->AddContainer("MMcEvt", "Events", kFALSE); 294 311 write->AddContainer("DataType", "Events"); 295 312 … … 398 415 399 416 // ------------- Loop Off Data -------------------- 400 MReadReports readoff; 401 readoff.AddTree("Events", "MTime.", kTRUE); 402 readoff.AddTree("Drive"); 403 readoff.AddTree("EffectiveOnTime"); 417 MReadReports readoffdata; 418 readoffdata.AddTree("Events", "MTime.", kTRUE); 419 readoffdata.AddTree("Drive"); 420 readoffdata.AddTree("EffectiveOnTime"); 421 422 MReadMarsFile readoffmc("Events"); 423 readoffmc.DisableAutoScheme(); 424 425 MRead &readoff = fIsMonteCarlo ? (MRead&)readoffmc : (MRead&)readoffdata; 404 426 if (fIsWobble) 405 427 set.AddFilesOn(readoff); … … 411 433 TString fname1(path); 412 434 fname0 += fNameSummary.IsNull() ? (TString) Form("ganymed%08d-summary.root", set.GetNumAnalysis()) : fNameSummary; 413 fname1 += fNameResult.IsNull() ? (TString) Form("ganymed%08d -result.root",set.GetNumAnalysis()) : fNameResult;435 fname1 += fNameResult.IsNull() ? (TString) Form("ganymed%08d.root", set.GetNumAnalysis()) : fNameResult; 414 436 415 437 MWriteRootFile *write0 = CanStoreSummary() ? new MWriteRootFile(fPathOut.IsNull()?0:fname0.Data(), fOverwrite?"RECREATE":"NEW") : 0; … … 443 465 444 466 MPrint print2("MEffectiveOnTime"); 467 print2.EnableSkip(); 445 468 446 469 // How to get source position from off- and on-data? … … 460 483 if (fIsWobble) 461 484 tlist2.AddToList(&hcalc2); 462 tlist2.AddToList(&taskenv1);463 485 tlist2.AddToList(&taskenv2); 464 486 tlist2.AddToList(&cont0); … … 468 490 tlist2.AddToList(&fill1a); 469 491 tlist2.AddToList(&cont1); 492 tlist2.AddToList(&taskenv1); 470 493 if (!fWriteOnly && !fIsWobble) 471 494 tlist2.AddToList(&ffs); … … 503 526 return kFALSE; 504 527 528 TObjArray cont; 529 cont.Add(&fit); 530 cont.Add(&cont0); 531 cont.Add(&cont1); 532 cont.Add(&cont2); 533 cont.Add(&cont3); 534 if (taskenv1.GetTask()) 535 cont.Add(taskenv1.GetTask()); 536 if (taskenv2.GetTask()) 537 cont.Add(taskenv2.GetTask()); 538 539 if (!WriteTasks(set.GetNumAnalysis(), cont)) 540 return kFALSE; 541 505 542 if (set.HasOffSequences() || fIsWobble) 506 543 { … … 524 561 525 562 // ------------- Loop On Data -------------------- 526 MReadReports readon; 527 readon.AddTree("Events", "MTime.", kTRUE); 528 readon.AddTree("Drive"); 529 readon.AddTree("EffectiveOnTime"); 563 MReadReports readondata; 564 readondata.AddTree("Events", "MTime.", kTRUE); 565 readondata.AddTree("Drive"); 566 readondata.AddTree("EffectiveOnTime"); 567 568 MReadMarsFile readonmc("Events"); 569 readonmc.DisableAutoScheme(); 570 571 MRead &readon = fIsMonteCarlo ? (MRead&)readonmc : (MRead&)readondata; 530 572 set.AddFilesOn(readon); 531 573 … … 614 656 tlist2.Replace(&ffs2); 615 657 616 tlist.AddToList(&fillvs, "EffectiveOnTime"); 658 if (!fIsMonteCarlo) 659 tlist.AddToList(&fillvs, "EffectiveOnTime"); 617 660 } 618 661 619 662 par.SetVal(1); 620 621 TObjArray cont;622 cont.Add(&cont0);623 cont.Add(&cont1);624 cont.Add(&cont2);625 cont.Add(&cont3);626 if (taskenv1.GetTask())627 cont.Add(taskenv1.GetTask());628 if (taskenv2.GetTask())629 cont.Add(taskenv2.GetTask());630 631 if (!WriteTasks(set.GetNumAnalysis(), cont))632 return kFALSE;633 663 634 664 // Execute first analysis -
trunk/MagicSoft/Mars/mjobs/MJCut.h
r6948 r6949 18 18 Bool_t fWriteOnly; 19 19 Bool_t fIsWobble; 20 Bool_t fIsMonteCarlo; 20 21 Bool_t fFullDisplay; 21 22 //Bool_t fSubstraction; … … 48 49 void EnableWriteOnly(Bool_t b=kTRUE) { fWriteOnly = b; } 49 50 void EnableWobbleMode(Bool_t b=kTRUE) { fIsWobble = b; } 51 void EnableMonteCarloMode(Bool_t b=kTRUE) { fIsMonteCarlo = b; } 50 52 void EnableFullDisplay(Bool_t b=kTRUE) { fFullDisplay = b; } 51 53 //void EnableSubstraction(Bool_t b=kTRUE) { fSubstraction = b; } -
trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
r6948 r6949 94 94 #include "MGeomCamCT1.h" 95 95 #include "MFEventSelector.h" 96 #include "MFDataMember.h" 96 97 #include "MReadTree.h" 97 98 #include "MHMatrix.h" … … 111 112 #include "MContinue.h" 112 113 #include "MGeomCamMagic.h" 113 #include " ../mimage/MHillasSrcCalc.h"114 #include "MHillasSrcCalc.h" 114 115 #include "MHMatrix.h" 115 116 #include "MMatrixLoop.h" … … 118 119 #include "../mhflux/MHEnergyEst.h" 119 120 #include "MDirIter.h" 120 #include " ../mjobs/MSequence.h"121 #include "MSequence.h" 121 122 122 123 using namespace std; … … 999 1000 MParList parlist; 1000 1001 1002 MParameterI par("DataType"); 1003 par.SetVal(1); 1004 parlist.AddToList(&par); 1005 1006 MFDataMember filter("DataType.fVal", '>', 0.5); 1007 fPreCuts.Add(&filter); 1008 1001 1009 MGeomCamMagic geom; // For GetConvMm2Deg 1002 1010 parlist.AddToList(&geom); … … 1023 1031 return kFALSE; 1024 1032 1033 fPreCuts.Remove(&filter); 1034 1025 1035 MTaskList tasklist; 1026 1036 parlist.Replace(&tasklist); -
trunk/MagicSoft/Mars/showlog.cc
r6888 r6949 99 99 else 100 100 s.ReplaceAll("", "\033"); 101 gLog << s << endl; 101 102 // Check whether it is an empty line 103 if (s=="\033[0m") 104 { 105 gLog << endl; 106 continue; 107 } 108 109 while (!s.IsNull()) 110 { 111 Ssiz_t pos = s.First("\033["); 112 if (pos<0) 113 { 114 gLog << s; 115 break; 116 } 117 118 gLog << s(0, pos); 119 s.Remove(0, pos+1); 120 if (s.BeginsWith("0m") && s.Length()>3) 121 { 122 gLog << all; 123 s.Remove(0, 2); 124 continue; 125 } 126 if (s.BeginsWith("31m")) 127 { 128 gLog << err; 129 s.Remove(0, 3); 130 continue; 131 } 132 if (s.BeginsWith("32m")) 133 { 134 gLog << inf; 135 s.Remove(0, 3); 136 continue; 137 } 138 if (s.BeginsWith("33m")) 139 { 140 gLog << warn; 141 s.Remove(0, 3); 142 continue; 143 } 144 if (s.BeginsWith("34m")) 145 { 146 gLog << dbg; 147 s.Remove(0, 3); 148 continue; 149 } 150 gLog << "\033["; 151 } 152 gLog << endl; 102 153 } 103 154 … … 105 156 delete in; 106 157 107 return 0;158 return 1; 108 159 }
Note:
See TracChangeset
for help on using the changeset viewer.