Ignore:
Timestamp:
08/05/02 14:30:21 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mfilter
Files:
10 edited

Legend:

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

    r1283 r1481  
    7171#include "MF.h"
    7272
     73#include <ctype.h>        // isalnum, ...
    7374#include <stdlib.h>       // strtod, ...
    74 #include <ctype.h>        // isalnum, ...
     75#include <fstream.h>      // ofstream, ...
    7576
    7677#include <TMethodCall.h>
     
    368369    return fFilter->IsExpressionTrue();
    369370}
     371
     372void MF::StreamPrimitive(ofstream &out) const
     373{
     374    out << "   MF " << ToLower(fName) << "";
     375}
     376
  • trunk/MagicSoft/Mars/mfilter/MF.h

    r1283 r1481  
    2424    MFilter *ParseString(TString txt, Int_t level);
    2525
     26    void StreamPrimitive(ofstream &out) const;
     27
    2628public:
    2729    MF(const char *text, const char *name=NULL, const char *title=NULL);
  • trunk/MagicSoft/Mars/mfilter/MFAlpha.cc

    r1276 r1481  
    2828//                                                                         //
    2929/////////////////////////////////////////////////////////////////////////////
    30 
    3130#include "MFAlpha.h"
    3231
    3332#include <math.h>
     33#include <fstream.h>
     34
     35#include "MLog.h"
     36#include "MLogManip.h"
    3437
    3538#include "MParList.h"
    36 #include "MLog.h"
    37 #include "MLogManip.h"
    3839
    3940#include "MHillasSrc.h"
     
    5354// --------------------------------------------------------------------------
    5455//
    55 MFAlpha::MFAlpha(const MHillasSrc *hillas, const char type, const Float_t val,
     56MFAlpha::MFAlpha(MHillasSrc *hillas, const char type, const Float_t val,
    5657                 const char *name, const char *title) : fHillas(hillas)
    5758{
     
    111112}
    112113
     114void MFAlpha::StreamPrimitive(ofstream &out) const
     115{
     116    if (fHillas)
     117        fHillas->SavePrimitive(out);
     118
     119    out << "   MFParticleId " << ToLower(fName) << "(";
     120
     121    if (fHillas)
     122        out << "&" << ToLower(fHillas->GetName());
     123    else
     124        out << "\"" << fContName << "\"";
     125
     126    out << ", '" << (fFilterType==kELowerThan?"<":">") << "', " << fValue << ");" << endl;
     127
     128}
  • trunk/MagicSoft/Mars/mfilter/MFAlpha.h

    r1276 r1481  
    1818{
    1919private:
    20     const MHillasSrc *fHillas;
     20    MHillasSrc *fHillas;
    2121    TString fContName;
    2222
     
    2424    FilterType_t fFilterType;
    2525
    26     Bool_t  fResult;
     26    Bool_t  fResult; //!
    2727    Float_t fValue; // [deg]
    2828
     
    3030              const char *name, const char *title);
    3131
     32    void StreamPrimitive(ofstream &out) const;
     33
    3234public:
    33     MFAlpha(const char       *cname="MHillas", const char type='>', const Float_t deg=15,
     35    MFAlpha(const char *cname="MHillas", const char type='>', const Float_t deg=15,
    3436            const char *name=NULL, const char *title=NULL);
    35     MFAlpha(const MHillasSrc *hillas,          const char type='>', const Float_t deg=15,
     37    MFAlpha(MHillasSrc *hillas, const char type='>', const Float_t deg=15,
    3638            const char *name=NULL, const char *title=NULL);
    3739
     
    4042    Bool_t Process();
    4143
    42     ClassDef(MFAlpha, 0) // A Filter for cuts in fabs(alpha)
     44    ClassDef(MFAlpha, 1) // A Filter for cuts in fabs(alpha)
    4345};
    4446
  • trunk/MagicSoft/Mars/mfilter/MFDataMember.cc

    r1333 r1481  
    4242//
    4343/////////////////////////////////////////////////////////////////////////////
     44#include "MFDataMember.h"
    4445
    45 #include "MFDataMember.h"
     46#include <fstream.h>
    4647
    4748#include <TMethodCall.h>
     
    9798void MFDataMember::Print(Option_t *) const
    9899{
    99     fData.Print();
    100     *fLog << (fFilterType==kELowerThan?"<":">") << fValue << flush;
     100    *fLog << GetRule() << flush;
    101101}
     102
     103void MFDataMember::StreamPrimitive(ofstream &out) const
     104{
     105    out << "   MFDataMember " << ToLower(fName) << "(\"";
     106    out << fData.GetRule() << "\", '";
     107    out << (fFilterType==kELowerThan?"<":">");
     108    out << "', " << fValue << ");" << endl;
     109}
     110
     111TString MFDataMember::GetRule() const
     112{
     113    TString ret = fData.GetRule();
     114    ret += fFilterType==kELowerThan?"<":">";
     115    ret += fValue;
     116    return ret;
     117}
     118
  • trunk/MagicSoft/Mars/mfilter/MFDataMember.h

    r1333 r1481  
    2525    FilterType_t fFilterType;
    2626
    27     Bool_t  fResult;
     27    Bool_t  fResult;           //!
    2828    Double_t fValue;
     29
     30    void StreamPrimitive(ofstream &out) const;
    2931
    3032public:
     
    3739
    3840    void Print(Option_t *opt = "") const;
     41    TString GetRule() const;
    3942
    40     ClassDef(MFDataMember, 0) // A Filter for cuts in any data member
     43    ClassDef(MFDataMember, 1) // A Filter for cuts in any data member
    4144};
    4245
  • trunk/MagicSoft/Mars/mfilter/MFParticleId.cc

    r1337 r1481  
    2525/////////////////////////////////////////////////////////////////////////////
    2626//                                                                         //
    27 //   MFParticleId                                                         //
     27//   MFParticleId                                                          //
     28//                                                                         //
     29//  A filter to choose between different particle types, identified by     //
     30//  their monte carlo particle type. For a list of idetifiers see          //
     31//  mbase/MAGIC.h                                                          //
    2832//                                                                         //
    2933/////////////////////////////////////////////////////////////////////////////
    30 
    3134#include "MFParticleId.h"
    3235
    33 #include "MParList.h"
     36#include <fstream.h>
     37
    3438#include "MLog.h"
    3539#include "MLogManip.h"
     40
     41#include "MParList.h"
    3642
    3743#include "MMcEvt.hxx"
     
    5157// --------------------------------------------------------------------------
    5258//
    53 MFParticleId::MFParticleId(const MMcEvt *mcevt, const char type, const Int_t val,
     59MFParticleId::MFParticleId(MMcEvt *mcevt, const char type, const Int_t val,
    5460                           const char *name, const char *title) : fMcEvt(mcevt)
    5561{
     
    117123}
    118124
     125void MFParticleId::StreamPrimitive(ofstream &out) const
     126{
     127    if (fMcEvt)
     128        fMcEvt->SavePrimitive(out);
     129
     130    out << "   MFParticleId " << ToLower(fName) << "(";
     131
     132    if (fMcEvt)
     133        out << "&" << ToLower(fMcEvt->GetName());
     134    else
     135        out << "\"" << fContName << "\"";
     136
     137    out << ", '" << (fFilterType==kEEqual?"=":"!") << "', ";
     138
     139    switch (fValue)
     140    {
     141    case kGAMMA:
     142        out << "kGAMMA";
     143        break;
     144    case kPROTON:
     145        out << "kPROTON";
     146        break;
     147    case kHELIUM:
     148        out << "kHELIUM";
     149        break;
     150    case kOXYGEN:
     151        out << "kOXYGEN";
     152        break;
     153    case kIRON:
     154        out << "kIRON";
     155        break;
     156    default:
     157        out << fValue;
     158    }
     159    out << ");" << endl;
     160}
  • trunk/MagicSoft/Mars/mfilter/MFParticleId.h

    r1337 r1481  
    1818{
    1919private:
    20     const MMcEvt *fMcEvt;
     20    MMcEvt *fMcEvt;
    2121    TString fContName;
    2222
     
    2424    FilterType_t fFilterType;
    2525
    26     Bool_t fResult;
     26    Bool_t fResult;    //!
    2727    Int_t  fValue;
    2828
     
    3030              const char *name, const char *title);
    3131
     32    void StreamPrimitive(ofstream &out) const;
     33
    3234public:
    3335    MFParticleId(const char *cname="MMcEvt", const char type='=', const Int_t val=0,
    3436                 const char *name=NULL, const char *title=NULL);
    35     MFParticleId(const MMcEvt *mcevt, const char type='=', const Int_t val=0,
     37    MFParticleId(MMcEvt *mcevt, const char type='=', const Int_t val=0,
    3638                 const char *name=NULL, const char *title=NULL);
    3739
     
    4042    Bool_t Process();
    4143
    42     ClassDef(MFParticleId, 0)           // A Filter for the Level 1 Trigger
     44    ClassDef(MFParticleId, 1)           // A Filter for the Level 1 Trigger
    4345};
    4446
  • trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc

    r1211 r1481  
    2828//                                                                         //
    2929/////////////////////////////////////////////////////////////////////////////
    30 
    3130#include "MFTriggerLvl1.h"
    3231
    33 #include "MParList.h"
     32#include <fstream.h>
     33
    3434#include "MLog.h"
    3535#include "MLogManip.h"
     36
     37#include "MParList.h"
    3638
    3739#include "MMcTrig.hxx"
     
    5153// --------------------------------------------------------------------------
    5254//
    53 MFTriggerLvl1::MFTriggerLvl1(const MMcTrig *mctrig, const char type, const Int_t val,
     55MFTriggerLvl1::MFTriggerLvl1(MMcTrig *mctrig, const char type, const Int_t val,
    5456                             const char *name, const char *title) : fMcTrig(mctrig)
    5557{
     
    116118}
    117119
     120void MFTriggerLvl1::StreamPrimitive(ofstream &out) const
     121{
     122    if (fMcTrig)
     123        fMcTrig->SavePrimitive(out);
     124
     125    out << "   MFTriggerLvl1 " << ToLower(fName) << "(";
     126
     127    if (fMcTrig)
     128        out << "&" << ToLower(fMcTrig->GetName());
     129    else
     130        out << "\"" << fContName << "\"";
     131
     132    out << ", '" << (fFilterType==kELowerThan?"<":">") << "', " << fValue << ");" << endl;
     133
     134}
  • trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.h

    r1211 r1481  
    1818{
    1919private:
    20     const MMcTrig *fMcTrig;
     20    MMcTrig *fMcTrig;
    2121    TString fContName;
    2222
    2323    typedef enum { kELowerThan, kEGreaterThan } FilterType_t;
    24     FilterType_t fFilterType;
     24    FilterType_t fFilterType; 
    2525
    26     Bool_t fResult;
     26    Bool_t fResult;             //!
    2727    Int_t  fValue;
    2828
     
    3030              const char *name, const char *title);
    3131
     32    void StreamPrimitive(ofstream &out) const;
     33
    3234public:
    3335    MFTriggerLvl1(const char *cname="MMcTrig", const char type='>', const Int_t val=0,
    3436                  const char *name=NULL, const char *title=NULL);
    35     MFTriggerLvl1(const MMcTrig *mctrig,      const char type='>', const Int_t val=0,
     37    MFTriggerLvl1(MMcTrig *mctrig, const char type='>', const Int_t val=0,
    3638                  const char *name=NULL, const char *title=NULL);
    3739
     
    4042    Bool_t Process();
    4143
    42     ClassDef(MFTriggerLvl1, 0)          // A Filter for the Level 1 Trigger
     44    ClassDef(MFTriggerLvl1, 1) // A Filter for the Level 1 Trigger
    4345};
    4446
Note: See TracChangeset for help on using the changeset viewer.