Changeset 7978


Ignore:
Timestamp:
09/28/06 09:45:39 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7977 r7978  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21 2006/09/28 Thomas Bretz
     22
     23   * mfilter/MFMagicCuts.[h,cc]:
     24     - implemented a hadronness cut as an option
     25     - updated class reference
     26
     27
    2028
    2129 2006/09/27 Daniela Dorner
  • trunk/MagicSoft/Mars/NEWS

    r7931 r7978  
    114114     with the colz draw-option
    115115
    116    - ganymed: now pruduces valid error codes if failed
     116   - ganymed: now produces valid error codes if failed
     117
     118   - ganymed: MFMagicCuts now supports a hadronness cut. Switch it on
     119     with the option "hadronness" instead of "area" or "both" if
     120     you want to use both cuts. The hadronness cut includes a fixed
     121     cut in hadronness (index 8) and a fixed cut in size (index 9).
     122
    117123
    118124
  • trunk/MagicSoft/Mars/mfilter/MFMagicCuts.cc

    r7780 r7978  
    2929//  Predefinitions:
    3030//  ---------------
    31 //
    32 //      m3long     = MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*fMM2Deg
    33 //      antim3long = MHillasExt.fM3Long*sign(MHillasSrcAnti.fCosDeltaAlpha)*fMM2Deg
     31//      width/length = MHillas.fWidth/MHillas.fLength
     32//      area         = MHillas.GetArea*fMm2Deg*fMm2Deg
     33//      lgsize       = log10(MHillas.fSize)
     34//
     35//      alpha        = MHillasSrc.fAlpha
     36//      dist         = MHillasSrc.fDist*fMm2Deg
     37//      leakage1     = log10(MNewImagePar.fLeakage1+1)
     38//
     39//      m3long       = MHillasExt.fM3Long*sign(MHillasSrc.fCosDeltaAlpha)*fMm2Deg
     40//      antim3long   = MHillasExt.fM3Long*sign(MHillasSrcAnti.fCosDeltaAlpha)*fMm2Deg
     41//
     42//      had          = Hadronness.fVal
    3443//
    3544//  Coefficients/Cuts:
     
    3746//
    3847//    c[0], c[5], c[6], c[7]:
    39 //          xi          = c[0]+c[6]*pow(Leakage1, c[7]);
     48//          xi          = c[0]+c[6]*pow(leakage1, c[7]);
    4049//          p           = xi*(1-width/length);
    4150//          disp        = TMath::Sign(disp, m3long-c[5])
     
    4756//          thetasq < c[1]*c[1]
    4857//
     58//    AreaCut:
    4959//    c[2], c[3], c[4]:
    5060//          A = c[2]*(1 - c[4]*(lgsize-c[3])*(lgsize-c[3]))
    5161//          area < A
     62//
     63//    HadronnessCut:
     64//    c[8], c[9]:
     65//          had       <= c[8]
     66//          10^lgsize >= c[9]
    5267//
    5368//
     
    113128MFMagicCuts::MFMagicCuts(const char *name, const char *title)
    114129    : fHil(0), fHilSrc(0), fHilAnti(0), fHilExt(0), fNewImgPar(0),
    115     fThetaSq(0), fDisp(0), fMatrix(0), fVariables(30), fThetaCut(kNone),
    116     fHadronnessCut(kAll)
     130    fThetaSq(0), fDisp(0), fHadronness(0), fMatrix(0), fVariables(30),
     131    fThetaCut(kNone), fHadronnessCut(kArea)
    117132{
    118133    fName  = name  ? name  : "MFMagicCuts";
     
    129144    AddToBranchList("MHillasExt.fM3Long");
    130145    AddToBranchList("MNewImagePar.fLeakage1");
    131 
     146    AddToBranchList("Hadronness.fVal");
     147/*
    132148    fVariables[0] =  1.42547;      // Xi
    133149    fVariables[1] =  0.233773;     // Theta^2
     
    137153    fVariables[5] = -0.0889;       // M3long
    138154    fVariables[6] =  0.18;         // Xi(theta)
     155    fVariables[7] =  0.18;         // Xi(theta)
     156    */
    139157}
    140158
     
    214232    }
    215233
     234    if (fHadronnessCut&kHadronness)
     235    {
     236        fHadronness = (MParameterD*)pList->FindObject("Hadronness", "MParameterD");
     237        if (!fHadronness)
     238        {
     239            *fLog << warn << "Hadronness [MParameterD] not found... aborting." << endl;
     240            return kFALSE;
     241        }
     242    }
     243
    216244    return kTRUE;
    217245}
     
    258286        fMap[kEDistAnti]   = fMatrix->AddColumn("MHillasSrcAnti.fDist*MGeomCam.fConvMm2Deg");
    259287    }
     288
     289    if (fHadronnessCut&kHadronness)
     290        fMap[kEHadronness] = fMatrix->AddColumn("Hadronness.fVal");
    260291}
    261292
     
    294325    const Double_t wdivl  = fMatrix ? GetVal(kEWdivL)   : fHil->GetWidth()/fHil->GetLength();
    295326    const Double_t lgsize = fMatrix ? GetVal(kESize)    : TMath::Log10(fHil->GetSize());
    296     //const Double_t zd     = fMatrix ? GetVal(kEZd)      : fPointing->GetZdRad();
    297327    const Double_t leak   = fMatrix ? GetVal(kELeakage) : TMath::Log10(fNewImgPar->GetLeakage1()+1);
    298328
     
    337367        if (area>=A)
    338368            return kTRUE;
    339 
    340         //const Double_t m3t  = fMatrix ? GetVal(kEM3Trans) : TMath::Abs(fHilExt->GetM3Trans())*fMm2Deg;
    341         //if (m3t>c[8])
    342         //    return kTRUE;
     369    }
     370
     371    // ---------------------------------------------------------------
     372    // ---------------------------------------------------------------
     373
     374    if (fHadronnessCut&kHadronness)
     375    {
     376        const Double_t had = fMatrix ? GetVal(kEHadronness) : fHadronness->GetVal();
     377        if (had>c[8])
     378            return kTRUE;
     379
     380        if (TMath::Power(10, lgsize)<c[9])
     381            return kTRUE;
    343382    }
    344383
     
    408447        *fLog << "none" << endl;
    409448        break;
    410     //case kArea:
    411     //    *fLog << "area" << endl;
    412     //    break;
     449    case kArea:
     450        *fLog << "area" << endl;
     451        break;
     452    case kHadronness:
     453        *fLog << "hadronness" << endl;
     454        break;
    413455    case kAll:
    414456        *fLog << "all" << endl;
     
    499541        if (str==(TString)"area")
    500542            fHadronnessCut = kArea;
     543        if (str==(TString)"hadronness")
     544            fHadronnessCut = kHadronness;
    501545        if (str==(TString)"all")
    502546            fHadronnessCut = kAll;
  • trunk/MagicSoft/Mars/mfilter/MFMagicCuts.h

    r7191 r7978  
    3232    // Possible kind of hadronness cuts
    3333    enum HadronnessCut_t {
    34         kNoCut =BIT(0),
    35         kArea  =BIT(1),
    36         kAll   =kArea
     34        kNoCut     =BIT(0),
     35        kArea      =BIT(1),
     36        kHadronness=BIT(2),
     37        kAll       =kArea|kHadronness
    3738    };
    3839
     
    4142    // the last on in the list. It is used as counter for fMap.
    4243    enum {
    43         kESize, kEAlpha, kEAlphaAnti, kEArea, kEDist, kEM3Long,
    44         kEM3LongAnti, kEM3Trans, kEDistAnti, kEWdivL, //kEZd,
    45         kELeakage, kESrcSign, //kEDelta, //kEMeanX, kEMeanY, kEDelta,
     44        kESize, kEAlpha, kEAlphaAnti, kEArea, kEDist,
     45        kEM3Long, kEM3LongAnti, kEM3Trans, kEDistAnti, kEWdivL,
     46        kELeakage, kESrcSign, kEHadronness,
    4647        kLastElement
    4748    };
     
    5455    MParameterD    *fThetaSq;           //! Pointer to MParameterD container called ThetaSq
    5556    MParameterD    *fDisp;              //! Pointer to MParameterD container called Disp
     57    MParameterD    *fHadronness;        //! Pointer to MParameterD container called Hadronness
    5658
    5759    Float_t         fMm2Deg;            //! Conversion factor from mm to deg, from MGeomCam
Note: See TracChangeset for help on using the changeset viewer.