Changeset 2386
- Timestamp:
- 10/15/03 19:15:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2382 r2386 1 1 -*-*- END OF LINE -*-*- 2 2003/10/15: Thomas Bretz 3 4 * Makefile.conf.general: 5 - added libThread to support mona 6 7 * manalysis/MCerPhotAnal2.cc: 8 - changed comments 9 - accelerated the code a bit by using pointer arithmetic 10 11 * mbase/BaseLinkDef.h, mbase/Makefile: 12 - added MReadSocket 13 14 * mbase/MReadSocket.[h,cc]: 15 - added MReadSocket 16 17 * mbase/MEvtLoop.cc: 18 - fixed some crashes in ProcessGuiEvents 19 20 * mbase/MFilter.cc: 21 - changed header 22 23 * mbase/MTime.h: 24 - added operator double() 25 26 * mimage/MHillas.cc: 27 - changed the comments about corrxy 28 29 * mmain/MStatusDisplay.cc: 30 - added many comments 31 - added kFileClose stuff 32 - added AddRawTab 33 - added thread handling in UpdateTab 34 - fixed deletion in case the pointer is on heap 35 - added date/time to ps-output 36 37 * mraw/MRawEvtHeader.cc: 38 - added some comments about the total number of bytes read 39 40 * mraw/MRawRunHeader.[h,cc]: 41 - added some comments about the total number of bytes read 42 - fixed treating files with 0xc0c1 as Magic-Number 43 - added GetNumTotalBytes 44 45 * mraw/Makefile, mraw/RawLinkDef.h: 46 - added MRawSocketRead 47 48 * mraw/MRawSocketRead.[h,cc]: 49 - added 50 51 52 2 53 2003/10/05: Abelardo Moralejo 3 54 … … 6 57 version of the macro, sorry!) 7 58 8 59 60 9 61 2003/10/02: Thomas Bretz 10 62 -
trunk/MagicSoft/Mars/Makefile.conf.general
r2265 r2386 4 4 5 5 ROOTVER = `root-config --version` 6 ROOTLIBS = `root-config --libs` -lMinuit -lHistPainter 7 ROOTGLIBS = `root-config --glibs` -lMinuit -lHistPainter 6 ROOTLIBS = `root-config --libs` -lMinuit -lHistPainter -lThread 7 ROOTGLIBS = `root-config --glibs` -lMinuit -lHistPainter -lThread 8 8 ROOTCFLAGS = `root-config --cflags` 9 9 -
trunk/MagicSoft/Mars/manalysis/MCerPhotAnal2.cc
r2265 r2386 24 24 25 25 ////////////////////////////////////////////////////////////////////////////// 26 // //27 // MCerPhotAnal2 //28 // //29 // This is a task which calculates the number of photons from the FADC //30 // time slices. At the moment it integrates simply the FADC values. //31 // //32 // Input Containers: //33 // MRawEvtData, MPedes dtalCam //34 // //35 // Output Containers: //36 // MCerPhotEvt //37 // //26 // 27 // MCerPhotAnal2 28 // 29 // This is a task which calculates the number of photons from the FADC 30 // time slices. At the moment it integrates simply the FADC values. 31 // 32 // Input Containers: 33 // MRawEvtData, MPedestalCam 34 // 35 // Output Containers: 36 // MCerPhotEvt 37 // 38 38 ////////////////////////////////////////////////////////////////////////////// 39 39 … … 134 134 while (pixel.Next()) 135 135 { 136 Byte_t max = pixel.GetNumMaxHiGainSample(); 137 Byte_t num = fRawEvt->GetNumHiGainSamples(); 138 139 Byte_t *ptr = pixel.GetHiGainSamples(); 136 Byte_t *ptr = pixel.GetHiGainSamples(); 137 Byte_t *max = ptr+pixel.GetIdxMaxHiGainSample(); 138 Byte_t *end = ptr+fRawEvt->GetNumHiGainSamples(); 139 Byte_t *first = max-fBefore; 140 Byte_t *last = max+fAfter; 140 141 141 142 ULong_t sumb = 0; // sum background … … 147 148 Int_t nb = 0; 148 149 Int_t nsb = 0; 149 for (int i=0; i<num; i++) 150 151 if (*max==255) 152 sat++; 153 154 while (ptr<end) 150 155 { 151 if (ptr[i]==255) 152 sat++; 153 154 //if (sat>1) 155 // continue; 156 157 if (i<max-fBefore || i>max+fAfter) 158 { 159 sumb += ptr[i]; 160 sqb += ptr[i]*ptr[i]; 156 if (ptr<first || ptr>last) 157 { 158 sumb += *ptr; 159 sqb += *ptr* *ptr; 161 160 nb++; 162 161 } 163 162 else 164 163 { 165 sumsb += ptr[i];166 sqsb += ptr[i]*ptr[i];164 sumsb += *ptr; 165 sqsb += *ptr* *ptr; 167 166 nsb++; 168 167 } 168 ptr++; 169 169 } 170 170 … … 172 172 { 173 173 // Area: x9 174 max = pixel.GetNumMaxLoGainSample();175 num = fRawEvt->GetNumLoGainSamples();176 177 174 ptr = pixel.GetLoGainSamples(); 175 max = ptr+pixel.GetIdxMaxLoGainSample(); 176 177 if (*max>250) 178 { 179 fSkip++; 180 return kCONTINUE; 181 } 182 183 end = ptr+fRawEvt->GetNumLoGainSamples(); 184 first = max-fBefore; 185 last = max+fAfter; 178 186 179 187 sumsb = 0; // sum signal+background … … 184 192 //nb = 0; 185 193 nsb = 0; 186 for (int i=0; i<num; i++) 187 { 188 if (ptr[i]>250) 189 { 190 fSkip++; 191 return kCONTINUE; 192 } 193 if (i<max-fBefore || i>max+fAfter) 194 while (ptr<end) 195 { 196 if (ptr<first || ptr>last) 194 197 { 195 198 /* 199 // Background already calced from hi-gains! 196 200 sumb += ptr[i]; 197 201 sqb += ptr[i]*ptr[i]; … … 200 204 else 201 205 { 202 sumsb += ptr[i];203 sqsb += ptr[i]*ptr[i];206 sumsb += *ptr; 207 sqsb += *ptr* *ptr; 204 208 nsb++; 205 209 } 210 ptr++; 206 211 } 207 212 } -
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r2267 r2386 14 14 15 15 #pragma link C++ class MLog+; 16 #pragma link C++ class MReadSocket+; 16 17 17 18 #pragma link C++ class MIter+; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2299 r2386 168 168 { 169 169 fProgress = bar; 170 fProgress->SetBit(kMustCleanup); 170 if (fProgress) 171 fProgress->SetBit(kMustCleanup); 171 172 } 172 173 … … 187 188 MParContainer::SetDisplay(d); 188 189 if (!d) 189 {190 190 fProgress=NULL; 191 return; 192 } 193 194 d->SetBit(kMustCleanup); 191 else 192 d->SetBit(kMustCleanup); 193 195 194 if (fParList) 196 195 fParList->SetDisplay(d); … … 269 268 Bool_t MEvtLoop::ProcessGuiEvents(Int_t num, Int_t entries) 270 269 { 271 if ( !fProgress ||gROOT->IsBatch())270 if (gROOT->IsBatch()) 272 271 return kTRUE; 273 272 … … 286 285 fDisplay->ClearStatus(); 287 286 break; 287 // 288 // If the display is not on the heap (means: not created 289 // with the new operator) the object is deleted somewhere 290 // else in the code. It is the responsibility of the 291 // application which instantiated the object to make 292 // sure that the correct action is taken. This can be 293 // done by calling MStatusDisplay::CheckStatus() 294 // 295 // Because we are synchronous we can safely delete it here! 296 // 297 // Close means: Close the display but leave analysis running 298 // Exit means: Close the display and stop analysis 299 // 300 case MStatusDisplay::kFileClose: 301 case MStatusDisplay::kFileExit: 302 rc = fDisplay->CheckStatus() == MStatusDisplay::kFileClose; 303 304 if (fDisplay->IsOnHeap()) 305 delete fDisplay; 306 307 // 308 // This makes the display really disappear physically on 309 // the screen in case of MStatusDisplay::kFileClose 310 // 311 gSystem->ProcessEvents(); 312 313 return rc; 288 314 default: 289 *fLog << warn << "MEvtloop: fDisplay->Chec Status() has returned unknown status #" << fDisplay->CheckStatus() << "... cleared." << endl;315 *fLog << warn << "MEvtloop: fDisplay->CheckStatus() has returned unknown status #" << fDisplay->CheckStatus() << "... cleared." << endl; 290 316 fDisplay->ClearStatus(); 291 317 break; … … 293 319 294 320 // 295 // Check System time (don't loose too much time by updat es)296 // 297 298 // FIXME: Not thread safe 321 // Check System time (don't loose too much time by updating the GUI) 322 // 323 324 // FIXME: Not thread safe (if you have more than one eventloop running) 299 325 static Int_t start = num; 300 326 static TTime t1 = gSystem->Now(); … … 335 361 // Set new progress bar position 336 362 // 337 fProgress->SetPosition(num); 363 if (fProgress) 364 fProgress->SetPosition(num); 338 365 339 366 // … … 346 373 gSystem->ProcessEvents(); 347 374 else 348 gClient->ProcessEventsFor(fProgress); 375 if (fProgress) 376 gClient->ProcessEventsFor(fProgress); 349 377 #endif 350 378 -
trunk/MagicSoft/Mars/mbase/MFilter.cc
r1938 r2386 16 16 ! 17 17 ! 18 ! Author(s): Thomas Bretz 07/2001 <mailto:tbretz@uni-sw.gwdg.de>18 ! Author(s): Thomas Bretz, 07/2001 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 120 ! Copyright: MAGIC Software Development, 2000-2003 21 21 ! 22 22 ! -
trunk/MagicSoft/Mars/mbase/MTime.h
r2150 r2386 108 108 } 109 109 110 operator double() const //[s] 111 { 112 return fNanoSec/1e9+(fHour*24*60*60+fMin*60+fSec); 113 } 114 110 115 ClassDef(MTime, 1) //A generalized MARS time stamp 111 116 }; -
trunk/MagicSoft/Mars/mbase/Makefile
r2267 r2386 44 44 MEvtLoop.cc \ 45 45 MIter.cc \ 46 MReadSocket.cc \ 46 47 MDirIter.cc \ 47 48 MGList.cc \ -
trunk/MagicSoft/Mars/mimage/MHillas.cc
r2173 r2386 277 277 278 278 // 279 // If corrxy=0 (which should never happen, because fSize>0) we 280 // cannot calculate Length and Width. The calculation failed 281 // and returns kFALSE 282 // In reallity it is almost impossible to have a distribution 283 // of cerenkov photons in the used pixels which is exactly symmetric 279 // If corrxy=0 (which should happen not very often, because fSize>0) 280 // we cannot calculate Length and Width. 281 // In reallity it is almost impossible to have a distribution of 282 // cerenkov photons in the used pixels which is exactly symmetric 284 283 // along one of the axis. 284 // It seems to be less than 0.1% of all events. 285 285 // 286 286 if (corrxy==0) -
trunk/MagicSoft/Mars/mmain/MStatusDisplay.cc
r2299 r2386 75 75 #include <TObjArray.h> // TObjArray 76 76 #include <TPostScript.h> // TPostScript 77 #include <TInterpreter.h> // gInterpreter 77 78 78 79 #include <TGTab.h> // TGTab … … 186 187 //filemenu->AddEntry("Set printer &name", kFilePrinterName); 187 188 filemenu->AddSeparator(); 189 filemenu->AddEntry("C&lose", kFileClose); 188 190 filemenu->AddEntry("E&xit", kFileExit); 189 191 filemenu->Associate(this); … … 507 509 : TGMainFrame(gClient ? gClient->GetRoot() : NULL, 1, 1), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0) 508 510 { 511 // 512 // This is a possibility for the user to check whether this 513 // object has already been deleted. It will be removed 514 // from the list in the destructor. 515 // 509 516 gROOT->GetListOfSpecials()->Add(this); 510 517 511 518 fFont = gVirtualX->LoadQueryFont("7x13bold"); 512 519 520 // 521 // In case we are in batch mode use a list of canvases 522 // instead of the Root Embedded Canvases in the TGTab 523 // 513 524 fBatch = new TList; 514 525 fBatch->SetOwner(); … … 566 577 MStatusDisplay::~MStatusDisplay() 567 578 { 579 // 580 // Delete object from global object table so it cannot 581 // be deleted by chance a second time 582 // 583 gInterpreter->DeleteGlobal(this); 584 585 // 586 // This is a possibility for the user to check whether this 587 // object has already been deleted. It has been added 588 // to the list in the constructor. 589 // 568 590 gROOT->GetListOfSpecials()->Remove(this); 569 591 570 592 SetLogStream(NULL); 571 593 594 // 595 // Delete the list of objects corresponding to this object 596 // 572 597 delete fList; 598 599 // 600 // Delete the list list of canvases used in batch mode 601 // instead of the Root Embedded Canvases in the TGTab 602 // 573 603 delete fBatch; 574 604 605 // 606 // Delete the font used for the logging window 607 // 575 608 if (fFont) 576 609 gVirtualX->DeleteFont(fFont); … … 671 704 } 672 705 706 /* 707 class MCanvas : public TRootEmbeddedCanvas 708 { 709 public: 710 MCanvas(const char* name, const TGWindow* p, UInt_t w, UInt_t h, UInt_t o) : 711 TRootEmbeddedCanvas(name, p, w, h, o) {} 712 void Layout() 713 { 714 cout << "EmbLayout: " << GetCanvas()->GetName() << endl; 715 716 // Create layout for canvas. Depending on the size of the container 717 // we need to add the scrollbars. 718 TRootEmbeddedCanvas::Layout(); 719 } 720 }; 721 */ 722 723 TGCompositeFrame *MStatusDisplay::AddRawTab(const char *name) 724 { 725 // Add new tab 726 TGCompositeFrame *f = fTab->AddTab(name); 727 728 // layout and map new tab 729 Layout(); 730 MapSubwindows(); 731 Layout(); 732 733 // display new tab in the main frame 734 gClient->ProcessEventsFor(fTab); 735 736 *fLog << inf << "Adding Raw Tab '" << name << "' (" << f->GetWidth() << "x"; 737 *fLog << f->GetHeight() << ")" << endl; 738 739 // return pointer to new canvas 740 return f; 741 } 742 673 743 // -------------------------------------------------------------------------- 674 744 // … … 688 758 TGCompositeFrame *f = fTab->AddTab(name); 689 759 690 // create root emb 0edded canvas and add it to the tab760 // create root embedded canvas and add it to the tab 691 761 TRootEmbeddedCanvas *ec = new TRootEmbeddedCanvas(name, f, f->GetWidth(), f->GetHeight(), 0); 692 762 f->AddFrame(ec, fLayCanvas); … … 723 793 } 724 794 795 725 796 // -------------------------------------------------------------------------- 726 797 // … … 737 808 return; 738 809 739 // Code taken from TCanvas::Update() and TCanvas::Paint 740 c->FeedbackMode(kFALSE); // Goto double buffer mode 741 c->Paint(); // Repaint all pad's 742 c->Flush(); // Copy all pad pixmaps to the screen 810 // Code taken from TCanvas::Update() and TCanvas::Paint() 811 // replaces PaintModified() by Paint() 812 if (gThreadXAR) 813 { 814 void *arr[2] = { NULL, c }; 815 if (((*gThreadXAR)("CUPD", 2, arr, NULL))) 816 return; 817 } 818 819 if (!c->IsBatch()) 820 c->FeedbackMode(kFALSE); // Goto double buffer mode 821 822 c->Paint(); // Repaint all pads 823 c->Flush(); // Copy all pad pixmaps to the screen 824 743 825 //c->SetCursor(kCross); 744 826 … … 871 953 { 872 954 case kLoopStop: 955 case kFileClose: 873 956 case kFileExit: 874 if (id==kFileExit )875 delete this;957 if (id==kFileExit || id==kFileClose) 958 CloseWindow(); 876 959 fStatus = (Status_t)id; 877 960 return kTRUE; … … 1029 1112 return ProcessMessageCommandMenu(mp1); // mp2=userdata 1030 1113 case kCM_TAB: 1031 for (int i=1; i<fTab->GetNumberOfTabs(); i++) 1032 fTab->GetTabContainer(i)->UnmapWindow(); 1114 /* 1115 for (int i=0; i<fTab->GetNumberOfTabs(); i++) 1116 fTab->GetTabContainer(i)->UnmapWindow(); 1117 */ 1033 1118 UpdateTab(fTab->GetTabContainer(mp1)); 1034 fTab->GetTabContainer(mp1)->MapWindow(); 1119 //fTab->GetTabContainer(mp1)->MapWindow(); 1120 1035 1121 /* 1036 1122 if (mp1>0) … … 1187 1273 // and the destructor are calling DestroyWindow which seems to be 1188 1274 // in conflict with the TRootEmbeddedCanvas. 1189 delete this; 1275 1276 // FIXME: Make sure that the Status Display is deleted from every 1277 // where (eg Eventloop) first! 1278 1279 gLog << dbg << "MStatusDisplay is on heap: " << (int)IsOnHeap() << endl; 1280 1281 if (fIsLocked<=0 && IsOnHeap()) 1282 delete this; 1283 fStatus = kFileExit; 1190 1284 } 1191 1285 … … 1201 1295 1202 1296 flag ? SetBit(kNoContextMenu) : ResetBit(kNoContextMenu); 1297 1203 1298 for (int i=1; i<fTab->GetNumberOfTabs(); i++) 1204 1299 { … … 1563 1658 TVirtualPS *psave = gVirtualPS; 1564 1659 1660 TDatime d; 1661 1565 1662 TPostScript ps(name, 112); 1566 1663 ps.SetBit(TPad::kPrintingPS); … … 1608 1705 ps.NewPage(); 1609 1706 1610 Float_t psw = 26; // A4 - width 1611 Float_t psh = 20; // A4 - height 1707 // 1708 // 26 is used here to scale the canvas into a height of 26, 1709 // such that the page title can be set above the canvas... 1710 // 1711 Float_t psw = 26; //29.7; // A4 - width 1712 Float_t psh = 21.0; // A4 - height 1612 1713 1613 1714 const Float_t cw = c->GetWw(); … … 1655 1756 ps.TextNDC(0, 1.02, TString(" ")+n->GetName()); 1656 1757 ps.SetTextAlign(21); // cent top 1657 ps.TextNDC(0.5, 1.02, "MARS - Magic Analysis and Reconstruction Software");1758 ps.TextNDC(0.5, 1.02, TString("MARS - Magic Analysis and Reconstruction Software - ")+d.AsString()); 1658 1759 ps.SetTextAlign(31); // right top 1659 1760 ps.TextNDC(1, 1.02, Form("Page No.%i (%i) ", page++, i)); -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r2328 r2386 237 237 int MRawEvtHeader::ReadEvt(istream &fin) 238 238 { 239 fin.read((char*)&fDAQEvtNumber, 4); 239 fin.read((char*)&fDAQEvtNumber, 4); // Total=4 240 240 241 241 UInt_t fAbsTime[2]; 242 fin.read((char*)fAbsTime, 8); 242 fin.read((char*)fAbsTime, 8); // Total=12 243 243 244 244 // … … 246 246 // 247 247 const Double_t mhz = 9.375; // [1e6 ticks/s] 248 const Double_t t = (Double_t)fAbsTime[0]/mhz *1e-3;// [ns]249 const UShort_t ns = (UShort_t)fmod(t , 1e9);250 const Byte_t s = (Byte_t)fmod(t/1e 9, 60);251 const Byte_t m = (Byte_t)fmod(t/60e 9, 60);252 const Byte_t h = (Byte_t)(t/3600e 9);248 const Double_t t = (Double_t)fAbsTime[0]/mhz; // [ns] 249 const UShort_t ns = (UShort_t)fmod(t*1e-3, 1e9); 250 const Byte_t s = (Byte_t)fmod(t/1e12, 60); 251 const Byte_t m = (Byte_t)fmod(t/60e12, 60); 252 const Byte_t h = (Byte_t)(t/3600e12); 253 253 254 254 fTime->SetTime(h, m, s, ns); … … 257 257 Byte_t dummy[4]; 258 258 259 fin.read((char*)&fNumTrigLvl1, 4); 260 fin.read((char*)&fNumTrigLvl2, 4); 261 fin.read((char*)fTrigPattern, 8); 262 fin.read((char*)&fTrigType, 2); 263 fin.read((char*)dummy, 2); //was fAllLoGainOn259 fin.read((char*)&fNumTrigLvl1, 4); // Total=16 260 fin.read((char*)&fNumTrigLvl2, 4); // Total=20 261 fin.read((char*)fTrigPattern, 8); // Total=28 262 fin.read((char*)&fTrigType, 2); // Total=30 263 fin.read((char*)dummy, 2); // Total=32, was fAllLoGainOn 264 264 fin.read((char*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize()); 265 265 -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r2299 r2386 94 94 // read one RUN HEADER from the input stream 95 95 // 96 fin.read((char*)&fMagicNumber, 2); 96 fMagicNumber = 0; 97 98 fin.read((char*)&fMagicNumber, 2); // Total=2 97 99 98 100 // … … 101 103 if (fMagicNumber != kMagicNumber && fMagicNumber != kMagicNumber+1) 102 104 { 103 *fLog << err << "Error: Wrong Magic Number : Not a Magic File!" << endl;105 *fLog << err << "Error: Wrong Magic Number (0x" << hex << fMagicNumber << "): Not a Magic File!" << endl; 104 106 return; 105 107 } 106 108 107 if (fMagicNumber == kMagicNumber && fMagicNumber != kMagicNumber+1)109 if (fMagicNumber == kMagicNumber+1) 108 110 *fLog << warn << "WARNING - This file maybe broken (0xc0c1) - DAQ didn't close it correctly!" << endl; 109 111 110 112 Byte_t dummy[16]; 111 113 112 fin.read((char*)&fFormatVersion, 2); 113 fin.read((char*)&fSoftVersion, 2); 114 fin.read((char*)&fRunType, 2); 115 fin.read((char*)&fRunNumber, 4); 116 fin.read((char*)&fProjectName, 22); 117 fin.read((char*)&fSourceName, 12); 114 fin.read((char*)&fFormatVersion, 2); // Total=4 115 fin.read((char*)&fSoftVersion, 2); // Total=6 116 fin.read((char*)&fRunType, 2); // Total=8 117 fin.read((char*)&fRunNumber, 4); // Total=12 118 fin.read((char*)&fProjectName, 22); // Total=34 119 fin.read((char*)&fSourceName, 12); // Total=46 118 120 fin.read((char*)dummy, 4); // was RA (moved to tracking system) 119 121 fin.read((char*)dummy, 4); // was DEC (moved to tracking system) 120 fin.read((char*)&fSourceEpochChar, 2); 121 fin.read((char*)&fSourceEpochDate, 2); 122 fin.read((char*)&fMJD, 4); 123 fin.read((char*)&fDateYear, 2); 124 fin.read((char*)&fDateMonth, 2); 125 fin.read((char*)&fDateDay, 2); 126 fin.read((char*)&fNumCrates, 2); 127 fin.read((char*)&fNumPixInCrate, 2); 128 fin.read((char*)&fNumSamplesLoGain, 2); 129 fin.read((char*)&fNumSamplesHiGain, 2); 130 fin.read((char*)&fNumEvents, 4); 122 fin.read((char*)&fSourceEpochChar, 2); // Total=56 123 fin.read((char*)&fSourceEpochDate, 2); // Total=58 124 fin.read((char*)&fMJD, 4); // Total=62 125 fin.read((char*)&fDateYear, 2); // Total=64 126 fin.read((char*)&fDateMonth, 2); // Total=66 127 fin.read((char*)&fDateDay, 2); // Total=68 128 fin.read((char*)&fNumCrates, 2); // Total=70 129 fin.read((char*)&fNumPixInCrate, 2); // Total=72 130 fin.read((char*)&fNumSamplesLoGain, 2); // Total=74 131 fin.read((char*)&fNumSamplesHiGain, 2); // Total=76 132 fin.read((char*)&fNumEvents, 4); // Total=80 131 133 132 134 … … 148 150 { 149 151 *fLog << all << endl; 150 *fLog << "MagicNumber: 0x" << hex << fMagicNumber << " - " << (fMagicNumber==kMagicNumber?"OK":"Wrong!") << endl; 152 *fLog << "MagicNumber: 0x" << hex << fMagicNumber << " - "; 153 switch (fMagicNumber) 154 { 155 case kMagicNumber: *fLog << "OK"; break; 156 case kMagicNumber+1: *fLog << "File not closed!"; break; 157 default: *fLog << "Wrong!"; break; 158 } 159 *fLog << endl; 151 160 *fLog << "Version: " << dec << "Format=" << fFormatVersion << " "; 152 161 *fLog << "Software=" << fSoftVersion << endl; … … 213 222 return fPixAssignment->GetSize(); 214 223 } 224 225 // -------------------------------------------------------------------------- 226 // 227 // Returns absolute size in bytes of the run header as read from a raw file. 228 // This must be done _after_ the header is read, because the header doesn't 229 // have a fixed size (used in MRawSocketRead) 230 // 231 Int_t MRawRunHeader::GetNumTotalBytes() const 232 { 233 return 80+fNumCrates*fNumPixInCrate*2+16; 234 } -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r2316 r2386 104 104 105 105 UShort_t GetNumPixel() const; 106 Int_t GetNumTotalBytes() const; 106 107 107 108 void Print(Option_t *t=NULL) const; -
trunk/MagicSoft/Mars/mraw/Makefile
r2207 r2386 34 34 MRawCrateArray.cc \ 35 35 MRawCrateData.cc \ 36 MRawFileWrite.cc \ 36 37 MRawFileRead.cc \ 37 MRaw FileWrite.cc38 MRawSocketRead.cc 38 39 39 40 SRCS = $(SRCFILES) -
trunk/MagicSoft/Mars/mraw/RawLinkDef.h
r1020 r2386 14 14 #pragma link C++ class MRawCrateData+; 15 15 16 #pragma link C++ class MRawSocketRead+; 16 17 #pragma link C++ class MRawFileRead+; 17 18 #pragma link C++ class MRawFileWrite+;
Note:
See TracChangeset
for help on using the changeset viewer.