Ignore:
Timestamp:
06/16/03 13:45:01 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r2173 r2178  
    3232//   the array fWeight (default: all slices added up with weight 1).
    3333//
     34//   The weights are rescaled, such that sum(weigths)=num slices
     35//
    3436//  Input Containers:
    3537//   MRawRunHeader, MRawEvtData, MPedestalCam
     
    112114
    113115    // Calculate quadratic sum of weights:
    114     fSumQuadWeights = 0.;
    115     for (Int_t i = 0; i < fWeight.GetSize(); i++)
     116    fSumWeights = 0;
     117    fSumQuadWeights = 0;
     118    for (Int_t i=0; i<fWeight.GetSize(); i++)
     119    {
     120        fSumWeights += fWeight[i];
    116121        fSumQuadWeights += fWeight[i]*fWeight[i];
     122    }
    117123
    118124    fSumQuadWeights = sqrt(fSumQuadWeights);
     
    169175
    170176    MRawEvtPixelIter pixel(fRawEvt);
    171 
    172     TArrayF binsignal(fWeight.GetSize());
    173177
    174178    while (pixel.Next())
     
    194198        // Calculate pixel signal unless it has all FADC slices empty:
    195199        //
    196         const Byte_t *ptr = pixel.GetHiGainSamples();
    197 
    198         Float_t nphot = 0;
    199         Float_t nphoterr = 0;
    200 
    201         if (pixel.GetSumHiGainSamples()>0)
    202         {
    203             for (Int_t i=0; i<fWeight.GetSize(); i++)
    204             {
    205                 binsignal[i] =  ptr[i] - mean;
    206                 nphot       +=  binsignal[i] * fWeight[i];
    207             }
    208             nphoterr = ped.GetSigma() * fSumQuadWeights;
    209         }
     200        Byte_t *ptr = pixel.GetHiGainSamples();
     201
     202        Float_t nphot = 0;
     203        for(Int_t i=0; i<fWeight.GetSize(); i++)
     204            nphot += ptr[i]*fWeight[i];
     205
     206        nphot -= mean*fSumWeights;
     207
     208        const Float_t nphoterr = ped.GetSigma()* fSumQuadWeights;
    210209
    211210        fCerPhotEvt->AddPixel(pixid, nphot, nphoterr);
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h

    r1715 r2178  
    3333
    3434    TArrayF         fWeight;  // Weights for adding up the ADC slices
     35    Float_t         fSumWeights;
    3536    Float_t         fSumQuadWeights;
    3637
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r2173 r2178  
    384384    fNumPixels=fPixels->GetEntriesFast();
    385385}
     386
     387Bool_t MCerPhotEvt::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio, Int_t type) const
     388{
     389    MCerPhotPix *pix = GetPixById(idx);
     390    if (!pix || !pix->IsPixelUsed())
     391        return kFALSE;
     392
     393    switch (type)
     394    {
     395    case 1:
     396        val = pix->GetErrorPhot()*TMath::Sqrt(ratio);
     397        return kTRUE;
     398    case 2:
     399        if (pix->GetErrorPhot()<=0)
     400            return kFALSE;
     401        val = pix->GetNumPhotons()*TMath::Sqrt(ratio)/pix->GetErrorPhot();
     402        return kTRUE;
     403    default:
     404        val = pix->GetNumPhotons()*ratio;
     405        return kTRUE;
     406    }
     407    return kTRUE;
     408}
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r2147 r2178  
    44#ifndef ROOT_TClonesArray
    55#include <TClonesArray.h>
     6#endif
     7#ifndef MARS_MCamEvent
     8#include "MCamEvent.h"
    69#endif
    710#ifndef MARS_MCerPhotPix
     
    1215class MCerPhotPix;
    1316
    14 class MCerPhotEvt : public MParContainer
     17class MCerPhotEvt : public MCamEvent
    1518{
    1619private:
     
    6164    void Clear(Option_t *opt=NULL) { Reset(); }
    6265
     66    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const;
     67    void DrawPixelContent(Int_t num) const
     68    {
     69    }
     70
    6371    ClassDef(MCerPhotEvt, 1)    // class for an event containing cerenkov photons
    6472};
  • trunk/MagicSoft/Mars/manalysis/MCurrents.h

    r2173 r2178  
    22#define MARS_MCurrents
    33
    4 #ifndef MARS_MParContainer
    5 #include "MParContainer.h"
     4#ifndef MARS_MCamEvent
     5#include "MCamEvent.h"
    66#endif
    77
     
    1010#endif
    1111
    12 class MCurrents : public MParContainer
     12#include <iostream.h>
     13class MCurrents : public MCamEvent
    1314{
    1415private:
     
    3738    void Print(Option_t *opt=NULL) const;
    3839
     40    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const
     41    {
     42        val = (*this)[idx];
     43        return val>0;
     44    }
     45    void DrawPixelContent(Int_t num) const
     46    {
     47    }
     48
    3949    ClassDef(MCurrents, 1) // Storage Container for the Currents (PRELIMINARY)
    4050};
  • trunk/MagicSoft/Mars/manalysis/MMcPedestalNSBAdd.cc

    r2173 r2178  
    1616!
    1717!
    18 !   Author(s): Oscar Blanch  11/2001 < mailto:blanch@ifae.es>
     18!   Author(s): Oscar Blanch, 11/2001 <mailto:blanch@ifae.es>
    1919!
    2020!   Copyright: MAGIC Software Development, 2000-2001
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r2173 r2178  
    181181    return maxval;
    182182}
     183
     184Bool_t MPedestalCam::GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const
     185{
     186    val = (*this)[idx].GetMean()*ratio;
     187    return kTRUE;
     188}
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.h

    r1540 r2178  
    22#define MARS_MPedestalCam
    33
    4 #ifndef MARS_MParContainer
    5 #include "MParContainer.h"
     4#ifndef MARS_MCamEvent
     5#include "MCamEvent.h"
    66#endif
    77
     
    1111class MPedestalPix;
    1212
    13 class MPedestalCam : public MParContainer
     13class MPedestalCam : public MCamEvent
    1414{
    1515private:
     
    3535    void Print(Option_t *o="") const;
    3636
     37    Bool_t GetPixelContent(Float_t &val, Int_t idx, Float_t ratio=1, Int_t type=0) const;
     38    void DrawPixelContent(Int_t num) const
     39    {
     40    }
     41
    3742    ClassDef(MPedestalCam, 1)   // Storage Container for all pedestal information of the camera
    3843};
Note: See TracChangeset for help on using the changeset viewer.