Changeset 8679
- Timestamp:
- 08/19/07 22:40:04 (17 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8677 r8679 25 25 the ListOfCleanups instead of removing the newly created canvas 26 26 from the global list of canvases 27 28 * mimage/MHHillas.cc, mimage/MHHillasExt.cc, mimage/MHHillasSrc.cc, 29 mimage/MHImagePar.cc, mimage/MHNewImagePar.cc: 30 - enables a lot of grids 31 32 * mhbase/MBinning.[h,cc]: 33 - addec constructor with a TArrayD 34 35 * mhbase/MH.[h,cc]: 36 - added two new member functions GetRange and GetRangeUser 37 38 * mjoptim/MJOptimizeDisp.[h,cc]: 39 - added new option UseThetaSq 40 41 * mjoptim/MJOptimizeEnergy.[h,cc]: 42 - added possibility to use also logarithmic fits 43 44 * mmc/MMcCorsikaRunHeader.cc: 45 - improved Print function 46 47 * msignal/MExtractTimeAndChargeSpline.cc: 48 - initialize rise and fall time as suggested by valgrind 49 50 * mtools/MChisqEval.[h,cc]: 51 - implemented the possibility to use weights 52 27 53 28 54 -
trunk/MagicSoft/Mars/NEWS
r8676 r8679 132 132 + PostCleanType: 3 133 133 134 - star/ganymed: The old spark-cuts have been replaced by new ones. 135 These new spark cuts have been cross checked with the sequences 136 84720 (before splitter), 101041 (after splitter) and 223539 (new 137 FADCs). In all cases they seperate pretty well, but of course not 138 perfect. Monte Carlos have suggested to tighten the cuts a little 139 bit further at low sizes. This has been done. 140 141 - ganymed: IMPORTANT - The spark cuts have been changed to match 142 all available data more or less well. This might mean that for 143 YOUR data there are still sparks visible. 144 Whenever you do an analysis you have to make sure that NO sparks 145 survive your cuts! 146 134 147 - ganymed: The old hadronness and size cuts have gotten new indices 135 148 (10, 11). The old indices 8 and 9 now mean an additional condition … … 188 201 paremtrization set parameter 8 to 0. 189 202 190 - star/ganymed: The old spark-cuts have been replaced by new ones.191 These new spark cuts have been cross checked with the sequences192 84720 (before splitter), 101041 (after splitter) and 223539 (new193 FADCs). In all cases they seperate pretty well, but of course not194 perfect. Monte Carlos have suggested to tighten the cuts a little195 bit further at low sizes. This has been done.196 197 - ganymed: IMPORTANT - The spark cuts have been changed to match198 all available data more or less well. This might mean that for199 YOUR data there are still sparks visible.200 Whenever you do an analysis you have to make sure that NO sparks201 survive your cuts!202 203 203 - ganymed: The distribution of observation time versus zenith 204 204 angle is now shown for off- AND on-data. … … 209 209 all off-regions from this file. Please do not forget to 210 210 set the scaling in optimwobble.C properly: 211 fit.SetScaleMode(MAlphaFitter::kNone);212 211 fit.SetScaleUser(1./3); 213 212 it is not yet read in automatically (will follow soon). … … 244 243 the information is lost. 245 244 246 - sponde: added a new tab "EventDist" showing the unweighted event247 distribution of your sample after cuts. This tells you how many248 events with this energy you had in your MC files. The same information249 you get from the error bars of the weighted histograms, but this is250 less intuitive.245 - sponde: added a new tab "EventDist" showing the unweighted real 246 absolute number of events of your sample after cuts. This tells 247 you how many events with this energy you had in your MC files. 248 The same information you get from the error bars of the weighted 249 histograms, but this is less intuitive. 251 250 252 251 -
trunk/MagicSoft/Mars/mhbase/MBinning.cc
r8106 r8679 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MBinning.cc,v 1.1 7 2006-10-17 17:16:00 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MBinning.cc,v 1.18 2007-08-19 21:35:00 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 134 134 // -------------------------------------------------------------------------- 135 135 // 136 // Initialize Binning from TArrayD. 137 // 138 MBinning::MBinning(const TArrayD &axis, const char *name, const char *title) 139 { 140 fName = name ? name : gsDefName.Data(); 141 fTitle = title ? title : gsDefTitle.Data(); 142 143 SetEdges(axis); 144 } 145 146 // -------------------------------------------------------------------------- 147 // 136 148 // Search in the parameter list for the binning with name "name". If found, 137 149 // set the edges and title accordingly. Default is name of object. -
trunk/MagicSoft/Mars/mhbase/MBinning.h
r8398 r8679 43 43 MBinning(const TH1 &h, const Char_t axis='x', const char *name=0, const char *title=0); 44 44 MBinning(const TAxis &a, const char *name=0, const char *title=0); 45 MBinning(const TArrayD &a, const char *name=0, const char *title=0); 45 46 46 47 void Copy(TObject &named) const -
trunk/MagicSoft/Mars/mhbase/MH.cc
r8657 r8679 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.3 3 2007-08-06 14:44:13tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MH.cc,v 1.34 2007-08-19 21:36:00 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 20 20 ! Author(s): Thomas Bretz 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de> 21 21 ! 22 ! Copyright: MAGIC Software Development, 2000-200 222 ! Copyright: MAGIC Software Development, 2000-2007 23 23 ! 24 24 ! … … 1409 1409 // -------------------------------------------------------------------------- 1410 1410 // 1411 // Return the first and last bin of the histogram which is not 0 1412 // 1413 void MH::GetRange(const TH1 &h, Int_t &lo, Int_t &hi) 1414 { 1415 lo = 0; 1416 hi = 1; 1417 1418 for (int i=2; i<=h.GetNbinsX(); i++) 1419 { 1420 if (lo==0 && h.GetBinContent(i)>0) 1421 lo = i; 1422 1423 if (h.GetBinContent(i)>0) 1424 hi = i; 1425 } 1426 } 1427 1428 // -------------------------------------------------------------------------- 1429 // 1430 // Return the lower edge of the first and the upper edge of the last bin 1431 // of the histogram which is not 0 1432 // 1433 void MH::GetRangeUser(const TH1 &h, Axis_t &lo, Axis_t &hi) 1434 { 1435 Int_t f, l; 1436 GetRange(h, f, l); 1437 1438 lo = h.GetBinLowEdge(f); 1439 hi = h.GetBinLowEdge(l+1); 1440 } 1441 1442 // -------------------------------------------------------------------------- 1443 // 1411 1444 // See MTask::PrintSkipped 1412 1445 // -
trunk/MagicSoft/Mars/mhbase/MH.h
r8657 r8679 119 119 static void ProjectionY(TH1D &dest, const TH2 &src, Int_t firstxbin=-1, Int_t lastxbin=9999); 120 120 121 static void GetRangeUser(const TH1 &hist, Axis_t &lo, Axis_t &hi); 122 static void GetRange(const TH1 &hist, Int_t &lo, Int_t &hi); 123 121 124 static TObject *FindObjectInPad(const char *name, TVirtualPad *pad=NULL); 122 125 -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.cc
r8671 r8679 178 178 179 179 MChisqEval eval; 180 eval.SetY1("sqrt(ThetaSquared.fVal)"); 180 eval.SetY1(fUseThetaSq?"ThetaSquared.fVal":"sqrt(ThetaSquared.fVal)"); 181 if (weights) 182 eval.SetNameWeight(); 181 183 182 184 MMatrixLoop loop(&m); -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeDisp.h
r7152 r8679 10 10 class MJOptimizeDisp : public MJOptimize 11 11 { 12 private: 13 Bool_t fUseThetaSq; 14 12 15 public: 13 MJOptimizeDisp() : MJOptimize() { } 16 MJOptimizeDisp() : MJOptimize(), fUseThetaSq(kFALSE) { } 17 18 void EnableThetaSq(Bool_t b=kTRUE) { fUseThetaSq=b; } 14 19 15 20 // Special optimizing routines -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.cc
r8671 r8679 66 66 // histograms 67 67 #include "../mhflux/MHEnergyEst.h" 68 #include "../mtools/MChisqEval.h" 68 69 69 70 // tasks … … 108 109 MHMatrix m("M"); 109 110 AddRulesToMatrix(m); 111 const Int_t map = m.AddColumn("MMcEvt.fEnergy"); 110 112 parlist.AddToList(&m); 111 113 … … 136 138 fill.SetWeight(); 137 139 140 MChisqEval eval; 141 eval.SetY1(fOptimLog?Form("log10(MEnergyEst.fVal/M[%d])", map):Form("MEnergyEst.fVal-M[%d]", map)); 142 if (weights) 143 eval.SetNameWeight(); 144 138 145 MMatrixLoop loop(&m); 139 146 … … 143 150 tasklist.AddToList(weights); 144 151 tasklist.AddToList(&fill); 152 tasklist.AddToList(&eval); 145 153 146 154 // Optimize with the tasklist in this parameterlist -
trunk/MagicSoft/Mars/mjoptim/MJOptimizeEnergy.h
r7152 r8679 10 10 class MJOptimizeEnergy : public MJOptimize 11 11 { 12 private: 13 Bool_t fOptimLog; 14 12 15 public: 13 MJOptimizeEnergy() : MJOptimize() { } 16 MJOptimizeEnergy() : MJOptimize(), fOptimLog(kFALSE) { } 17 18 void EnableOptimLog(Bool_t b=kTRUE) { fOptimLog=b; } 14 19 15 20 // Special optimizing routines -
trunk/MagicSoft/Mars/msignal/MExtractTimeAndChargeSpline.cc
r8478 r8679 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.6 8 2007-05-09 12:15:53 tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MExtractTimeAndChargeSpline.cc,v 1.69 2007-08-19 21:40:03 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 179 179 // 180 180 MExtractTimeAndChargeSpline::MExtractTimeAndChargeSpline(const char *name, const char *title) 181 : f HeightTm(0.5), fExtractionType(MExtralgoSpline::kIntegralRel)181 : fRiseTimeHiGain(0), fFallTimeHiGain(0), fHeightTm(0.5), fExtractionType(MExtralgoSpline::kIntegralRel) 182 182 { 183 183 -
trunk/MagicSoft/Mars/mtools/MChisqEval.cc
r8074 r8679 49 49 const TString MChisqEval::gsDefTitle = "Evaluate a chisq"; 50 50 51 MChisqEval::MChisqEval(const char *name, const char *title) : fData0(NULL), fData1(NULL), fNameResult("MinimizationValue") 51 MChisqEval::MChisqEval(const char *name, const char *title) 52 : fData0(NULL), fData1(NULL), fWeight(NULL), fNameResult("MinimizationValue") 52 53 { 53 54 fName = name ? name : gsDefName.Data(); … … 55 56 } 56 57 57 MChisqEval::MChisqEval(MData *y1, const char *name, const char *title) : fData0(NULL), fData1(NULL), fNameResult("MinimizationValue") 58 MChisqEval::MChisqEval(MData *y1, const char *name, const char *title) 59 : fData0(NULL), fData1(NULL), fWeight(NULL), fNameResult("MinimizationValue") 58 60 { 59 61 fName = name ? name : gsDefName.Data(); … … 62 64 } 63 65 64 MChisqEval::MChisqEval(MData *y1, MData *y2, const char *name, const char *title) : fData0(NULL), fData1(NULL), fNameResult("MinimizationValue") 66 MChisqEval::MChisqEval(MData *y1, MData *y2, const char *name, const char *title) 67 : fData0(NULL), fData1(NULL), fWeight(NULL), fNameResult("MinimizationValue") 65 68 { 66 69 fName = name ? name : gsDefName.Data(); … … 112 115 { 113 116 fChisq = 0; 117 fSumW = 0; 114 118 115 119 if (!fData0) … … 122 126 if (!fData1->PreProcess(plist)) 123 127 return kFALSE; 128 129 if (!fNameWeight.IsNull()) 130 { 131 fWeight = (MParameterD*)plist->FindObject(fNameWeight, "MParameterD"); 132 if (!fWeight) 133 return kFALSE; 134 } 124 135 125 136 fResult = (MParameterD*)plist->FindCreateObj("MParameterD", fNameResult); … … 138 149 const Double_t err = fData1 ? y1*y2 : 1; 139 150 140 fChisq += dy*dy/err; 151 const Double_t w = fWeight ? fWeight->GetVal() : 1; 152 153 fChisq += w*dy*dy/err; 154 fSumW += w; 155 141 156 return kTRUE; 142 157 } … … 145 160 { 146 161 if (GetNumExecutions()>0) 147 fChisq /= GetNumExecutions();162 fChisq /= fSumW; 148 163 149 164 fResult->SetVal(fChisq); -
trunk/MagicSoft/Mars/mtools/MChisqEval.h
r7804 r8679 15 15 static const TString gsDefTitle; 16 16 17 Double_t fChisq; //! Evaluated chi square18 MParameterD *fResult; //! Storage for result19 20 17 MData *fData0; // Data Member one (monte carlo data or chisq function) 21 18 MData *fData1; // Data Member two (measured data) 22 19 20 MParameterD *fWeight; //! Storage for weight 21 MParameterD *fResult; //! Storage for result 22 23 23 TString fNameResult; 24 TString fNameWeight; 25 26 Double_t fChisq; //! Evaluated chi square 27 Double_t fSumW; //! Sum of weights 24 28 25 29 void StreamPrimitive(ostream &out) const; … … 43 47 44 48 void SetOwner(Bool_t o=kTRUE) { o ? SetBit(kIsOwner) : ResetBit(kIsOwner); } 49 void SetNameWeight(TString w="MWeight") { fNameWeight=w; } 45 50 46 51 Double_t GetChisq() const { return fChisq; } -
trunk/MagicSoft/include-Classes/MMcFormat/MMcCorsikaRunHeader.cc
r3381 r8679 206 206 // Print Information about the Geometry of the camera 207 207 // 208 *fLog << all << GetTitle() <<". Number of Telescopes: " << fNumCT << endl; 209 210 fTelescopes.Print(); 208 *fLog << all << GetTitle() <<":" << endl; 209 *fLog << " Spectral Slope: " << fSlopeSpec << " from " << fELowLim << "GeV to " << fEUppLim << "GeV" << endl; 210 *fLog << " Number of Telescopes: " << fNumCT << endl; 211 fTelescopes.Print(); 211 212 }
Note:
See TracChangeset
for help on using the changeset viewer.