Changeset 654 for trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
- Timestamp:
- 03/01/01 15:56:58 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtData.cc
r609 r654 216 216 } 217 217 218 void MRawEvtData::DeletePixels( )218 void MRawEvtData::DeletePixels(Bool_t flag) 219 219 { 220 220 // … … 222 222 // 223 223 DeleteArrays(); 224 InitArrays( );224 InitArrays(flag); 225 225 } 226 226 … … 233 233 } 234 234 235 void MRawEvtData::InitArrays() 236 { 237 fHiGainPixId = new MArrayS(0); //UShort_t[0]; 238 fLoGainPixId = new MArrayS(0); //new UShort_t[0]; 239 fHiGainFadcSamples = new MArrayB(0); //new Byte_t[0]; 240 fLoGainFadcSamples = new MArrayB(0); //new Byte_t[0]; 235 void MRawEvtData::InitArrays(Bool_t flag) 236 { 237 // const int npix = !flag ? 0 : fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate(); 238 239 fHiGainPixId = new MArrayS(0);//npix); 240 fLoGainPixId = new MArrayS(0);//npix); 241 fHiGainFadcSamples = new MArrayB(0);//npix*fRunHeader->GetNumSamplesHiGain()); 242 fLoGainFadcSamples = new MArrayB(0);//npix*fRunHeader->GetNumSamplesLoGain()); 241 243 } 242 244 … … 248 250 // Add to lo gains if lflag = 1 249 251 // 250 251 252 MArrayS *arrpix = lflag ? fLoGainPixId : fHiGainPixId; 252 253 MArrayB *arrsam = lflag ? fLoGainFadcSamples : fHiGainFadcSamples; … … 286 287 } 287 288 288 /* 289 void MRawEvtData::AddPixelLo(UShort_t nOfPixel, TArrayC *data, int nr, int pos) 290 { 291 // 292 // add the number of the new pixel to the array as last entry 293 // 294 fLoGainPixId->AddAt(nOfPixel, nr); 295 296 // 297 // add the new slices as last entries to array 298 // 299 fLoGainFadcSamples->AddAt((Byte_t*)data->GetArray(), pos, data->GetSize()); 300 } 301 302 void MRawEvtData::AddPixelHi(UShort_t nOfPixel, TArrayC *data, int nr, int pos) 303 { 304 // check whether we got the right number of new samples 305 // if there are no samples already stored: this is the new number of samples 306 // 307 const Byte_t ns = data->GetSize(); 308 309 // 310 // add the number of the new pixel to the array as last entry 311 // 312 fHiGainPixId->AddAt(nOfPixel, nr); 313 314 // 315 // add the new slices as last entries to array 316 // 317 fHiGainFadcSamples->AddAt((Byte_t*)data->GetArray(), arrsam->GetSize()-ns, ns); 318 } 319 */ 320 void MRawEvtData::ReadEvt(ifstream &fin) 289 void MRawEvtData::ReadEvt(istream &fin) 321 290 { 322 291 // … … 327 296 const UShort_t nhi = fRunHeader->GetNumSamplesHiGain(); 328 297 329 TArrayC lo(nlo);330 TArrayC hi(nhi);331 332 298 const UShort_t npic = fRunHeader->GetNumPixInCrate(); 299 300 // 301 // Enhance array by the size which we'll read now 302 // 303 Byte_t lo[nlo]; 304 Byte_t hi[nhi]; 305 306 const int npixhi = fHiGainPixId->GetSize(); 307 const int npixlo = fLoGainPixId->GetSize(); 308 309 fHiGainPixId->Set(npixhi+npic); 310 fLoGainPixId->Set(npixlo+npic); 311 312 const int nsamhi = fHiGainFadcSamples->GetSize(); 313 const int nsamlo = fLoGainFadcSamples->GetSize(); 314 315 fHiGainFadcSamples->Set(nsamhi+nhi*npic); 316 fLoGainFadcSamples->Set(nsamlo+nlo*npic); 333 317 334 318 for (int i=0; i<npic; i++) … … 339 323 const UShort_t npix = fRunHeader->GetPixAssignment(i); 340 324 341 fin.read((Byte_t*)hi.GetArray(), nhi); 342 AddPixel(npix, &hi, kFALSE); 325 // 326 // This is to fill the data of one pixel to the MRawEvtHeader Class. 327 // The parameters are the pixelnumber and the FADC_SLICES values of ADCs 328 // Add to lo gains if lflag = 1 329 // 330 fin.read(hi, nhi); 331 fHiGainPixId->AddAt(npix, npixhi+i); 332 fHiGainFadcSamples->AddAt(hi, nsamhi+i*nhi, nhi); 343 333 344 334 // FIXME: Not implemented in the raw files yet 345 335 //if (IsLoGainOn(i, j)) 346 336 //{ 347 fin.read((Byte_t*)lo.GetArray(), nlo); 348 AddPixel(npix, &lo, kTRUE); 337 fin.read(lo, nlo); 338 fLoGainPixId->AddAt(npix, npixlo+i); 339 fLoGainFadcSamples->AddAt(lo, nsamlo+i*nlo, nlo); 349 340 //} 350 341 }
Note:
See TracChangeset
for help on using the changeset viewer.