Changeset 7174
- Timestamp:
- 06/28/05 13:39:15 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7173 r7174 25 25 26 26 * mfilter/MFMagicCuts.[h,cc]: 27 - first full implem tation... updates to come.27 - first full implementation... updates to come. 28 28 29 29 * mhbase/MH.[h,cc]: … … 35 35 - implemented subtracting off-data from on-data 36 36 - set different palettes 37 38 * mhflux/MMcSpectrumWeight.[h,cc]: 39 - implemented additional weight for zenith-angle- and size-bins 37 40 38 41 -
trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
r7144 r7174 73 73 #include <TF1.h> 74 74 #include <TH1.h> 75 #include <TSpline.h> 75 76 76 77 #include "MLog.h" … … 80 81 #include "MParameters.h" 81 82 83 #include "MHillas.h" 82 84 #include "MPointingPos.h" 83 85 … … 109 111 fAllowChange = kFALSE; 110 112 111 fFunc = NULL; 112 fMcEvt = NULL; 113 fWeight = NULL; 114 fZdWeights = NULL; 115 fPointing = NULL; 113 fFunc = NULL; 114 fMcEvt = NULL; 115 fHillas = NULL; 116 fWeight = NULL; 117 fWeightsZd = NULL; 118 fWeightsSize = NULL; 119 fPointing = NULL; 116 120 } 117 121 … … 133 137 if (fFunc) 134 138 delete fFunc; 139 // if (fWeightsSize) 140 // delete fWeightsSize; 135 141 } 136 142 … … 156 162 return kFALSE; 157 163 158 if (!fZdWeights) 159 return kTRUE; 160 161 fPointing = (MPointingPos*)pList->FindObject("MPointingPos"); 162 if (!fPointing) 163 { 164 *fLog << err << "MPointingPos not found... abort." << endl; 165 return kFALSE; 164 if (fWeightsZd) 165 { 166 fPointing = (MPointingPos*)pList->FindObject("MPointingPos"); 167 if (!fPointing) 168 { 169 *fLog << err << "MPointingPos not found... abort." << endl; 170 return kFALSE; 171 } 172 } 173 174 if (fWeightsSize) 175 { 176 fHillas = (MHillas*)pList->FindObject("MHillas"); 177 if (!fHillas) 178 { 179 *fLog << err << "MHillas not found... abort." << endl; 180 return kFALSE; 181 } 166 182 } 167 183 … … 256 272 TF1 funcold("Dummy", GetFormulaSpecOldX()); 257 273 return funcold.Integral(fEnergyMin, fEnergyMax); 274 } 275 276 void MMcSpectrumWeight::SetWeightsSize(TH1D *h) 277 { 278 fWeightsSize=h; 279 /* 280 if (h==0) 281 { 282 fWeightsSize=0; 283 return; 284 } 285 286 if (fWeightsSize) 287 delete fWeightsSize; 288 289 const Double_t xmin = TMath::Log10(h->GetXaxis()->GetXmin()); 290 const Double_t xmax = TMath::Log10(h->GetXaxis()->GetXmax()); 291 const Double_t xnum = h->GetNbinsX()+1; 292 293 fWeightsSize = new TSpline3("WeightsSize", xmin, xmax, 294 h->GetArray()+1, xnum);*/ 258 295 } 259 296 … … 379 416 Double_t w = 1; 380 417 381 if (fZdWeights) 382 { 383 const Int_t i = fZdWeights->GetXaxis()->FindFixBin(fPointing->GetZd()); 384 w = fZdWeights->GetBinContent(i); 418 if (fWeightsZd) 419 { 420 const Int_t i = fWeightsZd->GetXaxis()->FindFixBin(fPointing->GetZd()); 421 w = fWeightsZd->GetBinContent(i); 422 } 423 if (fWeightsSize) 424 { 425 const Int_t i = fWeightsSize->GetXaxis()->FindFixBin(fHillas->GetSize()); 426 w *= fWeightsSize->GetBinContent(i); 427 // w *= fWeightsSize->Eval(TMath::Log10(fHillas->GetSize())); 385 428 } 386 429 -
trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.h
r7142 r7174 8 8 class TF1; 9 9 class TH1; 10 class TH1D; 11 class TSpline3; 10 12 class MParList; 11 13 class MMcEvt; 14 class MHillas; 12 15 class MParameterD; 13 16 class MPointingPos; … … 17 20 { 18 21 private: 19 const MMcEvt *fMcEvt; // Pointer to the container with the MC energy 20 MParameterD *fWeight; // Pointer to the output MWeight container 21 MPointingPos *fPointing; 22 const MMcEvt *fMcEvt; // Pointer to the container with the MC energy 23 const MHillas *fHillas; 24 MParameterD *fWeight; // Pointer to the output MWeight container 25 MPointingPos *fPointing; 22 26 23 27 TString fNameWeight; // Name of the MWeight container 24 28 TString fNameMcEvt; // Name of the MMcEvt container 25 29 26 TF1 *fFunc; // Function calculating the weights 27 TH1 *fZdWeights; // Set additional ZA weights 30 TF1 *fFunc; // Function calculating the weights 31 TH1 *fWeightsZd; // Set additional ZA weights 32 TH1 *fWeightsSize; // Set additional ZA weights 33 // TSpline3 *fWeightsSize; 28 34 29 35 Double_t fOldSlope; // Slope of energy spectrum generated with Corsika … … 63 69 void SetEnergyRange(Double_t min=-2, Double_t max=-1) { fEnergyMin=min; fEnergyMax=max; } 64 70 void SetOldSlope(Double_t s=-2.6) { fOldSlope=s; } 65 void SetZdWeights(TH1 *h=0) { fZdWeights = h; } 71 void SetWeightsZd(TH1 *h=0) { fWeightsZd = h; } 72 void SetWeightsSize(TH1D *h=0); 66 73 Bool_t Set(const MMcCorsikaRunHeader &h); 67 74
Note:
See TracChangeset
for help on using the changeset viewer.