Changeset 2645
- Timestamp:
- 12/11/03 14:22:56 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mraw
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc
r2636 r2645 94 94 } 95 95 96 Int_t MRawCrateArray::GetSize() const 97 { 98 return fArray->GetEntriesFast(); 99 } 100 96 101 // -------------------------------------------------------------------------- 97 102 // -
trunk/MagicSoft/Mars/mraw/MRawCrateArray.h
r2607 r2645 27 27 28 28 void SetSize(Int_t i); 29 Int_t GetSize() const; 29 30 MRawCrateData *GetEntry(Int_t i); 30 31 -
trunk/MagicSoft/Mars/mraw/MRawCrateData.cc
r2636 r2645 73 73 *fLog << "FADCEventNr = " << fFADCEvtNumber << " "; 74 74 *fLog << "FADCClockTick = " << fFADCClockTick << " (20MHz)" << endl; 75 *fLog << "ABFlags = " << hex << fABFlags << " (20MHz)" <<endl;75 *fLog << "ABFlags = " << hex << fABFlags << endl; 76 76 } -
trunk/MagicSoft/Mars/mraw/MRawCrateData.h
r2636 r2645 24 24 UInt_t GetFADCEvtNumber() const { return fFADCEvtNumber; } 25 25 UInt_t GetFADCClockTick() const { return fFADCClockTick; } 26 Byte_t GetABFlags() const { return fABFlags; } 26 27 27 28 void Print(Option_t *t=NULL) const; -
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r2546 r2645 47 47 // 48 48 // 49 // Version 2: Derives from MCamEvent now 49 // Version 3: 50 // ---------- 51 // - Added fABFlags 52 // 53 // Version 2: 54 // ---------- 55 // - Derives from MCamEvent now 56 // 57 // Version 1: 58 // ---------- 59 // - First implementation 50 60 // 51 61 ///////////////////////////////////////////////////////////////////////////// … … 66 76 #include "MArrayB.h" 67 77 #include "MGeomCam.h" 78 79 #include "MRawCrateArray.h" 80 #include "MRawCrateData.h" 81 68 82 #include "MRawRunHeader.h" 69 83 #include "MRawEvtPixelIter.h" … … 109 123 fHiGainFadcSamples->Reset(); 110 124 fLoGainFadcSamples->Reset(); 125 fABFlags->Reset(); 111 126 } 112 127 … … 171 186 for (int i=0; i<nHiPix; i++) 172 187 { 188 const UShort_t idx = (*fHiGainPixId)[i]; 189 173 190 *fLog << endl; 174 *fLog << " " << setfill(' ') << setw(3) << dec << i << " -"; 175 *fLog << " " << setfill(' ') << setw(3) << dec << (*fHiGainPixId)[i] << ": "; 176 *fLog << (manip?dec:hex); 177 178 if (!manip) 179 *fLog << setfill('0'); 191 *fLog << " " << setfill(' ') << setw(3) << dec << i << " - " << setw(3); 192 *fLog << dec << idx << " <" << hex << setfill('0') << setw(2); 193 *fLog << ((Int_t)(*fABFlags)[idx/8]&0xff) << "> "; 194 195 *fLog << (manip?dec:hex) << (manip ? setfill(' ') : setfill('0')); 180 196 181 197 for (int j=0; j<nHiSamp; j++) … … 187 203 } 188 204 189 if (!(l<nLoPix && (*fLoGainPixId)[l]== (*fHiGainPixId)[i]))205 if (!(l<nLoPix && (*fLoGainPixId)[l]==idx)) 190 206 continue; 191 207 … … 364 380 delete fHiGainFadcSamples; 365 381 delete fLoGainFadcSamples; 382 delete fABFlags; 366 383 } 367 384 … … 382 399 fHiGainFadcSamples = new MArrayB(npix*fRunHeader->GetNumSamplesHiGain()); 383 400 fLoGainFadcSamples = new MArrayB(npix*fRunHeader->GetNumSamplesLoGain()); 401 fABFlags = new TArrayC((npix-1)/8+1); 384 402 385 403 fArraySize = npix; … … 391 409 fHiGainFadcSamples = new MArrayB(0); 392 410 fLoGainFadcSamples = new MArrayB(0); 411 fABFlags = new TArrayC(0); 393 412 394 413 fArraySize = 0; … … 457 476 458 477 const UShort_t npos = npic*fPosInArray; 478 479 const Byte_t ab = fCrateArray->GetEntry(fPosInArray)->GetABFlags(); 459 480 460 481 Byte_t *higainsam = fHiGainFadcSamples->GetArray()+nhi*fConnectedPixels; … … 490 511 logainsam += nlo; 491 512 //} 513 514 if (TESTBIT(ab, i)) 515 SETBIT((*fABFlags)[npix/8], npix%8); 516 else 517 CLRBIT((*fABFlags)[npix/8], npix%8); 492 518 493 519 fConnectedPixels++; … … 539 565 *evt.fLoGainFadcSamples = *fLoGainFadcSamples; 540 566 567 *evt.fABFlags = *fABFlags; 568 541 569 evt.fPosInArray = fPosInArray; 542 570 evt.fConnectedPixels = fConnectedPixels; -
trunk/MagicSoft/Mars/mraw/MRawEvtData.h
r2416 r2645 11 11 12 12 class MRawRunHeader; 13 class MRawCrateArray; 13 14 14 15 class TArrayC; … … 20 21 friend class MRawEvtPixelIter; 21 22 private: 22 MRawRunHeader *fRunHeader; //! provides information about numbers 23 MRawRunHeader *fRunHeader; //! provides information about numbers 24 MRawCrateArray *fCrateArray; //! provides information about ab flag 23 25 24 26 // FIXME: COMMENT ABOUT ORDERING … … 29 31 MArrayS *fLoGainPixId; //-> list of pixel IDs of lo gain channel 30 32 MArrayB *fLoGainFadcSamples; //-> list of lo gain samples of all pixels (ordering: see fLoGainPixId) 33 34 TArrayC *fABFlags; //-> A information about the exact trigger position 31 35 32 36 Int_t fPosInArray; //! … … 41 45 ~MRawEvtData(); 42 46 43 void Init(MRawRunHeader *rh )47 void Init(MRawRunHeader *rh, MRawCrateArray *arr) 44 48 { 45 49 // … … 47 51 // from a magic binary file 48 52 // 49 fRunHeader = rh; 53 fRunHeader = rh; 54 fCrateArray = arr; 50 55 } 51 56 … … 78 83 ; 79 84 80 ClassDef(MRawEvtData, 2) //Container to store the raw Event Data85 ClassDef(MRawEvtData, 3) //Container to store the raw Event Data 81 86 }; 82 87 -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.cc
r2487 r2645 50 50 #include "MRawEvtPixelIter.h" 51 51 52 #include <TArrayC.h> 53 52 54 #include "MRawEvtData.h" 53 55 … … 138 140 fHiGainPos = fData->fHiGainFadcSamples->GetArray()-fNumHiGainSamples; 139 141 fLoGainPos = fData->fLoGainFadcSamples->GetArray()-fNumLoGainSamples; 142 fABFlags = fData->fABFlags->GetArray(); 140 143 141 144 // -
trunk/MagicSoft/Mars/mraw/MRawEvtPixelIter.h
r2487 r2645 25 25 Byte_t *fHiGainPos; //! pointer to hi-gain samples of actual pixel 26 26 Byte_t *fLoGainPos; //! pointer to lo-gain samples of actual pixel 27 28 Char_t *fABFlags; //! pointer to AB flags 27 29 28 30 UShort_t fNumEntry; … … 93 95 return fLoGainId && *fHiGainId==*fLoGainId; 94 96 } 97 Bool_t HasABFlag() const 98 { 99 // 100 // return kTRUE the lo gains exist for the actual pixel, else return kFALSE 101 // 102 return TESTBIT(fABFlags[GetPixelId()/8], GetPixelId()%8); 103 } 104 Byte_t GetABFlag() const 105 { 106 // 107 // return kTRUE the lo gains exist for the actual pixel, else return kFALSE 108 // 109 return (Byte_t)fABFlags[GetPixelId()/8]; 110 } 95 111 96 112 Byte_t *GetLoGainSamples() const -
trunk/MagicSoft/Mars/mraw/MRawFileRead.cc
r2636 r2645 179 179 // 180 180 fRawEvtHeader->Init(fRawRunHeader, fRawEvtTime); 181 fRawEvtData ->Init(fRawRunHeader );181 fRawEvtData ->Init(fRawRunHeader, fRawCrateArray); 182 182 183 183 return kTRUE; -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r2636 r2645 133 133 fin.read((char*)&fSourceEpochChar, 2); // Total=56 134 134 fin.read((char*)&fSourceEpochDate, 2); // Total=58 135 if (fFormatVersion<2) 135 if (fFormatVersion<2) // Total += 10 136 136 { 137 137 UShort_t y, m, d; … … 142 142 fRunStart.Set(y, m, d, 0, 0, 0, 0); 143 143 } 144 fin.read((char*)&fNumCrates, 2); // Total= 70145 fin.read((char*)&fNumPixInCrate, 2); // Total= 72146 fin.read((char*)&fNumSamplesLoGain, 2); // Total= 74147 fin.read((char*)&fNumSamplesHiGain, 2); // Total= 76148 fin.read((char*)&fNumEvents, 4); // Total= 80144 fin.read((char*)&fNumCrates, 2); // Total=60 145 fin.read((char*)&fNumPixInCrate, 2); // Total=62 146 fin.read((char*)&fNumSamplesLoGain, 2); // Total=64 147 fin.read((char*)&fNumSamplesHiGain, 2); // Total=66 148 fin.read((char*)&fNumEvents, 4); // Total=70 149 149 if (fFormatVersion>1) 150 150 { 151 fRunStart.ReadBinary(fin); 152 fRunStop.ReadBinary(fin); 151 fRunStart.ReadBinary(fin); // Total += 7 152 fRunStop.ReadBinary(fin); // Total += 7 153 153 } 154 154 … … 255 255 Int_t MRawRunHeader::GetNumTotalBytes() const 256 256 { 257 return 80+fNumCrates*fNumPixInCrate*2+16; 258 } 257 switch (fFormatVersion) 258 { 259 case 1: 260 return 80+fNumCrates*fNumPixInCrate*2+16; 261 case 2: 262 return 84+fNumCrates*fNumPixInCrate*2+16; 263 } 264 return 0; 265 } -
trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc
r2636 r2645 277 277 // 278 278 fRawEvtHeader->Init(fRawRunHeader, fTime); 279 fRawEvtData ->Init(fRawRunHeader );279 fRawEvtData ->Init(fRawRunHeader, fRawCrateArray); 280 280 281 281 // -
trunk/MagicSoft/Mars/mraw/RawIncl.h
r2521 r2645 1 1 #ifndef __CINT__ 2 2 3 #include <TArrayC.h> 3 4 #include "MArrayB.h" 4 5 #include "MArrayS.h"
Note:
See TracChangeset
for help on using the changeset viewer.