Changeset 1827 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 03/18/03 18:13:32 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMcCT1CollectionArea.cc
r1824 r1827 58 58 59 59 fName = name ? name : "MHMcCT1CollectionArea"; 60 fTitle = title ? title : "Collection Area vs. Energy";60 fTitle = title ? title : "Collection Area vs. log10 Energy"; 61 61 62 62 fHistAll = new TH2D; … … 71 71 72 72 fHistCol->SetTitle(fTitle); 73 fHistAll->SetTitle("All showers - Theta vs Energy distribution");74 fHistSel->SetTitle("Selected showers - Theta vs Energy distribution");73 fHistAll->SetTitle("All showers - Theta vs log10 Energy distribution"); 74 fHistSel->SetTitle("Selected showers - Theta vs log10 Energy distribution"); 75 75 76 76 fHistAll->SetDirectory(NULL); … … 78 78 fHistCol->SetDirectory(NULL); 79 79 80 fHistAll->SetXTitle(" E [GeV]");80 fHistAll->SetXTitle("log10 E [GeV]"); 81 81 fHistAll->SetYTitle("theta [deg]"); 82 82 fHistAll->SetZTitle("N"); 83 83 84 fHistSel->SetXTitle(" E [GeV]");84 fHistSel->SetXTitle("log10 E [GeV]"); 85 85 fHistSel->SetYTitle("theta [deg]"); 86 fHistSel->Set YTitle("N");87 88 fHistCol->SetXTitle(" E [GeV]");86 fHistSel->SetZTitle("N"); 87 88 fHistCol->SetXTitle("log10 E [GeV]"); 89 89 fHistCol->SetYTitle("theta [deg]"); 90 90 fHistCol->SetZTitle("A [m^{2}]"); … … 99 99 { 100 100 MBinning binsx; 101 binsx.SetEdges Log(nbins, minEnergy, maxEnergy);101 binsx.SetEdges(nbins, minEnergy, maxEnergy); 102 102 103 103 MBinning binsy; … … 129 129 void MHMcCT1CollectionArea::FillSel(Double_t energy, Double_t theta) 130 130 { 131 fHistSel->Fill( energy, theta);131 fHistSel->Fill(log10(energy), theta); 132 132 } 133 133 … … 143 143 fHistAll->Draw(option); 144 144 145 gPad->SetLogx();146 147 145 gPad->Modified(); 148 146 gPad->Update(); … … 159 157 160 158 fHistSel->Draw(option); 161 162 gPad->SetLogx();163 159 164 160 gPad->Modified(); … … 183 179 fHistCol->DrawCopy(option); 184 180 185 gPad->SetLogx();186 187 181 c->Modified(); 188 182 c->Update(); … … 197 191 198 192 fHistCol->Draw(option); 199 200 gPad->SetLogx();201 193 202 194 gPad->Modified(); … … 306 298 for (Int_t i=1; i <= fHistAll->GetNbinsX(); i++) 307 299 { 308 const Float_t e1 = fHistAll->GetXaxis()->GetBinLowEdge(i);309 const Float_t e2 = fHistAll->GetXaxis()->GetBinLowEdge(i+1);300 const Float_t e1 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i)); 301 const Float_t e2 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i+1)); 310 302 311 303 if (e1 < emin1 || e2 > emax2) … … 336 328 337 329 if (Na <= 0) 338 continue; 330 { 331 // 332 // If energy is large, this case means that no or very few events 333 // were generated at this energy bin. In this case we assign it 334 // the effective area of the bin below it in energy. If energy is 335 // below 1E4, it means that no events triggered -> eff area = 0 336 // 337 338 if (fHistSel->GetXaxis()->GetBinLowEdge(ix) > 4.) 339 { 340 fHistCol->SetBinContent(ix, thetabin, fHistCol->GetBinContent(ix-1, thetabin)); 341 fHistCol->SetBinError(ix, thetabin, fHistCol->GetBinError(ix-1, thetabin)); 342 } 343 continue; 344 } 339 345 340 346 const Float_t Ns = fHistSel->GetBinContent(ix,thetabin); … … 350 356 const Double_t err = sqrt((1.-eff)*Ns)/Na; 351 357 358 352 359 const Float_t area = dr * cos(theta*TMath::Pi()/180.); 353 360 354 361 fHistCol->SetBinContent(ix, thetabin, eff*area); 355 362 fHistCol->SetBinError(ix, thetabin, err*area); 363 356 364 } 357 365 } -
trunk/MagicSoft/Mars/mhist/MHMcCT1CollectionArea.h
r1824 r1827 18 18 19 19 public: 20 MHMcCT1CollectionArea(const char *name=NULL, const char *title=NULL, Int_t nbins= 45, Axis_t minEnergy=100., Axis_t maxEnergy=30000.);20 MHMcCT1CollectionArea(const char *name=NULL, const char *title=NULL, Int_t nbins=30, Axis_t minEnergy=2., Axis_t maxEnergy=5.); 21 21 ~MHMcCT1CollectionArea(); 22 22 … … 27 27 28 28 const TH2D *GetHist() const { return fHistCol; } 29 const TH2D *GetHAll() const { return fHistAll; } 30 const TH2D *GetHSel() const { return fHistSel; } 29 31 30 32 void Draw(Option_t *option="");
Note:
See TracChangeset
for help on using the changeset viewer.