Changeset 2268 for trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc
- Timestamp:
- 07/07/03 16:22:51 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc
r2261 r2268 66 66 fTitle = title ? title : "Collection Area vs. log10 Energy"; 67 67 68 fEaxis = kLog10Energy; 69 68 70 fHistAll = new TH2D; 69 71 fHistSel = new TH2D; … … 93 95 fHistCol->SetYTitle("theta [deg]"); 94 96 fHistCol->SetZTitle("A [m^{2}]"); 97 95 98 } 96 99 … … 130 133 fHistCol->Sumw2(); 131 134 135 if (fEaxis == kEnergy) 136 { 137 fTitle = "Collection Area vs. Energy"; 138 fHistCol->SetTitle(fTitle); 139 fHistAll->SetTitle("All showers - Theta vs Energy distribution"); 140 fHistSel->SetTitle("Selected showers - Theta vs Energy distribution"); 141 fHistCol->SetXTitle("E [GeV]"); 142 fHistAll->SetXTitle("E [GeV]"); 143 fHistSel->SetXTitle("E [GeV]"); 144 } 145 132 146 return kTRUE; 133 147 } … … 142 156 MMcEvt &mcevt = *(MMcEvt*)par; 143 157 144 fHistSel->Fill(log10(mcevt.GetEnergy()), kRad2Deg*mcevt.GetTelescopeTheta(), w); 158 if (fEaxis == kLog10Energy) 159 fHistSel->Fill(log10(mcevt.GetEnergy()), kRad2Deg*mcevt.GetTelescopeTheta(), w); 160 else 161 fHistSel->Fill(mcevt.GetEnergy(), kRad2Deg*mcevt.GetTelescopeTheta(), w); 162 145 163 return kTRUE; 146 164 } … … 193 211 194 212 c.cd(1); 213 if (fEaxis == kEnergy) 214 gPad->SetLogx(); 195 215 fHistCol->SetDirectory(NULL); 196 216 fHistCol->DrawCopy(option); 197 217 198 218 c.cd(2); 219 if (fEaxis == kEnergy) 220 gPad->SetLogx(); 199 221 fHistSel->SetDirectory(NULL); 200 222 fHistSel->DrawCopy(option); 201 223 202 224 c.cd(3); 225 if (fEaxis == kEnergy) 226 gPad->SetLogx(); 203 227 fHistAll->SetDirectory(NULL); 204 228 fHistAll->DrawCopy(option); … … 435 459 for (Int_t i=1; i <= fHistAll->GetNbinsX(); i++) 436 460 { 437 Float_t e1 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i)); 438 Float_t e2 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i+1)); 461 Float_t e1; 462 Float_t e2; 463 464 if (fEaxis == kLog10Energy) 465 { 466 e1 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i)); 467 e2 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i+1)); 468 } 469 else 470 { 471 e1 = fHistAll->GetXaxis()->GetBinLowEdge(i); 472 e2 = fHistAll->GetXaxis()->GetBinLowEdge(i+1); 473 } 439 474 440 475 Float_t events = 0.;
Note:
See TracChangeset
for help on using the changeset viewer.