Changeset 2001


Ignore:
Timestamp:
04/24/03 11:58:50 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2000 r2001  
    66      - removed
    77
    8 
    9      
     8    * manalysis/MPadSchweizer.[h,cc]:
     9      - renamed arguments of SetHistograms to Mars style
     10      - removed default argument for SetHistograms (usage would result
     11        in a crash)
     12      - removed empty destructor
     13
     14    * mhistmc/MHMcTriggerLvl2.h:
     15      - removed the wrong f in GetHistf
     16
     17
     18
    1019 2003/04/24: Wolfgang Wittek
    1120
  • trunk/MagicSoft/Mars/manalysis/MPadSchweizer.cc

    r1999 r2001  
    1717!
    1818!   Author(s): Robert Wagner   <mailto:magicsoft@rwagner.de> 10/2002
    19 !             Wolfgang Wittek <mailto:wittek@mppmu.mpg.de>  02/2003
     19!   Author(s): Wolfgang Wittek <mailto:wittek@mppmu.mpg.de>  02/2003
    2020!
    2121!   Copyright: MAGIC Software Development, 2000-2003
     
    2525
    2626/////////////////////////////////////////////////////////////////////////////
    27 //                                                                         //
    28 //  MPadSchweizer                                                          //
    29 //                                                                         //
    30 //  This task applies padding such that for a given pixel and for a given  //
    31 //  Theta bin the resulting distribution of the pedestal sigma is identical//
    32 //  to the distributions given by fHSigmaPixTheta and fHDiffPixTheta.      //
    33 //                                                                         //
    34 //  The number of photons, its error and the pedestal sigmas are altered.  //
    35 //  On average, the number of photons added is zero.                       //
    36 //                                                                         //
    37 //  The formulas used can be found in Thomas Schweizer's Thesis,           //
    38 //                                    Section 2.2.1                        //
    39 //                                                                         //
    40 //  There are 2 options for the padding :                                  //
    41 //                                                                         //
    42 //  1) fPadFlag = 1 :                                                      //
    43 //     Generate first a Sigmabar using the 2D-histogram Sigmabar vs. Theta //
    44 //     (fHSigmaTheta). Then generate a pedestal sigma for each pixel using //
    45 //     the 3D-histogram Theta, pixel no., Sigma^2-Sigmabar^2               //
    46 //     (fHDiffPixTheta).                                                   //
    47 //                                                                         //
    48 //     This is the preferred option as it takes into account the           //
    49 //     correlations between the Sigma of a pixel and Sigmabar.             //
    50 //                                                                         //
    51 //  2) fPadFlag = 2 :                                                      //
    52 //     Generate a pedestal sigma for each pixel using the 3D-histogram     //
    53 //     Theta, pixel no., Sigma (fHSigmaPixTheta).                          //
    54 //                                                                         //
    55 //                                                                         //
    56 //  The padding has to be done before the image cleaning because the       //
    57 //  image cleaning depends on the pedestal sigmas.                         //
    58 //                                                                         //
    59 //                                                                         //
    60 //  This implementation has been tested for CT1 data. For MAGIC some       //
    61 //  modifications are necessary.                                           //
    62 //                                                                         //
     27//
     28//  MPadSchweizer
     29//
     30//  This task applies padding such that for a given pixel and for a given
     31//  Theta bin the resulting distribution of the pedestal sigma is identical
     32//  to the distributions given by fHSigmaPixTheta and fHDiffPixTheta.
     33//
     34//  The number of photons, its error and the pedestal sigmas are altered.
     35//  On average, the number of photons added is zero.
     36//
     37//  The formulas used can be found in Thomas Schweizer's Thesis,
     38//                                    Section 2.2.1
     39//
     40//  There are 2 options for the padding :
     41//
     42//  1) fPadFlag = 1 :
     43//     Generate first a Sigmabar using the 2D-histogram Sigmabar vs. Theta
     44//     (fHSigmaTheta). Then generate a pedestal sigma for each pixel using
     45//     the 3D-histogram Theta, pixel no., Sigma^2-Sigmabar^2
     46//     (fHDiffPixTheta).
     47//
     48//     This is the preferred option as it takes into account the
     49//     correlations between the Sigma of a pixel and Sigmabar.
     50//
     51//  2) fPadFlag = 2 :
     52//     Generate a pedestal sigma for each pixel using the 3D-histogram
     53//     Theta, pixel no., Sigma (fHSigmaPixTheta).
     54//
     55//
     56//  The padding has to be done before the image cleaning because the
     57//  image cleaning depends on the pedestal sigmas.
     58//
     59//  For random numbers gRandom is used.
     60//
     61//  This implementation has been tested for CT1 data. For MAGIC some
     62//  modifications are necessary.
     63//
    6364/////////////////////////////////////////////////////////////////////////////
    6465#include "MPadSchweizer.h"
     
    6667#include <stdio.h>
    6768
    68 #include "TH1.h"
    69 #include "TH2.h"
    70 #include "TH3.h"
    71 #include "TRandom.h"
    72 #include "TCanvas.h"
     69#include <TH1.h>
     70#include <TH2.h>
     71#include <TH3.h>
     72#include <TRandom.h>
     73#include <TCanvas.h>
    7374
    7475#include "MBinning.h"
     
    9697  fName  = name  ? name  : "MPadSchweizer";
    9798  fTitle = title ? title : "Task for the padding (Schweizer)";
    98 
    99   //fHSigmaTheta    = fHist2;
    100   //fHSigmaPixTheta = fHist3;
    101   //fHDiffPixTheta  = fHist3Diff;
    102 
    103   //fHSigmaTheta->SetDirectory(NULL);
    104   //fHSigmaPixTheta->SetDirectory(NULL);
    105   //fHDiffPixTheta->SetDirectory(NULL);
    106 
    107   //Print();
    10899}
    109100
    110101// --------------------------------------------------------------------------
    111102//
    112 // Destructor.
     103// Destructor. STLL DOESN'T DESTRUCT EVERYTHING
    113104//
    114105MPadSchweizer::~MPadSchweizer()
    115106{
    116   //nothing yet
     107    *fLog << all << "WARNING: ~MPadSchweizer called: Potential Memory Leak" << endl;
    117108}
    118109
     
    120111//
    121112// Set the references to the histograms to be used in the padding
    122 //
    123 //
    124 void MPadSchweizer::SetHistograms(TH2D *fHist2, TH3D *fHist3, TH3D *fHist3Diff)
     113// DOCUMENTATION of the arguments MISSING
     114//
     115void MPadSchweizer::SetHistograms(TH2D *hist2, TH3D *hist3, TH3D *hist3Diff)
    125116{
    126   fHSigmaTheta    = fHist2;
    127   fHSigmaPixTheta = fHist3;
    128   fHDiffPixTheta  = fHist3Diff;
    129 
    130   fHSigmaTheta->SetDirectory(NULL);
    131   fHSigmaPixTheta->SetDirectory(NULL);
    132   fHDiffPixTheta->SetDirectory(NULL);
    133 
    134   Print();
     117    fHSigmaTheta    = hist2;
     118    fHSigmaPixTheta = hist3;
     119    fHDiffPixTheta  = hist3Diff;
     120
     121    fHSigmaTheta->SetDirectory(NULL);
     122    fHSigmaPixTheta->SetDirectory(NULL);
     123    fHDiffPixTheta->SetDirectory(NULL);
     124
     125    Print();
    135126}
    136127
    137128// --------------------------------------------------------------------------
    138129//
    139 // Set the option for the padding 
    140 //
    141 //  There are 2 options for the padding :                                  //
    142 //                                                                         //
    143 //  1) fPadFlag = 1 :                                                      //
    144 //     Generate first a Sigmabar using the 2D-histogram Sigmabar vs. Theta //
    145 //     (fHSigmaTheta). Then generate a pedestal sigma for each pixel using //
    146 //     the 3D-histogram Theta, pixel no., Sigma^2-Sigmabar^2               //
    147 //     (fHDiffPixTheta).                                                   //
    148 //                                                                         //
    149 //     This is the preferred option as it takes into account the           //
    150 //     correlations between the Sigma of a pixel and Sigmabar.             //
    151 //                                                                         //
    152 //  2) fPadFlag = 2 :                                                      //
    153 //     Generate a pedestal sigma for each pixel using the 3D-histogram     //
    154 //     Theta, pixel no., Sigma (fHSigmaPixTheta).                          //
    155 //                                                                         //
     130// Set the option for the padding
     131//
     132//  There are 2 options for the padding :
     133//
     134//  1) fPadFlag = 1 :
     135//     Generate first a Sigmabar using the 2D-histogram Sigmabar vs. Theta
     136//     (fHSigmaTheta). Then generate a pedestal sigma for each pixel using
     137//     the 3D-histogram Theta, pixel no., Sigma^2-Sigmabar^2
     138//     (fHDiffPixTheta).
     139//
     140//     This is the preferred option as it takes into account the
     141//     correlations between the Sigma of a pixel and Sigmabar.
     142//
     143//  2) fPadFlag = 2 :
     144//     Generate a pedestal sigma for each pixel using the 3D-histogram
     145//     Theta, pixel no., Sigma (fHSigmaPixTheta).
     146//
    156147void MPadSchweizer::SetPadFlag(Int_t padflag)
    157148{
     
    166157Bool_t MPadSchweizer::PreProcess(MParList *pList)
    167158{
    168   fRnd = new TRandom3(0);
    169 
    170159  fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    171160  if (!fMcEvt)
     
    573562    // throw actual number of additional NSB photons (NSB)
    574563    //       and its RMS (sigmaNSB)
    575     Double_t NSB0 = fRnd->Poisson(lambdabar*Area);
     564    Double_t NSB0 = gRandom->Poisson(lambdabar*Area);
    576565    Double_t arg  = NSB0*(F2excess-1.0) + elNoise2Pix;
    577566    Double_t sigmaNSB0;
     
    592581    // smear NSB0 according to sigmaNSB0
    593582    // and subtract lambdabar because of AC coupling
    594     Double_t NSB = fRnd->Gaus(NSB0, sigmaNSB0) - lambdabar*Area;
     583    Double_t NSB = gRandom->Gaus(NSB0, sigmaNSB0) - lambdabar*Area;
    595584
    596585    //---------------------------------
  • trunk/MagicSoft/Mars/manalysis/MPadSchweizer.h

    r1999 r2001  
    1010#endif
    1111
    12 #include "TRandom3.h"
    13 #include "TH1.h"
    14 #include "TH2.h"
    15 #include "TH3.h"
    16 
     12class TH1D;
     13class TH2D;
     14class TH3D;
    1715
    1816class MGeomCam;
     
    2624{
    2725private:
    28     MGeomCam *fCam;
     26    MGeomCam       *fCam;
    2927    MCerPhotEvt    *fEvt;
    3028    MSigmabar      *fSigmabar;
    3129    MMcEvt         *fMcEvt;
    3230    MPedestalCam   *fPed;
    33 
    34     TRandom3       *fRnd;
    3531
    3632    Int_t          fPadFlag;
     
    6460    ~MPadSchweizer();
    6561
    66     void SetHistograms(TH2D     *fHist2=NULL, TH3D *fHist3=NULL,
    67                        TH3D *fHist3Diff=NULL);
     62    void SetHistograms(TH2D *hist2, TH3D *hist3, TH3D *hist3Diff);
    6863
    6964    Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/manalysis/MSigmabarParam.h

    r1682 r2001  
    2828  void SetParams(Int_t r, Double_t si, Double_t sx, Double_t ti, Double_t tx, Double_t mi=0, Double_t mx=0);
    2929
    30   Double_t GetSigmabarMin() { return fSigmabarMin; }
    31   Double_t GetSigmabarMax() { return fSigmabarMax; }
    32   Double_t GetThetaMin() { return fThetaMin; }
    33   Double_t GetThetaMax() { return fThetaMax; }
     30  Double_t GetSigmabarMin() const { return fSigmabarMin; }
     31  Double_t GetSigmabarMax() const { return fSigmabarMax; }
     32  Double_t GetThetaMin() const { return fThetaMin; }
     33  Double_t GetThetaMax() const { return fThetaMax; }
    3434
    3535  void Print();
  • trunk/MagicSoft/Mars/mhistmc/MHMcTriggerLvl2.h

    r1997 r2001  
    1212class MHMcTriggerLvl2 : public MH
    1313{
    14  public:
    15  
    16 
    1714private:
    1815
     
    2421    TH1F *fHistSizeBiggerCellNorm;   // Histogram of fSizeBiggerCell normalized on integral of distribution
    2522
    26     TF1* fFNorm;                      // Function used to normalize histograms
     23    TF1* fFNorm;                     // Function used to normalize histograms
    2724
    2825    static Int_t fColorLps;
    2926    static Int_t fColorSbc;
    3027    static Int_t fColorPs;
     28
     29    TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const;
    3130   
    3231public:
     
    3837    TH1 *GetHistByName(const TString name);
    3938
    40     TH1F *GetHistfLutPseudoSize() const { return fHistLutPseudoSize; }
    41     TH1F *GetHistfLutPseudoSizeNorm() const { return fHistLutPseudoSizeNorm; }
    42     TH1F *GetHistfPseudoSize()  const { return fHistPseudoSize; }
    43     TH1F *GetHistfPseudoSizeNorm()  const { return fHistPseudoSizeNorm; }
    44     TH1F *GetHistfSizeBiggerCell()  const { return fHistSizeBiggerCell; }
    45     TH1F *GetHistfSizeBiggerCellNorm()  const { return fHistSizeBiggerCellNorm; }
     39    TH1F *GetHistLutPseudoSize() const { return fHistLutPseudoSize; }
     40    TH1F *GetHistLutPseudoSizeNorm() const { return fHistLutPseudoSizeNorm; }
     41    TH1F *GetHistPseudoSize()  const { return fHistPseudoSize; }
     42    TH1F *GetHistPseudoSizeNorm()  const { return fHistPseudoSizeNorm; }
     43    TH1F *GetHistSizeBiggerCell()  const { return fHistSizeBiggerCell; }
     44    TH1F *GetHistSizeBiggerCellNorm()  const { return fHistSizeBiggerCellNorm; }
    4645
    4746    void Draw(Option_t *opt=NULL);
     
    5150
    5251    ClassDef(MHMcTriggerLvl2, 1) // Container which holds histograms for the Trigger Level2 image parameters
    53 
    54 private:
    55 
    56     TObject *DrawHist(TH1 &hist, TH1 &histNorm, const TString &canvasname, Int_t &colore) const;
    57 
    5852};
    5953
Note: See TracChangeset for help on using the changeset viewer.