Changeset 456 for trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
- Timestamp:
- 12/22/00 16:25:50 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r454 r456 1 /////////////////////////////////////////////////////////////////////////////// 2 // 3 // MRawEvtPixelIter 4 // 5 // class to iterate over all pixels of one event. 6 // The calling is similar to a root iterator: 7 // 8 // MRawEvtData *evtdata; // must be filled with data from somewhere 9 // MRawEvtPixelIter pixel(evtdata); // evtdata: ptr to event you want to iterate 10 // 11 // while (pixel.Next()) 12 // { 13 // // here you can access the actual time slices by using 14 // // pixel.GetPixelId(); 15 // // pixel.GetHiGainFadcSamples()[i]; // i is the number of the slice 16 // // pixel.IsLoGain(); // check if pixel has 17 // // pixel.GetLoGainFadcSamples()[i]; // i is the number of the slice 18 // 19 // // WARNING: Don't acces more time slices than available. 20 // // Get the numbers by calling: evtdata->GetNum[Lo,Hi]GainSamples() 21 // // This number is constant for one event 22 // } 23 // 24 /////////////////////////////////////////////////////////////////////////////// 1 25 #include "MRawEvtPixelIter.h" 2 26 … … 8 32 ClassImp(MRawEvtPixelIter) 9 33 10 TObject*MRawEvtPixelIter::Next()34 MRawEvtData *MRawEvtPixelIter::Next() 11 35 { 12 36 // 13 37 // if we are already at the last entry there is no 'next' entry anymore 14 38 // 15 if (fNumHiGainEntry==fData->fHiGainPixId->GetSize() -1)39 if (fNumHiGainEntry==fData->fHiGainPixId->GetSize()) 16 40 return NULL; 17 41 … … 19 43 // if we are already at the last entry there is no 'next' entry anymore 20 44 // 21 if (fNumLoGainEntry != fData->fLoGainPixId->GetSize() -1)45 if (fNumLoGainEntry != fData->fLoGainPixId->GetSize()) 22 46 if (*fHiGainId == *fLoGainId) 23 47 { … … 56 80 // set pointer to first entry of arrays 57 81 // 58 fHiGainId = (UShort_t*)fData->fHiGainPixId->GetArray();59 fLoGainId = (UShort_t*)fData->fLoGainPixId->GetArray();60 fHiGainPos = (Byte_t*)fData->fHiGainFadcSamples->GetArray();61 fLoGainPos = (Byte_t*)fData->fLoGainFadcSamples->GetArray();82 fHiGainId = fData->fHiGainPixId->GetArray()-1; 83 fLoGainId = fData->fLoGainPixId->GetArray()-1; 84 fHiGainPos = fData->fHiGainFadcSamples->GetArray()-fData->GetNumHiGainSamples(); 85 fLoGainPos = fData->fLoGainFadcSamples->GetArray()-fData->GetNumLoGainSamples(); 62 86 } 87 88 void MRawEvtPixelIter::Draw(Option_t *t) 89 { 90 // 91 // Draw the actual pixel (for options see: MRawEvtData::Draw) 92 // 93 char *txt = new char[6+strlen(t)]; 94 sprintf(txt, "%s%d", t, *fHiGainId); 95 fData->Draw(txt); 96 delete txt; 97 } 98 99 100 101 102 103
Note:
See TracChangeset
for help on using the changeset viewer.