Changeset 2208


Ignore:
Timestamp:
06/23/03 11:48:53 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mreflector/MRflEvtData.cc

    r2173 r2208  
    4242#include "MLogManip.h"
    4343
     44#include "MHexagon.h"
     45#include "MGeomCam.h"
     46
     47#include "MRflSinglePhoton.h"
     48
    4449ClassImp(MRflEvtData);
    4550
     
    5560    fName  = name  ? name  : "MRflEvtData";
    5661    fTitle = title ? title : "All Photons from a reflector event";
     62}
     63
     64const MRflSinglePhoton &MRflEvtData::GetPhoton(Int_t i) const
     65{
     66    return *static_cast<MRflSinglePhoton*>(fList.UncheckedAt(i));
    5767}
    5868
     
    91101}
    92102
     103void MRflEvtData::DrawPixelContent(Int_t num) const
     104{
     105}
     106
     107// ------------------------------------------------------------------------
     108//
     109// Fill a reflector event. Sums all pixels in each pixel as the
     110// pixel contents.
     111//
     112// WARNING: Due to the estimation in DistanceToPrimitive and the
     113//          calculation in pixels instead of x, y this is only a
     114//          rough estimate.
     115//
     116Bool_t MRflEvtData::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
     117{
     118    //
     119    // sum the photons content in each pixel
     120    //
     121    const Int_t entries = GetNumPhotons();
     122
     123    val = 0;
     124
     125    for (Int_t i=0; i<entries; i++)
     126    {
     127        const MRflSinglePhoton &ph = GetPhoton(i);
     128
     129        UInt_t idx;
     130        for (idx=0; idx<cam.GetNumPixels(); idx++)
     131        {
     132            MHexagon hex(cam[idx]);
     133            if (hex.DistanceToPrimitive(ph.GetX(), ph.GetY())<0)
     134                break;
     135        }
     136        if (idx==cam.GetNumPixels())
     137            continue;
     138
     139        val += cam.GetPixRatio(idx);
     140    }
     141
     142    return val>0;
     143}
  • trunk/MagicSoft/Mars/mreflector/MRflEvtData.h

    r2135 r2208  
    22#define MARS_MRflEvtData
    33
    4 #ifndef MARS_MRflSinglePhoton
    5 #include "MRflSinglePhoton.h"
     4#ifndef MARS_MCamEvent
     5#include "MCamEvent.h"
    66#endif
    77
     
    1010#endif
    1111
    12 class MRflEvtData : public MParContainer
     12class MRflSinglePhoton;
     13
     14class MRflEvtData : public MCamEvent
    1315{
    1416    TClonesArray fList;
     
    2527    void FixSize();
    2628
    27     const MRflSinglePhoton &GetPhoton(Int_t i) const { return (MRflSinglePhoton&)*fList.UncheckedAt(i); }
     29    const MRflSinglePhoton &GetPhoton(Int_t i) const;
    2830
    2931    void Print(Option_t *o="") const;
     32
     33    Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const;
     34    void   DrawPixelContent(Int_t num) const;
    3035
    3136    ClassDef(MRflEvtData, 0) // All Photons of a event from the reflector program
  • trunk/MagicSoft/Mars/mreflector/Makefile

    r2142 r2208  
    2222#  connect the include files defined in the config.mk file
    2323#
    24 INCLUDES = -I. -I../mbase
     24INCLUDES = -I. -I../mbase -I../mgui -I../mgeom
    2525
    2626#------------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mtools/MChisqEval.cc

    r2173 r2208  
    106106}
    107107
    108 Bool_t MChisqEval::PreProcess(MParList *plist)
     108Int_t MChisqEval::PreProcess(MParList *plist)
    109109{
    110110    fChisq = 0;
     
    123123}
    124124
    125 Bool_t MChisqEval::Process()
     125Int_t MChisqEval::Process()
    126126{
    127127    const Double_t y1 = fData0->GetValue();
     
    135135}
    136136
    137 Bool_t MChisqEval::PostProcess()
     137Int_t MChisqEval::PostProcess()
    138138{
    139139    fChisq /= GetNumExecutions();
  • trunk/MagicSoft/Mars/mtools/MChisqEval.h

    r1840 r2208  
    2929    enum { kIsOwner = BIT(14) };
    3030
     31    Int_t PreProcess(MParList *plist);
     32    Int_t Process();
     33    Int_t PostProcess();
     34
    3135public:
    3236    MChisqEval(const char *name=NULL, const char *title=NULL);
     
    4246    void SetOwner(Bool_t o=kTRUE) { o ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
    4347
    44     Bool_t PreProcess(MParList *plist);
    45     Bool_t Process();
    46     Bool_t PostProcess();
    47 
    4848    Double_t GetChisq() const { return fChisq; }
    4949 
Note: See TracChangeset for help on using the changeset viewer.