Ignore:
Timestamp:
06/29/07 12:47:48 (17 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc

    r8613 r8619  
    1818!   Author(s): Thomas Bretz, 03/2005 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2005
     20!   Copyright: MAGIC Software Development, 2000-2007
    2121!
    2222!
     
    3838//      dist         = MHillasSrc.fDist*fMm2Deg
    3939//      m3long       = MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*fMm2Deg
     40//      slope        = MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)*fMm2Deg
    4041//
    4142//      antialpha    = MHillasSrcAnti.fAlpha
    4243//      antidist     = MHillasSrcAnti.fDist*fMm2Deg
    4344//      antim3long   = MHillasExt.fM3Long*sign(MHillasSrcAnti.fCosDeltaAlpha)*fMm2Deg
     45//      antislope    = MHillasExt.fSlopeLong*sign(MHillasSrcAnti.fCosDeltaAlpha)*fMm2Deg
    4446//
    4547//      had          = Hadronness.fVal
     
    4850//  ------------------
    4951//
    50 //    c[0], c[5], c[6], c[7]:
     52//    c[0],  c[5], c[6], c[7],  c[8], c[9]:
    5153//          xi          = c[0]+c[6]*pow(leakage1, c[7]);
    5254//          p           = xi*(1-width/length);
    53 //          disp        = TMath::Sign(disp, m3long-c[5])
    54 //          antidisp    = TMath::Sign(disp, antim3long-c[5])
     55//          sign1       = m3long-c[5]
     56//          sign2       = (dist-c[9])*c[8]-slope
     57//          disp        = sign1<0 ||sign2<0 ? -disp : disp
     58//          antisign1   = antim3long-c[5]
     59//          antisign2   = (antidist-c[9])*c[8]-antislope
     60//          antidisp    = antisign1<0 || antisign2<0 ? -antidisp : antidisp
    5561//          thetasq     = disp^2 + dist^2 - 2*disp*dist*alpha
    5662//          antithetasq = antidisp^2 + antidist^2 - 2*antidisp*antidist*antialpha
     
    6571//
    6672//    HadronnessCut:
    67 //    c[8], c[9]:
    68 //          had       <= c[8]
    69 //          10^lgsize >= c[9]
     73//    c[10], c[11]:
     74//          had       <= c[10]
     75//          10^lgsize >= c[11]
    7076//
    7177//
     
    150156    AddToBranchList("MHillasSrcAnti.fCosDeltaAlpha");
    151157    AddToBranchList("MHillasExt.fM3Long");
     158    AddToBranchList("MHillasExt.fSlopeLong");
    152159    AddToBranchList("MNewImagePar.fLeakage1");
    153160    AddToBranchList("Hadronness.fVal");
     
    277284    fMatrix = mat;
    278285
     286//    fMap[kELength] = fMatrix->AddColumn("MHillas.fLength*MGeomCam.fConvMm2Deg");
     287//    fMap[kEWidth]  = fMatrix->AddColumn("MHillas.fWidth*MGeomCam.fConvMm2Deg");
     288
    279289    fMap[kEWdivL]   = fMatrix->AddColumn("MHillas.fWidth/MHillas.fLength");
    280290    fMap[kESize]    = fMatrix->AddColumn("log10(MHillas.fSize)");
     
    289299    fMap[kESrcSign] = fMatrix->AddColumn("sign(MHillasSrc.fCosDeltaAlpha)");
    290300
     301    fMap[kESlope]   = fMatrix->AddColumn("MHillasExt.fSlopeLong*sign(MHillasSrc.fCosDeltaAlpha)/MGeomCam.fConvMm2Deg");
     302
    291303    if (fThetaCut&kOff)
    292304    {
     
    294306        fMap[kEDistAnti]   = fMatrix->AddColumn("MHillasSrcAnti.fDist*MGeomCam.fConvMm2Deg");
    295307        fMap[kEM3LongAnti] = fMatrix->AddColumn("MHillasExt.fM3Long*sign(MHillasSrcAnti.fCosDeltaAlpha)*MGeomCam.fConvMm2Deg");
     308        fMap[kESlopeAnti]  = fMatrix->AddColumn("MHillasExt.fSlopeLong*sign(MHillasSrcAnti.fCosDeltaAlpha)/MGeomCam.fConvMm2Deg");
    296309    }
    297310
     
    351364    const Double_t dist   = fMatrix ? GetVal(kEDist)    : fHilSrc->GetDist()*fMm2Deg;
    352365    const Double_t alpha  = fMatrix ? GetVal(kEAlpha)   : fHilSrc->GetAlpha();
     366    const Double_t sign   = fMatrix ? GetVal(kESrcSign) : MMath::Sgn(fHilSrc->GetCosDeltaAlpha());
    353367    const Double_t m3long = fMatrix ? GetVal(kEM3Long)  : fHilExt->GetM3Long()*TMath::Sign(fMm2Deg, fHilSrc->GetCosDeltaAlpha());
    354     const Double_t sign   = fMatrix ? GetVal(kESrcSign) : MMath::Sgn(fHilSrc->GetCosDeltaAlpha());
     368    const Double_t slope  = fMatrix ? GetVal(kESlope)   : fHilExt->GetSlopeLong()/TMath::Sign(fMm2Deg, fHilSrc->GetCosDeltaAlpha());
     369
     370        // Do Ghostbusting with slope and m3l
     371    const Double_t sign1 = (dist-c[9])*c[8]-slope;
     372    const Double_t sign2 = m3long-c[5];
     373    const Double_t p = sign1<0 || sign2<0 ? -disp : disp;
    355374
    356375    // Align disp along source direction depending on third moment
    357     const Double_t p = TMath::Sign(disp, m3long-c[5]);
     376    //const Double_t p = TMath::Sign(disp, m3long-c[5]);
    358377
    359378    // Align sign of disp along shower axis like m3long
     
    384403    {
    385404        const Double_t had = fMatrix ? GetVal(kEHadronness) : fHadronness->GetVal();
    386         if (had>c[8])
     405        if (had>c[10])
    387406            return kTRUE;
    388407
    389         if (TMath::Power(10, lgsize)<c[9])
     408        if (TMath::Power(10, lgsize)<c[11])
    390409            return kTRUE;
    391410    }
     
    399418        const Double_t alphaanti   = fMatrix ? GetVal(kEAlphaAnti)  : fHilAnti->GetAlpha();
    400419        const Double_t m3lanti     = fMatrix ? GetVal(kEM3LongAnti) : fHilExt->GetM3Long()*TMath::Sign(fMm2Deg, fHilAnti->GetCosDeltaAlpha());
    401 
    402         const Double_t panti       = TMath::Sign(disp, m3lanti-c[5]);
     420        const Double_t slopeanti   = fMatrix ? GetVal(kESlopeAnti)  : fHilExt->GetSlopeLong()/TMath::Sign(fMm2Deg, fHilAnti->GetCosDeltaAlpha());
     421
     422        // Do Ghostbusting with slope and m3l
     423        const Double_t sign3 = (distanti-c[9])*c[8]-slopeanti;
     424        const Double_t sign4 = m3lanti-c[5];
     425        const Double_t panti = sign3<0 || sign4<0 ? -disp : disp;
     426
     427        // Align disp along source direction depending on third moment
     428        //const Double_t panti       = TMath::Sign(disp, m3lanti-c[5]);
    403429        const Double_t thetasqanti = GetThetaSq(panti, wdivl, distanti, alphaanti);
    404430
Note: See TracChangeset for help on using the changeset viewer.