Changeset 7366 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
09/27/05 14:38:40 (19 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r4920 r7366  
    124124    MAstro::Mjd2Ymd(fMjd, y, m, d);
    125125}
     126
     127// --------------------------------------------------------------------------
     128//
     129// GetMoonPhase - calculate phase of moon as a fraction:
     130//  Returns -1 if calculation failed
     131//
     132//  see MAstro::GetMoonPhase
     133//
     134Double_t MTime::GetMoonPhase() const
     135{
     136    return MAstro::GetMoonPhase(GetMjd());
     137}
     138
     139// --------------------------------------------------------------------------
     140//
     141// Calculate the Period to which the time belongs to. The Period is defined
     142// as the number of synodic months ellapsed since the first full moon
     143// after Jan 1st 1980 (which was @ MJD=44240.37917)
     144//
     145//   see MAstro::GetMoonPeriod
     146//
     147Double_t MTime::GetMoonPeriod() const
     148{
     149    return MAstro::GetMoonPeriod(GetMjd());
     150}
     151
     152// --------------------------------------------------------------------------
     153//
     154// To get the moon period as defined for MAGIC observation we take the
     155// nearest integer mjd, eg:
     156//   53257.8 --> 53258
     157//   53258.3 --> 53258
     158// Which is the time between 13h and 12:59h of the following day. To
     159// this day-period we assign the moon-period at midnight. To get
     160// the MAGIC definition we now substract 284.
     161//
     162// For MAGIC observation period do eg:
     163//   GetMagicPeriod(53257.91042)
     164// or
     165//   MTime t;
     166//   t.SetMjd(53257.91042);
     167//   GetMagicPeriod(t.GetMjd());
     168// or
     169//   MTime t;
     170//   t.Set(2004, 1, 1, 12, 32, 11);
     171//   GetMagicPeriod(t.GetMjd());
     172//
     173//
     174//  see MAstro::GetMagicPeriod
     175//
     176Int_t MTime::GetMagicPeriod() const
     177{
     178    return MAstro::GetMagicPeriod(GetMjd());
     179}
     180
    126181
    127182// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r5061 r7366  
    100100    TTime    GetRootTime() const;
    101101    Double_t GetAxisTime() const;
     102    Double_t GetMoonPhase() const;
     103    Double_t GetMoonPeriod() const;
     104    Int_t    GetMagicPeriod() const;
    102105    Long_t   GetTime() const { return (Long_t)fTime; } // [ms] Time of Day returned in the range [-11h, 13h)
    103106    void     GetTime(Byte_t &h, Byte_t &m, Byte_t &s, UShort_t &ms) const;
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc

    r7191 r7366  
    277277
    278278  PrintUncalibrated(MBadPixelsPix::kDeviatingTimeResolution,   
    279                     Form("%s%2.1f%s","Time resol. less than ",fRelTimeResolutionLimit," FADC sl. from Mean:     "));
     279                    Form("%s%2.1f%s","Time resol. less than ", fRelTimeResolutionLimit, " FADC sl. from Mean:"));
    280280  PrintUncalibrated(MBadPixelsPix::kRelTimeOscillating,   
    281                     "Pixels with changing Rel. Times over time:             ");
     281                    "Pixels with changing Rel. Times over time:");
    282282  PrintUncalibrated(MBadPixelsPix::kRelTimeNotFitted,     
    283                     "Pixels with unsuccesful Gauss fit to the times:        ");
     283                    "Pixels with unsuccesful Gauss fit to the times:");
    284284
    285285  if (asciilog)
     
    494494    if (fGeom->InheritsFrom("MGeomCamMagic"))
    495495    {
    496         *fLog << " Uncalibrated Pixels:            Inner: "
    497             << Form("%3i",unsuit[0]) << " Outer: " << Form("%3i",unsuit[1]) << endl;
    498         *fLog << " Unreliable Pixels:              Inner: "
    499             << Form("%3i",unrel[0])  << " Outer: " << Form("%3i",unrel[1])  << endl;
     496        PrintUncalibrated("Uncalibrated Pixels:", unsuit[0], unsuit[1]);
     497        PrintUncalibrated("Unreliable Pixels:",   unrel[0],  unrel[1]);
    500498    }
    501499}
     
    522520    }
    523521
    524     *fLog << " " << text << "Inner: " << Form("%3i",countinner);
    525     *fLog << " Outer: " << Form("%3i", countouter) << endl;
     522    PrintUncalibrated(text, countinner, countouter);
     523}
     524
     525void MCalibrationRelTimeCalc::PrintUncalibrated(const char *text, Int_t in, Int_t out) const
     526{
     527    *fLog << " " << setfill(' ') << setw(56) << setiosflags(ios::left) << text;
     528    *fLog << " Inner: " << Form("%3i", in);
     529    *fLog << " Outer: " << Form("%3i", out);
     530    *fLog << resetiosflags(ios::left) << endl;
     531
    526532}
    527533
  • trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.h

    r7188 r7366  
    6565  void   FinalizeUnsuitablePixels ();
    6666
    67   void   PrintUncalibrated( MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
     67  void   PrintUncalibrated(const char *text, Int_t in, Int_t out) const;
     68  void   PrintUncalibrated(MBadPixelsPix::UncalibratedType_t typ, const char *text) const;
    6869
    6970  // Query checks
  • trunk/MagicSoft/Mars/mmuon/MHMuonPar.cc

    r7365 r7366  
    238238    AppendPad("pad4");
    239239}
    240 
     240/*
    241241Double_t MHMuonPar::Integral(const TProfile &p, Int_t a, Int_t b) const
    242242{
     
    252252    return denominator==0 ? 0 : numerator/denominator;
    253253}
    254 
     254*/
    255255Double_t MHMuonPar::Integral(const TProfile &p, Float_t a, Float_t b) const
    256256{
     
    258258    const Int_t bin2 = p.GetXaxis()->FindFixBin(b);
    259259
    260 //    return Integral(p, bin1, bin2);
    261260    return p.Integral(bin1, bin2);
    262261}
     
    268267        const TString txt = Form("\\Sigma_{%.2f\\circ}^{%.2f\\circ} = %.3f",
    269268                                 fgIntegralLoLim, fgIntegralUpLim, Integral(fHistBroad));
    270 //                                 fgIntegralLoLim, fgIntegralUpLim, Integral(fHistBroad)*1000);
    271269
    272270        TLatex text(0.55, 0.93, txt);
  • trunk/MagicSoft/Mars/mmuon/MHMuonPar.h

    r7252 r7366  
    3333    Float_t fMm2Deg;
    3434
    35     Double_t Integral(const TProfile &p, Int_t a, Int_t b) const;
     35    //Double_t Integral(const TProfile &p, Int_t a, Int_t b) const;
    3636    Double_t Integral(const TProfile &p, Float_t a=fgIntegralLoLim, Float_t b=fgIntegralUpLim) const;
    3737
  • trunk/MagicSoft/Mars/mmuon/MHSingleMuon.cc

    r7365 r7366  
    130130    fHistTime.SetTitle("HistTime");
    131131    fHistTime.SetXTitle("timing difference");
    132     fHistTime.SetYTitle("number of pixels");
     132    fHistTime.SetYTitle("Counts");
    133133    fHistTime.SetDirectory(NULL);
    134134    fHistTime.SetFillStyle(4000);
     
    180180    ApplyBinning(*plist, "ArcPhi",    &fHistPhi);
    181181    ApplyBinning(*plist, "MuonWidth", &fHistWidth);
    182     ApplyBinning(*plist, "MuonTime", &fHistTime);
     182    ApplyBinning(*plist, "MuonTime",  &fHistTime);
    183183
    184184    return kTRUE;
     
    213213
    214214        // if the signal is not near the estimated circle, it is ignored.
    215         if (dist < fMuonSearchPar->GetRadius() + fMargin &&
    216             dist > fMuonSearchPar->GetRadius() - fMargin)
     215        if (TMath::Abs(dist-fMuonSearchPar->GetRadius())<fMargin)
    217216        {
    218217            fHistTime.Fill(pix.GetArrivalTime()-fMuonSearchPar->GetTime());
    219218        }
     219
    220220        // use only the inner pixles. FIXME: This is geometry dependent
    221221        if(i>397)
     
    240240
    241241    //    Double_t err;
    242     Double_t mean, meanerr, sig, sigerr;
    243     gMinuit->GetParameter(2, sig, sigerr); // get the sigma value
    244     gMinuit->GetParameter(1, mean, meanerr); // get the sigma value
     242    Double_t mean, meanerr, dummy;
     243    gMinuit->GetParameter(2, sig,  dummy); // get the sigma value
     244    gMinuit->GetParameter(1, mean, dummy); // get the sigma value
    245245
    246246    for (Int_t i=0; i<entries; i++)
     
    255255
    256256        // if the signal is not near the estimated circle, it is ignored.
    257         if (dist < fMuonSearchPar->GetRadius() + fMargin &&
    258             dist > fMuonSearchPar->GetRadius() - fMargin)
     257        if (TMath::Abs(dist-fMuonSearchPar->GetRadius())<fMargin &&
     258            TMath::Abs(pix.GetArrivalTime()-fMuonSearchPar->GetTime()-mean) < 2*sig)
    259259        {
    260             if(TMath::Abs(pix.GetArrivalTime()-(fMuonSearchPar->GetTime()+mean))<2*sig)
    261                 fHistPhi.Fill(TMath::ATan2(dx, dy)*TMath::RadToDeg(), pix.GetNumPhotons());
     260            fHistPhi.Fill(TMath::ATan2(dx, dy)*TMath::RadToDeg(), pix.GetNumPhotons());
    262261        }
    263262    }
Note: See TracChangeset for help on using the changeset viewer.