Changeset 8719 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 08/28/07 13:03:04 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHDisp.cc
r7616 r8719 70 70 // 71 71 MHDisp::MHDisp(const char *name, const char *title) 72 : fDisp(0), fDeviation(0), fS mearing(-1), fWobble(kFALSE),72 : fDisp(0), fDeviation(0), fSrcAnti(0), fSmearing(-1), fWobble(kFALSE), 73 73 fScaleMin(0.325), fScaleMax(0.475) 74 74 { … … 81 81 fHist.SetName("Alpha"); 82 82 fHist.SetTitle("3D-plot of ThetaSq vs x, y"); 83 fHist.SetXTitle(" x [\\circ]");84 fHist.SetYTitle(" y [\\circ]");83 fHist.SetXTitle("dx [\\circ]"); 84 fHist.SetYTitle("dy [\\circ]"); 85 85 fHist.SetZTitle("Eq.cts"); 86 86 … … 112 112 } 113 113 114 if (fWobble) 115 { 116 fSrcAnti = (MSrcPosCam*)plist->FindObject("MSrcPosAnti", "MSrcPosCam"); 117 if (!fSrcAnti) 118 { 119 *fLog << err << "MSrcPosAnti [MSrcPosCam] not found... abort." << endl; 120 return kFALSE; 121 } 122 123 *fLog << inf << "Wobble mode initialized. " << endl; 124 } 125 114 126 fDeviation = (MPointingDev*)plist->FindObject("MPointingDev"); 115 127 if (!fDeviation) … … 132 144 // -------------------------------------------------------------------------- 133 145 // 134 // Calculate the delta angle between fSrcPos->GetXY() and v.135 // Return result in deg.136 //137 Double_t MHDisp::DeltaPhiSrc(const TVector2 &v) const138 {139 return TMath::Abs(fSrcPos->GetXY().DeltaPhi(v))*TMath::RadToDeg();140 }141 142 // --------------------------------------------------------------------------143 //144 146 // Fill the histogram. For details see the code or the class description 145 147 // … … 162 164 TVector2 pos1 = hil->GetMean()*fMm2Deg + hil->GetNormAxis()*fDisp->GetVal(); 163 165 166 const TVector2 src = fSrcPos->GetXY()*fMm2Deg; 167 164 168 Double_t w0 = 1; 165 169 if (fWobble) 166 170 { 167 const Double_t delta = DeltaPhiSrc(pos1);171 const TVector2 anti = fSrcAnti->GetXY()*fMm2Deg; 168 172 169 173 // Skip off-data not in the same half than the source (here: anti-source) … … 171 175 if (!fHistOff) 172 176 { 173 if (delta>180-25) 177 Double_t r = anti.Mod()>0.2*1.7 ? 0.2*1.7 : anti.Mod(); 178 179 // In wobble mode processing the off-data, the anti-source 180 // position is our source position. Check if this is a possible 181 // gamma. If it is, do not fill it into our off-data histogram 182 if ((pos1-anti).Mod()<r) 174 183 return kTRUE; 175 184 … … 181 190 // increased uncertainty 182 191 // FIXME: The delta stuff could be replaced by a 2*antitheta cut... 183 w0 = delta>25 ? 1 : 2; 184 } 192 //w0 = delta>25 ? 1 : 2; 193 194 w0 = (pos1+anti).Mod()<r ? 2 : 1; 195 } 196 197 // When processing off-data the anti-source is the real source 198 const TVector2 srcpos = fHistOff ? src : anti; 185 199 186 200 // Define by the source position which histogram to fill 187 if ( DeltaPhiSrc(fFormerSrc)>90)201 if (TMath::Abs(srcpos.DeltaPhi(fFormerSrc))*TMath::RadToDeg()>90) 188 202 fHalf = !fHalf; 189 fFormerSrc = fSrcPos->GetXY();203 fFormerSrc = srcpos; 190 204 } 191 205 … … 202 216 { 203 217 // m: Position of the camera center in the FS plot 204 m = fSrcPos->GetXY().Rotate(-rho)*fMm2Deg;218 m = src.Rotate(-rho); 205 219 pos1 -= m; 206 220 } … … 410 424 const TAxis &axey = *h2.GetYaxis(); 411 425 412 const Double_t rmax = (fWobble ? axex.GetXmax() -0.4: axex.GetXmax()) - axex.GetBinWidth(1);426 const Double_t rmax = (fWobble ? axex.GetXmax()/*-0.7*/ : axex.GetXmax()) - axex.GetBinWidth(1); 413 427 414 428 for (int x=1; x<=axex.GetNbins(); x++) -
trunk/MagicSoft/Mars/mhflux/MHDisp.h
r7616 r8719 25 25 MPointingDev *fDeviation; //! 26 26 //MSrcPosCam *fAxis; //! 27 MSrcPosCam *fSrcAnti; //! 28 27 29 28 30 TH2D fHistBg; … … 41 43 // MHDisp 42 44 Double_t GetOffSignal(TH1 &h) const; 43 Double_t DeltaPhiSrc(const TVector2 &v) const;44 45 45 46 void Update(); -
trunk/MagicSoft/Mars/mhflux/MMcSpectrumWeight.cc
r8709 r8719 493 493 if (hasold) 494 494 { 495 *fLog << " Old Spectrum: " << GetFormulaSpecOldX();495 *fLog << " Old Spectrum: " << GetFormulaSpecOldX(); 496 496 if (fEnergyMin>=0 && fEnergyMax>0) 497 497 *fLog << " (I=" << GetSpecOldIntegral() << ")"; … … 500 500 if (hasnew) 501 501 { 502 *fLog << " New Spectrum: " << GetFormulaSpecNewX();502 *fLog << " New Spectrum: " << GetFormulaSpecNewX(); 503 503 if (fEnergyMin>=0 && fEnergyMax>0) 504 504 *fLog << " (I=" << GetSpecNewIntegral() << ")"; … … 506 506 } 507 507 if (fFunc) 508 *fLog << " Weight func: " << fFunc->GetTitle() << endl;508 *fLog << " Weight func: " << fFunc->GetTitle() << endl; 509 509 } 510 510
Note:
See TracChangeset
for help on using the changeset viewer.