Changeset 2037


Ignore:
Timestamp:
04/29/03 09:48:42 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2036 r2037  
    11                                                 -*-*- END OF LINE -*-*-
    2  2003/04/29: Abelardo Moralej0
     2 2003/04/29: Thomas Bretz
     3 
     4   * mfilter/MFCT1SelBasic.[h,cc], mfilter/MFCT1SelFinal.[h,cc],
     5     mfilter/MFCT1SelStandard.[h,cc]:
     6     - reordered includes
     7     - removed MHillas from constructor (if present)
     8     - added corresponding Setter-methods
     9     - added many const qualifiers
     10     - removed some obsolete data members
     11     - made some member functions private
     12     - only store fMm2Deg, not the pointer to MGeomCam
     13     - don't use the CT1 camera build in... (to be discussed)
     14     - fixed MHillas, MHillasExt and MNewImagePar stuff
     15
     16
     17
     18 2003/04/29: Abelardo Moralejo
    319
    420   * mmontecarlo/MMcCollectionareaCalc.[h,cc]
     
    1531       to CalcEfficiency.
    1632
     33
     34
    1735 2003/04/28: Nadia Tonello
    1836
     
    2644   * manalysis/MCerPhotPix.[h,cc]
    2745     - added fRing and Get-Set functions
    28  
     46
     47
     48
    2949 2003/04/28: Oscar Blanch
    3050
     
    3757   * mgeom/Makefile
    3858     - Added class MGeomCamECO1000
     59
     60
    3961
    4062 2003/04/28: Abelardo Moralejo
     
    4668       Removed couts and used fLog instead. Function fcn is no longer
    4769       declared external.
     70
     71
    4872
    4973 2003/04/28: Thomas Bretz
  • trunk/MagicSoft/Mars/mfilter/MFCT1SelBasic.cc

    r1905 r2037  
    1616!
    1717!
    18 !   Author(s): Wolfgang Wittek  04/2003 <mailto:wittek@mppmu.mpg.de>
     18!   Author(s): Wolfgang Wittek, 04/2003 <mailto:wittek@mppmu.mpg.de>
     19!   Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1920!
    2021!   Copyright: MAGIC Software Development, 2000-2003
     
    2425
    2526/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //  MFCT1SelBasic                                                          //
    28 //                                                                         //
    29 //  This is a class to evaluate basic cuts                                 //
    30 //                                                                         //
    31 //  to be called after the calibration (when the number of photons is      //
    32 //               available for all pixels)                                  //
    33 //                                                                         //
     27//
     28//  MFCT1SelBasic
     29//
     30//  This is a class to evaluate basic cuts
     31//
     32//  WHAT ARE THE BASIC CUTS?
     33//
     34//  to be called after the calibration (when the number of photons is
     35//               available for all pixels)
     36//
    3437/////////////////////////////////////////////////////////////////////////////
    3538
     
    3841#include "MParList.h"
    3942
    40 #include "MHillas.h"
     43#include "MMcEvt.hxx"
     44
    4145#include "MCerPhotEvt.h"
    42 #include "MMcEvt.hxx"
    43 #include "MRawRunHeader.h"
     46//nclude "MRawRunHeader.h"
     47
     48#include "MGeomPix.h"
    4449#include "MGeomCam.h"
     50
     51#include "MPedestalPix.h"
    4552#include "MPedestalCam.h"
    46 #include "MPedestalPix.h"
    47 #include "MGeomPix.h"
    4853
    4954#include "MLog.h"
     
    7378                            Float_t thetamin, Float_t thetamax)
    7479{
    75   fMinPhotons = minphotons;
    76   fThetaMin   = thetamin;
    77   fThetaMax   = thetamax;
    78 
    79   *fLog << inf << "MFCT1SelBasic cut values : fMinPhotons, fThetaMin, fThetaMax = "
    80         << fMinPhotons <<",  " << fThetaMin << ",  " << fThetaMax << endl;
     80    fMinPhotons = minphotons;
     81    fThetaMin   = thetamin;
     82    fThetaMax   = thetamax;
     83
     84    *fLog << inf << "MFCT1SelBasic cut values : fMinPhotons, fThetaMin, fThetaMax = ";
     85    *fLog << fMinPhotons <<",  " << fThetaMin << ",  " << fThetaMax << endl;
    8186}
    8287
     
    8893Bool_t MFCT1SelBasic::PreProcess(MParList *pList)
    8994{
     95    /*
    9096    fRawRun = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
    9197    if (!fRawRun)
     
    94100        return kFALSE;
    95101    }
     102    */
    96103
    97104    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
     
    109116    }
    110117
    111 
    112118    fCam = (MGeomCam*)pList->FindObject("MGeomCam");
    113119    if (!fCam)
     
    116122        return kFALSE;
    117123    }
    118 
     124/*
    119125    fPed = (MPedestalCam*)pList->FindObject("MPedestalCam");
    120126    if (!fPed)
     
    123129        return kFALSE;
    124130    }
    125 
     131*/
    126132    memset(fCut, 0, sizeof(fCut));
    127133
     
    138144Bool_t MFCT1SelBasic::Process()
    139145{
     146    const Double_t theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
     147
    140148    Int_t rc = 0;
    141149    fResult  = kFALSE;
    142150
    143     //if ( fRawRun->GetRunNumber() < 16279 )
    144     //{
    145     //   rc = 1;
    146     //   fResult = kTRUE;
    147     //}
    148 
    149     Double_t theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
    150151    if ( theta < fThetaMin )
    151152    {
     
    153154      fResult = kTRUE;
    154155    }   
    155 
    156156    else if ( theta > fThetaMax )
    157157    {
     
    159159      fResult = kTRUE;
    160160    }   
    161 
    162161    else if ( !SwTrigger() )
    163162    {
    164       //*fLog << "MFCT1SelBasic::Process; SwTrigger = " << SwTrigger << endl;
    165163      rc = 3;
    166164      fResult = kTRUE;
     
    185183    for (Int_t i=0; i<entries; i++)
    186184    {
    187       MCerPhotPix &pix = (*fEvt)[i];
    188       Int_t id = pix.GetPixId();
    189       if (!pix.IsPixelUsed()) continue;
    190 
    191       Double_t photons = pix.GetNumPhotons();
    192       if (photons < fMinPhotons) continue;
    193 
    194       // this pixel is used and has the required no.of photons
    195       // check whether this is also true for a neigboring pixel
    196 
    197       MGeomPix &gpix = (*fCam)[id];
    198       if ( gpix.IsInOutermostRing() ) continue;
    199 
    200       const Int_t nneighbors = gpix.GetNumNeighbors();
    201       for (Int_t n=0; n<nneighbors; n++)
    202       {
    203         const Int_t id1 =  gpix.GetNeighbor(n);
    204         if ( !fEvt->IsPixelUsed(id1) ) continue;
    205 
    206         MGeomPix &gpix1 = (*fCam)[id1];
    207         if ( gpix1.IsInOutermostRing() ) continue;
    208 
    209         MCerPhotPix &pix1 = *(fEvt->GetPixById(id1));     
    210 
    211         Double_t photons1 = pix1.GetNumPhotons();
    212         if (photons1 >= fMinPhotons) return kTRUE;
    213       }
     185        const MCerPhotPix &pix = (*fEvt)[i];
     186
     187        const Int_t id = pix.GetPixId();
     188        if (!pix.IsPixelUsed())
     189            continue;
     190
     191        const Double_t photons = pix.GetNumPhotons();
     192        if (photons < fMinPhotons)
     193            continue;
     194
     195        // this pixel is used and has the required no.of photons
     196        // check whether this is also true for a neigboring pixel
     197
     198        const MGeomPix &gpix = (*fCam)[id];
     199        if ( gpix.IsInOutermostRing() )
     200            continue;
     201
     202        const Int_t nneighbors = gpix.GetNumNeighbors();
     203        for (Int_t n=0; n<nneighbors; n++)
     204        {
     205            const Int_t id1 =  gpix.GetNeighbor(n);
     206            if ( !fEvt->IsPixelUsed(id1) )
     207                continue;
     208
     209            const MGeomPix &gpix1 = (*fCam)[id1];
     210            if ( gpix1.IsInOutermostRing() )
     211                continue;
     212
     213            const MCerPhotPix &pix1 = *fEvt->GetPixById(id1);
     214
     215            const Double_t photons1 = pix1.GetNumPhotons();
     216            if (photons1 >= fMinPhotons)
     217                return kTRUE;
     218        }
    214219    }
    215220    return kFALSE;
     
    228233    *fLog << GetDescriptor() << " execution statistics:" << endl;
    229234    *fLog << dec << setfill(' ');
    230     *fLog << " " << setw(7) << fCut[1] << " (" << setw(3)
    231           << (int)(fCut[1]*100/GetNumExecutions())
    232           << "%) Evts skipped due to: Zenith angle < " << fThetaMin << endl;
    233 
    234     *fLog << " " << setw(7) << fCut[2] << " (" << setw(3)
    235           << (int)(fCut[2]*100/GetNumExecutions())
    236           << "%) Evts skipped due to: Zenith angle > " << fThetaMax << endl;
    237 
    238     *fLog << " " << setw(7) << fCut[3] << " (" << setw(3)
    239           << (int)(fCut[3]*100/GetNumExecutions())
    240           << "%) Evts skipped due to: Software trigger not fullfilled"
    241           << " (with fMinPhotons = " << fMinPhotons << ")" << endl;
    242 
    243     *fLog << " " << fCut[0] << " (" << (int)(fCut[0]*100/GetNumExecutions())
    244           << "%) Evts survived Basic selections!" << endl;
     235    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) ;
     236    *fLog << (int)(fCut[1]*100/GetNumExecutions()) ;
     237    *fLog << "%) Evts skipped due to: Zenith angle < " << fThetaMin << endl;
     238
     239    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) ;
     240    *fLog << (int)(fCut[2]*100/GetNumExecutions()) ;
     241    *fLog << "%) Evts skipped due to: Zenith angle > " << fThetaMax << endl;
     242
     243    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) ;
     244    *fLog << (int)(fCut[3]*100/GetNumExecutions()) ;
     245    *fLog << "%) Evts skipped due to: Software trigger not fullfilled" ;
     246    *fLog << " (with fMinPhotons = " << fMinPhotons << ")" << endl;
     247
     248    *fLog << " " << fCut[0] << " (" << (int)(fCut[0]*100/GetNumExecutions()) ;
     249    *fLog << "%) Evts survived Basic selections!" << endl;
    245250    *fLog << endl;
    246251
    247252    return kTRUE;
    248253}
    249 
    250 
    251 
    252 
    253 
    254 
    255 
    256 
    257 
    258 
    259 
    260 
    261 
    262 
    263 
  • trunk/MagicSoft/Mars/mfilter/MFCT1SelBasic.h

    r1905 r2037  
    1414#endif
    1515
     16class MMcEvt;
    1617class MGeomCam;
     18class MCerPhotEvt;
    1719class MPedestalCam;
    18 class MCerPhotEvt;
    19 class MHillas;
    20 class MMcEvt;
    21 class MRawRunHeader;
     20//class MRawRunHeader;
    2221
    2322class MFCT1SelBasic : public MFilter
    2423{
    2524private:
    26     const MPedestalCam  *fPed;      // Pedestal information
     25    const MMcEvt        *fMcEvt;       
    2726    const MGeomCam      *fCam;      // Camera Geometry
    2827    const MCerPhotEvt   *fEvt;      // Cerenkov Photon Event
    29     const MMcEvt        *fMcEvt;       
    30     const MRawRunHeader *fRawRun;       
     28    //const MPedestalCam  *fPed;      // Pedestal information
     29    //const MRawRunHeader *fRawRun;
    3130
    3231    Float_t     fMinPhotons;
     
    3433    Float_t     fThetaMax;
    3534
    36     Bool_t      fResult;
    37 
    3835    Int_t       fCut[4];
    3936
    40 public:
    41     MFCT1SelBasic(const char *name=NULL, const char *title=NULL);
    42 
    43     Bool_t IsExpressionTrue() const { return fResult; }
     37    Bool_t      fResult;
    4438
    4539    Bool_t PreProcess(MParList *pList);
     
    4741    Bool_t PostProcess();
    4842
     43    Bool_t IsExpressionTrue() const { return fResult; }
     44
    4945    Bool_t SwTrigger();
     46
     47public:
     48    MFCT1SelBasic(const char *name=NULL, const char *title=NULL);
     49
    5050    void SetCuts(Float_t minphotons, Float_t thetamin, Float_t thetamax);
    5151
  • trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.cc

    r1999 r2037  
    2424
    2525/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //  MFCT1SelFinal                                                          //
    28 //                                                                         //
    29 //  This is a class to evaluate the Final Cuts                             //
    30 //  (these cuts define the final sample of gammas;                         //
    31 //   relevant for the calculation of the effective collection areas)       //
    32 //                                                                         //
    33 //  to be called after the calculation of the hadroness                    //
    34 //                                                                         //
     26//
     27//  MFCT1SelFinal
     28//
     29//  WHAT ARE THE FINAL CUTS?
     30//
     31//  This is a class to evaluate the Final Cuts
     32//  (these cuts define the final sample of gammas;
     33//   relevant for the calculation of the effective collection areas)
     34//
     35//  to be called after the calculation of the hadroness
     36//
    3537/////////////////////////////////////////////////////////////////////////////
     38#include "MFCT1SelFinal.h"
    3639
    37 #include "math.h"
    38 #include "MFCT1SelFinal.h"
     40#include <math.h>
    3941
    4042#include "MParList.h"
    4143
    42 #include "MHillas.h"
    43 #include "MHillasExt.h"
    44 #include "MHillasSrc.h"
     44#include "MMcEvt.hxx"
     45
    4546#include "MCerPhotEvt.h"
    46 #include "MMcEvt.hxx"
     47
     48#include "MGeomPix.h"
    4749#include "MGeomCam.h"
    48 #include "MGeomCamCT1.h"
    49 #include "MGeomPix.h"
    50 #include "MHadronness.h"
    5150
    5251#include "MLog.h"
    5352#include "MLogManip.h"
     53
     54#include "MHillasExt.h"
     55#include "MHillasSrc.h"
     56#include "MHadronness.h"
    5457
    5558ClassImp(MFCT1SelFinal);
     
    5962// Default constructor.
    6063//
    61 MFCT1SelFinal::MFCT1SelFinal(const char *HilName, const char *HilSrcName,
    62                      const char *name, const char *title)
     64MFCT1SelFinal::MFCT1SelFinal(const char *hilsrcname,
     65                             const char *name, const char *title)
     66    : fHilSrcName(hilsrcname), fHadronnessName("MHadronness")
    6367{
    6468    fName  = name  ? name  : "MFCT1SelFinal";
    6569    fTitle = title ? title : "Class to evaluate the Final Cuts";
    66 
    67     fHilName        = HilName;
    68     fHilSrcName     = HilSrcName;
    69     fHadronnessName = "MHadronness";
    70 
    71     MGeomCamCT1 camct1;
    72     fMm2Deg = camct1.GetConvMm2Deg();
    7370
    7471    // default values of cuts
     
    8380void MFCT1SelFinal::SetCuts(Float_t hadmax, Float_t alphamax, Float_t distmax)
    8481{
    85   fHadronnessMax =   hadmax;
    86   fAlphaMax      = alphamax;
    87   fDistMax       =  distmax;
     82    fHadronnessMax =   hadmax;
     83    fAlphaMax      = alphamax;
     84    fDistMax       =  distmax;
    8885
    89   *fLog << inf << "MFCT1SelFinal cut values : fHadronnessMax, fAlphaMax, fDistMax = "
    90         << fHadronnessMax << ",  " << fAlphaMax << ",  " << fDistMax <<  endl;
     86    *fLog << inf << "MFCT1SelFinal cut values : fHadronnessMax, fAlphaMax, fDistMax = ";
     87    *fLog << fHadronnessMax << ",  " << fAlphaMax << ",  " << fDistMax <<  endl;
    9188}
    9289
     
    9491//
    9592// Set the pointers
    96 //
    9793//
    9894Bool_t MFCT1SelFinal::PreProcess(MParList *pList)
    9995{
    100     fHil    = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt");
    101     if (!fHil)
    102     {
    103       *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl;
    104       return kFALSE;
    105     }
    106 
    10796    fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc");
    10897    if (!fHilSrc)
     
    119108    }
    120109
    121     fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    122     if (!fMcEvt)
     110    MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
     111    if (!cam)
    123112    {
    124         *fLog << dbginf << "MMcEvt not found... aborting." << endl;
     113        *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl;
    125114        return kFALSE;
    126115    }
     116
     117    fMm2Deg = cam->GetConvMm2Deg();
    127118
    128119    memset(fCut, 0, sizeof(fCut));
     
    139130Bool_t MFCT1SelFinal::Process()
    140131{
     132    const Double_t modalpha = fabs( fHilSrc->GetAlpha() );
     133    const Double_t h = fHadronness->GetHadronness();
     134
    141135    Int_t rc = 0;
    142136    fResult = kFALSE;
    143 
    144     Double_t modalpha = fabs( fHilSrc->GetAlpha() );
    145 
    146     Double_t h = fHadronness->GetHadronness();
    147137
    148138    if ( h>fHadronnessMax )
     
    151141      fResult = kTRUE;
    152142    }   
    153 
    154143    else if ( modalpha > fAlphaMax )
    155144    {
     
    157146      fResult = kTRUE;
    158147    }
    159 
    160148    else if ( fMm2Deg*fHilSrc->GetDist() > fDistMax )
    161149    {
     
    181169    *fLog << GetDescriptor() << " execution statistics:" << endl;
    182170    *fLog << dec << setfill(' ');
    183     *fLog << " " << setw(7) << fCut[1] << " (" << setw(3)
    184           << (int)(fCut[1]*100/GetNumExecutions())
    185           << "%) Evts skipped due to: hadronness > "<< fHadronnessMax
    186           << " (hadronness from '" << fHadronnessName << "')" << endl;
     171    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) ;
     172    *fLog << (int)(fCut[1]*100/GetNumExecutions());
     173    *fLog << "%) Evts skipped due to: hadronness > "<< fHadronnessMax;
     174    *fLog << " (hadronness from '" << fHadronnessName << "')" << endl;
    187175
    188     *fLog << " " << setw(7) << fCut[2] << " (" << setw(3)
    189           << (int)(fCut[2]*100/GetNumExecutions())
    190           << "%) Evts skipped due to: |ALPHA| > " << fAlphaMax
    191           << " [degrees]" << endl;
     176    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) ;
     177    *fLog << (int)(fCut[2]*100/GetNumExecutions());
     178    *fLog << "%) Evts skipped due to: |ALPHA| > " << fAlphaMax;
     179    *fLog << " [degrees]" << endl;
    192180
    193     *fLog << " " << setw(7) << fCut[3] << " (" << setw(3)
    194           << (int)(fCut[3]*100/GetNumExecutions())
    195           << "%) Evts skipped due to: DIST > " << fDistMax
    196           << " [degrees]" << endl;
     181    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) ;
     182    *fLog << (int)(fCut[3]*100/GetNumExecutions());
     183    *fLog << "%) Evts skipped due to: DIST > " << fDistMax;
     184    *fLog << " [degrees]" << endl;
    197185
    198     *fLog << " " << fCut[0] << " ("
    199           << (int)(fCut[0]*100/GetNumExecutions())
    200           << "%) Evts survived Final selections!" << endl;
     186    *fLog << " " << fCut[0] << " (" ;
     187    *fLog << (int)(fCut[0]*100/GetNumExecutions());
     188    *fLog << "%) Evts survived Final selections!" << endl;
    201189    *fLog << endl;
    202190
  • trunk/MagicSoft/Mars/mfilter/MFCT1SelFinal.h

    r1982 r2037  
    1414#endif
    1515
    16 class MGeomCam;
    17 class MCerPhotEvt;
    1816class MHillas;
    1917class MHillasSrc;
    20 class MMcEvt;
    2118class MHadronness;
    2219
     
    2421{
    2522private:
    26     MGeomCam    *fCam;      // Camera Geometry
    27     MCerPhotEvt *fEvt;      // Cerenkov Photon Event
    28     MMcEvt      *fMcEvt;       
    29     MHillas     *fHil;       
    3023    MHillasSrc  *fHilSrc;       
    3124    MHadronness *fHadronness;       
    3225
    33     Double_t     fMm2Deg;   // conversion mm to degrees in camera
    34     Int_t        fCut[4];
    3526    TString      fHilName;
    3627    TString      fHilSrcName;
     
    4132    Float_t      fDistMax;
    4233
     34    Double_t     fMm2Deg;   // conversion mm to degrees in camera
     35
     36    Int_t        fCut[4];
     37
    4338    Bool_t       fResult;
    44 
    45 
    46 public:
    47     MFCT1SelFinal(const char *HilName="MHillas", const char *HilSrcName="MHillasSrc",
    48                   const char *name=NULL, const char *title=NULL);
    49 
    50     void SetHadronnessName(const TString name) { fHadronnessName = name; }
    51     Bool_t IsExpressionTrue() const  { return fResult; }
    5239
    5340    Bool_t PreProcess(MParList *pList);
    5441    Bool_t Process();
    5542    Bool_t PostProcess();
     43
     44    Bool_t IsExpressionTrue() const  { return fResult; }
     45
     46public:
     47    MFCT1SelFinal(const char *HilSrcName="MHillasSrc",
     48                  const char *name=NULL, const char *title=NULL);
     49
     50    void SetHadronnessName(const TString name) { fHadronnessName = name; }
    5651
    5752    void SetCuts(Float_t hadmax, Float_t alphamax, Float_t distmax);
  • trunk/MagicSoft/Mars/mfilter/MFCT1SelStandard.cc

    r1905 r2037  
    1616!
    1717!
    18 !   Author(s): Wolfgang Wittek  04/2003 <mailto:wittek@mppmu.mpg.de>
     18!   Author(s): Wolfgang Wittek, 04/2003 <mailto:wittek@mppmu.mpg.de>
     19!   Author(s): Thomas Bretz, 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1920!
    2021!   Copyright: MAGIC Software Development, 2000-2003
     
    2425
    2526/////////////////////////////////////////////////////////////////////////////
    26 //                                                                         //
    27 //  MFCT1SelStandard                                                       //
    28 //                                                                         //
    29 //  This is a class to evaluate the Standard Cuts                          //
    30 //                                                                         //
    31 //  to be called after the calculation of the image parameters             //
    32 //               before the g/h separation                                 //
    33 //                                                                         //
     27//
     28//  MFCT1SelStandard
     29//
     30//  This is a class to evaluate the Standard Cuts
     31//
     32//  WHAT ARE THE STANDARD CUTS?                                                                       //
     33//
     34//  to be called after the calculation of the image parameters
     35//               before the g/h separation
     36//
    3437/////////////////////////////////////////////////////////////////////////////
    3538
     
    3740
    3841#include "MParList.h"
     42
     43#include "MMcEvt.hxx"
     44
     45#include "MGeomPix.h"
     46#include "MGeomCam.h"
     47
     48#include "MCerPhotEvt.h"
     49
     50#include "MLog.h"
     51#include "MLogManip.h"
    3952
    4053#include "MHillas.h"
    4154#include "MHillasExt.h"
    4255#include "MHillasSrc.h"
    43 #include "MCerPhotEvt.h"
    44 #include "MMcEvt.hxx"
    45 #include "MGeomCam.h"
    46 #include "MGeomPix.h"
    47 
    48 #include "MLog.h"
    49 #include "MLogManip.h"
     56#include "MNewImagePar.h"
    5057
    5158ClassImp(MFCT1SelStandard);
     
    5562// Default constructor.
    5663//
    57 MFCT1SelStandard::MFCT1SelStandard(const char *HilName, const char *HilSrcName,
     64MFCT1SelStandard::MFCT1SelStandard(const char *hilsrcname,
    5865                                   const char *name, const char *title)
     66    : fHilName("MHillas"), fHilSrcName(hilsrcname), fImgParName("MNewImgPar")
    5967{
    6068    fName  = name  ? name  : "MFCT1SelStandard";
    6169    fTitle = title ? title : "Class to evaluate the Standard Cuts";
    6270
    63     fHilName    = HilName;
    64     fHilSrcName = HilSrcName;
    65 
    6671    // default values of cuts
    6772    SetCuts(92, 4, 60, 0.4, 1.05, 0.0, 0.0);
     
    7479//
    7580void MFCT1SelStandard::SetCuts(Float_t usedpixelsmax, Float_t corepixelsmin,
    76                           Float_t sizemin, Float_t distmin, Float_t distmax,
    77                           Float_t lengthmin, Float_t widthmin)
     81                               Float_t sizemin, Float_t distmin, Float_t distmax,
     82                               Float_t lengthmin, Float_t widthmin)
    7883{
    79   fUsedPixelsMax = usedpixelsmax;
    80   fCorePixelsMin = corepixelsmin;
    81   fSizeMin       = sizemin;
    82   fDistMin       = distmin;
    83   fDistMax       = distmax;
    84   fLengthMin     = lengthmin;
    85   fWidthMin      = widthmin;
    86 
    87   *fLog << inf << "MFCT1SelStandard cut values : fUsedPixelsMax, fCorePixelsMin = "
    88         << fUsedPixelsMax << ",  " << fCorePixelsMin << endl;
    89   *fLog << inf << "     fSizeMin, fDistMin, fDistMax = " << fSizeMin
    90         << ",  " << fDistMin << ",  " << fDistMax << endl;
    91   *fLog << inf << "     fLengthMin, fWidthMin = " << fLengthMin
    92         << ",  " << fWidthMin << endl;
    93 }
    94 
    95 // --------------------------------------------------------------------------
    96 //
    97 //
    98 //
    99 //
     84    fUsedPixelsMax = usedpixelsmax;
     85    fCorePixelsMin = corepixelsmin;
     86    fSizeMin       = sizemin;
     87    fDistMin       = distmin;
     88    fDistMax       = distmax;
     89    fLengthMin     = lengthmin;
     90    fWidthMin      = widthmin;
     91
     92    *fLog << inf << "MFCT1SelStandard cut values : fUsedPixelsMax, fCorePixelsMin = ";
     93    *fLog << fUsedPixelsMax << ",  " << fCorePixelsMin << endl;
     94    *fLog << inf << "     fSizeMin, fDistMin, fDistMax = " << fSizeMin ;
     95    *fLog << ",  " << fDistMin << ",  " << fDistMax << endl;
     96    *fLog << inf << "     fLengthMin, fWidthMin = " << fLengthMin ;
     97    *fLog << ",  " << fWidthMin << endl;
     98}
     99
     100// --------------------------------------------------------------------------
     101//
     102// MISSING
    100103//
    101104Bool_t MFCT1SelStandard::PreProcess(MParList *pList)
    102105{
    103     fHil    = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt");
     106    fHil = (MHillas*)pList->FindObject(fHilName, "MHillas");
    104107    if (!fHil)
    105108    {
    106       *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl;
    107       return kFALSE;
     109        *fLog << err << fHilName << " [MHillas] not found... aborting." << endl;
     110        return kFALSE;
    108111    }
    109112
     
    111114    if (!fHilSrc)
    112115    {
    113       *fLog << dbginf << "MHillasSrc object " << fHilSrcName << " not found... aborting." << endl;
    114       return kFALSE;
    115     }
    116 
    117 
    118     fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    119     if (!fMcEvt)
    120     {
    121         *fLog << dbginf << "MMcEvt not found... aborting." << endl;
    122         return kFALSE;
    123     }
    124 
    125     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
    126     if (!fEvt)
    127     {
    128         *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
    129         return kFALSE;
    130     }
    131 
    132 
    133     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
    134     if (!fCam)
    135     {
    136         *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
    137         return kFALSE;
    138     }
    139     fMm2Deg = fCam->GetConvMm2Deg();
    140 
    141     //*fLog << "fMm2Deg = " << fMm2Deg << endl;
     116        *fLog << err << fHilSrcName << " [MHillasSrc] not found... aborting." << endl;
     117        return kFALSE;
     118    }
     119
     120    fNewImgPar = (MNewImagePar*)pList->FindObject(fImgParName, "MNewImagePar");
     121    if (!fNewImgPar)
     122    {
     123        *fLog << err << fImgParName << " [MNewImagePar] not found... aborting." << endl;
     124        return kFALSE;
     125    }
     126
     127    MGeomCam *cam = (MGeomCam*)pList->FindObject("MGeomCam");
     128    if (!cam)
     129    {
     130        *fLog << err << "MGeomCam (Camera Geometry) not found... aborting." << endl;
     131        return kFALSE;
     132    }
     133
     134    fMm2Deg = cam->GetConvMm2Deg();
    142135
    143136    memset(fCut, 0, sizeof(fCut));
     
    155148Bool_t MFCT1SelStandard::Process()
    156149{
     150    const Double_t length     = fHil->GetLength() * fMm2Deg;
     151    const Double_t width      = fHil->GetWidth()  * fMm2Deg;
     152    const Double_t dist       = fHilSrc->GetDist()* fMm2Deg;
     153    //const Double_t delta      = fHil->GetDelta()  * kRad2Deg;
     154    const Double_t size       = fHil->GetSize();
     155    const Int_t numusedpixels = fNewImgPar->GetNumUsedPixels();
     156    const Int_t numcorepixels = fNewImgPar->GetNumCorePixels();
     157
    157158    Int_t rc = 0;
    158159    fResult  = kFALSE;
    159160
    160     Double_t length       = fHil->GetLength() * fMm2Deg;
    161     Double_t width        = fHil->GetWidth()  * fMm2Deg;
    162     Double_t dist         = fHilSrc->GetDist()* fMm2Deg;
    163     //Double_t delta        = fHil->GetDelta()  * kRad2Deg;
    164     Double_t size         = fHil->GetSize();
    165     Int_t numusedpixels   = fHil->GetNumUsedPixels();
    166     Int_t numcorepixels   = fHil->GetNumCorePixels();
    167 
    168161    if ( numusedpixels >= fUsedPixelsMax  ||  numcorepixels <= fCorePixelsMin )
    169162    {
     
    171164      fResult = kTRUE;
    172165    }   
    173 
    174166    else if ( size <= fSizeMin )
    175167    {
     
    177169      fResult = kTRUE;
    178170    }   
    179 
    180171    else if ( dist< fDistMin   ||  dist > fDistMax )
    181172    {
     
    183174      fResult = kTRUE;
    184175    }   
    185 
    186176    else if ( length <= fLengthMin   ||  width <= fWidthMin )
    187177    {
     
    207197    *fLog << GetDescriptor() << " execution statistics:" << endl;
    208198    *fLog << dec << setfill(' ');
    209     *fLog << " " << setw(7) << fCut[1] << " (" << setw(3) 
    210           << (int)(fCut[1]*100/GetNumExecutions())
    211           << "%) Evts skipped due to: Used pixels >= " << fUsedPixelsMax
    212           << " or Core pixels <= " << fCorePixelsMin << endl;
    213 
    214     *fLog << " " << setw(7) << fCut[2] << " (" << setw(3)
    215           << (int)(fCut[2]*100/GetNumExecutions())
    216           << "%) Evts skipped due to: SIZE <= " << fSizeMin << endl;
    217 
    218     *fLog << " " << setw(7) << fCut[3] << " (" << setw(3)
    219           << (int)(fCut[3]*100/GetNumExecutions())
    220           << "%) Evts skipped due to: DIST < " << fDistMin
    221           << " or DIST > " << fDistMax << endl;
    222 
    223     *fLog << " " << setw(7) << fCut[4] << " (" << setw(3)
    224           << (int)(fCut[4]*100/GetNumExecutions())
    225           << "%) Evts skipped due to: LENGTH <= " << fLengthMin
    226           << " or WIDTH <= " << fWidthMin << endl;
    227 
    228     *fLog << " " << fCut[0] << " ("
    229           << (int)(fCut[0]*100/GetNumExecutions())
    230           << "%) Evts survived Standard selections!" << endl;
     199    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3);
     200    *fLog << (int)(fCut[1]*100/GetNumExecutions()) ;
     201    *fLog << "%) Evts skipped due to: Used pixels >= " << fUsedPixelsMax ;
     202    *fLog << " or Core pixels <= " << fCorePixelsMin << endl;
     203
     204    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3) ;
     205    *fLog << (int)(fCut[2]*100/GetNumExecutions()) ;
     206    *fLog << "%) Evts skipped due to: SIZE <= " << fSizeMin << endl;
     207
     208    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3) ;
     209    *fLog << (int)(fCut[3]*100/GetNumExecutions()) ;
     210    *fLog << "%) Evts skipped due to: DIST < " << fDistMin;
     211    *fLog << " or DIST > " << fDistMax << endl;
     212
     213    *fLog << " " << setw(7) << fCut[4] << " (" << setw(3) ;
     214    *fLog << (int)(fCut[4]*100/GetNumExecutions()) ;
     215    *fLog << "%) Evts skipped due to: LENGTH <= " << fLengthMin;
     216    *fLog << " or WIDTH <= " << fWidthMin << endl;
     217
     218    *fLog << " " << fCut[0] << " (" ;
     219    *fLog << (int)(fCut[0]*100/GetNumExecutions()) ;
     220    *fLog << "%) Evts survived Standard selections!" << endl;
    231221    *fLog << endl;
    232222
  • trunk/MagicSoft/Mars/mfilter/MFCT1SelStandard.h

    r1905 r2037  
    1414#endif
    1515
    16 class MGeomCam;
    17 class MCerPhotEvt;
    1816class MHillas;
    1917class MHillasSrc;
    20 class MMcEvt;
     18class MNewImagePar;
    2119
    2220class MFCT1SelStandard : public MFilter
    2321{
    2422private:
    25     MGeomCam    *fCam;      // Camera Geometry
    26     MCerPhotEvt *fEvt;      // Cerenkov Photon Event
    27     MMcEvt      *fMcEvt;       
    28     MHillas     *fHil;       
    29     MHillasSrc  *fHilSrc;       
     23    MHillas      *fHil;
     24    MHillasSrc   *fHilSrc;
     25    MNewImagePar *fNewImgPar;
    3026
    31     Double_t     fMm2Deg;   // conversion mm to degrees in camera
     27    TString      fHilName;
     28    TString      fHilSrcName;
     29    TString      fImgParName;
     30
     31    Float_t      fUsedPixelsMax;
     32    Float_t      fCorePixelsMin;
     33    Float_t      fSizeMin;
     34    Float_t      fDistMin;
     35    Float_t      fDistMax;
     36    Float_t      fLengthMin;
     37    Float_t      fWidthMin;
     38
     39    Double_t     fMm2Deg;    // conversion mm to degrees in camera
     40
    3241    Int_t        fCut[5];
    33     TString      fHilName;
    34     TString      fHilSrcName;
    3542
    36     Float_t     fUsedPixelsMax;
    37     Float_t     fCorePixelsMin;
    38     Float_t     fSizeMin;
    39     Float_t     fDistMin;
    40     Float_t     fDistMax;
    41     Float_t     fLengthMin;
    42     Float_t     fWidthMin;
    43 
    44     Bool_t      fResult;
    45 
    46 public:
    47     MFCT1SelStandard(const char *HilName="MHillas", const char *HilSrcName="MHillasSrc",
    48                  const char *name=NULL, const char *title=NULL);
    49 
    50     Bool_t IsExpressionTrue() const  { return fResult; }
     43    Bool_t       fResult;
    5144
    5245    Bool_t PreProcess(MParList *pList);
    5346    Bool_t Process();
    5447    Bool_t PostProcess();
     48
     49    Bool_t IsExpressionTrue() const  { return fResult; }
     50
     51public:
     52    MFCT1SelStandard(const char *HilSrcName="MHillasSrc",
     53                     const char *name=NULL, const char *title=NULL);
     54
     55    void SetHillasName(const char *name) { fHilName = name; }
     56    void SetImgParName(const char *name) { fImgParName = name; }
    5557
    5658    void SetCuts(Float_t usedpixelsmax, Float_t corepixelsmin,
  • trunk/MagicSoft/Mars/mgeom/MGeomCam.cc

    r1965 r2037  
    3535#include "MGeomCam.h"
    3636
    37 #include <TClass.h>
     37#include <TClass.h>     // IsA()->New()
    3838
    3939#include "MLog.h"
  • trunk/MagicSoft/Mars/mgeom/MGeomCamCT1.cc

    r1965 r2037  
    1919!   Author(s): Harald Kornmayer 1/2001
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2002
     21!   Copyright: MAGIC Software Development, 2000-2003
    2222!
    2323!
     
    3333//
    3434////////////////////////////////////////////////////////////////////////////
    35 
    3635#include "MGeomCamCT1.h"
    3736
    38 
    3937#include <math.h>     // floor
    4038
    41 #include "TCanvas.h"
    42 
    43 #include "MLog.h"
    44 #include "MLogManip.h"
     39/*
     40 #include "MLog.h"
     41 #include "MLogManip.h"
     42 */
    4543
    4644#include "MGeomPix.h"
  • trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.cc

    r2033 r2037  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    19 !   Author(s): Harald Kornmayer 1/2001
     18!   Author(s): Oscar Blanch, 4/2003 <mailto:blanch@ifae.es>
    2019!
    21 !   Copyright: MAGIC Software Development, 2000-2002
     20!   Copyright: MAGIC Software Development, 2000-2003
    2221!
    2322!
     
    2827// MGeomCamECO1000
    2928//
    30 // This class stores the geometry information of the Magic camera.
     29// This class stores the geometry information of the ECO1000 camera.
    3130// All information are copied from tables, see source code.
    3231//
    3332////////////////////////////////////////////////////////////////////////////
    34 
    3533#include "MGeomCamECO1000.h"
    36 
    37 #include "TCanvas.h"
    3834
    3935#include "MLog.h"
     
    6662    //   fill the geometry class with the coordinates of the MAGIC camera
    6763    //
    68     *fLog << inf << " Creating Magic geometry " << endl ;
     64    *fLog << inf << " Creating ECO1000 geometry " << endl ;
    6965
    7066    //
     
    302298    //   fill the pixels list with this data
    303299    //
    304 
    305300    for (UInt_t i=0; i<GetNumPixels(); i++)
    306301        (*this)[i].Set(xtemp[i], ytemp[i], rtemp[i]) ;
  • trunk/MagicSoft/Mars/mgeom/MGeomCamECO1000.h

    r2033 r2037  
    1515    MGeomCamECO1000(const char *name=NULL);
    1616
    17     ClassDef(MGeomCamECO1000, 1)                // Geometry class for the Magic camera
     17    ClassDef(MGeomCamECO1000, 1) // Geometry class for the ECO1000 camera
    1818};
    1919
  • trunk/MagicSoft/Mars/mgeom/MGeomCamMagic.cc

    r1965 r2037  
    1919!   Author(s): Harald Kornmayer 1/2001
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2002
     21!   Copyright: MAGIC Software Development, 2000-2003
    2222!
    2323!
     
    3232//
    3333////////////////////////////////////////////////////////////////////////////
    34 
    3534#include "MGeomCamMagic.h"
    3635
    37 #include "TCanvas.h"
    38 
    39 #include "MLog.h"
    40 #include "MLogManip.h"
     36/*
     37 #include "MLog.h"
     38 #include "MLogManip.h"
     39 */
    4140
    4241#include "MGeomPix.h"
Note: See TracChangeset for help on using the changeset viewer.