Ignore:
Timestamp:
10/20/03 17:49:59 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
4 edited

Legend:

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

    r2409 r2410  
    351351// --------------------------------------------------------------------------
    352352//
    353 // Return a pointer to the pixel with the requested id. NULL if it doesn't
    354 // exist.
     353// Return a pointer to the pixel with the requested idx. NULL if it doesn't
     354// exist. The Look-up-table fLut is used. If its size is zero (according
     355// to Rene this will happen if an old class object is loaded) we still
     356// try to search in the array.
    355357//
    356358MCerPhotPix *MCerPhotEvt::GetPixById(int idx) const
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r2216 r2410  
    44#ifndef ROOT_TClonesArray
    55#include <TClonesArray.h>
     6#endif
     7#ifndef ROOT_TArrayI
     8#include <TArrayI.h>
    69#endif
    710#ifndef MARS_MCamEvent
     
    1922private:
    2023    UInt_t        fNumPixels;
     24    TArrayI       fLut;        // Lookup tabel to lookup pixel by index
    2125    TClonesArray *fPixels;     //-> FIXME: Change TClonesArray away from a pointer?
    2226
     
    2832    //void   InitSize(UInt_t num) { fPixels->Expand(num); }
    2933
    30     void   AddPixel(Int_t id, Float_t nph, Float_t er)
     34    void   AddPixel(Int_t idx, Float_t nph, Float_t er)
    3135    {
    32         new ((*fPixels)[fNumPixels++]) MCerPhotPix(id, nph, er);
     36        //
     37        // If this is too slow or takes to much space we might use
     38        // MGeomApply and an InitSize member function instead.
     39        //
     40        if (idx>=fLut.GetSize())
     41            fLut.Set(idx+1);
     42
     43        fLut[idx] = fNumPixels;
     44        new ((*fPixels)[fNumPixels++]) MCerPhotPix(idx, nph, er);
    3345    }
    3446
    3547    void FixSize();
    36 
    37     //Bool_t  AddEvent(const MCerPhotEvt &evt);
    3848
    3949    Bool_t  IsPixelExisting(Int_t id) const;
     
    5363    MCerPhotPix &operator[](int i) const { return *(MCerPhotPix*)(fPixels->UncheckedAt(i)); }
    5464
    55     void Scale(Double_t f);
     65    void Scale(Double_t f) { fPixels->ForEach(MCerPhotPix, Scale)(f); }
    5666    void RemoveUnusedPixels();
    5767
    58     MCerPhotPix *GetPixById(int id) const;
     68    MCerPhotPix *GetPixById(int idx) const;// { return idx>=0 && idx<fLut.GetSize() ? (MCerPhotPix*)(fPixels->UncheckedAt(fLut[idx])) : 0; } // Return a pointer to the pixel with the requested id. NULL if it doesn't exist.
    5969
    6070    void Reset();
    6171
    62     void Draw(Option_t* option = "");
    6372    void Print(Option_t *opt=NULL) const;
    6473    void Clear(Option_t *opt=NULL) { Reset(); }
    6574
    6675    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    67     void DrawPixelContent(Int_t num) const
    68     {
    69     }
     76    void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const;
    7077
    71     ClassDef(MCerPhotEvt, 1)    // class for an event containing cerenkov photons
     78    ClassDef(MCerPhotEvt, 2)    // class for an event containing cerenkov photons
    7279};
    7380
    7481#endif
    75 
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc

    r2377 r2410  
    9292MPedestalPix &MPedestalCam::operator[](Int_t i)
    9393{
    94     return *(MPedestalPix*)fArray->UncheckedAt(i);
     94    return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i));
    9595}
    9696
     
    101101MPedestalPix &MPedestalCam::operator[](Int_t i) const
    102102{
    103     return *(MPedestalPix*)fArray->UncheckedAt(i);
     103    return *static_cast<MPedestalPix*>(fArray->UncheckedAt(i));
    104104}
    105105
     
    194194    return val>=0;
    195195}
     196
     197void MPedestalCam::DrawPixelContent(Int_t num, TVirtualPad *pad) const
     198{
     199    *fLog << warn << "MPedestalCam::DrawPixelContent - not available." << endl;
     200}
  • trunk/MagicSoft/Mars/manalysis/MPedestalCam.h

    r2237 r2410  
    3636
    3737    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
    38     void DrawPixelContent(Int_t num) const
    39     {
    40     }
     38    void DrawPixelContent(Int_t num, TVirtualPad *pad=NULL) const;
    4139
    4240    ClassDef(MPedestalCam, 1)   // Storage Container for all pedestal information of the camera
Note: See TracChangeset for help on using the changeset viewer.