- Timestamp:
- 08/20/07 11:04:58 (17 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/.rootrc
r8037 r8680 45 45 Root.Html.SearchEngine: http://magic.astro.uni-wuerzburg.de/mars/search.html 46 46 Root.Html.ViewCVS: http://www.astro.uni-wuerzburg.de/cgi-bin/viewcvs.cgi/ 47 48 ############################################################################# 49 # # 50 # Some default changes # 51 # # 52 ############################################################################# 53 54 #Canvas.HighLightColor: 3 55 #Canvas.MoveOpaque: 0 56 #Canvas.ResizeOpaque: 0 57 Canvas.ShowEventStatus: Yes 58 #Canvas.ShowToolBar: Yes 59 #Canvas.ShowEditor: Yes 60 #Canvas.AutoExec: No -
trunk/MagicSoft/Mars/Changelog
r8679 r8680 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2007/08/20 Thomas Bretz 22 23 * .rootrc: 24 - added some comments about defaults 25 - set the ShowEventStatus for the canvases to yes as default 26 27 * sponde.cc: 28 - removed the refill option (it was just a dummy) 29 - removed the accurate option. It didn't give more accurate 30 results at all 31 32 * mbase/MStatusDisplay.[h,cc]: 33 - added an update option to SetProgressBarPosition 34 35 * mhflux/MMcSpectrumWeight.[h,cc]: 36 - allow to give a container name to GetFormula* 37 - changed default for spectral slope from -9 to -99 38 - allow to give integral range to GetSpec*Integral 39 - added a new member function CompeleteEnergySpectrum which completes 40 a simulated spectrum starting at an energy fEnergyMin down to 41 an energy emin. 42 - added two options ("new" and "old") to Print function 43 - do not stop anymore if lower energy boundary changes 44 45 * mjobs/MJSpectrum.[h,cc]: 46 - cleaned the code in general 47 - removed fRefill (was not used in the code at all) 48 - added MJSpectrum to global ListOfCleanups to handle 49 the display more properly 50 - removed reading of the first (it was the second!) 51 MMcCorsikaRunHeader. It is now read for each file individually 52 - The read monte carlo events are now weighted with the mc 53 production area (events per area) 54 - incomplete (to lower energies) spectra are completed 55 - removed accurate mode, it was not more accurate 56 - we fit the spectrum now from the first to the last bin 57 - for comparison crab and 1553 are plotted 58 - changed the processing such that first the MCs are processed 59 and then the spectrum is refilled 60 - now the MC distribution from OriginalMC is read only once 61 - added new tab showing the basic event distribution 62 63 20 64 21 65 2007/08/19 Thomas Bretz -
trunk/MagicSoft/Mars/NEWS
r8679 r8680 223 223 give any improvement in accuracy, only decreased execution speed. 224 224 225 - sponde: the so called "simple"-mode has been removed. It didn't 226 give any improvement in simple. 227 228 - sponde: the so called "refill"-mode has been removed. It was anyhow 229 not implemented. 230 225 231 - sponde: now checks whether the theta distribution of your on-data 226 232 and the theta-distribution of your Monte Carlo sample (after … … 236 242 different maximum impact parameters. 237 243 244 - sponde: If MC files with different lower energy limits are used 245 the primary MC spectrum is artificially completed down to the 246 lowest energy used at all. WARNING: that this gives correct 247 collection areas ONLY if none of the events in this region would 248 survive your cuts at all. 249 238 250 - sponde: the output file now contains more information about 239 251 the spectrum (eg. the full 2D collection area histogram). … … 248 260 The same information you get from the error bars of the weighted 249 261 histograms, but this is less intuitive. 262 263 - sponde: The spectrum plots now show the crab- and 1553-spectrum 264 for comparison. It is not meant to show these curves in 265 publications, they are only for production. 266 267 - sponde: The OriginalMC tree with the events produced by corsika 268 is now processed only once 250 269 251 270 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r8678 r8680 602 602 // is assumed to be (0,1) 603 603 // 604 void MStatusDisplay::SetProgressBarPosition(Float_t p )604 void MStatusDisplay::SetProgressBarPosition(Float_t p, Bool_t upd) 605 605 { 606 606 fBar->SetPosition(p); 607 if (upd) 608 gClient->ProcessEventsFor(fBar); 607 609 } 608 610 … … 685 687 // p==NULL means: Take gClient->GetRoot() if not in batch mode 686 688 // see TGWindow::TGWindow() 689 690 // Make sure that the display is removed via RecursiveRemove 691 // from whereever possible. 692 SetBit(kMustCleanup); 687 693 688 694 // -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r8642 r8680 168 168 void SetUpdateTime(Long_t t); 169 169 170 void SetProgressBarPosition(Float_t p );170 void SetProgressBarPosition(Float_t p, Bool_t upd=kFALSE); 171 171 TGProgressBar *GetBar() const { return (TGProgressBar*)fBar; } 172 172 -
trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
r8674 r8680 19 19 ! Author(s): Marcos Lopez 10/2003 <mailto:marcos@gae.ucm.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 621 ! Copyright: MAGIC Software Development, 2000-2007 22 22 ! 23 23 ! … … 40 40 // Method: 41 41 // ------- 42 // 42 // 43 43 // - Corsika spectrun: dN/dE = A * E^(a) 44 44 // with a = fOldSlope, and A = N/integral{E*de} from ELowLim to EUppLim … … 72 72 // MMcEvt 73 73 // MMcCorsikaRunHeader 74 // [MPointingPos] 75 // [MHillas] 74 76 // 75 77 // Output Container: … … 81 83 #include <TF1.h> 82 84 #include <TH1.h> 85 #include <TH2.h> 86 #include <TH3.h> 83 87 #include <TSpline.h> 84 88 … … 109 113 fNameMcEvt = "MMcEvt"; 110 114 111 fNewSlope = -9 ;112 fOldSlope = -9 ;115 fNewSlope = -99; 116 fOldSlope = -99; 113 117 114 118 fEnergyMin = -1; … … 210 214 // The slope is returned as %.3f 211 215 // 212 TString MMcSpectrumWeight::GetFormulaSpecOld( ) const213 { 214 return Form("pow(%s.fEnergy, %.3f)", fNameMcEvt.Data(), fOldSlope);216 TString MMcSpectrumWeight::GetFormulaSpecOld(const char *name) const 217 { 218 return Form("pow(%s.fEnergy, %.3f)", name, fOldSlope); 215 219 } 216 220 … … 225 229 // unchanged. 226 230 // 227 TString MMcSpectrumWeight::GetFormulaSpecNew( ) const228 { 229 TString str = fFormula.IsNull() ? Form("pow(%s.fEnergy, %.3f)", fNameMcEvt.Data(), fNewSlope) : fFormula.Data();231 TString MMcSpectrumWeight::GetFormulaSpecNew(const char *name) const 232 { 233 TString str = fFormula.IsNull() ? Form("pow(%s.fEnergy, %.3f)", name, fNewSlope) : fFormula.Data(); 230 234 if (!fFormula.IsNull()) 231 str.ReplaceAll("X", Form("(%s.fEnergy)", fNameMcEvt.Data()));235 str.ReplaceAll("X", Form("(%s.fEnergy)", name)); 232 236 233 237 return str; … … 258 262 // Example: 0.3712780019*(pow(MMcEvt.fEnergy,-2.270))/(pow(MMcEvt.fEnergy,-2.600)) 259 263 // 260 TString MMcSpectrumWeight::GetFormulaWeights( ) const264 TString MMcSpectrumWeight::GetFormulaWeights(const char *name) const 261 265 { 262 266 if (GetFormulaSpecOld()==GetFormulaSpecNew()) … … 268 272 const Double_t norm = fNorm*iold/inew; 269 273 270 return Form("%.16e*(%s)/(%s)", norm, GetFormulaSpecNew( ).Data(), GetFormulaSpecOld().Data());274 return Form("%.16e*(%s)/(%s)", norm, GetFormulaSpecNew(name).Data(), GetFormulaSpecOld(name).Data()); 271 275 } 272 276 … … 276 280 // GetFormulaSpecNewX() describing the destination spectrum 277 281 // 278 Double_t MMcSpectrumWeight::GetSpecNewIntegral( ) const282 Double_t MMcSpectrumWeight::GetSpecNewIntegral(Double_t emin, Double_t emax) const 279 283 { 280 284 TF1 funcnew("Dummy", GetFormulaSpecNewX()); 281 return funcnew.Integral( fEnergyMin, fEnergyMax);285 return funcnew.Integral(emin, emax); 282 286 } 283 287 … … 287 291 // GetFormulaSpecOldX() describing the simulated spectrum 288 292 // 289 Double_t MMcSpectrumWeight::GetSpecOldIntegral( ) const293 Double_t MMcSpectrumWeight::GetSpecOldIntegral(Double_t emin, Double_t emax) const 290 294 { 291 295 TF1 funcold("Dummy", GetFormulaSpecOldX()); 292 return funcold.Integral( fEnergyMin, fEnergyMax);296 return funcold.Integral(emin, emax); 293 297 } 294 298 … … 357 361 if (fEnergyMax>fEnergyMin && !fAllowChange) 358 362 { 363 if (TMath::Abs(fEnergyMax-rh.GetEUppLim())>1e-10) 364 { 365 *fLog << err; 366 *fLog << "ERROR - The maximum simulated Monte Carlo energy is not allowed to change ("; 367 *fLog << "(" << fEnergyMax << " --> " << rh.GetEUppLim() << ")... abort." << endl; 368 return kFALSE; 369 } 370 359 371 if (TMath::Abs(fOldSlope-rh.GetSlopeSpec())>1e-10) 360 372 { … … 364 376 return kFALSE; 365 377 } 366 if (TMath::Abs(fEnergyMin-rh.GetELowLim())>1e-10) 367 { 368 *fLog << err; 369 *fLog << "ERROR - The minimum simulated Monte Carlo energy is not allowed to change "; 370 *fLog << "(" << fEnergyMin << " --> " << rh.GetELowLim() << ")... abort." << endl; 371 return kFALSE; 372 } 373 if (TMath::Abs(fEnergyMax-rh.GetEUppLim())>1e-10) 374 { 375 *fLog << err; 376 *fLog << "ERROR - The maximum simulated Monte Carlo energy is not allowed to change ("; 377 *fLog << "(" << fEnergyMax << " --> " << rh.GetEUppLim() << ")... abort." << endl; 378 return kFALSE; 379 } 380 return kTRUE; 378 379 // No change happened 380 if (TMath::Abs(fEnergyMin-rh.GetELowLim())<=1e-10) 381 return kTRUE; 382 383 // The lower energy limit has changed 384 *fLog << warn; 385 *fLog << "The minimum simulated Monte Carlo energy has changed from "; 386 *fLog << fEnergyMin << "GeV to " << rh.GetELowLim() << "GeV." << endl; 387 fEnergyMin = rh.GetELowLim(); 381 388 } 382 389 … … 385 392 fEnergyMax = rh.GetEUppLim(); 386 393 387 if (fNewSlope==-9 )388 { 389 *fLog << inf << " The new slope of the power law is undefined (-9)... no weighting applied." << endl;394 if (fNewSlope==-99) 395 { 396 *fLog << inf << "A new slope for the power law has not been defined... no weighting applied." << endl; 390 397 fNewSlope = fOldSlope; 391 398 } … … 403 410 // --------------------------------------------------------------------------- 404 411 // 412 // completes a simulated spectrum starting at an energy fEnergyMin down to 413 // an energy emin. 414 // 415 // It is assumed that the contents of MMcSpectrumWeight for the new spectrum 416 // correctly describe the spectrum within the histogram, and fEnergyMin 417 // and fEnergyMax correctly describe the range. 418 // 419 // In the 1D case it is assumed that the x-axis is a zenith angle binning. 420 // In the 2D case the x-axis is assumed to be zenith angle, the y-axis 421 // to be energy. 422 // 423 void MMcSpectrumWeight::CompleteEnergySpectrum(TH1 &h, Double_t emin) const 424 { 425 if (h.InheritsFrom(TH3::Class())) 426 { 427 *fLog << "ERROR - MMcSpctrumWeight::CompleteEnergySpectrum doesn't support TH3." << endl; 428 return; 429 } 430 431 if (fEnergyMin <= emin) 432 return; 433 434 const Double_t norm = GetSpecNewIntegral(); 435 436 if (!h.InheritsFrom(TH2::Class())) 437 { 438 h.Scale(GetSpecNewIntegral(emin, fEnergyMax)/norm); 439 return; 440 } 441 442 const TAxis &axey = *h.GetYaxis(); 443 444 const Int_t first = axey.FindFixBin(emin); 445 const Int_t last = axey.FindFixBin(fEnergyMin); 446 447 for (int x=1; x<=h.GetNbinsX(); x++) 448 { 449 const Double_t f = h.Integral(x, x, -1, 9999)/norm; 450 451 for (int y=first; y<=last; y++) 452 { 453 const Double_t lo = axey.GetBinLowEdge(y) <emin ? emin : axey.GetBinLowEdge(y); 454 const Double_t hi = axey.GetBinLowEdge(y+1)>fEnergyMin ? fEnergyMin : axey.GetBinLowEdge(y+1); 455 456 h.AddBinContent(h.GetBin(x, y), f*GetSpecNewIntegral(lo, hi)); 457 } 458 } 459 } 460 461 // --------------------------------------------------------------------------- 462 // 405 463 // The current contants are printed 406 464 // 407 465 void MMcSpectrumWeight::Print(Option_t *o) const 408 466 { 467 const TString opt(o); 468 469 const Bool_t hasnew = opt.Contains("new") || opt.IsNull(); 470 const Bool_t hasold = opt.Contains("old") || opt.IsNull(); 471 409 472 *fLog << all << GetDescriptor() << endl; 410 *fLog << " Simulated energy range: " << fEnergyMin << "GeV - " << fEnergyMax << "GeV" << endl; 411 *fLog << " Simulated spectral slope: " << fOldSlope << endl; 412 *fLog << " New spectral slope: " << fNewSlope << endl; 473 474 if (hasold) 475 { 476 *fLog << " Simulated energy range: " << fEnergyMin << "GeV - " << fEnergyMax << "GeV" << endl; 477 *fLog << " Simulated spectral slope: "; 478 if (fOldSlope==-99) 479 *fLog << "undefined" << endl; 480 else 481 *fLog << fOldSlope << endl; 482 } 483 if (hasnew) 484 { 485 *fLog << " New spectral slope: "; 486 if (fNewSlope==-99) 487 *fLog << "undefined" << endl; 488 else 489 *fLog << fNewSlope << endl; 490 } 413 491 *fLog << " Additional user norm.: " << fNorm << endl; 414 492 *fLog << " Spectra are normalized: " << (fNormEnergy<0?"by integral":Form("at %.1fGeV", fNormEnergy)) << endl; 415 *fLog << " Old Spectrum: " << GetFormulaSpecOldX() << " (I=" << GetSpecOldIntegral() << ")" << endl; 416 *fLog << " New Spectrum: " << GetFormulaSpecNewX() << " (I=" << GetSpecNewIntegral() << ")" << endl; 493 if (hasold) 494 { 495 *fLog << " Old Spectrum: " << GetFormulaSpecOldX(); 496 if (fEnergyMin>=0 && fEnergyMax>0) 497 *fLog << " (I=" << GetSpecOldIntegral() << ")"; 498 *fLog << endl; 499 } 500 if (hasnew) 501 { 502 *fLog << " New Spectrum: " << GetFormulaSpecNewX(); 503 if (fEnergyMin>=0 && fEnergyMax>0) 504 *fLog << " (I=" << GetSpecNewIntegral() << ")"; 505 *fLog << endl; 506 } 417 507 if (fFunc) 418 *fLog << " Weight func tion: " << fFunc->GetTitle() << endl;508 *fLog << " Weight func: " << fFunc->GetTitle() << endl; 419 509 } 420 510 … … 436 526 } 437 527 528 /* 529 * This could be used to improve the Zd-weighting within a bin. 530 * Another option is to use more bins, or both. 531 * Note that it seems unnecessary, because the shape within the 532 * theta-bins should be similar in data and Monte Carlo... hopefully. 533 * 534 void MMcSpectrumWeight::InitZdWeights() 535 { 536 TH2D w(*fWeightsZd); 537 538 for (int i=1; i<=w.GetNbinsX(); i++) 539 { 540 const Double_t tmin = w.GetBinLowEdge(i) *TMath::DegToRad(); 541 const Double_t tmax = w.GetBinLowEdge(i+1)*TMath::DegToRad(); 542 543 const Double_t wdth = tmax-tmin; 544 const Double_t integ = cos(tmin)-cos(tmax); 545 546 w.SetBinContent(i, w.GetBinContent(i)*wdth/integ); 547 } 548 549 // const Int_t i = fWeightsZd->GetXaxis()->FindFixBin(fPointing->GetZd()); 550 // const Double_t theta = fPointing->GetZd()*TMath::DegToRad(); 551 // w = sin(theta)*w.GetBinContent(i); 552 } 553 */ 554 438 555 // ---------------------------------------------------------------------------- 439 556 // … … 447 564 if (fWeightsZd) 448 565 { 449 /*450 const Int_t i = fWeightsZd->GetXaxis()->FindFixBin(fPointing->GetZd());451 452 Double_t tmin = fWeightsZd->GetXaxis()->GetBinLowEdge(i) *TMath::DegToRad();453 Double_t tmax = fWeightsZd->GetXaxis()->GetBinLowEdge(i+1)*TMath::DegToRad();454 Double_t wdth = fWeightsZd->GetXaxis()->GetBinWidth(i) *TMath::DegToRad();455 456 Double_t cont = fWeightsZd->GetBinContent(i);457 458 Double_t integ = cos(tmin)-cos(tmax);459 460 w = sin(tmax)*cont/integ*wdth;461 */462 463 566 const Int_t i = fWeightsZd->GetXaxis()->FindFixBin(fPointing->GetZd()); 464 567 w = fWeightsZd->GetBinContent(i); … … 472 575 473 576 const Double_t e = fMcEvt->GetEnergy(); 577 474 578 fWeight->SetVal(fFunc->Eval(e)*w); 475 579 -
trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.h
r7688 r8680 77 77 78 78 // Getter 79 TString GetFormulaSpecOld() const; 80 TString GetFormulaSpecNew() const; 81 TString GetFormulaWeights() const; 79 TString GetFormulaSpecOld(const char *name) const; 80 TString GetFormulaSpecNew(const char *name) const; 81 TString GetFormulaWeights(const char *name) const; 82 TString GetFormulaSpecOld() const { return GetFormulaSpecOld(fNameMcEvt); } 83 TString GetFormulaSpecNew() const { return GetFormulaSpecNew(fNameMcEvt); } 84 TString GetFormulaWeights() const { return GetFormulaWeights(fNameMcEvt); } 82 85 83 86 TString GetFormulaSpecOldX() const { return ReplaceX(GetFormulaSpecOld()); } … … 85 88 TString GetFormulaWeightsX() const { return ReplaceX(GetFormulaWeights()); } 86 89 87 Double_t GetSpecNewIntegral() const; 88 Double_t GetSpecOldIntegral() const; 90 Double_t GetSpecNewIntegral(Double_t emin, Double_t emax) const; 91 Double_t GetSpecOldIntegral(Double_t emin, Double_t emax) const; 92 93 Double_t GetSpecNewIntegral() const { return GetSpecNewIntegral(fEnergyMin, fEnergyMax); } 94 Double_t GetSpecOldIntegral() const { return GetSpecOldIntegral(fEnergyMin, fEnergyMax); } 89 95 90 96 Double_t CalcSpecNew(Double_t e) const; … … 93 99 Double_t GetEnergyMin() const { return fEnergyMin; } 94 100 Double_t GetEnergyMax() const { return fEnergyMax; } 101 102 // Functions 103 void CompleteEnergySpectrum(TH1 &h, Double_t emin) const; 95 104 96 105 // TObject -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r8676 r8680 18 18 ! Author(s): Thomas Bretz, 4/2005 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 520 ! Copyright: MAGIC Software Development, 2000-2007 21 21 ! 22 22 ! … … 62 62 #include "../mhflux/MHAlpha.h" 63 63 #include "../mhflux/MHCollectionArea.h" 64 //#include "../mhflux/MHThreshold.h"65 64 #include "../mhflux/MHEnergyEst.h" 66 65 #include "../mhflux/MMcSpectrumWeight.h" … … 80 79 #include "MFillH.h" 81 80 #include "MHillasCalc.h" 82 //#include "MSrcPosCalc.h"83 81 #include "MContinue.h" 84 82 … … 89 87 MJSpectrum::MJSpectrum(const char *name, const char *title) 90 88 : fCutQ(0), fCut0(0),fCut1(0), fCut2(0), fCut3(0), fCutS(0), 91 fEstimateEnergy(0), fCalcHadronness(0), fRefill(kFALSE), 92 /*fSimpleMode(kTRUE),*/ fForceTheta(kFALSE), 93 fRawMc(kFALSE), fNoThetaWeights(kFALSE) 89 fEstimateEnergy(0), fCalcHadronness(0), fForceTheta(kFALSE) 94 90 { 95 91 fName = name ? name : "MJSpectrum"; 96 92 fTitle = title ? title : "Standard program to calculate spectrum"; 97 } 98 93 94 // Make sure that fDisplay is maintained properly 95 // (i.e. removed via RecursiveRemove if closed) 96 gROOT->GetListOfCleanups()->Add(this); 97 } 98 99 // -------------------------------------------------------------------------- 100 // 101 // Delete all the fCut* data members and fCalcHadronness/fEstimateEnergy 102 // 99 103 MJSpectrum::~MJSpectrum() 100 104 { … … 128 132 } 129 133 134 // -------------------------------------------------------------------------- 135 // 136 // Read a MTask named name into task from the open file. If this task is 137 // required mustexist can be set. Depending on success kTRUE or kFALSE is 138 // returned. If the task is a MContinue SetAllowEmpty is called. 139 // The name of the task is set to name. 140 // 130 141 Bool_t MJSpectrum::ReadTask(MTask* &task, const char *name, Bool_t mustexist) const 131 142 { 143 // If a task is set delete task 132 144 if (task) 133 145 { … … 136 148 } 137 149 150 // Try to get task from file 138 151 task = (MTask*)gFile->Get(name); 139 152 if (!task) … … 144 157 return kFALSE; 145 158 } 159 160 // Check if task inherits from MTask 146 161 if (!task->InheritsFrom(MTask::Class())) 147 162 { … … 151 166 } 152 167 168 // Set name of task 153 169 task->SetName(name); 154 170 171 // SetAllowEmpty for MContinue tasks 155 172 if (dynamic_cast<MContinue*>(task)) 156 173 dynamic_cast<MContinue*>(task)->SetAllowEmpty(); … … 159 176 } 160 177 178 // -------------------------------------------------------------------------- 179 // 180 // Print setup used for the MC processing, namely MAlphaFitter ans all fCut*. 181 // 161 182 void MJSpectrum::PrintSetup(const MAlphaFitter &fit) const 162 183 { … … 194 215 } 195 216 196 // Read the first corsika RunHeader from the MC files 197 TChain chain("RunHeaders"); 198 if (!set.AddFilesOn(chain)) 199 return kFALSE; 200 201 MMcCorsikaRunHeader *h=0; 202 chain.SetBranchAddress("MMcCorsikaRunHeader.", &h); 203 chain.GetEntry(1); 204 205 if (!h) 206 { 207 *fLog << err << "ERROR - Couldn't read MMcCorsikaRunHeader from DataSet." << endl; 208 return kFALSE; 209 } 210 211 // Propagate the run header to MMcSpectrumWeight 212 if (!w.Set(*h)) 213 { 214 *fLog << err << "ERROR - Initializing MMcSpectrumWeight failed." << endl; 215 return kFALSE; 216 } 217 218 // Print new setup of MMcSpectrumWeight 219 w.Print(); 217 w.Print("new"); 218 220 219 return kTRUE; 221 220 } … … 281 280 } 282 281 282 // -------------------------------------------------------------------------- 283 // 284 // return maximum value of MMcRunHeader.fImpactMax stored in the RunHeaders 285 // of the files from the MC dataset 286 // 287 Bool_t MJSpectrum::AnalyzeMC(const MDataSet &set, Float_t &impactmax, Float_t &emin/*, Float_t emax*/) const 288 { 289 if (fDisplay) 290 fDisplay->SetStatusLine1("Analyzing Monte Carlo headers..."); 291 292 // ----- Create chain ----- 293 *fLog << inf << "Getting files... " << flush; 294 TChain chain("RunHeaders"); 295 if (!set.AddFilesOn(chain)) 296 return kFALSE; 297 *fLog << "done. " << endl; 298 299 *fLog << all; 300 *fLog << "Searching for maximum impact... " << flush; 301 impactmax = chain.GetMaximum("MMcRunHeader.fImpactMax"); 302 *fLog << "found " << impactmax/100 << "m" << endl; 303 304 *fLog << "Searching for minimum lower energy limit... " << flush; 305 emin = chain.GetMinimum("MMcCorsikaRunHeader.fELowLim"); 306 *fLog << "found " << emin << "GeV" << endl; 307 308 *fLog << "Searching for maximum lower energy limit... " << flush; 309 const Float_t emin2 = chain.GetMaximum("MMcCorsikaRunHeader.fELowLim"); 310 *fLog << "found " << emin2 << "GeV" << endl; 311 312 if (emin2>emin) 313 { 314 *fLog << warn; 315 *fLog << "WARNING - You are using files with different lower limits for the simulated" << endl; 316 *fLog << " energy, i.e. that the collection area and your correction" << endl; 317 *fLog << " coefficients between " << emin << "GeV and "; 318 *fLog << emin2 << "GeV might be wrong." << endl; 319 } 320 321 /* 322 *fLog << "Getting maximum energy... " << flush; 323 emax = chain.GetMaximum("MMcCorsikaRunHeader.fEUppLim"); 324 *fLog << "found " << emax << "GeV" << endl; 325 */ 326 return kTRUE; 327 } 328 283 329 Bool_t MJSpectrum::ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &weight) const 284 330 { … … 286 332 fLog->Separator("Compiling original MC distribution"); 287 333 288 // The name of the input container is MMcEvtBasic 289 weight.SetNameMcEvt("MMcEvtBasic"); 290 // Get the corresponding rule for the weights 291 const TString w(weight.GetFormulaWeights()); 292 // Set back to MMcEvt 293 weight.SetNameMcEvt(); 294 295 *fLog << inf << "Using weights: " << w << endl; 296 *fLog << "Please stand by, this may take a while..." << endl; 297 298 if (fDisplay) 299 fDisplay->SetStatusLine1("Getting maximum impact..."); 300 301 // ----- Create chain ----- 302 *fLog << "Getting files... " << flush; 303 TChain chain("RunHeaders"); 304 if (!set.AddFilesOn(chain)) 305 return kFALSE; 306 *fLog << "done. " << endl; 307 308 *fLog << "Getting maximum impact... " << flush; 309 const Double_t impactmax = chain.GetMaximum("MMcRunHeader.fImpactMax"); 310 *fLog << "found " << impactmax/100 << "m" << endl; 311 312 *fLog << "Getting files... " << flush; 334 Float_t impactmax=0, Emin=0; 335 if (!AnalyzeMC(set, impactmax, Emin)) 336 return kFALSE; 337 338 *fLog << inf << "Getting files... " << flush; 313 339 MDirIter iter; 314 340 if (!set.AddFilesOn(iter)) 315 341 return kFALSE; 316 342 *fLog << "done. " << endl; 343 344 const Int_t tot = iter.GetNumEntries(); 317 345 318 346 // Prepare histogram … … 339 367 340 368 if (fDisplay) 341 fDisplay->SetStatusLine1("Reading OriginalMC ");369 fDisplay->SetStatusLine1("Reading OriginalMC distribution..."); 342 370 343 371 TH1 *hfill = (TH1*)h.Clone(h.InheritsFrom(TH2::Class())?"ThetaEMC":"ThetaMC"); 344 372 hfill->SetDirectory(0); 345 373 374 *fLog << all << "Compiling simulated source spectrum... please stand by, this may take a while." << endl; 375 376 Double_t evts = 0; 377 Int_t num = 0; 378 379 // Reading this with a eventloop is five times slower :( 346 380 TString fname; 347 while (1) 348 { 381 while (fDisplay) 382 { 383 if (fDisplay) 384 fDisplay->SetProgressBarPosition(Float_t(num++)/tot); 385 386 // Get next filename 349 387 fname = iter.Next(); 350 388 if (fname.IsNull()) 351 389 break; 352 390 391 if (fDisplay) 392 fDisplay->SetStatusLine2(fname); 393 394 // open file 353 395 TFile file(fname); 354 396 if (file.IsZombie()) … … 358 400 } 359 401 402 // Get tree OriginalMC 403 TTree *t = dynamic_cast<TTree*>(file.Get("OriginalMC")); 404 if (!t) 405 { 406 *fLog << err << "ERROR - File " << fname << " doesn't contain tree OriginalMC." << endl; 407 return kFALSE; 408 } 409 if (t->GetEntries()==0) 410 { 411 *fLog << warn << "WARNING - OriginalMC of " << fname << " empty." << endl; 412 continue; 413 } 414 415 // Get tree RunHeaders 360 416 TTree *rh = dynamic_cast<TTree*>(file.Get("RunHeaders")); 361 417 if (!rh) … … 364 420 return kFALSE; 365 421 } 366 367 422 if (rh->GetEntries()!=1) 368 423 { … … 371 426 } 372 427 373 TTree *t = dynamic_cast<TTree*>(file.Get("OriginalMC")); 374 if (!t) 428 // Get corsika run header 429 MMcCorsikaRunHeader *head=0; 430 rh->SetBranchAddress("MMcCorsikaRunHeader.", &head); 431 rh->GetEntry(0); 432 if (!head) 375 433 { 376 *fLog << err << "ERROR - File " << fname << " doesn't contain tree OriginalMC." << endl;434 *fLog << err << "ERROR - Couldn't read MMcCorsikaRunHeader from " << fname << "." << endl; 377 435 return kFALSE; 378 436 } 379 437 438 // Get the maximum impact parameter of this file. Due to different 439 // production areas an additional scale-factor is applied. 440 // 441 // Because it is assumed that the efficiency outside the production 442 // area is nearly zero no additional weight has to be applied to the 443 // events after cuts. 444 const Double_t impact = rh->GetMaximum("MMcRunHeader.fImpactMax"); 445 const Double_t scale = impactmax/impact; 446 447 // Propagate the run header to MMcSpectrumWeight 448 if (!weight.Set(*head)) 449 { 450 *fLog << err << "ERROR - Initializing MMcSpectrumWeight failed." << endl; 451 return kFALSE; 452 } 453 454 // Get the corresponding rule for the weights 455 const TString weights(weight.GetFormulaWeights("MMcEvtBasic")); 456 457 // No we found everything... go on reading contents 380 458 *fLog << inf << "Reading OriginalMC of " << fname << endl; 381 382 if (t->GetEntries()==0)383 {384 *fLog << warn << "WARNING - OriginalMC of " << fname << " empty." << endl;385 continue;386 }387 388 // Why does it crash if closed within loop (no update?)389 //if (fDisplay)390 // fDisplay->SetStatusLine2(fname);391 392 // Normalize by deviding through production area393 const Double_t impact = rh->GetMaximum("MMcRunHeader.fImpactMax");394 const Double_t scale = impactmax/impact;395 const TString weights = Form("%.16e*(%s)", scale*scale, w.Data());396 459 397 460 // Fill histogram from tree … … 403 466 } 404 467 hfill->SetDirectory(0); 468 469 evts += hfill->GetEntries(); 470 471 // ----- Complete incomplete energy ranges ----- 472 // ----- and apply production area weights ----- 473 weight.CompleteEnergySpectrum(*hfill, Emin); 474 475 hfill->Scale(scale*scale); 476 477 // Add weighted data from file to final histogram 405 478 h.Add(hfill); 406 479 } 407 480 delete hfill; 408 481 409 *fLog << "Total number of events from file: " << h.GetEntries()<< endl;482 *fLog << all << "Total number of events from files in Monte Carlo dataset: " << evts << endl; 410 483 if (fDisplay) 411 484 fDisplay->SetStatusLine2("done."); 412 485 413 if ( h.GetEntries()>0)486 if (!fDisplay || h.GetEntries()>0) 414 487 return kTRUE; 415 488 416 *fLog << err << "ERROR - Histogram with original MC distribution empty..." << endl; 417 489 *fLog << err << "ERROR - Histogram with distribution from OriginalMC empty..." << endl; 418 490 return kFALSE; 419 491 } 420 492 421 Bool_t MJSpectrum::GetThetaDistribution(TH1D &temp1, TH1D &temp2) const 422 { 493 void MJSpectrum::GetThetaDistribution(TH1D &temp1, TH2D &hist2) const 494 { 495 TH1D &temp2 = *hist2.ProjectionX(); 496 423 497 // Display some stuff 424 498 if (fDisplay) … … 430 504 c.cd(1); 431 505 gPad->SetBorderMode(0); 506 gPad->SetGridx(); 507 gPad->SetGridy(); 432 508 temp1.DrawCopy(); 433 509 … … 435 511 c.cd(2); 436 512 gPad->SetBorderMode(0); 513 gPad->SetGridx(); 514 gPad->SetGridy(); 437 515 temp2.SetName("NVsTheta"); 438 516 temp2.DrawCopy("hist"); … … 440 518 c.cd(4); 441 519 gPad->SetBorderMode(0); 520 gPad->SetGridx(); 521 gPad->SetGridy(); 442 522 443 523 c.cd(3); 444 524 gPad->SetBorderMode(0); 525 gPad->SetGridx(); 526 gPad->SetGridy(); 445 527 } 446 528 447 529 // Calculate the Probability 448 530 temp1.Divide(&temp2); 449 temp1.Scale( fNoThetaWeights ? 1./temp1.GetMaximum() :1./temp1.Integral());531 temp1.Scale(1./temp1.Integral()); 450 532 451 533 // Some cosmetics: Name, Axis, etc. … … 456 538 temp1.DrawCopy("hist"); 457 539 458 return kTRUE;540 delete &temp2; 459 541 } 460 542 … … 492 574 } 493 575 576 // Check whether histogram is empty 494 577 if (proj.GetMaximum()==0) 495 578 { … … 497 580 *fLog << "ERROR - The Zenith Angle distribution of your Monte Carlos doesn't overlap" << endl; 498 581 *fLog << " with the Zenith Angle distribution of your observation." << endl; 499 *fLog << " Maybe the energy binning is not defined or wrong." << endl; 582 *fLog << " Maybe the energy binning is undefined or wrong (from "; 583 *fLog << h2.GetYaxis()->GetXmin() << "GeV to " << h2.GetYaxis()->GetXmax() << "GeV)" << endl; 500 584 theta->SetLineColor(kRed); 501 585 return kFALSE;; 502 586 } 503 587 588 // scale histogram and set new maximum for display 504 589 proj.Scale(theta->GetMaximum()/proj.GetMaximum()); 505 590 theta->SetMaximum(1.05*TMath::Max(theta->GetMaximum(), proj.GetMaximum())); 506 591 592 // draw project 507 593 proj.Draw("same"); 508 594 … … 688 774 fill0.SetFilter(&sel1); 689 775 690 if (!fRawMc)776 //if (!fRawMc) 691 777 tlist1.AddToList(&sel1); 692 778 tlist1.AddToList(&fill0); … … 767 853 TArrayD MJSpectrum::FitSpectrum(TH1D &spectrum) const 768 854 { 769 TF1 f("f", "[1]*(x/1e3)^[0]", 10, 3e4); 770 f.SetParameter(0, -2.5); 771 f.SetParameter(1, spectrum.GetBinContent(spectrum.GetXaxis()->FindFixBin(1000))); 855 Axis_t lo, hi; 856 MH::GetRangeUser(spectrum, lo, hi); 857 858 TF1 f("f", "[1]*(x/500)^[0]", lo, hi); 859 f.SetParameter(0, -3.0); 860 f.SetParameter(1, spectrum.GetMaximum()); 772 861 f.SetLineColor(kBlue); 773 spectrum.Fit(&f, "NI", "", 80, 1150); // M skipped 862 f.SetLineWidth(2); 863 spectrum.Fit(&f, "NIR"); // M skipped 774 864 f.DrawCopy("same"); 775 865 … … 881 971 spec = (TH1D*)spectrum.DrawCopy(); 882 972 883 // Calculate Spectrum * E^2 884 for (int i=0; i<spectrum.GetNbinsX(); i++) 885 { 886 const Double_t e = TMath::Sqrt(spectrum.GetBinLowEdge(i+1)*spectrum.GetBinLowEdge(i+2))*1e-3; 887 888 spectrum.SetBinContent(i+1, spectrum.GetBinContent(i+1)*e*e); 889 spectrum.SetBinError( i+1, spectrum.GetBinError(i+1) *e*e); 890 } 973 TF1 fc("Crab", "7.0e-6*(x/300)^(-2.31-0.26*log10(x/300))", 100, 6000); 974 fc.SetLineStyle(7); 975 fc.SetLineWidth(2); 976 fc.SetLineColor(14); 977 fc.DrawCopy("same"); 978 979 TF1 fa("PG1553", "1.8e-6*(x/200)^-4.21", 90, 600); 980 static_cast<const TAttLine&>(fc).Copy(fa); 981 fa.DrawCopy("same"); 891 982 892 983 // Display dN/dE*E^2 for conveinience … … 896 987 gPad->SetGrid(); 897 988 989 // Calculate Spectrum * E^2 990 for (int i=0; i<spectrum.GetNbinsX(); i++) 991 { 992 const Double_t e = TMath::Sqrt(spectrum.GetBinLowEdge(i+1)*spectrum.GetBinLowEdge(i+2))*1e-3; 993 994 spectrum.SetBinContent(i+1, spectrum.GetBinContent(i+1)*e*e); 995 spectrum.SetBinError( i+1, spectrum.GetBinError(i+1) *e*e); 996 } 997 898 998 spectrum.SetName("FluxStd"); 899 999 spectrum.SetMarkerStyle(kFullDotMedium); 900 1000 spectrum.SetTitle("Differential flux times E^{2}"); 901 spectrum.SetYTitle("E^{2} dN/dE [NTeV/sm^{2}]");1001 spectrum.SetYTitle("E^{2}#cdot dN/dE [N#cdot TeV/sm^{2}]"); 902 1002 spectrum.SetDirectory(0); 903 1003 spectrum.DrawCopy(); 1004 1005 TF1 fc2("Crab*E^2", "x^2*Crab*1e-6", 100, 6000); 1006 static_cast<const TAttLine&>(fc).Copy(fc2); 1007 fc2.DrawCopy("same"); 1008 1009 TF1 fa2("PG1553*E^2", "x^2*PG1553*1e-6", 100, 6000); 1010 static_cast<const TAttLine&>(fc).Copy(fa2); 1011 fa2.DrawCopy("same"); 904 1012 905 1013 // Fit Spectrum … … 943 1051 return res; 944 1052 */ 945 /*946 // Plot other spectra from Whipple947 f.SetParameter(0, -2.45);948 f.SetParameter(1, 3.3e-7);949 f.SetRange(300, 8000);950 f.SetLineColor(kBlack);951 f.SetLineStyle(kDashed);952 f.DrawCopy("same");953 954 // Plot other spectra from Cangaroo955 f.SetParameter(0, -2.53);956 f.SetParameter(1, 2.0e-7);957 f.SetRange(7000, 50000);958 f.SetLineColor(kBlack);959 f.SetLineStyle(kDashed);960 f.DrawCopy("same");961 962 // Plot other spectra from Robert963 f.SetParameter(0, -2.59);964 f.SetParameter(1, 2.58e-7);965 f.SetRange(150, 1500);966 f.SetLineColor(kBlack);967 f.SetLineStyle(kDashed);968 f.DrawCopy("same");969 970 // Plot other spectra from HEGRA971 f.SetParameter(0, -2.61);972 f.SetParameter(1, 2.7e-7);973 f.SetRange(1000, 20000);974 f.SetLineColor(kBlack);975 f.SetLineStyle(kDashed);976 f.DrawCopy("same");977 */978 1053 } 979 1054 … … 1179 1254 *fLog << endl; 1180 1255 1256 // Setup everything which is read from the ganymed file 1181 1257 MBinning bins1("BinningAlpha"); 1182 1258 MBinning bins2("BinningEnergyEst"); … … 1191 1267 MBinning binsa("BinningAsym"); 1192 1268 MBinning binsb("BinningConc1"); 1193 1194 1269 1195 1270 MAlphaFitter fit; … … 1209 1284 plist.AddToList(&fit); 1210 1285 1211 TH1D temp1, size; 1212 const Float_t ontime = ReadInput(plist, temp1, size); 1286 // Read from the ganymed file 1287 TH1D htheta, size; 1288 const Float_t ontime = ReadInput(plist, htheta, size); 1213 1289 if (ontime<0) 1214 1290 { … … 1217 1293 } 1218 1294 1219 plist.AddToList(&bins2); 1220 1221 // Initialize weighting to a new spectrum 1222 // as defined in the resource file 1295 // Set Zenith angle binning to binning from the ganymed-file 1296 bins3.SetEdges(htheta, 'x'); 1297 1298 // Read energy binning from resource file 1299 if (!CheckEnv(bins2)) 1300 { 1301 *fLog << err << "ERROR - Reading energy binning from resources failed." << endl; 1302 return kFALSE; 1303 } 1304 plist.AddToList(&bins2); // For later use in MC processing 1305 1306 // Initialize weighting to a new spectrum as defined in the resource file 1223 1307 MMcSpectrumWeight weight; 1224 1308 if (!InitWeighting(set, weight)) 1225 1309 return kFALSE; 1226 1310 1227 bins3.SetEdges(temp1, 'x'); 1228 1229 // Read the MC distribution as produced by corsika into 1230 // temp2 (1D) and apply the weights previously determined 1231 TH1D temp2(temp1); 1232 if (!ReadOrigMCDistribution(set, temp2, weight)) 1233 return kFALSE; 1234 1235 // Calculate the weights according to the zenith angle distribution 1236 // of the raw-data which have to be applied to the MC events 1237 if (!GetThetaDistribution(temp1, temp2)) 1238 return kFALSE; 1239 1240 // Tell the weighting task about the ZA-weights 1241 if (!fNoThetaWeights) 1242 weight.SetWeightsZd(&temp1); 1311 // Print Theta and energy binning for cross-checks 1312 *fLog << all << endl; 1313 bins2.Print(); 1314 bins3.Print(); 1315 1316 // Now we read the MC distribution as produced by corsika 1317 // vs zenith angle and energy. 1318 // Weight for the new energy spectrum defined in MMcSpectumWeight 1319 // are applied. 1320 // Also correction for different lower energy bounds and 1321 // different production areas (impact parameters) are applied. 1322 TH2D hist; 1323 hist.UseCurrentStyle(); 1324 MH::SetBinning(&hist, &bins3, &bins2); 1325 if (!ReadOrigMCDistribution(set, hist, weight)) 1326 return kFALSE; 1327 1328 // Check if user has closed the display 1329 if (!fDisplay) 1330 return kTRUE; 1331 1332 // Display histograms and calculate za-weights into htheta 1333 GetThetaDistribution(htheta, hist); 1334 1335 // Give the zenoith angle weights to the weighting task 1336 weight.SetWeightsZd(&htheta); 1337 1338 // No we apply the the zenith-angle-weights to the corsika produced 1339 // MC distribution. Unfortunately this must be done manually 1340 // because we are multiplying column by column 1341 for (int y=0; y<hist.GetNbinsY(); y++) 1342 for (int x=0; x<hist.GetNbinsX(); x++) 1343 { 1344 hist.SetBinContent(x, y, hist.GetBinContent(x, y)*htheta.GetBinContent(x)); 1345 hist.SetBinError(x, y, hist.GetBinError(x, y) *htheta.GetBinContent(x)); 1346 } 1347 1348 // Display the resulting distribution and check it matches 1349 // the observation time distribution (this could be false 1350 // for example if you miss MCs of some zenith angles, which you have 1351 // data for) 1352 if (!DisplayResult(hist)) 1353 return kFALSE; 1354 1355 // -------------- Fill excess events versus energy --------------- 1243 1356 1244 1357 // Refill excess histogram to determin the excess events … … 1247 1360 return kFALSE; 1248 1361 1249 // Print the setup and result of the MAlphaFitter 1250 // Print used cuts 1362 // Print the setup and result of the MAlphaFitter, print used cuts 1251 1363 PrintSetup(fit); 1252 1253 TH2D hist;1254 MH3 mh1("MMcEvtBasic.fTelescopeTheta*kRad2Deg", "MMcEvtBasic.fEnergy");1255 //if (fSimpleMode)1256 {1257 // Now we read the MC distribution as produced by corsika again1258 // with the spectral weights applied into a histogram vs.1259 // zenith angle and energy1260 hist.UseCurrentStyle();1261 MH::SetBinning(&hist, &bins3/*temp1.GetXaxis()*/, &bins2/*excess.GetXaxis()*/);1262 if (!ReadOrigMCDistribution(set, hist, weight))1263 return kFALSE;1264 1265 // No we apply the the zenith-angle-weights to the corsika produced1266 // MC distribution. Unfortunately this must be done manually1267 // because we are multiplying column by column1268 if (!fRawMc)1269 {1270 for (int y=0; y<hist.GetNbinsY(); y++)1271 for (int x=0; x<hist.GetNbinsX(); x++)1272 {1273 hist.SetBinContent(x, y, hist.GetBinContent(x, y)*temp1.GetBinContent(x));1274 hist.SetBinError(x, y, hist.GetBinError(x, y) *temp1.GetBinContent(x));1275 }1276 }1277 }/*1278 else1279 {1280 // This rereads the original MC spectrum and aplies both1281 // weights, spectral weights and ZA-weights.1282 weight.SetNameMcEvt("MMcEvtBasic");1283 if (!IntermediateLoop(plist, mh1, temp1, set, weight))1284 return kFALSE;1285 weight.SetNameMcEvt();1286 }*/1287 1288 if (!DisplayResult(/*fSimpleMode ?*/ hist /*: (TH2D&)mh1.GetHist()*/))1289 return kFALSE;1290 1364 1291 1365 // ------------------------- Final loop -------------------------- … … 1304 1378 1305 1379 // Selector to get correct (final) theta-distribution 1306 temp1.SetXTitle("MPointingPos.fZd");1307 1308 MH3 mh3(temp1);1309 1310 MFEventSelector2 sel2(mh3);1311 sel2.SetHistIsProbability();1312 1313 MContinue contsel(&sel2);1314 contsel.SetInverted();1380 //temp1.SetXTitle("MPointingPos.fZd"); 1381 // 1382 //MH3 mh3(temp1); 1383 // 1384 //MFEventSelector2 sel2(mh3); 1385 //sel2.SetHistIsProbability(); 1386 // 1387 //MContinue contsel(&sel2); 1388 //contsel.SetInverted(); 1315 1389 1316 1390 // Get correct source position … … 1318 1392 1319 1393 // Calculate corresponding Hillas parameters 1320 /* 1321 MHillasCalc hcalc1; 1322 MHillasCalc hcalc2("MHillasCalcAnti"); 1323 hcalc1.SetFlags(MHillasCalc::kCalcHillasSrc); 1324 hcalc2.SetFlags(MHillasCalc::kCalcHillasSrc); 1325 hcalc2.SetNameHillasSrc("MHillasSrcAnti"); 1326 hcalc2.SetNameSrcPosCam("MSrcPosAnti"); 1327 */ 1394 //MHillasCalc hcalc1; 1395 //MHillasCalc hcalc2("MHillasCalcAnti"); 1396 //hcalc1.SetFlags(MHillasCalc::kCalcHillasSrc); 1397 //hcalc2.SetFlags(MHillasCalc::kCalcHillasSrc); 1398 //hcalc2.SetNameHillasSrc("MHillasSrcAnti"); 1399 //hcalc2.SetNameSrcPosCam("MSrcPosAnti"); 1328 1400 1329 1401 // Fill collection area and energy estimator (unfolding) … … 1331 1403 MHCollectionArea area0("TriggerArea"); 1332 1404 MHCollectionArea area1; 1333 area0.SetHistAll( /*fSimpleMode ?*/ hist /*: (TH2D&)mh1.GetHist()*/);1334 area1.SetHistAll( /*fSimpleMode ?*/ hist /*: (TH2D&)mh1.GetHist()*/);1405 area0.SetHistAll(hist); 1406 area1.SetHistAll(hist); 1335 1407 1336 1408 MHEnergyEst hest; … … 1371 1443 MFillH fill7a("MHNewParMCPost [MHNewImagePar]", "MNewImagePar", "FillNewParPost"); 1372 1444 MFillH fill8a("ExcessMC [MH3]", "", "FillExcessMC"); 1445 fill0a.SetNameTab("EvtDist"); 1373 1446 fill1a.SetNameTab("PreCut"); 1374 1447 fill2a.SetNameTab("PostCut"); … … 1399 1472 // be thrown away according to the theta distribution 1400 1473 // it is enabled here 1401 if (!fRawMc && fNoThetaWeights)1402 tlist2.AddToList(&contsel);1474 //if (!fRawMc && fNoThetaWeights) 1475 // tlist2.AddToList(&contsel); 1403 1476 //tlist2.AddToList(&calc); 1404 1477 //tlist2.AddToList(&hcalc1); -
trunk/MagicSoft/Mars/mjobs/MJSpectrum.h
r8676 r8680 33 33 MTask *fCalcHadronness; 34 34 35 Bool_t fRefill;36 //Bool_t fSimpleMode;37 35 Bool_t fForceTheta; 38 Bool_t fRawMc;39 Bool_t fNoThetaWeights;40 36 41 37 // Read Input 42 Bool_t ReadTask(MTask* &task, const char *name, Bool_t mustexist=kTRUE) const; 43 Float_t ReadInput(MParList &plist, TH1D &h1, TH1D &size); 44 Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const; 45 Bool_t GetThetaDistribution(TH1D &temp1, TH1D &temp2) const; 46 Bool_t Refill(MParList &plist, TH1D &h) /*const*/; 47 Bool_t InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const; 38 Bool_t ReadTask(MTask* &task, const char *name, Bool_t mustexist=kTRUE) const; 39 Float_t ReadInput(MParList &plist, TH1D &h1, TH1D &size); 40 Bool_t AnalyzeMC(const MDataSet &set, Float_t &impactmax, Float_t &emin/*, Float_t emax*/) const; 41 Bool_t ReadOrigMCDistribution(const MDataSet &set, TH1 &h, MMcSpectrumWeight &w) const; 42 void GetThetaDistribution(TH1D &temp1, TH2D &temp2) const; 43 Bool_t Refill(MParList &plist, TH1D &h) /*const*/; 44 Bool_t InitWeighting(const MDataSet &set, MMcSpectrumWeight &w) const; 48 45 49 46 // Display Output … … 63 60 Bool_t Process(const MDataSet &set); 64 61 65 void EnableRefilling(Bool_t b=kTRUE) { fRefill=b; } 66 //void EnableSimpleMode(Bool_t b=kTRUE) { fSimpleMode=b; } 67 void EnableRawMc(Bool_t b=kTRUE) { fRawMc=b; } 68 void ForceTheta(Bool_t b=kTRUE) { fForceTheta=b; } 62 void ForceTheta(Bool_t b=kTRUE) { fForceTheta=b; } 69 63 70 64 void SetEnergyEstimator(const MTask *task); -
trunk/MagicSoft/Mars/sponde.rc
r7094 r8680 1 1 EstimateEnergy.Rule: (0.380075+(MPointingPos.fZd*MPointingPos.fZd*0.00109028))*pow(MHillas.fSize,0.892462) 2 2 3 BinningSize.Raw: 18 49 63600 log 4 BinningEnergyEst.Raw: 18 53 35800 log 5 3 6 #MMcSpectrumWeight.NewSlope: -2.26
Note:
See TracChangeset
for help on using the changeset viewer.