Changeset 4513
- Timestamp:
- 08/05/04 15:03:07 (20 years ago)
- Location:
- trunk/MagicSoft
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4511 r4513 21 21 2004/08/05: Thomas Bretz 22 22 23 * manalysis/MGeomApply.cc :23 * manalysis/MGeomApply.cc, mimage/MCameraSmooth.[h,cc]: 24 24 - removed dependancy on MBlindPixel 25 26 * macros/sql/readrbk.C, msql/MSQLServer.cc: 27 - fixed some memory leaks - the result of TSQLServer::Query 28 must be deleted 29 30 * mbase/MTaskInteractive.cc: 31 - added some comments 32 33 * mmain/MBrowser.cc: 34 - fixed a bug which caused '/data/MAGIC' not to be shown in 35 the dir-list 36 37 * mmc/MMcEvt.hxx: 38 - added some more particle ids 39 25 40 26 41 -
trunk/MagicSoft/Mars/macros/sql/readrbk.C
r4443 r4513 51 51 TSQLRow *row; 52 52 53 TList rows;53 Bool_t rc = kFALSE; 54 54 while (row=res->Next()) 55 55 { 56 56 if ((*row)[0]) 57 return kTRUE; 57 { 58 rc = kTRUE; 59 break; 60 } 58 61 } 59 62 60 return kFALSE; 63 delete res; 64 65 return rc; 61 66 } 62 67 … … 146 151 query += "\");"; 147 152 148 if (!serv->Query(query)) 153 TSQLResult *res = serv->Query(query); 154 if (!res) 149 155 cout << "ERROR: " << query << endl << endl; 150 156 else 157 { 158 delete res; 151 159 num++; 160 } 152 161 153 162 entry = ""; -
trunk/MagicSoft/Mars/mbase/MTaskInteractive.cc
r4452 r4513 72 72 // -------------------------------------------------------------------------- 73 73 // 74 // Default Constructor. Takes name and title of the interactive task 74 75 // 75 76 MTaskInteractive::MTaskInteractive(const char *name, const char *title) : … … 84 85 } 85 86 87 // -------------------------------------------------------------------------- 88 // 89 // Destructor. Free all resources. 90 // 86 91 MTaskInteractive::~MTaskInteractive() 87 92 { … … 91 96 } 92 97 98 // -------------------------------------------------------------------------- 99 // 100 // Calls the function and returns its return value. 101 // Called by PreProcess, Process, PostProcess and ReInit. 102 // 93 103 inline Int_t MTaskInteractive::Return(Int_t no, void *params) 94 104 { … … 107 117 } 108 118 119 // -------------------------------------------------------------------------- 120 // 121 // Generalized function to set the functions of your interactive task. 122 // Called by SetPreProcess, SetProcess, SetPostProcess and SetReInit 123 // 109 124 Bool_t MTaskInteractive::Set(void *fcn, Int_t no, const char *params) 110 125 { … … 138 153 } 139 154 155 // -------------------------------------------------------------------------- 156 // 157 // 158 // 140 159 void MTaskInteractive::Free(Int_t no) 141 160 { -
trunk/MagicSoft/Mars/mmain/MBrowser.cc
r3069 r4513 137 137 138 138 const TGPicture *pic0 = fList->GetPicture("magic_t.xpm"); 139 if ( !pic0)139 if (pic0) 140 140 { 141 dir->GetListBox()->Resize(100, 150); 141 142 TGTreeLBEntry *entry = new TGTreeLBEntry(dir->GetListBox()->GetContainer(), 142 143 new TGString("/data/MAGIC"), pic0, 6000, … … 144 145 TGLayoutHints *laylb = new TGLayoutHints(kLHintsLeft|kLHintsTop, 14, 0, 0, 0); 145 146 dir->AddEntry(entry, laylb); 146 // Not enecessary - deleted in ~TGLBContainer: fList->Add(laylb);147 fList->Add(entry);147 // Not necessary - deleted in ~TGLBContainer: fList->Add(laylb); 148 // fList->Add(laylb); 148 149 } 149 150 -
trunk/MagicSoft/Mars/msql/MSQLServer.cc
r3415 r4513 31 31 // many features usefull working with relational tables. 32 32 // 33 // Use it like TSQlServer: 34 // new MSQLServer("mysql://localhost:3306", "hercules", "stdmagicpassword"); 35 // // now start your TBrowser 36 // new TBrowser; 37 // 33 38 //////////////////////////////////////////////////////////////////////// 34 39 #include "MSQLServer.h" … … 72 77 const TString desc((*row)[1]); 73 78 74 //cout << "Column Type: " << desc << endl;79 delete res; 75 80 76 81 const Bool_t isnum = … … 119 124 num++; 120 125 } 126 127 delete res; 121 128 122 129 if (!isnum) … … 297 304 TSQLResult *res = fServ->Query(query); 298 305 if (res) 306 { 299 307 PrintTable(res); 308 delete res; 309 } 300 310 else 301 311 cout << "Query failed: " << query << endl; … … 519 529 520 530 if (res->GetFieldCount()!=1) 531 { 532 delete res; 521 533 return (PrintError("GetEntry - Number of columns != 1", query), ""); 534 } 522 535 523 536 if (res->GetRowCount()>1) 537 { 538 delete res; 524 539 return (PrintError("GetEntry - Number of rows > 1", query), ""); 540 } 525 541 526 542 if (res->GetRowCount()==0) 543 { 544 delete res; 527 545 return ""; 546 } 528 547 529 548 const char *fld = res->Next()->GetField(0); 530 549 if (!fld) 550 { 551 delete res; 531 552 return (PrintError("GetEntry - Entry is empty", query), ""); 532 533 return TString(fld); 534 } 553 } 554 555 const TString rc(fld); 556 delete res; 557 return rc; 558 } -
trunk/MagicSoft/include-Classes/MMcFormat/MMcEvt.hxx
r3894 r4513 14 14 enum ParticleId_t 15 15 { 16 kGAMMA =1,16 kGAMMA = 1, 17 17 kPOSITRON = 2, 18 18 kELECTRON = 3, 19 kANTIMUON = 5, 20 kMUON = 6, 21 kPI0 = 7, 22 kNEUTRON = 13, 19 23 kPROTON = 14, 20 24 kHELIUM = 402, … … 145 149 case kPOSITRON: return "Positron"; 146 150 case kELECTRON: return "Electron"; 151 case kANTIMUON: return "Anti-Muon"; 152 case kMUON: return "Muon"; 153 case kPI0: return "Pi-0"; 154 case kNEUTRON: return "Neutron"; 147 155 case kPROTON: return "Proton"; 148 156 case kHELIUM: return "Helium"; … … 151 159 } 152 160 153 return Form("%d", fPartId); 161 return Form("Id:%d", fPartId); 162 } 163 TString GetParticleSymbol() const 164 { 165 switch (fPartId) 166 { 167 case kGAMMA: return "\\gamma"; 168 case kPOSITRON: return "e^{+}"; 169 case kELECTRON: return "e^{-}"; 170 case kANTIMUON: return "\\mu^{+}"; 171 case kMUON: return "\\mu^{-}"; 172 case kPI0: return "\\pi^{0}"; 173 case kNEUTRON: return "n"; 174 case kPROTON: return "p"; 175 case kHELIUM: return "He"; 176 case kOXYGEN: return "O"; 177 case kIRON: return "Fe"; 178 } 179 180 return Form("Id:%d", fPartId); 154 181 } 155 182 TString GetEnergyStr() const
Note:
See TracChangeset
for help on using the changeset viewer.