Changeset 9226 for trunk/MagicSoft/Mars/mraw
- Timestamp:
- 01/17/09 14:52:43 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mraw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r9212 r9226 284 284 name += pix.GetPixelId(); 285 285 286 286 287 Bool_t same = str.Contains("same"); 287 288 … … 392 393 } 393 394 395 void MRawEvtData::ResetPixels() 396 { 397 if (!fRunHeader) 398 return; 399 400 // FIXME: Better give NumNormalPixels if numconnected==0 ? 401 402 ResetPixels(fRunHeader->GetNumNormalPixels(), fRunHeader->GetNumNormalPixels()-1); 403 } 404 394 405 // -------------------------------------------------------------------------- 395 406 // … … 435 446 void MRawEvtData::Set(const MArrayI &data) 436 447 { 437 const UInt_t n = fRunHeader->GetNumSamples()*fConnectedPixels; 448 fConnectedPixels = fHiGainPixId->GetSize(); 449 450 UInt_t n = fConnectedPixels*fRunHeader->GetNumSamplesHiGain(); 451 if (n!=data.GetSize()) 452 { 453 *fLog << err << "MRawEvtData::Set: Size mismatch." << endl; 454 *fLog << " fConnectedPixels=" << fConnectedPixels << endl; 455 *fLog << " NumHiGainSamples=" << fRunHeader->GetNumSamplesHiGain() << endl; 456 *fLog << " data.GetSize()=" << data.GetSize() << endl; 457 return; 458 } 438 459 439 460 Byte_t *dest = fHiGainFadcSamples->GetArray(); … … 448 469 Byte_t *ptr = reinterpret_cast<Byte_t*>(dest); 449 470 while (src<end) 450 *ptr++ = *src++;471 *ptr++ = Byte_t(*src++); 451 472 } 452 473 return; … … 456 477 UShort_t *ptr = reinterpret_cast<UShort_t*>(dest); 457 478 while (src<end) 458 *ptr++ = *src++;479 *ptr++ = UShort_t(*src++); 459 480 } 460 481 return; … … 464 485 return; 465 486 } 487 } 488 489 void MRawEvtData::SetIndices(const MArrayS &idx) 490 { 491 if (idx.GetSize()!=fHiGainPixId->GetSize()) 492 return; 493 494 memcpy(fHiGainPixId->GetArray(), idx.GetArray(), idx.GetSize()*sizeof(UShort_t)); 495 } 496 497 void MRawEvtData::SetIndices() 498 { 499 for (UInt_t i=0; i<fHiGainPixId->GetSize(); i++) 500 (*fHiGainPixId)[i] = i; 466 501 } 467 502 -
trunk/MagicSoft/Mars/mraw/MRawEvtData.h
r9212 r9226 57 57 } 58 58 59 59 60 public: 60 61 MRawEvtData(const char *name=NULL, const char *title=NULL); … … 74 75 void Draw (Option_t * = NULL); 75 76 77 void ResetPixels(); 76 78 void ResetPixels(UShort_t npix, UShort_t maxid); 77 79 void AddPixel(UShort_t nOfPixel, const TArrayC &data); 78 80 void Set(const MArrayI &data); 81 void SetIndices(const MArrayS &idx); 82 void SetIndices(); 79 83 80 84 UShort_t GetNumHiGainSamples() const;
Note:
See TracChangeset
for help on using the changeset viewer.