Ignore:
Timestamp:
04/02/03 09:03:22 (22 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/manalysis
Files:
8 edited

Legend:

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

    r1885 r1888  
    3838#include "MSrcPosCam.h"
    3939#include "MGeomCam.h"
     40#include "MParameters.h"
    4041
    4142#include "MLog.h"
     
    8182    }
    8283
     84    fHourAngle = (MParameterD*)pList->FindObject("HourAngle", "MParameterD");
     85    if (!fHourAngle)
     86    {
     87        *fLog << dbginf << "HourAngle not found... aborting." << endl;
     88        return kFALSE;
     89    }
     90
    8391
    8492    fSrcPos = (MSrcPosCam*)pList->FindObject(fSrcName, "MSrcPosCam");
     
    104112   // (cx, cy) is the source position in the camera [mm]
    105113   //
    106    Float_t fhourangle = fMcEvt->GetOtherCphFraction();
     114   Float_t fhourangle = fHourAngle->GetVal();
     115
     116   //*fLog << "MPointingCorr::Process; fhourangle = "
     117   //      << fhourangle << endl;
     118
    107119   Float_t cx = -0.05132 - 0.001064 * fhourangle
    108120                         - 3.530e-6 * fhourangle * fhourangle;
  • trunk/MagicSoft/Mars/manalysis/MPointingCorr.h

    r1868 r1888  
    1616class MMcEvt;
    1717class MSrcPosCam;
     18class MParameterD;
     19
    1820
    1921class MPointingCorr : public MTask
     
    2325    MSrcPosCam   *fSrcPos;
    2426    TString       fSrcName;
     27    MParameterD  *fHourAngle;
    2528
    2629    Float_t      fMm2Deg;
  • trunk/MagicSoft/Mars/manalysis/MSelBasic.cc

    r1885 r1888  
    6161    fTitle = title ? title : "Task to evaluate basic cuts";
    6262
    63     ThetaMin =  0.0;
    64     ThetaMax = 60.0;
     63    fThetaMin =  0.0;
     64    fThetaMax = 60.0;
    6565}
    6666
     
    109109    }
    110110
    111     memset(fErrors, 0, sizeof(fErrors));
     111    memset(fCut, 0, sizeof(fCut));
    112112
    113113    return kTRUE;
     
    123123Bool_t MSelBasic::Process()
    124124{
    125   /*
    126   //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    127   *fLog << "=========================================================" << endl;
    128   *fLog << "" << endl;
    129   *fLog << "MmcEvt data : " << endl;
    130   *fLog << "" << endl;
    131   fMcEvt->Print();
    132   *fLog << "" << endl;
    133   *fLog << "PartId() = " << fMcEvt->GetPartId() << endl;
    134   *fLog << "Energy() = " << fMcEvt->GetEnergy() << endl;
    135   *fLog << "Theta()  = " << fMcEvt->GetTheta() << endl;
    136 
    137   *fLog << "Phi()    = " << fMcEvt->GetPhi() << endl;
    138   //*fLog << "CoreD()  = " << fMcEvt->GetCoreD() << endl;
    139   //*fLog << "CoreX()  = " << fMcEvt->GetCoreX() << endl;
    140 
    141   //*fLog << "CoreY()  = " << fMcEvt->GetCoreY() << endl;
    142   *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;
    143   //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;
    144 
    145   //*fLog << "PassPhotAtm() = " << fMcEvt->GetPassPhotAtm() << endl;
    146   //*fLog << "PassPhotRef() = " << fMcEvt->GetPassPhotRef() << endl;
    147   //*fLog << "PassPhotCone()  = " << fMcEvt->GetPassPhotCone() << endl;
    148 
    149   //*fLog << "PhotElfromShower()    = " << fMcEvt->GetPhotElfromShower() << endl;
    150   //*fLog << "PhotElinCamera()  = " << fMcEvt->GetPhotElinCamera() << endl;
    151   *fLog << "TelescopePhi()  = " << fMcEvt->GetTelescopePhi() << endl;
    152 
    153   *fLog << "TelescopeTheta()  = " << fMcEvt->GetTelescopeTheta() << endl;
    154   *fLog << "Impact() = " << fMcEvt->GetImpact() << endl;
    155   //*fLog << "PhotIni()= " << fMcEvt->GetPhotIni() << endl;
    156   *fLog << "" << endl;
    157   *fLog << "=========================================================" << endl;
    158 
    159   *fLog << "=========================================================" << endl;
    160   *fLog << "" << endl;
    161   *fLog << "MPedestalPix data : " << endl;
    162   *fLog << "" << endl;
    163 
    164   Int_t ntot;
    165   ntot = fPed->GetSize();
    166     *fLog << "MeanRms() :" << endl;   
    167   for (Int_t i=0; i<ntot; i++)
    168   {
    169     MPedestalPix &pix = (*fPed)[i];
    170     //*fLog << "Mean()    = " << i << ",  " << pix.GetMean() << endl;   
    171     //*fLog << "Sigma()   = " << i << ",  " << pix.GetSigma() << endl;   
    172     *fLog << pix.GetMeanRms() << " ";   
    173     //*fLog << "SigmaRms()= " << i << ",  " << pix.GetSigmaRms() << endl;   
    174   }
    175   *fLog << "" << endl;
    176 
    177   *fLog << "" << endl;
    178   ntot = fEvt->GetNumPixels();
    179     *fLog << "MCerPhotPix :  pix.GetNumPhotons()" << endl;   
    180   for (Int_t i=0; i<ntot; i++)
    181   {
    182     MCerPhotPix &pix = (*fEvt)[i];
    183     *fLog << pix.GetNumPhotons() << " ";   
    184   }
    185   *fLog << "" << endl;
    186 
    187   *fLog << "" << endl;
    188   ntot = fEvt->GetNumPixels();
    189     *fLog << "MCerPhotPix :  pix.GetErrorPhot()" << endl;   
    190   for (Int_t i=0; i<ntot; i++)
    191   {
    192     MCerPhotPix &pix = (*fEvt)[i];
    193     *fLog << pix.GetErrorPhot() << " ";   
    194   }
    195   *fLog << "" << endl;
    196 
    197   //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
    198   */
    199 
    200 
    201125    Int_t rc = 0;
    202126
     
    207131    //}
    208132
    209     Double_t Theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
    210     if ( Theta < ThetaMin )
     133    Double_t theta = kRad2Deg*fMcEvt->GetTelescopeTheta();
     134    if ( theta < fThetaMin )
    211135    {
    212136      *fLog << "MSelBasic::Process; Run, Event, Theta = "
    213137            << fRawRun->GetRunNumber()<< ",  "
    214             << fMcEvt->GetEvtNumber() << ",  " << Theta << endl;
     138            << fMcEvt->GetEvtNumber() << ",  " << theta << endl;
    215139      rc = 1;
    216140    }   
    217141
    218     else if ( Theta > ThetaMax )
     142    else if ( theta > fThetaMax )
    219143    {
    220144      rc = 2;
     
    227151    }   
    228152
    229     fErrors[rc]++;
     153    fCut[rc]++;
    230154
    231155    return rc==0 ? kTRUE : kCONTINUE;
     
    246170    const Int_t entries = fEvt->GetNumPixels();
    247171 
    248     //$$$$$$$$$$$$$$$$$$
    249     //const Int_t nall = fPed->GetSize(); 
    250     //*fLog << "nall = " << nall << endl;
    251     //for (Int_t id=0; id<nall; id++)
    252     //{
    253     //  MGeomPix &gpix = (*fCam)[id];
    254     //  if ( gpix.IsInOutermostRing() )
    255     //  {
    256     //    *fLog << "IsInOutermostRing : pixel no. = " << id << endl;
    257     //  }
    258 
    259     //  if ( gpix.IsInOuterRing() )
    260     //  {
    261     //    *fLog << "IsInOuterRing : pixel no. = " << id << endl;
    262     //  }
    263     //}
    264     //$$$$$$$$$$$$$$$$$$
    265 
    266 
    267172    for (Int_t i=0; i<entries; i++)
    268173    {
     
    316221    *fLog << GetDescriptor() << " execution statistics:" << endl;
    317222    *fLog << dec << setfill(' ');
    318     *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3)
    319           << (int)(fErrors[1]*100/GetNumExecutions())
    320           << "%) Evts skipped due to: Zenith angle < " << ThetaMin << endl;
    321 
    322     *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3)
    323           << (int)(fErrors[2]*100/GetNumExecutions())
    324           << "%) Evts skipped due to: Zenith angle > " << ThetaMax << endl;
    325 
    326     *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3)
    327           << (int)(fErrors[3]*100/GetNumExecutions())
     223    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3)
     224          << (int)(fCut[1]*100/GetNumExecutions())
     225          << "%) Evts skipped due to: Zenith angle < " << fThetaMin << endl;
     226
     227    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3)
     228          << (int)(fCut[2]*100/GetNumExecutions())
     229          << "%) Evts skipped due to: Zenith angle > " << fThetaMax << endl;
     230
     231    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3)
     232          << (int)(fCut[3]*100/GetNumExecutions())
    328233          << "%) Evts skipped due to: Software trigger not fullfilled" << endl;
    329234
    330     *fLog << " " << fErrors[0] << " (" << (int)(fErrors[0]*100/GetNumExecutions())
     235    *fLog << " " << fCut[0] << " (" << (int)(fCut[0]*100/GetNumExecutions())
    331236          << "%) Evts survived Basic selections!" << endl;
    332237    *fLog << endl;
     
    336241
    337242
     243
     244
     245
     246
     247
     248
     249
  • trunk/MagicSoft/Mars/manalysis/MSelBasic.h

    r1872 r1888  
    2424{
    2525private:
    26     const MPedestalCam *fPed;      // Pedestal information
    27     const MGeomCam     *fCam;      // Camera Geometry
    28     const MCerPhotEvt  *fEvt;      // Cerenkov Photon Event
    29     const MMcEvt       *fMcEvt;       
     26    const MPedestalCam  *fPed;      // Pedestal information
     27    const MGeomCam      *fCam;      // Camera Geometry
     28    const MCerPhotEvt   *fEvt;      // Cerenkov Photon Event
     29    const MMcEvt        *fMcEvt;       
    3030    const MRawRunHeader *fRawRun;       
    3131
    32     Double_t     ThetaMin;
    33     Double_t     ThetaMax;
     32    Float_t     fThetaMin;
     33    Float_t     fThetaMax;
    3434
    35     Int_t        fErrors[4];
     35    Int_t        fCut[4];
    3636
    3737public:
     
    4343
    4444    Bool_t SwTrigger();
     45    void SetCuts(Float_t thetamin, Float_t thetamax)
     46         { fThetaMin = thetamin; fThetaMax = thetamax; }
    4547
    4648    ClassDef(MSelBasic, 0)   // Task to evaluate basic cuts
  • trunk/MagicSoft/Mars/manalysis/MSelFinal.cc

    r1885 r1888  
    6767    fHilSrcName = HilSrcName;
    6868
    69     fHadronnessCut =   0.2;
    70     fAlphaCut      = 100.0; //degrees
     69    // default values of cuts
     70    fHadronnessMax =   1.0;
     71    fAlphaMax      = 100.0; //degrees
    7172}
    7273
     
    109110    }
    110111
    111     memset(fErrors, 0, sizeof(fErrors));
     112    memset(fCut, 0, sizeof(fCut));
    112113
    113114    return kTRUE;
     
    133134    Double_t h = fHadronness->GetHadronness();
    134135
    135     if ( h>fHadronnessCut )
     136    if ( h>fHadronnessMax )
    136137    {
    137138      //*fLog << "MSelFinal::Process; h, alpha = " << h << ",  "
     
    140141    }   
    141142
    142     else if ( modalpha > fAlphaCut )
     143    else if ( modalpha > fAlphaMax )
    143144    {
    144145      //*fLog << "MSelFinal::Process; h, alpha = " << h << ",  "
     
    147148    }   
    148149
    149     fErrors[rc]++;
     150    fCut[rc]++;
    150151
    151152    return rc==0 ? kTRUE : kCONTINUE;
     
    164165    *fLog << GetDescriptor() << " execution statistics:" << endl;
    165166    *fLog << dec << setfill(' ');
    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;
     167    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3)
     168          << (int)(fCut[1]*100/GetNumExecutions())
     169          << "%) Evts skipped due to: hadroness > "<< fHadronnessMax << endl;
    170170
    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;
     171    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3)
     172          << (int)(fCut[2]*100/GetNumExecutions())
     173          << "%) Evts skipped due to: |ALPHA| > " << fAlphaMax
     174          << " [degrees]" << endl;
    175175
    176     *fLog << " " << fErrors[0] << " ("
    177           << (int)(fErrors[0]*100/GetNumExecutions())
     176    *fLog << " " << fCut[0] << " ("
     177          << (int)(fCut[0]*100/GetNumExecutions())
    178178          << "%) Evts survived Final selections!" << endl;
    179179    *fLog << endl;
  • trunk/MagicSoft/Mars/manalysis/MSelFinal.h

    r1847 r1888  
    3232
    3333    Double_t     fMm2Deg;   // conversion mm to degrees in camera
    34     Int_t        fErrors[3];
     34    Int_t        fCut[3];
    3535    TString      fHilName;
    3636    TString      fHilSrcName;
    3737 
    38     Float_t      fHadronnessCut;
    39     Float_t      fAlphaCut;
     38    Float_t      fHadronnessMax;
     39    Float_t      fAlphaMax;
    4040
    4141public:
     
    4747    Bool_t PostProcess();
    4848
    49     void SetHadronnessCut(Float_t hadcut) { fHadronnessCut = hadcut; }
    50     void SetAlphaCut(Float_t alpha)       { fAlphaCut      = alpha;  }
     49    void SetCuts(Float_t hadmax, Float_t alphamax)
     50         { fHadronnessMax = hadmax; fAlphaMax = alphamax;  }
    5151
    5252    ClassDef(MSelFinal, 0)   // Task to evaluate final cuts
  • trunk/MagicSoft/Mars/manalysis/MSelStandard.cc

    r1885 r1888  
    6464    fHilName    = HilName;
    6565    fHilSrcName = HilSrcName;
     66
     67    // default values of cuts
     68    fUsedPixelsMax =   92;
     69    fCorePixelsMin =    4;
     70    fSizeMin       =   60;
     71    fDistMin       =  0.4;
     72    fDistMax       = 1.05;
     73    fLengthMin     =  0.0;
     74    fWidthMin      =  0.0;
    6675}
    6776
     
    114123    //*fLog << "fMm2Deg = " << fMm2Deg << endl;
    115124
    116     memset(fErrors, 0, sizeof(fErrors));
     125    memset(fCut, 0, sizeof(fCut));
    117126
    118127    return kTRUE;
     
    131140    Int_t rc = 0;
    132141
    133     Double_t fLength       = fHil->GetLength() * fMm2Deg;
    134     Double_t fWidth        = fHil->GetWidth()  * fMm2Deg;
    135     Double_t fDist         = fHilSrc->GetDist()* fMm2Deg;
    136     //Double_t fDelta        = fHil->GetDelta()  * kRad2Deg;
    137     Double_t fSize         = fHil->GetSize();
    138     Int_t fNumUsedPixels   = fHil->GetNumUsedPixels();
    139     Int_t fNumCorePixels   = fHil->GetNumCorePixels();
    140 
    141     if ( fNumUsedPixels >= 92  ||  fNumCorePixels <= 4 )
    142     {
    143       //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
    144       //      << fSize << ",  " << fDist << ",  " << fNumUsedPixels << ",  "
    145       //      << fNumCorePixels << endl;
     142    Double_t length       = fHil->GetLength() * fMm2Deg;
     143    Double_t width        = fHil->GetWidth()  * fMm2Deg;
     144    Double_t dist         = fHilSrc->GetDist()* fMm2Deg;
     145    //Double_t delta        = fHil->GetDelta()  * kRad2Deg;
     146    Double_t size         = fHil->GetSize();
     147    Int_t numusedpixels   = fHil->GetNumUsedPixels();
     148    Int_t numcorepixels   = fHil->GetNumCorePixels();
     149
     150    if ( numusedpixels >= fUsedPixelsMax  ||  numcorepixels <= fCorePixelsMin )
     151    {
    146152      rc = 1;
    147153    }   
    148154
    149     else if ( fSize <= 60.0         ||  fDist< 0.4           ||  fDist > 1.05 )
    150     {
    151       //*fLog << "MSelStandard::Process; fSize, fDist, fNumUsedPixels, fNumCorePixels = "
    152       //      << fSize << ",  " << fDist << ",  " << fNumUsedPixels << ",  "
    153       //      << fNumCorePixels << endl;
     155    else if ( size <= fSizeMin )
     156    {
    154157      rc = 2;
    155158    }   
    156159
    157     else if ( fLength <= 0.0         ||  fWidth <= 0.0 )
    158     {
    159       //*fLog << "MSelStandard::Process; fLength, fWidth = "
    160       //      << fLength << ",  " << fWidth << endl;
     160    else if ( dist< fDistMin   ||  dist > fDistMax )
     161    {
    161162      rc = 3;
    162163    }   
    163164
    164 
    165     fErrors[rc]++;
     165    else if ( length <= fLengthMin   ||  width <= fWidthMin )
     166    {
     167      rc = 4;
     168    }   
     169
     170
     171    fCut[rc]++;
    166172
    167173    return rc==0 ? kTRUE : kCONTINUE;
     
    180186    *fLog << GetDescriptor() << " execution statistics:" << endl;
    181187    *fLog << dec << setfill(' ');
    182     *fLog << " " << setw(7) << fErrors[1] << " (" << setw(3)
    183           << (int)(fErrors[1]*100/GetNumExecutions())
    184           << "%) Evts skipped due to: Requirements on no.of used or core pxels not fullfilled" << endl;
    185 
    186     *fLog << " " << setw(7) << fErrors[2] << " (" << setw(3)
    187           << (int)(fErrors[2]*100/GetNumExecutions())
    188           << "%) Evts skipped due to: Requirements on SIZE or DIST not fullfilled" << endl;
    189 
    190     *fLog << " " << setw(7) << fErrors[3] << " (" << setw(3)
    191           << (int)(fErrors[3]*100/GetNumExecutions())
    192           << "%) Evts skipped due to: Length or Width is <= 0" << endl;
    193 
    194     *fLog << " " << fErrors[0] << " ("
    195           << (int)(fErrors[0]*100/GetNumExecutions())
     188    *fLog << " " << setw(7) << fCut[1] << " (" << setw(3)
     189          << (int)(fCut[1]*100/GetNumExecutions())
     190          << "%) Evts skipped due to: Used pixels >= " << fUsedPixelsMax
     191          << " or Core pixels <= " << fCorePixelsMin << endl;
     192
     193    *fLog << " " << setw(7) << fCut[2] << " (" << setw(3)
     194          << (int)(fCut[2]*100/GetNumExecutions())
     195          << "%) Evts skipped due to: SIZE <= " << fSizeMin << endl;
     196
     197    *fLog << " " << setw(7) << fCut[3] << " (" << setw(3)
     198          << (int)(fCut[3]*100/GetNumExecutions())
     199          << "%) Evts skipped due to: DIST < " << fDistMin
     200          << " or DIST > " << fDistMax << endl;
     201
     202    *fLog << " " << setw(7) << fCut[4] << " (" << setw(3)
     203          << (int)(fCut[4]*100/GetNumExecutions())
     204          << "%) Evts skipped due to: LENGTH <= " << fLengthMin
     205          << " or WIDTH <= " << fWidthMin << endl;
     206
     207    *fLog << " " << fCut[0] << " ("
     208          << (int)(fCut[0]*100/GetNumExecutions())
    196209          << "%) Evts survived Standard selections!" << endl;
    197210    *fLog << endl;
     
    201214
    202215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
  • trunk/MagicSoft/Mars/manalysis/MSelStandard.h

    r1847 r1888  
    3030
    3131    Double_t     fMm2Deg;   // conversion mm to degrees in camera
    32     Int_t        fErrors[4];
     32    Int_t        fCut[5];
    3333    TString      fHilName;
    3434    TString      fHilSrcName;
     35
     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;
    3543
    3644public:
     
    4250    Bool_t PostProcess();
    4351
     52    void SetCuts(Float_t usedpixelsmax, Float_t corepixelsmin,
     53                 Float_t sizemin, Float_t distmin, Float_t distmax,
     54                 Float_t lengthmin, Float_t widthmin)
     55      { fUsedPixelsMax = usedpixelsmax; fCorePixelsMin = corepixelsmin;
     56        fSizeMin = sizemin; fDistMin = distmin; fDistMax = distmax;
     57        fLengthMin = lengthmin; fWidthMin = widthmin; }
    4458
    4559    ClassDef(MSelStandard, 0)   // Task to evaluate standard cuts
Note: See TracChangeset for help on using the changeset viewer.