Ignore:
Timestamp:
03/08/03 14:00:30 (22 years ago)
Author:
wittek
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/manalysis/MSelFinal.cc

    r1781 r1809  
    4141
    4242#include "MHillas.h"
     43#include "MHillasExt.h"
    4344#include "MHillasSrc.h"
    4445#include "MCerPhotEvt.h"
     
    5758// Default constructor.
    5859//
    59 MSelFinal::MSelFinal(MHillas *parhil, MHillasSrc *parhilsrc,
     60MSelFinal::MSelFinal(const char *HilName, const char *HilSrcName,
    6061                     const char *name, const char *title)
    6162{
     
    6364    fTitle = title ? title : "Task to evaluate the Final Cuts";
    6465
    65     fHil    = parhil;
    66     fHilsrc = parhilsrc;
     66    fHilName    = HilName;
     67    fHilSrcName = HilSrcName;
     68
     69    fHadronnessCut =   0.2;
     70    fAlphaCut      = 100.0; //degrees
    6771}
    6872
     
    7579Bool_t MSelFinal::PreProcess(MParList *pList)
    7680{
     81    fHil    = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt");
     82    if (!fHil)
     83    {
     84      *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl;
     85      return kFALSE;
     86    }
     87
     88    fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc");
     89    if (!fHilSrc)
     90    {
     91      *fLog << dbginf << "MHillasSrc object " << fHilSrcName << " not found... aborting." << endl;
     92      return kFALSE;
     93    }
     94
     95
    7796    fHadronness = (MHadronness*)pList->FindObject("MHadronness");
    7897    if (!fHadronness)
     
    90109    }
    91110
    92     fEvt = (MCerPhotEvt*)pList->FindObject("MCerPhotEvt");
    93     if (!fEvt)
    94     {
    95         *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl;
    96         return kFALSE;
    97     }
    98 
    99 
    100     fCam = (MGeomCam*)pList->FindObject("MGeomCam");
    101     if (!fCam)
    102     {
    103         *fLog << dbginf << "MGeomCam (Camera Geometry) missing in Parameter List... aborting." << endl;
    104         return kFALSE;
    105     }
    106     fMm2Deg = fCam->GetConvMm2Deg();
    107 
    108     *fLog << "fMm2Deg = " << fMm2Deg << endl;
    109 
    110111    memset(fErrors, 0, sizeof(fErrors));
    111112
     
    122123Bool_t MSelFinal::Process()
    123124{
     125  //*fLog << "Entry MSelFinal; fHilSrc = " << fHilSrc << endl;
     126
     127   
     128
    124129    Int_t rc = 0;
    125130
    126     Double_t alphacut = 20.0;
     131    Double_t modalpha = fabs( fHilSrc->GetAlpha() );
    127132
    128     Double_t modalpha = fabs( fHilsrc->GetAlpha() );
    129133    Double_t h = fHadronness->GetHadronness();
    130134
    131     if ( h>0.5  ||  modalpha > alphacut )
     135    if ( h>fHadronnessCut )
    132136    {
    133137      //*fLog << "MSelFinal::Process; h, alpha = " << h << ",  "
    134       //      << fHilsrc->GetAlpha() << endl;
     138      //      << fHilSrc->GetAlpha() << endl;
    135139      rc = 1;
     140    }   
     141
     142    else if ( modalpha > fAlphaCut )
     143    {
     144      //*fLog << "MSelFinal::Process; h, alpha = " << h << ",  "
     145      //      << fHilSrc->GetAlpha() << endl;
     146      rc = 2;
    136147    }   
    137148
     
    153164    *fLog << GetDescriptor() << " execution statistics:" << endl;
    154165    *fLog << dec << setfill(' ');
    155     *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Final selections are not fullfilled" << endl;
     166    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3)
     167          << (int)(fErrors[1]*100/GetNumExecutions())
     168          << "%) Evts skipped due to: g/h separation cut (" << fHadronnessCut
     169          << ")" << endl;
    156170
    157     *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Final selections!" << endl;
     171    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3)
     172          << (int)(fErrors[2]*100/GetNumExecutions())
     173          << "%) Evts skipped due to: cut in ALPHA (" << fAlphaCut
     174          << " degrees)" << endl;
     175
     176    *fLog << " " << fErrors[0] << " ("
     177          << (int)(fErrors[0]*100/GetNumExecutions())
     178          << "%) Evts survived Final selections!" << endl;
    158179    *fLog << endl;
    159180
    160181    return kTRUE;
    161182}
     183
     184
     185
Note: See TracChangeset for help on using the changeset viewer.