Changeset 7594 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
03/13/06 15:51:11 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7591 r7594  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2006/03/13 Thomas Bretz
     21
     22   * ganymed.rc:
     23     - changed smearing to half of our PSF 0.06
     24     - added new examples for setting the starguider calibration
     25
     26   * ganymed_onoff.rc
     27     - changed smearing to half of our PSF 0.06
     28     - switched the new feature for a random source position on
     29     - added new examples for setting the starguider calibration
     30
     31   * ganymed_wobble.rc:
     32     - changed smearing to half of our PSF 0.06
     33     - added new examples for setting the starguider calibration
     34     - added example how to control the phi plot
     35
     36   * mhflux/MHPhi.[h,cc]:
     37     - many improvements to the algorithm, it now takes also inhomgeneities
     38       into account
     39     - restructured the display, display more histograms
     40     - increased class version to 2
     41
     42   * mjobs/MJCut.cc:
     43     - enabled acceleration for first and second loop
     44
     45   * mpointing/MPointingDevCalc.[h,cc]:
     46     - allowed to set the starguider offset calibration from the resource file
     47
     48
     49
    2050 2006/03/13 Markus Meyer
    2151
  • trunk/MagicSoft/Mars/NEWS

    r7575 r7594  
    3131   - ganymed: now stops in requested source isn't found in catalog file
    3232
     33   - ganymed: Many improvements to the phi-plot in wobble mode:
     34      + with a template the ideal background is displayed
     35      + a possible camera inhomogeneity is taken into account
     36      + the anti theta cut is better supported
     37      + the phi cut is automatically calculated from the theta cut
     38     See the examples in ganymed_wobble.rc for more details.
     39
    3340   - ganymed: fixed plot for E^2*dN/dE. The spectrum was multiplied with two
    3441     times the bin-width instead of the absolute energy
     42
     43   - ganymed: New cuts for on/off and wobble mode
     44
     45   - ganymed: The smearing of the False Source plot has been increased to 0.06
     46
     47   - ganymed: The starguider calibration can now be changed from the resource file.
     48      See the examples in ganymed*.rc for more details.
    3549
    3650   - ganymed: added a new option for on-/off-observations
     
    3953     position in the camera is calculated from the on-data and randomly
    4054     applied with this distrbution to the off-data.
     55
     56   - ganymed: by skipping some obsolete calles in the eventloop the first
     57     and second loop could be accelerated by ~20%
     58
     59   - ganymed: The default in ganymed_onoff.rc is now to determin the source
     60     position in the off-data randomly according to its distribution in the
     61     on-data.
    4162
    4263
  • trunk/MagicSoft/Mars/mhflux/MHPhi.cc

    r7251 r7594  
    3333// http://www.astro.uni-wuerzburg.de/results/ringmethod/
    3434//
     35// Class Version 2:
     36//   + TH1D fHPhi;             // Phi plot of the signal w.r.t. source
     37//   + TH1D fHPhiOff;          // Phi plot of the signal w.r.t. source+180deg
     38//   + TH1D fHTemplate;        // Template how the background should look in the ideal case
     39//
     40//   + TH1D fHInhom;           // Phi plot off the signal w.r.t. source (out of the ring with the signal)
     41//   + TH1D fHInhomOff;        // Phi plot off the signal w.r.t. source+180deg (out of the ring with the signal)
     42//
     43//   + Int_t   fNumBinsSignal; // Number of bins for signal region
     44//   + Float_t fThetaCut;      // Theta cut
     45//   + Float_t fDistSrc;       // Nominal distance of source from center in wobble
     46//
     47//   + Bool_t  fUseAntiPhiCut; // Whether to use a anti-phi cut or not
     48//
    3549////////////////////////////////////////////////////////////////////////////
    3650#include "MHPhi.h"
     
    6377//
    6478MHPhi::MHPhi(const char *name, const char *title)
    65 : fHillas(0), fSrcPos(0), fDisp(0)//, fOnOffMode(kTRUE), fIsOffLoop(kFALSE)
     79    : fHillas(0), fSrcPos(0), fDisp(0),
     80    fNumBinsSignal(2), fThetaCut(0.23), fDistSrc(0.4),
     81    fUseAntiPhiCut(kTRUE)
    6682{
    6783    fName  = name  ? name  : "MHPhi";
     
    7086    // Init Graphs
    7187    fHPhi.SetNameTitle("Phi", "\\Delta\\Phi-Distribution");
    72 
    73     fHPhi.SetXTitle("\\Delta\\Phi [\\circ]");
     88    fHPhi.SetXTitle("\\Delta\\Phi' [\\circ]");
    7489    fHPhi.SetYTitle("Counts");
    7590
     
    7994    fHPhi.SetBit(TH1::kNoStats);
    8095    fHPhi.SetMarkerStyle(kFullDotMedium);
    81 
    82     fHPhi.GetYaxis()->SetTitleOffset(1.2);
    83 
    84     /*
    85     fNameParameter = "Disp";
    86 
    87     fHist.SetNameTitle("Phi", "\\Delta\\Phi-Distribution");
    88     fHist.SetZTitle("\\Delta\\Phi [\\circ]");
    89     fHist.SetDirectory(NULL);
    90 
    91     // Main histogram
    92     fHistTime.SetName("Phi");
    93     fHistTime.SetXTitle("\\Delta\\Phi [\\circ]");
    94     fHistTime.SetDirectory(NULL);
    95 
    96     MBinning binsa, binse, binst;
    97     //binsa.SetEdges(75, 0, 1.5);
    98     //binsa.SetEdges(arr);
    99     binse.SetEdgesLog(15, 10, 100000);
    100     binst.SetEdgesASin(67, -0.005, 0.665);
    101     //binsa.Apply(fHistTime);
    102 
    103     MH::SetBinning(&fHist, &binst, &binse, &binsa);
    104      */
    105 }
    106 
    107 /*
    108 Double_t MHPhi::GetVal() const
    109 {
    110     const Dopuble_t disp = static_cast<const MParameterD*>(fParameter)->GetVal();
    111 
    112     const TVector2 pos = fHillas->GetMean()*fConvMm2Deg + fHillas->GetNormAxis()*disp;
    113     const TVector2 src = fSrcPos->GetXY()*fConvMm2Deg;
    114 
    115     // Calculate radial distance.
    116     const Double_t d = pos.Mod() - src.Mod();
    117 
    118     if (d<-fThetaCut*0.913 || d>fThetaCut)
    119         return kTRUE;
    120 
    121     const Double_t delta = src.DeltaPhi(pos)*TMath::RadToDeg();
    122     const Double_t absd  = TMath::Abs(delta)
    123 
    124     return fHistOff ? absd : 180-absd;
    125 }
    126 */
     96    fHPhi.SetLineColor(kBlue);
     97    fHPhi.SetMarkerColor(kBlue);
     98    fHPhi.GetYaxis()->SetTitleOffset(1.3);
     99
     100    fHPhiOff.SetMinimum(0);
     101    fHPhiOff.SetDirectory(0);
     102    fHPhiOff.Sumw2();
     103    fHPhiOff.SetBit(TH1::kNoStats);
     104    fHPhiOff.SetLineColor(kRed);
     105    fHPhiOff.SetMarkerColor(kRed);
     106
     107    fHTemplate.SetMinimum(0);
     108    fHTemplate.SetDirectory(0);
     109    fHTemplate.SetBit(TH1::kNoStats);
     110    fHTemplate.SetLineColor(kGreen);
     111
     112    fHInhom.SetNameTitle("Inhomogeneity", "\\Delta\\Phi-Distribution");
     113    fHInhom.SetXTitle("\\Delta\\Phi' [\\circ]");
     114    fHInhom.SetYTitle("Counts");
     115    fHInhom.Sumw2();
     116    fHInhom.SetMinimum(0);
     117    fHInhom.SetDirectory(0);
     118    fHInhom.SetBit(TH1::kNoStats);
     119    fHInhom.GetYaxis()->SetTitleOffset(1.3);
     120
     121    fHInhomOff.Sumw2();
     122    fHInhomOff.SetMinimum(0);
     123    fHInhomOff.SetDirectory(0);
     124    fHInhomOff.SetBit(TH1::kNoStats);
     125    fHInhomOff.SetLineColor(kRed);
     126    fHInhomOff.SetMarkerColor(kRed);
     127}
    127128
    128129// --------------------------------------------------------------------------
     
    161162    fConvMm2Deg = geom->GetConvMm2Deg();
    162163
    163     fNumBinsSignal = 2;
    164     fThetaCut      = 0.21/1.2;
    165     fDistSrc       = 0.4;
    166     //fIsOffLoop = !fIsOffLoop;
     164    MParameterD *cut = (MParameterD*)plist->FindObject("ThetaSquaredCut", "MParameterD");
     165    if (!cut)
     166        *fLog << warn << "ThetaSquareCut [MParameterD] not found... using default theta<" << fThetaCut << "." << endl;
     167    else
     168        fThetaCut = TMath::Sqrt(cut->GetVal());
    167169
    168170    const Double_t w  = TMath::ATan(fThetaCut/fDistSrc);
     
    170172    const Int_t    n  = TMath::Nint(TMath::Ceil(180/sz));
    171173
    172     MBinning(n, 0, n*sz).Apply(fHPhi);
    173     /*
    174 
    175     // Get Histogram binnings
    176     MBinning binst, binse;
    177     binst.SetEdges(fHist, 'x');
    178     binse.SetEdges(fHist, 'y');
    179 
    180     MBinning binsa(n, 0, n*sz);
    181 
    182     // Apply binning
    183     binsa.Apply(fHistTime);
    184     MH::SetBinning(&fHist, &binst, &binse, &binsa);
    185 
    186     // Remark: Binnings might be overwritten in MHAlpha::SetupFill
    187     return MHAlpha::SetupFill(pl);
    188      */
     174    MBinning(n+3, 0, (n+3)*sz).Apply(fHPhi);
     175    MBinning(n+3, 0, (n+3)*sz).Apply(fHPhiOff);
     176    MBinning(n+3, 0, (n+3)*sz).Apply(fHTemplate);
     177    MBinning(n+3, 0, (n+3)*sz).Apply(fHInhom);
     178    MBinning(n+3, 0, (n+3)*sz).Apply(fHInhomOff);
     179
    189180    return kTRUE;
    190181}
     
    197188Bool_t MHPhi::Fill(const MParContainer *par, const Stat_t weight)
    198189{
     190    // Here we calculate an upper phi cut to take a
     191    // possible anti-theta cut into account
     192    const Double_t ulim = fUseAntiPhiCut ? 180-fHPhi.GetBinLowEdge(fNumBinsSignal+1)*1.1 : 180;
     193
     194    // Calculate the shower origin and the source position in units of deg
    199195    const TVector2 pos = fHillas->GetMean()*fConvMm2Deg + fHillas->GetNormAxis()*fDisp->GetVal();
    200196    const TVector2 src = fSrcPos->GetXY()*fConvMm2Deg;
    201197
    202     // Calculate radial distance.
     198    // Calculate radial distance between shower origin and source
    203199    const Double_t d = pos.Mod() - src.Mod();
    204200
    205     if (d<-fThetaCut*0.913 || d>fThetaCut)
     201    // define an upper and lower cut for the radial distance between both
     202    const Double_t dR = fThetaCut;
     203    const Double_t dr = fThetaCut*0.913;
     204
     205    // calculate the phi-angle of the shower origin w.r.t. the source position
     206    const Double_t delta = src.DeltaPhi(pos)*TMath::RadToDeg();
     207
     208    // Define the radii of the upper and lower ring border
     209    const Double_t R = src.Mod()+dR;
     210    const Double_t r = src.Mod()-dr;
     211
     212    // Calculate a scale to scale all source positions to the
     213    // nominal distance to center
     214    const Double_t scale = src.Mod()/fDistSrc;
     215
     216    // Fill a phi-histograms with all events outside the ring
     217    // Take the upper phi cut into account
     218    if ((d<-dr || d>dR)/*TMath::Abs(d)>fThetaCut*1.2*/ && TMath::Abs(delta)<ulim)
     219    {
     220        fHInhom.Fill(TMath::Abs(delta)*scale,  weight);
     221        fHInhomOff.Fill((ulim-TMath::Abs(delta))*scale,  weight);
     222    }
     223
     224    // Now forget about all events which are not inside the ring
     225    if (d<-dr || d>dR)
    206226        return kTRUE;
    207227
    208     const Double_t delta = src.DeltaPhi(pos)*TMath::RadToDeg();
    209 
    210     fHPhi.Fill(TMath::Abs(delta), weight);
    211 
    212     // const Double_t absd = TMath::Abs(delta)
    213     // fHPhi.Fill(fHistOff ? absd : 180-absd, weight);
     228    // Fill the histograms for on and off with the scaled phi
     229    // only if we are below the upper phi cut
     230    if (TMath::Abs(delta)<ulim)
     231    {
     232        fHPhi.Fill(         TMath::Abs(delta)*scale,  weight);
     233        fHPhiOff.Fill((ulim-TMath::Abs(delta))*scale, weight);
     234    }
     235
     236    // Calculate the maximum scaled phi taking the upper phi cut into account
     237    const Double_t max = scale*ulim;
     238
     239    // Fill a template, this is how the phi-plot would look like
     240    // without a signal and for an ideal camera.
     241    const Int_t n = fHTemplate.GetNbinsX();
     242    TArrayD arr(n);
     243    for (int i=1; i<=n; i++)
     244    {
     245        const Double_t hi = fHTemplate.GetBinLowEdge(i+1);
     246        const Double_t lo = fHTemplate.GetBinLowEdge(i);
     247
     248        // Decide whether the bin is fully contained in the upper phi-cut or
     249        // the maximum possible phi is inside the bin
     250        if (hi<max)
     251            arr[i-1] = 1;
     252        else
     253            if (lo<max) // if its inside calculate the ratio
     254                arr[i-1] = (max-lo)/fHTemplate.GetBinWidth(i+1);
     255            else
     256                break;
     257    }
     258
     259    // The template is scaled with the current ring width. The upper phi-
     260    // cut must not be taken into account because it is just a constant
     261    // for all events.
     262    const Double_t sum = arr.GetSum();
     263    for (int i=1; i<=n; i++)
     264        fHTemplate.AddBinContent(i, (R*R-r*r)*arr[i-1]/sum);
    214265
    215266    return kTRUE;
     
    227278    pad->SetBorderMode(0);
    228279
    229     AppendPad("combine");
     280    AppendPad("update");
     281
     282    pad->Divide(2,2);
     283
     284    // --------------------------
     285
     286    pad->cd(1);
     287    gPad->SetBorderMode(0);
     288    gPad->SetFrameBorderMode(0);
    230289
    231290    fHPhi.Draw();
    232 
    233     AppendPad(opt);
    234 }
    235 
    236 void MHPhi::Paint(Option_t *o)
    237 {
    238     //TString opt(o);
    239     //opt.ToLower();
    240 
    241     // if (opt=="combine" && fHistOff)
    242     // {
    243     //    fHPhi.Add(fHist, fHistOff);
    244     //    return;
    245     // }
    246 
    247     const Bool_t wobble = TString(o).Contains("anticut", TString::kIgnoreCase);
    248 
    249     const Double_t cut  = fHPhi.GetBinLowEdge(fNumBinsSignal+1);
    250 
    251     const Int_t maxbin  = wobble ? fHPhi.GetXaxis()->FindFixBin(180-cut)-1 : fHPhi.GetNbinsX();
    252     const Double_t cut2 = wobble ? fHPhi.GetBinLowEdge(maxbin+1) : 180;
    253 
    254     const Double_t sig  = fHPhi.Integral(1, fNumBinsSignal);
    255     const Double_t bg   = fHPhi.Integral(1+fNumBinsSignal, maxbin);
    256 
    257     const Double_t f    = cut/(cut2-cut);
    258 
    259     const Double_t S0   = MMath::SignificanceLiMaSigned(sig, bg*f);
    260     const Double_t S    = MMath::SignificanceLiMaSigned(sig, bg, f);
    261 
    262     const TString  fmt  = Form("\\sigma_{L/M}=%.1f (\\sigma_{0}=%.1f)  \\Delta\\Phi_{on}<%.1f\\circ  \\Delta\\Phi_{off}<%.1f\\circ  E=%.0f  B=%.0f  f=%.2f",
    263                                S, S0, cut, cut2, sig-bg*f, bg*f, f);
     291    fHPhiOff.Draw("same");
     292
     293    TH1D *h1 = new TH1D(fHTemplate);
     294    h1->SetName("Template");
     295    h1->SetBit(kCanDelete);
     296    h1->SetDirectory(0);
     297    h1->Draw("same");
     298
     299    // --------------------------
     300
     301    pad->cd(2);
     302    gPad->SetBorderMode(0);
     303    gPad->SetFrameBorderMode(0);
     304
     305    fHInhom.Draw();
     306    fHInhomOff.Draw("same");
     307
     308    TH1D *h2 = new TH1D(fHTemplate);
     309    h2->SetName("Template");
     310    h2->SetBit(kCanDelete);
     311    h2->SetDirectory(0);
     312    h2->Draw("same");
     313
     314    // --------------------------
     315
     316    pad->cd(3);
     317    gPad->SetBorderMode(0);
     318    gPad->SetFrameBorderMode(0);
     319
     320    fHPhi.Draw();
     321    TH1D *h4 = new TH1D(fHInhom);
     322    h4->SetName("Inhomogeneity");
     323    h4->SetBit(kCanDelete);
     324    h4->SetDirectory(0);
     325    h4->Draw("same");
     326
     327    h1->Draw("same");
     328
     329    // --------------------------
     330
     331    pad->cd(4);
     332    gPad->SetBorderMode(0);
     333    gPad->SetFrameBorderMode(0);
     334
     335    TH1D *h3 = new TH1D(fHPhi);
     336    h3->SetName("Result");
     337    h3->SetBit(kCanDelete);
     338    h3->SetDirectory(0);
     339    h3->Draw();
     340
     341    h1->Draw("same");
     342
     343    // --------------------------
     344
     345    pad->cd();
     346    AppendPad("result");
     347}
     348
     349void MHPhi::PaintUpdate() const
     350{
     351    TVirtualPad *pad1 = gPad->GetPad(1);
     352    TVirtualPad *pad2 = gPad->GetPad(2);
     353    TVirtualPad *pad3 = gPad->GetPad(3);
     354    TVirtualPad *pad4 = gPad->GetPad(4);
     355
     356    Double_t sig2 = 0;
     357    Double_t bg2  = 0;
     358    Double_t f2   = 1;
     359    TH1D *htemp = pad1 ? dynamic_cast<TH1D*>(pad1->FindObject("Template")) : NULL;
     360    if (htemp)
     361    {
     362        fHTemplate.Copy(*htemp);
     363        htemp->SetName("Template");
     364        htemp->SetDirectory(0);
     365
     366        Double_t sc1 = 1;
     367        Double_t sc2 = 1;
     368
     369        TH1D *res = pad4 ? dynamic_cast<TH1D*>(pad4->FindObject("Result")) : NULL;
     370        if (res)
     371        {
     372            fHPhi.Copy(*res);
     373
     374            // Scale inhomogeneity to match the phi-plot in the off-region
     375            sc1 = res->Integral(fNumBinsSignal+1, 9999)/fHInhom.Integral(fNumBinsSignal+1, 9999);
     376            // Scale inhomogeneity to match the phi-plot in the off-region
     377            sc2 = fHInhom.Integral()/htemp->Integral();
     378
     379            res->Add(&fHInhom, -sc1);
     380            res->Add(htemp,     sc1*sc2);
     381            res->SetName("Result");
     382            res->SetDirectory(0);
     383
     384            htemp->Scale(res->Integral(fNumBinsSignal+1, 9999)/htemp->Integral(fNumBinsSignal+1, 9999));
     385
     386            sig2 = res->Integral(1, fNumBinsSignal);
     387            bg2  = fHPhi.Integral(fNumBinsSignal+1, 9999);
     388            f2   = htemp->Integral(1, fNumBinsSignal)/htemp->Integral(fNumBinsSignal+1, 9999);
     389        }
     390
     391        TH1D *hinhom = pad3 ? dynamic_cast<TH1D*>(pad3->FindObject("Inhomogeneity")) : NULL;
     392        if (hinhom)
     393        {
     394            fHInhom.Copy(*hinhom);
     395            hinhom->SetName("Inhomogeneity");
     396            hinhom->SetDirectory(0);
     397            hinhom->Scale(sc1);
     398        }
     399    }
     400
     401    htemp = pad2 ? dynamic_cast<TH1D*>(pad2->FindObject("Template")) : NULL;
     402    if (htemp)
     403    {
     404        fHTemplate.Copy(*htemp);
     405        htemp->Scale(fHInhom.Integral()/htemp->Integral());
     406        htemp->SetName("Template");
     407        htemp->SetDirectory(0);
     408    }
     409}
     410
     411void MHPhi::PaintText(const TH1D &res) const
     412{
     413    const Double_t cut  = res.GetBinLowEdge(fNumBinsSignal+1);
     414
     415    const Double_t sig  = res.Integral(1, fNumBinsSignal);
     416    const Double_t bg   = res.Integral(fNumBinsSignal+1, 9999);
     417
     418    const Double_t f    = fHTemplate.Integral(1, fNumBinsSignal)/fHTemplate.Integral(fNumBinsSignal+1, 9999);
     419
     420    const Double_t S0   = MMath::SignificanceLiMaSigned(sig,  bg*f);
     421    const Double_t S    = MMath::SignificanceLiMaSigned(sig,  bg, f);
     422
     423    const TString fmt = Form("\\sigma_{L/M}=%.1f (\\sigma_{0}=%.1f)  \\Delta\\Phi_{on}<%.1f\\circ  E=%.0f  B=%.0f  f=%.2f",
     424                             S, S0, cut, sig-bg*f, bg*f, f);
    264425
    265426    const Double_t b = bg             *f/fNumBinsSignal;
    266427    const Double_t e = TMath::Sqrt(bg)*f/fNumBinsSignal;
    267428
    268     TLatex text(0.27, 0.94, fmt);
     429    TLatex text(0.275, 0.95, fmt);
    269430    text.SetBit(TLatex::kTextNDC);
    270     text.SetTextSize(0.035);
     431    text.SetTextSize(0.042);
    271432    text.Paint();
    272433
     
    274435    line.SetLineColor(14);
    275436    line.PaintLine(cut, gPad->GetUymin(), cut, gPad->GetUymax());
    276     if (maxbin<fHPhi.GetNbinsX())
    277         line.PaintLine(cut2, gPad->GetUymin(), cut2, gPad->GetUymax());
    278     line.SetLineColor(kBlue);
     437
     438    // Here we calculate an upper phi cut to take a
     439    // possible anti-theta cut into account
     440    const Double_t ulim = fUseAntiPhiCut ? 180-fHPhi.GetBinLowEdge(fNumBinsSignal+1)*1.1 : 180;
     441    line.SetLineStyle(kDotted);
     442    line.PaintLine(ulim, gPad->GetUymin(), ulim, gPad->GetUymax());
     443
     444    line.SetLineStyle(kSolid);
     445    line.SetLineColor(kBlack);
    279446    line.PaintLine(0, b, cut, b);
    280447    line.PaintLine(cut/2, b-e, cut/2, b+e);
     
    283450
    284451    TMarker m;
    285     m.SetMarkerColor(kBlue);
    286452    m.SetMarkerStyle(kFullDotMedium);
    287453    m.PaintMarker(cut/2, b);
    288454}
     455
     456void MHPhi::PaintResult() const
     457{
     458    TVirtualPad *pad = gPad;
     459
     460    pad->cd(1);
     461    PaintText(fHPhi);
     462
     463    pad->cd(4);
     464    TH1D *res = gPad ? dynamic_cast<TH1D*>(gPad->FindObject("Result")) : NULL;
     465    if (res)
     466        PaintText(*res);
     467}
     468
     469void MHPhi::Paint(Option_t *o)
     470{
     471    TString opt(o);
     472    if (opt=="update")
     473        PaintUpdate();
     474    if (opt=="result")
     475        PaintResult();
     476}
     477
     478Int_t MHPhi::ReadEnv(const TEnv &env, TString prefix, Bool_t print)
     479{
     480    Bool_t rc = kFALSE;
     481    if (IsEnvDefined(env, prefix, "NumBinsSignal", print))
     482    {
     483        SetNumBinsSignal(GetEnvValue(env, prefix, "NumBinsSignal", (Int_t)fNumBinsSignal));
     484        rc = kTRUE;
     485    }
     486    if (IsEnvDefined(env, prefix, "UseAntiPhiCut", print))
     487    {
     488        SetUseAntiPhiCut(GetEnvValue(env, prefix, "UseAntiPhiCut", (Int_t)fUseAntiPhiCut));
     489        rc = kTRUE;
     490    }
     491
     492    return rc;
     493}
  • trunk/MagicSoft/Mars/mhflux/MHPhi.h

    r7251 r7594  
    1616{
    1717private:
    18     TH1D fHPhi;
     18    TH1D fHPhi;             // Phi plot of the signal w.r.t. source
     19    TH1D fHPhiOff;          // Phi plot of the signal w.r.t. source+180deg
     20    TH1D fHTemplate;        // Template how the background should look in the ideal case
    1921
    20     MHillas     *fHillas;  //!
    21     MSrcPosCam  *fSrcPos;  //!
    22     MParameterD *fDisp;    //!
     22    TH1D fHInhom;           // Phi plot off the signal w.r.t. source (out of the ring with the signal)
     23    TH1D fHInhomOff;        // Phi plot off the signal w.r.t. source+180deg (out of the ring with the signal)
    2324
    24     Double_t fConvMm2Deg;  //!
     25    MHillas     *fHillas;   //! Pointer to input container "MHillas"
     26    MSrcPosCam  *fSrcPos;   //! Pointer to input container "MSrcPosCam"
     27    MParameterD *fDisp;     //! Pointer to input container "Disp"
    2528
    26     Int_t   fNumBinsSignal;
    27     Float_t fThetaCut;
    28     Float_t fDistSrc;
    29     //Bool_t  fOnOffMode;
     29    Double_t fConvMm2Deg;   //! Conversion factor from camera geometry
    3030
    31     //Bool_t  fIsOffLoop; //!
     31    Int_t   fNumBinsSignal; // Number of bins for signal region
     32    Float_t fThetaCut;      // Theta cut
     33    Float_t fDistSrc;       // Nominal distance of source from center in wobble
     34
     35    Bool_t  fUseAntiPhiCut; // Whether to use a anti-phi cut or not
     36
     37    // Paint
     38    void PaintUpdate() const;
     39    void PaintResult() const;
     40    void PaintText(const TH1D &res) const;
     41
     42    // MH
     43    Bool_t SetupFill(const MParList *plist);
     44    Bool_t Fill(const MParContainer *par, const Stat_t w=1);
    3245
    3346public:
    3447    MHPhi(const char *name=NULL, const char *title=NULL);
    3548
    36     Bool_t SetupFill(const MParList *plist);
    37     Bool_t Fill(const MParContainer *par, const Stat_t w=1);
     49    // Setter
     50    void SetNumBinsSignal(UInt_t n)       { fNumBinsSignal=TMath::Max(n, 1U); }
     51    void SetUseAntiPhiCut(Bool_t b=kTRUE) { fUseAntiPhiCut=b; }
    3852
     53    // TObject
    3954    void Draw(Option_t *opt="");
    4055    void Paint(Option_t *opt="");
    4156
    42     ClassDef(MHPhi, 1) // Histogram to display information about rate
     57    // MParContainer
     58    Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print);
     59
     60    ClassDef(MHPhi, 2) // Histogram for ring-method
    4361};
    4462
  • trunk/MagicSoft/Mars/mjobs/MJCut.cc

    r7566 r7594  
    737737
    738738    // by setting it here it is distributed to all consecutive tasks
    739     //tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
     739    tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
    740740 
    741741    par.SetVal(0);
     
    907907
    908908    // by setting it here it is distributed to all consecutive tasks
    909     //tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
     909    tlist.SetAccelerator(MTask::kAccDontReset|MTask::kAccDontTime);
    910910
    911911    par.SetVal(1);
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.cc

    r7374 r7594  
    192192    // Linear starguider calibration taken from April/May data
    193193    // For calibration add MDriveReport::GetErrorZd/Az !
    194     fDeviation->SetDevXY(-7.0, 16);
     194    fDeviation->SetDevXY(fDx, fDy);
    195195    //devzd -= 2.686/60;   // 1arcmin ~ 5mm
    196196    //devaz -= 2.840/60;
     
    278278        rc = kTRUE;
    279279    }
     280    if (IsEnvDefined(env, prefix, "Dx", print))
     281    {
     282        fDx = GetEnvValue(env, prefix, "Dx", fDx);
     283        rc = kTRUE;
     284    }
     285    if (IsEnvDefined(env, prefix, "Dy", print))
     286    {
     287        fDy = GetEnvValue(env, prefix, "Dy", fDy);
     288        rc = kTRUE;
     289    }
    280290
    281291    return rc;
  • trunk/MagicSoft/Mars/mpointing/MPointingDevCalc.h

    r7553 r7594  
    3333    Float_t fMaxAbsDev;            // [arcmin] Maximum considered absolute deviation
    3434
     35    Float_t fDx;                   // Starguider calibration dx
     36    Float_t fDy;                   // Starguider calibration dy
     37
    3538    // MPointingDevCalc
    3639    Int_t ProcessStarguiderReport();
     
    4750public:
    4851    MPointingDevCalc() : fReport(0), fDeviation(0), fSkip(5), fNumMinStars(8),
    49         fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15)
     52        fNsbLevel(3), fNsbMin(30), fNsbMax(60), fMaxAbsDev(15), fDx(-7), fDy(16)
    5053    {
    5154        fName  = "MPointingDevCalc";
     
    6063    void SetNsbMax(Float_t nsb)    { fNsbMax=nsb;    }
    6164    void SetMaxAbsDev(Float_t max) { fMaxAbsDev=max; }
     65    void SetDx(Float_t dx)         { fDx=dx; }
     66    void SetDy(Float_t dy)         { fDy=dy; }
    6267
    6368    ClassDef(MPointingDevCalc, 0) //Task calculating the pointing deviation
Note: See TracChangeset for help on using the changeset viewer.