Changeset 1715 for trunk/MagicSoft


Ignore:
Timestamp:
01/19/03 14:52:29 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1714 r1715  
    4646   * mhist/MHStarMap.cc:
    4747     - added a warning output
     48
     49   * mmontecarlo/MMcCollectionAreaCalc.cc:
     50     - added a check for impact=NaN (some MC Files have this)
    4851
    4952
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r1552 r1715  
    1616!
    1717!
    18 !   Author(s): Abelardo Moralejo 7/2002  (moralejo@pd.infn.it)
    19 !
    20 !   Copyright: MAGIC Software Development, 2002
     18!   Author(s): Abelardo Moralejo 7/2002  <mailto:moralejo@pd.infn.it>
     19!   Author(s): Thomas Bretz 2002  <mailto:tbretz@astro.uni-wuerzburg.de>
     20!
     21!   Copyright: MAGIC Software Development, 2002-2003
    2122!
    2223!
     
    2425
    2526//////////////////////////////////////////////////////////////////////////////
    26 //                                                                          //
    27 //   MCerPhotCalc                                                          //
    28 //                                                                          //
    29 //   This is a task which calculates the number of photons from the FADC    //
    30 //   time slices. It weights the each slice according to the numbers in     //
    31 //   the array fWeight (default: all slices added up with weight 1). 
    32 //                                                                          //
    33 //  Input Containers:                                                       //
    34 //   MRawRunHeader, MRawEvtData, MPedestalCam                               //
    35 //                                                                          //
    36 //  Output Containers:                                                      //
    37 //   MCerPhotEvt                                                            //
    38 //                                                                          //
     27//
     28//   MCerPhotCalc
     29//
     30//   This is a task which calculates the number of photons from the FADC
     31//   time slices. It weights the each slice according to the numbers in
     32//   the array fWeight (default: all slices added up with weight 1).
     33//
     34//  Input Containers:
     35//   MRawRunHeader, MRawEvtData, MPedestalCam
     36//
     37//  Output Containers:
     38//   MCerPhotEvt
     39//
    3940//////////////////////////////////////////////////////////////////////////////
    40 
    4141#include "MCerPhotCalc.h"
    4242
     
    103103    fPedestals = (MPedestalCam*)pList->FindCreateObj("MPedestalCam");
    104104    if (!fPedestals)
    105     {
    106         *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
    107         return kFALSE;
    108     }
     105        return kFALSE;
    109106
    110107    fCerPhotEvt = (MCerPhotEvt*)pList->FindCreateObj("MCerPhotEvt");
     
    115112    fSumQuadWeights = 0.;
    116113    for (Int_t i = 0; i < fWeight.GetSize(); i++)
    117       fSumQuadWeights += fWeight[i]*fWeight[i];
     114        fSumQuadWeights += fWeight[i]*fWeight[i];
    118115
    119116    fSumQuadWeights = sqrt(fSumQuadWeights);
     
    171168    MRawEvtPixelIter pixel(fRawEvt);
    172169
    173     TArrayF BinSignal(fWeight.GetSize());
     170    TArrayF binsignal(fWeight.GetSize());
    174171
    175172    while (pixel.Next())
    176       {
    177         const UInt_t pixid = pixel.GetPixelId();
     173    {
     174        const UInt_t pixid = pixel.GetPixelId();
    178175        const MPedestalPix &ped = (*fPedestals)[pixid];
    179176
     
    187184        }
    188185
    189         // Mean pedestal:
    190         Double_t mean = fEnableFix ? ped.GetMean()-0.5 : ped.GetMean();
    191 
    192         Byte_t *ptr = pixel.GetHiGainSamples();
    193 
    194         Float_t nphot = 0.;
    195         Float_t nphoterr = 0.;
    196 
    197         // Calculate pixel signal unless it has all FADC slices empty:
    198 
    199         if (pixel.GetSumHiGainSamples()>0)
    200           {
    201             for(Int_t i = 0; i<fWeight.GetSize(); i++)
    202               {
    203                 BinSignal[i] =  (Float_t) ptr[i] - mean;
    204                 nphot       +=  BinSignal[i] * fWeight[i];
    205               }
    206             nphoterr = ped.GetSigma()* fSumQuadWeights;
    207           }
     186        //
     187        // Mean pedestal:
     188        //
     189        const Double_t mean = fEnableFix ? ped.GetMean()-0.5 : ped.GetMean();
     190
     191        //
     192        // Calculate pixel signal unless it has all FADC slices empty:
     193        //
     194        const Byte_t *ptr = pixel.GetHiGainSamples();
     195
     196        Float_t nphot = 0;
     197        Float_t nphoterr = 0;
     198
     199        if (pixel.GetSumHiGainSamples()>0)
     200        {
     201            for (Int_t i=0; i<fWeight.GetSize(); i++)
     202            {
     203                binsignal[i] =  ptr[i] - mean;
     204                nphot       +=  binsignal[i] * fWeight[i];
     205            }
     206            nphoterr = ped.GetSigma() * fSumQuadWeights;
     207        }
    208208
    209209        fCerPhotEvt->AddPixel(pixid, nphot, nphoterr);
    210210
    211211        // FIXME! Handling of Lo Gains is missing!
    212       }
     212    }
    213213
    214214    fCerPhotEvt->SetReadyToSave();
     
    217217}
    218218
     219// --------------------------------------------------------------------------
    219220//
    220221// Set default values for the number of slices and weights:
    221222//
    222 
    223223void MCerPhotCalc::SetDefaultWeights()
    224224{
    225   const Float_t dummy[15] = {1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,};
    226 
    227   fWeight.Set(15,dummy);
    228   return;
    229 }
    230 
    231 
    232 
    233 
     225    const Float_t dummy[15] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
     226    fWeight.Set(15, dummy);
     227}
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.h

    r1546 r1715  
    1010//                                                                         //
    1111/////////////////////////////////////////////////////////////////////////////
     12#ifndef ROOT_TArrayF
     13#include <TArrayF.h>
     14#endif
    1215
    1316#ifndef MARS_MTask
     
    1518#endif
    1619
    17 #include <TArrayF.h>
    18 
    1920class MRawEvtData;
    2021class MPedestalCam;
    2122class MCerPhotEvt;
    2223class MRawRunHeader;
    23 class TArrayF;
    2424
    2525class MCerPhotCalc : public MTask
     
    4444    Bool_t ReInit(MParList *pList);
    4545
    46     void   SetWeights(TArrayF w) {fWeight.Set(w.GetSize(),w.GetArray());}
     46    // FIXME: The array size should be checked!
     47    void   SetWeights(const TArrayF &w) { fWeight = w; }
    4748
    4849    ClassDef(MCerPhotCalc, 0)   // Task to calculate cerenkov photons from raw data
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.cc

    r1574 r1715  
    158158        return -5.;
    159159
     160    const UInt_t n = geom->GetNumPixels();
     161
    160162    Float_t minval = (*this)[0].GetNumPhotons();
    161163
     
    164166        const MCerPhotPix &pix = (*this)[i];
    165167
     168        const UInt_t id = pix.GetPixId();
     169        if (id>=n)
     170            continue;
     171
    166172        Float_t testval = pix.GetNumPhotons();
    167173
    168174        if (geom)
    169             testval *= geom->GetPixRatio(pix.GetPixId());
     175            testval *= geom->GetPixRatio(id);
    170176
    171177        if (testval < minval)
     
    187193        return 50.;
    188194
     195    const UInt_t n = geom->GetNumPixels();
     196
    189197    Float_t maxval = (*this)[0].GetNumPhotons();
    190198
     
    193201        const MCerPhotPix &pix = (*this)[i];
    194202
     203        const UInt_t id = pix.GetPixId();
     204        if (id>=n)
     205            continue;
     206
    195207        Float_t testval = pix.GetNumPhotons();
    196 
    197208        if (geom)
    198             testval *= geom->GetPixRatio(pix.GetPixId());
     209            testval *= geom->GetPixRatio(id);
    199210
    200211        if (testval > maxval)
     
    322333    return NULL;
    323334}
     335
     336/*
     337// --------------------------------------------------------------------------
     338//
     339// Use this function to sum photons in events together.
     340//
     341Bool_t MCerPhotEvt::AddEvent(const MCerPhotEvt &evt)
     342{
     343    if (evt.fNumPixels<=0)
     344    {
     345        *fLog << "Warning - Event to be added has no pixels." << endl;
     346        return kFALSE;
     347    }
     348    if (fNumPixels<=0)
     349    {
     350        *fLog << "Warning - Event to add pixels to has no pixels." << endl;
     351        return kFALSE;
     352    }
     353
     354    for (UInt_t i=0; i<evt.fNumPixels; i++)
     355    {
     356        const UInt_t id = evt[i].GetPixId();
     357
     358        MCerPhotPix *pix2 = GetPixById(id);
     359        if (!pix2)
     360        {
     361            *fLog << "Error - Pixel#" << dec << id << " does not exist in this event!" << endl;
     362            return kFALSE;
     363        }
     364
     365        pix2->AddNumPhotons(evt[i].GetNumPhotons());
     366    }
     367    return kTRUE;
     368}
     369*/
  • trunk/MagicSoft/Mars/manalysis/MCerPhotEvt.h

    r1574 r1715  
    3030    }
    3131
     32    //Bool_t  AddEvent(const MCerPhotEvt &evt);
    3233
    3334    Bool_t  IsPixelExisting(Int_t id) const;
  • trunk/MagicSoft/Mars/manalysis/MCerPhotPix.h

    r1503 r1715  
    4141    void    Set(Float_t np, Float_t ep) { fPhot = np; fErrPhot = ep; }
    4242
     43    void    AddNumPhotons(Float_t f)    { fPhot += f; }
     44
    4345    void    Print(Option_t *opt = NULL) const;
    4446
  • trunk/MagicSoft/Mars/mbase/MContinue.cc

    r1600 r1715  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 // MContinue                                                               //
    28 //                                                                         //
    29 // Does nothing than return kCONTINUE in the Process-function              //
    30 // (use with filters)                                                      //
    31 //                                                                         //
     26//
     27// MContinue
     28//
     29// Does nothing than return kCONTINUE in the Process-function
     30// (use with filters). For more details see the description of the
     31// constructors.
     32//
    3233/////////////////////////////////////////////////////////////////////////////
    3334#include "MContinue.h"
    3435
     36#include "MLog.h"
     37#include "MLogManip.h"
     38
     39#include "MF.h"
     40#include "MParList.h"
     41#include "MTaskList.h"
     42
    3543ClassImp(MContinue);
    3644
    37 MContinue::MContinue(const char *name, const char *title)
     45// --------------------------------------------------------------------------
     46//
     47// Use this constructor if a rule (see MF for more details) shell be used.
     48// MContinue will create a MF object and use it as a filter for the
     49// instance. The MF-Task is added to the tasklist in front of the MContinue
     50// instance and also automatically deleted, eg.
     51//   MContinue cont("MHillas.fSize<20");
     52//   tasklist.AddToList(&cont);
     53// would skip all events which fullfill "MHillas.fSize<20" from this point
     54// in the tasklist.
     55//
     56MContinue::MContinue(const TString rule, const char *name, const char *title)
    3857{
    3958    fName  = name  ? name  : "MContinue";
    4059    fTitle = title ? title : "Task returning kCONTINUE";
     60
     61    if (rule.IsNull())
     62        return;
     63
     64    SetBit(kIsOwner);
     65
     66    MTask::SetFilter(new MF(rule, TString("MF(")+fName+")"));
    4167}
    4268
     69// --------------------------------------------------------------------------
     70//
     71// Use this if you have a filter. Would be the same as if you would call:
     72//   MContinue cont;
     73//   cont.SetFilter(f);
     74//
    4375MContinue::MContinue(MFilter *f, const char *name, const char *title)
    4476{
     
    4880    SetFilter(f);
    4981}
     82
     83// --------------------------------------------------------------------------
     84//
     85//  Delete the filter if it was created automatically
     86//
     87MContinue::~MContinue()
     88{
     89    if (TestBit(kIsOwner))
     90        delete GetFilter();
     91}
     92
     93// --------------------------------------------------------------------------
     94//
     95//  In case the filter was created automatically, PreProcess tries to find
     96//  the tasklist MTaskList, adds the filter before this instance to the
     97//  tasklist and preprocesses the filter.
     98//
     99Bool_t MContinue::PreProcess(MParList *list)
     100{
     101    if (!TestBit(kIsOwner))
     102        return kTRUE;
     103
     104    MTaskList *tlist = (MTaskList*)list->FindObject("MTaskList");
     105    if (!tlist)
     106    {
     107        *fLog << err << dbginf << "ERROR - Tasklist 'MTaskList' not found... abort." << endl;
     108        return kFALSE;
     109    }
     110
     111    if (!GetFilter())
     112    {
     113        *fLog << err << dbginf << "Unknown fatal Error! (fFilter=NULL?!?)" << endl;
     114        return kFALSE;
     115    }
     116
     117    if (!tlist->AddToListBefore(GetFilter(), this))
     118    {
     119        *fLog << err << dbginf << "ERROR - Adding filter before MContinue... abort." << endl;
     120        return kFALSE;
     121    }
     122
     123    return GetFilter()->CallPreProcess(list);
     124}
     125
  • trunk/MagicSoft/Mars/mbase/MContinue.h

    r1538 r1715  
    2020{
    2121private:
     22    Bool_t PreProcess(MParList *list);
    2223    Bool_t Process() { return kCONTINUE; }
    2324
     25    enum { kIsOwner = BIT(14) };
     26
    2427public:
    25     MContinue(const char *name=NULL, const char *title=NULL);
     28    MContinue(const TString rule="", const char *name=NULL, const char *title=NULL);
    2629    MContinue(MFilter *f, const char *name=NULL, const char *title=NULL);
     30    ~MContinue();
     31
     32    void SetFilter(MFilter *filter) { if (!TestBit(kIsOwner)) MTask::SetFilter(filter); }
    2733
    2834    ClassDef(MContinue, 1) //Task returning kCONTINUE
  • trunk/MagicSoft/Mars/mbase/Makefile

    r1540 r1715  
    2020# @endcode
    2121
    22 INCLUDES = -I. -I../mraw -I../MRawFormat -I../mmc -I../mfileio -I../mmain
     22INCLUDES = -I. -I../mraw -I../MRawFormat -I../mmc -I../mfileio -I../mmain -I../mfilter
    2323
    2424# @code
  • trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc

    r1668 r1715  
    701701
    702702    fNumFilterEvts = 0;
     703    fNumEvents     = 0;
    703704    fNumRuns       = 0;
    704705
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r1544 r1715  
    117117Float_t MGeomCam::GetPixRatio(Int_t i) const
    118118{
    119     return (*this)[0].GetA()/(*this)[i].GetA();
     119    return i<fNumPixels ? (*this)[0].GetA()/(*this)[i].GetA() : 0;
    120120}
    121121
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.cc

    r1670 r1715  
    4242#include <TStyle.h>
    4343#include <TCanvas.h>
    44 #include <TButton.h>
     44//#include <TButton.h>
    4545#include <TClonesArray.h>
    4646
     
    167167}
    168168
    169 inline void MCamDisplay::SetPixColor(const MCerPhotPix &pix, const Int_t i, Float_t min, Float_t max)
    170 {
     169inline void MCamDisplay::SetPixColor(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max)
     170{
     171    if (i>=fNumPixels)
     172        return;
     173
    171174    //
    172175    // Fixme: Use absolute value per mm^2. Needs another scaling algorithm.
     
    178181}
    179182
    180 inline void MCamDisplay::SetPixColorPedestal(const MPedestalPix &pix, const Int_t i, Float_t min, Float_t max)
    181 {
     183inline void MCamDisplay::SetPixColorPedestal(const MPedestalPix &pix, const UInt_t i, Float_t min, Float_t max)
     184{
     185    if (i>=fNumPixels)
     186        return;
     187
    182188    //
    183189    // Fixme: Use absolute value per mm^2. Needs another scaling algorithm.
     
    189195}
    190196
    191 inline void MCamDisplay::SetPixColorError(const MCerPhotPix &pix, const Int_t i, Float_t min, Float_t max)
    192 {
     197inline void MCamDisplay::SetPixColorError(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max)
     198{
     199    if (i>=fNumPixels)
     200        return;
     201
    193202    //
    194203    // Fixme: Use absolute value per mm^2. Needs another scaling algorithm.
     
    378387}
    379388
     389void MCamDisplay::SetPrettyPalette()
     390{
     391    SetPalette(1, 0);
     392}
     393
     394void MCamDisplay::SetDeepBlueSeaPalette()
     395{
     396    SetPalette(51, 0);
     397}
     398
     399void MCamDisplay::SetInvDeepBlueSeaPalette()
     400{
     401    SetPalette(52, 0);
     402}
     403
    380404// ------------------------------------------------------------------------
    381405//
     
    418442    Paint();
    419443
    420     //
    421     // Create and draw the buttons which allows changing the
    422     // color palette of the display
    423     //
    424     TButton *but;
    425     char txt[100];
    426     sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(1,0);", this);
    427     but = new TButton("Pretty", txt, 0.01, 0.95, 0.15, 0.99);
    428     but->Draw();
    429     sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(51,0);", this);
    430     but = new TButton("Deap Sea", txt, 0.16, 0.95, 0.30, 0.99);
    431     but->Draw();
    432     sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(52,0);", this);
    433     but = new TButton("Blue Inv", txt, 0.31, 0.95, 0.45, 0.99);
    434     but->Draw();
     444    /*
     445     //
     446     // Create and draw the buttons which allows changing the
     447     // color palette of the display
     448     //
     449     TButton *but;
     450     char txt[100];
     451     sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(1,0);", this);
     452     but = new TButton("Pretty", txt, 0.01, 0.95, 0.15, 0.99);
     453     but->Draw();
     454     sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(51,0);", this);
     455     but = new TButton("Deap Sea", txt, 0.16, 0.95, 0.30, 0.99);
     456     but->Draw();
     457     sprintf(txt, "((MCamDisplay*)0x%lx)->SetPalette(52,0);", this);
     458     but = new TButton("Blue Inv", txt, 0.31, 0.95, 0.45, 0.99);
     459     but->Draw();
     460     */
    435461
    436462    //
     
    441467    {
    442468#if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)
    443         (*this)[i].SetBit(kNoContextMenu|kCannotPick);
     469        (*this)[i].SetBit(/*kNoContextMenu|*/kCannotPick);
    444470#endif
    445471        (*this)[i].SetFillColor(22);
     
    470496        box->SetFillColor(22);
    471497#if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)
    472         box->SetBit(kNoContextMenu|kCannotPick);
     498        box->SetBit(/*kNoContextMenu|*/kCannotPick);
    473499#endif
    474500        box->Draw();
     
    478504        txt->SetY(H*((i+0.5)*h - 1.));
    479505#if ROOT_VERSION_CODE > ROOT_VERSION(3,01,06)
    480         txt->SetBit(kNoContextMenu|kCannotPick);
     506        txt->SetBit(/*kNoContextMenu|*/kCannotPick);
    481507#endif
    482508        txt->Draw();
  • trunk/MagicSoft/Mars/mgui/MCamDisplay.h

    r1544 r1715  
    5454    MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
    5555
    56     void  SetPixColor(const MCerPhotPix &pix, const Int_t i, Float_t min, Float_t max);
     56    void  SetPixColor(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max);
    5757    void  SetPixColorRatio(const MCerPhotPix &pix, Float_t min, Float_t max);
    5858    void  SetPixColorLevel(const MCerPhotPix &pix, Float_t lvl1, Float_t lvl2);
    59     void  SetPixColorError(const MCerPhotPix &pix, const Int_t i, Float_t min, Float_t max);
    60     void  SetPixColorPedestal(const MPedestalPix &pix, const Int_t i, Float_t min, Float_t max);
     59    void  SetPixColorError(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max);
     60    void  SetPixColorPedestal(const MPedestalPix &pix, const UInt_t i, Float_t min, Float_t max);
    6161    Int_t GetColor(Float_t val, Float_t min, Float_t max);
    6262
     
    8686    void SetPalette(Int_t ncolors, Int_t *colors);
    8787
     88    void SetPrettyPalette(); // *MENU*
     89    void SetDeepBlueSeaPalette(); // *MENU*
     90    void SetInvDeepBlueSeaPalette(); // *MENU*
     91
    8892    ClassDef(MCamDisplay, 0) // Displays the magic camera
    8993};
  • trunk/MagicSoft/Mars/mhist/HistLinkDef.h

    r1683 r1715  
    1717#pragma link C++ class MHFadcCam+;
    1818#pragma link C++ class MHFadcPix+;
     19
     20#pragma link C++ class MHCerPhotEvt+;
    1921
    2022#pragma link C++ class MHHillas+;
     
    4850#pragma link C++ class MHMcEnergyImpact+;
    4951#pragma link C++ class MHMcCollectionArea+;
    50 # pragma link C++ class MHMcEnergyMigration+;
     52#pragma link C++ class MHMcEnergyMigration+;
    5153
    5254#endif
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1668 r1715  
    400400    if (fParContainerName.IsNull())
    401401    {
    402         fParContainer = pList;
     402        fParContainer = NULL;
    403403        return kTRUE;
    404404    }
    405405
    406406    fParContainer = (MParContainer*)pList->FindObject(fParContainerName);
     407
    407408    if (fParContainer)
    408409        return kTRUE;
  • trunk/MagicSoft/Mars/mhist/MHHillasExt.cc

    r1574 r1715  
    179179    const MHillasSrc *src = (MHillasSrc*)par;
    180180
    181     const Double_t scale = src ? TMath::Sign(fUseMmScale?1:fMm2Deg, src->GetCosDeltaAlpha()) : 1;
     181    const Double_t scale = TMath::Sign(fUseMmScale?1:fMm2Deg, src ? src->GetCosDeltaAlpha() : 1);
    182182
    183183    fHConc.Fill(fHillasExt->GetConc());
  • trunk/MagicSoft/Mars/mhist/MHStarMap.cc

    r1540 r1715  
    6868    fTitle = title ? title : "Container for a Star Map" ;
    6969
     70    *fLog << warn << "WARNING - Using MHStarMap doesn't take care of the Source Position!" << endl;
     71
    7072    //
    7173    //   loop over all Pixels and create two histograms
  • trunk/MagicSoft/Mars/mhist/Makefile

    r1683 r1715  
    3434           MHArray.cc \
    3535           MH3.cc \
     36           MHCerPhotEvt.cc \
    3637           MHMatrix.cc \
    3738           MHFadcPix.cc \
     
    8283
    8384# @endcode
    84 
    85 
    86 
    87 
    88 
    89 
    90 
    91 
    92 
    93 
  • trunk/MagicSoft/Mars/mmontecarlo/MMcCollectionAreaCalc.cc

    r1646 r1715  
    130130Bool_t MMcCollectionAreaCalc::Process()
    131131{
    132 //    *fLog << all << fMcEvt << " " << (int)fAllEvtsTriggered << " " << fCollArea << endl;
    133     const Float_t energy = fMcEvt->GetEnergy();
    134     const Float_t impact = fMcEvt->GetImpact()/100.;
     132    const Double_t energy = fMcEvt->GetEnergy();
     133    const Double_t impact = fMcEvt->GetImpact()/100.;
     134
     135    //
     136    // This happens for camera files created with Camera 0.5
     137    //
     138    if (TMath::IsNaN(impact))
     139    {
     140        *fLog << err << dbginf << "ERROR - Impact=NaN (Not a number)... abort." << endl;
     141        return kERROR;
     142    }
    135143
    136144    if (!fAllEvtsTriggered)
Note: See TracChangeset for help on using the changeset viewer.