Changeset 3417
- Timestamp:
- 03/07/04 14:05:58 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r3415 r3417 4 4 5 5 -*-*- END OF LINE -*-*- 6 7 2004/03/06: Markus Gaug 8 9 * macros/calibration.C 10 - adapted call to MHCamera::ProjectionS to the new version 11 12 * mcalib/Makefile 13 - include directory mbadpixels 14 15 * mcalib/MCalibrationChargeCalc.[h,cc] 16 - include MBadPixelsCam 17 - remove exclusion of pixels from ascii-file 18 (now accessible from MBadPixelsCam) 19 6 20 7 21 2004/03/05: Nadia Tonello -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r3414 r3417 37 37 // Initialize pulser light wavelength 38 38 // 39 // ReInit: MCalibrationCam::InitSize(NumPixels) is called which allocates 40 // memory in a TClonesArray of type MCalibrationChargePix 39 // ReInit: MCalibrationCam::InitSize(NumPixels) is called from MGeomApply (which allocates 40 // memory in a TClonesArray of type MCalibrationChargePix) 41 // Initializes pointer to MBadPixelsCam 41 42 // 42 43 // Process: Nothing done by this class, histograms are filled by … … 57 58 // MRawEvtData 58 59 // MPedestalCam 59 // M CalibrationCam60 // MBadPixelsCam 60 61 // 61 62 // Output Containers: 62 63 // MCalibrationCam 64 // MBadPixelsCam 63 65 // 64 66 // … … 174 176 #include "MCalibrationChargeCalc.h" 175 177 176 // FXIME: Usage of fstream is a preliminary workaround!177 #include <fstream>178 179 178 #include <TSystem.h> 180 179 #include <TH1.h> … … 200 199 #include "MExtractedSignalPix.h" 201 200 201 #include "MBadPixelsCam.h" 202 #include "MBadPixelsPix.h" 203 202 204 203 205 ClassImp(MCalibrationChargeCalc); … … 211 213 MCalibrationChargeCalc::MCalibrationChargeCalc(const char *name, const char *title) 212 214 : fPedestals(NULL), fCam(NULL), 213 fRawEvt(NULL), fRunHeader(NULL), fGeom(NULL), fEvtTime(NULL), 215 fRawEvt(NULL), fRunHeader(NULL), fGeom(NULL), 216 fBadPixels(NULL), fEvtTime(NULL), 214 217 fSignals(NULL), fPINDiode(NULL), fBlindPixel(NULL) 215 218 { … … 235 238 fNumLoGainSamples = 0; 236 239 fConversionHiLo = 0; 237 fNumExcludedPixels = 0;238 240 239 241 } … … 323 325 } 324 326 327 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam"); 328 if (!fBadPixels) 329 { 330 *fLog << err << "Could not find or create MBadPixelsCam ... aborting." << endl; 331 return kFALSE; 332 } 333 325 334 fCam->SetGeomCam(fGeom); 326 327 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); 328 fNumLoGainSamples = fSignals->GetNumUsedLoGainFADCSlices(); 329 fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples); 330 331 UInt_t npixels = fGeom->GetNumPixels(); 335 fCam->SetBadPixelsCam(fBadPixels); 336 337 fNumHiGainSamples = fSignals->GetNumUsedHiGainFADCSlices(); 338 fNumLoGainSamples = fSignals->GetNumUsedLoGainFADCSlices(); 339 fSqrtHiGainSamples = TMath::Sqrt((Float_t)fNumHiGainSamples); 340 341 UInt_t npixels = fGeom->GetNumPixels(); 332 342 333 343 for (UInt_t i=0; i<npixels; i++) 334 344 { 335 345 MCalibrationChargePix &pix = (*fCam)[i]; 346 MBadPixelsPix &bad = (*fBadPixels)[i]; 347 336 348 pix.DefinePixId(i); 349 350 if (bad.IsBad()) 351 { 352 pix.SetExcluded(); 353 continue; 354 } 337 355 338 356 pix.SetAbsTimeBordersHiGain(fSignals->GetFirstUsedSliceHiGain(), … … 341 359 fSignals->GetLastUsedSliceLoGain()); 342 360 } 343 344 if (fExcludedPixelsFile.IsNull())345 return kTRUE;346 347 //348 // Look for file to exclude pixels from analysis349 //350 gSystem->ExpandPathName(fExcludedPixelsFile);351 352 //353 // Initialize reading the file354 //355 ifstream in(fExcludedPixelsFile);356 if (!in)357 {358 *fLog << warn << "Cannot open file '" << fExcludedPixelsFile << "'" << endl;359 return kTRUE;360 }361 362 *fLog << inf << "Use excluded pixels from file: '" << fExcludedPixelsFile << "'" << endl;363 364 //365 // Read the file and count the number of entries366 //367 UInt_t pixel = 0;368 369 while (++fNumExcludedPixels)370 {371 in >> pixel;372 if (!in)373 break;374 375 //376 // Check for out of range377 //378 if (pixel > npixels)379 {380 *fLog << warn << "WARNING: To be excluded pixel: " << pixel << " is out of range " << endl;381 continue;382 }383 //384 // Exclude pixel385 //386 MCalibrationChargePix &pix = (*fCam)[pixel];387 pix.SetExcluded();388 389 *fLog << GetDescriptor() << inf << ": Exclude Pixel: " << pixel << endl;390 391 }392 393 if (--fNumExcludedPixels == 0)394 *fLog << warn << "WARNING: File '" << fExcludedPixelsFile << "'" << " is empty " << endl;395 else396 fCam->SetNumPixelsExcluded(fNumExcludedPixels);397 361 398 362 return kTRUE; … … 436 400 const Float_t num = TMath::Sqrt((Float_t)fPedestals->GetTotalEntries()); 437 401 438 if (ped == -1.)439 pix.SetExcluded();440 441 402 // 442 403 // Check if the pixel has been excluded from the fits -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r3351 r3417 15 15 #endif 16 16 17 #include "TString.h"18 19 17 class MRawEvtData; 20 18 class MRawRunHeader; … … 25 23 class MGeomCam; 26 24 class MExtractedSignalCam; 25 class MBadPixelsCam; 27 26 class MTime; 28 27 class MCalibrationChargeCalc : public MTask … … 35 34 MRawRunHeader *fRunHeader; //! RunHeader information 36 35 MGeomCam *fGeom; //! Geometry information 37 36 MBadPixelsCam *fBadPixels; //! Bad Pixels information 37 38 38 MTime *fEvtTime; //! Time of the event 39 39 … … 42 42 MCalibrationChargeBlindPix *fBlindPixel; // Calibration results of the Blind Pixel 43 43 44 45 44 Byte_t fNumHiGainSamples; 46 45 Byte_t fNumLoGainSamples; … … 49 48 Float_t fConversionHiLo; 50 49 Int_t fFlags; // Flag for the fits used 51 52 TString fExcludedPixelsFile;53 UInt_t fNumExcludedPixels;54 50 55 51 enum { kUseQualityChecks, … … 72 68 {b ? CLRBIT(fFlags, kHiLoGainCalibration) : SETBIT(fFlags, kHiLoGainCalibration);} 73 69 74 75 // Exclude pixels from configuration file76 void ExcludePixelsFromAsciiFile(const char *file) { fExcludedPixelsFile = file; }77 78 70 ClassDef(MCalibrationChargeCalc, 1) // Task to fill the Calibration Containers from raw data 79 71 }; -
trunk/MagicSoft/Mars/mcalib/Makefile
r3322 r3417 23 23 # 24 24 INCLUDES = -I. -I../mbase -I../mhbase -I../mgui -I../mgeom -I../manalysis \ 25 -I../mraw -I../mtools -I../mmc -I../mimage -I../msignal 25 -I../mraw -I../mtools -I../mmc -I../mimage -I../msignal -I../mbadpixels 26 26 27 27 # mhbase: MBinning MH
Note:
See TracChangeset
for help on using the changeset viewer.