Changeset 5956 for trunk/MagicSoft
- Timestamp:
- 01/24/05 11:07:29 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r5952 r5956 21 21 -*-*- END OF LINE -*-*- 22 22 23 2005/01/24 Thomas Bretz 24 25 * callisto.cc: 26 - removed non-existing option from output 27 28 * manalysis/MEnergyEstimate.[h,cc]: 29 - added ReadEnv member function 30 31 * mbase/MContinue.[h,cc]: 32 - implementes AllowEmpty option to support doing nothing 33 defined in resource file 34 - added a first draft to allow usage of class-filters instead of 35 rules 36 37 * mbase/MMath.[h,cc]: 38 - implemented a function suggested by Florian Goebel which reduces 39 the precision of a float to ~0.5% which is usefull for data 40 compression by gzip 41 42 * mdata/MDataChain.[h,cc]: 43 - implemented ReadEnv member function 44 45 * mfbase/MF.cc: 46 - a small enhancement to the output in ReadEnv 47 48 * mhbase/MH3.cc: 49 - fixed call to FindObject in Paint which caused a profile to be 50 displayed incorrectly in case it was read from a file 51 52 * mhflux/MHFalseSource.[h,cc]: 53 - removed old obsolete unsused Significance functions 54 - implemented ReadEnv member function 55 56 * mjobs/MJCalibrateSignal.cc, mjobs/MJCalibration.cc, 57 mjobs/MJPedestal.cc: 58 - added an additional check and output if output-file could 59 not be opened 60 61 * mjobs/MJob.h: 62 - added some Getter 63 64 65 23 66 2005/01/24 Markus Gaug 24 67 … … 28 71 * msignal/MExtractedSignalPix.cc 29 72 - change sign of default initializer to negative. 73 74 30 75 31 76 2005/01/23 Markus Gaug … … 46 91 * mbadpixels/MBadPixelsCam.cc 47 92 - removed some bugs in the Print() function 93 94 48 95 49 96 2005/01/22 Markus Gaug … … 67 114 * macros/calibration.C 68 115 - update to changes in MJExtractCalibTest 116 117 69 118 70 119 2005/01/21 Markus Gaug -
trunk/MagicSoft/Mars/callisto.cc
r5832 r5956 58 58 gLog << " -q Quit when job is finished" << endl; 59 59 gLog << " -f Force overwrite of existing files" << endl; 60 gLog << " -ff Force execution if not all files found" << endl;60 //gLog << " -ff Force execution if not all files found" << endl; 61 61 gLog << " --ind=path Path where to search for the data files" << endl; 62 62 gLog << " [default=standard path in datacenter]" << endl; -
trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc
r5869 r5956 134 134 return kTRUE; 135 135 } 136 137 // -------------------------------------------------------------------------- 138 // 139 // Check for corresponding entries in resource file and setup filters. 140 // Avoid trailing 0's! 141 // 142 // Example: 143 // test.C: 144 // MEnergyEstimate est("MyEstimator"); 145 // 146 // test.rc: 147 // MyEstimator.Rule: {0} + {1} 148 // MyEstimator.0: log10(MHillas.fSize) 149 // MyEstimator.1: 5.5 150 // 151 // For more details see MDataChain::ReadEnv 152 // 153 Int_t MEnergyEstimate::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 154 { 155 MDataChain *f = new MDataChain; 156 f->SetName(fName); 157 158 const Bool_t rc = f->ReadEnv(env, prefix, print); 159 if (rc!=kTRUE) 160 { 161 delete f; 162 return rc; 163 } 164 165 delete fData; 166 fData = f; 167 168 if (!fData->IsValid()) 169 { 170 *fLog << err << "MEnergyEst::ReadEnv - ERROR: Inavlid rule from resource file." << endl; 171 return kERROR; 172 } 173 174 return kTRUE; 175 } -
trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h
r5869 r5956 14 14 MData *fData; //-> 15 15 MEnergyEst *fEnergy; 16 17 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 16 18 17 19 public: -
trunk/MagicSoft/Mars/mbase/MContinue.cc
r5910 r5956 73 73 // 74 74 MContinue::MContinue(const TString rule, const char *name, const char *title) 75 : fTaskList(0) 75 76 { 76 77 fName = name ? name : "MContinue"; … … 95 96 // 96 97 MContinue::MContinue(MFilter *f, const char *name, const char *title) 98 : fTaskList(0) 97 99 { 98 100 fName = name ? name : "MContinue"; … … 119 121 Int_t MContinue::PreProcess(MParList *list) 120 122 { 123 ResetBit(kFilterIsPrivate); 124 121 125 if (!GetFilter()) 122 126 { 127 if (IsAllowEmpty()) 128 { 129 *fLog << warn << GetDescriptor() << " - WARNING: Empty filter found... task removed." << endl; 130 return kSKIP; 131 } 132 123 133 *fLog << err << dbginf << "Unknown fatal Error! (fFilter=NULL?!?)" << endl; 124 134 return kFALSE; … … 144 154 } 145 155 156 // Make sure, that everything is correctly propageted to the childs 146 157 GetFilter()->SetDisplay(fDisplay); 147 158 GetFilter()->SetLogStream(fLog); 148 159 160 // Remeber that the filter is not already in tasklist 149 161 SetBit(kFilterIsPrivate); 150 162 … … 229 241 // MyContinue.0: MHillas.fSize>1000 230 242 // MyContinue.1: MHillas.fSize<10000 243 // or 244 // MyContinue.Condition: <MMyClass> 245 // MMyClass.Variable1: ... 246 // MMyClass.Variable2: ... 231 247 // 232 248 // For more details see MF::ReadEnv … … 234 250 Int_t MContinue::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 235 251 { 252 if (IsEnvDefined(env, prefix, "Condition", print)) 253 { 254 TString txt = GetEnvValue(env, prefix, "Condition", ""); 255 txt = txt.Strip(TString::kBoth); 256 if (txt.BeginsWith("<") && txt.EndsWith(">")) 257 { 258 *fLog << err << "NOT YET IMPLEMENTED..." << endl; 259 return kERROR; 260 } 261 } 262 236 263 MF *f = new MF; 237 264 f->SetName(fName); -
trunk/MagicSoft/Mars/mbase/MContinue.h
r5910 r5956 30 30 Int_t PostProcess(); 31 31 32 enum { kIsOwner = BIT(14), kFilterIsPrivate = BIT(15) };32 enum { kIsOwner = BIT(14), kFilterIsPrivate = BIT(15), kAllowEmpty = BIT(16) }; 33 33 34 34 public: … … 36 36 MContinue(MFilter *f, const char *name=NULL, const char *title=NULL); 37 37 ~MContinue(); 38 39 // MContinue 40 void SetAllowEmpty(Bool_t b=kTRUE) { b ? SetBit(kAllowEmpty) : ResetBit(kAllowEmpty); } 41 Bool_t IsAllowEmpty() const { return TestBit(kAllowEmpty); } 42 38 43 39 44 void SetInverted(Bool_t i=kTRUE); -
trunk/MagicSoft/Mars/mbase/MMath.cc
r5901 r5956 135 135 } 136 136 137 // -------------------------------------------------------------------------- 138 // 139 // This function truncates the precision to roughly 0.5% of a Float_t by 140 // changing its bit-pattern (Be carefull, in rare cases this function must 141 // be adapted to different machines!). This is usefull to enforce better 142 // compression by eg. gzip. 143 // 144 void MMath::TruncatePrecision(Float_t &val) 145 { 146 UInt_t &f = (UInt_t&)val; 147 148 f += 0x00004000; 149 f &= 0xffff8000; 150 } 151 137 152 // ------------------------------------------------------------------------- 138 153 // -
trunk/MagicSoft/Mars/mbase/MMath.h
r5832 r5956 18 18 Double_t SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha=1); 19 19 20 void TruncatePrecision(Float_t &val); 21 20 22 TVector3 GetParab(const TVector3 &x, const TVector3 &y); 21 23 Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x); -
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r5832 r5956 749 749 return fMember->SetVariables(arr); 750 750 } 751 752 // -------------------------------------------------------------------------- 753 // 754 // Check for corresponding entries in resource file and setup data chain. 755 // 756 // Assuming your MDataChain is called (Set/GetName): MyData 757 // 758 // Now setup the condition, eg: 759 // MyData.Rule: log10(MHillas.fSize) 760 // or 761 // MyData.Rule: log10(MHillas.fSize) - 4.1 762 // 763 // If you want to use more difficult rules you can split the 764 // condition into subrules. Subrules are identified 765 // by {}-brackets. Avoid trailing 0's! For example: 766 // 767 // MyData.Rule: log10(MHillas.fSize) + {0} - {1} 768 // MyData.0: 5.5*MHillas.fSize 769 // MyData.1: 2.3*log10(MHillas.fSize) 770 // 771 // The numbering must be continous and start with 0. You can use 772 // a subrules more than once. All {}-brackets are simply replaced 773 // by the corresponding conditions. The rules how conditions can 774 // be written can be found in the class description of MDataChain. 775 // 776 Int_t MDataChain::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 777 { 778 Bool_t rc = kFALSE; 779 if (!IsEnvDefined(env, prefix, "Rule", print)) 780 return rc; 781 782 TString rule = GetEnvValue(env, prefix, "Rule", ""); 783 rule.ReplaceAll(" ", ""); 784 785 Int_t idx=0; 786 while (1) 787 { 788 TString cond; 789 if (IsEnvDefined(env, prefix, Form("%d", idx), print)) 790 { 791 cond += "("; 792 cond += GetEnvValue(env, prefix, Form("%d", idx), ""); 793 cond += ")"; 794 } 795 796 if (cond.IsNull()) 797 break; 798 799 rule.ReplaceAll(Form("{%d}", idx), cond); 800 idx++; 801 } 802 803 if (fMember) 804 { 805 delete fMember; 806 fMember = 0; 807 } 808 809 if (rule.IsNull()) 810 { 811 *fLog << warn << "MDataChain::ReadEnv - ERROR: Empty rule found." << endl; 812 return kERROR; 813 } 814 815 if (!(fMember=ParseString(rule, 1))) 816 { 817 *fLog << err << "MDataChain::ReadEnv - ERROR: Parsing '" << rule << "' failed." << endl; 818 return kERROR; 819 } 820 821 if (print) 822 { 823 *fLog << inf << "found: "; 824 fMember->Print(); 825 *fLog << endl; 826 } 827 828 return kTRUE; 829 } -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r3788 r5956 17 17 { 18 18 private: 19 MData 19 MData *fMember; // Filter 20 20 21 21 // PLEASE, always add new enums to the end of the enumeration, … … 54 54 ~MDataChain(); 55 55 56 // MData 56 57 Double_t GetValue() const; 57 Bool_t PreProcess(const MParList *plist);58 58 59 59 Bool_t IsValid() const { return fMember ? kTRUE : kFALSE; } 60 Bool_t IsReadyToSave() const; 61 62 // void Print(Option_t *opt = "") const; 60 Bool_t PreProcess(const MParList *plist); 63 61 64 62 TString GetRule() const; 65 63 TString GetDataMember() const; 66 64 65 // MParContainer 66 Bool_t IsReadyToSave() const; 67 67 void SetVariables(const TArrayD &arr); 68 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 68 69 69 70 ClassDef(MDataChain, 1) // A chain/concatenation of MData objects -
trunk/MagicSoft/Mars/mfbase/MF.cc
r5924 r5956 478 478 479 479 if (!IsEnvDefined(env, prefix, "Condition", print)) 480 { 481 if (rc) 482 { 483 *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: No condition found." << endl; 484 SetAllowEmpty(); 485 } 480 486 return rc; 487 } 481 488 482 489 TString rule = GetEnvValue(env, prefix, "Condition", ""); … … 509 516 if (rule.IsNull()) 510 517 { 511 *fLog << warn << "MF::ReadEnv - WARNING: Empty condition found." << endl;518 *fLog << warn << GetDescriptor() << " ::ReadEnv - WARNING: Empty condition found." << endl; 512 519 SetAllowEmpty(); 513 520 return kTRUE; -
trunk/MagicSoft/Mars/mhbase/MH3.cc
r5620 r5956 546 546 547 547 // FIXME: We may have to remove all our own options from str! 548 if (!only && !gPad-> GetListOfPrimitives()->FindObject(fHist))548 if (!only && !gPad->FindObject(fHist)) 549 549 fHist->Draw(str); 550 550 … … 552 552 { 553 553 TProfile *p = ((TH2*)fHist)->ProfileX("ProfX", -1, 9999, "s"); 554 if (!gPad-> GetListOfPrimitives()->FindObject(p))554 if (!gPad->FindObject(p)) 555 555 { 556 556 p->UseCurrentStyle(); … … 566 566 { 567 567 TProfile *p = ((TH2*)fHist)->ProfileY("ProfY", -1, 9999, "s"); 568 if (!gPad-> GetListOfPrimitives()->FindObject(p))568 if (!gPad->FindObject(p)) 569 569 { 570 570 p->UseCurrentStyle();
Note:
See TracChangeset
for help on using the changeset viewer.