Changeset 2255


Ignore:
Timestamp:
07/01/03 10:46:07 (21 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2252 r2255  
    11                                                 -*-*- END OF LINE -*-*-
     2
     3
     4 2003/07/01: Wolfgang Wittek
     5
     6   * mhist/MHSigmaTheta.cc
     7     - change code because GetPixRatio returns area(pixel_zero)/area(pixel)
     8                                       and not area(pixel)/area(pixel_zero)
     9
     10   * manalysis/MSigmabar.cc
     11               MCT1PadSchweizer.cc
     12               MCT1PadONOFF.cc
     13     - change code because GetPixRatio returns area(pixel_zero)/area(pixel)
     14                                       and not area(pixel)/area(pixel_zero)
     15
     16   * macros/CT1Analysis.C
     17            ONOFFCT1Analysis.C
     18     - current versions of CT1 macros
     19
     20   * macros/unfold.C
     21            fluxunfold.C
     22     - macros for testing the unfolding within root
     23
     24
    225
    326 2003/06/30: Thomas Bretz
     
    752775
    753776
     777
     778
    754779 2003/06/09: Wolfgang Wittek
    755780
  • trunk/MagicSoft/Mars/macros/CT1Analysis.C

    r2167 r2255  
    232232    //  - write root file for ON data after final cuts (ON3.root))
    233233
    234     Bool_t JobF_XX  = kFALSE; 
     234    Bool_t JobF_XX  = kTRUE; 
    235235    Bool_t WXX      = kFALSE;  // write out root file ON3.root ?
    236236
     
    21752175
    21762176    // type of data to be analysed
    2177     //TString typeData = "ON";
     2177    TString typeData = "ON";
    21782178    //TString typeData = "OFF";
    2179     TString typeData = "MC";
     2179    //TString typeData = "MC";
    21802180    gLog << "typeData = " << typeData << endl;
    21812181
     
    21882188
    21892189    //TString XX("NN");
    2190     //TString XX("SC");
    2191     TString XX("RF");
     2190    TString XX("SC");
     2191    //TString XX("RF");
    21922192    TString fhadronnessName("Had");
    21932193    fhadronnessName += XX;
     
    21952195
    21962196    // maximum values of the hadronness, |ALPHA| and DIST
    2197     Float_t maxhadronness   = 0.20;
     2197    Float_t maxhadronness   = 0.30;
    21982198    Float_t maxalpha        = 20.0;
    21992199    Float_t maxdist         = 10.0;
     
    22952295    tliston.AddToList(&contfinalgh);
    22962296
    2297     tliston.AddToList(&contfinal);
    2298 
    22992297    tliston.AddToList(&fillhadnn);
    23002298    tliston.AddToList(&fillhadsc);
     
    23072305    tliston.AddToList(&hfill5);
    23082306
    2309 
     2307    tliston.AddToList(&contfinal);
    23102308
    23112309    //*****************************
     
    23402338    pliston.FindObject("MHNewImagePar")->DrawClone();
    23412339    pliston.FindObject("MHStarMap")->DrawClone();
     2340
     2341
     2342    //-------------------------------------------
     2343    // fit alpha distribution to get the number of excess events
     2344    //
     2345
     2346    MHHillasSrc* hillasSrc =
     2347      (MHHillasSrc*)(pliston.FindObject("MHHillasSrc"));
     2348    TH1F* alphaHist = (TH1F*)(hillasSrc->GetHistAlpha());
     2349 
     2350    MHOnSubtraction onsub;
     2351    onsub.Calc(alphaHist, &pliston, kTRUE, 13.1);
     2352    //-------------------------------------------
     2353
    23422354
    23432355    DeleteBinnings(&pliston);
     
    27132725
    27142726    TString typeMC   = "MC";
    2715     TString ext      = "2.root";
    2716     TString extout   = "3.root";
     2727    TString ext      = "3.root";
     2728    TString extout   = "4.root";
    27172729
    27182730    //------------------------------
     
    27212733
    27222734    //TString XX("NN");
    2723     TString XX("SC");
    2724     //TString XX("RF");
     2735    //TString XX("SC");
     2736    TString XX("RF");
    27252737    TString fhadronnessName("Had");
    27262738    fhadronnessName += XX;
     
    27352747         << maxdist << endl;
    27362748
     2749    //------------------------------
     2750    // name of MC file to be used for optimizing the energy estimator
     2751    TString filenameOpt(outPath);
     2752    filenameOpt += typeMC;
     2753    filenameOpt += ext;
     2754    gLog << "filenameOpt = " << filenameOpt << endl;
     2755
     2756    //------------------------------
     2757    // name of file containing the parameters of the energy estimator
     2758    TString energyParName(outPath);
     2759    energyParName += "energyest_";
     2760    //energyParName += XX;
     2761    energyParName += ".root";
     2762    gLog << "energyParName = " << energyParName << endl;
    27372763
    27382764    //------------------------------
     
    27402766    TString filenameArea(outPath);
    27412767    filenameArea += typeMC;
    2742     filenameArea += "_";
    2743     filenameArea += XX;
     2768    //filenameArea += "_";
     2769    //filenameArea += XX;
    27442770    filenameArea += ext;
    27452771    gLog << "filenameArea = " << filenameArea << endl;
     
    27492775    TString collareaName(outPath);
    27502776    collareaName += "area_";
    2751     collareaName += XX;
     2777    //collareaName += XX;
    27522778    collareaName += ".root";
    27532779    gLog << "collareaName = " << collareaName << endl;
     
    27572783    TString filenameData(outPath);
    27582784    filenameData += typeData;
    2759     filenameData += "_";
    2760     filenameData += XX;
     2785    //filenameData += "_";
     2786    //filenameData += XX;
    27612787    filenameData += ext;
    27622788    gLog << "filenameData = " << filenameData << endl;
     
    27662792    TString filenameDataout(outPath);
    27672793    filenameDataout += typeData;
    2768     filenameDataout += "_";
    2769     filenameDataout += XX;
     2794    //filenameDataout += "_";
     2795    //filenameDataout += XX;
    27702796    filenameDataout += extout;
    27712797    gLog << "filenameDataout = " << filenameDataout << endl;
     
    27902816    MContinue conthadrons(&cuthadrons);
    27912817
    2792     MHMcCT1CollectionArea* collarea = new MHMcCT1CollectionArea();
     2818    //MHMcCT1CollectionArea* collarea = new MHMcCT1CollectionArea();
     2819    //MHMcCT1CollectionArea* collarea;
    27932820
    27942821    MFillH filler("MHMcCT1CollectionArea", "MMcEvt");
     
    28002827    parlist.AddToList(&tasklist);
    28012828    InitBinnings(&parlist);
    2802     parlist.AddToList(collarea);
     2829    //parlist.AddToList(collarea);
    28032830
    28042831    //********************************
     
    28272854    // and display the histograms
    28282855    //
    2829     //MHMcCT1CollectionArea *collarea = parlist.FindObject("MHMcCT1CollectionArea");
     2856    MHMcCT1CollectionArea *collarea =
     2857         (MHMcCT1CollectionArea*)parlist.FindObject("MHMcCT1CollectionArea");
    28302858    collarea->CalcEfficiency();
    28312859    collarea->DrawClone("lego");
     
    28472875
    28482876
    2849     //*************************************************************************
    2850     //
    2851     // Analyse the data
    2852     //
    2853 
    2854     MTaskList tliston;
    2855     MParList pliston;
    2856 
    2857     // geometry is needed in  MHHillas... classes
    2858     MGeomCam *fGeom =
    2859              (MGeomCam*)pliston->FindCreateObj("MGeomCamCT1", "MGeomCam");
    2860 
    2861 
    28622877    TString fHilName    = "MHillas";
    28632878    TString fHilNameExt = "MHillasExt";
    28642879    TString fHilNameSrc = "MHillasSrc";
    28652880    TString fImgParName = "MNewImagePar";
     2881
     2882
     2883    //===========================================================
     2884    //
     2885    // Optimization of energy estimator
     2886    //
     2887
     2888    TString inpath("");
     2889    TString outpath("");
     2890    Int_t howMany = 2000;
     2891    CT1EEst(inpath,   filenameOpt,   outpath, energyParName,
     2892            fHilName, fHilNameSrc,   fhadronnessName,
     2893            howMany,  maxhadronness, maxalpha, maxdist);
     2894
     2895    //-----------------------------------------------------------
     2896    //
     2897    // Read in parameters of energy estimator ("MMcEnergyEst")
     2898    //                   and migration matrix ("MHMcEnergyMigration")
     2899    //
     2900    gLog << "================================================================"
     2901         << endl;
     2902    gLog << "Macro CT1Analysis.C : read parameters of energy estimator and migration matrix from file '"
     2903         << energyParName << "'" << endl;
     2904    TFile enparam(energyParName);
     2905    enparam.ls();
     2906
     2907    //MMcEnergyEst mcest("MMcEnergyEst");
     2908    //mcest.Read("MMcEnergyEst");
     2909    MMcEnergyEst &mcest = *((MMcEnergyEst*)gROOT->FindObject("MMcEnergyEst"));
     2910
     2911    gLog << "Parameters of energy estimator were read in" << endl;
     2912
     2913    TArrayD parA(5);
     2914    TArrayD parB(7);
     2915    for (Int_t i=0; i<parA.GetSize(); i++)
     2916      parA[i] = mcest.GetCoeff(i);
     2917    for (Int_t i=0; i<parB.GetSize(); i++)
     2918      parB[i] = mcest.GetCoeff( i+parA.GetSize() );
     2919
     2920    gLog << "Read in Migration matrix" << endl;   
     2921
     2922    //MHMcEnergyMigration mighiston("MHMcEnergyMigration");
     2923    //mighiston.Read("MHMcEnergyMigration");
     2924    MHMcEnergyMigration &mighiston =
     2925          *((MHMcEnergyMigration*)gROOT->FindObject("MHMcEnergyMigration"));
     2926
     2927    gLog << "Migration matrix was read in" << endl;
     2928
     2929    //*************************************************************************
     2930    //
     2931    // Analyse the data
     2932    //
     2933    gLog << "============================================================"
     2934         << endl;
     2935    gLog << "Analyse the data" << endl;
     2936
     2937    MTaskList tliston;
     2938    MParList pliston;
     2939
     2940    // geometry is needed in  MHHillas... classes
     2941    MGeomCam *fGeom =
     2942             (MGeomCam*)pliston->FindCreateObj("MGeomCamCT1", "MGeomCam");
     2943
    28662944
    28672945    //-------------------------------------------
     
    29142992    fillhadrf.SetName("HhadRF");
    29152993
     2994    //---------------------------
     2995    // calculate estimated energy
     2996
     2997    MEnergyEstParam eeston(fHilName);
     2998    eeston.Add(fHilNameSrc);
     2999
     3000    eeston.SetCoeffA(parA);
     3001    eeston.SetCoeffB(parB);
     3002    //---------------------------
     3003
    29163004
    29173005    MFillH hfill1("MHHillas",    fHilName);
     
    29553043      tliston.AddToList(&write);
    29563044
     3045    tliston.AddToList(&eeston);
     3046
    29573047    tliston.AddToList(&fillhadnn);
    29583048    tliston.AddToList(&fillhadsc);
     
    29773067    evtloop.SetProgressBar(&bar);
    29783068
    2979     Int_t maxevents = -1;
    2980     //Int_t maxevents = 10000;
     3069    //Int_t maxevents = -1;
     3070    Int_t maxevents = 10000;
    29813071    if ( !evtloop.Eventloop(maxevents) )
    29823072        return;
     
    30103100
    30113101
     3102
     3103
     3104
     3105
     3106
     3107
     3108
     3109
     3110
     3111
     3112
  • trunk/MagicSoft/Mars/macros/ONOFFCT1Analysis.C

    r2169 r2255  
    7575        gLog << "DeleteBinnings" << endl;
    7676
     77        if (!plist)
     78        {
     79          gLog << "Deletebinnins : MParlist no longer existing" << endl;
     80          return;
     81        }
     82
    7783        TObject *bin;
    7884
     
    113119        bin = plist->FindObject("BinningDiffsigma2");
    114120        if (bin) delete bin;
     121
     122        gLog << "exit DeleteBinnings" << endl;
    115123}
    116124
     
    134142
    135143      // path for input for Mars
    136       TString inPath = "~magican/ct1test/wittek/marsoutput/optionA/";
     144      TString inPath = "~magican/ct1test/wittek/marsoutput/optionC/";
    137145
    138146      // path for output from Mars
    139       TString outPath = "~magican/ct1test/wittek/marsoutput/optionA/";
     147      TString outPath = "~magican/ct1test/wittek/marsoutput/optionC/";
    140148
    141149      //-----------------------------------------------
     
    153161    //  - write root file for ON (or OFF or MC) data (ON1.root, ...);
    154162
    155     Bool_t JobA    = kFALSE; 
    156     Bool_t WPad    = kFALSE;   // write out padding histograms ?
     163    Bool_t JobA    = kTRUE; 
     164    Bool_t WPad    = kTRUE;   // write out padding histograms ?
    157165    Bool_t RPad    = kFALSE;   // read in padding histograms ?
    158166    Bool_t Wout    = kFALSE;   // write out root file ON1.root
     
    203211    //  - make plots
    204212
    205     Bool_t JobD  = kTRUE; 
     213    Bool_t JobD  = kFALSE; 
    206214
    207215
     
    22452253
    22462254    MHHillasSrc* hillasSrc =
    2247       (MHHillasSrc*)(pliston->FindObject("MHHillasSrc"));
     2255      (MHHillasSrc*)(pliston.FindObject("MHHillasSrc"));
    22482256    TH1F* alphaHist = (TH1F*)(hillasSrc->GetHistAlpha());
    22492257 
    22502258    MHOnSubtraction onsub;
    2251     onsub.Calc(alphaHist, &pliston, kTRUE, 25);
     2259    onsub.Calc(alphaHist, &pliston, kTRUE, 13.1);
    22522260    //-------------------------------------------
    22532261
  • trunk/MagicSoft/Mars/manalysis/MCT1PadONOFF.cc

    r2206 r2255  
    14011401    Int_t j = pix.GetPixId();
    14021402
    1403     Double_t ratioArea = fCam->GetPixRatio(j);
     1403    // GetPixRatio returns (area of pixel 0 / area of current pixel)
     1404    Double_t ratioArea = 1.0 / fCam->GetPixRatio(j);
    14041405
    14051406    MPedestalPix &ppix = (*fPed)[j];
  • trunk/MagicSoft/Mars/manalysis/MCT1PadSchweizer.cc

    r2237 r2255  
    540540    Int_t j = pix.GetPixId();
    541541
    542     Double_t ratioArea = fCam->GetPixRatio(j);
     542    // GetPixRatio returns (area of pixel 0 / area of current pixel)
     543    Double_t ratioArea = 1.0 / fCam->GetPixRatio(j);
    543544
    544545    MPedestalPix &ppix = (*fPed)[j];
  • trunk/MagicSoft/Mars/manalysis/MSigmabar.cc

    r2237 r2255  
    136136
    137137        const Int_t idx = cerpix.GetPixId();
    138         const Double_t area = geom.GetPixRatio(idx);
    139 
    140138        if (idx == 0)
    141139        {
     
    145143        }
    146144
     145        // ratio is the area of pixel 0
     146        //          divided by the area of the current pixel
     147        const Double_t ratio = geom.GetPixRatio(idx);
     148
    147149        const MGeomPix &gpix = geom[idx];
    148150
     
    157159            continue;
    158160
    159         if (area < 1.5)
     161        //if (area < 1.5)
     162        if (ratio > 0.5)
    160163        {
    161164            innerPixels[sector]++;
    162             innerSquaredSum[sector]+= sigma*sigma / area;
     165            innerSquaredSum[sector]+= sigma*sigma * ratio;
    163166        }
    164167        else
    165168        {
    166169            outerPixels[sector]++;
    167             outerSquaredSum[sector]+= sigma*sigma / area;
     170            outerSquaredSum[sector]+= sigma*sigma * ratio;
    168171        }
    169172    }
     
    243246
    244247}
     248
     249
     250
     251
     252
     253
     254
     255
     256
Note: See TracChangeset for help on using the changeset viewer.