Changeset 7094 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 05/27/05 09:46:22 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.cc
r6976 r7094 31 31 #include "MHCollectionArea.h" 32 32 33 #include <TLatex.h> 33 34 #include <TCanvas.h> 34 35 #include <TPaveStats.h> … … 81 82 fHistAll.SetTitle("Number of events produced"); 82 83 fHistAll.SetXTitle("\\Theta [deg]"); 83 fHistAll.SetYTitle("E [GeV]");84 fHistAll.SetYTitle("E_{mc} [GeV]"); 84 85 fHistAll.SetDirectory(NULL); 85 86 fHistAll.UseCurrentStyle(); 86 87 87 88 fHEnergy.SetName("CollEnergy"); 88 fHEnergy.SetTitle("Collection Area vs Energy");89 fHEnergy.SetTitle("Collection Area"); 89 90 fHEnergy.SetXTitle("E [GeV]"); 90 fHEnergy.SetYTitle("A [m^{2}]");91 fHEnergy.SetYTitle("A_{eff} [m^{2}]"); 91 92 fHEnergy.SetDirectory(NULL); 92 93 fHEnergy.UseCurrentStyle(); … … 119 120 // read from run header, but it is not yet in!! 120 121 // 121 const Float_t r1 = 0; 122 const Float_t r2 = fMcAreaRadius; 123 124 //*fLog << warn << endl << dbginf << "WARNING! I will assume a maximum impact parameter of " << fMCAreaRadius << " meters for the MC events. Check that this is the true one!" <<endl<<endl; 125 const Float_t total_area = TMath::Pi() * (r2*r2 - r1*r1); 122 const Float_t totalarea = GetCollectionAreaAbs();//TMath::Pi() * (r2*r2 - r1*r1); 126 123 127 124 for (Int_t ix=1; ix<=nbinx; ix++) … … 141 138 continue; 142 139 143 const Double_t eff = Ns/Na; 144 145 const Double_t efferr = TMath::Sqrt((1.-eff)*Ns)/Na; 140 const Double_t eff = Ns/Na; 141 const Double_t efferr = TMath::Sqrt((1.-eff)*Ns)/Na; 146 142 147 const Float_t col _area = eff * total_area;148 const Float_t col _area_error = efferr * total_area;149 150 fHEnergy.SetBinContent(ix, col _area);151 fHEnergy.SetBinError(ix, col_area_error);143 const Float_t colarea = eff * totalarea; 144 const Float_t colareaerror = efferr * totalarea; 145 146 fHEnergy.SetBinContent(ix, colarea); 147 fHEnergy.SetBinError(ix, colareaerror); 152 148 } 153 149 … … 275 271 void MHCollectionArea::Paint(Option_t *option) 276 272 { 273 if (TString(option)=="paint3") 274 { 275 /* 276 TH1 *h = dynamic_cast<TH1*>(gPad->FindObject("Efficiency")); 277 if (h) 278 { 279 const TString txt = Form("N/N_{0}=%.2f", 280 GetCollectionAreaEff(), 281 GetCollectionAreaAbs(), fMcAreaRadius); 282 283 TLatex text(0.31, 0.95, txt); 284 text.SetBit(TLatex::kTextNDC); 285 text.SetTextSize(0.04); 286 text.Paint();*/ 287 return; 288 } 289 if (TString(option)=="paint4") 290 { 291 const TString txt = Form("A_{eff}=%.0fm^{2} A_{abs}=%.0fm^{2} r=%.0fm", 292 GetCollectionAreaEff(), 293 GetCollectionAreaAbs(), fMcAreaRadius); 294 295 TLatex text(0.31, 0.95, txt); 296 text.SetBit(TLatex::kTextNDC); 297 text.SetTextSize(0.04); 298 text.Paint(); 299 return; 300 } 301 277 302 TVirtualPad *pad; 278 303 … … 405 430 h->SetNameTitle("Efficiency", "Combined cut and trigger efficiency"); 406 431 h->SetDirectory(NULL); 432 AppendPad("paint3"); 407 433 } 408 434 else … … 416 442 gPad->SetGridy(); 417 443 fHEnergy.Draw(); 444 AppendPad("paint4"); 418 445 } 419 446 else … … 428 455 //*fLog << energy << " " << theta << endl; 429 456 430 fHistSel.Fill(theta, energy );457 fHistSel.Fill(theta, energy, weight); 431 458 432 459 return kTRUE; -
trunk/MagicSoft/Mars/mhflux/MHCollectionArea.h
r6976 r7094 56 56 const TH1D &GetHEnergy() const { return fHEnergy; } 57 57 58 Double_t GetEntries() const { return fHistAll.Integral(); } 59 Double_t GetCollectionAreaEff() const { return fHEnergy.Integral(); } 60 Double_t GetCollectionAreaAbs() const { return TMath::Pi()*fMcAreaRadius*fMcAreaRadius; } 61 58 62 /* 59 63 void DrawAll(Option_t *option="");
Note:
See TracChangeset
for help on using the changeset viewer.