Changeset 1481 for trunk/MagicSoft/Mars/mfilter
- Timestamp:
- 08/05/02 14:30:21 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mfilter
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mfilter/MF.cc
r1283 r1481 71 71 #include "MF.h" 72 72 73 #include <ctype.h> // isalnum, ... 73 74 #include <stdlib.h> // strtod, ... 74 #include < ctype.h> // isalnum, ...75 #include <fstream.h> // ofstream, ... 75 76 76 77 #include <TMethodCall.h> … … 368 369 return fFilter->IsExpressionTrue(); 369 370 } 371 372 void MF::StreamPrimitive(ofstream &out) const 373 { 374 out << " MF " << ToLower(fName) << ""; 375 } 376 -
trunk/MagicSoft/Mars/mfilter/MF.h
r1283 r1481 24 24 MFilter *ParseString(TString txt, Int_t level); 25 25 26 void StreamPrimitive(ofstream &out) const; 27 26 28 public: 27 29 MF(const char *text, const char *name=NULL, const char *title=NULL); -
trunk/MagicSoft/Mars/mfilter/MFAlpha.cc
r1276 r1481 28 28 // // 29 29 ///////////////////////////////////////////////////////////////////////////// 30 31 30 #include "MFAlpha.h" 32 31 33 32 #include <math.h> 33 #include <fstream.h> 34 35 #include "MLog.h" 36 #include "MLogManip.h" 34 37 35 38 #include "MParList.h" 36 #include "MLog.h"37 #include "MLogManip.h"38 39 39 40 #include "MHillasSrc.h" … … 53 54 // -------------------------------------------------------------------------- 54 55 // 55 MFAlpha::MFAlpha( constMHillasSrc *hillas, const char type, const Float_t val,56 MFAlpha::MFAlpha(MHillasSrc *hillas, const char type, const Float_t val, 56 57 const char *name, const char *title) : fHillas(hillas) 57 58 { … … 111 112 } 112 113 114 void 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 18 18 { 19 19 private: 20 constMHillasSrc *fHillas;20 MHillasSrc *fHillas; 21 21 TString fContName; 22 22 … … 24 24 FilterType_t fFilterType; 25 25 26 Bool_t fResult; 26 Bool_t fResult; //! 27 27 Float_t fValue; // [deg] 28 28 … … 30 30 const char *name, const char *title); 31 31 32 void StreamPrimitive(ofstream &out) const; 33 32 34 public: 33 MFAlpha(const char 35 MFAlpha(const char *cname="MHillas", const char type='>', const Float_t deg=15, 34 36 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, 36 38 const char *name=NULL, const char *title=NULL); 37 39 … … 40 42 Bool_t Process(); 41 43 42 ClassDef(MFAlpha, 0) // A Filter for cuts in fabs(alpha)44 ClassDef(MFAlpha, 1) // A Filter for cuts in fabs(alpha) 43 45 }; 44 46 -
trunk/MagicSoft/Mars/mfilter/MFDataMember.cc
r1333 r1481 42 42 // 43 43 ///////////////////////////////////////////////////////////////////////////// 44 #include "MFDataMember.h" 44 45 45 #include "MFDataMember.h"46 #include <fstream.h> 46 47 47 48 #include <TMethodCall.h> … … 97 98 void MFDataMember::Print(Option_t *) const 98 99 { 99 fData.Print(); 100 *fLog << (fFilterType==kELowerThan?"<":">") << fValue << flush; 100 *fLog << GetRule() << flush; 101 101 } 102 103 void 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 111 TString 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 25 25 FilterType_t fFilterType; 26 26 27 Bool_t fResult; 27 Bool_t fResult; //! 28 28 Double_t fValue; 29 30 void StreamPrimitive(ofstream &out) const; 29 31 30 32 public: … … 37 39 38 40 void Print(Option_t *opt = "") const; 41 TString GetRule() const; 39 42 40 ClassDef(MFDataMember, 0) // A Filter for cuts in any data member43 ClassDef(MFDataMember, 1) // A Filter for cuts in any data member 41 44 }; 42 45 -
trunk/MagicSoft/Mars/mfilter/MFParticleId.cc
r1337 r1481 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // // 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 // 28 32 // // 29 33 ///////////////////////////////////////////////////////////////////////////// 30 31 34 #include "MFParticleId.h" 32 35 33 #include "MParList.h" 36 #include <fstream.h> 37 34 38 #include "MLog.h" 35 39 #include "MLogManip.h" 40 41 #include "MParList.h" 36 42 37 43 #include "MMcEvt.hxx" … … 51 57 // -------------------------------------------------------------------------- 52 58 // 53 MFParticleId::MFParticleId( constMMcEvt *mcevt, const char type, const Int_t val,59 MFParticleId::MFParticleId(MMcEvt *mcevt, const char type, const Int_t val, 54 60 const char *name, const char *title) : fMcEvt(mcevt) 55 61 { … … 117 123 } 118 124 125 void 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 18 18 { 19 19 private: 20 constMMcEvt *fMcEvt;20 MMcEvt *fMcEvt; 21 21 TString fContName; 22 22 … … 24 24 FilterType_t fFilterType; 25 25 26 Bool_t fResult; 26 Bool_t fResult; //! 27 27 Int_t fValue; 28 28 … … 30 30 const char *name, const char *title); 31 31 32 void StreamPrimitive(ofstream &out) const; 33 32 34 public: 33 35 MFParticleId(const char *cname="MMcEvt", const char type='=', const Int_t val=0, 34 36 const char *name=NULL, const char *title=NULL); 35 MFParticleId( constMMcEvt *mcevt, const char type='=', const Int_t val=0,37 MFParticleId(MMcEvt *mcevt, const char type='=', const Int_t val=0, 36 38 const char *name=NULL, const char *title=NULL); 37 39 … … 40 42 Bool_t Process(); 41 43 42 ClassDef(MFParticleId, 0) // A Filter for the Level 1 Trigger44 ClassDef(MFParticleId, 1) // A Filter for the Level 1 Trigger 43 45 }; 44 46 -
trunk/MagicSoft/Mars/mfilter/MFTriggerLvl1.cc
r1211 r1481 28 28 // // 29 29 ///////////////////////////////////////////////////////////////////////////// 30 31 30 #include "MFTriggerLvl1.h" 32 31 33 #include "MParList.h" 32 #include <fstream.h> 33 34 34 #include "MLog.h" 35 35 #include "MLogManip.h" 36 37 #include "MParList.h" 36 38 37 39 #include "MMcTrig.hxx" … … 51 53 // -------------------------------------------------------------------------- 52 54 // 53 MFTriggerLvl1::MFTriggerLvl1( constMMcTrig *mctrig, const char type, const Int_t val,55 MFTriggerLvl1::MFTriggerLvl1(MMcTrig *mctrig, const char type, const Int_t val, 54 56 const char *name, const char *title) : fMcTrig(mctrig) 55 57 { … … 116 118 } 117 119 120 void 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 18 18 { 19 19 private: 20 constMMcTrig *fMcTrig;20 MMcTrig *fMcTrig; 21 21 TString fContName; 22 22 23 23 typedef enum { kELowerThan, kEGreaterThan } FilterType_t; 24 FilterType_t fFilterType; 24 FilterType_t fFilterType; 25 25 26 Bool_t fResult; 26 Bool_t fResult; //! 27 27 Int_t fValue; 28 28 … … 30 30 const char *name, const char *title); 31 31 32 void StreamPrimitive(ofstream &out) const; 33 32 34 public: 33 35 MFTriggerLvl1(const char *cname="MMcTrig", const char type='>', const Int_t val=0, 34 36 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, 36 38 const char *name=NULL, const char *title=NULL); 37 39 … … 40 42 Bool_t Process(); 41 43 42 ClassDef(MFTriggerLvl1, 0)// A Filter for the Level 1 Trigger44 ClassDef(MFTriggerLvl1, 1) // A Filter for the Level 1 Trigger 43 45 }; 44 46
Note:
See TracChangeset
for help on using the changeset viewer.