Changeset 8149 for trunk/MagicSoft/Mars/mbadpixels
- Timestamp:
- 10/23/06 15:39:30 (18 years ago)
- Location:
- trunk/MagicSoft/Mars/mbadpixels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.cc
r8147 r8149 150 150 InitSize(n); 151 151 152 if ( n!=GetSize())152 if (GetSize()<n) 153 153 { 154 154 *fLog << warn << "MBadPixelsCam::Merge: Size mismatch (" << n << "," << GetSize() << ")... ignored." << endl; … … 559 559 // 560 560 // Read from an ascii file of the format: 561 // pixel1 pixel2 pixel3 pixel4 561 // pixel1 562 // pixel2 563 // pixel3 564 // pixel4 562 565 // while pixel1,2,3,4 are the pixel indices used in the software. 563 566 // 564 // To read the pixels corresponding to a given run you can give run!=0 565 // and a file of the format: 566 // 1234: 17 193 292 567 // 1235: 17 193 292 293 568 // 569 void MBadPixelsCam::AsciiRead(istream &fin, UInt_t run=0) 570 { 571 572 Int_t len; 567 void MBadPixelsCam::AsciiRead(istream &fin) 568 { 573 569 TString str; 574 570 … … 576 572 { 577 573 str.ReadLine(fin); 578 579 if (str.IsNull()) 580 { 581 *fLog << warn << GetDescriptor() 582 << ": Cannot apply AsciiRead from istream pointer. " 583 << "Either file does not exist or file is empty! " << endl; 584 return; 585 } 586 587 Int_t r; 588 589 const Int_t n = sscanf(str.Data(), " %d : %n", &r, &len); 590 if (n!=1) 591 return; 592 593 if (run==0 || run && (UInt_t)r==run) 574 if (!fin) 594 575 break; 595 } 596 597 str.Remove(0, len); 598 599 while (1) 600 { 601 Int_t idx; 602 const Int_t n = sscanf(str.Data(), " %d %n", &idx, &len); 603 604 if (n!=1) 605 break; 606 607 str.Remove(0, len); 576 577 if (str[0]=='#') 578 continue; 579 580 const Int_t idx = str.Atoi(); 608 581 609 582 if (idx>=GetSize()) … … 617 590 // -------------------------------------------------------------------------- 618 591 // 619 // Write the information into an ascii file. If a run-number is given the 620 // run-number will lead the line. 621 // 622 Bool_t MBadPixelsCam::AsciiWrite(ostream &fout, UInt_t run=0) const 623 { 624 if (run) 625 fout << run << ":"; 626 592 // Write the information into an ascii file. 593 // 594 Bool_t MBadPixelsCam::AsciiWrite(ostream &fout) const 595 { 627 596 for (int i=0; i<GetSize(); i++) 628 597 if ((*this)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 629 fout << " " << i; 630 631 if (run && GetSize()) 632 fout << endl; 598 fout << i << endl; 633 599 634 600 return kTRUE; -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsCam.h
r7903 r8149 50 50 Short_t GetNumMaxCluster(const MGeomCam &geom, Int_t aidx=-1) { return GetNumMaxCluster(MBadPixelsPix::kUnsuitableRun, geom, aidx); } 51 51 52 void AsciiRead(istream &fin, UInt_t run); 53 void AsciiRead(istream &fin) { AsciiRead(fin, 0); } 54 Bool_t AsciiWrite(ostream &out, UInt_t run) const; 55 Bool_t AsciiWrite(ostream &out) const { return AsciiWrite(out, 0); } 52 void AsciiRead(istream &fin); 53 Bool_t AsciiWrite(ostream &out) const; 56 54 57 55 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsIntensityCam.h
r8140 r8149 71 71 { return GetCam()->GetNumMaxCluster(geom, aidx); } 72 72 73 void AsciiRead(istream &fin, UInt_t run) 74 { GetCam()->AsciiRead(fin,run); } 75 void AsciiRead(istream &fin) 76 {GetCam()->AsciiRead(fin); } 77 Bool_t AsciiWrite(ostream &out, UInt_t run) 78 const { return GetCam()->AsciiWrite(out,run); } 79 Bool_t AsciiWrite(ostream &out) 80 const { return GetCam()->AsciiWrite(out); } 73 void AsciiRead(istream &fin) { GetCam()->AsciiRead(fin); } 74 Bool_t AsciiWrite(ostream &out) const { return GetCam()->AsciiWrite(out); } 81 75 82 76 // Inits
Note:
See TracChangeset
for help on using the changeset viewer.