Changeset 2679 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/15/03 19:01:14 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc
r2666 r2679 413 413 { 414 414 if (blindpixel.FitCharge()) 415 { 416 if (!fCalibrations->CalcNrPhotInnerPixel()) 417 *fLog << err << dbginf << "Could not calculate Number of photons from the blind pixel " << endl; 418 } 415 *fLog << err << dbginf << "Could not fit the blind pixel " << endl; 419 416 else 420 {421 417 *fLog << err << dbginf << "Could not fit the blind pixel " << endl; 422 }423 418 424 419 if (!blindpixel.FitTime()) … … 426 421 427 422 blindpixel.Draw(); 428 429 423 } 430 424 431 425 *fLog << GetDescriptor() << " Fitting the Normal Pixels" << endl; 432 426 … … 450 444 451 445 } 446 447 if (!fCalibrations->CalcNumPhotInsidePlexiglass()) 448 *fLog << err << dbginf << "Could not calculate the number of photons from the blind pixel " << endl; 452 449 453 450 fCalibrations->SetReadyToSave(); -
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.cc
r2673 r2679 25 25 26 26 ///////////////////////////////////////////////////////////////////////////// 27 // // 28 // MCalibrationCam // 29 // // 30 // Hold the Calibration information for all pixels in the camera // 31 // // 32 // The Classes MCalibrationPix's are stored in a TClonesArray // 33 // The Class MCalibrationBlindPix and the MCalibrationPINDiode // 34 // are stored in separate pointers // 35 // // 27 // 28 // MCalibrationCam 29 // 30 // Hold the whole Calibration results of the camera: 31 // 32 // 1) MCalibrationCam initializes a TClonesArray whose elements are 33 // pointers to MCalibrationPix Containers 34 // 2) It initializes a pointer to an MCalibrationBlindPix container 35 // 3) It initializes a pointer to an MCalibrationPINDiode container 36 // 37 // 4) 38 // 36 39 ///////////////////////////////////////////////////////////////////////////// 37 40 #include "MCalibrationCam.h" … … 56 59 // 57 60 // Default constructor. 58 // Creates a TClonesArray of MHCalibrationPix objects, initialized to 0 entries 59 // Creates an MCalibrationBlindPix and an MCalibrationPINDiode 61 // 62 // Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry 63 // Later, a call to MCalibrationCam::InitSize(Int_t size) has to be performed 64 // 65 // Creates an MCalibrationBlindPix container 66 // Creates an MCalibrationPINDiode container 60 67 // 61 68 MCalibrationCam::MCalibrationCam(const char *name, const char *title) 62 : fMeanNrPhotAvailable(kFALSE), 63 fMeanNrPhotInnerPix(-1.), 64 fMeanNrPhotInnerPixErr(-1.), 69 : fNumPhotInsidePlexiglassAvailable(kFALSE), 70 fMeanPhotInsidePlexiglass(-1.), 71 fMeanPhotErrInsidePlexiglass(-1.), 72 fNumPhotOutsidePlexiglassAvailable(kFALSE), 73 fMeanPhotOutsidePlexiglass(-1.), 74 fMeanPhotErrOutsidePlexiglass(-1.), 65 75 fOffsets(NULL), 66 76 fSlopes(NULL), … … 77 87 // -------------------------------------------------------------------------- 78 88 // 79 // Delete the TClonesArray o r MCalibrationPix's89 // Delete the TClonesArray of MCalibrationPix containers 80 90 // Delete the MCalibrationPINDiode and the MCalibrationBlindPix 91 // 92 // Delete the histograms if they exist 81 93 // 82 94 MCalibrationCam::~MCalibrationCam() … … 99 111 } 100 112 101 void MCalibrationCam::DrawHiLoFits() 102 { 103 104 if (!fOffsets) 105 fOffsets = new TH1D("pp","Offsets of the HiGain LoGain Fit",100,-600.,400.); 106 if (!fSlopes) 107 fSlopes = new TH1D("mm","Slopes of the HiGain LoGain Fit",100,-2.,2.); 108 if (!fOffvsSlope) 109 fOffvsSlope = new TH2D("aa","Slopes vs Offsets of the HiGain LoGain Fit",100,-600.,400.,100,-2.,2.); 110 111 TIter Next(fPixels); 112 MCalibrationPix *pix; 113 MHCalibrationPixel *hist; 114 while ((pix=(MCalibrationPix*)Next())) 115 { 116 hist = pix->GetHist(); 117 hist->FitHiGainvsLoGain(); 118 fOffsets->Fill(hist->GetOffset(),1.); 119 fSlopes->Fill(hist->GetSlope(),1.); 120 fOffvsSlope->Fill(hist->GetOffset(),hist->GetSlope(),1.); 121 } 122 123 TCanvas *c1 = new TCanvas(); 124 125 c1->Divide(1,3); 126 c1->cd(1); 127 fOffsets->Draw(); 128 gPad->Modified(); 129 gPad->Update(); 130 131 c1->cd(2); 132 fSlopes->Draw(); 133 gPad->Modified(); 134 gPad->Update(); 135 136 c1->cd(3); 137 fOffvsSlope->Draw("col1"); 138 gPad->Modified(); 139 gPad->Update(); 140 } 141 142 143 // -------------------------------------------------------------------------- 144 // 145 // This function return the size of the FILLED MCalibrationCam 146 // It is NOT the size of the array fPixels !!! 147 // Note that with every call to AddPixels, GetSize() might change 148 // 149 Int_t MCalibrationCam::GetSize() const 150 { 151 152 // 153 // Here we get the number of "filled" fPixels!! 154 // 155 return fPixels->GetEntriesFast(); 156 } 157 158 // -------------------------------------------------------------------------- 159 // 160 // Get i-th pixel (pixel number) 161 // 162 MCalibrationPix &MCalibrationCam::operator[](Int_t i) 163 { 164 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 165 } 166 167 // -------------------------------------------------------------------------- 168 // 169 // Get i-th pixel (pixel number) 170 // 171 MCalibrationPix &MCalibrationCam::operator[](Int_t i) const 172 { 173 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 174 } 175 176 // -------------------------------------------------------------------------- 177 // 178 // Return a pointer to the pixel with the requested idx. 179 // NULL if it doesn't exist. 180 // 181 MCalibrationPix *MCalibrationCam::GetCalibrationPix(Int_t idx) const 182 { 183 if (idx<0) 184 return NULL; 185 186 if (!CheckBounds(idx)) 187 return NULL; 188 189 return (MCalibrationPix*)fPixels->At(idx); 190 } 191 192 193 194 // -------------------------------------------------------------------------- 195 // 196 // Check if position i is inside bounds 197 // 198 Bool_t MCalibrationCam::CheckBounds(Int_t i) const 199 { 200 return i < fPixels->GetEntriesFast(); 201 } 202 203 Bool_t MCalibrationCam::IsPixelUsed(Int_t idx) const 204 { 205 if (!CheckBounds(idx)) 206 return kFALSE; 207 208 return kTRUE; 209 } 210 211 Bool_t MCalibrationCam::IsPixelFitted(Int_t idx) const 212 { 213 return ((*this)[idx].GetCharge() > 0. && (*this)[idx].GetErrCharge() > 0.); 214 } 215 216 217 218 void MCalibrationCam::Clear(Option_t *o) 219 { 220 fPixels->ForEach(TObject, Clear)(); 221 } 222 223 // 224 // Perform the fits of the charges 225 // If i=-1, then all pixels will be fitted 226 // Otherwise only the one with index i 227 // 228 // The number of succesful fits is returned 229 // 230 UShort_t MCalibrationCam::FitCharge(Int_t i) 231 { 232 233 UShort_t nsuccess = 0; 234 235 // invalidate i if it exceeds the number of entries in fPixels 236 if (i > fPixels->GetEntriesFast()) 237 { 238 *fLog << warn << "Tried to fit pixel out of allowed range " << endl; 239 return 0; 240 } 241 242 if (i == -1) // loop over all events 243 { 244 245 TIter Next(fPixels); 246 MCalibrationPix *pix; 247 while ((pix=(MCalibrationPix*)Next())) 248 { 249 if (pix->FitCharge()) 250 nsuccess++; 251 } 252 } 253 else // fit only the pixel with index i 254 { 255 if((*this)[i].FitCharge()) 256 nsuccess++; 257 } 258 259 return nsuccess; 260 261 } 262 263 // 264 // Perform the fits of the charges of all pixels 265 // plus the blind pixel and the PIN Diode 266 // 267 // The number of succesful fits is returned 268 // 269 UShort_t MCalibrationCam::FitAllCharge() 270 { 271 272 // FIXME: Once the blind pixel is fully working, 273 // there must be some penalty in case the 274 // fit does not succeed 275 // 276 UShort_t nsuccess = 0; 277 278 TIter Next(fPixels); 279 MCalibrationPix *pix; 280 while ((pix=(MCalibrationPix*)Next())) 281 { 282 if (pix->FitCharge()) 283 nsuccess++; 284 } 285 286 if (fBlindPixel->FitCharge()) 287 nsuccess++; 288 289 if (fPINDiode->FitCharge()) 290 nsuccess++; 291 292 return nsuccess; 293 294 } 295 296 297 298 // 299 // Perform the fits of the arrival times 300 // If i=-1, then all pixels will be fitted 301 // Otherwise only the one with index i 302 // 303 // The number of succesful fits is returned 304 // 305 UShort_t MCalibrationCam::FitTime(Int_t i) 306 { 307 308 UShort_t nsuccess = 0; 309 310 // invalidate i if it exceeds the number of entries in fPixels 311 if (i > fPixels->GetEntriesFast()) 312 { 313 *fLog << warn << "Tried to fit pixel out of allowed range " << endl; 314 return 0; 315 } 316 317 if (i == -1) // loop over all events 318 { 319 320 TIter Next(fPixels); 321 MCalibrationPix *pix; 322 while ((pix=(MCalibrationPix*)Next())) 323 { 324 if (pix->FitTime()) 325 nsuccess++; 326 } 327 } 328 else // fit only the pixel with index i 329 { 330 if((*this)[i].FitTime()) 331 nsuccess++; 332 } 333 334 return nsuccess; 335 336 } 337 338 339 // 340 // Perform the fits of the times of all pixels 341 // plus the blind pixel and the PIN Diode 342 // 343 // The number of succesful fits is returned 344 // 345 UShort_t MCalibrationCam::FitAllTime() 346 { 347 348 // FIXME: Once the blind pixel is fully working, 349 // there must be some penalty in case the 350 // fit does not succeed 351 // 352 UShort_t nsuccess = 0; 353 354 TIter Next(fPixels); 355 MCalibrationPix *pix; 356 while ((pix=(MCalibrationPix*)Next())) 357 { 358 if (pix->FitTime()) 359 nsuccess++; 360 } 361 362 if (fBlindPixel->FitTime()) 363 nsuccess++; 364 365 if (fPINDiode->FitTime()) 366 nsuccess++; 367 368 return nsuccess; 369 370 } 371 372 373 374 void MCalibrationCam::CutEdges() 375 { 376 377 fBlindPixel->GetHist()->CutAllEdges(); 378 379 TIter Next(fPixels); 380 MCalibrationPix *pix; 381 while ((pix=(MCalibrationPix*)Next())) 382 { 383 pix->GetHist()->CutAllEdges(); 384 } 385 386 return; 387 } 388 389 // --------------------------------------------------------------------- 113 // ------------------------------------------------------------------- 390 114 // 391 115 // This function simply allocates memory via the ROOT command: 392 116 // (TObject**) TStorage::ReAlloc(fCont, newSize * sizeof(TObject*), 393 // 117 // fSize * sizeof(TObject*)); 394 118 // newSize corresponds to size in our case 395 // fSize is the old size (in most cases: 0)119 // fSize is the old size (in most cases: 1) 396 120 // 397 121 void MCalibrationCam::InitSize(Int_t size) … … 404 128 return; 405 129 406 //407 // It is important to use Expand and NOT ExpandCreate, because408 // we want to keep all pixel not used with a NULL pointer.409 //410 130 fPixels->ExpandCreate(size); 411 131 132 } 133 134 // -------------------------------------------------------------------------- 135 // 136 // This function returns the current size of the TClonesArray 137 // independently if the MCalibrationPix is filled with values or not. 138 // 139 // It is the size of the array fPixels. 140 // 141 Int_t MCalibrationCam::GetSize() const 142 { 143 return fPixels->GetEntriesFast(); 144 } 145 146 // -------------------------------------------------------------------------- 147 // 148 // Check if position i is inside the current bounds of the TClonesArray 149 // 150 Bool_t MCalibrationCam::CheckBounds(Int_t i) const 151 { 152 return i < fPixels->GetEntriesFast(); 153 } 154 155 156 // -------------------------------------------------------------------------- 157 // 158 // Get i-th pixel (pixel number) 159 // 160 MCalibrationPix &MCalibrationCam::operator[](Int_t i) 161 { 162 163 if (!CheckBounds(i)) 164 return *static_cast<MCalibrationPix*>(NULL); 165 166 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 167 } 168 169 // -------------------------------------------------------------------------- 170 // 171 // Get i-th pixel (pixel number) 172 // 173 MCalibrationPix &MCalibrationCam::operator[](Int_t i) const 174 { 175 return *static_cast<MCalibrationPix*>(fPixels->UncheckedAt(i)); 176 } 177 178 // -------------------------------------------------------------------------- 179 // 180 // Return a pointer to the pixel with the requested idx. 181 // NULL if it doesn't exist. 182 // 183 MCalibrationPix *MCalibrationCam::GetCalibrationPix(Int_t idx) const 184 { 185 if (idx<0) 186 return NULL; 187 188 if (!CheckBounds(idx)) 189 return NULL; 190 191 return (MCalibrationPix*)fPixels->At(idx); 192 } 193 194 195 196 197 Bool_t MCalibrationCam::IsPixelUsed(Int_t idx) const 198 { 199 if (!CheckBounds(idx)) 200 return kFALSE; 201 202 return kTRUE; 203 } 204 205 Bool_t MCalibrationCam::IsPixelFitted(Int_t idx) const 206 { 207 return ((*this)[idx].GetCharge() > 0. && (*this)[idx].GetErrCharge() > 0.); 208 } 209 210 211 212 void MCalibrationCam::Clear(Option_t *o) 213 { 214 fPixels->ForEach(TObject, Clear)(); 215 } 216 217 void MCalibrationCam::CutEdges() 218 { 219 220 fBlindPixel->GetHist()->CutAllEdges(); 221 222 TIter Next(fPixels); 223 MCalibrationPix *pix; 224 while ((pix=(MCalibrationPix*)Next())) 225 { 226 pix->GetHist()->CutAllEdges(); 227 } 228 229 return; 412 230 } 413 231 … … 514 332 case 13: 515 333 if (idx < 397) 516 val = (double)fMean NrPhotInnerPix;334 val = (double)fMeanPhotInsidePlexiglass; 517 335 else 518 val = (double)fMean NrPhotInnerPix*gkCalibrationOuterPixelArea;336 val = (double)fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea; 519 337 break; 520 338 case 14: 521 if ((fMean NrPhotInnerPix> 0. ) && ((*this)[idx].GetCharge() != -1.))339 if ((fMeanPhotInsidePlexiglass > 0. ) && ((*this)[idx].GetCharge() != -1.)) 522 340 { 523 341 if (idx < 397) 524 val = fMean NrPhotInnerPix/ (*this)[idx].GetCharge();342 val = fMeanPhotInsidePlexiglass / (*this)[idx].GetCharge(); 525 343 else 526 val = fMean NrPhotInnerPix*gkCalibrationOuterPixelArea / (*this)[idx].GetCharge();344 val = fMeanPhotInsidePlexiglass*gkCalibrationOutervsInnerPixelArea / (*this)[idx].GetCharge(); 527 345 } 528 346 else … … 544 362 } 545 363 546 Bool_t MCalibrationCam::CalcN rPhotInnerPixel()364 Bool_t MCalibrationCam::CalcNumPhotInsidePlexiglass() 547 365 { 548 366 … … 556 374 { 557 375 case kECGreen: 558 fMean NrPhotInnerPix = (mean / gkCalibrationBlindPixelQEGreen)// real photons376 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQEGreen) // real photons 559 377 *TMath::Power(10,gkCalibrationBlindPixelAttGreen) // correct for absorption 560 / gkCalibrationBlindPixelArea;// correct for area378 * gkCalibrationInnerPixelArea; // correct for area 561 379 break; 562 380 case kECBlue: 563 fMean NrPhotInnerPix= (mean / gkCalibrationBlindPixelQEBlue )381 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQEBlue ) 564 382 *TMath::Power(10,gkCalibrationBlindPixelAttBlue) 565 / gkCalibrationBlindPixelArea;383 * gkCalibrationInnerPixelArea; 566 384 break; 567 385 case kECUV: 568 fMean NrPhotInnerPix= (mean / gkCalibrationBlindPixelQEUV )386 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQEUV ) 569 387 *TMath::Power(10,gkCalibrationBlindPixelAttUV) 570 / gkCalibrationBlindPixelArea;388 * gkCalibrationInnerPixelArea; 571 389 break; 572 390 case kECCT1: 573 391 default: 574 fMean NrPhotInnerPix= (mean / gkCalibrationBlindPixelQECT1 )392 fMeanPhotInsidePlexiglass = (mean / gkCalibrationBlindPixelQECT1 ) 575 393 *TMath::Power(10,gkCalibrationBlindPixelAttCT1) 576 / gkCalibrationBlindPixelArea;577 break; 578 } 579 580 f MeanNrPhotAvailable = kTRUE;394 * gkCalibrationInnerPixelArea; 395 break; 396 } 397 398 fNumPhotInsidePlexiglassAvailable = kTRUE; 581 399 582 400 TIter Next(fPixels); … … 585 403 { 586 404 587 if((pix->GetCharge() > 0.) && (fMean NrPhotInnerPix> 0.))588 pix->SetConversionBlindPixelMethod(fMean NrPhotInnerPix/pix->GetCharge(), 0., 0.);405 if((pix->GetCharge() > 0.) && (fMeanPhotInsidePlexiglass > 0.)) 406 pix->SetConversionBlindPixelMethod(fMeanPhotInsidePlexiglass/pix->GetCharge(), 0., 0.); 589 407 } 590 408 return kTRUE; … … 592 410 593 411 412 Bool_t MCalibrationCam::CalcNumPhotOutsidePlexiglass() 413 { 414 415 if (!fPINDiode->IsFitOK()) 416 return kFALSE; 417 418 const Float_t mean = fPINDiode->GetMean(); 419 const Float_t merr = fPINDiode->GetMeanError(); 420 421 switch (fColor) 422 { 423 case kECGreen: 424 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQEGreen) // real photons 425 * gkCalibrationInnerPixelvsPINDiodeArea; // correct for area 426 break; 427 case kECBlue: 428 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQEBlue ) 429 * gkCalibrationInnerPixelvsPINDiodeArea; 430 break; 431 case kECUV: 432 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQEUV ) 433 * gkCalibrationInnerPixelvsPINDiodeArea; 434 break; 435 case kECCT1: 436 default: 437 fMeanPhotOutsidePlexiglass = (mean / gkCalibrationPINDiodeQECT1 ) 438 * gkCalibrationInnerPixelvsPINDiodeArea; 439 break; 440 } 441 442 fNumPhotOutsidePlexiglassAvailable = kTRUE; 443 444 TIter Next(fPixels); 445 MCalibrationPix *pix; 446 while ((pix=(MCalibrationPix*)Next())) 447 { 448 449 if((pix->GetCharge() > 0.) && (fMeanPhotInsidePlexiglass > 0.)) 450 pix->SetConversionPINDiodeMethod(fMeanPhotOutsidePlexiglass/pix->GetCharge(), 0., 0.); 451 } 452 return kTRUE; 453 } 454 455 456 594 457 Bool_t MCalibrationCam::GetConversionFactorBlindPixel(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma) 595 458 { … … 598 461 return kFALSE; 599 462 600 if (!f MeanNrPhotAvailable)601 if (!CalcN rPhotInnerPixel())463 if (!fNumPhotInsidePlexiglassAvailable) 464 if (!CalcNumPhotInsidePlexiglass()) 602 465 return kFALSE; 603 466 … … 666 529 667 530 } 531 532 533 void MCalibrationCam::DrawHiLoFits() 534 { 535 536 if (!fOffsets) 537 fOffsets = new TH1D("pp","Offsets of the HiGain LoGain Fit",100,-600.,400.); 538 if (!fSlopes) 539 fSlopes = new TH1D("mm","Slopes of the HiGain LoGain Fit",100,-2.,2.); 540 if (!fOffvsSlope) 541 fOffvsSlope = new TH2D("aa","Slopes vs Offsets of the HiGain LoGain Fit",100,-600.,400.,100,-2.,2.); 542 543 TIter Next(fPixels); 544 MCalibrationPix *pix; 545 MHCalibrationPixel *hist; 546 while ((pix=(MCalibrationPix*)Next())) 547 { 548 hist = pix->GetHist(); 549 hist->FitHiGainvsLoGain(); 550 fOffsets->Fill(hist->GetOffset(),1.); 551 fSlopes->Fill(hist->GetSlope(),1.); 552 fOffvsSlope->Fill(hist->GetOffset(),hist->GetSlope(),1.); 553 } 554 555 TCanvas *c1 = new TCanvas(); 556 557 c1->Divide(1,3); 558 c1->cd(1); 559 fOffsets->Draw(); 560 gPad->Modified(); 561 gPad->Update(); 562 563 c1->cd(2); 564 fSlopes->Draw(); 565 gPad->Modified(); 566 gPad->Update(); 567 568 c1->cd(3); 569 fOffvsSlope->Draw("col1"); 570 gPad->Modified(); 571 gPad->Update(); 572 } 573 -
trunk/MagicSoft/Mars/manalysis/MCalibrationCam.h
r2665 r2679 44 44 45 45 Int_t fNumPixels; 46 TClonesArray *fPixels; //! FIXME: Change TClonesArray away from a pointer?46 TClonesArray *fPixels; // Array of MCalibrationPix with fit results 47 47 48 MCalibrationBlindPix *fBlindPixel; //! containing blind pixel data with fitresults49 MCalibrationPINDiode *fPINDiode; //! containing PIN Diode datawith fit results48 MCalibrationBlindPix *fBlindPixel; // Pointer to the Blind Pixel with fit results 49 MCalibrationPINDiode *fPINDiode; // Pointer to the PIN Diode with fit results 50 50 51 Bool_t f MeanNrPhotAvailable;52 Float_t fMean NrPhotInnerPix; // The mean number of photons in an inner pixel53 Float_t fMean NrPhotInnerPixErr; // The uncertainty about the number of photons in an inner pixel51 Bool_t fNumPhotInsidePlexiglassAvailable; // TRUE: Blind Pixel could have been fitted well 52 Float_t fMeanPhotInsidePlexiglass; // The mean number of photons in an INNER PIXEL inside the plexiglass 53 Float_t fMeanPhotErrInsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL 54 54 55 TH1F* fHChargeAllPixels; 56 TH1F* fHChargeErrAllPixels; 57 TH1F* fHChargeSigmaAllPixels; 58 TH1F* fHChargeProbAllPixels; 55 Bool_t fNumPhotOutsidePlexiglassAvailable; // TRUE: PIN Diode could have been fitted well 56 Float_t fMeanPhotOutsidePlexiglass; // The mean number of photons in an INNER PIXEL outside the plexiglass 57 Float_t fMeanPhotErrOutsidePlexiglass; // The uncertainty about the number of photons in an INNER PIXEL 59 58 60 TH1F* fHTimeAllPixels; 61 TH1F* fHTimeSigmaAllPixels; 62 TH1F* fHTimeProbAllPixels; 59 TH1F* fHChargeAllPixels; //! 60 TH1F* fHChargeErrAllPixels; //! 61 TH1F* fHChargeSigmaAllPixels; //! 62 TH1F* fHChargeProbAllPixels; //! 63 63 64 TH1F* fHPedAllPixels; 65 TH1F* fHPedRMSAllPixels; 64 TH1F* fHTimeAllPixels; //! 65 TH1F* fHTimeSigmaAllPixels; //! 66 TH1F* fHTimeProbAllPixels; //! 66 67 67 TH1F* fHSigmaPerChargeAllPixels; 68 TH1F* fHPhEAllPixels; 68 TH1F* fHPedAllPixels; //! 69 TH1F* fHPedRMSAllPixels; //! 70 TH1F* fHSigmaPerChargeAllPixels; //! 71 TH1F* fHPhEAllPixels; //! 69 72 70 TH1F* fHConvPhEperFADCAllPixels; 71 TH1F* fHConvPhperFADCAllPixels; 73 TH1F* fHConvPhEperFADCAllPixels; //! 74 TH1F* fHConvPhperFADCAllPixels; //! 72 75 73 TH1D* fOffsets; 74 TH1D* fSlopes; 76 TH1D* fOffsets; //! 77 TH1D* fSlopes; //! 75 78 76 TH2D* fOffvsSlope; 79 TH2D* fOffvsSlope; //! 77 80 78 81 public: … … 102 105 MCalibrationPix &operator[](Int_t i) const; 103 106 104 UShort_t FitCharge(Int_t i=-1);105 UShort_t FitAllCharge();106 UShort_t FitTime(Int_t i=-1);107 UShort_t FitAllTime();108 109 107 Bool_t CheckBounds(Int_t i) const; 110 108 … … 113 111 void CutEdges(); 114 112 115 Bool_t CalcNrPhotInnerPixel();116 113 Bool_t GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type=0) const; 117 114 void DrawPixelContent(Int_t num) const; … … 127 124 Bool_t GetConversionFactorPINDiode(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma); 128 125 Bool_t GetConversionFactorCombined(Int_t ipx, Float_t &mean, Float_t &err, Float_t &sigma); 129 126 127 Bool_t CalcNumPhotInsidePlexiglass(); 128 Bool_t CalcNumPhotOutsidePlexiglass(); 129 130 130 void DrawHiLoFits(); 131 131 -
trunk/MagicSoft/Mars/manalysis/MCalibrationConfig.h
r2627 r2679 3 3 4 4 ///////////////////////////////////////////////////////////////////////////// 5 // // 6 // MCalibrationConfig // 7 // // 8 // Contains all configuration data of the Calibration // 9 // // 5 // 6 // MCalibrationConfig 7 // 8 // Contains all configuration data of the Calibration 9 // 10 // This file is only TEMPORARY. It values will go into the DATABASE 11 // 10 12 ///////////////////////////////////////////////////////////////////////////// 11 13 … … 37 39 const Float_t gkCalibrationBlindPixelAttCT1 = 1.95; 38 40 39 // Area of Blind Pixel w.r.t. Inner Pixel 40 const Float_t gkCalibrationBlindPixelArea = 0.25; 41 41 // 42 // Area of Inner Pixel w.r.t. Blind Pixel (which is 1 cm²) 43 // 44 // Hexagone of diagonal axis b = 3.5 cm 45 // straight axis a = 3.0 cm +- 2% 46 // Area = sqrt(3)*a²/2 = 7.79 cm² +- 4% = 7.8 +- 0.3 cm² 47 // 48 const Float_t gkCalibrationInnerPixelArea = 7.8; 49 const Float_t gkCalibrationInnerPixelAreaError = 0.3; 50 // 42 51 // Area of Outer Pixel w.r.t. Inner Pixel 43 const Float_t gkCalibrationOuterPixelArea = 4.00; 52 // 53 // Hexagone of diagonal axis b = 7.0 cm 54 // straight axis a = 6.0 cm +- 1% 55 // Area = sqrt(3)*a²/2 = 56 // 57 const Float_t gkCalibrationOutervsInnerPixelArea = 4.00; 58 const Float_t gkCalibrationOutervsInnerPixelAreaError = 0.00; 44 59 45 60 // ----- PIN DIODE ------------------------// … … 48 63 const UShort_t gkCalibrationPINDiodeId = 9999; 49 64 50 #endif /* MARS_MCalibrationBlindPixelConfig */ 65 // 66 // Area of Inner Pixel w.r.t. PIN Diode (which is 1 cm²) 67 // 68 // Hexagone of diagonal axis b = 3.5 cm 69 // straight axis a = 3.0 cm +- 2% 70 // Area = sqrt(3)*a²/2 = 7.79 cm² +- 4% = 7.8 +- 0.3 cm² 71 // 72 // Distance of PIN Diode to pulser D1: 1.5 +- 0.3 m 73 // Distance of Inner Pixel to pulser D2: 18.0 +- 0.5 m 74 // 75 // 76 // A(Inner Pixel) D1² 77 // conversion C = -------------- * ----- = 0.054 78 // A(PIN Diode) D2² 79 // 80 // Delta C / C = sqrt((Delta A(IP)/A(IP))² + 4 * ( (Delta D1/D1)² + (Delta D2/D2)² ) 81 // Delta C / C = 0.4 82 // 83 // C = 0.05 +- 0.02 84 // 85 const Float_t gkCalibrationInnerPixelvsPINDiodeArea = 0.05; 86 const Float_t gkCalibrationInnerPixelvsPINDiodeAreaError = 0.02; 87 88 // Average QE of the PIN Diode 89 const Float_t gkCalibrationPINDiodeQEGreen = -1.0; 90 const Float_t gkCalibrationPINDiodeQEBlue = -1.0; 91 const Float_t gkCalibrationPINDiodeQEUV = -1.0; 92 const Float_t gkCalibrationPINDiodeQECT1 = -1.0; 93 94 95 #endif /* MARS_MCalibrationConfig */ -
trunk/MagicSoft/Mars/manalysis/MCalibrationPINDiode.h
r2627 r2679 23 23 Float_t fErrTime; // The error of the mean arrival time after the fit 24 24 25 Float_t fRCharge; // The reduced mean charge after the fit26 Float_t fErrRCharge; // The error of the reduced mean charge after the fit27 28 25 public: 29 26 … … 36 33 void SetPedRms(Float_t pedrms) { fPedRms = pedrms; } 37 34 38 Bool_t IsValid() const { return fRCharge >=0 || fErrRCharge >= 0; } 35 Float_t GetMean() const { return fCharge; } 36 Float_t GetMeanError() const { return fErrCharge; } 37 38 Bool_t IsFitOK() const { return fCharge > 0 && fErrCharge > 0; } 39 39 40 40 Bool_t FillCharge(Float_t q) { return fHist->FillChargeHiGain(q); } -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2666 r2679 111 111 if (fPed && fPedRms) 112 112 fHist->SetLowerFitRange(1.5*fPedRms); 113 114 113 else 115 114 *fLog << warn << "Cannot set lower fit range to suppress cosmics: Pedestals not available" << endl; 116 117 115 118 116 if (fHist->UseLoGain()) -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.h
r2666 r2679 68 68 Float_t GetTimeChiSquare() const { return fTimeChiSquare; } 69 69 70 70 Float_t GetPed() const { return fPed; } 71 71 Float_t GetPedRms() const { return fPedRms; } 72 72 … … 127 127 void Draw(Option_t *opt="") { fHist->Draw(opt); } 128 128 129 130 129 ClassDef(MCalibrationPix, 1) // Storage Container for Calibration information of one pixel 131 130 };
Note:
See TracChangeset
for help on using the changeset viewer.