Changeset 950 for trunk/MagicSoft/Mars
- Timestamp:
- 09/26/01 15:23:21 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mmain
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mmain/MAnalysis.cc
r949 r950 30 30 31 31 enum { 32 M_BUTTON_HILLAS 32 M_BUTTON_HILLAS, 33 M_CHECK_DISPLHIL 33 34 }; 35 36 void MAnalysis::AddButtons() 37 { 38 TGTextButton *hillas = new TGTextButton(fTop2, "Calculate Standard Hillas", M_BUTTON_HILLAS); 39 40 hillas->Associate(this); 41 42 fList->Add(hillas); 43 44 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5); 45 fList->Add(laybut); 46 47 fTop2->AddFrame(hillas, laybut); 48 } 49 50 void MAnalysis::AddSetupTab() 51 { 52 TGCompositeFrame *frame = CreateNewTab("Setup"); 53 54 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5); 55 fList->Add(laybut); 56 57 fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished", M_CHECK_DISPLHIL); 58 fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished", M_CHECK_DISPLHIL); 59 60 fList->Add(fCheckButton1); 61 fList->Add(fCheckButton2); 62 63 frame->AddFrame(fCheckButton1, laybut); 64 frame->AddFrame(fCheckButton2, laybut); 65 } 34 66 35 67 MAnalysis::MAnalysis(const TGWindow *main, const TGWindow *p, … … 37 69 : MBrowser(main, p, w, h) 38 70 { 39 TGTextButton *hillas = new TGTextButton(fTop2, "Calculate Standard Hillas", M_BUTTON_HILLAS); 40 41 hillas->Associate(this); 42 43 fList->Add(hillas); 44 45 TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5); 46 fList->Add(laybut); 47 48 fTop2->AddFrame(hillas, laybut); 71 AddButtons(); 72 AddSetupTab(); 49 73 50 74 MapSubwindows(); … … 74 98 #include "MHillas.h" 75 99 76 void MAnalysis::CalculateHillas( const char *fname)100 void MAnalysis::CalculateHillas() const 77 101 { 78 102 // 79 103 // This is a demonstration program which calculates the Hillas 80 104 // parameter out of a Magic root file. 105 106 const Bool_t displhillas = fCheckButton1->GetState(); 107 const Bool_t displstarmap = fCheckButton2->GetState(); 81 108 82 109 // … … 131 158 // CalEvents: Calibration Events 132 159 // 133 MReadTree read("Events", f name);160 MReadTree read("Events", fInputFile); 134 161 MCerPhotCalc ncalc; 135 162 MImgCleanStd clean; … … 137 164 MFillH hfill(&hillas, hists); 138 165 MFillH sfill(&hillas, smap); 139 //140 // FIXME:141 // -----142 // I cannot use MFillH fill("name", "name") here.143 // for me it is not yet clear why this doesn't work144 //145 146 /*147 MWriteRootFile write("hillas.root");148 write.AddContainer("MHillas");149 write.AddContainer("MHHillas");150 write.AddContainer(smap);151 */152 166 153 167 tlist.AddToList(&read); … … 157 171 tlist.AddToList(&hfill); 158 172 tlist.AddToList(&sfill); 159 //tlist.AddToList(&write);160 173 161 174 // … … 174 187 // After the analysis is finished we can display the histograms 175 188 // 176 hists->Draw(); 177 smap->Draw(); 189 190 if (displhillas) 191 hists->Draw(); 192 193 if (displstarmap) 194 smap->Draw(); 178 195 } 179 196 … … 199 216 { 200 217 case M_BUTTON_HILLAS: 201 CalculateHillas( fInputFile);218 CalculateHillas(); 202 219 return kTRUE; 203 220 } -
trunk/MagicSoft/Mars/mmain/MAnalysis.h
r949 r950 10 10 #endif 11 11 12 class TGCheckButton; 13 12 14 class MAnalysis : public MBrowser 13 15 { 14 16 private: 15 void CalculateHillas(const char *fname); 17 TGCheckButton *fCheckButton1; 18 TGCheckButton *fCheckButton2; 19 20 void CalculateHillas() const; 21 22 void AddButtons(); 23 void AddSetupTab(); 16 24 17 25 public: -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r947 r950 175 175 } 176 176 177 void MBrowser::CreateTab1(TGCompositeFrame *frame) 178 { 177 void MBrowser::CreateTab1() 178 { 179 TGCompositeFrame *frame = CreateNewTab("Input File"); 180 179 181 // 180 182 // Create three frames for the first tab … … 202 204 } 203 205 206 TGCompositeFrame *MBrowser::CreateNewTab(const char *name) 207 { 208 return fTabs->AddTab(name); 209 } 210 204 211 void MBrowser::CreateLowerFrame(TGCompositeFrame *framelow) 205 212 { … … 211 218 // ----- Create Object holding the Tabs ----- 212 219 // 213 TGTab *tabs = new TGTab(framelow, 400, 400);214 fList->Add( tabs);220 fTabs = new TGTab(framelow, 400, 400); 221 fList->Add(fTabs); 215 222 216 223 TGLayoutHints *laytabs = new TGLayoutHints(kLHintsBottom|kLHintsExpandX|kLHintsExpandY, 5, 5, 5, 5); 217 224 fList->Add(laytabs); 218 225 219 framelow->AddFrame( tabs, laytabs);226 framelow->AddFrame(fTabs, laytabs); 220 227 221 228 // 222 229 // --- Create the first tab of the tabs --- 223 230 // 224 TGCompositeFrame *tf = tabs->AddTab("Input File"); 225 226 CreateTab1(tf); 231 CreateTab1(); 227 232 } 228 233 -
trunk/MagicSoft/Mars/mmain/MBrowser.h
r947 r950 11 11 12 12 class TList; 13 class TGTab; 13 14 class TGListView; 14 15 class TGComboBox; … … 19 20 { 20 21 private: 21 TG ComboBox *fDir;22 TGTab *fTabs; 22 23 23 TGPictureButton *fCdup; 24 TGPictureButton *fListMode; 25 TGPictureButton *fDetail; 24 TGComboBox *fDir; 26 25 27 TGFileContainer *fFileCont; 28 TGListView *fFileView; 26 TGPictureButton *fCdup; 27 TGPictureButton *fListMode; 28 TGPictureButton *fDetail; 29 29 30 const TGPicture *fPic1; 31 const TGPicture *fPic2; 32 const TGPicture *fPic3; 30 TGFileContainer *fFileCont; 31 TGListView *fFileView; 32 33 const TGPicture *fPic1; 34 const TGPicture *fPic2; 35 const TGPicture *fPic3; 33 36 34 37 void CreateMenuBar(); 38 void CreateTab1(); 35 39 void CreateUpperFrame(TGCompositeFrame *frameup); 36 40 void CreateLowerFrame(TGCompositeFrame *framelow); 37 void CreateTab1(TGCompositeFrame *frame);38 41 void CreateDirListMenu(TGCompositeFrame *frame); 39 42 void CreateDirListBox(TGCompositeFrame *frame); … … 42 45 TList *fList; 43 46 Char_t fInputFile[256]; 47 48 TGCompositeFrame *CreateNewTab(const char *name); 44 49 45 50 void DisplError(const char *txt);
Note:
See TracChangeset
for help on using the changeset viewer.