Changeset 2273 for trunk/MagicSoft/Mars/mhistmc
- Timestamp:
- 07/12/03 16:44:56 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mhistmc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc ¶
r2268 r2273 52 52 // - collection area (result) 53 53 // 54 MHMcCT1CollectionArea::MHMcCT1CollectionArea(const char *name, const char *title) 54 MHMcCT1CollectionArea::MHMcCT1CollectionArea(const char *name, const char *title) : 55 fEaxis(kLog10) 55 56 { 56 57 // … … 66 67 fTitle = title ? title : "Collection Area vs. log10 Energy"; 67 68 68 fEaxis = kLog10Energy;69 70 69 fHistAll = new TH2D; 71 70 fHistSel = new TH2D; … … 84 83 fHistCol->SetDirectory(NULL); 85 84 86 fHistAll->SetXTitle("log10 E [GeV]");87 fHistAll->SetYTitle(" theta [deg]");88 fHistAll->SetZTitle(" N");89 90 fHistSel->SetXTitle("log10 E [GeV]");91 fHistSel->SetYTitle(" theta [deg]");92 fHistSel->SetZTitle(" N");93 94 fHistCol->SetXTitle("log10 E [GeV]");85 fHistAll->SetXTitle("log10(E [GeV])"); 86 fHistAll->SetYTitle("\\Theta [\\circ]"); 87 fHistAll->SetZTitle("Counts"); 88 89 fHistSel->SetXTitle("log10(E [GeV])"); 90 fHistSel->SetYTitle("\\Theta [\\circ]"); 91 fHistSel->SetZTitle("Counts"); 92 93 fHistCol->SetXTitle("log10(E [GeV])"); 95 94 fHistCol->SetYTitle("theta [deg]"); 96 95 fHistCol->SetZTitle("A [m^{2}]"); … … 133 132 fHistCol->Sumw2(); 134 133 135 if (fEaxis == k Energy)136 137 138 139 140 141 142 143 144 134 if (fEaxis == kLinear) 135 { 136 fTitle = "Collection Area vs. Energy"; 137 fHistCol->SetTitle(fTitle); 138 fHistAll->SetTitle("All showers - Theta vs Energy distribution"); 139 fHistSel->SetTitle("Selected showers - Theta vs Energy distribution"); 140 fHistCol->SetXTitle("E [GeV]"); 141 fHistAll->SetXTitle("E [GeV]"); 142 fHistSel->SetXTitle("E [GeV]"); 143 } 145 144 146 145 return kTRUE; … … 156 155 MMcEvt &mcevt = *(MMcEvt*)par; 157 156 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); 157 const Double_t E = fEaxis==kLinear ? mcevt.GetEnergy() : log10(mcevt.GetEnergy()); 158 159 fHistSel->Fill(E, kRad2Deg*mcevt.GetTelescopeTheta(), w); 162 160 163 161 return kTRUE; … … 211 209 212 210 c.cd(1); 213 if (fEaxis == k Energy)211 if (fEaxis == kLinear) 214 212 gPad->SetLogx(); 215 213 fHistCol->SetDirectory(NULL); … … 217 215 218 216 c.cd(2); 219 if (fEaxis == k Energy)217 if (fEaxis == kLinear) 220 218 gPad->SetLogx(); 221 219 fHistSel->SetDirectory(NULL); … … 223 221 224 222 c.cd(3); 225 if (fEaxis == k Energy)223 if (fEaxis == kLinear) 226 224 gPad->SetLogx(); 227 225 fHistAll->SetDirectory(NULL); … … 462 460 Float_t e2; 463 461 464 if (fEaxis == kLog10 Energy)462 if (fEaxis == kLog10) 465 463 { 466 464 e1 = pow(10.,fHistAll->GetXaxis()->GetBinLowEdge(i)); … … 547 545 // 548 546 549 Float_t area ;547 Float_t area = dr; 550 548 551 549 if (theta < 50) 552 area = dr * cos(theta*TMath::Pi()/180.); 553 else 554 area = dr; 550 area *= cos(theta*TMath::Pi()/180.); 555 551 556 552 // Above 50 degrees MC was generated with Corsika 6.xx, and the cores -
TabularUnified trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.h ¶
r2268 r2273 6 6 #endif 7 7 8 enum {9 kLog10Energy,10 kEnergy11 };12 13 8 class TH2D; 14 9 15 10 class MHMcCT1CollectionArea : public MH 16 11 { 12 public: 13 enum FillType_t { 14 kLog10, 15 kLinear 16 }; 17 17 18 private: 18 19 TH2D *fHistAll; // all simulated showers … … 20 21 TH2D *fHistCol; // the collection area 21 22 22 Byte_tfEaxis;23 FillType_t fEaxis; 23 24 24 25 public: … … 32 33 void DrawSel(Option_t *option=""); 33 34 34 void SetEaxis( Byte_t x) { fEaxis = x; }35 void SetEaxis(FillType_t x) { fEaxis = x; } 35 36 36 37 const TH2D *GetHist() const { return fHistCol; }
Note:
See TracChangeset
for help on using the changeset viewer.