Changeset 4986 for trunk/MagicSoft/Mars/mhcalib
- Timestamp:
- 09/14/04 00:11:10 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mhcalib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.cc
r4964 r4986 40 40 #include "MLogManip.h" 41 41 42 #include "M CalibrationChargeBlindPix.h"43 #include "M CalibrationChargeBlindCam.h"42 #include "MRawEvtData.h" 43 #include "MRawEvtPixelIter.h" 44 44 45 45 #include "MExtractedSignalBlindPixel.h" 46 46 47 #include "MCalibrationBlindPix.h" 48 #include "MCalibrationIntensityBlindCam.h" 49 47 50 #include "MParList.h" 48 51 … … 52 55 53 56 using namespace std; 54 57 const Int_t MHCalibrationChargeBlindCam::fgNbins = 128; 58 const Axis_t MHCalibrationChargeBlindCam::fgFirst = -0.5; 59 const Axis_t MHCalibrationChargeBlindCam::fgLast = 511.5; 60 const Axis_t MHCalibrationChargeBlindCam::fgSPheCut = 20.; 61 const TString MHCalibrationChargeBlindCam::gsHistName = "ChargeBlind"; 62 const TString MHCalibrationChargeBlindCam::gsHistTitle = "Signals Blind "; 63 const TString MHCalibrationChargeBlindCam::gsHistXTitle = "Signal [FADC counts]"; 64 const TString MHCalibrationChargeBlindCam::gsHistYTitle = "Nr. events"; 55 65 // -------------------------------------------------------------------------- 56 66 // … … 60 70 // - all pointers to NULL 61 71 // 62 // Initializes and sets owner of: 63 // - fBlindPixelsArray 72 // - fFitFunc to kEPoisson4 73 // - fNbins to fgNbins 74 // - fFirst to fgFirst 75 // - fLast to fgLast 76 // - fSPheCut to fgSPheCut 64 77 // 65 // Sets fFitFunc to kEPoisson4 78 // - fHistName to gsHistName 79 // - fHistTitle to gsHistTitle 80 // - fHistXTitle to gsHistXTitle 81 // - fHistYTitle to gsHistYTitle 82 // 83 // - SetAverageing (kFALSE); 84 // - SetLoGain (kFALSE); 85 // - SetOscillations(kFALSE); 86 // - SetSizeCheck (kFALSE); 66 87 // 67 88 MHCalibrationChargeBlindCam::MHCalibrationChargeBlindCam(const char *name, const char *title) 68 : fCam(NULL), fRunHeader(NULL)89 : fRawEvt(NULL) 69 90 { 70 91 … … 72 93 fTitle = title ? title : "Class to fille the blind pixel histograms"; 73 94 74 fBlindPixelsArray = new TObjArray; 75 fBlindPixelsArray->SetOwner(); 76 77 fFitFunc = MHCalibrationChargeBlindPix::kEPoisson4; 78 79 } 80 81 // -------------------------------------------------------------------------- 82 // 83 // Deletes the TClonesArray of: 84 // - fBlindPixelsArray 85 // 86 MHCalibrationChargeBlindCam::~MHCalibrationChargeBlindCam() 87 { 88 delete fBlindPixelsArray; 89 } 90 91 // -------------------------------------------------------------------------- 92 // 93 // Get i-th High Gain pixel (pixel number) 94 // 95 MHCalibrationChargeBlindPix &MHCalibrationChargeBlindCam::operator[](UInt_t i) 96 { 97 return *static_cast<MHCalibrationChargeBlindPix*>(fBlindPixelsArray->UncheckedAt(i)); 98 } 99 100 // -------------------------------------------------------------------------- 101 // 102 // Get i-th High Gain pixel (pixel number) 103 // 104 const MHCalibrationChargeBlindPix &MHCalibrationChargeBlindCam::operator[](UInt_t i) const 105 { 106 return *static_cast<MHCalibrationChargeBlindPix*>(fBlindPixelsArray->UncheckedAt(i)); 107 } 95 SetFitFunc(); 96 SetSPheCut(); 97 98 SetNbins(fgNbins); 99 SetFirst(fgFirst); 100 SetLast (fgLast ); 101 102 SetHistName (gsHistName .Data()); 103 SetHistTitle (gsHistTitle .Data()); 104 SetHistXTitle(gsHistXTitle.Data()); 105 SetHistYTitle(gsHistYTitle.Data()); 106 107 SetAverageing (kFALSE); 108 SetLoGain (kFALSE); 109 SetOscillations(kFALSE); 110 SetSizeCheck (kFALSE); 111 } 112 113 // -------------------------------------------------------------------------- 114 // 115 // Gets the pointers to: 116 // - MRawEvtData 117 // 118 Bool_t MHCalibrationChargeBlindCam::SetupHists(const MParList *pList) 119 { 120 121 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData"); 122 if (!fRawEvt) 123 { 124 *fLog << err << dbginf << "MRawEvtData not found... aborting." << endl; 125 return kFALSE; 126 } 127 128 return kTRUE; 129 } 130 131 // -------------------------------------------------------------------------- 132 // 133 // Gets or creates the pointers to: 134 // - MExtractedSignalBlindPixel 135 // - MCalibrationChargeCam or MCalibrationIntensityBlindCam 136 // 137 // Initializes the number of used FADC slices from MExtractedSignalCam 138 // into MCalibrationChargeCam and test for changes in that variable 139 // 140 // Retrieve: 141 // - fRunHeader->GetNumSamplesHiGain(); 142 // 143 // Initializes the High Gain Arrays: 144 // 145 // - Expand fHiGainArrays to nblindpixels 146 // 147 // - For every entry in the expanded arrays: 148 // * Initialize an MHCalibrationPix 149 // * Set Binning from fNbins, fFirst and fLast 150 // * Set Histgram names and titles from fHistName and fHistTitle 151 // * Set X-axis and Y-axis titles from fHistXTitle and fHistYTitle 152 // * Call InitHists 153 // 154 Bool_t MHCalibrationChargeBlindCam::ReInitHists(MParList *pList) 155 { 156 157 MExtractedSignalBlindPixel *signal = 158 (MExtractedSignalBlindPixel*)pList->FindObject(AddSerialNumber("MExtractedSignalBlindPixel")); 159 if (!signal) 160 { 161 *fLog << err << "MExtractedSignalBlindPixel not found... abort." << endl; 162 return kFALSE; 163 } 164 165 fIntensCam = (MCalibrationIntensityCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityBlindCam")); 166 if (fIntensCam) 167 *fLog << inf << "Found MCalibrationIntensityBlindCam ... " << endl; 168 else 169 { 170 fCam = (MCalibrationCam*)pList->FindObject(AddSerialNumber("MCalibrationBlindCam")); 171 if (!fCam) 172 { 173 fCam = (MCalibrationCam*)pList->FindCreateObj(AddSerialNumber("MCalibrationBlindCam")); 174 if (!fCam) 175 { 176 *fLog << err << "Cannot find nor create MCalibrationBlindCam ... abort." << endl; 177 return kFALSE; 178 } 179 } 180 } 181 182 const Int_t nblindpixels = signal->GetNumBlindPixels(); 183 const Int_t samples = signal->GetNumFADCSamples(); 184 const Int_t integ = signal->IsExtractionType( MExtractBlindPixel::kIntegral ); 185 186 TH1F *h; 187 188 if (fHiGainArray->GetEntries()==0) 189 { 190 fHiGainArray->Expand(nblindpixels); 191 for (Int_t i=0; i<nblindpixels; i++) 192 { 193 (*fHiGainArray)[i] = new MHCalibrationChargeBlindPix(Form("%s%s",fHistName.Data(),"Pix"), 194 Form("%s%s",fHistTitle.Data()," Pixel ")); 195 196 MHCalibrationChargeBlindPix &pix = (MHCalibrationChargeBlindPix&)(*this)[i]; 197 198 pix.SetNbins ( fNbins ); 199 pix.SetFirst ( fFirst ); 200 pix.SetLast ( integ ? ((fLast+0.5)*samples)-0.5 : fLast ); 201 pix.SetSinglePheCut ( integ ? fSPheCut * samples : fSPheCut ); 202 pix.SetFitFunc ( integ ? kEPoisson5 : fFitFunc ); 203 204 h = pix.GetHGausHist(); 205 206 h->SetName (Form("%s%s%s","H",fHistName.Data(),"Pix")); 207 h->SetTitle(Form("%s%s",fHistTitle.Data()," Pixel ")); 208 h->SetXTitle(fHistXTitle.Data()); 209 h->SetYTitle(fHistYTitle.Data()); 210 211 pix.ChangeHistId(i); 212 pix.InitBins(); 213 214 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: ")); 215 } 216 } 217 return kTRUE; 218 } 219 220 // -------------------------------------------------------------------------- 221 // 222 // Retrieves from MExtractedSignalBlindPixel: 223 // - number of blind pixels 224 // 225 // Retrieves from MExtractedSignalBlindPixel: 226 // - number of FADC samples 227 // - extracted signal 228 // - blind Pixel ID 229 // 230 // Resizes (if necessary): 231 // - fASinglePheFADCSlices to sum of HiGain and LoGain samples 232 // - fAPedestalFADCSlices to sum of HiGain and LoGain samples 233 // 234 // Fills the following histograms: 235 // - MHGausEvents::FillHistAndArray(signal) 236 // 237 // Creates MRawEvtPixelIter, jumps to blind pixel ID, 238 // fills the vectors fASinglePheFADCSlices and fAPedestalFADCSlices 239 // with the full FADC slices, depending on the size of the signal w.r.t. fSinglePheCut 240 // 241 Bool_t MHCalibrationChargeBlindCam::FillHists(const MParContainer *par, const Stat_t w) 242 { 243 244 MExtractedSignalBlindPixel *signal = (MExtractedSignalBlindPixel*)par; 245 if (!signal) 246 { 247 *fLog << err << "No argument in MExtractedSignalBlindCam::Fill... abort." << endl; 248 return kFALSE; 249 } 250 251 const Int_t nblindpixels = signal->GetNumBlindPixels(); 252 253 if (GetSize() != nblindpixels) 254 { 255 gLog << err << "ERROR - Size mismatch... abort." << endl; 256 return kFALSE; 257 } 258 259 Float_t slices = (Float_t)signal->GetNumFADCSamples(); 260 261 if (slices == 0.) 262 { 263 *fLog << err << dbginf 264 << "Number of used signal slices in MExtractedSignalBlindPix " 265 << "is zero ... abort." 266 << endl; 267 return kFALSE; 268 } 269 270 for (Int_t i=0; i<nblindpixels; i++) 271 { 272 273 // 274 // Signal extraction and histogram filling 275 // If filter has been applied, sig has been set to -1. 276 // 277 const Float_t sig = signal->GetExtractedSignal(i); 278 279 if (sig < -0.5) 280 continue; 281 282 MHCalibrationChargeBlindPix &hist = (MHCalibrationChargeBlindPix&)(*this)[i]; 283 284 hist.FillHist(sig); 285 // 286 // In order to study the single-phe posistion, we extract the slices 287 // 288 const Int_t blindpixIdx = signal->GetBlindPixelIdx(i); 289 290 MRawEvtPixelIter pixel(fRawEvt); 291 pixel.Jump(blindpixIdx); 292 293 if (sig > fSPheCut) 294 hist.FillSinglePheFADCSlices(pixel); 295 else 296 hist.FillPedestalFADCSlices(pixel); 297 298 } 299 300 return kTRUE; 301 } 302 303 // -------------------------------------------------------------------------- 304 // 305 // For all TObjArray's (including the averaged ones), the following steps are performed: 306 // 307 // 1) Returns if the pixel is excluded. 308 // 2) Tests saturation. In case yes, set the flag: MCalibrationPix::SetHiGainSaturation() 309 // or the flag: MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainSaturated ) 310 // 3) Store the absolute arrival times in the MCalibrationChargePix's. If flag 311 // MCalibrationPix::IsHiGainSaturation() is set, the Low-Gain arrival times are stored, 312 // otherwise the Hi-Gain ones. 313 // 4) Calls to MHCalibrationCam::FitHiGainArrays() and MCalibrationCam::FitLoGainArrays() 314 // with the flags: 315 // - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainNotFitted ) 316 // - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainNotFitted ) 317 // - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kHiGainOscillating ) 318 // - MBadPixelsPix::SetUncalibrated( MBadPixelsPix::kLoGainOscillating ) 319 // 320 Bool_t MHCalibrationChargeBlindCam::FinalizeHists() 321 { 322 323 *fLog << endl; 324 325 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 326 { 327 328 MHCalibrationChargeBlindPix &hist = (MHCalibrationChargeBlindPix&)(*this)[i]; 329 330 TH1F *h = hist.GetHGausHist(); 331 332 Stat_t overflow = h->GetBinContent(h->GetNbinsX()+1); 333 if (overflow > 0.1) 334 { 335 *fLog << warn << GetDescriptor() 336 << ": Histogram Overflow occurred " << overflow 337 << " times in blind pixel: " << i << endl; 338 } 339 340 overflow = h->GetBinContent(0); 341 if (overflow > 0.1) 342 { 343 *fLog << warn << GetDescriptor() 344 << ": Histogram Underflow occurred " << overflow 345 << " times in blind pixel: " << i << endl; 346 } 347 348 MCalibrationBlindPix &pix = fIntensCam 349 ? (MCalibrationBlindPix&)(*fIntensCam)[i] 350 : (MCalibrationBlindPix&)(*fCam)[i]; 351 352 FitBlindPixel(hist,pix); 353 } 354 355 return kTRUE; 356 } 357 358 359 // -------------------------------------------------------------------------- 360 // 361 // Returns kFALSE, if empty 362 // 363 // - Creates the fourier spectrum and sets bit MHGausEvents::IsFourierSpectrumOK() 364 // - Retrieves the pedestals from MExtractedSignalBlindPixel 365 // - Normalizes fASinglePheFADCSlices and fAPedestalFADCSlices 366 // - Executes FitPedestal() 367 // - Executes FitSinglePhe() 368 // - Retrieves fit results and stores them in MCalibrationBlindPix 369 // 370 void MHCalibrationChargeBlindCam::FitBlindPixel(MHCalibrationChargeBlindPix &hist, MCalibrationBlindPix &pix) 371 { 372 373 if (hist.IsEmpty()) 374 { 375 *fLog << err << GetDescriptor() << " ID: " << hist.GetPixId() 376 << " My histogram has not been filled !! " << endl; 377 return; 378 } 379 380 hist.FinalizeSinglePheSpectrum(); 381 382 hist.FitPedestal(); 383 384 pix.SetValid(kTRUE); 385 386 if (hist.FitSinglePhe()) 387 pix.SetSinglePheFitOK(); 388 else 389 pix.SetValid(hist.IsPedestalFitOK()); 390 391 pix.SetLambda ( hist.GetLambda () ); 392 pix.SetLambdaVar ( hist.GetLambdaErr()*hist.GetLambdaErr() ); 393 pix.SetMu0 ( hist.GetMu0 () ); 394 pix.SetMu0Err ( hist.GetMu0Err () ); 395 pix.SetMu1 ( hist.GetMu1 () ); 396 pix.SetMu1Err ( hist.GetMu1Err () ); 397 pix.SetSigma0 ( hist.GetSigma0 () ); 398 pix.SetSigma0Err ( hist.GetSigma0Err() ); 399 pix.SetSigma1 ( hist.GetSigma1 () ); 400 pix.SetSigma1Err ( hist.GetSigma1Err() ); 401 pix.SetProb ( hist.GetProb () ); 402 403 pix.SetLambdaCheck ( hist.GetLambdaCheck() ); 404 pix.SetLambdaCheckErr ( hist.GetLambdaCheckErr() ); 405 } 406 108 407 109 408 // -------------------------------------------------------------------------- … … 118 417 { 119 418 120 const Int_t nhi = fBlindPixelsArray->GetEntries();121 122 419 // 123 420 // FIXME, this might be done faster and more elegant, by direct copy. … … 125 422 MHCalibrationChargeBlindCam *cam = new MHCalibrationChargeBlindCam(); 126 423 127 cam->fBlindPixelsArray->Expand(nhi); 424 // 425 // Copy the data members 426 // 427 cam->fRunNumbers = fRunNumbers; 428 cam->fPulserFrequency = fPulserFrequency; 429 cam->fFlags = fFlags; 430 cam->fNbins = fNbins; 431 cam->fFirst = fFirst; 432 cam->fLast = fLast; 433 cam->fFitFunc = fFitFunc; 434 435 const Int_t nhi = fHiGainArray->GetEntries(); 436 437 cam->fHiGainArray->Expand(nhi); 128 438 129 439 for (int i=0; i<nhi; i++) 130 (*cam->f BlindPixelsArray)[i] = (*fBlindPixelsArray)[i]->Clone();440 (*cam->fHiGainArray)[i] = (*fHiGainArray)[i]->Clone(); 131 441 132 442 return cam; 133 443 } 134 135 // --------------------------------------------------------------------------136 //137 // Gets the pointers to:138 // - MRunHeader139 // - MExtractedSignalBlindPix140 //141 // Calls Delete-Function of:142 // - MHCalibrationChargeBlindCam::fBlindPixelsArray143 //144 Bool_t MHCalibrationChargeBlindCam::SetupFill(const MParList *pList)145 {146 147 fRunHeader = (MRawRunHeader*)pList->FindObject("MRawRunHeader");148 if (!fRunHeader)149 {150 *fLog << warn << GetDescriptor()151 << ": MRawRunHeader not found... will not store run numbers." << endl;152 return kFALSE;153 }154 155 fSignal = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel");156 if (!fSignal)157 {158 *fLog << err << "MExtractedSignalBlindPixel not found... aborting " << endl;159 return kFALSE;160 }161 162 return kTRUE;163 }164 165 166 // --------------------------------------------------------------------------167 //168 // Initializes, if empty to MExtractedSignalCam::GetSize() for:169 // - MHCalibrationChargeBlindCam::fBlindPixelsArray170 //171 // Calls InitializeHists() for every entry in:172 // - MHCalibrationChargeBlindCam::fBlindPixelsArray173 //174 // Retrieves the run numbers from MRawRunHeader and stores them in fRunNumbers175 //176 Bool_t MHCalibrationChargeBlindCam::ReInit(MParList *pList)177 {178 179 const UInt_t nblindpixels = fSignal->GetNumBlindPixels();180 181 Int_t runnr = 0;182 183 if (fRunHeader)184 runnr = fRunHeader->GetRunNumber();185 186 fCam = (MCalibrationChargeBlindCam*)pList->FindCreateObj("MCalibrationChargeBlindCam");187 if (!fCam)188 {189 *fLog << err << "Cannot find nor create MCalibrationChargeBlindCam ... abort." << endl;190 return kFALSE;191 }192 193 if (fCam->GetNumBlindPixels() != nblindpixels)194 {195 *fLog << err;196 *fLog << "Size mismatch in MCalibrationChargeBlindCam ... abort." << endl;197 *fLog << " Size of MCalibrationChargeBlindCam: " << fCam->GetNumBlindPixels() << endl;198 *fLog << " Size of MExtractedSignalBlindPixel: " << nblindpixels << endl;199 return kFALSE;200 }201 202 203 const Int_t samples = fSignal->GetNumFADCSamples();204 const Int_t integ = fSignal->IsExtractionType( MExtractBlindPixel::kIntegral );205 206 if (fBlindPixelsArray->GetEntries()==0)207 {208 209 fBlindPixelsArray->Expand(nblindpixels);210 211 for (UInt_t i=0; i<nblindpixels; i++)212 {213 (*fBlindPixelsArray)[i] = new MHCalibrationChargeBlindPix;214 (*this)[i].ChangeHistId(i);215 if (integ)216 {217 (*this)[i].SetLast( samples * integ *218 ((*this)[i].GetLast()+0.5) - 0.5 );219 (*this)[i].SetSinglePheCut( samples * integ *220 (*this)[i].GetSinglePheCut() );221 }222 (*this)[i].InitBins();223 TH1F *h = (*this)[i].GetHGausHist();224 h->SetTitle( Form("%s%s", h->GetTitle()," Runs: "));225 (*this)[i].ChangeFitFunc(fFitFunc);226 (*this)[i].SetupFill(pList);227 (*this)[i].SetCalibrationChargeBlindPix(&(*fCam)[i]);228 }229 }230 231 for (UInt_t i=0; i<nblindpixels; i++)232 {233 TH1F *h = (*this)[i].GetHGausHist();234 h->SetTitle( Form("%s%i%s", h->GetTitle(),runnr," "));235 }236 237 return kTRUE;238 }239 240 241 //--------------------------------------------------------------------------------242 //243 // Retrieves from MExtractedSignalBlindPixel:244 // - number of blind pixels245 //246 // For all TObjArray's, the following steps are performed:247 //248 // 1) Test size and return kFALSE if not matching249 // 2)250 //251 Bool_t MHCalibrationChargeBlindCam::Fill(const MParContainer *par, const Stat_t w)252 {253 254 const Int_t nblindpixels = fSignal->GetNumBlindPixels();255 256 if (GetSize() != nblindpixels)257 {258 gLog << err << "ERROR - Size mismatch... abort." << endl;259 return kFALSE;260 }261 262 for (Int_t i=0; i<nblindpixels; i++)263 (*this)[i].Fill(par,w);264 265 return kTRUE;266 }267 268 // --------------------------------------------------------------------------269 //270 // Calls the Finalize() function of the blind pixels271 //272 Bool_t MHCalibrationChargeBlindCam::Finalize()273 {274 275 for (Int_t i=0; i<GetSize(); i++)276 if (!(*this)[i].Finalize())277 return kFALSE;278 279 return kTRUE;280 }281 282 283 444 284 445 // ----------------------------------------------------------------------------- … … 293 454 { 294 455 295 const Int_t size = f BlindPixelsArray->GetEntries();456 const Int_t size = fHiGainArray->GetEntries(); 296 457 297 458 if (size == 0) … … 330 491 331 492 } 493 494 Int_t MHCalibrationChargeBlindCam::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 495 { 496 497 Bool_t rc = kFALSE; 498 499 if (MHCalibrationCam::ReadEnv(env,prefix,print)) 500 rc = kTRUE; 501 502 if (IsEnvDefined(env, prefix, "SPheCut", print)) 503 { 504 SetSPheCut(GetEnvValue(env, prefix, "SPheCut", fSPheCut)); 505 rc = kTRUE; 506 } 507 508 // FIXME: GetEnvValue does not work with enums yet 509 /* 510 if (IsEnvDefined(env, prefix, "FitFunc", print)) 511 { 512 SetFitFunc((Int_t)GetEnvValue(env, prefix, "FitFunc", fFitFunc)); 513 rc = kTRUE; 514 } 515 */ 516 return rc; 517 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindCam.h
r4970 r4986 2 2 #define MARS_MHCalibrationChargeBlindCam 3 3 4 #ifndef MARS_MH 5 #include "MH.h" 6 #endif 7 #ifndef MARS_MHCalibrationChargeBlindPix 8 #include "MHCalibrationChargeBlindPix.h" 4 #ifndef MARS_MHCalibrationCam 5 #include "MHCalibrationCam.h" 9 6 #endif 10 7 11 class TObjArray; 12 class MRawRunHeader; 13 class MExtractedSignalBlindPixel; 14 class MCalibrationChargeBlindCam; 8 class MRawEvtData; 9 class MCalibrationBlindPix; 15 10 class MHCalibrationChargeBlindPix; 16 class MHCalibrationChargeBlindCam : public MH 11 class MHCalibrationChargeBlindCam : public MHCalibrationCam 17 12 { 18 13 private: 19 14 20 MExtractedSignalBlindPixel *fSignal; //! Extracted Signal class 21 MCalibrationChargeBlindCam *fCam; //! Calibration Cam with the results 22 MRawRunHeader *fRunHeader; //! Run Header 15 static const Int_t fgNbins; //! Default for fNBins new style blind pixel (now set to: 128 ) 16 static const Axis_t fgFirst; //! Default for fFirst new style blind pixel (now set to: - 0.5 ) 17 static const Axis_t fgLast; //! Default for fLast new style blind pixel (now set to: 511.5 ) 18 19 static const Axis_t fgSPheCut; //! Default for fSinglePheCut new style blind pixel (now set to: 20) 23 20 24 TObjArray *fBlindPixelsArray; // Array of calibration pixels, one per pixel 21 static const TString gsHistName; //! Default Histogram names 22 static const TString gsHistTitle; //! Default Histogram titles 23 static const TString gsHistXTitle; //! Default Histogram x-axis titles 24 static const TString gsHistYTitle; //! Default Histogram y-axis titles 25 26 Axis_t fSPheCut; // Signal value upon which event considered as single-phe 27 28 MRawEvtData *fRawEvt; //! Raw event data 25 29 26 MHCalibrationChargeBlindPix::FitFunc_t fFitFunc; 30 public: 31 32 enum FitFunc_t { kEPoisson4, kEPoisson5, 33 kEPoisson6, kEPoisson7, 34 kEPolya, kEMichele }; // Possible fit functions types (see MHCalibrationChargeBlindPix) 35 36 static const FitFunc_t fgFitFunc = kEPoisson4; //! Default for fFitFunc 37 38 private: 39 40 FitFunc_t fFitFunc; // The actual fit function type 41 42 Bool_t SetupHists (const MParList *pList ); 43 Bool_t ReInitHists ( MParList *pList ); 44 Bool_t FillHists (const MParContainer *par, const Stat_t w=1 ); 45 Bool_t FinalizeHists(); 46 47 void FitBlindPixel( MHCalibrationChargeBlindPix &hist, MCalibrationBlindPix &pix); 48 49 Int_t ReadEnv ( const TEnv &env, TString prefix, Bool_t print); 27 50 28 51 public: 29 52 30 53 MHCalibrationChargeBlindCam(const char *name=NULL, const char *title=NULL); 31 ~MHCalibrationChargeBlindCam();32 33 Bool_t SetupFill( const MParList *pList);34 Bool_t ReInit ( MParList *pList);35 Bool_t Fill ( const MParContainer *par, const Stat_t w=1);36 Bool_t Finalize ( );37 54 38 55 // Clone … … 40 57 41 58 // Draw 42 void Draw(Option_t *opt=""); 43 44 const Int_t GetSize() const { return fBlindPixelsArray->GetSize(); } 45 46 MHCalibrationChargeBlindPix &operator[] (UInt_t i); 47 const MHCalibrationChargeBlindPix &operator[] (UInt_t i) const; 48 49 void SetFitFunc(const MHCalibrationChargeBlindPix::FitFunc_t func) { fFitFunc = func; } 59 void Draw(Option_t *opt=""); 60 void SetFitFunc( const FitFunc_t func=fgFitFunc) { fFitFunc = func; } 61 void SetSPheCut( const Axis_t a=fgSPheCut ) { fSPheCut = a; } 50 62 51 63 ClassDef(MHCalibrationChargeBlindCam, 1) // Histogram class for Blind Pixel Calibration -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.cc
r4963 r4986 32 32 // Performs the Single Photo-electron fit to extract the Poisson mean and its errors. 33 33 // 34 // Different fits can be chosen with the function ChangeFitFunc().34 // Different fits can be chosen with the function SetFitFunc(). 35 35 // 36 36 // The fit result is accepted under the condition that: … … 69 69 ////////////////////////////////////////////////////////////////////////////// 70 70 #include "MHCalibrationChargeBlindPix.h" 71 #include "M ExtractBlindPixel.h"71 #include "MHCalibrationChargeBlindCam.h" 72 72 73 73 #include <TStyle.h> … … 88 88 #include "MParList.h" 89 89 90 #include "MRawEvtData.h"91 90 #include "MRawEvtPixelIter.h" 92 93 #include "MExtractedSignalBlindPixel.h"94 #include "MCalibrationChargeBlindPix.h"95 91 96 92 ClassImp(MHCalibrationChargeBlindPix); … … 101 97 const Double_t MHCalibrationChargeBlindPix::gkElectronicAmpErr = 0.002; 102 98 const Float_t MHCalibrationChargeBlindPix::gkSignalInitializer = -9999.; 103 104 const Int_t MHCalibrationChargeBlindPix::fgChargeNbins = 128;105 const Axis_t MHCalibrationChargeBlindPix::fgChargeFirst = -0.5;106 const Axis_t MHCalibrationChargeBlindPix::fgChargeLast = 511.5;107 const Float_t MHCalibrationChargeBlindPix::fgSinglePheCut = 20.;108 99 const Float_t MHCalibrationChargeBlindPix::fgNumSinglePheLimit = 50.; 109 100 // -------------------------------------------------------------------------- … … 112 103 // 113 104 // Sets: 114 // - the default number for fNbins (fgChargeNbins)115 // - the default number for fFirst (fgChargeFirst)116 // - the default number for fLast (fgChargeLast)117 // - the default number for fSinglePheCut (fgSingePheCut)118 105 // - the default number for fNumSinglePheLimit (fgNumSinglePheLimit) 119 106 // - the default number of bins after stripping (30) 120 //121 // - the default name of the fHGausHist ("HCalibrationChargeBlindPix")122 // - the default title of the fHGausHist ("Distribution of Summed FADC slices Blind Pixel ")123 // - the default x-axis title for fHGausHist ("Sum FADC Slices")124 // - the default y-axis title for fHGausHist ("Nr. of events")125 107 // 126 108 // Initializes: … … 128 110 // - fASinglePheFADCSlices(0); 129 111 // - fAPedestalFADCSlices(0); 130 // - fPixId to 0131 112 // 132 113 // Calls: … … 134 115 // 135 116 MHCalibrationChargeBlindPix::MHCalibrationChargeBlindPix(const char *name, const char *title) 136 : fBlindPix(NULL), fSignal(NULL), fRawEvt(NULL), 137 fSinglePheFit(NULL), 117 : fSinglePheFit(NULL), 138 118 fFitLegend(NULL), 139 119 fHSinglePheFADCSlices(NULL), fHPedestalFADCSlices(NULL) … … 143 123 fTitle = title ? title : "Statistics of the FADC sums of Blind Pixel calibration events"; 144 124 145 SetNbins( fgChargeNbins );146 SetFirst( fgChargeFirst );147 SetLast ( fgChargeLast );148 149 125 fASinglePheFADCSlices.ResizeTo(1); 150 126 fAPedestalFADCSlices.ResizeTo(1); 151 127 152 SetSinglePheCut();153 128 SetNumSinglePheLimit(); 154 129 SetProbLimit(0.001); 155 130 SetBinsAfterStripping(0); 156 157 fHGausHist.SetName("HCalibrationChargeBlindPix");158 fHGausHist.SetTitle("Distribution of Summed FADC slices Blind Pixel");159 fHGausHist.SetXTitle("Signal Amplitude");160 fHGausHist.SetYTitle("Nr. of events");161 162 fPixId = 0;163 131 164 132 Clear(); … … 224 192 fLambdaCheckErr = gkSignalInitializer; 225 193 226 // fFitFunc = kEMichele; 227 fFitFunc = kEPoisson5; 194 fFitFunc = MHCalibrationChargeBlindCam::kEPoisson5; 228 195 229 196 fNumSinglePhes = 0; … … 356 323 pix.fNDF = fNDF; 357 324 pix.fProb = fProb; 358 pix.fMeanPedestal = fMeanPedestal;359 pix.fSigmaPedestal = fSigmaPedestal;360 pix.fMeanPedestalErr = fMeanPedestalErr;361 pix.fSigmaPedestalErr = fSigmaPedestalErr;362 325 363 326 return &pix; … … 427 390 // -------------------------------------------------------------------------- 428 391 // 429 // Gets the pointers to: 430 // - MRawEvtData 431 // - MExtractedSignalBlindPixel 392 // Normalizes fASinglePheFADCSlices and fAPedestalFADCSlices 432 393 // 433 Bool_t MHCalibrationChargeBlindPix::SetupFill(const MParList *pList) 434 { 435 436 fRawEvt = (MRawEvtData*)pList->FindObject("MRawEvtData"); 437 if (!fRawEvt) 438 { 439 *fLog << err << "MRawEvtData not found... aborting." << endl; 440 return kFALSE; 441 } 442 443 fSignal = (MExtractedSignalBlindPixel*)pList->FindObject("MExtractedSignalBlindPixel"); 444 if (!fSignal) 445 { 446 *fLog << err << "MExtractedSignalBlindPixel not found... aborting " << endl; 447 return kFALSE; 448 } 449 450 return kTRUE; 451 } 452 453 // -------------------------------------------------------------------------- 454 // 455 // Gets or creates the pointers to: 456 // - MCalibrationChargeBlindPix 457 // 458 // Calls: 459 // - MHGausHist::InitBins() 460 // 461 Bool_t MHCalibrationChargeBlindPix::ReInit(MParList *pList) 462 { 463 464 fBlindPix = (MCalibrationChargeBlindPix*)pList->FindCreateObj("MCalibrationChargeBlindPix"); 465 if (!fBlindPix) 466 return kFALSE; 467 468 const Int_t samples = fSignal->GetNumFADCSamples(); 469 const Int_t integ = fSignal->IsExtractionType( MExtractBlindPixel::kIntegral ); 470 471 // 472 // Modify the histogram size in case, integrals have been used 473 // 474 if ( fLast < samples*integ*fgChargeLast ) 475 { 476 SetLast ( samples * (fgChargeLast+0.5) - 0.5 ); 477 SetSinglePheCut( samples * fgSinglePheCut ); 478 } 479 480 MHCalibrationPix::InitBins(); 481 482 return kTRUE; 483 } 484 485 // -------------------------------------------------------------------------- 486 // 487 // Retrieves from MExtractedSignalBlindPixel: 488 // - number of FADC samples 489 // - extracted signal 490 // - blind Pixel ID 491 // 492 // Resizes (if necessary): 493 // - fASinglePheFADCSlices to sum of HiGain and LoGain samples 494 // - fAPedestalFADCSlices to sum of HiGain and LoGain samples 495 // 496 // Fills the following histograms: 497 // - MHGausEvents::FillHistAndArray(signal) 498 // 499 // Creates MRawEvtPixelIter, jumps to blind pixel ID, 500 // fills the vectors fASinglePheFADCSlices and fAPedestalFADCSlices 501 // with the full FADC slices, depending on the size of the signal w.r.t. fSinglePheCut 502 // 503 Bool_t MHCalibrationChargeBlindPix::Fill(const MParContainer *par, const Stat_t w) 504 { 505 506 const Int_t samples = (Int_t)fRawEvt->GetNumHiGainSamples() 507 +(Int_t)fRawEvt->GetNumLoGainSamples(); 508 509 if (!fASinglePheFADCSlices.IsValid()) 510 { 511 fASinglePheFADCSlices.ResizeTo(samples); 512 fAPedestalFADCSlices.ResizeTo(samples); 513 } 514 515 if (fASinglePheFADCSlices.GetNrows() != samples) 516 { 517 fASinglePheFADCSlices.ResizeTo(samples); 518 fAPedestalFADCSlices.ResizeTo(samples); 519 } 520 521 Float_t slices = (Float_t)fSignal->GetNumFADCSamples(); 522 523 if (slices == 0.) 524 { 525 *fLog << err 526 << "Number of used signal slices in MExtractedSignalBlindPix " 527 << "is zero ... abort." 528 << endl; 529 return kFALSE; 530 } 531 532 // 533 // Signal extraction and histogram filling 534 // 535 const Float_t signal = fSignal->GetExtractedSignal(fPixId); 536 537 if (signal > -0.5) 538 FillHist(signal); 539 else 540 return kTRUE; 541 542 // 543 // In order to study the single-phe posistion, we extract the slices 544 // 545 const Int_t blindpixIdx = fSignal->GetBlindPixelIdx(fPixId); 546 547 MRawEvtPixelIter pixel(fRawEvt); 548 pixel.Jump(blindpixIdx); 549 550 if (signal > fSinglePheCut) 551 FillSinglePheFADCSlices(pixel); 552 else 553 FillPedestalFADCSlices(pixel); 554 555 return kTRUE; 556 } 557 558 // -------------------------------------------------------------------------- 559 // 560 // Returns kFALSE, if empty 561 // 562 // - Creates the fourier spectrum and sets bit MHGausEvents::IsFourierSpectrumOK() 563 // - Retrieves the pedestals from MExtractedSignalBlindPixel 564 // - Normalizes fASinglePheFADCSlices and fAPedestalFADCSlices 565 // - Executes FitPedestal() 566 // - Executes FitSinglePhe() 567 // - Retrieves fit results and stores them in MCalibrationChargeBlindPix 568 // 569 Bool_t MHCalibrationChargeBlindPix::Finalize() 570 { 571 572 if (IsEmpty()) 573 { 574 *fLog << err << GetDescriptor() << " ID: " << fPixId 575 << " My histogram has not been filled !! " << endl; 576 return kFALSE; 577 } 578 579 fMeanPedestal = fSignal->GetPed(); 580 fMeanPedestalErr = fSignal->GetPedErr(); 581 fSigmaPedestal = fSignal->GetPedRms(); 582 fSigmaPedestalErr = fSignal->GetPedRmsErr(); 583 394 void MHCalibrationChargeBlindPix::FinalizeSinglePheSpectrum() 395 { 396 584 397 if (fNumSinglePhes > 1) 585 398 for (Int_t i=0;i<fASinglePheFADCSlices.GetNrows();i++) … … 587 400 if (fNumPedestals > 1) 588 401 for (Int_t i=0;i<fAPedestalFADCSlices.GetNrows();i++) 589 fAPedestalFADCSlices[i] = fAPedestalFADCSlices[i]/fNumPedestals; 590 591 FitPedestal(); 592 593 fBlindPix->SetValid(kTRUE); 594 595 if (FitSinglePhe()) 596 fBlindPix->SetSinglePheFitOK(); 597 else 598 fBlindPix->SetValid(IsPedestalFitOK()); 599 600 fBlindPix->SetLambda ( fLambda ); 601 fBlindPix->SetLambdaVar ( fLambdaErr*fLambdaErr ); 602 fBlindPix->SetMu0 ( fMu0 ); 603 fBlindPix->SetMu0Err ( fMu0Err ); 604 fBlindPix->SetMu1 ( fMu1 ); 605 fBlindPix->SetMu1Err ( fMu1Err ); 606 fBlindPix->SetSigma0 ( fSigma0 ); 607 fBlindPix->SetSigma0Err ( fSigma0Err ); 608 fBlindPix->SetSigma1 ( fSigma1 ); 609 fBlindPix->SetSigma1Err ( fSigma1Err ); 610 fBlindPix->SetProb ( fProb ); 611 612 fBlindPix->SetLambdaCheck ( fLambdaCheck ); 613 fBlindPix->SetLambdaCheckErr ( fLambdaCheckErr ); 614 615 return kTRUE; 616 } 617 402 fAPedestalFADCSlices[i] = fAPedestalFADCSlices[i]/fNumPedestals; 403 } 618 404 619 405 // -------------------------------------------------------------------------- … … 733 519 switch (fFitFunc) 734 520 { 735 case kEPoisson4:521 case MHCalibrationChargeBlindCam::kEPoisson4: 736 522 fSinglePheFit = new TF1("SinglePheFit",&fPoissonKto4,rmin,rmax,6); 737 523 rmin += 6.5; 738 524 break; 739 case kEPoisson5:525 case MHCalibrationChargeBlindCam::kEPoisson5: 740 526 fSinglePheFit = new TF1("SinglePheFit",&fPoissonKto5,rmin,rmax,6); 741 527 rmin = 0.; 742 528 break; 743 case kEPoisson6:529 case MHCalibrationChargeBlindCam::kEPoisson6: 744 530 fSinglePheFit = new TF1("SinglePheFit",&fPoissonKto6,rmin,rmax,6); 745 531 break; 746 case kEPolya:532 case MHCalibrationChargeBlindCam::kEPolya: 747 533 fSinglePheFit = new TF1("SinglePheFit",&fPolya,rmin,rmax,8); 748 534 break; 749 case kEMichele:535 case MHCalibrationChargeBlindCam::kEMichele: 750 536 fSinglePheFit = new TF1("SinglePheFit",&fFitFuncMichele,rmin,rmax,9); 751 537 break; … … 786 572 { 787 573 788 case kEPoisson4:574 case MHCalibrationChargeBlindCam::kEPoisson4: 789 575 fSinglePheFit->SetParNames( "#lambda", "#mu_{0}", "#mu_{1}", "#sigma_{0}", "#sigma_{1}","Area"); 790 576 fSinglePheFit->SetParameters(lambda_guess,mu_0_guess,mu_1_guess,si_0_guess,si_1_guess,norm); … … 796 582 fSinglePheFit->SetParLimits(5,norm-(0.5*norm),norm+(0.7*norm)); 797 583 break; 798 case kEPoisson5:799 case kEPoisson6:584 case MHCalibrationChargeBlindCam::kEPoisson5: 585 case MHCalibrationChargeBlindCam::kEPoisson6: 800 586 fSinglePheFit->SetParNames("#lambda","#mu_{0}","#mu_{1}","#sigma_{0}","#sigma_{1}","Area"); 801 587 fSinglePheFit->SetParameters(lambda_guess,mu_0_guess,800.,si_0_guess,500.,norm); … … 808 594 break; 809 595 810 case kEPolya:596 case MHCalibrationChargeBlindCam::kEPolya: 811 597 fSinglePheFit->SetParameters(lambda_guess, excessPoisson_guess, 812 598 delta1_guess,delta2_guess, 813 599 electronicAmp_guess, 814 fSigmaPedestal,600 10., 815 601 norm, 816 fMeanPedestal);602 0.); 817 603 fSinglePheFit->SetParNames("#lambda","b_{tot}", 818 604 "#delta_{1}","#delta_{2}", … … 825 611 fSinglePheFit->SetParLimits(4,electronicAmp_guess-electronicAmp_limit, 826 612 electronicAmp_guess+electronicAmp_limit); 827 fSinglePheFit->SetParLimits(5, 828 fSigmaPedestal-3.*fSigmaPedestalErr, 829 fSigmaPedestal+3.*fSigmaPedestalErr); 613 fSinglePheFit->SetParLimits(5,0.,40.); 830 614 fSinglePheFit->SetParLimits(6,norm-0.1,norm+0.1); 831 fSinglePheFit->SetParLimits(7, 832 fMeanPedestal-3.*fMeanPedestalErr, 833 fMeanPedestal+3.*fMeanPedestalErr); 834 break; 835 case kEMichele: 615 fSinglePheFit->SetParLimits(7,-10.,10.); 616 break; 617 case MHCalibrationChargeBlindCam::kEMichele: 836 618 fSinglePheFit->SetParNames("#lambda_{cat}","#lambda_{dyn}", 837 619 "#mu_{0}","#mu_{1cat}","#mu_{1dyn}", … … 879 661 { 880 662 881 case kEPoisson4:882 case kEPoisson5:883 case kEPoisson6:884 case kEPoisson7:663 case MHCalibrationChargeBlindCam::kEPoisson4: 664 case MHCalibrationChargeBlindCam::kEPoisson5: 665 case MHCalibrationChargeBlindCam::kEPoisson6: 666 case MHCalibrationChargeBlindCam::kEPoisson7: 885 667 fLambda = fSinglePheFit->GetParameter(0); 886 668 fMu0 = fSinglePheFit->GetParameter(1); … … 895 677 fSigma1Err = fSinglePheFit->GetParError(4); 896 678 break; 897 case kEPolya:679 case MHCalibrationChargeBlindCam::kEPolya: 898 680 fLambda = fSinglePheFit->GetParameter(0); 899 681 fMu0 = fSinglePheFit->GetParameter(7); … … 907 689 fSigma0Err = fSinglePheFit->GetParError(5); 908 690 fSigma1Err = 0.; 909 case kEMichele:691 case MHCalibrationChargeBlindCam::kEMichele: 910 692 fLambda = fSinglePheFit->GetParameter(0); 911 693 fMu0 = fSinglePheFit->GetParameter(2); … … 1037 819 fFitLegend = new TPaveText(0.05,0.05,0.95,0.95); 1038 820 fFitLegend->SetLabel(Form("%s%s", "Results of the single PhE Fit (", 1039 (fFitFunc == kEPoisson4) ? "Poisson(k=4))" : 1040 (fFitFunc == kEPoisson5) ? "Poisson(k=5))" : 1041 (fFitFunc == kEPoisson6) ? "Poisson(k=6))" : 1042 (fFitFunc == kEPolya ) ? "Polya(k=4))" : 1043 (fFitFunc == kEMichele ) ? "Michele)" : " none )" )); 821 (fFitFunc == MHCalibrationChargeBlindCam::kEPoisson4) ? "Poisson(k=4))" : 822 (fFitFunc == MHCalibrationChargeBlindCam::kEPoisson5) ? "Poisson(k=5))" : 823 (fFitFunc == MHCalibrationChargeBlindCam::kEPoisson6) ? "Poisson(k=6))" : 824 (fFitFunc == MHCalibrationChargeBlindCam::kEPolya ) ? "Polya(k=4))" : 825 (fFitFunc == MHCalibrationChargeBlindCam::kEMichele ) ? "Michele)" 826 : " none )" )); 1044 827 fFitLegend->SetTextSize(0.05); 1045 828 } -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeBlindPix.h
r4963 r4986 7 7 #endif 8 8 9 #ifndef MARS_MHCalibrationChargeBlindCam 10 #include "MHCalibrationChargeBlindCam.h" 11 #endif 12 9 13 #ifndef ROOT_TF1 10 14 #include <TF1.h> … … 18 22 class TPaveText; 19 23 class TText; 20 class M RawEvtData;24 class MExtractedSignalBlindPixel; 21 25 class MRawEvtPixelIter; 22 class MCalibrationChargeBlindPix;23 class MExtractBlindPixel;24 class MExtractedSignalBlindPixel;25 26 26 27 class MHCalibrationChargeBlindPix : public MHCalibrationPix … … 28 29 private: 29 30 30 static const Int_t fgChargeNbins; //! Default for fNBins (now set to: 5300 )31 static const Axis_t fgChargeFirst; //! Default for fFirst (now set to: -100.5 )32 static const Axis_t fgChargeLast; //! Default for fLast (now set to: 5199.5 )33 static const Float_t fgSinglePheCut; //! Default for fSinglePheCut (now set to: 200 )34 31 static const Float_t fgNumSinglePheLimit; //! Default for fNumSinglePheLimit (now set to: 50) 35 32 static const Float_t gkSignalInitializer; //! Signal initializer (-9999.) … … 41 38 Float_t fNumSinglePheLimit; // Minimum number of single-phe events 42 39 43 MCalibrationChargeBlindPix *fBlindPix; //! Storage container results44 MExtractedSignalBlindPixel *fSignal; //! Storage container extracted signal45 MRawEvtData *fRawEvt; //! Storage container raw data46 47 40 TVector fASinglePheFADCSlices; // Averaged FADC slice entries supposed single-phe events 48 41 TVector fAPedestalFADCSlices; // Averaged FADC slice entries supposed pedestal events … … 68 61 Int_t fNDF; // Ndof of single-phe fit 69 62 Double_t fProb; // Probability of singleo-phe fit 70 Double_t fMeanPedestal; // Mean pedestal from pedestal run71 Double_t fSigmaPedestal; // Sigma pedestal from pedestal run72 Double_t fMeanPedestalErr; // Error of Mean pedestal from pedestal run73 Double_t fSigmaPedestalErr; // Error of Sigma pedestal from pedestal run74 63 75 64 Byte_t fFlags; // Bit-field for the flags 76 65 enum { kSinglePheFitOK, kPedestalFitOK }; // Possible bits to be set 77 66 67 MHCalibrationChargeBlindCam::FitFunc_t fFitFunc; 68 78 69 TPaveText *fFitLegend; //! Some legend to display the fit results 79 70 TH1F *fHSinglePheFADCSlices; //! A histogram created and deleted only in Draw() 80 71 TH1F *fHPedestalFADCSlices; //! A histogram created and deleted only in Draw() 81 72 82 // Fill histos83 void FillSinglePheFADCSlices(const MRawEvtPixelIter &iter);84 void FillPedestalFADCSlices( const MRawEvtPixelIter &iter);85 86 73 // Fit 87 74 Bool_t InitFit(); 88 75 void ExitFit(); 89 76 77 void DrawLegend(Option_t *opt=""); 78 90 79 public: 91 80 … … 98 87 // TObject *Clone(const char *) const; 99 88 100 Bool_t SetupFill(const MParList *pList);101 Bool_t ReInit ( MParList *pList);102 Bool_t Fill (const MParContainer *par, const Stat_t w=1);103 Bool_t Finalize();104 105 89 // Getters 106 90 const Double_t GetLambda () const { return fLambda; } … … 128 112 129 113 // Setters 130 void Set CalibrationChargeBlindPix ( MCalibrationChargeBlindPix *pix) { fBlindPix = pix; }131 void SetSinglePheCut ( const Float_t cut = fgSinglePheCut) { fSinglePheCut = cut; }114 void SetFitFunc(const MHCalibrationChargeBlindCam::FitFunc_t func) { fFitFunc = func; } 115 void SetSinglePheCut ( const Float_t cut = 0. ) { fSinglePheCut = cut; } 132 116 void SetNumSinglePheLimit ( const Float_t lim =fgNumSinglePheLimit ) { fNumSinglePheLimit = lim; } 133 134 void SetMeanPedestal ( const Float_t f ) { fMeanPedestal = f; }135 void SetMeanPedestalErr ( const Float_t f ) { fMeanPedestalErr = f; }136 void SetSigmaPedestal ( const Float_t f ) { fSigmaPedestal = f; }137 void SetSigmaPedestalErr ( const Float_t f ) { fSigmaPedestalErr = f; }138 117 139 118 void SetSinglePheFitOK ( const Bool_t b=kTRUE); 140 119 void SetPedestalFitOK ( const Bool_t b=kTRUE); 141 120 121 // Fill histos 122 void FillSinglePheFADCSlices(const MRawEvtPixelIter &iter); 123 void FillPedestalFADCSlices( const MRawEvtPixelIter &iter); 124 void FinalizeSinglePheSpectrum(); 125 142 126 // Draws 143 127 void Draw(Option_t *opt=""); 144 128 145 private:146 void DrawLegend(Option_t *opt="");147 148 129 // Fits 149 public:150 enum FitFunc_t { kEPoisson4, kEPoisson5, kEPoisson6, kEPoisson7, kEPolya, kEMichele }; // The possible fit functions151 152 private:153 FitFunc_t fFitFunc;154 155 public:156 130 Bool_t FitSinglePhe (Option_t *opt="RL0+Q"); 157 131 void FitPedestal (Option_t *opt="RL0+Q"); 158 132 159 void ChangeFitFunc(const FitFunc_t func) { fFitFunc = func; }160 161 133 // Simulation 162 134 Bool_t SimulateSinglePhe(const Double_t lambda, -
trunk/MagicSoft/Mars/mhcalib/Makefile
r4940 r4986 32 32 # mimage MHillas 33 33 34 SRCFILES = MHCalibrationChargeBlindPix.cc \ 35 MHCalibrationChargeBlindCam.cc \ 36 MHCalibrationChargePix.cc \ 37 MHCalibrationCam.cc \ 34 SRCFILES = MHCalibrationCam.cc \ 38 35 MHCalibrationPix.cc \ 39 36 MHCalibrationChargeCam.cc \ 37 MHCalibrationChargePix.cc \ 38 MHCalibrationChargeBlindCam.cc \ 39 MHCalibrationChargeBlindPix.cc \ 40 40 MHCalibrationChargePINDiode.cc \ 41 41 MHCalibrationRelTimeCam.cc \
Note:
See TracChangeset
for help on using the changeset viewer.