Changeset 1880
- Timestamp:
- 03/31/03 10:37:56 (22 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r1879 r1880 1 1 -*-*- END OF LINE -*-*- 2 3 2003/03/31: Thomas Bretz 4 5 * Makefile.conf.linux: 6 - removed -fno-rtti to make it compatible with root 3.04.02 7 8 * NEWS: 9 - changed 10 11 * manalysis/MImgCleanStd.[h,cc]: 12 - added SetLvl1 13 - added SetLvl2 14 - added ReadEnv 15 16 * manalysis/MNewImagePar.[h,cc]: 17 - removed unnecessary fHillas data member 18 - removed unnecessary fSrcPos data member 19 - removed unnecessary Set/GetSrcPos 20 21 * manalysis/MNewImageParCalc.[h,cc]: 22 - removed unnecessary SetSrcPos 23 - removed const-qualifier from fGeomCam, fCerPhotEvt 24 (trouble with root 3.02/06) 25 26 * manalysis/MRanForest.cc: 27 - changed cout-output 28 29 * manalysis/MSigmabar.cc: 30 - changed Area to area (local variable) 31 32 * mbase/MEvtLoop.[h,cc]: 33 - added evtloop name to constructor (default=Evtloop) 34 - adapted StreamPrimitive 35 - added ReadEnv 36 - added WriteEnv 37 38 * mbase/MParContainer.[h,cc]: 39 - removed TROOT.h 40 - fixed const-qualifier for Copy-function for root>3.04.01 41 - added ReadEnv 42 - added WriteEnv 43 - added IsEnvDefined 44 - added GetEnvValue 45 46 * mbase/MParList.[h,cc], mbase/MTaskList.[h,cc]: 47 - added ReadEnv 48 - added WriteEnv 49 50 * mfileio/MCT1ReadAscii.[h,cc], mfileio/MCT1ReadPreProc.[h,cc]: 51 - changed AddFile declaration to declaration in MRead 52 - added return value to AddFile 53 54 * mfileio/MRead.[h,cc]: 55 - added template for AddFile 56 - added ReadEnv 57 58 * mgui/MHexagon.[h,cc]: 59 - fixed const-qualifier for Copy-function for root>3.04.01 60 61 * mhist/MH.cc: 62 - fixed the FindGoodLimit stuff for root> 3.04.01 63 64 * mhist/MHRanForest.[h,cc], mhist/MHRanForestGini.[h,cc]: 65 - removed unnecessary casts 66 - fixed a copilation error with root 3.04.01 (kFullDotlarge 67 doesn't exist) 68 - removed second Draw (one should not add something twice to 69 the pad) 70 71 * mmontecarlo/MMcTriggerRateCalc.cc: 72 - changes to the header 73 - changes to the fLog stuff 74 - added a cast to get rid of a warning 75 76 * mtools/Makefile, mtools/ToolsLinkDef.h: 77 - added MagicReversi 78 79 * mtools/MagicRevers.[h,cc]: 80 - added 81 2 82 3 83 … … 384 464 - Added axis labels in graphic output 385 465 - Added Get function for rate histograms 466 386 467 * macros/trigrate.C 387 468 - Added output file with rate histograms -
trunk/MagicSoft/Mars/Makefile.conf.linux
r1172 r1880 20 20 # ----->>> settings for compilation 21 21 # 22 OPTIM = -O5 -Wall -fno -rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual22 OPTIM = -O5 -Wall -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual 23 23 DEBUG = 24 24 ARCHDEF = -D__LINUX__ -
trunk/MagicSoft/Mars/NEWS
r1860 r1880 40 40 41 41 - added Random Forest - method for g/h-separation 42 43 - made compatible with the latest PRO version of root (3.04/02) 42 44 43 45 -
trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
r1647 r1880 414 414 } 415 415 416 void MImgCleanStd::SetLvl1(Float_t lvl) 417 { 418 fCleanLvl1 = lvl; 419 *fLog << inf << "Cleaning level 1 set to " << lvl << " sigma." << endl; 420 } 421 422 void MImgCleanStd::SetLvl2(Float_t lvl) 423 { 424 fCleanLvl2 = lvl; 425 *fLog << inf << "Cleaning level 2 set to " << lvl << " sigma." << endl; 426 } 427 416 428 // -------------------------------------------------------------------------- 417 429 // … … 433 445 { 434 446 case kImgCleanLvl1: 435 fCleanLvl1 = lvl; 436 *fLog << "Cleaning level 1 set to " << lvl << " sigma." << endl; 447 SetLvl1(lvl); 437 448 return kTRUE; 438 449 439 450 case kImgCleanLvl2: 440 fCleanLvl2 = lvl; 441 *fLog << "Cleaning level 2 set to " << lvl << " sigma." << endl; 451 SetLvl2(lvl); 442 452 return kTRUE; 443 453 } … … 465 475 out << ");" << endl; 466 476 } 477 478 // -------------------------------------------------------------------------- 479 // 480 // Read the setup from a TEnv: 481 // Float_t fCleanLvl1: CleaningLevel1 482 // Float_t fCleanLvl2: CleaningLevel2 483 // 484 Bool_t MImgCleanStd::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 485 { 486 Bool_t rc = kTRUE; 487 if (!IsEnvDefined(env, prefix, "CleaningLevel1", print)) 488 rc = kFALSE; 489 else 490 { 491 SetLvl1(GetEnvValue(env, prefix, "CleaningLevel1", fCleanLvl1)); 492 if (fCleanLvl1<0) 493 { 494 *fLog << err << "ERROR - Negative values for Cleaning Level 1 forbidden." << endl; 495 return kERROR; 496 } 497 } 498 499 if (!IsEnvDefined(env, prefix, "CleaningLevel2", print)) 500 rc = kFALSE; 501 else 502 { 503 SetLvl2(GetEnvValue(env, prefix, "CleaningLevel2", fCleanLvl2)); 504 if (fCleanLvl2<0) 505 { 506 *fLog << err << "ERROR - Negative values for Cleaning Level 2 forbidden." << endl; 507 return kERROR; 508 } 509 } 510 511 return rc; 512 } -
trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h
r1540 r1880 20 20 Float_t fCleanLvl2; 21 21 22 void SetLvl1(Float_t lvl); 23 void SetLvl2(Float_t lvl); 24 22 25 void CreateGuiElements(MGGroupFrame *f); 23 26 void StreamPrimitive(ofstream &out) const; … … 40 43 41 44 Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2); 45 Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 42 46 43 47 ClassDef(MImgCleanStd, 0) // task doing a standard image cleaning -
trunk/MagicSoft/Mars/manalysis/MNewImagePar.cc
r1872 r1880 72 72 const MHillas *hillas) 73 73 { 74 fHillas =hillas;74 //fHillas = (MHillas*)hillas; 75 75 76 76 const UInt_t npixevt = evt.GetNumPixels(); … … 96 96 } 97 97 98 99 fLeakage1 = edgepix1 / fHillas->GetSize(); 100 fLeakage2 = edgepix2 / fHillas->GetSize(); 98 fLeakage1 = edgepix1 / hillas->GetSize(); 99 fLeakage2 = edgepix2 / hillas->GetSize(); 101 100 102 101 SetReadyToSave(); -
trunk/MagicSoft/Mars/manalysis/MNewImagePar.h
r1872 r1880 11 11 { 12 12 private: 13 const MHillas *fHillas; //! Input parameters14 const MSrcPosCam *fSrcPos; //! Source position in the camera15 16 13 Float_t fLeakage1; // (photons in most outer ring of pixels) over fSize 17 14 Float_t fLeakage2; // (photons in the 2 outer rings of pixels) over fSize … … 20 17 MNewImagePar(const char *name=NULL, const char *title=NULL); 21 18 22 void SetSrcPos(constMSrcPosCam *pos) { fSrcPos = pos; }23 const MSrcPosCam *GetSrcPos() const { return fSrcPos; }19 // void SetSrcPos(MSrcPosCam *pos) { fSrcPos = pos; } 20 // const MSrcPosCam *GetSrcPos() const { return fSrcPos; } 24 21 25 22 void Reset(); -
trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.cc
r1872 r1880 107 107 return kFALSE; 108 108 109 fNewImagePar->SetSrcPos(fSrcPos);110 111 109 fErrors = 0; 112 110 -
trunk/MagicSoft/Mars/manalysis/MNewImageParCalc.h
r1872 r1880 15 15 { 16 16 private: 17 constMGeomCam *fGeomCam;18 constMCerPhotEvt *fCerPhotEvt;17 MGeomCam *fGeomCam; 18 MCerPhotEvt *fCerPhotEvt; 19 19 20 20 MHillas *fHillas; //! Pointer to the source independent hillas parameters -
trunk/MagicSoft/Mars/manalysis/MRanForest.cc
r1871 r1880 288 288 289 289 // give running output 290 TString str=Form("%.2f",100.*fErr); 291 cout.width(5); cout<<fTreeNo; 292 cout.width(15); cout<<str<<endl; 290 cout << setw(5) << fTreeNo << setw(15) << Form("%.2f",100.*fErr) << endl; 293 291 294 292 // adding tree to forest -
trunk/MagicSoft/Mars/manalysis/MSigmabar.cc
r1748 r1880 91 91 Int_t outerPixels[6] = {0,0,0,0,0,0}; 92 92 93 Int_t currentSector;94 Float_t angle;95 96 93 // sum up sigma**2 for each sector, separately for inner and outer region; 97 94 // all pixels are renormalized to the area of pixel 0 … … 117 114 118 115 Int_t j = cerpix.GetPixId(); 119 Double_t Area = geom.GetPixRatio(j);116 Double_t area = geom.GetPixRatio(j); 120 117 121 118 const MGeomPix &gpix = geom[j]; … … 125 122 //if (angle<0.0) angle+=6.0; 126 123 127 angle = 6.0*atan2(gpix.GetY(),gpix.GetX()) / (2.0*TMath::Pi()); 128 if (angle<0.0) angle+=6.0; 129 currentSector=(Int_t)angle; 124 Float_t angle = atan2(gpix.GetY(),gpix.GetX())*6 / (TMath::Pi()*2); 125 if (angle<0) angle+=6; 126 127 Int_t currentSector=(Int_t)angle; 130 128 131 129 // count only those pixels which have a sigma != 0.0 … … 134 132 if ( sigma != 0.0 ) 135 133 { 136 if ( Area < 1.5)134 if (area < 1.5) 137 135 { 138 136 innerPixels[currentSector]++; 139 innerSquaredSum[currentSector]+= sigma*sigma / Area;137 innerSquaredSum[currentSector]+= sigma*sigma / area; 140 138 } 141 139 else 142 140 { 143 141 outerPixels[currentSector]++; 144 outerSquaredSum[currentSector]+= sigma*sigma / Area;142 outerSquaredSum[currentSector]+= sigma*sigma / area; 145 143 } 146 144 } … … 191 189 } 192 190 193 return (fSigmabar);191 return fSigmabar; 194 192 } 195 193 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r1850 r1880 103 103 // default constructor - emty 104 104 // 105 MEvtLoop::MEvtLoop( ) : fParList(NULL), fProgress(NULL)106 { 107 fName = "Evtloop";105 MEvtLoop::MEvtLoop(const char *name) : fParList(NULL), fProgress(NULL) 106 { 107 fName = name; 108 108 } 109 109 … … 444 444 // gui elements to a macro-file. 445 445 // 446 447 446 void MEvtLoop::StreamPrimitive(ofstream &out) const 448 447 { 449 out << " MEvtLoop " << GetUniqueName() << ";" << endl; 450 } 451 448 out << " MEvtLoop " << GetUniqueName(); 449 if (fName!="Evtloop") 450 out << "(\"" << fName << "\")"; 451 out << ";" << endl; 452 } 453 454 // -------------------------------------------------------------------------- 455 // 456 // 452 457 void MEvtLoop::SavePrimitive(ofstream &out, Option_t *opt) 453 458 { … … 666 671 return n; 667 672 } 673 674 // -------------------------------------------------------------------------- 675 // 676 // Read the contents/setup of a parameter container/task from a TEnv 677 // instance (steering card/setup file). 678 // The key to search for in the file should be of the syntax: 679 // prefix.vname 680 // While vname is a name which is specific for a single setup date 681 // (variable) of this container and prefix is something like: 682 // evtloopname.name 683 // While name is the name of the containers/tasks in the parlist/tasklist 684 // 685 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 686 // Job4.MImgCleanStd.CleaningLevel2: 2.5 687 // 688 // If this cannot be found the next step is to search for 689 // MImgCleanStd.CleaningLevel1: 3.0 690 // And if this doesn't exist, too, we should search for: 691 // CleaningLevel1: 3.0 692 // 693 // Warning: The programmer is responsible for the names to be unique in 694 // all Mars classes. 695 // 696 Bool_t MEvtLoop::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 697 { 698 if (!prefix.IsNull()) 699 *fLog << warn << "WARNING - Second argument in MEvtLoop::ReadEnv has no meaning... ignored." << endl; 700 701 *fLog << "1: " << "'" << prefix << "'" << (int)print << endl; 702 703 prefix = fName; 704 prefix += "."; 705 706 *fLog << inf << "Reading resources for " << prefix /*TEnv::fRcName << " from " << env.GetRcName()*/ << endl; 707 708 if (fParList->ReadEnv(env, prefix, print)==kERROR) 709 { 710 *fLog << err << "ERROR - Reading Environment file." << endl; 711 return kFALSE; 712 } 713 714 return kTRUE; 715 } 716 717 // -------------------------------------------------------------------------- 718 // 719 // Write the contents/setup of a parameter container/task to a TEnv 720 // instance (steering card/setup file). 721 // The key to search for in the file should be of the syntax: 722 // prefix.vname 723 // While vname is a name which is specific for a single setup date 724 // (variable) of this container and prefix is something like: 725 // evtloopname.name 726 // While name is the name of the containers/tasks in the parlist/tasklist 727 // 728 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 729 // Job4.MImgCleanStd.CleaningLevel2: 2.5 730 // 731 // If this cannot be found the next step is to search for 732 // MImgCleanStd.CleaningLevel1: 3.0 733 // And if this doesn't exist, too, we should search for: 734 // CleaningLevel1: 3.0 735 // 736 // Warning: The programmer is responsible for the names to be unique in 737 // all Mars classes. 738 // 739 Bool_t MEvtLoop::WriteEnv(TEnv &env, TString prefix, Bool_t print) const 740 { 741 if (!prefix.IsNull()) 742 *fLog << warn << "WARNING - Second argument in MEvtLoop::WriteEnv has no meaning... ignored." << endl; 743 744 prefix = fName; 745 prefix += "."; 746 747 *fLog << inf << "Writing resources: " << prefix /*TEnv::fRcName << " to " << env.GetRcName()*/ << endl; 748 749 if (fParList->WriteEnv(env, prefix, print)!=kTRUE) 750 { 751 *fLog << err << "ERROR - Writing Environment file." << endl; 752 return kFALSE; 753 } 754 755 return kTRUE; 756 } -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r1657 r1880 37 37 38 38 public: 39 MEvtLoop( );39 MEvtLoop(const char *name="Evtloop"); 40 40 virtual ~MEvtLoop(); 41 41 … … 66 66 void Print(Option_t *opt="") const; 67 67 68 Bool_t ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE); 69 Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const; 70 68 71 ClassDef(MEvtLoop, 1) // Class to execute the tasks in a tasklist 69 72 }; -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1794 r1880 40 40 #include <fstream.h> // ofstream, AsciiWrite 41 41 42 #include <T ROOT.h> // TROOT::Identlevel42 #include <TEnv.h> // Env::Lookup 43 43 #include <TClass.h> // IsA 44 44 #include <TObjArray.h> // TObjArray … … 54 54 #include "MEvtLoop.h" // gListOfPrimitives 55 55 #else 56 TList *gListOfPrimitives; 56 TList *gListOfPrimitives; // forard declaration in MParContainer.h 57 57 #endif 58 58 … … 122 122 // 123 123 void MParContainer::Copy(TObject &obj) 124 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 125 const 126 #endif 124 127 { 125 128 MParContainer &cont = (MParContainer&)obj; … … 449 452 return (MParContainer*)IsA()->New(); 450 453 } 454 455 // -------------------------------------------------------------------------- 456 // 457 // Read the contents/setup of a parameter container/task from a TEnv 458 // instance (steering card/setup file). 459 // The key to search for in the file should be of the syntax: 460 // prefix.vname 461 // While vname is a name which is specific for a single setup date 462 // (variable) of this container and prefix is something like: 463 // evtloopname.name 464 // While name is the name of the containers/tasks in the parlist/tasklist 465 // 466 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 467 // Job4.MImgCleanStd.CleaningLevel2: 2.5 468 // 469 // If this cannot be found the next step is to search for 470 // MImgCleanStd.CleaningLevel1: 3.0 471 // And if this doesn't exist, too, we should search for: 472 // CleaningLevel1: 3.0 473 // 474 // Warning: The programmer is responsible for the names to be unique in 475 // all Mars classes. 476 // 477 Bool_t MParContainer::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 478 { 479 if (!IsEnvDefined(env, prefix, "", print)) 480 return kFALSE; 481 482 *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but no " << IsA()->GetName() << "::ReadEnv." << endl; 483 return kTRUE; 484 } 485 486 // -------------------------------------------------------------------------- 487 // 488 // Write the contents/setup of a parameter container/task to a TEnv 489 // instance (steering card/setup file). 490 // The key to search for in the file should be of the syntax: 491 // prefix.vname 492 // While vname is a name which is specific for a single setup date 493 // (variable) of this container and prefix is something like: 494 // evtloopname.name 495 // While name is the name of the containers/tasks in the parlist/tasklist 496 // 497 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 498 // Job4.MImgCleanStd.CleaningLevel2: 2.5 499 // 500 // If this cannot be found the next step is to search for 501 // MImgCleanStd.CleaningLevel1: 3.0 502 // And if this doesn't exist, too, we should search for: 503 // CleaningLevel1: 3.0 504 // 505 // Warning: The programmer is responsible for the names to be unique in 506 // all Mars classes. 507 // 508 Bool_t MParContainer::WriteEnv(TEnv &env, TString prefix, Bool_t print) const 509 { 510 if (!IsEnvDefined(env, prefix, "", print)) 511 return kFALSE; 512 513 *fLog << warn << "WARNING - Resource " << prefix+fName << " found, but " << IsA()->GetName() << "::WriteEnv not overloaded." << endl; 514 return kTRUE; 515 } 516 517 Bool_t MParContainer::IsEnvDefined(const TEnv &env, TString prefix, TString postfix, Bool_t print) const 518 { 519 if (!postfix.IsNull()) 520 postfix.Insert(0, "."); 521 522 return IsEnvDefined(env, prefix+fName+postfix, print); 523 } 524 525 Bool_t MParContainer::IsEnvDefined(const TEnv &env, TString name, Bool_t print) const 526 { 527 if (print) 528 *fLog << all << GetDescriptor() << " - " << name << "... " << flush; 529 530 if (!((TEnv&)env).Defined(name)) 531 { 532 if (print) 533 *fLog << "not found." << endl; 534 return kFALSE; 535 } 536 537 if (print) 538 *fLog << "found." << endl; 539 540 return kTRUE; 541 } 542 543 Int_t MParContainer::GetEnvValue(const TEnv &env, TString prefix, TString postfix, Int_t dflt) const 544 { 545 return ((TEnv&)env).GetValue(prefix+fName+"."+postfix, dflt); 546 } 547 548 Double_t MParContainer::GetEnvValue(const TEnv &env, TString prefix, TString postfix, Double_t dflt) const 549 { 550 return ((TEnv&)env).GetValue(prefix+fName+"."+postfix, dflt); 551 } 552 553 const char *MParContainer::GetEnvValue(const TEnv &env, TString prefix, TString postfix, const char *dflt) const 554 { 555 return ((TEnv&)env).GetValue(prefix+fName+"."+postfix, dflt); 556 } -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1879 r1880 23 23 class ifstream; 24 24 25 class TEnv; 25 26 class TDataMember; 26 27 class TMethodCall; … … 56 57 virtual TObject *Clone(const char *newname="") const; 57 58 virtual Int_t Compare(const TObject *obj) const; 58 virtual void Copy(TObject &named); 59 virtual void Copy(TObject &named) 60 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 61 const 62 #endif 63 ; 59 64 virtual void FillBuffer(char *&buffer); 60 65 … … 95 100 virtual void SetNames(TObjArray &arr); 96 101 102 virtual Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 103 virtual Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 104 105 Bool_t ReadEnv(const TEnv &env, Bool_t print=kFALSE) { return ReadEnv(env, "", print); } 106 Bool_t WriteEnv(TEnv &env, Bool_t print=kFALSE) const { return WriteEnv(env, "", print); } 107 108 Bool_t IsEnvDefined(const TEnv &env, TString prefix, TString postfix, Bool_t print) const; 109 Bool_t IsEnvDefined(const TEnv &env, TString name, Bool_t print) const; 110 111 Int_t GetEnvValue(const TEnv &env, TString prefix, TString postfix, Int_t dflt) const; 112 Double_t GetEnvValue(const TEnv &env, TString prefix, TString postfix, Double_t dflt) const; 113 const char *GetEnvValue(const TEnv &env, TString prefix, TString postfix, const char *dflt) const; 114 97 115 ClassDef(MParContainer, 0) //The basis for all parameter containers 98 116 }; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r1528 r1880 768 768 } 769 769 770 // -------------------------------------------------------------------------- 771 // 772 // Read the contents/setup of a parameter container/task from a TEnv 773 // instance (steering card/setup file). 774 // The key to search for in the file should be of the syntax: 775 // prefix.vname 776 // While vname is a name which is specific for a single setup date 777 // (variable) of this container and prefix is something like: 778 // evtloopname.name 779 // While name is the name of the containers/tasks in the parlist/tasklist 780 // 781 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 782 // Job4.MImgCleanStd.CleaningLevel2: 2.5 783 // 784 // If this cannot be found the next step is to search for 785 // MImgCleanStd.CleaningLevel1: 3.0 786 // And if this doesn't exist, too, we search for: 787 // CleaningLevel1: 3.0 788 // 789 // Warning: The programmer is responsible for the names to be unique in 790 // all Mars classes. 791 // 792 Bool_t MParList::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 793 { 794 MParContainer *cont = NULL; 795 796 TIter Next(fContainer); 797 while ((cont=(MParContainer*)Next())) 798 if (cont->ReadEnv(env, print)==kERROR) 799 return kERROR; 800 801 Next.Reset(); 802 while ((cont=(MParContainer*)Next())) 803 if (cont->ReadEnv(env, prefix, print)==kERROR) 804 return kERROR; 805 806 return kTRUE; 807 } 808 809 // -------------------------------------------------------------------------- 810 // 811 // Write the contents/setup of a parameter container/task to a TEnv 812 // instance (steering card/setup file). 813 // The key to search for in the file should be of the syntax: 814 // prefix.vname 815 // While vname is a name which is specific for a single setup date 816 // (variable) of this container and prefix is something like: 817 // evtloopname.name 818 // While name is the name of the containers/tasks in the parlist/tasklist 819 // 820 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 821 // Job4.MImgCleanStd.CleaningLevel2: 2.5 822 // 823 // If this cannot be found the next step is to search for 824 // MImgCleanStd.CleaningLevel1: 3.0 825 // And if this doesn't exist, too, we search for: 826 // CleaningLevel1: 3.0 827 // 828 // Warning: The programmer is responsible for the names to be unique in 829 // all Mars classes. 830 // 831 Bool_t MParList::WriteEnv(TEnv &env, TString prefix, Bool_t print) const 832 { 833 MParContainer *cont = NULL; 834 835 TIter Next(fContainer); 836 while ((cont=(MParContainer*)Next())) 837 if (!cont->WriteEnv(env, prefix, print)) 838 return kFALSE; 839 return kTRUE; 840 } -
trunk/MagicSoft/Mars/mbase/MParList.h
r1879 r1880 90 90 void SavePrimitive(ofstream &out, Option_t *o=""); 91 91 92 Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 93 Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 94 92 95 ClassDef(MParList, 1) // list of parameter containers (MParContainer) 93 96 }; -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1666 r1880 643 643 } 644 644 645 // -------------------------------------------------------------------------- 646 // 647 // Read the contents/setup of a parameter container/task from a TEnv 648 // instance (steering card/setup file). 649 // The key to search for in the file should be of the syntax: 650 // prefix.vname 651 // While vname is a name which is specific for a single setup date 652 // (variable) of this container and prefix is something like: 653 // evtloopname.name 654 // While name is the name of the containers/tasks in the parlist/tasklist 655 // 656 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 657 // Job4.MImgCleanStd.CleaningLevel2: 2.5 658 // 659 // If this cannot be found the next step is to search for 660 // MImgCleanStd.CleaningLevel1: 3.0 661 // And if this doesn't exist, too, we should search for: 662 // CleaningLevel1: 3.0 663 // 664 // Warning: The programmer is responsible for the names to be unique in 665 // all Mars classes. 666 // 667 Bool_t MTaskList::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 668 { 669 MParContainer *cont = NULL; 670 671 TIter Next(fTasks); 672 while ((cont=(MParContainer*)Next())) 673 if (cont->ReadEnv(env, print)==kERROR) 674 return kERROR; 675 676 Next.Reset(); 677 while ((cont=(MParContainer*)Next())) 678 if (cont->ReadEnv(env, prefix, print)==kERROR) 679 return kERROR; 680 681 return kTRUE; 682 } 683 684 // -------------------------------------------------------------------------- 685 // 686 // Write the contents/setup of a parameter container/task to a TEnv 687 // instance (steering card/setup file). 688 // The key to search for in the file should be of the syntax: 689 // prefix.vname 690 // While vname is a name which is specific for a single setup date 691 // (variable) of this container and prefix is something like: 692 // evtloopname.name 693 // While name is the name of the containers/tasks in the parlist/tasklist 694 // 695 // eg. Job4.MImgCleanStd.CleaningLevel1: 3.0 696 // Job4.MImgCleanStd.CleaningLevel2: 2.5 697 // 698 // If this cannot be found the next step is to search for 699 // MImgCleanStd.CleaningLevel1: 3.0 700 // And if this doesn't exist, too, we should search for: 701 // CleaningLevel1: 3.0 702 // 703 // Warning: The programmer is responsible for the names to be unique in 704 // all Mars classes. 705 // 706 Bool_t MTaskList::WriteEnv(TEnv &env, TString prefix, Bool_t print) const 707 { 708 MParContainer *cont = NULL; 709 710 TIter Next(fTasks); 711 while ((cont=(MParContainer*)Next())) 712 if (!cont->WriteEnv(env, prefix, print)) 713 return kFALSE; 714 return kTRUE; 715 } -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1661 r1880 67 67 void SetNames(TObjArray &arr); 68 68 69 Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 70 Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 71 69 72 ClassDef(MTaskList, 1) //collection of tasks to be performed in the eventloop 70 73 }; -
trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.cc
r1668 r1880 96 96 // Add this file as the last entry in the chain 97 97 // 98 void MCT1ReadAscii::AddFile(const char *txt)98 Int_t MCT1ReadAscii::AddFile(const char *txt, Int_t) 99 99 { 100 100 TNamed *name = new TNamed(txt, ""); 101 101 fFileNames->AddLast(name); 102 return 1; 102 103 } 103 104 … … 299 300 return kTRUE; 300 301 } 301 -
trunk/MagicSoft/Mars/mfileio/MCT1ReadAscii.h
r1381 r1880 30 30 ~MCT1ReadAscii(); 31 31 32 void AddFile(const char *fname);32 Int_t AddFile(const char *fname, Int_t dummy=-1); 33 33 34 34 Bool_t PreProcess(MParList *pList); -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.cc
r1873 r1880 119 119 // Add this file as the last entry in the chain 120 120 // 121 void MCT1ReadPreProc::AddFile(const char *txt)121 Int_t MCT1ReadPreProc::AddFile(const char *txt, Int_t) 122 122 { 123 123 const char *name = gSystem->ExpandPathName(txt); … … 129 129 { 130 130 *fLog << warn << "WARNING - Problem reading header... ignored." << endl; 131 return ;131 return 0; 132 132 } 133 133 … … 136 136 { 137 137 *fLog << warn << "WARNING - File contains no data... ignored." << endl; 138 return ;138 return 0; 139 139 } 140 140 … … 144 144 145 145 fFileNames->AddLast(new TNamed(txt, "")); 146 return 1; 146 147 } 147 148 -
trunk/MagicSoft/Mars/mfileio/MCT1ReadPreProc.h
r1849 r1880 77 77 ~MCT1ReadPreProc(); 78 78 79 void AddFile(const char *fname);79 Int_t AddFile(const char *fname, Int_t dummy=-1); 80 80 81 81 UInt_t GetEntries() { return fEntries; } -
trunk/MagicSoft/Mars/mfileio/MRead.cc
r1668 r1880 39 39 ClassImp(MRead); 40 40 41 // -------------------------------------------------------------------------- 42 // 43 // Read the setup from a TEnv: 44 // File0, File1, File2, ..., File10, ..., File100, ... 45 // 46 // Searching stops if the first key isn't found in the TEnv 47 // 48 // Enclosing quotation marks (") are removed 49 // 50 // Number of entries at the moment not supported 51 // 52 Bool_t MRead::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 53 { 54 // 55 // Don't allow 'global' setup of files 56 // 57 if (prefix.IsNull()) 58 return kFALSE; 59 60 // 61 // Search (beginning with 0) all keys 62 // 63 for (int i=0;; i++) 64 { 65 TString idx = "File"; 66 idx += i; 67 68 // Output if print set to kTRUE 69 IsEnvDefined(env, prefix, idx, print); 70 71 // Try to get the file name 72 TString name = GetEnvValue(env, prefix, idx, ""); 73 if (name.IsNull()) 74 return kTRUE; 75 76 if (name.BeginsWith("\"") && name.EndsWith("\"")) 77 { 78 name.Remove(name.Last('\"'), 1); 79 name.Remove(name.First('\"'), 1); 80 } 81 82 AddFile(name); 83 } 84 85 return kTRUE; 86 } -
trunk/MagicSoft/Mars/mfileio/MRead.h
r1668 r1880 21 21 MFilter *GetSelector() { return fSelector; } 22 22 23 Int_t AddFile(const char *fname, Int_t entries=-1) { return -1; } 24 25 Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print); 26 23 27 ClassDef(MRead, 0) // Base class for a reading task 24 28 }; -
trunk/MagicSoft/Mars/mgui/MHexagon.cc
r1508 r1880 92 92 // 93 93 void MHexagon::Copy(TObject &obj) 94 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 95 const 96 #endif 97 94 98 { 95 99 MHexagon &hex = (MHexagon&) obj; -
trunk/MagicSoft/Mars/mgui/MHexagon.h
r1384 r1880 44 44 virtual ~MHexagon(); 45 45 46 virtual void Copy(TObject &hexagon); 46 virtual void Copy(TObject &hexagon) 47 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 48 const 49 #endif 50 ; 47 51 48 52 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); -
trunk/MagicSoft/Mars/mhist/MH.cc
r1879 r1880 59 59 #include <TLegend.h> 60 60 #include <TPaveStats.h> 61 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 62 #include <THLimitsFinder.h> 63 #endif 61 64 62 65 #include "MLog.h" … … 469 472 void MH::FindGoodLimits(Int_t nbins, Int_t &newbins, Double_t &xmin, Double_t &xmax, Bool_t isInteger) 470 473 { 474 #if ROOT_VERSION_CODE > ROOT_VERSION(3,04,01) 475 THLimitsFinder::OptimizeLimits(nbins, newbins, xmin, xmax, isInteger); 476 #else 471 477 //*-*-*-*-*-*-*-*-*Find reasonable bin values*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 472 478 //*-* ========================== … … 486 492 Double_t binwidth=0; 487 493 488 #if ROOT_VERSION_CODE < ROOT_VERSION(3,03,01)489 494 TGaxis::Optimize(umin, umax, nbins, binlow, binhigh, nbins, binwidth, ""); 490 #else491 gLog << all << "*********************************************************" << endl;492 gLog << all << "ERROR, because Abelardo removed TGaxis::Optimize from" << endl;493 gLog << all << " MH::FindGoodLimits to be able to compile Mars with newer" << endl;494 gLog << all << " root versions, whatever you are trying to do will fail!!!" << endl;495 gLog << all << "*********************************************************" << endl;496 #endif497 495 498 496 if (binwidth <= 0 || binwidth > 1.e+39) … … 532 530 533 531 newbins = nbins; 532 #endif 534 533 } 535 534 -
trunk/MagicSoft/Mars/mhist/MHRanForest.cc
r1870 r1880 114 114 115 115 Int_t ntrees=fRanForest->GetNumTrees(); 116 //cout<<"filling"<<endl; 116 117 117 for (Int_t i=0;i<ntrees;i++) 118 118 { … … 120 120 hest+=fRanForest->GetTreeHad(j); 121 121 122 hest/= Double_t(i+1);122 hest/=i+1; 123 123 fSigma[i]+=(htrue-hest)*(htrue-hest); 124 124 } … … 177 177 g.GetXaxis()->SetTitle("Number of Trees"); 178 178 g.GetYaxis()->SetTitle("Standard deviation of estimated hadronness"); 179 g.SetMarkerStyle(kFullDotlarge); 180 g.Draw("P"); 181 179 g.SetMarkerStyle(kFullDotMedium); 180 gPad->Modified(); 181 gPad->Update(); 182 //g.Draw("P"); 182 183 } 183 184 gPad->SetGrid(); … … 209 210 210 211 fGraphSigma->SetMarkerStyle(kFullDotSmall); 211 fGraphSigma->Draw("P");212 //fGraphSigma->Draw("P"); 212 213 gPad->Modified(); 213 214 gPad->Update(); -
trunk/MagicSoft/Mars/mhist/MHRanForestGini.cc
r1870 r1880 121 121 for (Int_t i=0; i<n; i++) 122 122 { 123 fGini[i]/=fRanForest->GetNumTrees(); 124 fGini[i]/=fRanForest->GetNumData(); 125 123 126 Stat_t ip = i+1.; 124 fGini[i]/=Stat_t(fRanForest->GetNumTrees());125 fGini[i]/=Stat_t(fRanForest->GetNumData());126 127 Stat_t ig = fGini[i]; 128 127 129 max=TMath::Max(max,ig); 128 130 min=TMath::Min(min,ig); 131 129 132 fGraphGini->SetPoint(i,ip,ig); 130 133 } … … 157 160 g.GetXaxis()->SetTitle("No. of RF-input parameter"); 158 161 g.GetYaxis()->SetTitle("Mean decrease in Gini-index [a.u.]"); 159 g.SetMarkerStyle(kFullDotlarge); 160 g.Draw("P"); 161 162 g.SetMarkerStyle(kFullDotMedium); 163 //g.Draw("P"); 164 gPad->Modified(); 165 gPad->Update(); 162 166 } 163 167 gPad->SetGrid(); … … 189 193 190 194 fGraphGini->SetMarkerStyle(kFullDotSmall); 191 fGraphGini->Draw("P");195 //fGraphGini->Draw("P"); 192 196 gPad->Modified(); 193 197 gPad->Update(); -
trunk/MagicSoft/Mars/mhist/MHRanForestGini.h
r1870 r1880 19 19 { 20 20 private: 21 MRanForest *fRanForest; 21 MRanForest *fRanForest; //! 22 22 23 TArrayF fGini; 24 TGraph *fGraphGini; 23 TArrayF fGini; //! 24 TGraph *fGraphGini; //-> 25 25 26 26 public: -
trunk/MagicSoft/Mars/mmontecarlo/MMcTriggerRateCalc.cc
r1800 r1880 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@ uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! Author(s): Harald Kornmayer 1/2001 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 121 ! Copyright: MAGIC Software Development, 2000-2003 22 22 ! 23 23 ! Modified 4/7/2002 Abelardo Moralejo: now the dimension of fTrigger is … … 27 27 ! 28 28 \* ======================================================================== */ 29 30 29 #include "MMcTriggerRateCalc.h" 31 30 … … 105 104 if (fMcRunHeader->GetAllEvtsTriggered()) 106 105 { 107 *fLog << endl << all << endl << 108 "WARNING: the input data file contains only the" << endl << 109 "events that triggered. I will assume the standard value" << endl << 110 "for maximum impact parameter (400 m)" <<endl; 111 112 113 if (fTrigNSB[0] > 0) 114 *fLog << endl << all << 115 "WARNING: NSB rate can be overestimated by up to 5%." << endl << 116 "For a precise estimate of the total rate including NSB" << endl << 117 "accidental triggers I need a file containing all event headers." 118 << endl; 119 else 120 *fLog << endl << all << 121 "WARNING: calculating only shower rate (no NSB accidental triggers)" << endl; 106 *fLog << warn; 107 *fLog << "WARNING - the input data file contains only the" << endl; 108 *fLog << "events that triggered. I will assume the standard value" << endl; 109 *fLog << "for maximum impact parameter (400 m)" <<endl; 110 111 112 if (fTrigNSB[0] > 0) 113 { 114 *fLog << warn; 115 *fLog << "WARNING - NSB rate can be overestimated by up to 5%." << endl; 116 *fLog << "For a precise estimate of the total rate including NSB" << endl; 117 *fLog << "accidental triggers I need a file containing all event headers." << endl; 118 } 119 else 120 { 121 *fLog << warn << "WARNING - calculating only shower rate (no NSB accidental triggers)" << endl; 122 } 122 123 } 123 124 124 *fLog << endl << all<<125 *fLog << endl << warn << 125 126 "WARNING: I will assume the standard maximum off axis angle" << endl << 126 127 "(5 degrees) for the original showers" << endl; … … 168 169 // rate: rate of incident showers 169 170 // 170 171 171 MMcTriggerRateCalc::MMcTriggerRateCalc(float rate, int dim, 172 172 float *trigbg, float simbg, … … 325 325 if (fMcCorRunHeader->GetSlopeSpec() != -2.75) 326 326 { 327 *fLog << err << dbginf << 328 "Spectrum slope as read from input file ("<< 329 fMcCorRunHeader->GetSlopeSpec() << ") does not match the expectedone (-2.75) for protons" << endl << "... aborting." << endl;330 331 327 *fLog << err << dbginf << "Spectrum slope as read from input file ("; 328 *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected "; 329 *fLog << "one (-2.75) for protons" << endl << "... aborting." << endl; 330 return kFALSE; 331 } 332 332 rate.SetFlux(0.1091, 2.75); 333 333 break; … … 335 335 if (fMcCorRunHeader->GetSlopeSpec() != -2.62) 336 336 { 337 *fLog << err << dbginf << 338 "Spectrum slope as read from input file ("<< 339 fMcCorRunHeader->GetSlopeSpec() << ") does not match the expectedone (-2.75) for Helium" << endl << "... aborting." << endl;340 337 *fLog << err << dbginf << "Spectrum slope as read from input file ("; 338 *fLog << fMcCorRunHeader->GetSlopeSpec() << ") does not match the expected "; 339 *fLog << "one (-2.75) for Helium" << endl << "... aborting." << endl; 340 return kFALSE; 341 341 } 342 342 rate.SetFlux(0.0660, 2.62); … … 363 363 void MMcTriggerRateCalc::Draw() 364 364 { 365 /* 366 Commented out, because this is creating a memory leak! 367 The histograms are neither deleted anywhere, nor it is made 368 sure, that the histograms are not overwritten. 369 Also the comment for the function doesn't match the rules. 370 365 371 TCanvas *c = MH::MakeDefCanvas("Rate"); 366 372 367 373 Float_t xmin = GetRate(0)->GetMeanThreshold()-0.55; 368 374 Float_t xmax = GetRate(fNum-1)->GetMeanThreshold()+0.55; 369 Int_t nbins = 10*(xmax-xmin);375 Int_t nbins = (Int_t)((xmax-xmin)*10); 370 376 371 377 fHist[1] = new TH1F("Rate2","Trigger rate, mult. 2", nbins, xmin, xmax); … … 412 418 fHist[4]->Draw("same"); 413 419 fHist[4]->SetMarkerColor(4); 414 415 return; 416 } 417 420 */ 421 } 422 -
trunk/MagicSoft/Mars/mtools/Makefile
r1845 r1880 29 29 30 30 SRCFILES = MChisqEval.cc \ 31 MagicReversi.cc \ 31 32 MagicSnake.cc \ 32 33 MagicShow.cc \ -
trunk/MagicSoft/Mars/mtools/ToolsLinkDef.h
r1845 r1880 7 7 #pragma link C++ class MChisqEval+; 8 8 #pragma link C++ class MineSweeper+; 9 //#pragma link C++ class MagicReversi+;9 #pragma link C++ class MagicReversi+; 10 10 #pragma link C++ class MagicSnake+; 11 11 #pragma link C++ class MagicShow+;
Note:
See TracChangeset
for help on using the changeset viewer.