Ignore:
Timestamp:
01/17/09 14:52:43 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r9212 r9226  
    284284    name += pix.GetPixelId();
    285285
     286
    286287    Bool_t same = str.Contains("same");
    287288
     
    392393}
    393394
     395void 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
    394405// --------------------------------------------------------------------------
    395406//
     
    435446void MRawEvtData::Set(const MArrayI &data)
    436447{
    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    }
    438459
    439460    Byte_t *dest = fHiGainFadcSamples->GetArray();
     
    448469            Byte_t *ptr = reinterpret_cast<Byte_t*>(dest);
    449470            while (src<end)
    450                 *ptr++ = *src++;
     471                *ptr++ = Byte_t(*src++);
    451472        }
    452473        return;
     
    456477            UShort_t *ptr = reinterpret_cast<UShort_t*>(dest);
    457478            while (src<end)
    458                 *ptr++ = *src++;
     479                *ptr++ = UShort_t(*src++);
    459480        }
    460481        return;
     
    464485        return;
    465486    }
     487}
     488
     489void 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
     497void MRawEvtData::SetIndices()
     498{
     499    for (UInt_t i=0; i<fHiGainPixId->GetSize(); i++)
     500        (*fHiGainPixId)[i] = i;
    466501}
    467502
Note: See TracChangeset for help on using the changeset viewer.