Ignore:
Timestamp:
04/12/03 16:40:23 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHSigmaPixel.cc

    r1682 r1951  
    1717!
    1818!   Author(s): Robert Wagner 10/2002 <mailto:magicsoft@rwagner.de>
    19 !   Copyright: MAGIC Software Development, 2000-2002
     19!
     20!   Copyright: MAGIC Software Development, 2000-2003
    2021!
    2122!
     
    7980  if (!fPedestalCam)
    8081    {
    81       *fLog << err << dbginf << "MHSigmaPixel: MPedestalCam not found... aborting." << endl;
     82      *fLog << err << "MPedestalCam not found... aborting." << endl;
    8283      return kFALSE;
    8384    }
    8485 
    8586  MBinning* binssigma = (MBinning*)plist->FindObject("BinningSigma");
    86   MBinning* binspixel = new MBinning();
    87   binspixel->SetEdges(fPedestalCam->GetSize(), -0.5, -0.5+fPedestalCam->GetSize());
    88  
    8987  if (!binssigma)
    9088    {
    91       *fLog << err << dbginf << "MHSigmaPixel: BinningSigma not found... aborting." << endl;
     89      *fLog << err << "BinningSigma [MBinning] not found... aborting." << endl;
    9290      return kFALSE;     
    93    }
     91    }
    9492
    95    SetBinning(&fHist, binspixel, binssigma);
     93  const Int_t n = fPedestalCam->GetSize();
    9694
    97    fHist.Sumw2();
     95  MBinning binspixel;
     96  binspixel.SetEdges(n, -0.5, -0.5+n);
    9897
    99    return kTRUE;
     98  SetBinning(&fHist, &binspixel, binssigma);
     99
     100  fHist.Sumw2();
     101
     102  return kTRUE;
    100103}
    101104
     
    106109Bool_t MHSigmaPixel::Fill(const MParContainer *par)
    107110{
    108   MPedestalCam &ped = *(MPedestalCam*)par;
     111    const MPedestalCam &ped = *(MPedestalCam*)par;
    109112    for (Int_t i=0;i<(ped.GetSize());i++)
    110113    {
    111       const MPedestalPix pix = ped[i];       
    112       fHist.Fill(i, pix.GetSigma());
     114        const MPedestalPix pix = ped[i];
     115        fHist.Fill(i, pix.GetSigma());
    113116    }
    114117    return kTRUE;
  • trunk/MagicSoft/Mars/mhist/MHSigmaPixel.h

    r1682 r1951  
    1919{
    2020private:
    21     MPedestalCam *fPedestalCam;
     21    MPedestalCam *fPedestalCam; //!
     22
    2223    TH2D fHist;
    2324
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.cc

    r1809 r1951  
    9696  if (!fMcEvt)
    9797    {
    98        *fLog << err << dbginf << "MHSigmaTheta::SetupFill : MMcEvt not found... aborting." << endl;
     98       *fLog << err << "MMcEvt not found... aborting." << endl;
    9999       return kFALSE;
    100100     }
     
    103103   if (!fPed)
    104104     {
    105        *fLog << dbginf << "MHSigmaTheta::SetupFill : MPedestalCam not found... aborting." << endl;
     105       *fLog << err << "MPedestalCam not found... aborting." << endl;
    106106       return kFALSE;
    107107     }
     
    110110   if (!fCam)
    111111     {
    112        *fLog << dbginf << "MHSigmaTheta::SetupFill : MGeomCam not found (no geometry information available)... aborting." << endl;
     112       *fLog << err << "MGeomCam not found (no geometry information available)... aborting." << endl;
    113113       return kFALSE;
    114114     }
     
    117117   if (!fEvt)
    118118     {
    119        *fLog << dbginf << "MHSigmaTheta::SetupFill : MCerPhotEvt not found... aborting." << endl;
     119       *fLog << err << "MCerPhotEvt not found... aborting." << endl;
    120120       return kFALSE;
    121121     }
     
    124124   if (!fSigmabar)
    125125     {
    126        *fLog << dbginf << "MHSigmaTheta::SetupFill : MSigmabar not found... aborting." << endl;
     126       *fLog << err << "MSigmabar not found... aborting." << endl;
    127127       return kFALSE;
    128128     }
     
    132132   if (!binstheta)
    133133     {
    134        *fLog << err << dbginf << "MHSigmaTheta::SetupFill : BinningTheta not found... aborting." << endl;
     134       *fLog << err << "BinningTheta [MBinning] not found... aborting." << endl;
    135135       return kFALSE;     
    136136     }
    137137
    138138   // Get Sigmabar binning 
    139    MBinning* binssigma  = (MBinning*)plist->FindObject("BinningSigmabar");
     139   MBinning* binssigma = (MBinning*)plist->FindObject("BinningSigmabar");
    140140   if (!binssigma)
    141141     {
    142        *fLog << err << dbginf << "MHSigmaTheta::SetupFill : BinningSigmabar not found... aborting." << endl;
     142       *fLog << err << "BinningSigmabar [MBinning] not found... aborting." << endl;
    143143       return kFALSE;     
    144144     }
     
    148148   if (!binsdiff)
    149149     {
    150        *fLog << err << dbginf << "MHSigmaTheta::SetupFill : BinningDiffsigma2 not found... aborting." << endl;
     150       *fLog << err << "BinningDiffsigma2 [MBinning] not found... aborting." << endl;
    151151       return kFALSE;     
    152152     }
     
    154154
    155155   // Set binnings in histograms
    156    SetBinning(&fSigmaTheta,    binstheta, binssigma);
     156   SetBinning(&fSigmaTheta, binstheta, binssigma);
    157157
    158158   // Get binning for pixel number
    159    UInt_t npix = fPed->GetSize();
     159   const UInt_t npix = fPed->GetSize();
     160
    160161   MBinning binspix("BinningPixel");
    161    MBinning* binspixel = &binspix;
    162    binspixel->SetEdges(npix, -0.5, ((float)npix)-0.5 );
    163 
    164    SetBinning(&fSigmaPixTheta, binstheta, binspixel, binssigma);
    165    SetBinning(&fDiffPixTheta,  binstheta, binspixel, binsdiff);
     162   binspix.SetEdges(npix, -0.5, -0.5+npix );
     163
     164   SetBinning(&fSigmaPixTheta, binstheta, &binspix, binssigma);
     165   SetBinning(&fDiffPixTheta,  binstheta, &binspix, binsdiff);
    166166
    167167   return kTRUE;
     
    176176  //*fLog << "entry Fill" << endl;
    177177
    178     Double_t Theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
     178    Double_t theta = fMcEvt->GetTelescopeTheta()*kRad2Deg;
    179179    Double_t mySig = fSigmabar->Calc(*fCam, *fPed, *fEvt);
    180     fSigmaTheta.Fill(Theta, mySig);
    181 
    182     //*fLog << "Theta, mySig = " << Theta << ",  " << mySig << endl;
     180
     181    fSigmaTheta.Fill(theta, mySig);
    183182
    184183    const UInt_t npix = fEvt->GetNumPixels();
     
    189188        continue;
    190189
     190      /*
    191191      if (cerpix.GetNumPhotons() == 0)
    192192        continue;
    193 
    194       Int_t j = cerpix.GetPixId();
    195       const MPedestalPix pix = fPed->operator[](j);
    196 
    197       Double_t Sigma = pix.GetMeanRms();
    198       Double_t Area  = fCam->GetPixRatio(j);
    199 
    200       fSigmaPixTheta.Fill(Theta, (Double_t)j, Sigma);
    201 
    202       Double_t Diff = Sigma*Sigma/Area - mySig*mySig;
    203       fDiffPixTheta.Fill (Theta, (Double_t)j, Diff);
     193        */
     194
     195      const Int_t id = cerpix.GetPixId();
     196      const MPedestalPix &pix = (*fPed)[id];
     197
     198      const Double_t sigma = pix.GetMeanRms();
     199      const Double_t area  = fCam->GetPixRatio(id);
     200
     201      fSigmaPixTheta.Fill(theta, (Double_t)id, sigma);
     202
     203      const Double_t diff = sigma*sigma/area - mySig*mySig;
     204      fDiffPixTheta.Fill(theta, (Double_t)id, diff);
    204205    }
    205 
    206     return kTRUE;
    207 }
    208 
    209 // --------------------------------------------------------------------------
    210 //
    211 //  Plot the results
    212 //
    213 Bool_t MHSigmaTheta::Finalize()
    214 {
    215     DrawClone();
    216206
    217207    return kTRUE;
     
    329319{
    330320    if (!gPad)
    331         MakeDefCanvas("SigmaTheta", "Sigmabar vs. Theta",
    332                        600, 600);
     321        MakeDefCanvas("SigmaTheta", "Sigmabar vs. Theta", 600, 600);
    333322
    334323    TH1D *h;
     
    358347    fSigmaTheta.DrawCopy(opt);
    359348
    360 
    361 
    362349    gPad->Modified();
    363350    gPad->Update();
  • trunk/MagicSoft/Mars/mhist/MHSigmaTheta.h

    r1748 r1951  
    1414#endif
    1515
    16 #ifndef ROOT_TProfile2D
    17 #include "TProfile2D.h"
    18 #endif
    19 
    2016class MGeomCam;
    2117class MCerPhotEvt;
     
    3026{
    3127private:
    32     const MGeomCam *fCam;
    33     MPedestalCam   *fPed;
    34     MCerPhotEvt    *fEvt;
    35     MSigmabar      *fSigmabar;
    36     MMcEvt         *fMcEvt;
     28    const MGeomCam *fCam;        //!
     29    MPedestalCam   *fPed;        //!
     30    MCerPhotEvt    *fEvt;        //!
     31    MSigmabar      *fSigmabar;   //!
     32    MMcEvt         *fMcEvt;      //!
    3733 
    38     TH2D           fSigmaTheta;   // 2D-distribution sigmabar versus Theta;
    39                                   // sigmabar is the average pedestasl sigma
    40                                   // in an event
    41     TH3D           fSigmaPixTheta;// 3D-distr.:Theta, pixel, pedestal sigma
    42     TH3D           fDiffPixTheta; // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
     34    TH2D fSigmaTheta;    // 2D-distribution sigmabar versus Theta; sigmabar is the average pedestasl sigma in an event
     35    TH3D fSigmaPixTheta; // 3D-distr.:Theta, pixel, pedestal sigma
     36    TH3D fDiffPixTheta;  // 3D-distr.:Theta, pixel, sigma^2-sigmabar^2
    4337
    4438
     
    4640    MHSigmaTheta(const char *name=NULL, const char *title=NULL);
    4741
    48     virtual Bool_t SetupFill(const MParList *plist);
    49     virtual Bool_t Fill(const MParContainer *par);
    50     virtual Bool_t Finalize();
     42    Bool_t SetupFill(const MParList *plist);
     43    Bool_t Fill(const MParContainer *par);
    5144
    5245    const TH2D *GetSigmaTheta() { return &fSigmaTheta; }
  • trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.cc

    r1682 r1951  
    7676   if (!fMcEvt)
    7777   {
    78        *fLog << err << dbginf << "MHSigmabarTheta : MMcEvt not found... aborting." << endl;
     78       *fLog << err << "MMcEvt not found... aborting." << endl;
    7979       return kFALSE;
    8080   }
     
    8383   if (!fSigmabar)
    8484   {
    85        *fLog << err << dbginf << "MHSigmabarTheta : MSigmabar not found... aborting." << endl;
     85       *fLog << err << "MSigmabar not found... aborting." << endl;
    8686       return kFALSE;
    8787   }
    8888
     89   MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta");
     90   if (!binstheta)
     91   {
     92       *fLog << err << "BinningTheta [MBinning] not found... aborting." << endl;
     93       return kFALSE;     
     94   }
    8995   MBinning* binssigmabar = (MBinning*)plist->FindObject("BinningSigmabar");
    90    MBinning* binstheta  = (MBinning*)plist->FindObject("BinningTheta");
    91    if (!binssigmabar || !binstheta)
     96   if (!binssigmabar)
    9297   {
    93        *fLog << err << dbginf << "MHSigmabarTheta : At least one MBinning not found... aborting." << endl;
     98       *fLog << err << "BinningSigmabar [MBinning] not found... aborting." << endl;
    9499       return kFALSE;     
    95100   }
  • trunk/MagicSoft/Mars/mhist/MHSigmabarTheta.h

    r1682 r1951  
    1919{
    2020private:
    21     MMcEvt    *fMcEvt;
    22     MSigmabar *fSigmabar;
     21    MMcEvt    *fMcEvt;        //!
     22    MSigmabar *fSigmabar;     //!
    2323
    2424    TH2D fHist;
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r1867 r1951  
    156156    const float sind = sqrt(1.0-cosd*cosd);
    157157
    158 
    159     float t = h.GetMeanY() - m*h.GetMeanX();
     158    const float t = h.GetMeanY() - m*h.GetMeanX();
    160159
    161160    if (!fUseMmScale)
     
    163162
    164163    // get step size ds along the main axis of the ellipse
    165     TAxis &axe = *fStarMap->GetXaxis();
     164    const TAxis &axe = *fStarMap->GetXaxis();
    166165    const int   N    = axe.GetNbins();
    167     const float xmin = axe.GetBinLowEdge(1);
    168     const float xmax = axe.GetBinLowEdge(N+1);
     166    const float xmin = axe.GetXmin();
     167    const float xmax = axe.GetXmax();
     168    // FIXME: Fixed number?
    169169    const float ds   = (xmax-xmin) / 200.0;
    170170
    171171    if (m>-1 && m<1)
    172172    {
    173         float dx = ds * cosd;
    174         float  x = xmin + dx/2.0;
    175         int   N1 = (int) ((xmax-xmin)/dx+1.0);
     173        const float dx = ds * cosd;
     174        const float  x = xmin + dx/2.0;
     175        const int   N1 = (int) ((xmax-xmin)/dx+1.0);
    176176
    177177        for (int i=0; i<N1; i++)
     
    184184    else
    185185    {
    186         TAxis &axe = *fStarMap->GetYaxis();
     186        const TAxis &axe = *fStarMap->GetYaxis();
    187187        const int   M    = axe.GetNbins();
    188         const float ymin = axe.GetBinLowEdge(1);
    189         const float ymax = axe.GetBinLowEdge(M+1);
    190 
    191         float dy = ds * sind;
    192         float  y = ymin + dy/2.0;
    193         int   M1 = (int) ((ymax-ymin)/dy+1.0);
     188        const float ymin = axe.GetXmin();
     189        const float ymax = axe.GetXmax();
     190
     191        const float dy = ds * sind;
     192        const float  y = ymin + dy/2.0;
     193        const int   M1 = (int) ((ymax-ymin)/dy+1.0);
    194194
    195195        for (int i=0; i<M1; i++)
Note: See TracChangeset for help on using the changeset viewer.