Changeset 2658 for trunk/MagicSoft/Mars
- Timestamp:
- 12/11/03 17:42:25 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCalibrationCalc.cc
r2642 r2658 252 252 { 253 253 254 fEvents++;255 256 254 Int_t cosmicpix = 0; 257 255 … … 273 271 while (pixel.Next()) 274 272 { 275 276 const Int_t pixid = pixel.GetPixelId(); 277 278 Int_t sum = pixel.GetSumHiGainSamples(); 279 280 MPedestalPix &ped = (*fPedestals)[pixid]; 281 282 Float_t pedes = ped.GetPedestal(); 273 274 const UInt_t pixid = pixel.GetPixelId(); 275 276 MExtractedSignalPix &sig = (*fSignals)[pixid]; 277 MPedestalPix &ped = (*fPedestals)[pixid]; 283 278 Float_t pedrms = ped.GetPedestalRms(); 279 Float_t sumhi = sig.GetExtractedSignalHiGain(); 284 280 285 if ( (float)sum < ((pedes*fNumHiGainSamples)+(2.*fNumHiGainSamples*pedrms)) )286 281 if (sumhi < 15.*pedrms ) // cut at 3.5 sigma 282 cosmicpix++; 287 283 } 288 284 289 290 if (cosmicpix > 50.) 285 if (cosmicpix > 100.) 291 286 { 292 287 fCosmics++; … … 295 290 296 291 pixel.Reset(); 292 fEvents++; 297 293 298 294 // … … 304 300 305 301 const UInt_t pixid = pixel.GetPixelId(); 306 302 307 303 MExtractedSignalPix &sig = (*fSignals)[pixid]; 308 304 309 305 Float_t sumhi = sig.GetExtractedSignalHiGain(); 310 306 Float_t sumlo = sig.GetExtractedSignalLoGain(); 311 307 Bool_t logain = sig.IsLoGainUsed(); 312 308 313 Byte_t mid; 314 315 if (logain) 316 mid = pixel.GetIdxMaxLoGainSample(); 317 else 318 mid = pixel.GetIdxMaxHiGainSample(); 309 Float_t mtime = sig.GetMeanArrivalTime(); 319 310 320 311 MCalibrationPix &pix = (*fCalibrations)[pixid]; … … 329 320 "Overflow or Underflow occurred filling Blind Pixel sum = " << sumhi << endl; 330 321 331 if (!blindpixel.FillTime((int)m id))322 if (!blindpixel.FillTime((int)mtime)) 332 323 *fLog << warn << 333 "Overflow or Underflow occurred filling Blind Pixel time = " << (int)mid<< endl;324 "Overflow or Underflow occurred filling Blind Pixel time = " << mtime << endl; 334 325 335 326 if (!blindpixel.FillRChargevsTime(sumhi,fEvents)) 336 327 *fLog << warn << 337 328 "Overflow or Underflow occurred filling Blind Pixel eventnr = " << fEvents << endl; 329 break; 338 330 339 331 case gkCalibrationPINDiodeId: … … 341 333 *fLog << warn << 342 334 "Overflow or Underflow occurred filling HCharge: means = " << sumhi << endl; 343 if (!pindiode.FillTime((int)m id))335 if (!pindiode.FillTime((int)mtime)) 344 336 *fLog << warn << 345 "Overflow or Underflow occurred filling HTime: time = " << (int)mid<< endl;337 "Overflow or Underflow occurred filling HTime: time = " << mtime << endl; 346 338 if (!pindiode.FillRChargevsTime(sumhi,fEvents)) 347 339 *fLog << warn << 348 340 "Overflow or Underflow occurred filling HChargevsN: eventnr = " << fEvents << endl; 341 break; 349 342 350 343 default: … … 359 352 << " signal = " << sumlo << endl; 360 353 361 if (!pix.FillTimeLoGain((int)m id))354 if (!pix.FillTimeLoGain((int)mtime)) 362 355 *fLog << warn << "Could not fill Lo Gain Time of pixel: " 363 << pixid << " time = " << (int)mid<< endl;356 << pixid << " time = " << mtime << endl; 364 357 365 //366 // Fill the reduced charge into the control histo for better visibility367 //368 358 if (!pix.FillRChargevsTimeLoGain(sumlo,fEvents)) 369 359 *fLog << warn << "Could not fill Lo Gain Charge vs. EvtNr of pixel: " … … 377 367 << " signal = " << sumhi << endl; 378 368 379 if (!pix.FillTimeHiGain((int)m id))369 if (!pix.FillTimeHiGain((int)mtime)) 380 370 *fLog << warn << "Could not fill Hi Gain Time of pixel: " 381 << pixid << " time = " << (int)mid<< endl;371 << pixid << " time = " << mtime << endl; 382 372 383 373 if (!pix.FillRChargevsTimeHiGain(sumhi,fEvents)) … … 385 375 << pixid << " signal = " << sumhi << " event Nr: " << fEvents << endl; 386 376 } 377 break; 387 378 388 379 } /* switch(pixid) */ … … 449 440 pix.SetPedestal(ped,prms); 450 441 442 pix.FitCharge(); 443 451 444 if (TESTBIT(fFlags,kUseTimeFits)) 452 445 pix.FitTime(); 453 446 454 pix.FitCharge();455 447 } 456 448 -
trunk/MagicSoft/Mars/manalysis/MCalibrationPix.cc
r2642 r2658 110 110 if (fHist->UseLoGain()) 111 111 { 112 112 113 SetHiGainSaturation(); 113 114 -
trunk/MagicSoft/Mars/manalysis/MExtractSignal.cc
r2646 r2658 163 163 164 164 Byte_t *ptr = pixel.GetHiGainSamples(); 165 Byte_t *max = ptr + pixel.GetIdxMaxHiGainSample(); 166 Byte_t *end = ptr + fRawEvt->GetNumHiGainSamples(); 167 Byte_t *first; 168 Byte_t *last; 165 Byte_t *first = ptr + 3; 166 Byte_t *last = ptr + 9; 169 167 170 168 UInt_t sumHi = 0; … … 178 176 const Float_t pedrms = ped.GetPedestalRms(); 179 177 180 181 if (max-3 < ptr) 182 { 183 first = ptr+3; 184 last = ptr+3+fAfter+fBefore; 185 } 186 else if (max+fAfter-1 > end) 187 { 188 first = end-fAfter-fBefore-1; 189 last = end-1; 190 } 191 else 192 { 193 first = max-fBefore; 194 last = max+fAfter; 195 } 178 Byte_t maxhi = 0; 179 Byte_t midhi = 0; 196 180 197 181 for (ptr=first;ptr<last;ptr++) 198 182 { 183 184 if (*ptr > maxhi) 185 { 186 maxhi = *ptr; 187 midhi = ptr-first; 188 } 189 199 190 sumHi += *ptr; 191 200 192 if (*ptr >= fSaturationLimit) 201 193 satHi++; 194 202 195 } 203 196 204 197 ptr = pixel.GetLoGainSamples(); 205 max = ptr+pixel.GetIdxMaxLoGainSample(); 206 end = ptr+fRawEvt->GetNumLoGainSamples(); 207 208 if (max-4 < ptr) 209 { 210 first = ptr+4; 211 last = ptr+4+fAfter+fBefore; 212 } 213 else if (max+fAfter > end) 214 { 215 first = end-fAfter-fBefore; 216 last = end; 217 } 218 else 219 { 220 first = max-fBefore; 221 last = max+fAfter; 222 } 223 198 first = ptr + 3; 199 last = ptr + 9; 200 Byte_t maxlo = 0; 201 Byte_t midlo = 0; 202 224 203 for (ptr=first;ptr<last;ptr++) 225 204 { 205 206 if (*ptr > maxlo) 207 { 208 maxlo = *ptr; 209 midlo = ptr-first; 210 } 211 226 212 sumLo += *ptr; 227 213 if (*ptr >= fSaturationLimit) … … 233 219 } 234 220 } 235 236 //237 // FIXME: This is preliminary, we will change to pedestals per slice!!!238 // Assume pedestals per time slice ==> multiply with number of slices239 //240 241 221 pix.SetExtractedSignal((float)sumHi - pedes*(float)fNumHiGainSamples, 242 222 pedrms*fSqrtHiGainSamples, … … 247 227 pix.SetGainSaturation((satHi),satHi,satLo); 248 228 229 if (satHi) 230 pix.SetArrivalTimes((float)(midlo+3),0.); 231 else 232 pix.SetArrivalTimes((float)(midhi+3),0.); 233 249 234 } /* while (pixel.Next()) */ 250 235 -
trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.h
r2641 r2658 33 33 Float_t GetExtractedSignalLoGainError() const { return fExtractedSignalLoGainError; } 34 34 35 Float_t GetMeanArrivalTime() const { return fMeanArrivalTime; }36 Float_t GetWidthArrivalTime() const { return fWidthArrivalTime; }35 Float_t GetMeanArrivalTime() const { return fMeanArrivalTime; } 36 Float_t GetWidthArrivalTime() const { return fWidthArrivalTime; } 37 37 38 38 void SetExtractedSignal(Float_t sig, Float_t sigerr) -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.cc
r2642 r2658 116 116 fHTimeHiGain->SetXTitle("Mean Arrival Times [Hi Gain FADC slice nr]"); 117 117 fHTimeHiGain->SetYTitle("Nr. of events"); 118 fHTimeHiGain->Sumw2();118 // fHTimeHiGain->Sumw2(); 119 119 120 120 fHTimeHiGain->SetDirectory(NULL); … … 124 124 fHTimeLoGain->SetXTitle("Mean Arrival Times [Lo Gain FADC slice nr]"); 125 125 fHTimeLoGain->SetYTitle("Nr. of events"); 126 fHTimeLoGain->Sumw2();126 // fHTimeLoGain->Sumw2(); 127 127 128 128 fHTimeLoGain->SetDirectory(NULL); … … 183 183 184 184 fPixId = id; 185 185 186 // 187 // Names Hi gain Histograms 188 // 186 189 TString nameQHiGain = TString(fHChargeHiGain->GetName()); 187 190 nameQHiGain += id; … … 196 199 fHChargevsNHiGain->SetName(nameQvsNHiGain.Data()); 197 200 201 // 202 // Title Hi gain Histograms 203 // 198 204 TString titleQHiGain = TString(fHChargeHiGain->GetTitle()); 199 205 titleQHiGain += id; … … 208 214 fHChargevsNHiGain->SetTitle(titleQvsNHiGain.Data()); 209 215 210 216 // 217 // Names Low Gain Histograms 218 // 211 219 TString nameQLoGain = TString(fHChargeLoGain->GetName()); 212 220 nameQLoGain += id; … … 221 229 fHChargevsNLoGain->SetName(nameQvsNLoGain.Data()); 222 230 231 // 232 // Titles Low Gain Histograms 233 // 223 234 TString titleQLoGain = TString(fHChargeLoGain->GetTitle()); 224 235 titleQLoGain += id; … … 374 385 fHiGainvsLoGain->GetXaxis()->Set(300,0.,1500.); 375 386 fHiGainvsLoGain->GetYaxis()->Set(400,0.,2000.); 387 fHiGainvsLoGain->GetXaxis()->SetTitle("Sum of Charges High Gain"); 388 fHiGainvsLoGain->GetYaxis()->SetTitle("Sum of Charges Low Gain"); 376 389 fHiGainvsLoGain->SetMarkerStyle(7); 377 390 … … 480 493 if (fTimeGausFit) 481 494 { 482 if (fTime Chisquare > 1.)495 if (fTimeProb > gkProbLimit) 483 496 fTimeGausFit->SetLineColor(kRed); 484 497 else … … 494 507 if (fTimeGausFit) 495 508 { 496 if (fTime Chisquare > 1.)509 if (fTimeProb > gkProbLimit) 497 510 fTimeGausFit->SetLineColor(kRed); 498 511 else … … 535 548 return kFALSE; 536 549 537 rmin = (rmin != 0.) ? rmin : 4.;550 rmin = (rmin != 0.) ? rmin : 3.; 538 551 rmax = (rmax != 0.) ? rmax : 9.; 539 552 … … 575 588 fTimeSigma = fTimeGausFit->GetParameter(2); 576 589 577 if (fTime Chisquare > 1.)590 if (fTimeProb < gkProbLimit) 578 591 { 579 592 *fLog << warn << "Fit of the Arrival times failed ! " << endl; … … 591 604 return kFALSE; 592 605 593 rmin = (rmin != 0.) ? rmin : 4.;606 rmin = (rmin != 0.) ? rmin : 3.; 594 607 rmax = (rmax != 0.) ? rmax : 9.; 595 608 … … 631 644 fTimeSigma = fTimeGausFit->GetParameter(2); 632 645 633 if (fTime Chisquare > 1.)646 if (fTimeProb < gkProbLimit) 634 647 { 635 648 *fLog << warn << "Fit of the Arrival times failed ! " << endl; … … 709 722 } 710 723 711 712 724 fFitOK = kTRUE; 713 725 -
trunk/MagicSoft/Mars/mhist/MHCalibrationPixel.h
r2642 r2658 36 36 37 37 Int_t fPixId; // Pixel Nr 38 TGraph *fHiGainvsLoGain; // Plot the HiGain vs. the LoGain38 TGraph *fHiGainvsLoGain; //! Plot the HiGain vs. the LoGain 39 39 Int_t fTotalEntries; // Number of entries 40 40
Note:
See TracChangeset
for help on using the changeset viewer.