Changeset 6932 for trunk/MagicSoft/Mars
- Timestamp:
- 04/12/05 17:05:49 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r6931 r6932 82 82 * mranforest/MRFEnergyEst.[h,cc]: 83 83 - replaced MEnergyEst by MParameterD 84 85 * mfileio/MReadTree.cc: 86 - shortened the output a bit when siwtching to the next file 84 87 85 88 -
trunk/MagicSoft/Mars/Makefile
r6855 r6932 66 66 mgui \ 67 67 mranforest \ 68 mhistmc \69 68 mjobs \ 70 69 mtools \ -
trunk/MagicSoft/Mars/ganymed.cc
r6907 r6932 143 143 arg.Print("options"); 144 144 gLog << endl; 145 return 2; 145 146 } 146 147 -
trunk/MagicSoft/Mars/manalysis/AnalysisLinkDef.h
r6915 r6932 12 12 #pragma link C++ class MMultiDimDistCalc+; 13 13 14 #pragma link C++ class MEnergyEst+;15 14 #pragma link C++ class MEnergyEstimate+; 16 15 -
trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.cc
r5956 r6932 47 47 48 48 #include "MDataChain.h" 49 #include "M EnergyEst.h"49 #include "MParameters.h" 50 50 51 51 #include "MLog.h" … … 107 107 Int_t MEnergyEstimate::PreProcess(MParList *plist) 108 108 { 109 fEnergy = (M EnergyEst*)plist->FindCreateObj("MEnergyEst");109 fEnergy = (MParameterD*)plist->FindCreateObj("MParameterD", "MEnergyEst"); 110 110 if (!fEnergy) 111 111 return kFALSE; … … 130 130 return kCONTINUE; 131 131 132 fEnergy->Set Energy(val);132 fEnergy->SetVal(val); 133 133 fEnergy->SetReadyToSave(); 134 134 return kTRUE; 135 } 136 137 // -------------------------------------------------------------------------- 138 // 139 // Print the rule used for energy estimation 140 // 141 void MEnergyEstimate::Print(Option_t *o) const 142 { 143 *fLog << all << GetDescriptor() << ":"; 144 if (!fData) 145 *fLog << " <n/a>" << endl; 146 else 147 *fLog << endl << fData->GetRule() << endl; 135 148 } 136 149 -
trunk/MagicSoft/Mars/manalysis/MEnergyEstimate.h
r5956 r6932 7 7 8 8 class MData; 9 class M EnergyEst;9 class MParameterD; 10 10 11 11 class MEnergyEstimate : public MTask 12 12 { 13 13 private: 14 MData *fData; //->15 M EnergyEst *fEnergy;14 MData *fData; //-> 15 MParameterD *fEnergy; //! 16 16 17 17 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); … … 28 28 void SetVariables(const TArrayD &); 29 29 30 ClassDef(MEnergyEstimate, 0) // Task to estimate the energy by a rule 30 void Print(Option_t *o="") const; 31 32 ClassDef(MEnergyEstimate, 1) // Task to estimate the energy by a rule 31 33 }; 32 34 -
trunk/MagicSoft/Mars/manalysis/Makefile
r6915 r6932 28 28 SRCFILES = MGeomApply.cc \ 29 29 MCameraData.cc \ 30 MEnergyEst.cc \31 30 MEnergyEstimate.cc \ 32 31 MMatrixLoop.cc \ -
trunk/MagicSoft/Mars/mbase/MStatusArray.cc
r4981 r6932 61 61 delete d; 62 62 return 0; 63 } 64 65 void MStatusArray::DisplayIn(MStatusDisplay &d, const char *tab) const 66 { 67 d.Display(*this, tab); 63 68 } 64 69 … … 149 154 { 150 155 if (!c) 156 { 157 gLog << warn << "Canvas '" << canvas << "' not found..." << endl; 151 158 return 0; 159 } 152 160 153 161 TObject *o = FindObjectInPad(c, object, cls); 154 162 if (!o) 163 { 164 gLog << warn << "Object '" << object << "' [" << base << "] not found in canvas '" << canvas << "'..." << endl; 155 165 return 0; 166 } 156 167 157 return o ->InheritsFrom(cls) ? o : 0;168 return o; //o->InheritsFrom(cls) ? o : 0; 158 169 } 159 170 … … 169 180 } 170 181 182 gLog << warn << "Object '" << object << "' [" << base << "] not found in canvas '" << canvas << "'..." << endl; 171 183 return NULL; 172 184 } -
trunk/MagicSoft/Mars/mbase/MStatusArray.h
r4966 r6932 10 10 class TVirtualPad; 11 11 12 class MStatusDisplay; 13 12 14 class MStatusArray : public TObjArray 13 15 { … … 18 20 public: 19 21 TObject *DisplayIn(Option_t *o=0) const; // *MENU* 22 void DisplayIn(MStatusDisplay &d, const char *tab=0) const; 20 23 TObject *Display() const { return DisplayIn(); } // *MENU* 21 24 -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
r6890 r6932 1686 1686 } 1687 1687 1688 Bool_t MStatusDisplay::Display(const TObjArray &list )1688 Bool_t MStatusDisplay::Display(const TObjArray &list, const char *tab) 1689 1689 { 1690 1690 TIter Next(&list); … … 1702 1702 while ((c=(TCanvas*)Next())) 1703 1703 //if (!GetCanvas(c->GetName())) 1704 if (!tab || c->GetName()==(TString)tab) 1704 1705 DrawClonePad(AddTab(c->GetName()), *c); 1705 1706 … … 1711 1712 // Reads the contents of a saved MStatusDisplay from a file. 1712 1713 // 1713 Int_t MStatusDisplay::Read(const char *name )1714 Int_t MStatusDisplay::Read(const char *name, const char *tab) 1714 1715 { 1715 1716 if (!gFile) … … 1734 1735 } 1735 1736 1736 if (!Display(list ))1737 if (!Display(list, tab)) 1737 1738 { 1738 1739 *fLog << err << "MStatusDisplay::Display: No entry in " << name << "." << endl; -
trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
r6890 r6932 122 122 void DrawClonePad(TCanvas &newc, TCanvas &oldc) const; 123 123 void CanvasSetFillColor(TPad &c, Int_t col) const; 124 Bool_t Display(const TObjArray &list );124 Bool_t Display(const TObjArray &list, const char *tab=0); 125 125 126 126 void AddExtension(TString &name, const TString &ext, Int_t num) const; … … 167 167 Int_t Write(Int_t num, const char *name="MStatusDisplay", Int_t option=0, Int_t bufsize=0) const; 168 168 169 Int_t Read(const char *name="MStatusDisplay"); 169 Int_t Read(const char *name, const char *tab); 170 Int_t Read(const char *name="MStatusDisplay") 171 { 172 return Read(name, 0); 173 } 170 174 Int_t Write(const char *name="MStatusDisplay", Int_t option=0, Int_t bufsize=0) 171 175 { -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r6913 r6932 390 390 { 391 391 case kPhe: 392 *fLog << warn << "WARNING - Renormalization to photo-electrons applied!" << endl;392 *fLog << inf << "Calibrating in units of equivalent (outer/inner=4) photo-electrons." << endl; 393 393 break; 394 394 case kPhot: 395 *fLog << inf << "Calibrating in units of photons." << endl; 395 396 break; 396 397 } … … 403 404 if (fCalibrations->GetSize() != npixels) 404 405 { 405 *fLog << err << GetDescriptor() 406 << ": Size mismatch between MGeomCam and MCalibrationChargeCam ... abort!" << endl; 406 *fLog << "Size mismatch between MGeomCam and MCalibrationChargeCam... abort!" << endl; 407 407 return kFALSE; 408 408 } … … 410 410 if (fBadPixels->GetSize() != npixels) 411 411 { 412 *fLog << err << GetDescriptor() 413 << ": Size mismatch between MGeomCam and MBadPixelsCam ... abort!" << endl; 412 *fLog << "Size mismatch between MGeomCam and MBadPixelsCam... abort!" << endl; 414 413 return kFALSE; 415 414 } … … 417 416 if (fBadPixels->GetSize() != npixels) 418 417 { 419 *fLog << err << GetDescriptor() 420 << ": Size mismatch between MGeomCam and MBadPixelsCam ... abort!" << endl; 418 *fLog << "Size mismatch between MGeomCam and MBadPixelsCam... abort!" << endl; 421 419 return kFALSE; 422 420 } -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r6242 r6932 270 270 Form("%s%2.1f%s","Time resolution less than ",fRelTimeResolutionLimit," FADC slices from Mean: ")); 271 271 PrintUncalibrated(MBadPixelsPix::kRelTimeOscillating, 272 "Pixels with changing Rel. Times over time:");272 "Pixels with changing Rel. Times over time: "); 273 273 PrintUncalibrated(MBadPixelsPix::kRelTimeNotFitted, 274 "Pixels with unsuccesful Gauss fit to the times: ");274 "Pixels with unsuccesful Gauss fit to the times: "); 275 275 276 276 if (asciilog) -
trunk/MagicSoft/Mars/mfbase/MF.cc
r6905 r6932 106 106 // Default Constructor. Don't use. 107 107 // 108 MF::MF() : fF(NULL) 108 MF::MF() : fF(NULL), fAllowEmpty(kFALSE) 109 109 { 110 110 fName = gsDefName.Data(); … … 117 117 // the class description above. 118 118 // 119 MF::MF(const char *text, const char *name, const char *title) 119 MF::MF(const char *text, const char *name, const char *title) : fAllowEmpty(kFALSE) 120 120 { 121 121 fName = name ? name : gsDefName.Data(); -
trunk/MagicSoft/Mars/mfbase/MF.h
r5911 r6932 21 21 static const TString gsDefTitle; //! 22 22 23 MFilter *fF; // Filter 23 MFilter *fF; // Filter 24 Bool_t fAllowEmpty; // Not a Bit to be stored 24 25 25 26 Int_t IsRule(TString &txt, TString &rule) const; … … 32 33 void StreamPrimitive(ofstream &out) const; 33 34 34 enum { kAllowEmpty = BIT(14) };35 36 35 public: 37 36 MF(); … … 40 39 41 40 // MF 42 void SetAllowEmpty(Bool_t b=kTRUE) { b ? SetBit(kAllowEmpty) : ResetBit(kAllowEmpty); }43 Bool_t IsAllowEmpty() const { return TestBit(kAllowEmpty); }41 void SetAllowEmpty(Bool_t b=kTRUE) { fAllowEmpty = b; } 42 Bool_t IsAllowEmpty() const { return fAllowEmpty; } 44 43 45 44 // MFilter … … 61 60 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 62 61 63 ClassDef(MF, 0) // A Filter for cuts in any data member62 ClassDef(MF, 1) // A Filter for cuts in any data member 64 63 }; 65 64 -
trunk/MagicSoft/Mars/mfileio/MReadTree.cc
r6513 r6932 277 277 return kFALSE; 278 278 279 *fLog << inf << GetDescriptor() << ": Switching to#" << GetFileIndex();280 *fLog << " '" << GetFileName() << "' ( before event #";279 *fLog << inf << GetDescriptor() << ": Next file #" << GetFileIndex(); 280 *fLog << " '" << GetFileName() << "' (next evt #"; 281 281 *fLog << GetNumEntry()-1 << ")" << endl; 282 282 -
trunk/MagicSoft/Mars/mhbase/MBinning.cc
r5971 r6932 248 248 str = str.Strip(TString::kBoth); 249 249 250 TString typ ;250 TString typ(str); 251 251 Ssiz_t pos = str.First(' '); 252 252 if (pos>=0) 253 253 { 254 254 typ = str(0, pos); 255 str.Remove(0, pos); 256 str = str.Strip(TString::kBoth); 255 257 if (typ!=(TString)"lin" && typ!=(TString)"log" && typ!=(TString)"cos") 256 258 { … … 261 263 262 264 SetEdges(nbins, loedge, upedge, typ.Data()); 263 264 str = str.Strip(TString::kBoth);265 265 266 266 if (!str.IsNull()) -
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r6907 r6932 57 57 #include "MSrcPosCam.h" 58 58 #include "MHillasSrc.h" 59 #include "MEnergyEst.h"60 59 #include "MTime.h" 61 60 #include "MObservatory.h" … … 116 115 fHEnergy.UseCurrentStyle(); 117 116 118 fHTheta.SetName(" Theta");117 fHTheta.SetName("ExcessTheta"); 119 118 fHTheta.SetTitle(" N_{exc} vs. \\Theta "); 120 119 fHTheta.SetXTitle("\\Theta [\\circ]"); … … 124 123 125 124 // effective on time versus time 126 fHTime.SetName(" Time");125 fHTime.SetName("ExcessTime"); 127 126 fHTime.SetTitle(" N_{exc} vs. Time "); 128 127 fHTime.SetXTitle("Time"); … … 268 267 } 269 268 */ 270 fEnergy = (M EnergyEst*)pl->FindObject("MEnergyEst");269 fEnergy = (MParameterD*)pl->FindObject("MEnergyEst", "MParameterD"); 271 270 if (!fEnergy) 272 271 { /* … … 277 276 } */ 278 277 279 *fLog << warn << "MEnergyEst not found... " << flush;278 *fLog << warn << "MEnergyEst [MParameterD] not found... " << flush; 280 279 281 280 if (!fHillas) … … 286 285 *fLog << "ignored." << endl; 287 286 288 fHEnergy.SetName(" Size");287 fHEnergy.SetName("ExcessSize"); 289 288 fHEnergy.SetTitle(" N_{exc} vs. Size "); 290 289 fHEnergy.SetXTitle("Size [\\gamma]"); … … 292 291 else 293 292 { 294 fHEnergy.SetName("E nergy");293 fHEnergy.SetName("ExcessEnergy"); 295 294 fHEnergy.SetTitle(" N_{exc} vs. E_{est} "); 296 295 fHEnergy.SetXTitle("E_{est} [GeV]"); … … 488 487 if (fHillas) 489 488 size = fHillas->GetSize(); 490 energy = fEnergy ? fEnergy->Get Energy() : (fHillas?fHillas->GetSize():1000);489 energy = fEnergy ? fEnergy->GetVal() : (fHillas?fHillas->GetSize():1000); 491 490 theta = fPointPos ? fPointPos->GetZd() : 0; 492 491 } … … 715 714 pad->cd(2); 716 715 gPad->SetBorderMode(0); 716 gPad->SetGridx(); 717 gPad->SetGridy(); 717 718 fHEnergy.Draw(); 718 719 … … 737 738 pad->cd(3); 738 739 gPad->SetBorderMode(0); 740 gPad->SetGridx(); 741 gPad->SetGridy(); 739 742 fHTime.Draw(); 740 743 AppendPad("time"); … … 746 749 { 747 750 pad->cd(4); 751 gPad->SetGridx(); 752 gPad->SetGridy(); 748 753 gPad->SetBorderMode(0); 749 754 fHTheta.Draw(); … … 910 915 if (type==0) 911 916 { 912 fMap[1] = fMatrix->AddColumn("MEnergyEst.f Energy");917 fMap[1] = fMatrix->AddColumn("MEnergyEst.fVal"); 913 918 fMap[2] = -1; 914 919 } -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r6907 r6932 20 20 class MParList; 21 21 class MParameterD; 22 class MEnergyEst;23 22 class MHillas; 24 23 class MHMatrix; … … 96 95 97 96 MParameterD *fResult; //! 98 M EnergyEst*fEnergy; //!97 MParameterD *fEnergy; //! 99 98 MHillas *fHillas; //! 100 99 MPointingPos *fPointPos; //! -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.cc
r6924 r6932 120 120 } 121 121 122 fEnergy = (M EnergyEst*)plist->FindObject("MEnergyEst");122 fEnergy = (MParameterD*)plist->FindObject("MEnergyEst", "MParameterD"); 123 123 if (!fEnergy) 124 124 { 125 *fLog << err << "MEnergyEst not found... aborting." << endl;125 *fLog << err << "MEnergyEst [MParameterD] not found... aborting." << endl; 126 126 return kFALSE; 127 127 } … … 160 160 Bool_t MHEnergyEst::Fill(const MParContainer *par, const Stat_t w) 161 161 { 162 const Double_t eest = fEnergy->Get Energy();162 const Double_t eest = fEnergy->GetVal(); 163 163 const Double_t etru = fMatrix ? GetVal(0) : fMcEvt->GetEnergy(); 164 164 const Double_t imp = fMatrix ? GetVal(1) : fMcEvt->GetImpact()/100; … … 185 185 fResult->SetVal(sigma); 186 186 187 *fLog << all << "Mean log10(Energy) Resoltion: " << Form("%.1f%%", TMath::Sqrt(fChisq-fBias*fBias)*100) << endl; 188 *fLog << all << "Mean log10(Energy) Bias: " << Form("%.1f%%", fBias*100) << endl; 187 Print(); 189 188 190 189 return kTRUE; 190 } 191 192 void MHEnergyEst::Print(Option_t *o) const 193 { 194 *fLog << all; 195 *fLog << "Mean log10(Energy) Resoltion: " << Form("%5.2f%%", TMath::Sqrt(fChisq-fBias*fBias)) << endl; 196 *fLog << "Mean log10(Energy) Bias: " << Form("%5.2f%%", fBias) << endl; 191 197 } 192 198 … … 298 304 gPad->SetGridy(); 299 305 306 // Results in crashes.... 300 307 //gROOT->GetListOfCleanups()->Add(gPad); // WHY? 301 308 … … 315 322 316 323 h2->Draw(""); 317 h1->Draw("E3 same");318 h1->Draw("Chistsame");324 h1->Draw("E3 hist C same"); 325 // h1->Draw("Chistsame"); 319 326 320 327 return h1; -
trunk/MagicSoft/Mars/mhflux/MHEnergyEst.h
r6890 r6932 15 15 16 16 class MMcEvt; 17 class MEnergyEst;18 17 class MParList; 19 18 class MParameterD; … … 24 23 private: 25 24 MMcEvt *fMcEvt; //! 26 M EnergyEst*fEnergy; //!25 MParameterD *fEnergy; //! 27 26 MParameterD *fResult; //! 28 27 … … 54 53 void Paint(Option_t *opt=""); 55 54 void Draw(Option_t *option=""); 55 void Print(Option_t *o="") const; 56 56 57 57 ClassDef(MHEnergyEst, 1) // -
trunk/MagicSoft/Mars/mjobs/MJOptimize.cc
r6924 r6932 109 109 #include "MFilterList.h" 110 110 #include "../mfilter/MFMagicCuts.h" 111 #include "../mfilter/MFMagicCuts2.h" 111 112 #include "MContinue.h" 112 113 #include "MGeomCamMagic.h" … … 333 334 void MJOptimize::AddPreCut(const char *rule) 334 335 { 335 fPreCuts.Add(new MF(rule)); 336 MFilter *f = new MF(rule); 337 f->SetBit(kCanDelete); 338 AddPreCut(f); 339 } 340 341 //------------------------------------------------------------------------ 342 // 343 // Add a cut which is used to fill the matrix. If kCanDelete is set 344 // MJOptimize takes the ownership. 345 // 346 void MJOptimize::AddPreCut(MFilter *f) 347 { 348 fPreCuts.Add(f); 336 349 } 337 350 … … 823 836 if (filter && filter->InheritsFrom(MFMagicCuts::Class())) 824 837 ((MFMagicCuts*)filter)->InitMapping(&m); 838 if (filter && filter->InheritsFrom(MFMagicCuts2::Class())) 839 ((MFMagicCuts2*)filter)->InitMapping(&m); 825 840 826 841 MReadTree read("Events"); … … 898 913 if (filter && filter->InheritsFrom(MFMagicCuts::Class())) 899 914 ((MFMagicCuts*)filter)->InitMapping(&m); 915 if (filter && filter->InheritsFrom(MFMagicCuts2::Class())) 916 ((MFMagicCuts2*)filter)->InitMapping(&m); 900 917 901 918 parlist.AddToList(&histon); … … 1025 1042 return kFALSE; 1026 1043 1044 hist.Print(); 1045 1027 1046 TObjArray cont; 1028 1047 cont.Add(&est); -
trunk/MagicSoft/Mars/mjobs/MJOptimize.h
r6924 r6932 101 101 void AddFilter(const char *rule); 102 102 void AddPreCut(const char *rule); 103 void AddPreCut(MFilter *f); 103 104 104 105 // Steering of optimization -
trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.cc
r6797 r6932 34 34 #include <TList.h> 35 35 36 #include <TH1 F.h>37 #include <TH2 F.h>36 #include <TH1.h> 37 #include <TH2.h> 38 38 #include <TStyle.h> 39 39 #include <TCanvas.h> 40 #include <TMath.h> 41 #include <TVector.h> 40 42 41 43 #include "MHMatrix.h" … … 53 55 54 56 #include "MData.h" 55 56 #include "TFile.h" 57 #include "TList.h" 58 59 #include "TH1F.h" 60 #include "TH2F.h" 61 #include "TStyle.h" 62 #include "TCanvas.h" 63 #include "TMath.h" 64 #include "TVector.h" 65 66 #include "MEnergyEst.h" 57 #include "MParameters.h" 67 58 68 59 … … 287 278 Double_t e_true = (*mptr)(i,ncols-1); 288 279 Double_t e_est = 0; 289 Double_t hmax = 0;280 //Double_t hmax = 0; 290 281 Double_t hsum = 0; 291 282 … … 388 379 Int_t MRFEnergyEst::PreProcess(MParList *plist) 389 380 { 390 fEnergyEst = (M EnergyEst*)plist->FindCreateObj("MEnergyEst");381 fEnergyEst = (MParameterD*)plist->FindCreateObj("MParameterD", "MEnergyEst"); 391 382 if (!fEnergyEst) 392 383 { 393 *fLog << err << dbginf << "MEnergyEst not found... aborting." << endl;384 *fLog << err << dbginf << "MEnergyEst [MParameterD] not found... aborting." << endl; 394 385 return kFALSE; 395 386 } … … 424 415 *fData >> event; 425 416 426 Double_t e _est = 0;427 Double_t hmax = 0;417 Double_t eest = 0; 418 //Double_t hmax = 0; 428 419 Double_t hsum = 0; 429 420 … … 438 429 }*/ 439 430 hsum+=h; 440 e _est+=h*e;441 } 442 e _est/=hsum;443 e _est=pow(10.,e_est);444 445 fEnergyEst->Set Energy(e_est);431 eest+=h*e; 432 } 433 eest/=hsum; 434 eest=pow(10.,eest); 435 436 fEnergyEst->SetVal(eest); 446 437 fEnergyEst->SetReadyToSave(); 447 438 448 439 return kTRUE; 449 440 } 450 451 Int_t MRFEnergyEst::PostProcess()452 {453 454 return kTRUE;455 } -
trunk/MagicSoft/Mars/mranforest/MRFEnergyEst.h
r6530 r6932 16 16 class MHMatrix; 17 17 class MDataArray; 18 class M EnergyEst;18 class MParameterD; 19 19 20 20 class MRFEnergyEst : public MTask … … 33 33 TObjArray fEForests; 34 34 35 M EnergyEst*fEnergyEst;35 MParameterD *fEnergyEst; 36 36 37 37 Int_t PreProcess(MParList *plist); 38 38 Int_t Process(); 39 Int_t PostProcess();40 39 41 40 Int_t ReadForests(MParList *plist=NULL);
Note:
See TracChangeset
for help on using the changeset viewer.