Changeset 6855 for trunk/MagicSoft


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Makefile

    r6604 r6855  
    2020#
    2121#PROGRAMS = readraw merpp mars test mona status
    22 PROGRAMS = readdaq merpp readraw sinope callisto star ganymed showlog showplot mars mona
     22PROGRAMS = readdaq merpp readraw sinope callisto star ganymed showlog showplot mars
    2323SOLIB    = libmars.so
    2424CINT     = M
  • trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h

    r6848 r6855  
    44#pragma link off all classes;
    55#pragma link off all functions;
    6 
    7 #pragma link C++ class MCerPhotPix+;
    8 #pragma link C++ class MCerPhotEvt+;
    9 #pragma link C++ class MCerPhotEvtIter+;
    10 #pragma link C++ class MCerPhotAnal+;
    11 #pragma link C++ class MCerPhotAnal2+;
    12 #pragma link C++ class MCerPhotCalc+;
    136
    147#pragma link C++ class MCameraData+;
     
    2720
    2821#pragma link C++ class MMatrixLoop+;
    29 /*
    30 #pragma link C++ class MSigmabar+;
    31 #pragma link C++ class MSigmabarCalc+;
    32 #pragma link C++ class MSigmabarParam+;
    33 */
     22
    3423#pragma link C++ class MEventRate+;
    3524#pragma link C++ class MEventRateCalc+;
     
    3827#pragma link C++ class MParameterD+;
    3928#pragma link C++ class MParameterDerr+;
    40 //#pragma link C++ class MParameters+;
    4129
    4230#pragma link C++ class MMcTriggerLvl2+;
     
    4937#pragma link C++ class MFiltercutsCalc+;
    5038
    51 //#pragma link C++ class MPad+;
    5239#pragma link C++ class MMcCalibrationUpdate+;
    53 //#pragma link C++ class MMakePadHistograms+;
    5440
    5541#endif
  • trunk/MagicSoft/Mars/manalysis/MCameraData.cc

    r6569 r6855  
    4545#include "MPedPhotPix.h"
    4646
    47 #include "MCerPhotEvt.h"
    48 #include "MCerPhotPix.h"
     47#include "MSignalCam.h"
     48#include "MSignalPix.h"
    4949
    5050#include "MSigmabar.h"
    51 #include "MArrivalTime.h"
    5251
    5352ClassImp(MCameraData);
     
    5756// --------------------------------------------------------------------------
    5857//
    59 // Creates a MCerPhotPix object for each pixel in the event
     58// Creates a MSignalPix object for each pixel in the event
    6059//
    6160MCameraData::MCameraData(const char *name, const char *title)
     
    9998// FIXME: Should the check noise<=0 be replaced by MBadPixels?
    10099//
    101 void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, const MPedPhotCam &cam,
     100void MCameraData::CalcCleaningLevel(const MSignalCam &evt, const MPedPhotCam &cam,
    102101                                    const MGeomCam &geom)
    103102{
     
    114113
    115114    // calculate cleaning levels
    116     for (Int_t i=0; i<entries; i++)
    117     {
    118         const MCerPhotPix &pix = evt[i];
    119 
    120         const Int_t idx = pix.GetPixId();
     115    for (Int_t idx=0; idx<entries; idx++)
     116    {
     117        const MSignalPix &pix = evt[idx];
     118
    121119        const Float_t noise = cam[idx].GetRms();
    122120
     
    145143// FIXME: Should the check noise<=0 be replaced by MBadPixels?
    146144//
    147 void MCameraData::CalcCleaningLevel2(const MCerPhotEvt &evt, const MPedPhotCam &cam,
     145void MCameraData::CalcCleaningLevel2(const MSignalCam &evt, const MPedPhotCam &cam,
    148146                                     const MGeomCam &geom)
    149147{
     
    164162    // calculate cleaning levels
    165163    const Int_t entries = evt.GetNumPixels();
    166     for (Int_t i=0; i<entries; i++)
    167     {
    168         const MCerPhotPix &pix = evt[i];
    169 
    170         const Int_t   idx   = pix.GetPixId();
     164    for (Int_t idx=0; idx<entries; idx++)
     165    {
     166        const MSignalPix &pix = evt[idx];
     167
    171168        const Float_t noise = cam[idx].GetRms();
    172169
     
    189186
    190187
    191 void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, const MSigmabar &sgb,
     188void MCameraData::CalcCleaningLevel(const MSignalCam &evt, const MSigmabar &sgb,
    192189                                    const MGeomCam &geom)
    193190{
     
    195192}
    196193
    197 void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, Double_t noise,
     194void MCameraData::CalcCleaningLevel(const MSignalCam &evt, Double_t noise,
    198195                                    const MGeomCam &geom)
    199196{
     
    213210    // calculate cleaning levels
    214211    const Int_t entries = evt.GetNumPixels();
    215     for (Int_t i=0; i<entries; i++)
    216     {
    217         const MCerPhotPix &pix = evt[i];
    218 
    219         const Int_t idx = pix.GetPixId();
     212    for (Int_t idx=0; idx<entries; idx++)
     213    {
     214        const MSignalPix &pix = evt[idx];
    220215
    221216        //
     
    237232// FIXME: Should the check noise<=0 be replaced by MBadPixels?
    238233//
    239 void MCameraData::CalcCleaningLevelDemocratic(const MCerPhotEvt &evt, const MPedPhotCam &cam,
     234void MCameraData::CalcCleaningLevelDemocratic(const MSignalCam &evt, const MPedPhotCam &cam,
    240235                                              const MGeomCam &geom)
    241236{
     
    256251    // calculate cleaning levels
    257252    const Int_t entries = evt.GetNumPixels();
    258     for (Int_t i=0; i<entries; i++)
    259     {
    260         const MCerPhotPix &pix = evt[i];
    261 
    262         const Int_t idx     = pix.GetPixId();
     253    for (Int_t idx=0; idx<entries; idx++)
     254    {
     255        const MSignalPix &pix = evt[idx];
     256
    263257        const Float_t noise = cam[idx].GetRms();
    264258
     
    286280// FIXME: Should the check noise<=0 be replaced by MBadPixels?
    287281//
    288 void MCameraData::CalcCleaningProbability(const MCerPhotEvt &evt, const MPedPhotCam &pcam,
    289                                           const MGeomCam &geom,   const MArrivalTime *tcam)
     282void MCameraData::CalcCleaningProbability(const MSignalCam &evt, const MPedPhotCam &pcam,
     283                                          const MGeomCam &geom)
    290284{
    291285    const Int_t n = geom.GetNumPixels();
     
    307301    // Find pixel with max signal
    308302    Int_t maxidx = 0;
    309     if (tcam)
    310     {
    311         // Find pixel enty with maximum signal
    312         for (Int_t i=0; i<entries; i++)
    313         {
    314             const Double_t s0 = evt[i].GetNumPhotons()      * geom.GetPixRatio(i);
    315             const Double_t s1 = evt[maxidx].GetNumPhotons() * geom.GetPixRatio(maxidx);
    316             if (s0>s1)
    317                 maxidx = i;
    318         }
    319 
    320         // Get software index of pixel
    321         maxidx = evt[maxidx].GetPixId();
    322     }
    323 
    324     const Double_t timemean = tcam ? (*tcam)[maxidx] : 0;
     303
     304    // Find pixel entry with maximum signal
     305    for (Int_t i=0; i<entries; i++)
     306    {
     307        const Double_t s0 = evt[i].GetNumPhotons()      * geom.GetPixRatio(i);
     308        const Double_t s1 = evt[maxidx].GetNumPhotons() * geom.GetPixRatio(maxidx);
     309        if (s0>s1)
     310            maxidx = i;
     311    }
     312
     313    const Double_t timemean = evt[maxidx].GetArrivalTime();
    325314    const Double_t timerms  = 0.75; //[slices] rms time spread around highest pixel
    326315
    327316    // calculate cleaning levels
    328     for (Int_t i=0; i<entries; i++)
    329     {
    330         const MCerPhotPix &spix = evt[i];
    331 
    332         const Int_t   idx = spix.GetPixId();
     317    for (Int_t idx=0; idx<entries; idx++)
     318    {
     319        const MSignalPix &spix = evt[idx];
     320
    333321        const Float_t rms = pcam[idx].GetRms();
    334322        if (rms<=0) // fData[idx]=0, fValidity[idx]=0
     
    342330
    343331        const Double_t signal  = spix.GetNumPhotons() * geom.GetPixRatio(idx) * ratio / rms;
    344         const Double_t time    = tcam ? (*tcam)[idx] : 1;
     332        const Double_t time    = evt[idx].GetArrivalTime();
    345333
    346334        // if signal<0 the probability is equal 0
     
    377365// The level is the absolute number of photons times the area-ratio.
    378366//
    379 void MCameraData::CalcCleaningAbsolute(const MCerPhotEvt &evt, const MGeomCam &geom)
     367void MCameraData::CalcCleaningAbsolute(const MSignalCam &evt, const MGeomCam &geom)
    380368{
    381369    const Int_t n = geom.GetNumPixels();
     
    391379
    392380    // calculate cleaning levels
    393     for (Int_t i=0; i<entries; i++)
    394     {
    395         const MCerPhotPix &spix = evt[i];
    396 
    397         const Int_t idx = spix.GetPixId();
     381    for (Int_t idx=0; idx<entries; idx++)
     382    {
     383        const MSignalPix &spix = evt[idx];
    398384
    399385        // Set probability
  • trunk/MagicSoft/Mars/manalysis/MCameraData.h

    r6569 r6855  
    1717class MGeomCam;
    1818class MSigmabar;
    19 class MCerPhotEvt;
     19class MSignalCam;
    2020class MPedPhotCam;
    21 class MArrivalTime;
    2221
    2322class MCameraData : public MParContainer, public MCamEvent
     
    3332    UInt_t GetNumPixels() const { return fData.GetSize(); }
    3433
    35     void CalcCleaningLevel(const MCerPhotEvt &evt, const MPedPhotCam &fCam,
     34    void CalcCleaningLevel(const MSignalCam &evt, const MPedPhotCam &fCam,
    3635                           const MGeomCam &geom);
    37     void CalcCleaningLevel(const MCerPhotEvt &evt, const MSigmabar &sgb,
     36    void CalcCleaningLevel(const MSignalCam &evt, const MSigmabar &sgb,
    3837                           const MGeomCam &geom);
    39     void CalcCleaningLevel(const MCerPhotEvt &evt, Double_t noise,
     38    void CalcCleaningLevel(const MSignalCam &evt, Double_t noise,
    4039                           const MGeomCam &geom);
    41     void CalcCleaningLevel2(const MCerPhotEvt &evt, const MPedPhotCam &fCam,
     40    void CalcCleaningLevel2(const MSignalCam &evt, const MPedPhotCam &fCam,
    4241                            const MGeomCam &geom);
    43     void CalcCleaningLevelDemocratic(const MCerPhotEvt &evt, const MPedPhotCam &cam,
     42    void CalcCleaningLevelDemocratic(const MSignalCam &evt, const MPedPhotCam &cam,
    4443                                     const MGeomCam &geom);
    45     void CalcCleaningProbability(const MCerPhotEvt &evt, const MPedPhotCam &pcam,
    46                                  const MGeomCam &geom,   const MArrivalTime *tcam);
    47     void CalcCleaningAbsolute(const MCerPhotEvt &evt, const MGeomCam &geom);
     44    void CalcCleaningProbability(const MSignalCam &evt, const MPedPhotCam &pcam,
     45                                 const MGeomCam &geom);
     46    void CalcCleaningAbsolute(const MSignalCam &evt, const MGeomCam &geom);
    4847
    4948    const TArrayD &GetData() const { return fData; }
  • trunk/MagicSoft/Mars/manalysis/MSupercutsCalc.cc

    r3140 r6855  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //   MSupercutsCalc                                                     //
    28 //                                                                         //
    29 //   this class calculates the hadronness for the supercuts                //
    30 //   the parameters of the supercuts are taken                             //
    31 //                  from the container MSupercuts                       //
    32 //                                                                         //
    33 //                                                                         //
     26//
     27//   MSupercutsCalc
     28//
     29//   this class calculates the hadronness for the supercuts
     30//   the parameters of the supercuts are taken
     31//                  from the container MSupercuts
     32//
    3433/////////////////////////////////////////////////////////////////////////////
    3534#include "MSupercutsCalc.h"
     
    4645#include "MNewImagePar.h"
    4746#include "MMcEvt.hxx"
    48 #include "MCerPhotEvt.h"
    4947#include "MGeomCam.h"
    5048#include "MHadronness.h"
  • trunk/MagicSoft/Mars/manalysis/Makefile

    r6848 r6855  
    3636           MCompProbCalc.cc \
    3737           MMultiDimDistCalc.cc \
    38            MCerPhotPix.cc \
    39            MCerPhotEvt.cc \
    40            MCerPhotAnal.cc \
    41            MCerPhotAnal2.cc \
    42            MCerPhotCalc.cc \
    4338           MEventRate.cc \
    4439           MEventRateCalc.cc \
  • trunk/MagicSoft/Mars/mars.cc

    r2531 r6855  
    66#include "MLogManip.h"
    77
    8 #include "MMars.h"
     8#include "MCameraDisplay.h"
    99#include "MArgs.h"
    1010#include "MArray.h"
     
    133133    // start the main window
    134134    //
    135     new MMars;
     135    new MCameraDisplay;
    136136
    137137    //
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc

    r6845 r6855  
    3434//   This task takes the integrated charge from MExtractedSignal and applies
    3535//   the calibration constants from MCalibrationCam to convert the summed FADC
    36 //   slices into photons. The number of photons obtained is stored in MCerPhotEvt.
     36//   slices into photons. The number of photons obtained is stored in MSignalCam.
    3737//   Optionally, the calibration of pedestals from an MPedestalCam container into
    3838//   an MPedPhotCam container can be chosen with the member functions
     
    8989//   Output Containers:
    9090//    [MPedPhotCam]
    91 //    [MCerPhotEvt]
     91//    [MSignalCam]
    9292//
    9393// See also: MJCalibration, MJPedestal, MJExtractSignal, MJExtractCalibTest
     
    129129#include "MBadPixelsPix.h"
    130130
    131 #include "MCerPhotEvt.h"
     131#include "MSignalCam.h"
    132132
    133133ClassImp(MCalibrateData);
     
    194194//
    195195//  - MPedPhotCam
    196 //  - MCerPhotEvt
     196//  - MSignalCam
    197197//
    198198Int_t MCalibrateData::PreProcess(MParList *pList)
     
    218218        }
    219219
    220         fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj(AddSerialNumber("MCerPhotEvt"));
     220        fCerPhotEvt = (MSignalCam*)pList->FindCreateObj(AddSerialNumber("MSignalCam"));
    221221        if (!fCerPhotEvt)
    222222            return kFALSE;
     
    657657    const Float_t sqrtslices = TMath::Sqrt(slices);
    658658
     659    Int_t numsatlo=0;
     660    Int_t numsathi=0;
     661
    659662    for (UInt_t pixidx=0; pixidx<npix; pixidx++)
    660663    {
     
    699702            const Float_t nphotErr = TMath::Sqrt(TMath::Abs(nphot)) * fCalibFFactors[pixidx];
    700703           
    701             MCerPhotPix *cpix = fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr);
     704            fCerPhotEvt->AddPixel(pixidx, nphot, nphotErr);
    702705
    703706            if (sig.GetNumHiGainSaturated() > 0)
    704                 cpix->SetPixelHGSaturated();
     707                numsathi++;
    705708
    706709            if (sig.GetNumLoGainSaturated() > 0)
    707               cpix->SetPixelSaturated();
     710                numsatlo++;
    708711        } /* if (data) */
    709712     
     
    735738    if (data)
    736739    {
    737         fCerPhotEvt->FixSize();
     740        fCerPhotEvt->SetNumPixelsSaturated(numsathi, numsatlo);
    738741        fCerPhotEvt->SetReadyToSave();
    739742    }
  • trunk/MagicSoft/Mars/mcalib/MCalibrateData.h

    r6330 r6855  
    22#define MARS_MCalibrateData
    33
    4 /////////////////////////////////////////////////////////////////////////////
    5 //                                                                         //
    6 // MCalibrateData                                                          //
    7 //                                                                         //
    8 // Integrates the desired ADC time slices of one pixel and apply           //
    9 // calibration constants                                                   //
    10 //                                                                         //
    11 // Differences between MCalibrateData and MCalibrate :                     //
    12 // in MCalibrateData                                                       //
    13 // - in ReInit the MPedPhot container is filled using                      //
    14 //      - the pedstals/slice from MPedestalCam                             //
    15 //      - the number of used FADC slices from MExtractedSignalCam          //
    16 //      - the photon/ADC conversion factor from MCalibrationCam            //
    17 //                                                                         //
    18 /////////////////////////////////////////////////////////////////////////////
    194#ifndef MARS_MTask
    205#include "MTask.h"
     
    3318
    3419class MPedPhotCam;
    35 class MCerPhotEvt;
     20class MSignalCam;
    3621class MCalibConstCam;
     22
    3723class MCalibrateData : public MTask
    3824{
     
    5036  MCalibrationQECam     *fQEs;           //! Quantum efficiencies
    5137  MExtractedSignalCam   *fSignals;       //! Integrated charge in FADCs counts
    52   MCerPhotEvt           *fCerPhotEvt;    //! Cerenkov Photon Event used for calculation
     38  MSignalCam            *fCerPhotEvt;    //! Cerenkov Photon Event used for calculation
    5339  MCalibConstCam        *fCalibConstCam; //! Temporary calib consts storage
    5440 
  • trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.cc

    r6038 r6855  
    2929//   This task takes the extracted arrival times from MArrivalTimeCam for each 
    3030//   pixel and applies the offset calibrated in MCalibrationRelTimeCam
    31 //   The calibrated arrival time and its error gets stored in MCerPhotEvt.
     31//   The calibrated arrival time and its error gets stored in MSignalCam.
    3232//
    3333//   Input Containers:
     
    3636//
    3737//   Output Containers:
    38 //    MArrivalTime
     38//    MSignalCam
    3939//
    4040//////////////////////////////////////////////////////////////////////////////
     
    5858#include "MBadPixelsPix.h"
    5959
    60 #include "MArrivalTime.h"
     60#include "MSignalCam.h"
     61#include "MSignalPix.h"
    6162
    6263ClassImp(MCalibrateRelTimes);
     
    112113
    113114
    114     fArrivalTime = (MArrivalTime*)pList->FindCreateObj(AddSerialNumber("MArrivalTime"));
     115    fArrivalTime = (MSignalCam*)pList->FindCreateObj(AddSerialNumber("MSignalCam"));
    115116    if (!fArrivalTime)
    116       {
    117         *fLog << err << AddSerialNumber("MArrivalTime") << ": Cannot create ... aborting." << endl;
    118117        return kFALSE;
    119       }
    120118   
    121119    return kTRUE;
    122120}
    123121
    124 // --------------------------------------------------------------------------
    125 //
    126 // Check for validity of the selected calibration method, switch to a
    127 // different one in case of need
    128 //
    129 Bool_t MCalibrateRelTimes::ReInit(MParList *pList)
    130 {
    131   return kTRUE;
    132 }
    133122// --------------------------------------------------------------------------
    134123//
     
    142131     {
    143132     // FIXME: MArrivalTime must be of variable size -
    144      //        like MCerPhotEvt - because we must be able
     133     //        like MSignalCam - because we must be able
    145134     //        to reduce size by zero supression
    146135     //        For the moment this check could be done in ReInit...
     
    172161        const Float_t time = signal - offset;
    173162
    174         fArrivalTime->SetTime(pixidx, time);
     163        (*fArrivalTime)[pixidx].SetArrivalTime(time);
    175164
    176165    } /* for (UInt_t pixidx=0; pixidx<npix; pixidx++) */
  • trunk/MagicSoft/Mars/mcalib/MCalibrateRelTimes.h

    r3752 r6855  
    1818class MCalibrationRelTimeCam;
    1919class MArrivalTimeCam;
    20 class MArrivalTime;
     20class MSignalCam;
     21
    2122class MCalibrateRelTimes : public MTask
    2223{
     
    2627    MBadPixelsCam          *fBadPixels;    // Bad Pixels information
    2728    MArrivalTimeCam        *fSignals;      // Extracted Arrival Time
    28     MArrivalTime           *fArrivalTime;  // Calibrated arrival times
     29    MSignalCam             *fArrivalTime;  // Calibrated arrival times
    2930
    3031    Int_t PreProcess(MParList *pList);
    31     Bool_t ReInit(MParList *pList);
    3232    Int_t Process();
    3333
  • trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc

    r6828 r6855  
    489489      fBlindCam = (MCalibrationBlindCam*)pList->FindObject(AddSerialNumber("MCalibrationBlindCam"));
    490490      if (!fBlindCam)
    491         {
    492           *fLog << endl;
    493           *fLog << warn << GetDescriptor()
    494                 << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
    495         }
     491        *fLog << warn << GetDescriptor()
     492              << ": No MCalibrationBlindCam found... no Blind Pixel method! " << endl;
    496493    }
    497494 
    498495  fHBlindCam = (MHCalibrationChargeBlindCam*)pList->FindObject(AddSerialNumber("MHCalibrationChargeBlindCam")); 
    499496  if (!fHBlindCam)
    500     {
    501       *fLog << endl;
    502       *fLog << warn << GetDescriptor()
    503             << ": No MHCalibrationChargeBlindCam found... no Blind Pixel method! " << endl;
    504     }
     497    *fLog << warn << GetDescriptor()
     498          << ": No MHCalibrationChargeBlindCam found... no Blind Pixel method! " << endl;
    505499
    506500  fIntensBad = (MBadPixelsIntensityCam*)pList->FindObject(AddSerialNumber("MBadPixelsIntensityCam"));
     
    522516  fPINDiode = (MCalibrationChargePINDiode*)pList->FindObject("MCalibrationChargePINDiode");
    523517  if (!fPINDiode)
    524     {
    525       *fLog << endl;
    526       *fLog << warn << GetDescriptor()
    527             << ": MCalibrationChargePINDiode not found... no PIN Diode method! " << endl;
    528     }
     518    *fLog << warn << GetDescriptor()
     519          << ": No MCalibrationChargePINDiode found... no PIN Diode method! " << endl;
    529520 
    530521  MCalibrationQECam     *qecam     = fIntensQE     
     
    18651856    ? (MCalibrationChargeCam*)fIntensCam->GetCam()  : fCam;
    18661857
     1858  if (!blindcam)
     1859    return;
     1860
    18671861  //
    18681862  // Set the results in the MCalibrationChargeCam
     
    19561950  MBadPixelsCam         *badcam    = fIntensBad
    19571951    ? (MBadPixelsCam*)        fIntensBad->GetCam()  : fBadPixels;
     1952
     1953  if (!fPINDiode)
     1954    return;
     1955
    19581956  //
    19591957  //  With the knowledge of the overall photon flux, calculate the
  • trunk/MagicSoft/Mars/mhft/MGeomCamMagicEnhance.cc

    r5691 r6855  
    163163
    164164    // Copy result into output MCerPhotEvt
    165     fEvtOut->Reset();
     165    fEvtOut->InitSize(res.GetSize());
    166166
    167167    for (UInt_t i=0; i<res.GetSize(); i++)
    168168        fEvtOut->AddPixel(i, res[i], 0);
    169169
    170     fEvtOut->FixSize();
     170    //fEvtOut->FixSize();
    171171    fEvtOut->SetReadyToSave();
    172172
  • trunk/MagicSoft/Mars/mhft/MHexagonalFTCalc.cc

    r5691 r6855  
    172172    fOffset.Reset();
    173173
    174     fMap.Set(lim);
    175     for (int i=0; i<lim; i++)
    176         fMap[i]=-1;
     174    //fMap.Set(lim);
     175    //for (int i=0; i<lim; i++)
     176    //    fMap[i]=-1;
    177177
    178178    const Double_t dx = (*geom)[2].GetX(); // -(*geom)[0].GetX()
     
    190190        if ((*geom)[idx].GetAidx()==0)
    191191        {
    192             fMap[idx]  = i;
     192            //fMap[idx]  = i;
    193193            fOffset[i] = 1;
    194194        }
     
    254254    MArrayD re(lim);
    255255
    256     MCerPhotPix *pix=0;
    257 
    258     MCerPhotEvtIter Next(fEvtIn, kFALSE);
    259 
     256    //    MCerPhotPix *pix=0;
     257    //    MCerPhotEvtIter Next(fEvtIn, kFALSE);
     258    //    while ((pix = (MCerPhotPix*)Next()))
    260259    // Copy data from MCerPhotEvt into array
    261     while ((pix = (MCerPhotPix*)Next()))
    262     {
    263         const Int_t idx = pix->GetPixId();
    264         if (fMap[idx]>=0)
    265             re[fMap[idx]] = pix->GetNumPhotons();
     260    const UInt_t npix = fEvtIn->GetNumPixels();
     261    for (UInt_t idx=0; idx<npix; idx++)
     262    {
     263        //const Int_t idx = pix->GetPixId();
     264        //if (fMap[idx]>=0)
     265        re[idx] = (*fEvtIn)[idx].GetNumPhotons();
    266266    }
    267267
     
    307307        return kTRUE;
    308308
    309     fEvtOut->Reset();
     309    fEvtOut->InitSize(lim); // necessary?
    310310    for (int i=0; i<lim; i++)
    311311    {
    312         const Int_t map = fMap[i];
    313         if (map>=0)
    314             fEvtOut->AddPixel(i, out[map]);
    315     }
    316     fEvtOut->FixSize();
     312        //const Int_t map = fMap[i];
     313        //if (map>=0)
     314        fEvtOut->AddPixel(i, out[i]);
     315    }
     316    //fEvtOut->FixSize();
    317317    fEvtOut->SetReadyToSave();
    318318
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r5068 r6855  
    1818#pragma link C++ class MHAlphaEnergyTheta+;
    1919#pragma link C++ class MHGamma+;
    20 #pragma link C++ class MHSigmaTheta;
     20//#pragma link C++ class MHSigmaTheta;
    2121#pragma link C++ class MHThetabarTime+;
    2222#pragma link C++ class MHThetabarTheta+;
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r6513 r6855  
    3333// =====
    3434//
    35 // To plot sqrt(variance) instead of the rms use:
    36 //    MHCamEvent::SetBit(MHCamera::kSqrtVariance);
    37 //  or
    38 //    MHCamEvent::EnableSqrtVariance()
    39 //
    4035// To count how often a certain pixel is above or below a threshold do:
    4136//    MHCamEvent::SetThreshold(5.5);  // Default=LowerBound
     
    121116    if (fSum)
    122117        delete fSum;
    123 }
    124 
    125 // --------------------------------------------------------------------------
    126 //
    127 // use this to display the variance instead of the rms.
    128 //
    129 void MHCamEvent::EnableSqrtVariance(Bool_t b)
    130 {
    131     b ? SetBit(MHCamera::kSqrtVariance) : ResetBit(MHCamera::kSqrtVariance);
    132118}
    133119
     
    173159        fSum->SetYTitle("a.u.");
    174160    fSum->SetBit(MHCamera::kProfile);
    175     if (TestBit(MHCamera::kSqrtVariance))
    176         fSum->SetBit(MHCamera::kSqrtVariance);
    177161
    178162    fSum->SetXTitle("Pixel Idx");
     
    261245{
    262246    TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
     247    const Int_t col = pad->GetFillColor();
    263248    pad->SetBorderMode(0);
    264249
    265250    AppendPad();
    266251
    267     TString name = Form("%s_5", pad->GetName());
    268     TPad *p = new TPad(name,name,6./8,0.25,0.99,0.5,pad->GetFillColor(),0,0);
    269     p->SetNumber(5);
    270     p->Draw();
    271 
    272     name = Form("%s_6", pad->GetName());
    273     p = new TPad(name,name,6./8,0.01,0.99,0.25,pad->GetFillColor(),0,0);
    274     p->SetNumber(6);
    275     p->Draw();
    276 
    277     pad->Divide(2,2);
    278 
    279     pad->cd(1);
    280     gPad->SetBorderMode(0);
    281     gPad->SetPad(0.01, 0.5, 0.66, 0.99);
     252    TString name = Form("%s_1", pad->GetName());
     253    TPad *p = new TPad(name,name,0.005, 0.5, 0.66, 0.995,col,0,0);
     254    p->SetNumber(1);
     255    p->Draw();
     256    p->cd();
    282257    fSum->Draw("EPhist");
    283258
    284     pad->cd(2);
    285     gPad->SetBorderMode(0);
    286     gPad->SetPad(0.66, 0.5, 0.99, 0.99);
     259    pad->cd();
     260    name = Form("%s_2", pad->GetName());
     261    p = new TPad(name,name,0.66, 0.5, 0.995, 0.995,col,0,0);
     262    p->SetNumber(2);
     263    p->Draw();
     264    p->cd();
    287265    TH1 *h = fSum->Projection(Form("%s;proj", fName.Data()), 50);
    288266    h->SetTitle("Projection");
     
    290268    h->Draw();
    291269
    292     pad->cd(3);
    293     gPad->SetPad(0.01, 0.01, 3./8, 0.5);
    294     gPad->SetBorderMode(0);
     270    pad->cd();
     271    name = Form("%s_3", pad->GetName());
     272    p = new TPad(name,name,0.005, 0.005, 3./8, 0.5,col,0,0);
     273    p->SetNumber(3);
     274    p->Draw();
     275    p->cd();
    295276    fSum->Draw();
    296277
    297     pad->cd(4);
    298     gPad->SetPad(3./8, 0.01, 6./8, 0.5);
    299     gPad->SetBorderMode(0);
     278    pad->cd();
     279    name = Form("%s_4", pad->GetName());
     280    p = new TPad(name,name,3./8, 0.005, 6./8-0.005, 0.5,col,0,0);
     281    p->SetNumber(4);
     282    p->Draw();
     283    p->cd();
    300284
    301285    MHCamera *cam = new MHCamera(*fSum->GetGeometry());
    302286    cam->SetName(Form("%s;err", fName.Data()));
    303     cam->SetTitle(fSum->TestBit(MHCamera::kSqrtVariance)?"Sqrt(Variance)":"Root Mean Squared (rms)");
     287    cam->SetTitle("Sqrt(Variance)");
    304288    cam->SetYTitle(fSum->GetYaxis()->GetTitle());
    305289    cam->SetCamContent(*fSum, 1);
     
    307291    cam->Draw();
    308292
    309     pad->cd(5);
     293    pad->cd();
     294    name = Form("%s_5", pad->GetName());
     295    p = new TPad(name,name,6./8,0.25,0.995,0.5,col,0,0);
     296    p->SetNumber(5);
     297    p->Draw();
     298    p->cd();
    310299    h = (TH1*)fSum->RadialProfile(Form("%s;rad", fName.Data()), 20);
    311300    h->SetTitle("Radial Profile");
     
    313302    h->Draw();
    314303
    315     pad->cd(6);
     304    pad->cd();
     305    name = Form("%s_6", pad->GetName());
     306    p = new TPad(name,name,6./8,0.005,0.995,0.25,col,0,0);
     307    p->SetNumber(6);
     308    p->Draw();
     309    p->cd();
    316310    h = (TH1*)fSum->AzimuthProfile(Form("%s;az", fName.Data()), 30);
    317311    h->SetTitle("Azimuth Profile");
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.h

    r6276 r6855  
    1515    static const TString gsDefTitle;
    1616
     17protected:
    1718    MHCamera  *fSum;       // storing the sum
    1819    MCamEvent *fEvt;       //! the current event
     
    5051
    5152    void SetThreshold(Float_t f, Char_t direction=kIsLowerBound) { fThreshold = f; fUseThreshold=direction; }
    52     void EnableSqrtVariance(Bool_t b=kTRUE);
    5353
    5454    ClassDef(MHCamEvent, 1) // Histogram to sum camera events
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r6457 r6855  
    164164    fUsed.Set(geom.GetNumPixels());
    165165    for (Int_t i=0; i<fNcells-2; i++)
    166       ResetUsed(i);
     166        ResetUsed(i);
     167
     168    fBinEntries.Set(geom.GetNumPixels()+2);
     169    fBinEntries.Reset();
    167170}
    168171
     
    213216   const Int_t bin = (Int_t)x+1;
    214217   AddBinContent(bin);
     218   fBinEntries[bin]++;
    215219   if (fSumw2.fN)
    216220       fSumw2.fArray[bin]++;
     
    249253   const Int_t bin = (Int_t)x+1;
    250254   AddBinContent(bin, w);
     255   fBinEntries[bin]++;
    251256   if (fSumw2.fN)
    252257       fSumw2.fArray[bin] += w*w;
     
    319324        if ((all || IsUsed(i)) && MatchSector(i, sector, aidx))
    320325        {
    321             mean += fArray[i+1];
     326            if (TestBit(kProfile) && fBinEntries[i+1]==0)
     327                continue;
     328
     329            mean += TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1];
    322330            n++;
    323331        }
    324332    }
    325333
    326     return n==0 ? 0 : Profile(mean/n);
     334    return n==0 ? 0 : mean/n;
    327335}
    328336
     
    346354        if ((all || IsUsed(i)) && MatchSector(i, sector, aidx))
    347355        {
    348             sum += fArray[i+1];
    349             sq  += fArray[i+1]*fArray[i+1];
     356            if (TestBit(kProfile) && fBinEntries[i+1]==0)
     357                continue;
     358
     359            const Double_t val = TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1];
     360
     361            sum += val;
     362            sq  += val*val;
    350363            n++;
    351364        }
     
    358371    sq  /= n;
    359372
    360     return Profile(TMath::Sqrt(sq-sum*sum));
     373    return TMath::Sqrt(sq-sum*sum);
    361374}
    362375
     
    377390    Double_t minimum=FLT_MAX;
    378391
    379     for (Int_t idx=0; idx<fNcells-2; idx++)
    380         if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]<minimum)
    381             minimum = fArray[idx+1];
    382 
    383     return Profile(minimum);
     392    for (Int_t i=0; i<fNcells-2; i++)
     393    {
     394        if (TestBit(kProfile) && fBinEntries[i+1]==0)
     395            continue;
     396
     397        const Double_t val = TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1];
     398        if (MatchSector(i, sector, aidx) && (all || IsUsed(i)) && val<minimum)
     399            minimum = val;
     400    }
     401
     402    return minimum;
    384403}
    385404
     
    399418
    400419    Double_t maximum=-FLT_MAX;
    401     for (Int_t idx=0; idx<fNcells-2; idx++)
    402         if (MatchSector(idx, sector, aidx) && (all || IsUsed(idx)) && fArray[idx+1]>maximum)
    403             maximum = fArray[idx+1];
    404 
    405     return Profile(maximum);
     420    for (Int_t i=0; i<fNcells-2; i++)
     421    {
     422        if (TestBit(kProfile) && fBinEntries[i+1]==0)
     423            continue;
     424
     425        const Double_t val = TestBit(kProfile) ? fArray[i+1]/fBinEntries[i+1] : fArray[i+1];
     426        if (MatchSector(i, sector, aidx) && (all || IsUsed(i)) && val>maximum)
     427            maximum = val;
     428    }
     429
     430    return maximum;
    406431}
    407432
     
    458483        // resized in paint to keep the correct aspect ratio
    459484        //
    460         pad->Divide(1, 1, 0, 0, col);
     485        // The margin != 0 is a workaround for a problem in root 4.02/00
     486        pad->Divide(1, 1, 1e-10, 1e-10, col);
    461487        pad->cd(1);
    462488        gPad->SetBorderMode(0);
     
    11251151        Double_t val=0;
    11261152        if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/)
     1153        {
    11271154            SetUsed(idx);
    1128 
    1129         Fill(idx, val); // FIXME: Slow!
     1155            Fill(idx, val); // FIXME: Slow!
     1156        }
    11301157    }
    11311158    fEntries++;
     
    11531180}
    11541181
     1182Stat_t MHCamera::GetBinContent(Int_t bin) const
     1183{
     1184    if (fBuffer) ((TProfile*)this)->BufferEmpty();
     1185    if (bin < 0) bin = 0;
     1186    if (bin >= fNcells) bin = fNcells-1;
     1187    if (!fArray) return 0;
     1188
     1189    if (!TestBit(kProfile))
     1190        return Stat_t (fArray[bin]);
     1191
     1192    if (fBinEntries.fArray[bin] == 0) return 0;
     1193    return fArray[bin]/fBinEntries.fArray[bin];
     1194}
     1195
    11551196Stat_t MHCamera::GetBinError(Int_t bin) const
    11561197{
     1198    if (!TestBit(kProfile))
     1199        return TH1D::GetBinError(bin);
     1200
     1201    const UInt_t n = (UInt_t)fBinEntries[bin];
     1202
     1203    if (n==0)
     1204        return 0;
     1205
     1206    const Double_t sqr = fSumw2.fArray[bin] / n;
     1207    const Double_t val = fArray[bin]        / n;
     1208
     1209    return sqr>val*val ? TMath::Sqrt(sqr - val*val) / n : 0;
     1210
     1211    /*
    11571212    Double_t rc = 0;
    11581213    if (TestBit(kSqrtVariance) && GetEntries()>0) // error on the mean
     
    11651220        rc = TH1D::GetBinError(bin);
    11661221
    1167     return Profile(rc);
     1222    return Profile(rc);*/
    11681223}
    11691224
     
    12661321    {
    12671322        Double_t val=threshold;
    1268         if (event.GetPixelContent(val, idx, *fGeomCam, type)/* && !IsUsed(idx)*/)
     1323        const Bool_t rc = event.GetPixelContent(val, idx, *fGeomCam, type);
     1324        if (rc)
     1325            SetUsed(idx);
     1326
     1327        const Bool_t cond =
     1328            ( isabove && val>threshold) ||
     1329            (!isabove && val<threshold);
     1330
     1331        Fill(idx, rc && cond ? 1 : 0);
     1332    }
     1333    fEntries++;
     1334}
     1335
     1336// ------------------------------------------------------------------------
     1337//
     1338// Call this function to add a MCamEvent on top of the present contents.
     1339// - the contents of the pixels in event are added to each pixel
     1340//   if the pixel of thresevt<threshold (in case isabove is set
     1341//   to kTRUE == default)
     1342// - the contents of the pixels in event are  added to each pixel
     1343//   if the pixel of thresevt<threshold (in case isabove is set
     1344//   to kFALSE)
     1345//
     1346// in unused pixel is not counted if it didn't fullfill the condition.
     1347//
     1348void MHCamera::CntCamContent(const MCamEvent &event, Int_t type1, const MCamEvent &thresevt, Int_t type2, Double_t threshold, Bool_t isabove)
     1349{
     1350    if (fNcells<=1 || IsFreezed())
     1351        return;
     1352
     1353    // FIXME: Security check missing!
     1354    for (Int_t idx=0; idx<fNcells-2; idx++)
     1355    {
     1356        Double_t th=0;
     1357        if (!thresevt.GetPixelContent(th, idx, *fGeomCam, type2))
     1358            continue;
     1359
     1360        if ((isabove && th>threshold) || (!isabove && th<threshold))
     1361            continue;
     1362
     1363        Double_t val=th;
     1364        if (event.GetPixelContent(val, idx, *fGeomCam, type1))
    12691365        {
    12701366            SetUsed(idx);
    1271 
    1272             if (isabove && val>threshold)
    1273                 Fill(idx);
    1274             if (!isabove && val<threshold)
    1275                 Fill(idx);
     1367            Fill(idx, val);
    12761368        }
    12771369    }
     
    16721764        return;
    16731765
    1674     gLog << all << GetTitle() << " <" << GetName() << ">" << endl;
     1766    gLog << all << GetTitle() << " <" << GetName() << ">" << dec << endl;
    16751767    gLog << "Software Pixel Idx: " << idx << endl;
    16761768    gLog << "Hardware Pixel Id:  " << idx+1 << endl;
     
    16781770    if (GetBinError(idx+1)>0)
    16791771        gLog << " +/- " << GetBinError(idx+1);
    1680     gLog << "  <" << (IsUsed(idx)?"on":"off") << ">" << endl;
     1772    gLog << "  <" << (IsUsed(idx)?"on":"off") << ">  n=" << fBinEntries[idx+1] << endl;
    16811773
    16821774    if (fNotify && fNotify->GetSize()>0)
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r6276 r6855  
    1010#ifndef ROOT_TArrayI
    1111#include <TArrayI.h>
    12 #endif
    13 #ifndef ROOT_TArrayD
    14 #include <TArrayD.h>
    1512#endif
    1613#ifndef ROOT_MArrayD
     
    4037public:
    4138    enum {
    42         kProfile      = BIT(18), // FIXME: When changing change max/min!
    43         kFreezed      = BIT(19),
    44         kNoLegend     = BIT(20),
    45         kSqrtVariance = BIT(21)
     39        kProfile            = BIT(18), // FIXME: When changing change max/min!
     40        kFreezed            = BIT(19),
     41        kNoLegend           = BIT(20)/*,
     42        kSqrtVariance       = BIT(21),
     43        kSinglePixelProfile = BIT(22)*/
    4644    };
    4745private:
    4846    MGeomCam      *fGeomCam;     // pointer to camera geometry (y-axis)
    4947    TArrayC        fUsed;        // array containing flags
     48    TArrayI        fBinEntries;  // number of entries per bin
    5049
    5150    TArrayI        fColors;      //! Color conversion table
     
    5958
    6059    void Init();
    61 
     60/*
    6261    Stat_t Profile(Stat_t val) const
    6362    {
     
    6867        return n>0 ? val/n : val;
    6968    }
    70 
     69  */
    7170    Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog);
    7271
     
    162161    virtual void     CntCamContent(const MCamEvent &evt, TArrayD threshold, Int_t type=0, Bool_t isabove=kTRUE);
    163162    virtual void     CntCamContent(const TArrayD &evt, Double_t threshold, Bool_t ispos=kTRUE);
    164 
    165     Stat_t   GetBinContent(Int_t bin) const { return Profile(TH1D::GetBinContent(bin)); }
     163    virtual void     CntCamContent(const MCamEvent &event, Int_t type1, const MCamEvent &thresevt, Int_t type2, Double_t threshold, Bool_t isabove);
     164
     165    Stat_t   GetBinContent(Int_t bin) const;
    166166    Stat_t   GetBinContent(Int_t binx, Int_t biny) const { return GetBinContent(binx); }
    167167    Stat_t   GetBinContent(Int_t binx, Int_t biny, Int_t binz) const { return GetBinContent(binx); }
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r6569 r6855  
    5959#include "MTaskList.h"
    6060#include "MParList.h"
    61 #include "MCerPhotEvt.h"
     61#include "MSignalCam.h"
    6262#include "MRawEvtHeader.h"
    6363#include "MRawRunHeader.h"
     
    239239        break;
    240240    case kEvtArrTime:
    241         fHist->SetCamContent(*event, 0);
     241        fHist->SetCamContent(*event, 6);
    242242        break;
    243243    case kEvtTrigPix:
  • trunk/MagicSoft/Mars/mhist/MHEvent.h

    r5807 r6855  
    1313class MMcEvt;
    1414class MMcTrig;
    15 class MCerPhotEvt;
     15class MSignalCam;
    1616class MImgCleanStd;
    1717
     
    3434    MMcEvt        *fMcEvt;         //!
    3535    MMcTrig       *fMcTrig;        //!
    36     MCerPhotEvt   *fCerPhotEvt;    //!
     36    MSignalCam    *fCerPhotEvt;    //!
    3737    MImgCleanStd  *fImgCleanStd;   //!
    3838
  • trunk/MagicSoft/Mars/mhist/Makefile

    r5676 r6855  
    4040           MHThetabarTheta.cc \
    4141           MHGamma.cc \
    42            MHSigmaTheta.cc \
    4342           MHSigmaPixel.cc \
    4443           MHSigmabarTheta.cc \
  • 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.