Ignore:
Timestamp:
03/08/03 14:00:30 (22 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
9 edited

Legend:

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

    r1660 r1809  
    208208    }
    209209
    210     //fHadronness->SetHadronness(dg/(dg+dh));
    211     fHadronness->SetHadronness(exp(-dh/dg));
     210    Double_t arg;
     211
     212    if (dg+dh != 0.0)
     213      arg = dg / (dg+dh);
     214    else
     215      arg = 1.e10;
     216    //fHadronness->SetHadronness(arg);
     217
     218    if (dg != 0.0)
     219      arg = exp(-dh/dg);
     220    else
     221      arg = 0.0;
     222    fHadronness->SetHadronness(arg);
     223     
    212224
    213225    return kTRUE;
  • trunk/MagicSoft/Mars/manalysis/MPadSchweizer.cc

    r1772 r1809  
    1 
    21/* ======================================================================== *\
    32!
     
    102101  fHDiffPixTheta  = fHist3Diff;
    103102
     103  fHSigmaTheta->SetDirectory(NULL);
     104  fHSigmaPixTheta->SetDirectory(NULL);
     105  fHDiffPixTheta->SetDirectory(NULL);
     106
    104107  Print();
    105108}
     
    239242   fHDiffPixTh->SetZTitle("Sigma^2-Sigmabar^2");
    240243
     244   //--------------------------------------------------------------------
     245
     246   memset(fErrors, 0, sizeof(fErrors));
     247
    241248   return kTRUE;
    242249}
     
    251258  //*fLog << "Entry MPadSchweizer::Process();" << endl;
    252259
     260  Int_t rc;
     261
    253262  const UInt_t npix = fEvt->GetNumPixels();
     263
     264  Double_t SigbarOld;
     265
     266  //*fLog << "before padding : " << endl;
     267  //SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt);
     268  //fSigmabar->Print("");
     269
    254270
    255271  //$$$$$$$$$$$$$$$$$$$$$$$$$$
    256272  // to simulate the situation that before the padding the NSB and
    257273  // electronic noise are zero : set Sigma = 0 for all pixels
    258   for (UInt_t i=0; i<npix; i++)
    259   {   
    260     MCerPhotPix &pix = fEvt->operator[](i);     
    261     Int_t j = pix.GetPixId();
    262 
    263     MPedestalPix &ppix = fPed->operator[](j);
    264     ppix.SetMeanRms(0.0);
    265   }
     274  //for (UInt_t i=0; i<npix; i++)
     275  //{   
     276  //  MCerPhotPix &pix = fEvt->operator[](i);     
     277  //  Int_t j = pix.GetPixId();
     278
     279  //  MPedestalPix &ppix = fPed->operator[](j);
     280  //  ppix.SetMeanRms(0.0);
     281  //}
    266282  //$$$$$$$$$$$$$$$$$$$$$$$$$$
    267283
     
    269285  // Calculate average sigma of the event
    270286  //
    271   Double_t SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt);
     287  SigbarOld = fSigmabar->Calc(*fCam, *fPed, *fEvt);
    272288  //fSigmabar->Print("");
    273289
    274   //if (SigbarOld > 0.0)
    275   //{
     290  if (SigbarOld > 0.0)
     291  {
    276292    //*fLog << "MPadSchweizer::Process(); Sigmabar of event to be padded is > 0 : "
    277293    //      << SigbarOld << ". Stop event loop " << endl;
    278294    // input data should have Sigmabar = 0; stop event loop
    279     // return kFALSE;
    280   //}
     295 
     296    rc = 1;
     297    fErrors[rc]++;
     298    return kCONTINUE;
     299  }
    281300
    282301  Double_t Theta  = kRad2Deg*fMcEvt->GetTelescopeTheta();
     
    296315          << Theta << ",  " << binNumber << ";  Skip event " << endl;
    297316    // event cannot be padded; skip event
     317
     318    rc = 2;
     319    fErrors[rc]++;
    298320    return kCONTINUE;
    299321  }
     
    308330      // event cannot be padded; skip event
    309331      delete fHSigma;
     332
     333      rc = 3;
     334      fErrors[rc]++;
    310335      return kCONTINUE;
    311336    }
     
    331356    *fLog << "MPadSchweizer::Process(); target Sigmabar is less than SigbarOld : "
    332357          << Sigmabar << ",  " << SigbarOld << ",   Skip event" << endl;
     358
     359    rc = 4;
     360    fErrors[rc]++;
    333361    return kCONTINUE;     
    334362  }
     
    426454              << binTheta << "  and pixel bin " << binPixel 
    427455              << " has no entries;  aborting " << endl;
    428         return kERROR;
     456
     457        rc = 5;
     458        fErrors[rc]++;
     459        return kCONTINUE;     
    429460      }
    430461
     
    465496              << binTheta << "  and pixel bin " << binPixel 
    466497              << " has no entries;  aborting " << endl;
    467         return kERROR;
     498
     499        rc = 6;
     500        fErrors[rc]++;
     501        return kCONTINUE;     
    468502      }
    469503
     
    553587
    554588  // Calculate Sigmabar again and crosscheck
     589
    555590  Double_t SigbarNew = fSigmabar->Calc(*fCam, *fPed, *fEvt);
     591  //*fLog << "after padding : " << endl;
    556592  //fSigmabar->Print("");
    557593
     
    585621  //*fLog << "Exit MPadSchweizer::Process();" << endl;
    586622
     623  rc = 0;
     624  fErrors[rc]++;
     625
    587626  return kTRUE;
    588627
     
    594633Bool_t MPadSchweizer::PostProcess()
    595634{
     635    if (GetNumExecutions() != 0)
     636    {
     637
     638    *fLog << inf << endl;
     639    *fLog << GetDescriptor() << " execution statistics:" << endl;
     640    *fLog << dec << setfill(' ');
     641    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3)
     642          << (int)(fErrors[1]*100/GetNumExecutions())
     643          << "%) Evts skipped due to: Sigmabar_old > 0" << endl;
     644
     645    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3)
     646          << (int)(fErrors[2]*100/GetNumExecutions())
     647          << "%) Evts skipped due to: Zenith angle out of range" << endl;
     648
     649    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3)
     650          << (int)(fErrors[3]*100/GetNumExecutions())
     651          << "%) Evts skipped due to: No data for generating Sigmabar" << endl;
     652
     653    *fLog << " " << setw(7) << fErrors[4] << " (" << setw(3)
     654          << (int)(fErrors[4]*100/GetNumExecutions())
     655          << "%) Evts skipped due to: Target sigma <= Sigmabar_old" << endl;
     656
     657    *fLog << " " << setw(7) << fErrors[5] << " (" << setw(3)
     658          << (int)(fErrors[5]*100/GetNumExecutions())
     659          << "%) Evts skipped due to: No data for generating Sigma^2-Sigmabar^2" << endl;
     660
     661    *fLog << " " << setw(7) << fErrors[6] << " (" << setw(3)
     662          << (int)(fErrors[6]*100/GetNumExecutions())
     663          << "%) Evts skipped due to: No data for generating Sigma" << endl;
     664
     665    *fLog << " " << fErrors[0] << " ("
     666          << (int)(fErrors[0]*100/GetNumExecutions())
     667          << "%) Evts survived the padding!" << endl;
     668    *fLog << endl;
     669
     670    }
     671
     672    //---------------------------------------------------------------
    596673    TCanvas &c = *(MH::MakeDefCanvas("PadSchweizer", "", 900, 1200));
    597674    c.Divide(3, 4);
     
    600677
    601678    c.cd(1);
     679    fHSigmaTheta->SetDirectory(NULL);
    602680    fHSigmaTheta->SetTitle("2D : Sigmabar, \\Theta (reference sample)");
    603     fHSigmaTheta->DrawClone();     
     681    fHSigmaTheta->DrawCopy();     
    604682    fHSigmaTheta->SetBit(kCanDelete);     
    605683
    606684      //c.cd(1);
    607       //fHSigmaPixTheta->DrawClone();     
     685      //fHSigmaPixTheta->DrawCopy();     
    608686      //fHSigmaPixTheta->SetBit(kCanDelete);     
    609687
    610688    c.cd(4);
    611     fHSigbarTheta->DrawClone();     
     689    fHSigbarTheta->SetDirectory(NULL);
     690    fHSigbarTheta->DrawCopy();     
    612691    fHSigbarTheta->SetBit(kCanDelete);     
    613692
    614693
    615694    c.cd(7);
    616     fHNSB->DrawClone();
     695    fHNSB->SetDirectory(NULL);
     696    fHNSB->DrawCopy();
    617697    fHNSB->SetBit(kCanDelete);   
    618698
     
    625705    c.cd(2);
    626706    l = (TH2D*) ((TH3*)fHDiffPixTh)->Project3D("zx");
    627 
     707    l->SetDirectory(NULL);
    628708    l->SetTitle("Sigma^2-Sigmabar^2 vs. \\Theta (all pixels)");
    629709    l->SetXTitle("\\Theta [\\circ]");
    630710    l->SetYTitle("Sigma^2-Sigmabar^2");
    631711
    632     *fLog << "before box" << endl;
    633 
    634     l->Draw("box");
     712    l->DrawCopy("box");
    635713    l->SetBit(kCanDelete);;
    636714
    637715    c.cd(5);
    638716    l = (TH2D*) ((TH3*)fHDiffPixTh)->Project3D("zy");
     717    l->SetDirectory(NULL);
    639718    l->SetTitle("Sigma^2-Sigmabar^2 vs. pixel number (all \\Theta)");
    640719    l->SetXTitle("pixel");
    641720    l->SetYTitle("Sigma^2-Sigmabar^2");
    642721
    643     l->Draw("box");
     722    l->DrawCopy("box");
    644723    l->SetBit(kCanDelete);;
    645724
     
    655734    c.cd(3);
    656735    k = (TH2D*) ((TH3*)fHSigPixTh)->Project3D("zx");
     736    k->SetDirectory(NULL);
    657737    k->SetTitle("Sigma vs. \\Theta (all pixels)");
    658738    k->SetXTitle("\\Theta [\\circ]");
    659739    k->SetYTitle("Sigma");
    660740
    661     k->Draw("box");
     741    k->DrawCopy("box");
    662742    k->SetBit(kCanDelete);
    663743
    664744    c.cd(6);
    665745    k = (TH2D*) ((TH3*)fHSigPixTh)->Project3D("zy");
     746    k->SetDirectory(NULL);
    666747    k->SetTitle("Sigma vs. pixel number (all \\Theta)");
    667748    k->SetXTitle("pixel");
    668749    k->SetYTitle("Sigma");
    669750
    670     k->Draw("box");
     751    k->DrawCopy("box");
    671752    k->SetBit(kCanDelete);;
    672753
     
    677758
    678759    c.cd(10);
    679     fHSigmaPedestal->DrawClone();
     760    fHSigmaPedestal->SetDirectory(NULL);
     761    fHSigmaPedestal->DrawCopy();
    680762    fHSigmaPedestal->SetBit(kCanDelete);   
    681763
    682764    c.cd(11);
    683     fHPhotons->DrawClone();
     765    fHPhotons->SetDirectory(NULL);
     766    fHPhotons->DrawCopy();
    684767    fHPhotons->SetBit(kCanDelete);   
    685768
  • trunk/MagicSoft/Mars/manalysis/MPadSchweizer.h

    r1771 r1809  
    3939    Int_t          fRunType;
    4040    Int_t          fGroup;
     41
     42    Int_t          fErrors[7];
    4143
    4244    // plots used for the padding
  • trunk/MagicSoft/Mars/manalysis/MSelBasic.cc

    r1762 r1809  
    4444#include "MGeomCam.h"
    4545#include "MPedestalCam.h"
     46#include "MPedestalPix.h"
    4647#include "MGeomPix.h"
    4748
     
    119120Bool_t MSelBasic::Process()
    120121{
     122  /*
     123  //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     124  *fLog << "=========================================================" << endl;
     125  *fLog << "" << endl;
     126  *fLog << "MmcEvt data : " << endl;
     127  *fLog << "" << endl;
     128  fMcEvt->Print();
     129  *fLog << "" << endl;
     130  *fLog << "PartId() = " << fMcEvt->GetPartId() << endl;
     131  *fLog << "Energy() = " << fMcEvt->GetEnergy() << endl;
     132  *fLog << "Theta()  = " << fMcEvt->GetTheta() << endl;
     133
     134  *fLog << "Phi()    = " << fMcEvt->GetPhi() << endl;
     135  //*fLog << "CoreD()  = " << fMcEvt->GetCoreD() << endl;
     136  //*fLog << "CoreX()  = " << fMcEvt->GetCoreX() << endl;
     137
     138  //*fLog << "CoreY()  = " << fMcEvt->GetCoreY() << endl;
     139  *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;
     140  //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;
     141
     142  //*fLog << "PassPhotAtm() = " << fMcEvt->GetPassPhotAtm() << endl;
     143  //*fLog << "PassPhotRef() = " << fMcEvt->GetPassPhotRef() << endl;
     144  //*fLog << "PassPhotCone()  = " << fMcEvt->GetPassPhotCone() << endl;
     145
     146  //*fLog << "PhotElfromShower()    = " << fMcEvt->GetPhotElfromShower() << endl;
     147  //*fLog << "PhotElinCamera()  = " << fMcEvt->GetPhotElinCamera() << endl;
     148  *fLog << "TelescopePhi()  = " << fMcEvt->GetTelescopePhi() << endl;
     149
     150  *fLog << "TelescopeTheta()  = " << fMcEvt->GetTelescopeTheta() << endl;
     151  *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;
     152  //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;
     153  *fLog << "" << endl;
     154  *fLog << "=========================================================" << endl;
     155
     156  *fLog << "=========================================================" << endl;
     157  *fLog << "" << endl;
     158  *fLog << "MPedestalPix data : " << endl;
     159  *fLog << "" << endl;
     160
     161  Int_t ntot;
     162  ntot = fPed->GetSize();
     163    *fLog << "MeanRms() :" << endl;   
     164  for (Int_t i=0; i<ntot; i++)
     165  {
     166    MPedestalPix &pix = (*fPed)[i];
     167    //*fLog << "Mean()    = " << i << ",  " << pix.GetMean() << endl;   
     168    //*fLog << "Sigma()   = " << i << ",  " << pix.GetSigma() << endl;   
     169    *fLog << pix.GetMeanRms() << " ";   
     170    //*fLog << "SigmaRms()= " << i << ",  " << pix.GetSigmaRms() << endl;   
     171  }
     172  *fLog << "" << endl;
     173
     174  *fLog << "" << endl;
     175  ntot = fEvt->GetNumPixels();
     176    *fLog << "MCerPhotPix :  pix.GetNumPhotons()" << endl;   
     177  for (Int_t i=0; i<ntot; i++)
     178  {
     179    MCerPhotPix &pix = (*fEvt)[i];
     180    *fLog << pix.GetNumPhotons() << " ";   
     181  }
     182  *fLog << "" << endl;
     183
     184  *fLog << "" << endl;
     185  ntot = fEvt->GetNumPixels();
     186    *fLog << "MCerPhotPix :  pix.GetErrorPhot()" << endl;   
     187  for (Int_t i=0; i<ntot; i++)
     188  {
     189    MCerPhotPix &pix = (*fEvt)[i];
     190    *fLog << pix.GetErrorPhot() << " ";   
     191  }
     192  *fLog << "" << endl;
     193
     194  //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
     195  */
     196
     197
    121198    Int_t rc = 0;
    122199
    123     //if ( fRawRun->GetRunNumber() < 1025 )
     200    //if ( fRawRun->GetRunNumber() < 16279 )
    124201    //{
    125202    //   rc = 1;
     
    128205
    129206    Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
    130     if (Theta > 45.0  ||  !SwTrigger() )
    131     {
    132       //*fLog << "MSelBasic::Process; Theta = " << Theta << endl;
     207    if ( Theta < 0.0 )
     208    {
     209      *fLog << "MSelBasic::Process; Run, Event, Theta = "
     210            << fRawRun->GetRunNumber()<< ",  "
     211            << fMcEvt->GetEvtNumber() << ",  " << Theta << endl;
    133212      rc = 1;
     213    }   
     214
     215    else if ( Theta > 45.0 )
     216    {
     217      rc = 2;
     218    }   
     219
     220    else if ( !SwTrigger() )
     221    {
     222      //*fLog << "MSelBasic::Process; SwTrigger = " << SwTrigger << endl;
     223      rc = 3;
    134224    }   
    135225
     
    223313    *fLog << GetDescriptor() << " execution statistics:" << endl;
    224314    *fLog << dec << setfill(' ');
    225     *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Basic selections are not fullfilled" << endl;
     315    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle < 0" << endl;
     316
     317    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Zenith angle too high" << endl;
     318
     319    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Software trigger not fullfilled" << endl;
    226320
    227321    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Basic selections!" << endl;
     
    230324    return kTRUE;
    231325}
     326
  • trunk/MagicSoft/Mars/manalysis/MSelBasic.h

    r1762 r1809  
    3030    const MRawRunHeader *fRawRun;       
    3131
    32           Int_t        fErrors[2];
     32          Int_t        fErrors[4];
    3333
    3434public:
  • 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
  • trunk/MagicSoft/Mars/manalysis/MSelFinal.h

    r1781 r1809  
    2828    MMcEvt      *fMcEvt;       
    2929    MHillas     *fHil;       
    30     MHillasSrc  *fHilsrc;       
     30    MHillasSrc  *fHilSrc;       
    3131    MHadronness *fHadronness;       
    3232
    3333    Double_t     fMm2Deg;   // conversion mm to degrees in camera
    34     Int_t        fErrors[2];
     34    Int_t        fErrors[3];
     35    TString      fHilName;
     36    TString      fHilSrcName;
     37 
     38    Float_t      fHadronnessCut;
     39    Float_t      fAlphaCut;
    3540
    3641public:
    37     MSelFinal(MHillas *fHil, MHillasSrc *fHilsrc,
     42    MSelFinal(const char *HilName, const char *HilSrcName,
    3843              const char *name=NULL, const char *title=NULL);
    3944
     
    4247    Bool_t PostProcess();
    4348
     49    void SetHadronnessCut(Float_t hadcut) { fHadronnessCut = hadcut; }
     50    void SetAlphaCut(Float_t alpha)       { fAlphaCut      = alpha;  }
    4451
    4552    ClassDef(MSelFinal, 0)   // Task to evaluate final cuts
  • trunk/MagicSoft/Mars/manalysis/MSelStandard.cc

    r1762 r1809  
     1
    12/* ======================================================================== *\
    23!
     
    3940
    4041#include "MHillas.h"
     42#include "MHillasExt.h"
    4143#include "MHillasSrc.h"
    4244#include "MCerPhotEvt.h"
     
    5456// Default constructor.
    5557//
    56 MSelStandard::MSelStandard(const MHillas *parhil, const MHillasSrc *parhilsrc,
     58MSelStandard::MSelStandard(const char *HilName, const char *HilSrcName,
    5759                           const char *name, const char *title)
    5860{
     
    6062    fTitle = title ? title : "Task to evaluate the Standard Cuts";
    6163
    62     fHil    = parhil;
    63     fHilsrc = parhilsrc;
     64    fHilName    = HilName;
     65    fHilSrcName = HilSrcName;
    6466}
    6567
     
    7274Bool_t MSelStandard::PreProcess(MParList *pList)
    7375{
     76    fHil    = (MHillasExt*)pList->FindObject(fHilName, "MHillasExt");
     77    if (!fHil)
     78    {
     79      *fLog << dbginf << "MHillasExt object " << fHilName << " not found... aborting." << endl;
     80      return kFALSE;
     81    }
     82
     83    fHilSrc = (MHillasSrc*)pList->FindObject(fHilSrcName, "MHillasSrc");
     84    if (!fHilSrc)
     85    {
     86      *fLog << dbginf << "MHillasSrc object " << fHilSrcName << " not found... aborting." << endl;
     87      return kFALSE;
     88    }
     89
     90
    7491    fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
    7592    if (!fMcEvt)
     
    95112    fMm2Deg = fCam->GetConvMm2Deg();
    96113
    97     *fLog << "fMm2Deg = " << fMm2Deg << endl;
     114    //*fLog << "fMm2Deg = " << fMm2Deg << endl;
    98115
    99116    memset(fErrors, 0, sizeof(fErrors));
     
    114131    Int_t rc = 0;
    115132
    116     //Double_t fLength       = fHil->GetLength() * fMm2Deg;
    117     //Double_t fWidth        = fHil->GetWidth()  * fMm2Deg;
    118     Double_t fDist         = fHilsrc->GetDist()* fMm2Deg;
     133    Double_t fLength       = fHil->GetLength() * fMm2Deg;
     134    Double_t fWidth        = fHil->GetWidth()  * fMm2Deg;
     135    Double_t fDist         = fHilSrc->GetDist()* fMm2Deg;
    119136    //Double_t fDelta        = fHil->GetDelta()  * kRad2Deg;
    120137    Double_t fSize         = fHil->GetSize();
     
    122139    Int_t fNumCorePixels   = fHil->GetNumCorePixels();
    123140
    124     if (     fSize <= 60.0         ||  fDist< 0.4           ||  fDist > 1.1 
    125          ||  fNumUsedPixels >= 92  ||  fNumCorePixels < 4)
     141    if ( fNumUsedPixels >= 92  ||  fNumCorePixels < 4 )
    126142    {
    127143      //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
     
    129145      //      << fNumCorePixels << endl;
    130146      rc = 1;
     147    }   
     148
     149    else if ( fSize <= 60.0         ||  fDist< 0.4           ||  fDist > 1.1 )
     150    {
     151      //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
     152      //      << fSize << ",  " << fDist << ",  " << fNumUsedPixels << ",  "
     153      //      << fNumCorePixels << endl;
     154      rc = 2;
     155    }   
     156
     157    else if ( fLength <= 0.0         ||  fWidth <= 0.0 )
     158    {
     159      //*fLog << "MSelStandard::Process; fLength, fWidth = "
     160      //      << fLength << ",  " << fWidth << endl;
     161      rc = 3;
    131162    }   
    132163
     
    149180    *fLog << GetDescriptor() << " execution statistics:" << endl;
    150181    *fLog << dec << setfill(' ');
    151     *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Standard selections are not fullfilled" << endl;
     182    *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3) << (int)(fErrors[1]*100/GetNumExecutions()) << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl;
     183
     184    *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3) << (int)(fErrors[2]*100/GetNumExecutions()) << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl;
     185
     186    *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3) << (int)(fErrors[3]*100/GetNumExecutions()) << "%) Evts skipped due to: Length or Width is <= 0" << endl;
    152187
    153188    *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions()) << "%) Evts survived Standard selections!" << endl;
     
    156191    return kTRUE;
    157192}
     193
     194
  • trunk/MagicSoft/Mars/manalysis/MSelStandard.h

    r1762 r1809  
    2323{
    2424private:
    25     const MGeomCam    *fCam;      // Camera Geometry
    26     const MCerPhotEvt *fEvt;      // Cerenkov Photon Event
    27     const MMcEvt      *fMcEvt;       
    28     const MHillas     *fHil;       
    29     const MHillasSrc  *fHilsrc;       
     25    MGeomCam    *fCam;      // Camera Geometry
     26    MCerPhotEvt *fEvt;      // Cerenkov Photon Event
     27    MMcEvt      *fMcEvt;       
     28    MHillas     *fHil;       
     29    MHillasSrc  *fHilSrc;       
    3030
    31           Double_t     fMm2Deg;   // conversion mm to degrees in camera
    32           Int_t        fErrors[2];
     31    Double_t     fMm2Deg;   // conversion mm to degrees in camera
     32    Int_t        fErrors[4];
     33    TString      fHilName;
     34    TString      fHilSrcName;
    3335
    3436public:
    35     MSelStandard(const MHillas *fHil, const MHillasSrc *fHilsrc,
     37    MSelStandard(const char *HilName, const char *HilSrcName,
    3638                 const char *name=NULL, const char *title=NULL);
    3739
Note: See TracChangeset for help on using the changeset viewer.