Changeset 2273
- Timestamp:
- 07/12/03 16:44:56 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2269 r2273 1 1 -*-*- END OF LINE -*-*- 2 3 2003/07/12: Thomas Bretz 4 5 * mhistmc/MHMcCT1CollectionArea.[h,cc]: 6 - made the enum as FillType_t a public member of the class 7 8 * macros/CT1collarea.C 9 - Updated accordingly. Can somebody please check whether it 10 still works. 11 12 * mbase/MArgs.h: 13 - added some comment 14 15 * mraw/MRawRunHeader.cc: 16 - added an 'inf' to the log-stream 17 18 2 19 3 20 2003/07/08: Abelardo Moralejo … … 9 26 distribution of the shower. 10 27 28 29 11 30 2003/07/06: Abelardo Moralejo 12 31 … … 20 39 - Added example on how to use the new function 21 40 MHMcCT1CollectionArea::SetEaxis 41 42 22 43 23 44 2003/07/06: Thomas Bretz -
trunk/MagicSoft/Mars/macros/CT1collarea.C
r2268 r2273 24 24 \* ======================================================================== */ 25 25 26 #include "/home/magic/Mars/mhistmc/MHMcCT1CollectionArea.h"27 28 26 void CT1collarea(TString filename="MC_SC4.root", TString outname="") 29 27 { … … 45 43 reader.DisableAutoScheme(); 46 44 47 MHMcCT1CollectionArea * collarea = new MHMcCT1CollectionArea();45 MHMcCT1CollectionArea collarea; 48 46 49 47 MBinning binsx("BinningE"); … … 54 52 xed.Set(15,xedge); 55 53 binsx.SetEdges(xed); 56 collarea ->SetEaxis(kLog10Energy);54 collarea.SetEaxis(MHMcCollectionArea::kLog10); 57 55 */ 58 56 … … 64 62 // 65 63 binsx.SetEdgesLog(14,300,1.e5); 66 collarea ->SetEaxis(kEnergy);64 collarea.SetEaxis(MHMcCT1CollectionArea::kLinear); 67 65 68 66 … … 73 71 binsy.SetEdges(yed); 74 72 75 parlist.AddToList( collarea);73 parlist.AddToList(&collarea); 76 74 parlist.AddToList(&binsx); 77 75 parlist.AddToList(&binsy); … … 103 101 tasklist.PrintStatistics(); 104 102 105 collarea ->CalcEfficiency();103 collarea.CalcEfficiency(); 106 104 107 105 // … … 109 107 // filled and can be displayed 110 108 // 111 collarea ->DrawClone();109 collarea.DrawClone(); 112 110 113 111 // … … 119 117 120 118 TFile f(outname,"recreate"); 121 collarea->GetHist()->Write(); 122 collarea->GetHAll()->Write(); 123 collarea->GetHSel()->Write(); 124 f.Close(); 119 collarea.GetHist()->Write(); 120 collarea.GetHAll()->Write(); 121 collarea.GetHSel()->Write(); 125 122 } 126 123 -
trunk/MagicSoft/Mars/mbase/MArgs.h
r2267 r2273 35 35 void Print(const Option_t *o="") const; 36 36 37 // FIXME: Add max, min option 38 // FIXME: Add default option 39 37 40 Int_t GetInt(const TString name) const; 38 41 Double_t GetFloat(const TString name) const; -
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 -
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; } -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r2200 r2273 155 155 *fLog << "Evt Counter: " << fNumEvents << endl; 156 156 157 *fLog << hex;157 *fLog << inf << hex; 158 158 for (int i=0; i<GetNumPixel(); i++) 159 159 *fLog << setfill('0') << setw(3) << (*fPixAssignment)[i] << " ";
Note:
See TracChangeset
for help on using the changeset viewer.