Ignore:
Timestamp:
03/18/05 17:21:58 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mimage
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mimage/ImageLinkDef.h

    r6848 r6855  
    1010#pragma link C++ class MHillas+;
    1111#pragma link C++ class MHillasSrc+;
    12 #pragma link C++ class MHillasSrcCalc+;
    1312#pragma link C++ class MHillasExt+;
    1413#pragma link C++ class MHillasCalc+;
  • trunk/MagicSoft/Mars/mimage/MCameraSmooth.cc

    r4512 r6855  
    4141#include "MGeomPix.h"
    4242#include "MGeomCam.h"
    43 #include "MCerPhotPix.h"
    44 #include "MCerPhotEvt.h"
     43#include "MSignalPix.h"
     44#include "MSignalCam.h"
    4545
    4646ClassImp(MCameraSmooth);
     
    6262// --------------------------------------------------------------------------
    6363//
    64 //  - get the MCerPhotEvt from the parlist (abort if missing)
     64//  - get the MSignalCam from the parlist (abort if missing)
    6565//  - get MGeomCam from the parameter list
    6666//
    6767Int_t MCameraSmooth::PreProcess (MParList *pList)
    6868{
    69     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
     69    fEvt = (MSignalCam*)pList->FindObject("MSignalCam");
    7070    if (!fEvt)
    7171    {
    72         *fLog << err << dbginf << "MCerPhotEvt not found... aborting." << endl;
     72        *fLog << err << dbginf << "MSignalCam not found... aborting." << endl;
    7373        return kFALSE;
    7474    }
     
    104104        for (UShort_t i=0; i<entries; i++)
    105105        {
    106             MCerPhotPix &pix = (*fEvt)[i];
     106            MSignalPix &pix = (*fEvt)[i];
    107107
    108             const Int_t id = pix.GetPixId();
     108            //const Int_t id = pix.GetPixId();
    109109
    110             const MGeomPix &gpix = (*fGeomCam)[id];
     110            const MGeomPix &gpix = (*fGeomCam)[i];
    111111
    112112            const Int_t n = gpix.GetNumNeighbors();
     
    120120                const UShort_t nid = gpix.GetNeighbor(j);
    121121
    122                 const MCerPhotPix *evtpix = fEvt->GetPixById(nid);
     122                const MSignalPix *evtpix = fEvt->GetPixById(nid);
    123123                if (evtpix)
    124124                {
  • trunk/MagicSoft/Mars/mimage/MCameraSmooth.h

    r4512 r6855  
    1111
    1212class MGeomCam;
    13 class MCerPhotEvt;
     13class MSignalCam;
    1414
    1515class MCameraSmooth : public MTask
    1616{
    1717private:
    18     MCerPhotEvt *fEvt;     //! Pointer to data to smooth
    19     MGeomCam    *fGeomCam; //! Camera geometry
     18    MSignalCam *fEvt;     //! Pointer to data to smooth
     19    MGeomCam   *fGeomCam; //! Camera geometry
    2020
    2121    Byte_t fCounts;           // number of smoothing loops
  • trunk/MagicSoft/Mars/mimage/MConcentration.cc

    r5142 r6855  
    5050#include "MGeomCam.h"
    5151
    52 #include "MCerPhotPix.h"
    53 #include "MCerPhotEvt.h"
     52#include "MSignalPix.h"
     53#include "MSignalCam.h"
    5454
    5555#include "MLog.h"
     
    106106//    Nothing.
    107107//
    108 Int_t MConcentration::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, const MHillas &hillas)
     108Int_t MConcentration::Calc(const MGeomCam &geom, const MSignalCam &evt, const MHillas &hillas)
    109109{
    110110    Float_t maxpix[9] = {0,0,0,0,0,0,0,0,0};             // [#phot]
    111111
    112     TIter Next(evt);
    113     MCerPhotPix *pix = 0;
    114     while ((pix=(MCerPhotPix*)Next()))
    115     {
    116         const Int_t    pixid = pix->GetPixId();
    117         const Double_t nphot = pix->GetNumPhotons()* geom.GetPixRatio(pixid);
     112   const UInt_t npix = evt.GetNumPixels();
     113   for (UInt_t i=0; i<npix; i++)
     114   {
     115       const MSignalPix &pix = evt[i];
     116       if (!pix.IsPixelUsed())
     117           continue;
     118
     119        const Double_t nphot = pix.GetNumPhotons()* geom.GetPixRatio(i);
    118120
    119121        // Get number of photons in the 8 most populated pixels
  • trunk/MagicSoft/Mars/mimage/MConcentration.h

    r4710 r6855  
    88class MHillas;
    99class MGeomCam;
    10 class MCerPhotEvt;
     10class MSignalCam;
    1111
    1212class MConcentration : public MParContainer
     
    2020    void Reset();
    2121
    22     Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix, const MHillas &hil);
     22    Int_t Calc(const MGeomCam &geom, const MSignalCam &pix, const MHillas &hil);
    2323
    2424    void Print(Option_t *opt=NULL) const;
  • trunk/MagicSoft/Mars/mimage/MHillas.cc

    r6292 r6855  
    6969#include "MGeomCam.h"
    7070
    71 #include "MCerPhotPix.h"
    72 #include "MCerPhotEvt.h"
     71#include "MSignalPix.h"
     72#include "MSignalCam.h"
    7373
    7474#include "MLog.h"
     
    203203// Returns:
    204204//   0  no error
    205 //   1  number of pixels < 3
     205//   1  number of pixels in event == 0 (special MC events)
    206206//   2  size==0
    207207//   3  number of used pixel < 3
    208208//   4  CorrXY == 0
    209209//
    210 Int_t MHillas::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, Int_t island)
    211 {
    212     //
    213     // sanity check 1
    214     //
    215     if (evt.GetNumPixels()<3)
     210Int_t MHillas::Calc(const MGeomCam &geom, const MSignalCam &evt, Int_t island)
     211{
     212    const UInt_t numpix  = evt.GetNumPixels();
     213
     214    //
     215    // sanity check 1 (special MC events)
     216    //
     217    if (numpix==0)
    216218        return 1;
    217219
     
    229231    fSize  = 0;
    230232
    231     MCerPhotPix *pix = 0;
     233    UInt_t numused = 0;
     234/*
     235    MSignalPix *pix = 0;
    232236
    233237    TIter Next(evt);
    234     UInt_t numused = 0;
    235     while ((pix=(MCerPhotPix*)Next()))
     238    while ((pix=(MSignalPix*)Next()))*/
     239    for (UInt_t i=0; i<numpix; i++)
    236240    {
    237         if (island>=0 && pix->GetIdxIsland()!=island)
     241        MSignalPix &pix = evt[i];
     242        if (!pix.IsPixelUsed())
    238243            continue;
    239244
    240         const MGeomPix &gpix = geom[pix->GetPixId()];
    241 
    242         const Float_t nphot = pix->GetNumPhotons();
     245        if (island>=0 && pix.GetIdxIsland()!=island)
     246            continue;
     247
     248        const MGeomPix &gpix = geom[i/*pix->GetPixId()*/];
     249
     250        const Float_t nphot = pix.GetNumPhotons();
    243251
    244252        fSize  += nphot;                             // [counter]
     
    277285    Double_t corryy=0;                               // [m^2]
    278286
    279     Next.Reset();
    280     while ((pix=(MCerPhotPix*)Next()))
     287    //Next.Reset();
     288    //while ((pix=(MSignalPix*)Next()))
     289    //{
     290    for (UInt_t i=0; i<numpix; i++)
    281291    {
    282         if (island>=0 && pix->GetIdxIsland()!=island)
     292        MSignalPix &pix = evt[i];
     293        if (!pix.IsPixelUsed())
    283294            continue;
    284295
    285         const MGeomPix &gpix = geom[pix->GetPixId()];
     296        if (island>=0 && pix.GetIdxIsland()!=island)
     297            continue;
     298
     299        const MGeomPix &gpix = geom[i/*pix->GetPixId()*/];
    286300
    287301        const Float_t dx = gpix.GetX() - fMeanX;     // [mm]
    288302        const Float_t dy = gpix.GetY() - fMeanY;     // [mm]
    289303
    290         const Float_t nphot = pix->GetNumPhotons();  // [#phot]
     304        const Float_t nphot = pix.GetNumPhotons();   // [#phot]
    291305
    292306        corrxx += nphot * dx*dx;                     // [mm^2]
  • trunk/MagicSoft/Mars/mimage/MHillas.h

    r6350 r6855  
    1010
    1111class MGeomCam;
    12 class MCerPhotEvt;
     12class MSignalCam;
    1313
    1414class MHillas : public MParContainer
     
    3131    void Reset();
    3232
    33     Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix, Int_t island=-1);
     33    Int_t Calc(const MGeomCam &geom, const MSignalCam &pix, Int_t island=-1);
    3434
    3535    void Print(const MGeomCam &geom) const;
  • trunk/MagicSoft/Mars/mimage/MHillasCalc.cc

    r5352 r6855  
    117117//
    118118//    1) MGeomCam          5) MHillas         8) MImagePar
    119 //    2) MCerPhotEvt       6) MHillasSrc      9) MNewImagePar
     119//    2) MSignalCam       6) MHillasSrc      9) MNewImagePar
    120120//    3) MSrcPosCam        7) MHillasExt     10) MConcentration
    121121//    4) fIdxIslands
     
    138138#include "MParList.h"
    139139
    140 #include "MCerPhotEvt.h"
     140#include "MSignalCam.h"
    141141
    142142#include "MHillas.h"
     
    189189    if (TestFlags(~kCalcHillasSrc))
    190190    {
    191         fCerPhotEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt"));
     191        fCerPhotEvt = (MSignalCam*)pList->FindObject(AddSerialNumber("MSignalCam"));
    192192        if (!fCerPhotEvt)
    193193        {
    194             *fLog << err << "MCerPhotEvt not found... aborting." << endl;
     194            *fLog << err << "MSignalCam not found... aborting." << endl;
    195195            return kFALSE;
    196196        }
     
    355355    if (TestFlag(kCalcHillas))
    356356    {
    357         PrintSkipped(fErrors[1], "Less than 3 pixels (before cleaning)");
     357        PrintSkipped(fErrors[1], "0-Pixel Event (before cleaning, MC event?)");
    358358        PrintSkipped(fErrors[2], "Calculated Size == 0 (after cleaning)");
    359359        PrintSkipped(fErrors[3], "Number of used pixels < 3");
     
    379379    *fLog << inf << GetDescriptor() << " calculating:" << endl;
    380380    if (TestFlag(kCalcHillas))
    381         *fLog << " - " << fNameHillas << " from MGeomCam, MCerPhotEvt and fIdxIsland=" << fIdxIsland << endl;
     381        *fLog << " - " << fNameHillas << " from MGeomCam, MSignalCam and fIdxIsland=" << fIdxIsland << endl;
    382382    if (TestFlag(kCalcHillasSrc))
    383383        *fLog << " - " << fNameHillasSrc << " from " << fNameSrcPosCam << ", " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
    384384    if (TestFlag(kCalcHillasExt))
    385         *fLog << " - " << fNameHillasExt << " from MGeomCam, MCerPhotEvt, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
     385        *fLog << " - " << fNameHillasExt << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
    386386    if (TestFlag(kCalcImagePar))
    387         *fLog << " - " << fNameImagePar << " from MCerPhotEvt" << endl;
     387        *fLog << " - " << fNameImagePar << " from MSignalCam" << endl;
    388388    if (TestFlag(kCalcNewImagePar))
    389         *fLog << " - " << fNameNewImagePar << " from MGeomCam, MCerPhotEvt, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
     389        *fLog << " - " << fNameNewImagePar << " from MGeomCam, MSignalCam, " << fNameHillas << " and fIdxIsland=" << fIdxIsland << endl;
    390390    if (TestFlag(kCalcConc))
    391         *fLog << " - " << fNameConc << " from MGeomCam, MCerPhotEvt and " << fNameHillas << endl;
     391        *fLog << " - " << fNameConc << " from MGeomCam, MSignalCam and " << fNameHillas << endl;
    392392}
    393393
  • trunk/MagicSoft/Mars/mimage/MHillasCalc.h

    r5059 r6855  
    1818
    1919class MGeomCam;
    20 class MCerPhotEvt;
     20class MSignalCam;
    2121class MHillas;
    2222class MHillasExt;
     
    4141
    4242    const MGeomCam      *fGeomCam;          //! Camera Geometry used to calculate Hillas
    43     const MCerPhotEvt   *fCerPhotEvt;       //! Cerenkov Photon Event used for calculation
     43    const MSignalCam    *fCerPhotEvt;       //! Cerenkov Photon Event used for calculation
    4444
    4545    MHillas             *fHillas;           //! output container to store result
  • trunk/MagicSoft/Mars/mimage/MHillasExt.cc

    r4826 r6855  
    6868#include "MGeomCam.h"
    6969
    70 #include "MCerPhotPix.h"
    71 #include "MCerPhotEvt.h"
     70#include "MSignalPix.h"
     71#include "MSignalCam.h"
    7272
    7373#include "MLog.h"
     
    137137// and the cerenkov photon event
    138138//
    139 Int_t MHillasExt::Calc(const MGeomCam &geom, const MCerPhotEvt &evt, const MHillas &hil, Int_t island)
     139Int_t MHillasExt::Calc(const MGeomCam &geom, const MSignalCam &evt, const MHillas &hil, Int_t island)
    140140{
    141141    //
     
    155155    Float_t maxdist = 0;
    156156
    157     MCerPhotPix *pix = 0;
    158 
    159     TIter Next(evt);
    160     while ((pix=(MCerPhotPix*)Next()))
     157    //    MSignalPix *pix = 0;
     158    //    TIter Next(evt);
     159    //    while ((pix=(MSignalPix*)Next()))
     160
     161    const UInt_t npix = evt.GetNumPixels();
     162    for (UInt_t i=0; i<npix; i++)
    161163    {
    162         if (island>=0 && pix->GetIdxIsland()!=island)
     164        const MSignalPix &pix = evt[i];
     165        if (!pix.IsPixelUsed())
    163166            continue;
    164167
    165         const Int_t pixid = pix->GetPixId();
    166 
    167         const MGeomPix &gpix = geom[pixid];
     168        if (island>=0 && pix.GetIdxIsland()!=island)
     169            continue;
     170
     171        //const Int_t pixid = pix->GetPixId();
     172
     173        const MGeomPix &gpix = geom[i/*pixid*/];
    168174        const Double_t dx = gpix.GetX() - hil.GetMeanX();      // [mm]
    169175        const Double_t dy = gpix.GetY() - hil.GetMeanY();      // [mm]
    170176
    171         Double_t nphot = pix->GetNumPhotons();                  // [1]
     177        Double_t nphot = pix.GetNumPhotons();                  // [1]
    172178
    173179        const Double_t dzx =  hil.GetCosDelta()*dx + hil.GetSinDelta()*dy; // [mm]
     
    185191        // must take pixel size into account
    186192        //
    187         nphot *= geom.GetPixRatio(pixid);
     193        nphot *= geom.GetPixRatio(i/*pixid*/);
    188194
    189195        if (nphot>maxpix)
    190196        {
    191197            maxpix   = nphot;                                  // [1]
    192             maxpixid = pixid;
     198            maxpixid = i;//pixid;
    193199            continue;                                          // [1]
    194200        }
  • trunk/MagicSoft/Mars/mimage/MHillasExt.h

    r4710 r6855  
    1010class MHillas;
    1111class MGeomCam;
    12 class MCerPhotEvt;
     12class MSignalCam;
    1313
    1414class MHillasExt : public MParContainer
     
    3333    Float_t GetMaxDist() const { return fMaxDist; }
    3434
    35     Int_t Calc(const MGeomCam &geom, const MCerPhotEvt &pix,
     35    Int_t Calc(const MGeomCam &geom, const MSignalCam &pix,
    3636               const MHillas &hil, Int_t island=-1);
    3737
  • trunk/MagicSoft/Mars/mimage/MImagePar.cc

    r6489 r6855  
    4848#include "MLogManip.h"
    4949
    50 #include "MCerPhotEvt.h"
    51 #include "MCerPhotPix.h"
     50#include "MSignalCam.h"
    5251
    5352ClassImp(MImagePar);
     
    8685//  Calculation of new image parameters
    8786//
    88 void MImagePar::Calc(const MCerPhotEvt &evt)
     87void MImagePar::Calc(const MSignalCam &evt)
    8988{
    9089    // Get number of saturating pixels
    91     fNumSatPixelsHG = 0;
    92     fNumSatPixelsLG = 0;
    93 
    94     const UInt_t npixevt = evt.GetNumPixels();
    95     for (UInt_t i=0; i<npixevt; i++)
    96     {
    97         const MCerPhotPix &pix = evt[i];
    98 
    99         if (pix.IsPixelHGSaturated())
    100             fNumSatPixelsHG++;
    101         if (pix.IsPixelSaturated())
    102             fNumSatPixelsLG++;
    103     }
     90    fNumSatPixelsHG   = evt.GetNumPixelsSaturatedHiGain();
     91    fNumSatPixelsLG   = evt.GetNumPixelsSaturatedLoGain();
    10492
    10593    // Get number of islands
  • trunk/MagicSoft/Mars/mimage/MImagePar.h

    r6489 r6855  
    88class MHillas;
    99class MGeomCam;
    10 class MCerPhotEvt;
     10class MSignalCam;
    1111
    1212class MImagePar : public MParContainer
     
    3939    void Print(Option_t *opt=NULL) const;
    4040
    41     void Calc(const MCerPhotEvt &evt);
     41    void Calc(const MSignalCam &evt);
    4242
    4343    ClassDef(MImagePar, 2) // Container to hold (geometry and island independant) image parameters
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.cc

    r6489 r6855  
    6161//
    6262// When an event is read, before the image cleaning, all the pixels that
    63 // are in MCerPhotEvt are set as USED and NOT CORE. All the pixels belong
     63// are in MSignalCam are set as USED and NOT CORE. All the pixels belong
    6464// to RING number 1 (like USED pixels).
    65 // Look at MCerPhotPix.h to see how these informations of the pixel are
     65// Look at MSignalPix.h to see how these informations of the pixel are
    6666// stored.
    6767// The default  cleaning METHOD is the STANDARD one and the number of the
     
    8484// This avoids problems of deformations of the shower images.
    8585// The signal S_i and the pedestal RMS Prms_i of the pixel are called from
    86 // the object MCerPhotPix.
     86// the object MSignalPix.
    8787// If (default method = kStandard)
    8888//Begin_Html
     
    281281//   MGeomCam
    282282//   MPedPhotCam
    283 //   MCerPhotEvt
     283//   MSignalCam
    284284//
    285285//  Output Containers:
    286 //   MCerPhotEvt
     286//   MSignalCam
    287287//
    288288/////////////////////////////////////////////////////////////////////////////
     
    307307#include "MGeomCam.h"
    308308
    309 #include "MCerPhotPix.h"
    310 #include "MCerPhotEvt.h"
     309#include "MSignalPix.h"
     310#include "MSignalCam.h"
    311311
    312312#include "MGGroupFrame.h" // MGGroupFrame
     
    325325
    326326const TString MImgCleanStd::gsNamePedPhotCam="MPedPhotCam"; // default name of the 'MPedPhotCam' container
    327 const TString MImgCleanStd::gsNameCerPhotEvt="MCerPhotEvt"; // default name of the 'MCerPhotEvt' container
     327const TString MImgCleanStd::gsNameSignalCam ="MSignalCam"; // default name of the 'MSignalCam' container
    328328const TString MImgCleanStd::gsNameGeomCam   ="MGeomCam";    // default name of the 'MGeomCam' container
    329329
     
    341341    fCleanLvl2(lvl2), fCleanRings(1), fKeepSinglePixels(kFALSE),
    342342    fNamePedPhotCam(gsNamePedPhotCam), fNameGeomCam(gsNameGeomCam),
    343     fNameCerPhotEvt(gsNameCerPhotEvt)
     343    fNameSignalCam(gsNameSignalCam)
    344344{
    345345    fName  = name  ? name  : gsDefName.Data();
     
    374374    // set them to 'unused' state if necessary
    375375    //
    376     MCerPhotPix *pix;
    377 
    378     // Loop over all pixels
    379     MCerPhotEvtIter Next(fEvt, kFALSE);
    380     while ((pix=static_cast<MCerPhotPix*>(Next())))
    381         if (!pix->IsPixelUnmapped() && data[pix->GetPixId()] <= fCleanLvl1)
    382             pix->SetPixelUnused();
     376    const UInt_t npixevt = fEvt->GetNumPixels();
     377    for (UInt_t idx=0; idx<npixevt; idx++)
     378    {
     379        if (data[idx]>fCleanLvl1)
     380            continue;
     381
     382        MSignalPix &pix = (*fEvt)[idx];
     383        if (!pix.IsPixelUnmapped())
     384            pix.SetPixelUnused();
     385    }
    383386}
    384387
     
    395398    size = 0;
    396399
    397     MCerPhotPix *pix;
    398 
    399     // Loop over used pixels only
    400     TIter Next(*fEvt);
    401 
    402     while ((pix=static_cast<MCerPhotPix*>(Next())))
    403     {
    404         // get pixel id of this entry
    405         const Int_t idx = pix->GetPixId();
     400    const UInt_t npixevt = fEvt->GetNumPixels();
     401    for (UInt_t idx=0; idx<npixevt; idx++)
     402    {
     403        MSignalPix &pix = (*fEvt)[idx];
     404        if (!pix.IsPixelUsed())
     405            continue;
    406406 
    407407        // check for 'used' neighbors of this pixel
     
    427427        {
    428428            if (!fKeepSinglePixels)
    429                 pix->SetPixelUnused();
    430             size += pix->GetNumPhotons();
     429                pix.SetPixelUnused();
     430            size += pix.GetNumPhotons();
    431431            n++;
    432432        }
    433433    }
    434434
    435     Next.Reset();
    436     while ((pix=static_cast<MCerPhotPix*>(Next())))
    437     {
    438         if (pix->IsPixelUsed())
    439             pix->SetPixelCore();
     435    for (UInt_t idx=0; idx<npixevt; idx++)
     436    {
     437        MSignalPix &pix = (*fEvt)[idx];
     438        if (pix.IsPixelUsed())
     439            pix.SetPixelCore();
    440440    }
    441441
     
    443443}
    444444
    445 void MImgCleanStd::CleanStep3b(MCerPhotPix &pix)
    446 {
    447     const Int_t idx = pix.GetPixId();
     445void MImgCleanStd::CleanStep3b(Int_t idx)
     446{
     447    MSignalPix &pix = (*fEvt)[idx];
    448448
    449449    //
     
    475475//   If a value<2 for fCleanRings is used, no CleanStep4 is done.
    476476//
    477 void MImgCleanStd::CleanStep4(UShort_t r, MCerPhotPix &pix)
    478 {
     477void MImgCleanStd::CleanStep4(UShort_t r, Int_t idx/*MSignalPix &pix*/)
     478{
     479    MSignalPix &pix = (*fEvt)[idx];
     480
    479481    //
    480482    // Skip events that have already a defined status;
     
    488490    // and tell to which ring it belongs to.
    489491    //
    490     const Int_t idx = pix.GetPixId();
    491 
    492492    MGeomPix  &gpix  = (*fCam)[idx];
    493493
     
    498498        const Int_t idx2 = gpix.GetNeighbor(j);
    499499
    500         MCerPhotPix *npix = fEvt->GetPixById(idx2);
     500        MSignalPix *npix = fEvt->GetPixById(idx2);
    501501        if (!npix || !npix->IsPixelUsed() || npix->GetRing()>r-1 )
    502502            continue;
     
    519519    for (UShort_t r=1; r<fCleanRings+1; r++)
    520520    {
    521         MCerPhotPix *pix;
    522 
    523521        // Loop over all pixels
    524 
    525         MCerPhotEvtIter NextAll(fEvt, kFALSE);
    526         while ((pix=static_cast<MCerPhotPix*>(NextAll())))
     522        const UInt_t npixevt = fEvt->GetNumPixels();
     523        for (UInt_t idx=0; idx<npixevt; idx++)
    527524        {
     525            MSignalPix &pix = (*fEvt)[idx];
     526
    528527            //
    529528            // if pixel is a core pixel or unmapped, go to the next pixel
    530529            //
    531             if (pix->IsPixelCore() || pix->IsPixelUnmapped())
     530            if (pix.IsPixelCore() || pix.IsPixelUnmapped())
    532531                continue;
    533532
    534             if (data[pix->GetPixId()] <= fCleanLvl2)
     533            if (data[idx] <= fCleanLvl2)
    535534                continue;
    536535
    537536            if (r==1)
    538                 CleanStep3b(*pix);
     537                CleanStep3b(idx);
    539538            else
    540                 CleanStep4(r, *pix);
     539                CleanStep4(r, idx);
    541540        }
    542541    }
     
    557556    }
    558557
    559     fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber(fNameCerPhotEvt), "MCerPhotEvt");
     558    fEvt = (MSignalCam*)pList->FindObject(AddSerialNumber(fNameSignalCam), "MSignalCam");
    560559    if (!fEvt)
    561560    {
    562         *fLog << err << fNameCerPhotEvt << " [MCerPhotEvt] not found... aborting." << endl;
     561        *fLog << err << fNameSignalCam << " [MSignalCam] not found... aborting." << endl;
    563562        return kFALSE;
    564563    }
     
    570569        return kFALSE;
    571570    }
    572 
    573     fTime = (MArrivalTime*)pList->FindObject(AddSerialNumber("MArrivalTime"));
    574     if (!fTime && fCleaningMethod==kProbability)
    575         *fLog << warn << "MArrivalTime not found... probability cleaning done with signal only!" << endl;
    576571
    577572    fData = (MCameraData*)pList->FindCreateObj(AddSerialNumber("MCameraData"));
     
    602597        break;
    603598    case kProbability:
    604         fData->CalcCleaningProbability(*fEvt, *fPed, *fCam, fTime);
     599        fData->CalcCleaningProbability(*fEvt, *fPed, *fCam);
    605600        break;
    606601    case kAbsolute:
     
    819814    if (gsNameGeomCam!=fNameGeomCam)
    820815        out << "   " << GetUniqueName() << ".SetNameGeomCam(\"" << fNameGeomCam << "\");" << endl;
    821     if (gsNameCerPhotEvt!=fNameCerPhotEvt)
    822         out << "   " << GetUniqueName() << ".SetNameCerPhotEvt(\"" << fNameCerPhotEvt << "\");" << endl;
     816    if (gsNameSignalCam!=fNameSignalCam)
     817        out << "   " << GetUniqueName() << ".SetNameSignalCam(\"" << fNameSignalCam << "\");" << endl;
    823818    if (fKeepSinglePixels)
    824819        out << "   " << GetUniqueName() << ".SetKeepSinglePixels();" << endl;
  • trunk/MagicSoft/Mars/mimage/MImgCleanStd.h

    r6489 r6855  
    88class MGeomCam;
    99class MSigmabar;
    10 class MCerPhotPix;
    11 class MCerPhotEvt;
     10class MSignalCam;
    1211class MPedPhotCam;
    1312class MArrivalTime;
     
    3029    static const TString gsNamePedPhotCam; // default name of the 'MPedPhotCam' container
    3130    static const TString gsNameGeomCam;    // default name of the 'MGeomCam' container
    32     static const TString gsNameCerPhotEvt; // default name of the 'MCerPhotEvt' container
     31    static const TString gsNameSignalCam;  // default name of the 'MSignalCam' container
    3332
    3433    const MGeomCam     *fCam;  //!
    35           MCerPhotEvt  *fEvt;  //!
     34          MSignalCam  *fEvt;  //!
    3635          MPedPhotCam  *fPed;  //!
    37           MArrivalTime *fTime; //!
    3836          MCameraData  *fData; //!
    3937
     
    4846    TString  fNamePedPhotCam; // name of the 'MPedPhotCam' container
    4947    TString  fNameGeomCam;    // name of the 'MGeomCam' container
    50     TString  fNameCerPhotEvt; // name of the 'MCerPhotEvt' container
     48    TString  fNameSignalCam;  // name of the 'MSignalCam' container
    5149
    5250    // MImgCleanStd
     
    5452    Short_t CleanStep2(Float_t &size);
    5553    void    CleanStep3();
    56     void    CleanStep3b(MCerPhotPix &pix);
    57     void    CleanStep4(UShort_t r, MCerPhotPix &pix);
     54    void    CleanStep3b(Int_t idx);
     55    void    CleanStep4(UShort_t r, Int_t idx);
    5856
    5957    // MGTask, MTask, MParContainer
     
    8179
    8280    void SetNamePedPhotCam(const char *name)  { fNamePedPhotCam = name; }
    83     void SetNameCerPhotEvt(const char *name)  { fNameCerPhotEvt = name; }
     81    void SetNameSignalCam(const char *name)   { fNameSignalCam = name; }
    8482    void SetNameGeomCam(const char *name)     { fNameGeomCam = name; }
    8583
  • trunk/MagicSoft/Mars/mimage/MNewImagePar.cc

    r4826 r6855  
    7777#include "MGeomPix.h"
    7878
    79 #include "MCerPhotEvt.h"
    80 #include "MCerPhotPix.h"
     79#include "MSignalCam.h"
     80#include "MSignalPix.h"
    8181
    8282ClassImp(MNewImagePar);
     
    121121//  Calculation of new image parameters
    122122//
    123 void MNewImagePar::Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
     123void MNewImagePar::Calc(const MGeomCam &geom, const MSignalCam &evt,
    124124                        const MHillas &hillas, Int_t island)
    125125{
     
    141141    Float_t maxpix2 = 0;                                 // [#phot]
    142142
    143     MCerPhotPix *pix = 0;
    144 
     143    /*
     144    MSignalPix *pix = 0;
    145145    TIter Next(evt);
    146     while ((pix=(MCerPhotPix*)Next()))
     146    while ((pix=(MSignalPix*)Next()))
     147    */
     148    UInt_t npix = evt.GetNumPixels();
     149    for (UInt_t i=0; i<npix; i++)
    147150    {
     151        const MSignalPix &pix = evt[i];
     152        if (!pix.IsPixelUsed())
     153            continue;
     154
    148155        // Check for requested islands
    149         if (island>=0 && pix->GetIdxIsland()!=island)
     156        if (island>=0 && pix.GetIdxIsland()!=island)
    150157            continue;
    151158
    152159        // Get geometry of pixel
    153         const Int_t pixid = pix->GetPixId();
    154         const MGeomPix &gpix = geom[pixid];
     160        //const Int_t pixid = pix->GetPixId();
     161        const MGeomPix &gpix = geom[i/*pixid*/];
    155162
    156163        // count used and core pixels
    157         if (pix->IsPixelCore())
     164        if (pix.IsPixelCore())
    158165        {
    159166            fNumCorePixels++;
     
    165172        fUsedArea += gpix.GetA();
    166173
    167         Double_t nphot = pix->GetNumPhotons();
     174        Double_t nphot = pix.GetNumPhotons();
    168175
    169176        //
     
    179186        // must take pixel size into account
    180187        //
    181         nphot *= geom.GetPixRatio(pixid);
     188        nphot *= geom.GetPixRatio(i/*pixid*/);
    182189
    183190        // count inner pixels: To dependent on MAGIC Camera --> FIXME
    184191
    185         if (pixid<397){
     192        if (i<397){
    186193            fInnerSize += nphot;
    187             if(pixid>270){
     194            if(i>270){
    188195                edgepixin2 += nphot;
    189                 if(pixid>330)
     196                if(i>330)
    190197                    edgepixin1 += nphot;
    191198            }
  • trunk/MagicSoft/Mars/mimage/MNewImagePar.h

    r4710 r6855  
    88class MHillas;
    99class MGeomCam;
    10 class MCerPhotEvt;
     10class MSignalCam;
    1111
    1212class MNewImagePar : public MParContainer
     
    5353    void Print(const MGeomCam &geom) const;
    5454
    55     void Calc(const MGeomCam &geom, const MCerPhotEvt &evt,
     55    void Calc(const MGeomCam &geom, const MSignalCam &evt,
    5656              const MHillas &hillas, Int_t island=-1);
    5757
  • trunk/MagicSoft/Mars/mimage/Makefile

    r6848 r6855  
    1919#  connect the include files defined in the config.mk file
    2020#
    21 INCLUDES = -I. -I../mbase -I../mhbase -I../mgeom -I../manalysis \
     21INCLUDES = -I. -I../mbase -I../mhbase -I../mgeom -I../msignal \
    2222           -I../mgui -I../mmc -I../mpointing -I../mpedestal \
    23            -I../mhist
     23           -I../mhist -I../manalysis
    2424
    2525# mhist: MHHillas (MHCamera)
     
    3232           MHillasExt.cc \
    3333           MHillasCalc.cc \
    34            MHillasSrcCalc.cc \
    3534           MImagePar.cc \
    3635           MNewImagePar.cc \
Note: See TracChangeset for help on using the changeset viewer.