Ignore:
Timestamp:
06/18/03 18:04:46 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r2178 r2200  
    170170    {
    171171        *fLog << endl;
    172         *fLog << " " << setfill(' ') << setw(3) << dec << i << ": ";
     172        *fLog << " " << setfill(' ') << setw(3) << dec << i << " -";
     173        *fLog << " " << setfill(' ') << setw(3) << dec << (*fHiGainPixId)[i] << ": ";
    173174        *fLog << (manip?dec:hex) << flush;
    174175
     
    313314    if (fRunHeader && flag)
    314315    {
    315         const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
     316        //const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
     317        const int npix = fRunHeader->GetNumConnectedPixels();
    316318
    317319        if (fArraySize == npix)
    318320        {
    319321            fPosInArray = 0;
     322            fConnectedPixels = 0;
    320323            return;
    321324        }
     
    347350    if (flag && fRunHeader)
    348351    {
    349         const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
     352        //const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
     353        const int npix = fRunHeader->GetNumConnectedPixels();
    350354
    351355        fHiGainPixId       = new MArrayS(npix);
     
    367371
    368372    fPosInArray = 0;
     373    fConnectedPixels = 0;
    369374}
    370375
     
    428433    const UShort_t npos = npic*fPosInArray;
    429434
    430     Byte_t *higainsam = fHiGainFadcSamples->GetArray()+nhi*npos;
    431     Byte_t *logainsam = fLoGainFadcSamples->GetArray()+nlo*npos;
    432 
    433     // UShort_t *hipixid = (UShort_t*)fHiGainPixId->GetArray()+npos;
    434     // UShort_t *lopixid = (UShort_t*)fLoGainPixId->GetArray()+npos;
     435    Byte_t *higainsam = fHiGainFadcSamples->GetArray()+nhi*fConnectedPixels;
     436    Byte_t *logainsam = fLoGainFadcSamples->GetArray()+nlo*fConnectedPixels;
    435437
    436438    for (int i=0; i<npic; i++)
    437439    {
    438         //
    439         // get the spiral pixel number from the run header
    440         //
     440        fin.read((char*)higainsam, nhi);
     441        fin.read((char*)logainsam, nlo);
     442
     443        // calc the spiral hardware pixel number
    441444        const UShort_t ipos = npos+i;
    442445
    443         const UShort_t npix = fRunHeader->GetPixAssignment(ipos);
     446        // -1 converts the hardware pixel Id into the software pixel index
     447        const Int_t npix = fRunHeader->GetPixAssignment(ipos);
     448
     449        // Check whether the pixel is connected or not
     450        if (npix==0)
     451            continue;
    444452
    445453        //
     
    448456        //  Add to lo gains if lflag = 1
    449457        //
    450         fHiGainPixId->AddAt(npix, ipos);
    451         fin.read((char*)higainsam, nhi);
     458        fHiGainPixId->AddAt(npix, fConnectedPixels);
    452459        higainsam += nhi;
    453460
     
    455462        //if (IsLoGainOn(i, j))
    456463        //{
    457         fLoGainPixId->AddAt(npix, ipos);
    458         fin.read((char*)logainsam, nlo);
     464        fLoGainPixId->AddAt(npix, fConnectedPixels);
    459465        logainsam += nlo;
    460466        //}
     467
     468        fConnectedPixels++;
    461469    }
    462470
Note: See TracChangeset for help on using the changeset viewer.