Changeset 1986 for trunk/MagicSoft/Mars
- Timestamp:
- 04/23/03 15:02:13 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1985 r1986 1 1 -*-*- END OF LINE -*-*- 2 3 2003/04/23: Abelardo Moralejo 4 5 * mhistmc/MHMcCT1CollectionArea.[h,cc] 6 - Now the class inherits from MH instead of directly from 7 MParContainer. Implemented SetupFill, so that the binning 8 definitions are read from the parlist. 9 10 * mmontecarlo/MMcCT1CollectionAreaCalc.[h,cc] 11 - Removed. This class was superfluous, since the same job 12 can be done using MFillH. 13 14 * mmontecarlo/Makefile, MontecarloLinkDef.h 15 - removed class MMcCT1CollectionAreaCalc. 16 17 * macros/CT1collarea.C 18 - adapted to changes above. 2 19 3 20 2003/04/23: Antonio Stamerra -
trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.cc
r1974 r1986 34 34 #include <TCanvas.h> 35 35 36 #include "MMcEvt.hxx" 36 37 #include "MH.h" 37 38 #include "MBinning.h" 39 #include "MParList.h" 40 #include "MLog.h" 41 #include "MLogManip.h" 42 38 43 39 44 ClassImp(MHMcCT1CollectionArea); … … 46 51 // - collection area (result) 47 52 // 48 MHMcCT1CollectionArea::MHMcCT1CollectionArea(const char *name, const char *title , Int_t nbins, Axis_t minEnergy, Axis_t maxEnergy)53 MHMcCT1CollectionArea::MHMcCT1CollectionArea(const char *name, const char *title) 49 54 { 50 55 // … … 64 69 fHistCol = new TH2D; 65 70 66 SetBins(nbins, minEnergy, maxEnergy);67 68 71 fHistCol->SetName(fName); 69 72 fHistAll->SetName("AllEvents"); … … 93 96 // -------------------------------------------------------------------------- 94 97 // 95 // Set binning of histograms. Binning of energy axis can be changed, that96 // of theta axis is always the same (to match the CT1 MC sample theta dist):97 //98 void MHMcCT1CollectionArea::SetBins(Int_t nbins, Axis_t minEnergy, Axis_t maxEnergy)99 {100 MBinning binsx;101 binsx.SetEdges(nbins, minEnergy, maxEnergy);102 103 MBinning binsy;104 const Double_t yedge[7] = {12.5, 17.5, 23.5, 29.5, 35.5, 42., 48.};105 const TArrayD yed(7,yedge);106 binsy.SetEdges(yed);107 108 MH::SetBinning(fHistAll, &binsx, &binsy);109 MH::SetBinning(fHistSel, &binsx, &binsy);110 MH::SetBinning(fHistCol, &binsx, &binsy);111 }112 113 114 // --------------------------------------------------------------------------115 //116 98 // Delete the three histograms 117 99 // … … 125 107 // -------------------------------------------------------------------------- 126 108 // 109 // Set the binnings and prepare the filling of the histograms 110 // 111 Bool_t MHMcCT1CollectionArea::SetupFill(const MParList *plist) 112 { 113 const MBinning* binsenergy = (MBinning*)plist->FindObject("MBinningE"); 114 const MBinning* binstheta = (MBinning*)plist->FindObject("MBinningTheta"); 115 116 if (!binsenergy || !binstheta) 117 { 118 *fLog << err << dbginf << "At least one MBinning not found... aborting." 119 << endl; 120 return kFALSE; 121 } 122 123 SetBinning(fHistAll, binsenergy, binstheta); 124 SetBinning(fHistSel, binsenergy, binstheta); 125 SetBinning(fHistCol, binsenergy, binstheta); 126 127 fHistAll->Sumw2(); 128 fHistSel->Sumw2(); 129 fHistCol->Sumw2(); 130 131 return kTRUE; 132 } 133 134 135 // -------------------------------------------------------------------------- 136 // 127 137 // Fill data into the histogram which contains the selected showers 128 138 // 129 void MHMcCT1CollectionArea::FillSel(Double_t energy, Double_t theta) 130 { 131 fHistSel->Fill(log10(energy), theta); 139 Bool_t MHMcCT1CollectionArea::Fill(const MParContainer *par) 140 { 141 MMcEvt &mcevt = *(MMcEvt*)par; 142 143 fHistSel->Fill(log10(mcevt.GetEnergy()), kRad2Deg*mcevt.GetTelescopeTheta()); 144 return kTRUE; 132 145 } 133 146 … … 209 222 // set here by hand, so make sure that the MC sample you are using is the 210 223 // right one (check all these quantities in your files and compare with 211 // is written below. In some theta bins, there are two different224 // what is written below. In some theta bins, there are two different 212 225 // productions, with different energy limits but with the same spectral 213 226 // slope. We account for this when calculating the original number of … … 354 367 355 368 const Double_t eff = Ns/Na; 356 const Double_t e rr = sqrt((1.-eff)*Ns)/Na;369 const Double_t efferr = sqrt((1.-eff)*Ns)/Na; 357 370 358 371 … … 360 373 361 374 fHistCol->SetBinContent(ix, thetabin, eff*area); 362 fHistCol->SetBinError(ix, thetabin, e rr*area);375 fHistCol->SetBinError(ix, thetabin, efferr*area); 363 376 364 377 } -
trunk/MagicSoft/Mars/mhistmc/MHMcCT1CollectionArea.h
r1974 r1986 2 2 #define MARS_MHMcCT1CollectionArea 3 3 4 #ifndef MARS_M ParContainer5 #include "M ParContainer.h"4 #ifndef MARS_MH 5 #include "MH.h" 6 6 #endif 7 7 8 8 class TH2D; 9 9 10 11 class MHMcCT1CollectionArea : public MParContainer 10 class MHMcCT1CollectionArea : public MH 12 11 { 13 12 private: … … 15 14 TH2D *fHistSel; // the selected showers 16 15 TH2D *fHistCol; // the collection area 17 void SetBins(Int_t nbins, Axis_t minEnergy, Axis_t maxEnergy);18 16 19 17 public: 20 MHMcCT1CollectionArea(const char *name=NULL, const char *title=NULL , Int_t nbins=30, Axis_t minEnergy=2., Axis_t maxEnergy=5.);18 MHMcCT1CollectionArea(const char *name=NULL, const char *title=NULL); 21 19 ~MHMcCT1CollectionArea(); 22 20 23 void FillSel(Double_t energy, Double_t radius); 21 virtual Bool_t SetupFill(const MParList *pList); 22 virtual Bool_t Fill(const MParContainer *par); 24 23 25 24 void DrawAll(Option_t *option=""); -
trunk/MagicSoft/Mars/mmontecarlo/Makefile
r1982 r1986 32 32 MMcTimeGenerate.cc \ 33 33 MMcTriggerRateCalc.cc \ 34 MMcCT1CollectionAreaCalc.cc \35 34 MMcEnergyEst.cc 36 35 -
trunk/MagicSoft/Mars/mmontecarlo/MonteCarloLinkDef.h
r1982 r1986 9 9 #pragma link C++ class MMcCollectionAreaCalc+; 10 10 #pragma link C++ class MMcTriggerRateCalc+; 11 #pragma link C++ class MMcCT1CollectionAreaCalc+;12 11 #pragma link C++ class MMcEnergyEst+; 13 12 #endif
Note:
See TracChangeset
for help on using the changeset viewer.