Changeset 6987 for trunk


Ignore:
Timestamp:
04/29/05 18:22:01 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r6985 r6987  
    2828     - set as time a time which represents the starting point
    2929       of the calculation interval in all cases
     30
     31   * star.rc, mmuon/MMuonCalibParCalc.cc, mmuon/MMuonSetup.[h,cc]:
     32     - fixed wrong units of thresholds for muon analysis
     33
     34   * mmuon/MHSingleMuon.cc:
     35     - removed obsolete conversion factor in error calculation
     36     - FindeCreateObj called for MMuonSetup
     37     - get NDF from fit
     38     - optimized FindRangeAboveThreshold
     39     - handle special case when arcphi is 360deg
     40
     41   * star.cc:
     42     - replaced ProcessFile by Process
     43
     44   * mjobs/MJSpectrum.cc:
     45     - renamed second MHAlpha tab to MHAlphaOn to be able to
     46       access each tab uniquely
     47     - fixed a bug calling SetStats which could cause crashes
     48
     49   * mjobs/MJStar.[h,cc]:
     50     - preliminary implementation of the muon analysis
     51     - reanamed ProcessFile to Process
    3052
    3153
  • trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc

    r6978 r6987  
    344344
    345345    MFillH fill1("MHAlphaOff [MHAlpha]", "MHillasSrc", "FillAlphaOff");
    346     MFillH fill2("MHAlpha",              "MHillasSrc", "FillAlphaOn");
     346    MFillH fill2("MHAlphaOn  [MHAlpha]", "MHillasSrc", "FillAlphaOn");
    347347
    348348    MFDataMember f0("DataType.fVal", '<', 0.5, "FilterOffData");
     
    381381    }
    382382
    383     const MHAlpha *halpha = (MHAlpha *)plist.FindObject("MHAlpha");
     383    const MHAlpha *halpha = (MHAlpha *)plist.FindObject("MHAlphaOn");
    384384    if (!halpha)
    385385    {
    386         *fLog << err << GetDescriptor() << ": MHAlpha not found... abort." << endl;
     386        *fLog << err << GetDescriptor() << ": MHAlphaOn [MHAlpha] not found... abort." << endl;
    387387        return kFALSE;
    388388    }
     
    615615    cout << "Searching..." << endl;
    616616
    617     TH1D *excess = (TH1D*)arr.FindObjectInCanvas("Excess", "TH1D", "MHAlpha");
     617    TH1 *excess = (TH1D*)arr.FindObjectInCanvas("Excess", "TH1D", "MHAlpha");
    618618    if (!excess)
    619619        return kFALSE;
     
    633633
    634634    excess->SetTitle("Number of excess events vs Size (data, mc/blue)");
     635    excess->Scale(1./excess->Integral());
     636    excess = excess->DrawCopy();
     637    // Don't do this on the original object!
    635638    excess->SetStats(kFALSE);
    636     excess->Scale(1./excess->Integral());
    637     excess->DrawCopy();
     639
     640    cout << "ExcessSize..." << endl;
    638641
    639642    TObject *o=0;
    640643    if ((o=plist.FindObject("ExcessSize")))
    641644    {
    642         TH1F *histsel = (TH1F*)o->FindObject("");
    643         histsel->SetStats(kFALSE);
    644         histsel->Scale(1./histsel->Integral());
    645         histsel->SetLineColor(kBlue);
    646         histsel->SetBit(kCanDelete);
    647         histsel->DrawCopy("same");
    648     }
     645        TH1 *histsel = (TH1F*)o->FindObject("");
     646        if (histsel)
     647        {
     648            histsel->Scale(1./histsel->Integral());
     649            histsel->SetLineColor(kBlue);
     650            histsel->SetBit(kCanDelete);
     651            histsel = histsel->DrawCopy("same");
     652            // Don't do this on the original object!
     653            histsel->SetStats(kFALSE);
     654        }
     655    }
     656
     657    cout << "Dist..." << endl;
    649658
    650659    // -------------- Comparison of Image Parameters --------------
     
    652661    PlotSame(arr, plist, "Dist",   "HilSrc",  "MHHilSrcMCPost");
    653662
     663    cout << "Length..." << endl;
     664
    654665    c.cd(3);
    655666    PlotSame(arr, plist, "Length", "PostCut", "MHHillasMCPost");
    656667
     668    cout << "M3l..." << endl;
     669
    657670    c.cd(4);
    658671    PlotSame(arr, plist, "M3l",    "HilExt",  "MHHilExtMCPost");
    659672
     673    cout << "Conc1..." << endl;
     674
    660675    c.cd(5);
    661676    PlotSame(arr, plist, "Conc1",  "NewPar",  "MHNewParMCPost");
     677
     678    cout << "Width..." << endl;
    662679
    663680    c.cd(6);
  • trunk/MagicSoft/Mars/mjobs/MJStar.cc

    r6915 r6987  
    5353#include "MReadReports.h"
    5454#include "MReadMarsFile.h"
     55#include "MF.h"
    5556#include "MFDeltaT.h"
    5657#include "MFSoftwareTrigger.h"
     
    6162#include "MSrcPosCalc.h"
    6263#include "MHillasCalc.h"
     64#include "../mmuon/MMuonSearchParCalc.h"
     65#include "../mmuon/MMuonCalibParCalc.h"
     66#include "../mmuon/MMuonSetup.h"
    6367#include "MFillH.h"
    6468#include "MWriteRootFile.h"
     
    108112}
    109113
    110 Bool_t MJStar::ProcessFile(Bool_t ismc)
     114Bool_t MJStar::Process(Bool_t ismc)
    111115{
    112116    if (!fSequence.IsValid())
     
    156160    MObservatory obs;
    157161    plist.AddToList(&obs);
     162
     163    MMuonSetup muonsetup;
     164    plist.AddToList(&muonsetup);
     165
     166    // Setup binnings for muon analysis
     167    MBinning bins1("BinningRadius");
     168    MBinning bins2("BinningArcWidth");
     169    MBinning bins3("BinningRingBroadening");
     170    MBinning bins4("BinningSizeVsArcRadius");
     171    MBinning bins5("BinningMuonWidth");
     172    MBinning bins6("BinningArcPhi");
     173    plist.AddToList(&bins1);
     174    plist.AddToList(&bins2);
     175    plist.AddToList(&bins3);
     176    plist.AddToList(&bins4);
     177    plist.AddToList(&bins5);
     178    plist.AddToList(&bins6);
     179
    158180
    159181    // Setup Tasklist
     
    276298    write.AddContainer("MObservatory",  "RunHeaders");
    277299
     300    // Muon Setup
     301    write.AddContainer("BinningRadius",          "RunHeaders");
     302    write.AddContainer("BinningArcWidth",        "RunHeaders");
     303    write.AddContainer("BinningRingBroadening",  "RunHeaders");
     304    write.AddContainer("BinningSizeVsArcRadius", "RunHeaders");
     305    write.AddContainer("MMuonSetup",             "RunHeaders");
     306
    278307    if (ismc)
    279308    {
     
    327356    tlist2.AddToList(&fill4);
    328357    tlist2.AddToList(&fill5);
     358
     359    // *********************************************************
     360    MMuonSetup setup;
     361    plist.AddToList(&setup);
     362
     363    MF fmuon1("MHillas.fSize>150", "MuonPreCut");
     364
     365    MF fmuon2("(MMuonSearchPar.fRadius>180) &&"
     366              "(MMuonSearchPar.fRadius<400) &&"
     367              "(MMuonSearchPar.fDeviation<45)", "MuonSearchCut");
     368    fmuon2.SetFilter(&fmuon1);
     369
     370    MF fmuon3("(MMuonCalibPar.fArcPhi>175)  &&"
     371              "(MMuonSearchPar.fDeviation<37)", "MuonFinalCut");
     372
     373    MMuonSearchParCalc muscalc;
     374    muscalc.SetFilter(&fmuon1);
     375
     376    MMuonCalibParCalc mcalc;
     377    mcalc.SetFilter(&fmuon2);
     378
     379    MFillH fill11("MHSingleMuon", "", "FillMuon");
     380    MFillH fill10("MHMuonPar",    "", "FillMuonPar");
     381    fill11.SetFilter(&fmuon2);
     382    fill10.SetFilter(&fmuon3);
     383
     384    tlist2.AddToList(&fmuon1);
     385    tlist2.AddToList(&muscalc);
     386    tlist2.AddToList(&fmuon2);
     387    tlist2.AddToList(&fill11);
     388    tlist2.AddToList(&mcalc);
     389    tlist2.AddToList(&fmuon3);
     390    tlist2.AddToList(&fill10);
     391
     392    // *********************************************************
     393
    329394    //tlist2.AddToList(&fill6);
    330395    //tlist2.AddToList(&fill7);
  • trunk/MagicSoft/Mars/mjobs/MJStar.h

    r4906 r6987  
    1414    MJStar(const char *name=NULL, const char *title=NULL);
    1515
    16     Bool_t ProcessFile(Bool_t ismc=kFALSE);
     16    Bool_t Process(Bool_t ismc=kFALSE);
    1717
    1818    ClassDef(MJStar, 0) // Tool to create a pedestal file (MPedestalCam)
  • trunk/MagicSoft/Mars/mmuon/MHSingleMuon.cc

    r6986 r6987  
    221221    {
    222222        const Float_t val = h.GetBinContent(i%n + 1);
    223         if (val<thres && last<0)
     223        if (val<thres)
     224        {
    224225            last = i%n+1;
     226            break;
     227        }
    225228    }
    226229
     
    230233    {
    231234        const Float_t val = h.GetBinContent(i%n + 1);
    232         if (val<thres && first<0)
     235        if (val<thres)
     236        {
    233237            first = i%n+1;
     238            break;
     239        }
    234240    }
    235241
     
    245251Bool_t MHSingleMuon::CalcPhi(Double_t thres, Double_t &peakphi, Double_t &arcphi) const
    246252{
     253    if (fHistPhi.GetMaximum()<thres)
     254        return kFALSE;
     255
    247256    peakphi = 180.-fHistPhi.GetBinCenter(fHistPhi.GetMaximumBin());
    248257
     
    250259    Int_t first, last;
    251260
    252     if (!FindRangeAboveThreshold(fHistPhi, thres, first, last))
    253         return kFALSE;
    254 
    255     //cout << "P: " << first << " " << last << " " << last-first << endl;
     261    FindRangeAboveThreshold(fHistPhi, thres, first, last);
     262
     263    const Int_t n    = fHistPhi.GetNbinsX();
     264    const Int_t edge = fHistPhi.GetMaximumBin()+n/2;
     265    if (first<0)
     266        first = (edge-1)%n+1;
     267    if (last<0)
     268        last  = edge%n+1;;
    256269
    257270    const Float_t startfitval = fHistPhi.GetBinLowEdge(first+1);
    258271    const Float_t endfitval   = fHistPhi.GetBinLowEdge(last);
    259272
    260     //Int_t effbinnum = TMath::Nint((endfitval-startfitval)/convbin2val);
    261 
    262     arcphi = last<first ? 360+(endfitval-startfitval) : endfitval-startfitval;
     273    arcphi = last-1<first ? 360+(endfitval-startfitval) : endfitval-startfitval;
    263274
    264275    //if (fEnableImpactCalc)
  • trunk/MagicSoft/Mars/star.cc

    r6911 r6987  
    225225        // job.SetPathIn(kInpath); // not yet needed
    226226
    227         if (!job.ProcessFile(kIsMC))
     227        if (!job.Process(kIsMC))
    228228        {
    229229            gLog << err << "Calculation of image parameters failed." << endl << endl;
Note: See TracChangeset for help on using the changeset viewer.