Changeset 5431 for trunk


Ignore:
Timestamp:
11/18/04 15:55:40 (20 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
2 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r5000 r5431  
    5151#pragma link C++ class MPad+;
    5252#pragma link C++ class MMcCalibrationUpdate+;
     53#pragma link C++ class MMakePadHistograms+;
    5354
    5455#endif
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r5000 r5431  
    2323           -I../mhistmc -I../mfileio -I../mmain -I../mhcalib -I../mcalib \
    2424           -I../msignal -I../mpointing -I../mtools -I../mfbase       \
    25            -I../mbadpixels -I../mastro -I../mpedestal
     25           -I../mbadpixels -I../mastro -I../mpedestal -I../mtemp/mucm/classes
    2626# mcalib: MGeomApply (MCalibrationCam)
    2727
     
    5555           MFiltercutsCalc.cc \
    5656           MPad.cc \
    57            MMcCalibrationUpdate.cc
     57           MMcCalibrationUpdate.cc \
     58           MMakePadHistograms.cc
    5859
    5960############################################################
     
    6667
    6768mrproper:       clean rmbak
     69
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.cc

    r4635 r5431  
    106106        if (!fPedPhotCam)
    107107        {
    108             *fLog << err << "MPedPhotCam not found... aborting." << endl;
     108          *fLog << err << fNamePedPhotContainer << "[MPedPhotCam] not found... aborting." << endl;
    109109            return kFALSE;
    110110        }
     
    117117        }
    118118    }
     119
     120    *fLog << inf << "Name of MPedPhotCam container : " << fNamePedPhotContainer
     121          << endl;
     122
    119123    return kTRUE;
    120124}
     
    257261        fPedPhotCam->ReCalc(*fGeomCam, fBadPixels);
    258262    }
     263
    259264    return kTRUE;
    260265}
  • trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCalc.h

    r5117 r5431  
    3737
    3838#endif
     39
     40
     41
     42
  • trunk/MagicSoft/Mars/mbadpixels/MHBadPixels.cc

    r4887 r5431  
    3535#include "MBadPixelsCam.h"
    3636#include "MGeomCam.h"
     37#include "MPedPhotCam.h"
    3738#include "MParList.h"
    3839#include "MBinning.h"
     
    4748// -------------------------------------------------------------------------
    4849//
    49 //  Default Constructor.
     50//  Constructor.
    5051//
    5152MHBadPixels::MHBadPixels(const char *name, const char *title)
    52     : fNamePedPhotCam("MPedPhotCam")
    5353{
    5454    fName  = name  ? name  : "MHBadPixels";
    5555    fTitle = title ? title : "Histogram for Bad Pixels vs. Theta";
    5656
    57     fBadId.SetName("2D-IdBadPixels");
    58     fBadId.SetTitle("2D-IdBadPixels");
    59     fBadId.SetDirectory(NULL);
    60     fBadId.SetXTitle("\\Theta [\\circ]");
    61     fBadId.SetYTitle("pixel Id");
    62 
    63     fBadN.SetName("2D-NBadPixels");
    64     fBadN.SetTitle("2D-NBadPixels");
    65     fBadN.SetDirectory(NULL);
    66     fBadN.SetXTitle("\\Theta [\\circ]");
    67     fBadN.SetYTitle("number of bad pixels");
    68 
     57    fBadId = new TH2D;
     58    fBadId->SetName("2D-IdBadPixels");
     59    fBadId->SetTitle("2D-IdBadPixels");
     60    fBadId->SetDirectory(NULL);
     61    fBadId->UseCurrentStyle();
     62    fBadId->SetXTitle("\\Theta [\\circ]");
     63    fBadId->SetYTitle("pixel Id");
     64    fBadId->SetTitleOffset(1.2, "Y");
     65
     66    fBadN = new TH2D;
     67    fBadN->SetName("2D-NBadPixels");
     68    fBadN->SetTitle("2D-NBadPixels");
     69    fBadN->SetDirectory(NULL);
     70    fBadN->UseCurrentStyle();
     71    fBadN->SetXTitle("\\Theta [\\circ]");
     72    fBadN->SetYTitle("number of bad pixels");
     73    fBadN->SetTitleOffset(1.2, "Y");
     74
     75    // define default binnings
     76    fBinsTheta = new MBinning;
     77    fBinsTheta->SetEdgesCos(10,  0.0,  90.0);    // theta
     78
     79    fBinsPix = new MBinning;
     80    fBinsPix->SetEdges(578, -0.5, 577.5);    // pixel id
     81
     82    SetBinning(fBadId, fBinsTheta, fBinsPix);
     83    SetBinning(fBadN,  fBinsTheta, fBinsPix);
     84
     85    //-----------------------------------------
     86    fNamePedPhotCam = "MPedPhotCamFromData";
     87}
     88
     89
     90// -------------------------------------------------------------------------
     91//
     92//  Destructor.
     93//
     94MHBadPixels::~MHBadPixels()
     95{
     96  delete fBadId;
     97  delete fBadN;
     98
     99  delete fBinsTheta;
     100  delete fBinsPix;
    69101}
    70102
     
    75107Bool_t MHBadPixels::SetupFill(const MParList *plist)
    76108{
    77     MGeomCam *fCam = (MGeomCam*)plist->FindObject(AddSerialNumber("MGeomCam"));
     109    fCam = (MGeomCam*)plist->FindObject(AddSerialNumber("MGeomCam"));
    78110    if (!fCam)   
    79111    {
    80         *fLog << err << "MGeomCam not found... aborting." << endl;
    81         return kFALSE;
    82     }
     112        *fLog << err << "MHBadPixels::SetupFill; MGeomCam not found... aborting." << endl;
     113        return kFALSE;
     114    }
     115    *fLog << "MHBadPixels::SetupFill; fCam = " << fCam << endl;
     116
    83117    fPointPos = (MPointingPos*)plist->FindObject("MPointingPos");
    84118    if (!fPointPos)
     
    87121        return kFALSE;
    88122    }
     123   
     124    fPedPhot = (MPedPhotCam*)plist->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam");
     125    if (!fPedPhot)
     126    {
     127        *fLog << err << AddSerialNumber(fNamePedPhotCam)
     128              << "[MPedPhotCam] not found... aborting." << endl;
     129        return kFALSE;
     130    }
     131    fPedPhot->InitSize(fCam->GetNumPixels());
     132
    89133
    90134    //----------------------------------------------------
     135    *fLog << inf << "Name of MPedPhotCam container : " << fNamePedPhotCam
     136          << endl;
     137
     138
     139    //----------------------------------------------------
     140    // redefine the binnings
     141   
    91142    // Get Theta Binning
    92     MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta", "MBinning");
     143    const MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta", "MBinning");
    93144    if (!binstheta)
    94145    {
    95         *fLog << err << "BinningTheta [MBinning] not found... aborting" << endl;
    96         return kFALSE;
    97     }
    98 
    99     // Get binning for pixel number
    100     const UInt_t npix1 = fCam->GetNumPixels()+1;
    101 
     146        *fLog << err << "Object 'BinningTheta' [MBinning] not found... use default binning." << endl;
     147        binstheta = fBinsTheta;
     148    }
     149
     150    // Define binning for pixel number
     151    const UInt_t npix1 = fPedPhot->GetSize()+1;
     152    //*fLog << "MHBadPixels::SetupFill(); npix1 = " << npix1 << endl;
    102153    MBinning binspix("BinningPixel");
    103154    binspix.SetEdges(npix1, -0.5, npix1-0.5);
    104155
    105156    // Set binnings in histograms
    106     SetBinning(&fBadId, binstheta, &binspix);
    107     SetBinning(&fBadN,  binstheta, &binspix);
     157    SetBinning(fBadId, binstheta, &binspix);
     158    SetBinning(fBadN,  binstheta, &binspix);
     159
     160    *fLog << "MHBadPixels::SetupFill(); binnings were set" << endl;
     161   
     162
    108163
    109164    return kTRUE;
     
    122177    Double_t theta = fPointPos->GetZd();
    123178
    124     const MBadPixelsCam *badpixels = (MBadPixelsCam*)par;
    125 
    126     const UInt_t entries = badpixels->GetSize();
    127 
     179    const MBadPixelsCam *fBadPixels = (MBadPixelsCam*)par;
     180
     181    const UInt_t entries = fPedPhot->GetSize();
    128182    UInt_t nb = 0;
    129183    for (UInt_t i=0; i<entries; i++)
    130184    {
    131         if ( (*badpixels)[i].IsUnsuitable() )
    132         {
    133             fBadId.Fill(theta, i, w);
    134             nb++;
    135         }
    136     }
    137     fBadN.Fill(theta, nb, w);
     185      //*fLog << "MHBadPixels::Fill; i = " << i << endl;
     186
     187      if ( (*fBadPixels)[i].IsUnsuitable() )
     188      {
     189        //*fLog << "MHBadPixels::Fill; (UnSuitable) " << endl;
     190
     191          fBadId->Fill(theta, i, w);
     192          nb++;
     193      }   
     194    }
     195    fBadN->Fill(theta, nb, w);
    138196
    139197    return kTRUE;
     
    154212
    155213    pad->cd(1);
    156     fBadId.Draw(option);
     214    fBadId->Draw(option);
    157215
    158216    pad->cd(2);
    159     fBadN.Draw(option);
     217    fBadN->Draw(option);
    160218
    161219    pad->cd(3);
    162220    gPad->SetBorderMode(0);
    163     h = ((TH2*)&fBadId)->ProjectionY("ProjY-pixId", -1, 9999, "");
     221    h = ((TH2*)fBadId)->ProjectionY("ProjY-pixId", -1, 9999, "");
    164222    h->SetDirectory(NULL);
    165223    h->SetTitle("Distribution of bad pixel Id");
    166224    h->SetXTitle("Id of bad pixel");
    167225    h->SetYTitle("No. of events");
     226    h->SetTitleOffset(1.2, "Y");
    168227    h->Draw(option);
    169228    h->SetBit(kCanDelete);
     
    171230    pad->cd(4);
    172231    gPad->SetBorderMode(0);
    173     h = ((TH2*)&fBadN)->ProjectionY("ProjY-pixN", -1, 9999, "");
     232    h = ((TH2*)fBadN)->ProjectionY("ProjY-pixN", -1, 9999, "");
    174233    h->SetDirectory(NULL);
    175234    h->SetTitle("Distribution of no.of bad pixels");
    176235    h->SetXTitle("No. of bad pixels");
    177236    h->SetYTitle("No. of events");
     237    h->SetTitleOffset(1.2, "Y");
    178238    h->Draw(option);
    179239    h->SetBit(kCanDelete);
     
    182242    pad->Update();
    183243}
     244//==========================================================================
     245
     246
     247
     248
     249
     250
     251
     252
     253
     254
     255
  • trunk/MagicSoft/Mars/mbadpixels/MHBadPixels.h

    r4887 r5431  
    1818private:
    1919    MGeomCam      *fCam;      //!
     20    MPedPhotCam   *fPedPhot;  //!
    2021    MPointingPos  *fPointPos; //!
    2122
    2223    TString  fNamePedPhotCam; //! name of the 'MPedPhotCam' container
     24    MBinning *fBinsTheta;     //!
     25    MBinning *fBinsPix;       //!
    2326
    24     TH2D          fBadId; // 2D-histogram : pixel Id vs. Theta
    25     TH2D          fBadN;  // 2D-histogram : no.of bad pixels vs. Theta
     27    TH2D          *fBadId; // 2D-histogram : pixel Id vs. Theta
     28    TH2D          *fBadN;  // 2D-histogram : no.of bad pixels vs. Theta
    2629
    2730public:
    2831    MHBadPixels(const char *name=NULL, const char *title=NULL);
     32    ~MHBadPixels();
    2933
    3034    void SetNamePedPhotCam(const char *name)  { fNamePedPhotCam = name; }
    3135
    32     const TH2D *GetBadId()       { return &fBadId; }
    33     const TH2D *GetBadId() const { return &fBadId; }
     36    const TH2D *GetBadId()       { return fBadId; }
     37    const TH2D *GetBadId() const { return fBadId; }
    3438
    35     const TH2D *GetBadN()       { return &fBadN; }
    36     const TH2D *GetBadN() const { return &fBadN; }
     39    const TH2D *GetBadN()       { return fBadN; }
     40    const TH2D *GetBadN() const { return fBadN; }
     41
     42    TH2 *GetBadIdByName(const TString name) { return fBadId; }
     43    TH2 *GetBadNByName(const TString name)  { return fBadN; }
    3744
    3845    void Draw(Option_t* option = "");
  • trunk/MagicSoft/Mars/mfilter/MFSelBasic.cc

    r4584 r5431  
    8686    fThetaMax   = thetamax;
    8787
     88}
     89
     90// --------------------------------------------------------------------------
     91//
     92// Set the pointers
     93//
     94//
     95Int_t MFSelBasic::PreProcess(MParList *pList)
     96{
     97    fRawRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
     98    if (!fRawRun)
     99    {
     100        *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
     101        return kFALSE;
     102    }
     103
     104    fPointPos = (MPointingPos*)pList->FindObject("MPointingPos");
     105    if (!fPointPos)
     106    {
     107        *fLog << dbginf << "MPointingPos not found... aborting." << endl;
     108        return kFALSE;
     109    }
     110
     111    fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     112    if (!fEvt)
     113    {
     114        *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
     115        return kFALSE;
     116    }
     117
     118    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
     119    if (!fCam)
     120    {
     121        *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
     122        return kFALSE;
     123    }
     124
     125    memset(fCut, 0, sizeof(fCut));
     126
     127    //-------------------------
    88128    *fLog << inf << "MFSelBasic cut values : fMinPhotons, fThetaMin, fThetaMax = ";
    89129    *fLog << fMinPhotons <<",  " << fThetaMin << ",  " << fThetaMax << endl;
    90 }
    91 
    92 // --------------------------------------------------------------------------
    93 //
    94 // Set the pointers
    95 //
    96 //
    97 Int_t MFSelBasic::PreProcess(MParList *pList)
    98 {
    99     fRawRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    100     if (!fRawRun)
    101     {
    102         *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
    103         return kFALSE;
    104     }
    105 
    106     fPointPos = (MPointingPos*)pList->FindObject("MPointingPos");
    107     if (!fPointPos)
    108     {
    109         *fLog << dbginf << "MPointingPos not found... aborting." << endl;
    110         return kFALSE;
    111     }
    112 
    113     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
    114     if (!fEvt)
    115     {
    116         *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
    117         return kFALSE;
    118     }
    119 
    120     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
    121     if (!fCam)
    122     {
    123         *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
    124         return kFALSE;
    125     }
    126 
    127     memset(fCut, 0, sizeof(fCut));
     130    //-------------------------
    128131
    129132    return kTRUE;
  • trunk/MagicSoft/Mars/mfilter/MFSelFinal.cc

    r2663 r5431  
    8686    fDistMax       =  distmax;
    8787
    88     *fLog << inf << "MFSelFinal cut values : fHadronnessMax, fAlphaMax, fDistMax = ";
    89     *fLog << fHadronnessMax << ",  " << fAlphaMax << ",  " << fDistMax <<  endl;
    9088}
    9189
     
    120118
    121119    memset(fCut, 0, sizeof(fCut));
     120
     121    //----------------------
     122    *fLog << inf << "MFSelFinal cut values : fHadronnessMax, fAlphaMax, fDistMax = ";
     123    *fLog << fHadronnessMax << ",  " << fAlphaMax << ",  " << fDistMax <<  endl;
     124    //----------------------
    122125
    123126    return kTRUE;
  • trunk/MagicSoft/Mars/mfilter/MFSelStandard.cc

    r3398 r5431  
    9292    fWidthMin      = widthmin;
    9393
     94}
     95
     96// --------------------------------------------------------------------------
     97//
     98// MISSING
     99//
     100Int_t MFSelStandard::PreProcess(MParList *pList)
     101{
     102    fHil = (MHillas*)pList->FindObject(fHilName, "MHillas");
     103    if (!fHil)
     104    {
     105        *fLog << err << fHilName << " [MHillas] not found... aborting." << endl;
     106        return kFALSE;
     107    }
     108
     109    fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc");
     110    if (!fHilSrc)
     111    {
     112        *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl;
     113        return kFALSE;
     114    }
     115
     116    fNewImgPar = (MNewImagePar*)pList->FindObject(fImgParName, "MNewImagePar");
     117    if (!fNewImgPar)
     118    {
     119        *fLog << err << fImgParName << " [MNewImagePar] not found... aborting." << endl;
     120        return kFALSE;
     121    }
     122
     123    MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
     124    if (!cam)
     125    {
     126        *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl;
     127        return kFALSE;
     128    }
     129
     130    fMm2Deg = cam->GetConvMm2Deg();
     131
     132    memset(fCut, 0, sizeof(fCut));
     133
     134    //--------------------
    94135    *fLog << inf << "MFSelStandard cut values : fUsedPixelsMax, fCorePixelsMin = ";
    95136    *fLog << fUsedPixelsMax << ",  " << fCorePixelsMin << endl;
     
    98139    *fLog << inf << "     fLengthMin, fWidthMin = " << fLengthMin ;
    99140    *fLog << ",  " << fWidthMin << endl;
    100 }
    101 
    102 // --------------------------------------------------------------------------
    103 //
    104 // MISSING
    105 //
    106 Int_t MFSelStandard::PreProcess(MParList *pList)
    107 {
    108     fHil = (MHillas*)pList->FindObject(fHilName, "MHillas");
    109     if (!fHil)
    110     {
    111         *fLog << err << fHilName << " [MHillas] not found... aborting." << endl;
    112         return kFALSE;
    113     }
    114 
    115     fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc");
    116     if (!fHilSrc)
    117     {
    118         *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl;
    119         return kFALSE;
    120     }
    121 
    122     fNewImgPar = (MNewImagePar*)pList->FindObject(fImgParName, "MNewImagePar");
    123     if (!fNewImgPar)
    124     {
    125         *fLog << err << fImgParName << " [MNewImagePar] not found... aborting." << endl;
    126         return kFALSE;
    127     }
    128 
    129     MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
    130     if (!cam)
    131     {
    132         *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl;
    133         return kFALSE;
    134     }
    135 
    136     fMm2Deg = cam->GetConvMm2Deg();
    137 
    138     memset(fCut, 0, sizeof(fCut));
     141    //--------------------
    139142
    140143    return kTRUE;
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc

    r4841 r5431  
    3232//             - the 3D-histogram   sigma, pixel no., Theta                 //
    3333//             - the 3D-histogram   (sigma^2-sigmabar^2), pixel no., Theta  //
     34//             - the 2D-histogram   Theta    vs. Phi                        //
    3435//                                                                          //
    3536//////////////////////////////////////////////////////////////////////////////
     
    6465// --------------------------------------------------------------------------
    6566//
    66 // Default Constructor. It sets name and title of the histogram.
     67// Constructor.
    6768//
    6869MHSigmaTheta::MHSigmaTheta(const char *name, const char *title)
     
    7172    fTitle = title ? title : "2D histogram sigmabar vs. Theta";
    7273
    73     fSigmaTheta.SetDirectory(NULL);
    74     fSigmaTheta.SetName("2D-ThetaSigmabar(Inner)");
    75     fSigmaTheta.SetTitle("2D: \\bar{\\sigma}, \\Theta");
    76     fSigmaTheta.SetXTitle("\\Theta [\\circ]");
    77     fSigmaTheta.SetYTitle("Sigmabar(Inner) / SQRT(Area)");
    78 
    79     fSigmaThetaOuter.SetDirectory(NULL);
    80     fSigmaThetaOuter.SetName("2D-ThetaSigmabar(Outer)");
    81     fSigmaThetaOuter.SetTitle("2D: \\bar{\\sigma}, \\Theta");
    82     fSigmaThetaOuter.SetXTitle("\\Theta [\\circ]");
    83     fSigmaThetaOuter.SetYTitle("Sigmabar(Outer) / SQRT(Area)");
    84 
    85     fSigmaPixTheta.SetDirectory(NULL);
    86     fSigmaPixTheta.SetName("3D-ThetaPixSigma");
    87     fSigmaPixTheta.SetTitle("3D: \\Theta, Pixel Id, \\sigma");
    88     fSigmaPixTheta.SetXTitle("\\Theta [\\circ]");
    89     fSigmaPixTheta.SetYTitle("Pixel Id");
    90     fSigmaPixTheta.SetZTitle("Sigma");
    91 
    92     fDiffPixTheta.SetDirectory(NULL);
    93     fDiffPixTheta.SetName("3D-ThetaPixDiff");
    94     fDiffPixTheta.SetTitle("3D: \\Theta, Pixel Id, {\\sigma}^{2}-\\bar{\\sigma}^{2}");
    95     fDiffPixTheta.SetXTitle("\\Theta [\\circ]");
    96     fDiffPixTheta.SetYTitle("Pixel Id");
    97     fDiffPixTheta.SetZTitle("(Sigma2 - Sigmabar2)/Area");
    98 
    99     // Set default binning
    100     // FIXME: Maybe ist's necessary to adapt the value to the
    101     // Magic default values
    102     MBinning binsb;
    103     MBinning binst;
    104     MBinning binsd;
    105     binsd.SetEdges(100, -10, 20);
    106     binsb.SetEdges(100, 0, 10);
    107     binst.SetEdgesCos(10, 0, 90);
    108 
    109     MBinning binspix("BinningPixel");
    110     binspix.SetEdges(578, -0.5, 577.5);
    111 
    112     SetBinning(&fSigmaTheta,      &binst, &binsb);
    113     SetBinning(&fSigmaThetaOuter, &binst, &binsb);
    114     SetBinning(&fSigmaPixTheta,   &binst, &binspix, &binsb);
    115     SetBinning(&fDiffPixTheta,    &binst, &binspix, &binsd);
    116 
     74    fThetaPhi = new TH2D;
     75    fThetaPhi->SetDirectory(NULL);
     76    fThetaPhi->UseCurrentStyle();
     77    fThetaPhi->SetName("2D-ThetaPhi");
     78    fThetaPhi->SetTitle("2D: \\Theta vs. \\Phi");
     79    fThetaPhi->SetXTitle("\\phi [\\circ]");
     80    fThetaPhi->SetYTitle("\\Theta [\\circ]");
     81    fThetaPhi->SetTitleOffset(1.2,"Y");
     82
     83    fSigmaTheta = new TH2D;
     84    fSigmaTheta->SetDirectory(NULL);
     85    fSigmaTheta->UseCurrentStyle();
     86    fSigmaTheta->SetName("2D-ThetaSigmabar(Inner)");
     87    fSigmaTheta->SetTitle("2D: \\bar{\\sigma}, \\Theta");
     88    fSigmaTheta->SetXTitle("\\Theta [\\circ]");
     89    fSigmaTheta->SetYTitle("Sigmabar(Inner)");
     90    fSigmaTheta->SetTitleOffset(1.2,"Y");
     91
     92    fSigmaThetaOuter = new TH2D;
     93    fSigmaThetaOuter->SetDirectory(NULL);
     94    fSigmaThetaOuter->UseCurrentStyle();
     95    fSigmaThetaOuter->SetName("2D-ThetaSigmabar(Outer)");
     96    fSigmaThetaOuter->SetTitle("2D: \\bar{\\sigma}, \\Theta");
     97    fSigmaThetaOuter->SetXTitle("\\Theta [\\circ]");
     98    fSigmaThetaOuter->SetYTitle("Sigmabar(Outer)");
     99    fSigmaThetaOuter->SetTitleOffset(1.2,"Y");
     100
     101    fSigmaPixTheta = new TH3D;
     102    fSigmaPixTheta->SetDirectory(NULL);
     103    fSigmaPixTheta->UseCurrentStyle();
     104    fSigmaPixTheta->SetName("3D-ThetaPixSigma");
     105    fSigmaPixTheta->SetTitle("3D: \\Theta, Pixel Id, \\sigma");
     106    fSigmaPixTheta->SetXTitle("\\Theta [\\circ]");
     107    fSigmaPixTheta->SetYTitle("Pixel Id");
     108    fSigmaPixTheta->SetZTitle("Sigma");
     109
     110    fDiffPixTheta = new TH3D;
     111    fDiffPixTheta->SetDirectory(NULL);
     112    fDiffPixTheta->UseCurrentStyle();
     113    fDiffPixTheta->SetName("3D-ThetaPixDiff");
     114    //fDiffPixTheta->SetTitle("3D: \\Theta, Pixel Id, {\\sigma}^{2}-\\bar{\\sigma}^{2}");
     115    fDiffPixTheta->SetTitle("3D: \\Theta, Pixel Id, (Sigma2-Sigmabar2)/Area");
     116    fDiffPixTheta->SetXTitle("\\Theta [\\circ]");
     117    fDiffPixTheta->SetYTitle("Pixel Id");
     118    fDiffPixTheta->SetZTitle("(Sigma2 - Sigmabar2)/Area");
     119
     120    // Define default binning
     121    fBinsPhi = new MBinning;
     122    fBinsPhi->SetEdges( 20, 0.0, 360.0);
     123
     124    Double_t fThetaLo =  0.0;
     125    Double_t fThetaHi = 90.0;
     126    fBinsTheta = new MBinning;
     127    fBinsTheta->SetEdgesCos( 10,  fThetaLo, fThetaHi);   // theta
     128    //fBinsTheta->SetEdges( 1, fThetaLo, fThetaHi);   // theta
     129
     130    fBinsSigma = new MBinning;
     131    fBinsSigma->SetEdges(   100,     0.0, 120.0);   // sigma
     132
     133    fBinsSigmabarIn  = new MBinning;
     134    fBinsSigmabarOut = new MBinning;;
     135    fBinsSigmabarIn->SetEdges(100,     0.0,  40.0);   // sigmabar (inner)
     136    fBinsSigmabarOut->SetEdges(100,     0.0,  80.0);   // sigmabar (outer)
     137
     138    fBinsPix = new MBinning;
     139    fBinsPix->SetEdges(578, -0.5, 577.5);
     140
     141    fBinsDiff = new MBinning;
     142    fBinsDiff->SetEdges(   100,  -500.0, 1500.0);   // (sigma2-sigmabar2)/area
     143
     144    SetBinning(fThetaPhi,        fBinsPhi,   fBinsTheta);
     145    SetBinning(fSigmaTheta,      fBinsTheta, fBinsSigmabarIn);
     146    SetBinning(fSigmaThetaOuter, fBinsTheta, fBinsSigmabarOut);
     147    SetBinning(fSigmaPixTheta,   fBinsTheta, fBinsPix, fBinsSigma);
     148    SetBinning(fDiffPixTheta,    fBinsTheta, fBinsPix, fBinsDiff);
     149
     150    //--------------------------------------------
    117151    fNamePedPhotCam = "MPedPhotCamFromData";
     152}
     153
     154
     155// --------------------------------------------------------------------------
     156//
     157// Destructor.
     158//
     159MHSigmaTheta::~MHSigmaTheta()
     160{
     161  delete fThetaPhi;
     162  delete fSigmaTheta;
     163  delete fSigmaThetaOuter;
     164  delete fSigmaPixTheta;
     165  delete fDiffPixTheta;
     166
     167  delete fBinsPhi;
     168  delete fBinsTheta;
     169  delete fBinsSigma;
     170  delete fBinsSigmabarIn;
     171  delete fBinsSigmabarOut;
     172  delete fBinsPix;
     173  delete fBinsDiff;
    118174}
    119175
     
    133189    fPointPos = (MPointingPos*)plist->FindObject("MPointingPos");
    134190    if (!fPointPos)
    135         *fLog << warn << "MPointingPos not found... aborting." << endl;
    136 
    137 
     191    {
     192        *fLog << err << "MPointingPos not found... aborting." << endl;
     193        return kFALSE;
     194    }
    138195
    139196    fPed = (MPedPhotCam*)plist->FindObject(AddSerialNumber(fNamePedPhotCam), "MPedPhotCam");
     
    144201        return kFALSE;
    145202    }
    146     //fPed->InitSize(fCam->GetNumPixels());
     203    fPed->InitSize(fCam->GetNumPixels());
    147204
    148205   
     
    162219
    163220
     221    //---------------------------------------------------------------
     222    *fLog << inf << "Name of MPedPhotCam container : "
     223          << fNamePedPhotCam << endl;
     224
     225
     226    //---------------------------------------------------------------
     227
     228    // Get Phi Binning
     229    MBinning* binsphi  = (MBinning*)plist->FindObject("BinningPhi", "MBinning");
     230    if (!binsphi)
     231    {
     232        *fLog << warn << "Object 'BinningPhi' [MBinning] not found... use default binning." << endl;
     233        binsphi = fBinsPhi;
     234    }
     235
    164236    // Get Theta Binning
    165237    MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta", "MBinning");
    166238    if (!binstheta)
    167239    {
    168         *fLog << warn << "Object 'BinningTheta' [MBinning] not found... no binning applied." << endl;
    169         return kTRUE;
    170     }
    171 
    172     // Get Sigmabar binning
    173     MBinning* binssigma = (MBinning*)plist->FindObject("BinningSigmabar", "MBinning");
    174     if (!binssigma)
    175         *fLog << warn << "Object 'BinningSigmabar' [MBinning] not found... no binning applied." << endl;
     240        *fLog << warn << "Object 'BinningTheta' [MBinning] not found... use default binning." << endl;
     241        binstheta = fBinsTheta;
     242    }
     243
     244    // Get Sigma binning
     245    MBinning* binssig = (MBinning*)plist->FindObject("BinningSigma", "MBinning");
     246    if (!binssig)
     247    {
     248        *fLog << warn << "Object 'BinningSigma' [MBinning] not found... use default binning." << endl;
     249        binssig = fBinsSigma;
     250    }
     251
     252    // Get SigmabarIn binning
     253    MBinning* binssigmain = (MBinning*)plist->FindObject("BinningSigmabarIn", "MBinning");
     254    if (!binssigmain)
     255    {
     256        *fLog << warn << "Object 'BinningSigmabarIn' [MBinning] not found... use default binning." << endl;
     257        binssigmain = fBinsSigmabarIn;
     258    }
     259
     260    // Get SigmabarOut binning
     261    MBinning* binssigmaout = (MBinning*)plist->FindObject("BinningSigmabarOut", "MBinning");
     262    if (!binssigmaout)
     263    {
     264        *fLog << warn << "Object 'BinningSigmabarOut' [MBinning] not found... use default binning." << endl;
     265        binssigmaout = fBinsSigmabarOut;
     266    }
    176267
    177268    // Get binning for (sigma^2-sigmabar^2)
    178269    MBinning* binsdiff  = (MBinning*)plist->FindObject("BinningDiffsigma2", "MBinning");
    179270    if (!binsdiff)
    180         *fLog << warn << "Object 'BinningDiffsigma2' [MBinning] not found... no binning applied." << endl;
    181 
    182     //FIXME: Missing: Apply new binning to only one axis!
     271    {
     272        *fLog << warn << "Object 'BinningDiffsigma2' [MBinning] not found... use default binning." << endl;
     273        binsdiff = fBinsDiff;
     274    }
     275
     276
     277    //---------------------------------------------------------------
    183278
    184279    // Get binning for pixel number
    185280    const UInt_t npix1 = fPed->GetSize()+1;
    186     *fLog << "npix1 = " << npix1 << endl;
     281    //*fLog << "MHSigmaTheata::SetupFill(); npix1 = " << npix1 << endl;
    187282    MBinning binspix("BinningPixel");
    188283    binspix.SetEdges(npix1, -0.5, npix1-0.5);
    189284
    190285    // Set binnings in histograms
    191     if (binssigma)
    192     {
    193         SetBinning(&fSigmaTheta,      binstheta, binssigma);
    194         SetBinning(&fSigmaThetaOuter, binstheta, binssigma);
    195         SetBinning(&fSigmaPixTheta,   binstheta, &binspix, binssigma);
    196     }
    197 
    198     if (binsdiff)
    199         SetBinning(&fDiffPixTheta,  binstheta, &binspix, binsdiff);
     286    SetBinning(fThetaPhi,        binsphi,   binstheta);
     287    SetBinning(fSigmaTheta,      binstheta, binssigmain);
     288    SetBinning(fSigmaThetaOuter, binstheta, binssigmaout);
     289    SetBinning(fSigmaPixTheta,   binstheta, &binspix, binssig);
     290    SetBinning(fDiffPixTheta,    binstheta, &binspix, binsdiff);
     291
     292    *fLog << "MHSigmaTheta::SetupFill(); binnings were set" << endl;
    200293
    201294    return kTRUE;
     
    211304{
    212305    Double_t theta = fPointPos->GetZd();
     306    Double_t phi   = fPointPos->GetAz();
     307
     308    fPed->ReCalc(*fCam, fBad);
    213309
    214310    Double_t mysig      = (fPed->GetArea(0)).GetRms();
    215311    Double_t mysigouter = (fPed->GetArea(1)).GetRms();
    216312
    217     *fLog << "theta, mysig, mysigouter = " << theta << ",  " << mysig
    218           << ",  " << mysigouter << endl;
    219 
    220     fSigmaTheta.Fill(theta, mysig);
    221     fSigmaThetaOuter.Fill(theta, mysigouter);
    222 
    223     const UInt_t npix = fEvt->GetNumPixels();
    224 
    225     for (UInt_t i=0; i<npix; i++)
    226     {
    227         MCerPhotPix &cerpix = (*fEvt)[i];
    228         const Int_t id = cerpix.GetPixId();
    229 
    230         if (!cerpix.IsPixelUsed())
     313    //*fLog << "theta, mysig, mysigouter = " << theta << ",  " << mysig
     314    //      << ",  " << mysigouter << endl;
     315
     316    fThetaPhi->Fill(phi, theta);
     317    fSigmaTheta->Fill(theta, mysig);
     318    fSigmaThetaOuter->Fill(theta, mysigouter);
     319
     320    MCerPhotPix *cerpix = 0;
     321    TIter Next(*fEvt);
     322    while ( (cerpix=(MCerPhotPix*)Next()) )
     323    {
     324        const Int_t id = cerpix->GetPixId();
     325
     326        if (!cerpix->IsPixelUsed())
    231327        {
    232328          //*fLog << all << "MHSigmaTheta::Fill; unused pixel found, id = "
     
    237333        const MPedPhotPix &pix = (*fPed)[id];
    238334
    239         if ( fBad != NULL  &&  ((*fBad)[id]).IsUnsuitable() )
    240         {
    241           // this should never occur, because bad pixels should have
    242           // been set unused
    243           *fLog << all << "MHSigmaTheta::Fill; bad pixel found which is used, id = "
    244                 << id << "... go to next pixel." << endl;
    245           continue;
    246         }
    247 
    248335        // ratio is the area of pixel 0
    249336        //          divided by the area of the current pixel
     
    251338        const Double_t sigma = pix.GetRms();
    252339
    253         fSigmaPixTheta.Fill(theta, (Double_t)id, sigma*sqrt(ratio));
     340        fSigmaPixTheta->Fill(theta, (Double_t)id, sigma);
    254341
    255342        Double_t diff;
     
    258345        {
    259346          // inner pixel
    260           diff = sigma*sigma*ratio - mysig*mysig;
     347          diff = (sigma*sigma - mysig*mysig) * ratio;
    261348        }
    262349        else
    263350        {
    264351          // outer pixel
    265           diff = sigma*sigma*ratio - mysigouter*mysigouter;
     352          diff = (sigma*sigma - mysigouter*mysigouter) * ratio;
    266353        }
    267354
    268         fDiffPixTheta.Fill(theta, (Double_t)id, diff);
     355        fDiffPixTheta->Fill(theta, (Double_t)id, diff);
    269356    }
    270357
     
    285372    if ((h = (TH1D*)gPad->FindObject("ProjX-Theta")))
    286373    {
    287         ProjectionX(*h, fSigmaTheta);
     374        ProjectionX(*h, *fSigmaTheta);
    288375        if (h->GetEntries()!=0)
    289376            gPad->SetLogy();
     
    292379    padsave->cd(4);
    293380    if ((h = (TH1D*)gPad->FindObject("ProjY-sigma")))
    294         ProjectionY(*h, fSigmaTheta);
     381        ProjectionY(*h, *fSigmaTheta);
    295382
    296383    gPad = padsave;
     
    305392    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
    306393    pad->SetBorderMode(0);
    307 
    308394    AppendPad("");
    309395
     
    315401    pad->cd(1);
    316402    gPad->SetBorderMode(0);
    317     h = fSigmaTheta.ProjectionX("ProjX-Theta", -1, 9999, "E");
     403    h = fSigmaTheta->ProjectionX("ProjX-Theta", -1, 9999, "E");
    318404    h->SetDirectory(NULL);
     405    h->UseCurrentStyle();
    319406    h->SetTitle("Distribution of \\Theta");
    320407    h->SetXTitle("\\Theta [\\circ]");
    321408    h->SetYTitle("No.of events");
     409    h->SetTitleOffset(1.2,"Y");
    322410    h->Draw(opt);
    323411    h->SetBit(kCanDelete);
     
    325413    pad->cd(2);
    326414    gPad->SetBorderMode(0);
    327     h = fDiffPixTheta.Project3D("zx");
     415    h = fDiffPixTheta->Project3D("zx");
    328416    h->SetDirectory(NULL);
    329     h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)");
     417    h->UseCurrentStyle();
     418    //h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. \\Theta (all pixels)");
     419    h->SetTitle("(Sigma2-Sigmabar2)/Area  vs. \\Theta (all pixels)");
    330420    h->SetXTitle("\\Theta [\\circ]");
    331421    h->SetYTitle("(Sigma2 - Sigmabar2) / Area");
     422    h->SetTitleOffset(1.2,"Y");
    332423    h->Draw("box");
    333424    h->SetBit(kCanDelete);
     
    335426    pad->cd(3);
    336427    gPad->SetBorderMode(0);
    337     h = fSigmaPixTheta.Project3D("zx");
     428    h = fSigmaPixTheta->Project3D("zx");
    338429    h->SetDirectory(NULL);
     430    h->UseCurrentStyle();
    339431    h->SetTitle("\\sigma_{ped} vs. \\Theta (all pixels)");
    340432    h->SetXTitle("\\Theta [\\circ]");
    341433    h->SetYTitle("Sigma");
     434    h->SetTitleOffset(1.2,"Y");
    342435    h->Draw("box");
    343436    h->SetBit(kCanDelete);
     
    345438    //pad->cd(7);
    346439    //gPad->SetBorderMode(0);
    347     //h = fSigmaTheta.ProjectionY("ProjY-sigma", -1, 9999, "E");
     440    //h = fSigmaTheta->ProjectionY("ProjY-sigma", -1, 9999, "E");
    348441    //h->SetDirectory(NULL);
     442    //h->UseCurrentStyle();
    349443    //h->SetTitle("Distribution of \\bar{\\sigma}_{ped}");
    350444    //h->SetXTitle("\\bar{\\sigma}_{ped}");
    351445    //h->SetYTitle("No.of events");
     446    //h->SetTitleOffset(1.2,"Y");
    352447    //h->Draw(opt);
    353448    //h->SetBit(kCanDelete);
     
    355450    pad->cd(5);
    356451    gPad->SetBorderMode(0);
    357     h = fDiffPixTheta.Project3D("zy");
     452    h = fDiffPixTheta->Project3D("zy");
    358453    h->SetDirectory(NULL);
    359     h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all  \\Theta)");
     454    h->UseCurrentStyle();
     455    //h->SetTitle("\\sigma_{ped}^{2}-\\bar{\\sigma}_{ped}^{2} vs. pixel Id (all  \\Theta)");
     456    h->SetTitle("(Sigma2-Sigmabar2)/Area  vs. pixel Id (all  \\Theta)");
    360457    h->SetXTitle("Pixel Id");
    361     h->SetYTitle("Sigma2 - sigmabar2) / Area");
     458    h->SetYTitle("(Sigma2 - sigmabar2) / Area");
     459    h->SetTitleOffset(1.2,"Y");
    362460    h->Draw("box");
    363461    h->SetBit(kCanDelete);
     
    365463    pad->cd(6);
    366464    gPad->SetBorderMode(0);
    367     h = fSigmaPixTheta.Project3D("zy");
     465    h = fSigmaPixTheta->Project3D("zy");
    368466    h->SetDirectory(NULL);
     467    h->UseCurrentStyle();
    369468    h->SetTitle("\\sigma_{ped} vs. pixel Id (all  \\Theta)");
    370469    h->SetXTitle("Pixel Id");
    371470    h->SetYTitle("Sigma");
     471    h->SetTitleOffset(1.2,"Y");
    372472    h->Draw("box");
    373473    h->SetBit(kCanDelete);
    374474
    375475    pad->cd(4);
    376     fSigmaTheta.Draw(opt);
     476    gPad->SetBorderMode(0);
     477    fSigmaTheta->Draw();
    377478
    378479    pad->cd(7);
    379     fSigmaThetaOuter.Draw(opt);
    380 
    381     //pad->cd(8);
    382     //fDiffPixTheta.Draw(opt);
    383 
    384     //pad->cd(9);
    385     //fSigmaPixTheta.Draw(opt);
     480    gPad->SetBorderMode(0);
     481    fSigmaThetaOuter->Draw();
     482
     483    pad->cd(8);
     484    gPad->SetBorderMode(0);
     485    fThetaPhi->Draw();
     486
     487    pad->cd(9);
     488    gPad->SetBorderMode(0);
     489    h = fThetaPhi->ProjectionX("ProjX-Phi", -1, 9999, "E");
     490    h->SetDirectory(NULL);
     491    h->UseCurrentStyle();
     492    h->SetTitle("Distribution of \\Phi");
     493    h->SetXTitle("\\phi [\\circ]");
     494    h->SetYTitle("No. of events");
     495    h->SetTitleOffset(1.2,"Y");
     496    h->Draw(opt);
     497    h->SetBit(kCanDelete);
    386498}
    387499
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h

    r4841 r5431  
    3535
    3636                           // sigmabar is the average pedestal sigma 
    37     TH2D fSigmaTheta;      // 2D-distribution sigmabar versus Theta (Inner)
    38     TH2D fSigmaThetaOuter; // 2D-distribution sigmabar versus Theta (Outer)
     37    TH2D *fSigmaTheta;      // 2D-distribution sigmabar versus Theta (Inner)
     38    TH2D *fSigmaThetaOuter; // 2D-distribution sigmabar versus Theta (Outer)
    3939
    40     TH3D fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma
    41     TH3D fDiffPixTheta;  // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
     40    TH3D *fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma
     41    TH3D *fDiffPixTheta;  // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
     42
     43    TH2D *fThetaPhi;      // 2D-distribution Theta versus Phi
     44
     45    MBinning *fBinsPhi;            //!
     46    MBinning *fBinsTheta;          //!
     47    MBinning *fBinsSigma;          //!
     48    MBinning *fBinsSigmabarIn;     //!
     49    MBinning *fBinsSigmabarOut;    //!
     50    MBinning *fBinsPix;            //!
     51    MBinning *fBinsDiff;           //!
    4252
    4353    void Paint(Option_t *opt="");
     
    4555public:
    4656    MHSigmaTheta(const char *name=NULL, const char *title=NULL);
     57    ~MHSigmaTheta();
    4758
    4859    void SetNamePedPhotCam(const char *name)  { fNamePedPhotCam = name; }
     
    5162    Bool_t Fill(const MParContainer *par, const Stat_t w=1);
    5263
    53     const TH2D *GetSigmaTheta() { return &fSigmaTheta; }
    54     const TH2D *GetSigmaTheta() const { return &fSigmaTheta; }
     64    const TH2D *GetThetaPhi() { return fThetaPhi; }
     65    const TH2D *GetThetaPhi() const { return fThetaPhi; }
    5566
    56     const TH2D *GetSigmaThetaOuter() { return &fSigmaThetaOuter; }
    57     const TH2D *GetSigmaThetaOuter() const { return &fSigmaThetaOuter; }
     67    const TH2D *GetSigmaTheta() { return fSigmaTheta; }
     68    const TH2D *GetSigmaTheta() const { return fSigmaTheta; }
    5869
    59     const TH3D *GetSigmaPixTheta() { return &fSigmaPixTheta; }
    60     const TH3D *GetSigmaPixTheta() const { return &fSigmaPixTheta; }
     70    const TH2D *GetSigmaThetaOuter() { return fSigmaThetaOuter; }
     71    const TH2D *GetSigmaThetaOuter() const { return fSigmaThetaOuter; }
    6172
    62     const TH3D *GetDiffPixTheta() { return &fDiffPixTheta; }
    63     const TH3D *GetDiffPixTheta() const { return &fDiffPixTheta; }
     73    const TH3D *GetSigmaPixTheta() { return fSigmaPixTheta; }
     74    const TH3D *GetSigmaPixTheta() const { return fSigmaPixTheta; }
     75
     76    const TH3D *GetDiffPixTheta() { return fDiffPixTheta; }
     77    const TH3D *GetDiffPixTheta() const { return fDiffPixTheta; }
    6478
    6579    void Draw(Option_t *option="");
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r4844 r5431  
    560560        return kFALSE;
    561561    }
     562    *fLog << all << "Name of MPedPhotCam container = " << fNamePedPhotCam
     563          << endl;
    562564
    563565    fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
Note: See TracChangeset for help on using the changeset viewer.