- Timestamp:
- 07/14/04 19:28:57 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.cc
r4249 r4379 68 68 ////////////////////////////////////////////////////////////////////////////// 69 69 #include "MHCalibrationChargeBlindPix.h" 70 #include "MExtractBlindPixel.h" 70 71 71 72 #include <TStyle.h> … … 95 96 const Double_t MHCalibrationChargeBlindPix::gkElectronicAmp = 0.008; 96 97 const Double_t MHCalibrationChargeBlindPix::gkElectronicAmpErr = 0.002; 97 98 const Int_t MHCalibrationChargeBlindPix::fgChargeNbins = 1000; 98 const Float_t MHCalibrationChargeBlindPix::gkSignalInitializer = -9999.; 99 100 const Int_t MHCalibrationChargeBlindPix::fgChargeNbins = 512; 99 101 const Axis_t MHCalibrationChargeBlindPix::fgChargeFirst = -0.5; 100 const Axis_t MHCalibrationChargeBlindPix::fgChargeLast = 5999.5;101 const Float_t MHCalibrationChargeBlindPix::fgSinglePheCut = 600.;102 const Axis_t MHCalibrationChargeBlindPix::fgChargeLast = 255.5; 103 const Float_t MHCalibrationChargeBlindPix::fgSinglePheCut = 60.; 102 104 const Float_t MHCalibrationChargeBlindPix::fgNumSinglePheLimit = 50.; 103 105 // -------------------------------------------------------------------------- … … 122 124 // - fASinglePheFADCSlices(0); 123 125 // - fAPedestalFADCSlices(0); 126 // - fPixId to 0 124 127 // 125 128 // Calls: … … 145 148 SetSinglePheCut(); 146 149 SetNumSinglePheLimit(); 147 SetProbLimit(0.00 001);148 SetBinsAfterStripping( 50);150 SetProbLimit(0.001); 151 SetBinsAfterStripping(64); 149 152 150 153 fHGausHist.SetName("HCalibrationChargeBlindPix"); … … 152 155 fHGausHist.SetXTitle("Sum FADC Slices"); 153 156 fHGausHist.SetYTitle("Nr. of events"); 154 157 158 fPixId = 0; 159 155 160 Clear(); 156 161 } … … 187 192 // 188 193 // Sets: 189 // - all variables to 0., except the fit result variables to -999.194 // - all variables to 0., except the fit result variables to gkSignalInitializer 190 195 // - all flags to kFALSE 191 196 // - all pointers to NULL … … 201 206 { 202 207 203 fLambda = -999.; 204 fMu0 = -999.; 205 fMu1 = -999.; 206 fSigma0 = -999.; 207 fSigma1 = -999.; 208 209 fLambdaErr = -999.; 210 fMu0Err = -999.; 211 fMu1Err = -999.; 212 fSigma0Err = -999.; 213 fSigma1Err = -999.; 214 215 fLambdaCheck = -999.; 216 fLambdaCheckErr = -999.; 217 218 fFitFunc = kEMichele; 219 // fFitFunc = kEPoisson4; 208 fLambda = gkSignalInitializer; 209 fMu0 = gkSignalInitializer; 210 fMu1 = gkSignalInitializer; 211 fSigma0 = gkSignalInitializer; 212 fSigma1 = gkSignalInitializer; 213 fLambdaErr = gkSignalInitializer; 214 fMu0Err = gkSignalInitializer; 215 fMu1Err = gkSignalInitializer; 216 fSigma0Err = gkSignalInitializer; 217 fSigma1Err = gkSignalInitializer; 218 219 fLambdaCheck = gkSignalInitializer; 220 fLambdaCheckErr = gkSignalInitializer; 221 222 // fFitFunc = kEMichele; 223 fFitFunc = kEPoisson4; 220 224 221 225 fNumSinglePhes = 0; … … 258 262 } 259 263 264 /* 265 // -------------------------------------------------------------------------- 266 // 267 // Our own clone function is necessary since root 3.01/06 or Mars 0.4 268 // I don't know the reason. 269 // 270 // Creates new MHCalibrationCam 271 // 272 TObject *MHCalibrationChargeBlindPix::Clone(const char *) const 273 { 274 275 MHCalibrationChargeBlindPix *pix = new MHCalibrationChargeBlindPix(); 276 this->Copy(*pix); 277 278 this->fHGausHist.Copy(pix->fHGausHist); 279 this->fSinglePheFit->Copy(*(pix->fSinglePheFit)); 280 this->fHSinglePheFADCSlices->Copy(*(pix->fHSinglePheFADCSlices)); 281 this->fHPedestalFADCSlices->Copy(*(pix->fHPedestalFADCSlices)); 282 283 284 return pix; 285 } 286 */ 287 260 288 // -------------------------------------------------------------------------- 261 289 // 262 290 // Set bit kSinglePheFitOK from outside 263 291 // 264 void MHCalibrationChargeBlindPix::SetSinglePheFitOK (const Bool_t b )292 void MHCalibrationChargeBlindPix::SetSinglePheFitOK (const Bool_t b ) 265 293 { 266 294 b ? SETBIT(fFlags,kSinglePheFitOK) : CLRBIT(fFlags,kSinglePheFitOK); … … 320 348 } 321 349 322 InitBins();323 324 350 return kTRUE; 325 351 } … … 337 363 return kFALSE; 338 364 365 fExtractor = (MExtractBlindPixel*)pList->FindObject("MExtractBlindPixel"); 366 if (!fExtractor) 367 { 368 *fLog << err << "MExtractBlindPixel not found... aborting " << endl; 369 return kFALSE; 370 } 371 372 const Int_t samples = fSignal->GetNumFADCSamples(); 373 const Int_t integ = fExtractor->IsExtractionType( MExtractBlindPixel::kIntegral ); 374 375 // 376 // Modify the histogram size in case, integrals have been used 377 // 378 if ( fLast < samples*integ*fgChargeLast ) 379 { 380 SetLast ( samples * 256. - 0.5 ); 381 SetSinglePheCut( samples * fgSinglePheCut ); 382 } 383 384 MHGausEvents::InitBins(); 385 339 386 return kTRUE; 340 387 } … … 384 431 } 385 432 386 433 // 387 434 // Signal extraction and histogram filling 388 435 // 389 const Float_t signal = (Float_t)fSignal->GetExtractedSignal();436 const Float_t signal = fSignal->GetExtractedSignal(fPixId); 390 437 if (signal > -0.5) 391 438 FillHistAndArray(signal); … … 394 441 395 442 // 396 // I Norder to study the single-phe posistion, we extract the slices397 // 398 const Int_t blindpixIdx = fSignal->GetBlindPixelIdx( );443 // In order to study the single-phe posistion, we extract the slices 444 // 445 const Int_t blindpixIdx = fSignal->GetBlindPixelIdx(fPixId); 399 446 400 447 MRawEvtPixelIter pixel(fRawEvt); … … 579 626 // 580 627 const Stat_t entries = fHGausHist.Integral("width"); 581 const Double_t lambda_guess = 0. 1;628 const Double_t lambda_guess = 0.05; 582 629 const Double_t maximum_bin = fHGausHist.GetBinCenter(fHGausHist.GetMaximumBin()); 583 630 const Double_t norm = entries/TMath::Sqrt(TMath::TwoPi()); … … 642 689 case kEPoisson4: 643 690 fSinglePheFit->SetParNames( "#lambda", "#mu_{0}", "#mu_{1}", "#sigma_{0}", "#sigma_{1}","Area"); 644 fSinglePheFit->SetParameters(lambda_guess,fMeanPedestal,mu_1_guess,fSigmaPedestal,si_1_guess,norm); 691 // fSinglePheFit->SetParameters(lambda_guess,fMeanPedestal,mu_1_guess,fSigmaPedestal,si_1_guess,norm); 692 fSinglePheFit->SetParameters(0.05,10.,75.,20.,70.,norm); 645 693 646 694 fSinglePheFit->SetParLimits(0,0.,0.5); 647 fSinglePheFit->SetParLimits(1, 648 fMeanPedestal-5.*fMeanPedestalErr, 649 fMeanPedestal+5.*fMeanPedestalErr); 650 fSinglePheFit->SetParLimits(2,rmin,rmax); 651 fSinglePheFit->SetParLimits(3, 652 fSigmaPedestal-5.*fSigmaPedestalErr, 653 fSigmaPedestal+5.*fSigmaPedestalErr); 654 fSinglePheFit->SetParLimits(4,0.,(rmax-rmin)); 695 // fSinglePheFit->SetParLimits(1, 696 // fMeanPedestal-5.*fMeanPedestalErr, 697 // fMeanPedestal+5.*fMeanPedestalErr); 698 fSinglePheFit->SetParLimits(1,0.,30.); 699 // fSinglePheFit->SetParLimits(2,rmin,rmax); 700 fSinglePheFit->SetParLimits(2,50.,150.); 701 // fSinglePheFit->SetParLimits(3, 702 // fSigmaPedestal-5.*fSigmaPedestalErr, 703 // fSigmaPedestal+5.*fSigmaPedestalErr); 704 fSinglePheFit->SetParLimits(3,0.,50.); 705 // fSinglePheFit->SetParLimits(4,0.,(rmax-rmin)); 706 fSinglePheFit->SetParLimits(4,0.,100.); 655 707 fSinglePheFit->SetParLimits(5,norm-(0.5*norm),norm+(0.5*norm)); 656 708 break; … … 1004 1056 1005 1057 if (!IsEmpty()) 1006 1058 gPad->SetLogy(); 1007 1059 1008 1060 gPad->SetTicks(); -
trunk/MagicSoft/Mars/mcalib/MHCalibrationChargeBlindPix.h
r4376 r4379 22 22 class MRawEvtPixelIter; 23 23 class MCalibrationChargeBlindPix; 24 class MExtractBlindPixel; 24 25 class MExtractedSignalBlindPixel; 25 26 class MHCalibrationChargeBlindPix : public MHCalibrationChargePix … … 32 33 static const Float_t fgSinglePheCut; //! Default for fSinglePheCut (now set to: 200 ) 33 34 static const Float_t fgNumSinglePheLimit; //! Default for fNumSinglePheLimit (now set to: 50) 35 static const Float_t gkSignalInitializer; //! Signal initializer (-9999.) 34 36 35 37 static const Double_t gkElectronicAmp; // Electronic Amplification after the PMT (in FADC counts/N_e) … … 41 43 MCalibrationChargeBlindPix *fBlindPix; //! Storage container results 42 44 MExtractedSignalBlindPixel *fSignal; //! Storage container extracted signal 45 MExtractBlindPixel *fExtractor; //! Extractor blind pixel 43 46 MRawEvtData *fRawEvt; //! Storage container raw data 44 47 -
trunk/MagicSoft/Mars/msignal/MExtractBlindPixel.h
r4376 r4379 44 44 Byte_t fExtractionType; 45 45 46 enum ExtractionType_t { kAmplitude, kIntegral, kFilter }; 46 public: 47 enum ExtractionType_t { kAmplitude, kIntegral }; 47 48 49 50 private: 48 51 void FindAmplitude (Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat); 49 52 void FindIntegral (Byte_t *firstused, Byte_t *lowgain, Float_t &sum, Byte_t &sat);
Note:
See TracChangeset
for help on using the changeset viewer.