Changeset 8452
- Timestamp:
- 04/27/07 11:05:11 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r8451 r8452 19 19 -*-*- END OF LINE -*-*- 20 20 21 2007/04/27 Thomas Bretz 22 23 * mcalib/CalibLinkDef.h, mcalib/Makefile: 24 - removed obsolete MCalibrationIntensityCam 25 - removed obsolete MCalibrationIntensityChargeCam 26 27 * mcalib/MCalibCalcFromPast.[h,cc], mcalib/MCalibColorSteer.[h,cc], 28 mcalib/MCalibrateData.[h,cc], mhcalib/MHCalibrationChargeCam.[h,cc]: 29 - removed obsolete MCalibrationIntensityChargeCam and replaced by 30 MCalibrationChargeCam 31 32 * mcalib/MCalibrationChargeCalc.[h,cc]: 33 - removed obsolete MCalibrationIntensityChargeCam and replaced by 34 MCalibrationChargeCam 35 - to realize the difference between continous and single calibration 36 a new data member fContinousCalibration has been introduced 37 - consequently increased version number to 6 38 - do not set any exclusion in ReInit. it is nonsense not to fill 39 histograms which might give (or give not) correct result, 40 if the checks are all executed anyhow 41 42 * mcalib/MCalibrationRelTimeCalc.cc: 43 - do not set any exclusion in ReInit and if a pixel is unsuitable. 44 it is nonsense not to fill histograms which might give (or give 45 not) correct result, if the checks are all executed anyhow 46 - switched on the check for outliers 47 - outliers are now set unsuitable rather than unreliable 48 - some code simplification of the checks 49 50 * mcalib/MCalibrationChargeCam.cc: 51 - added a comment in the Clear member function 52 53 * mcalib/MCalibrationRelTimeCam.cc: 54 - some fixes of looong Form statements 55 - a small cosmetic change to GetPixelContent 56 - replaced the old check of the average time resolution by 57 a more accurate check using the median and deviation 58 59 * mhcalib/MHCalibrationRelTimeCam.[h,cc]: 60 - removed data member fReferencePixel and corresponding code 61 - use the median of pixels with area index 0 as reference instead of 62 an artificial pixel 63 64 * mhcalib/MHCalibrationCam.[h,cc]: 65 - finally removed all dependencies on the intensity cams and replaced 66 them by the direct cam 67 - if the lo-gain histogram is empty this is not a reason for an 68 uncalibrated pixel. At least in case of extracted properties (charge 69 and time) it is ok. 70 71 * mjobs/MJCalibration.cc: 72 - let MCalibrationRelTimeCalc run after MCalibrationChargeCalc 73 otherwise almost all unsuitable pixels have deviating 74 relative arrival resolution. 75 - added new level for deviating time reolution to plot of bad pixels 76 - changed reference lines for timr resolution plots 77 - removed data member fRefTimeOffsetInner, it is now 0 by definition 78 79 * mjobs/MJCalibrateSignal.cc: 80 - finally removed all dependencies of Intensity cams 81 - enable ContinousCalibration in MCalibrationChargeCalc instead 82 - switched on interleaved relative time calibration 83 84 * mbadpixels/MBadPixelsPix.h: 85 - adapted to new unsuitable flag kDeviatingTimeResolution 86 87 * callisto_mux.rc: 88 - removed the obsolete resource statement about the level 89 for the relative arrival time check. 90 91 * mjobs/calibrationref.rc, mjobs/calibrationref_Dec04.rc, 92 mjobs/calibrationref_Nov04.rc, resources/calibrationref_mux.rc: 93 - changed time resolution references accordingly 94 95 96 21 97 2007/04/26 Thomas Bretz 22 98 -
trunk/MagicSoft/Mars/NEWS
r8442 r8452 56 56 helps to get rid of artefacts in histograms. For the signal this 57 57 is not necessray because it is displayed in log-scale anyhow 58 59 - callisto: Fixed a problem with internal exclusions. Pixels which 60 have once been marked as unsuitable didn't get the necessary 61 histograms filled anymore to be rechecked with each interleaved 62 calibration. 63 64 - callisto: The relative arrival time resolution (the rms of the 65 relative arrival time offset) is now checked against its 66 median and the median deviation, instead of the average 67 plus an absolute offset. 68 69 - callisto: The relative arrival time offset is now calculated 70 w.r.t. its median not w.r.t. to an artificial reference pixel. 71 72 - callisto: The relative time calibration now marks pixels with 73 outlaying offset as unsuitable 74 75 - callisto: The interleaved relative time calibration has been switched 76 on. The advantage is that pixels which are marked as outliers 77 now can recover. An improvement over time is not expected, because 78 the relative time calibration seems stable. 58 79 59 80 - ganymed: If the dataset file containes "MonteCarlo: Yes" the "-mc" -
trunk/MagicSoft/Mars/callisto_mux.rc
r8439 r8452 282 282 #MJCalibration.MHCalibrationRelTimeCam.PulserFrequency: 500 283 283 284 MJCalibration.MCalibrationRelTimeCalc.RelTimeResolutionLimit: 0.2285 286 284 # ========================================================================== 287 285 ############################################################################# -
trunk/MagicSoft/Mars/mbadpixels/MBadPixelsPix.h
r7188 r8452 107 107 if (IsUncalibrated( kFluctuatingArrivalTimes)) return 8; 108 108 if (IsUncalibrated( kDeviatingNumPhes )) return 9; 109 if (IsUncalibrated( kLoGainBlackout )) return 10; 110 if (IsUncalibrated( kPreviouslyExcluded )) return 11; 111 return 12; 109 if (IsUncalibrated( kDeviatingTimeResolution)) return 10; 110 if (IsUncalibrated( kLoGainBlackout )) return 11; 111 if (IsUncalibrated( kPreviouslyExcluded )) return 12; 112 return 13; 112 113 } 113 114 … … 115 116 if (!IsUnreliable() || IsUnsuitable()) return 0; 116 117 if (IsUncalibrated( kChargeSigmaNotValid )) return 1; 117 if (IsUncalibrated( kDeviatingNumPhes )) return 2;118 118 if (IsUncalibrated( kHiGainNotFitted )) return 3; 119 119 if (IsUncalibrated( kLoGainNotFitted )) return 4; -
trunk/MagicSoft/Mars/mcalib/CalibLinkDef.h
r8429 r8452 16 16 #pragma link C++ class MCalibConstCam+; 17 17 #pragma link C++ class MCalibConstPix+; 18 19 #pragma link C++ class MCalibrationIntensityCam+;20 #pragma link C++ class MCalibrationIntensityChargeCam+;21 18 22 19 #pragma link C++ class MCalibrationCam+; -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.cc
r8428 r8452 30 30 // Input Containers: 31 31 // MParList 32 // MCalibrationIntensityChargeCam33 32 // 34 33 // Output Containers: 35 // MCalibrationIntensityChargeCam36 34 // 37 35 // Class version 2: … … 55 53 #include "MHCalibrationCam.h" 56 54 57 #include "MCalibrationIntensityChargeCam.h"58 59 55 #include "MBadPixelsCam.h" 60 56 61 57 #include "MCalibrationQECam.h" 62 58 #include "MCalibrationBlindCam.h" 59 #include "MCalibrationChargeCam.h" 63 60 #include "MCalibrationChargePix.h" 64 61 #include "MCalibrationChargeCalc.h" … … 83 80 MCalibCalcFromPast::MCalibCalcFromPast(const char *name, const char *title) 84 81 : fGeom(NULL), fParList(NULL), fRunHeader(NULL), 85 f IntensCharge(NULL), fBlindCam(NULL), fQECam(NULL), fBadPixels(NULL),82 fCharge(NULL), fBlindCam(NULL), fQECam(NULL), fBadPixels(NULL), 86 83 fChargeCalc(NULL), fRelTimeCalc(NULL), fCalibrate(NULL), 87 84 fNumCam(0), fNumEvents(0), fUpdateWithFFactorMethod(kTRUE), fUpdateNumPhes(kTRUE), … … 133 130 134 131 // 135 // Look for the M BadPixels IntensityCam132 // Look for the MCalibrationQECam 136 133 // 137 134 fQECam = (MCalibrationQECam*)pList->FindObject("MCalibrationQECam"); … … 143 140 144 141 // 145 // Look for the MFillH-class "MHCalibrationBlindCam". In case yes, initialize the 146 // corresponding IntensityCam 142 // Look for the MFillH-class "MHCalibrationBlindCam". 147 143 // 148 144 if (pList->FindObject(AddSerialNumber("MHCalibrationBlindCam"))) … … 156 152 157 153 // 158 // Look for the MFillH-class "MHCalibrationChargeCam". In case yes, initialize the 159 // corresponding IntensityCam 154 // Look for the MFillH-class "MHCalibrationChargeCam". 160 155 // 161 156 if (pList->FindObject(AddSerialNumber("MHCalibrationChargeCam"))) 162 157 { 163 158 164 fIntensCharge = (MCalibrationIntensityChargeCam*)pList->FindCreateObj("MCalibrationIntensityChargeCam"); 165 if (!fIntensCharge) 166 return kFALSE; 167 168 MCalibrationChargeCam *chargeinit = (MCalibrationChargeCam*)pList->FindObject("MCalibrationChargeCam"); 169 170 if (chargeinit) 171 fIntensCharge->SetCam(chargeinit,0); 172 else 173 *fLog << "Could not find initial MCalibrationChargeCam, cannot initialize intensity cam" << endl; 159 fCharge = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam"); 160 if (!fCharge) 161 return kFALSE; 174 162 175 163 if (!fChargeCalc) … … 194 182 195 183 // 196 // Look for the MFillH name "FillRelTimeCam". In case yes, initialize the 197 // corresponding IntensityCam 184 // Look for the MFillH name "FillRelTimeCam". 198 185 // 199 186 if (pList->FindObject(AddSerialNumber("MHCalibrationRelTimeCam"))) 200 187 { 201 // if (!pList->FindCreateObj("MCalibrationIntensityRelTimeCam"))202 // return kFALSE;203 204 188 if (!fRelTimeCalc) 205 189 fRelTimeCalc = (MCalibrationRelTimeCalc*)pList->FindObject(AddSerialNumber("MCalibrationRelTimeCalc")); … … 252 236 // 253 237 // - Initializes new containers in the 254 // - Intensity Cams, if the number of calibration events has reach fNumEventsDump.238 // - if the number of calibration events has reach fNumEventsDump. 255 239 // - Executes Finalize() of the MCalibration*Calc classes in that case. 256 240 // - Sets the latest MCalibrationChargeCam as update class into MCalibrateData 257 // - Initialize new MCalibration*Cams into the intensity cams.241 // - clean MCalibration*Cams 258 242 // 259 243 Int_t MCalibCalcFromPast::Process() … … 263 247 264 248 // Replace the old cams by (empty) new ones 265 // MCalibrationChargeCam: f IntensCharge249 // MCalibrationChargeCam: fCharge 266 250 // MCalibrationQECam: fIntensQE 267 251 // MCalibrationBlindCam: fIntensBlind … … 276 260 *fLog << inf << "Finalize calibration histograms:" << endl; 277 261 278 // This fills the IntensityCam which are newly created by262 // This fills the Cams which are cleared by 279 263 // ReInitialize with the result of the last calib cycle 280 264 Finalize("MHCalibrationChargeCam"); … … 299 283 if (fUpdateNumPhes) 300 284 { 301 MCalibrationChargePix &avpix =(MCalibrationChargePix&)f IntensCharge->GetCam()->GetAverageArea(0);285 MCalibrationChargePix &avpix =(MCalibrationChargePix&)fCharge->GetAverageArea(0); 302 286 fPhes [fNumPhes] = avpix.GetPheFFactorMethod(); 303 287 fPhesVar[fNumPhes] = avpix.GetPheFFactorMethodVar(); … … 329 313 330 314 if (fCalibrate) 331 return fCalibrate->UpdateConversionFactors(fUpdateWithFFactorMethod ? NULL 332 : (MCalibrationChargeCam*)fIntensCharge->GetCam() ); 315 return fCalibrate->UpdateConversionFactors(fUpdateWithFFactorMethod ? NULL : fCharge); 333 316 334 317 return kTRUE; … … 358 341 // -------------------------------------------------------------------------- 359 342 // 360 // Re-Intitializes new containers inside the Intensity Cams. 361 // From now on, a call to the IntensityCam functions returns pointers 362 // to the newly created Containers. 343 // Clear contents of cams 363 344 // 364 345 Bool_t MCalibCalcFromPast::ReInitialize() … … 391 372 // IF SIMPLE ENOUGH, REMOVE THE FUNCTION! 392 373 393 if (fIntensCharge) 394 { 395 *fLog << "MCalibrationChargeCam..."; 396 MCalibrationChargeCam *cold = (MCalibrationChargeCam*)fIntensCharge->GetCam(); 397 398 fIntensCharge->AddToList(Form("MCalibrationChargeCam%04d",fNumCam),*fGeom); 399 400 MCalibrationChargeCam *cnew = (MCalibrationChargeCam*)fIntensCharge->GetCam(); 401 cnew->SetRunNumber(runnumber); 402 403 if (cold) 404 { 405 cnew->MergeHiLoConversionFactors(*cold); 406 fIntensCharge->DeleteOldCam(cold); 407 } 374 if (fCharge) 375 { 376 *fLog << "MCalibrationChargeCam..."; 377 fCharge->Clear(); 378 fCharge->SetRunNumber(runnumber); 408 379 } 409 380 -
trunk/MagicSoft/Mars/mcalib/MCalibCalcFromPast.h
r8427 r8452 17 17 class MCalibrationRelTimeCalc; 18 18 class MCalibrateData; 19 class MCalibration IntensityChargeCam;19 class MCalibrationChargeCam; 20 20 class MCalibrationBlindCam; 21 21 class MCalibrationQECam; … … 32 32 MParList *fParList; //! Parameter List 33 33 MRawRunHeader *fRunHeader; //! Run header storing the run number 34 MCalibration IntensityChargeCam *fIntensCharge;//! Intensity Charge Cam (to be created)34 MCalibrationChargeCam *fCharge; //! Intensity Charge Cam (to be created) 35 35 36 36 MCalibrationBlindCam *fBlindCam; //! Blind Cam -
trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.cc
r8428 r8452 33 33 // MCalibrationPattern 34 34 // MParList 35 // MCalibrationIntensityChargeCam36 35 // 37 36 // Output Containers: 38 // MCalibrationIntensityChargeCam39 37 // 40 38 ////////////////////////////////////////////////////////////////////////////// … … 55 53 #include "MBadPixelsCam.h" 56 54 57 #include "MCalibrationIntensityChargeCam.h"58 59 55 #include "MCalibrationPattern.h" 60 56 #include "MCalibrationQECam.h" … … 76 72 // 77 73 MCalibColorSteer::MCalibColorSteer(const char *name, const char *title) 78 : fCalibPattern(NULL), fGeom(NULL), fParList(NULL), 79 fIntensCharge(NULL), 74 : fCalibPattern(NULL), fGeom(NULL), fParList(NULL), fCharge(NULL), 80 75 fBad(NULL), fChargeCalc(NULL), fRelTimeCalc(NULL), fHistCopy(kFALSE) 81 76 { … … 148 143 149 144 // 150 // Look for the MFillH name "FillChargeCam". In case yes, initialize the 151 // corresponding IntensityCam 145 // Look for the MFillH name "FillChargeCam". 152 146 // 153 147 if (pList->FindObject(AddSerialNumber("MHCalibrationChargeCam"))) … … 155 149 *fLog << inf << "Found MHCalibrationChargeCam ... " << flush; 156 150 157 f IntensCharge = (MCalibrationIntensityChargeCam*)pList->FindCreateObj("MCalibrationIntensityChargeCam");158 if (!f IntensCharge)151 fCharge = (MCalibrationChargeCam*)pList->FindCreateObj("MCalibrationChargeCam"); 152 if (!fCharge) 159 153 return kFALSE; 160 154 … … 172 166 173 167 // 174 // Look for the MFillH name "FillRelTimeCam". In case yes, initialize the 175 // corresponding IntensityCam 168 // Look for the MFillH name "FillRelTimeCam". 176 169 // 177 170 if (pList->FindObject(AddSerialNumber("MHCalibrationRelTimeCam"))) … … 199 192 // -------------------------------------------------------------------------- 200 193 // 201 // Reads the pattern from MCalibrationPattern and initializes new containers in the202 // Intensity Cams, if the pattern has changed. Executes Finalize of the194 // Reads the pattern from MCalibrationPattern and clear 195 // Cams, if the pattern has changed. Executes Finalize of the 203 196 // MCalibration*Calc classes in that case. 204 197 // … … 256 249 // -------------------------------------------------------------------------- 257 250 // 258 // Reads the pattern from MCalibrationPattern and initializes new containers in the259 // Intensity Cams, if the pattern has changed. Executes Finalize of the251 // Reads the pattern from MCalibrationPattern and clear 252 // Cams, if the pattern has changed. Executes Finalize of the 260 253 // MCalibration*Calc classes in that case. 261 254 // … … 290 283 291 284 hist->Finalize(); 292 CopyHist(name);285 //CopyHist(name); 293 286 hist->ResetHists(); 294 287 hist->SetColor( fCalibPattern->GetPulserColor()); … … 298 291 // -------------------------------------------------------------------------- 299 292 // 300 // Re-Intitializes new containers inside the Intensity Cams. 301 // From now on, a call to the IntensityCam functions returns pointers 302 // to the newly created Containers. 293 // Clear cams 303 294 // 304 295 Bool_t MCalibColorSteer::ReInitialize() … … 310 301 311 302 fBad->Clear(); // FIXME:::::: MERGE PreExcl!!!! 312 fQECam->Clear(); 303 304 if (fQECam) 305 fQECam->Clear(); 313 306 314 307 fBlindCam->Clear(); 315 308 fBlindCam->SetPulserColor(fCalibPattern->GetPulserColor()); 316 309 317 fRelTimeCam->Clear(); 318 fRelTimeCam->SetPulserColor(fCalibPattern->GetPulserColor()); 319 320 if (fIntensCharge) 321 { 322 MCalibrationChargeCam *oldcam = (MCalibrationChargeCam*)fIntensCharge->GetCam(); 323 fIntensCharge->AddToList(Form("MCalibrationChargeCam%s",namep.Data()),*fGeom); 324 MCalibrationChargeCam *cam = (MCalibrationChargeCam*)fIntensCharge->GetCam(); 325 cam->SetPulserColor(fCalibPattern->GetPulserColor()); 326 if (!cam->MergeHiLoConversionFactors(*oldcam)) 327 return kFALSE; 328 *fLog << inf << "New MCalibrationChargeCam with name: " << cam->GetName() << endl; 329 } 310 if (fRelTimeCam) 311 { 312 fRelTimeCam->Clear(); 313 fRelTimeCam->SetPulserColor(fCalibPattern->GetPulserColor()); 314 } 315 316 if (fCharge) 317 { 318 fCharge->Clear(); 319 fCharge->SetPulserColor(fCalibPattern->GetPulserColor()); 320 } 330 321 331 322 return kTRUE; … … 360 351 return result; 361 352 } 362 363 // --------------------------------------------------------------------------364 //365 // Copies the histogram classes into the intensity cams366 //367 void MCalibColorSteer::CopyHist(const char* name)368 {369 MHCalibrationCam *hcam = (MHCalibrationCam*)fParList->FindObject(name);370 TString n(name);371 if (n.Contains("ChargeCam"))372 {373 if (fIntensCharge)374 fIntensCharge->AddHist((MHCalibrationCam*)hcam->Clone());375 }376 // if (n.Contains("Blind"))377 // if (fIntensBlind)378 // fIntensBlind->AddHist((MHCalibrationCam*)hcam->Clone());379 380 // if (n.Contains("RelTime"))381 // if (fIntensRelTime)382 // fIntensRelTime->AddHist((MHCalibrationCam*)hcam->Clone());383 }384 385 // -------------------------------------------------------------------------- -
trunk/MagicSoft/Mars/mcalib/MCalibColorSteer.h
r8428 r8452 16 16 class MRawRunHeader; 17 17 class MCalibrationChargeCalc; 18 class MCalibrationChargeCam; 18 19 class MCalibrationRelTimeCalc; 19 class MCalibrationIntensityChargeCam;20 20 class MCalibrationRelTimeCam; 21 21 class MCalibrationBlindCam; … … 30 30 MGeomCam *fGeom; //! 31 31 MParList *fParList; //! 32 MCalibration IntensityChargeCam *fIntensCharge;//!32 MCalibrationChargeCam *fCharge; //! 33 33 MCalibrationRelTimeCam *fRelTimeCam; //! 34 34 MCalibrationBlindCam *fBlindCam; //! 35 35 MCalibrationQECam *fQECam; //! 36 36 MBadPixelsCam *fBad; //! 37 37 38 38 MCalibrationChargeCalc *fChargeCalc; //! 39 39 MCalibrationRelTimeCalc *fRelTimeCalc; //! 40 40 41 41 MCalibrationCam::PulserColor_t fColor; 42 42 Float_t fStrength; 43 43 44 44 Bool_t fHistCopy; // Decide whether MHCalibrationCams will get copied 45 45 46 46 Int_t PreProcess(MParList *pList); 47 47 Int_t Process(); 48 48 Int_t PostProcess(); 49 49 50 50 Bool_t ReInitialize(); 51 51 Bool_t Finalize(const char* name); 52 52 53 void CopyHist(const char* name);53 //void CopyHist(const char* name); 54 54 TString GetNamePattern(); 55 55 56 56 public: 57 57 MCalibColorSteer(const char *name=NULL, const char *title=NULL); -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.cc
r8425 r8452 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.6 7 2007-04-20 11:48:08tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrateData.cc,v 1.68 2007-04-27 10:04:46 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 114 114 #include "MPedestalPix.h" 115 115 116 #include "MCalibrationIntensityChargeCam.h"117 116 #include "MCalibrationChargeCam.h" 118 117 #include "MCalibrationChargePix.h" … … 155 154 // 156 155 MCalibrateData::MCalibrateData(CalibrationMode_t calmode,const char *name, const char *title) 157 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), fIntensCalib(NULL),156 : fGeomCam(NULL), fBadPixels(NULL), fCalibrations(NULL), 158 157 fQEs(NULL), fSignals(NULL), fCerPhotEvt(NULL), fCalibConstCam(NULL), 159 158 fPedestalFlag(kNo), fSignalType(kPhot), fRenormFactor(1.), fScaleFactor(1.) … … 238 237 if (fCalibrationMode>kNone) 239 238 { 240 fIntensCalib = (MCalibrationIntensityChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityChargeCam"));241 if (fIntensCalib)242 *fLog << inf << "Found MCalibrationIntensityChargeCam ... " << endl;243 244 239 fCalibrations = (MCalibrationChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); 245 240 if (!fCalibrations) … … 465 460 if (fCalibrationMode > kNone) 466 461 { 467 468 const MCalibrationCam *chargecam = fIntensCalib ? fIntensCalib->GetCam() : fCalibrations; 469 if (chargecam->GetSize() != npixels) 462 if (fCalibrations->GetSize() != npixels) 470 463 { 471 464 *fLog << "Size mismatch between MGeomCam and MCalibrationChargeCam... abort!" << endl; … … 478 471 return kFALSE; 479 472 } 480 481 473 } 474 482 475 fCalibConsts .Set(npixels); 483 476 fCalibFFactors.Set(npixels); … … 512 505 fHiLoConv.Reset(); 513 506 fHiLoConvErr.Reset(); 514 515 MCalibrationChargeCam *chargecam = NULL;516 if (updatecam)517 chargecam = fCalibrations;518 else519 chargecam = fIntensCalib ? (MCalibrationChargeCam*)fIntensCalib->GetCam() : fCalibrations;520 507 521 508 // … … 546 533 } 547 534 548 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[pixidx];549 const MCalibrationChargePix &avpix = (MCalibrationChargePix&) chargecam->GetAverageArea(0);535 const MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCalibrations)[pixidx]; 536 const MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCalibrations->GetAverageArea(0); 550 537 551 538 hiloconv = pix.GetConversionHiLo (); 552 539 hiloconverr= pix.GetConversionHiLoSigma(); 553 540 554 541 calibConv = pix.GetMeanConvFADC2Phe(); 555 542 calibConvVar = pix.GetMeanConvFADC2PheVar(); 556 543 calibFFactor = pix.GetMeanFFactorFADC2Phot(); 557 544 558 545 const MCalibrationQEPix &qe = (MCalibrationQEPix&)(*fQEs)[pixidx]; 559 546 -
trunk/MagicSoft/Mars/mcalib/MCalibrateData.h
r8425 r8452 20 20 class MCalibrationChargeCam; 21 21 class MCalibrationQECam; 22 23 class MCalibrationIntensityChargeCam;24 22 25 23 class MCalibrateData : public MTask … … 63 61 MBadPixelsCam *fBadPixels; //! Bad Pixels information 64 62 MCalibrationChargeCam *fCalibrations; //! Calibration constants 65 MCalibrationIntensityChargeCam *fIntensCalib; //! Calibration constants from interlaced calib.66 63 MCalibrationQECam *fQEs; //! Quantum efficiencies 67 64 MExtractedSignalCam *fSignals; //! Integrated charge in FADCs counts -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.cc
r8427 r8452 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.17 6 2007-04-20 13:21:11tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCalc.cc,v 1.177 2007-04-27 10:04:46 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 200 200 // - TString fOutputFile 201 201 // 202 // ClassVersion 6: 203 // - Bool_t fContinousCalibration 204 // 202 205 ////////////////////////////////////////////////////////////////////////////// 203 206 #include "MCalibrationChargeCalc.h" … … 220 223 #include "MPedestalCam.h" 221 224 #include "MPedestalPix.h" 222 223 #include "MCalibrationIntensityChargeCam.h"224 225 225 226 #include "MHCalibrationChargeCam.h" … … 362 363 363 364 fBadPixels = NULL; 364 fIntensCam = NULL;365 365 fCam = NULL; 366 366 fHCam = NULL; … … 440 440 // Search for the following input containers and abort if not existing: 441 441 // - MGeomCam 442 // - MCalibration IntensityChargeCam or MCalibrationChargeCam442 // - MCalibrationChargeCam 443 443 // - MCalibrationQECam 444 444 // - MBadPixelsCam … … 455 455 // It defines the PixId of every pixel in: 456 456 // 457 // - MCalibrationIntensityChargeCam458 457 // - MCalibrationChargeCam 459 458 // - MCalibrationQECam … … 495 494 496 495 // 497 // Intensity containers496 // MCalibrationChargeCam 498 497 // 499 fIntensCam = (MCalibrationIntensityChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationIntensityChargeCam")); 500 if (fIntensCam) 501 *fLog << inf << "Found MCalibrationIntensityChargeCam... " << flush; 502 else 503 { 504 fCam = (MCalibrationChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); 505 if (!fCam) 506 { 507 *fLog << err << "Cannot find MCalibrationChargeCam ... abort." << endl; 508 *fLog << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl; 509 return kFALSE; 510 } 511 } 512 498 fCam = (MCalibrationChargeCam*)pList->FindObject(AddSerialNumber("MCalibrationChargeCam")); 499 if (!fCam) 500 { 501 *fLog << err << "Cannot find MCalibrationChargeCam ... abort." << endl; 502 *fLog << "Maybe you forget to call an MFillH for the MHCalibrationChargeCam before..." << endl; 503 return kFALSE; 504 } 505 513 506 // 514 507 // Blind pixel calibration … … 550 543 // Further initialization 551 544 // 552 MCalibrationChargeCam *chargecam = fIntensCam 553 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam; 554 555 const UInt_t npixels = fGeom->GetNumPixels(); 556 557 for (UInt_t i=0; i<npixels; i++) 558 { 559 560 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i]; 561 562 if ((*fBadPixels)[i].IsBad()) 563 { 564 MCalibrationQEPix &pqe = (MCalibrationQEPix&)(*fQECam)[i]; 565 pix.SetExcluded(); 566 pqe.SetExcluded(); 567 continue; 568 } 569 570 if (IsDebug()) 571 pix.SetDebug(); 572 } 545 if (IsDebug()) 546 { 547 const UInt_t npixels = fGeom->GetNumPixels(); 548 for (UInt_t i=0; i<npixels; i++) 549 (*fCam)[i].SetDebug(); 550 } 573 551 574 552 fResultFlags.Set(fGeom->GetNumAreas()); … … 606 584 // Now retrieve the colour and check if not various colours have been used 607 585 // 608 if (!fIntensCam) 609 { 610 if (fPulserColor != MCalibrationCam::kNONE) 611 { 612 *fLog << warn << "Multiple colours used simultaneously!" << flush; 613 fHCam->Finalize(); 614 if (fHBlindCam) 615 fHBlindCam->Finalize(); 616 617 Finalize(); 618 619 fHCam->ResetHists(); 620 if (fHBlindCam) 621 fHBlindCam->ResetHists(); 622 623 *fLog << inf << "Starting next calibration... " << flush; 624 625 fHCam->SetColor(col); 626 if (fHBlindCam) 627 fHBlindCam->SetColor(col); 628 629 fCam->SetPulserColor(col); 630 if (fBlindCam) 631 fBlindCam->SetPulserColor(col); 632 } 633 } 586 if (!fContinousCalibration && fPulserColor != MCalibrationCam::kNONE) 587 { 588 *fLog << warn << "Multiple colours used simultaneously!" << flush; 589 fHCam->Finalize(); 590 if (fHBlindCam) 591 fHBlindCam->Finalize(); 592 593 Finalize(); 594 595 fHCam->ResetHists(); 596 if (fHBlindCam) 597 fHBlindCam->ResetHists(); 598 599 *fLog << inf << "Starting next calibration... " << flush; 600 601 fHCam->SetColor(col); 602 if (fHBlindCam) 603 fHBlindCam->SetColor(col); 604 605 fCam->SetPulserColor(col); 606 if (fBlindCam) 607 fBlindCam->SetPulserColor(col); 608 } 634 609 635 610 // … … 655 630 // Distribute new color to all containers 656 631 // 632 fCam->SetPulserColor(col); 633 if (fBlindCam) 634 fBlindCam->SetPulserColor(col); 635 657 636 fHCam->SetColor(col); 658 637 if (fHBlindCam) 659 638 fHBlindCam->SetColor(col); 660 661 MCalibrationChargeCam *chargecam = fIntensCam662 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam;663 664 chargecam->SetPulserColor(col);665 666 if (fBlindCam)667 fBlindCam->SetPulserColor(col);668 639 if (fPINDiode) 669 640 fPINDiode->SetColor(col); … … 724 695 // Call FinalizeUnsuitablePixels() 725 696 // 726 // Call MParContainer::SetReadyToSave() for f IntensCam, fCam, fQECam, fBadPixels and727 // 697 // Call MParContainer::SetReadyToSave() for fCam, fQECam, fBadPixels and 698 // fBlindCam and fPINDiode if they exist 728 699 // 729 700 // Print out some statistics … … 749 720 } 750 721 751 MCalibrationChargeCam *chargecam = fIntensCam ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam;752 753 722 // 754 723 // First loop over pixels, call FinalizePedestals and FinalizeCharges … … 759 728 { 760 729 761 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[pixid];730 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[pixid]; 762 731 // 763 732 // Check if the pixel has been excluded from the fits … … 786 755 if (nvalid == 0) 787 756 { 788 if (!fIntensCam)757 if (!fContinousCalibration) 789 758 { 790 759 *fLog << warn << GetDescriptor() << ": All pixels have non-valid calibration. " … … 801 770 802 771 const MPedestalPix &ped = fPedestals->GetAverageArea(aidx); 803 MCalibrationChargePix &pix = (MCalibrationChargePix&) chargecam->GetAverageArea(aidx);772 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageArea(aidx); 804 773 const MArrayI &arr = fHCam->GetAverageAreaNum(); 805 774 … … 814 783 pix.SetSigma (pix.GetSigma()/pix.GetFFactorFADC2Phe()); 815 784 816 FinalizeCharges(pix, chargecam->GetAverageBadArea(aidx),"area id");817 FinalizeArrivalTimes(pix, chargecam->GetAverageBadArea(aidx), "area id");785 FinalizeCharges(pix, fCam->GetAverageBadArea(aidx),"area id"); 786 FinalizeArrivalTimes(pix, fCam->GetAverageBadArea(aidx), "area id"); 818 787 } 819 788 … … 825 794 const MPedestalPix &ped = fPedestals->GetAverageSector(sector); 826 795 827 MCalibrationChargePix &pix = (MCalibrationChargePix&) chargecam->GetAverageSector(sector);796 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageSector(sector); 828 797 FinalizePedestals(ped,pix, 0); 829 798 } … … 840 809 // 841 810 if (FinalizeFFactorMethod()) 842 chargecam->SetFFactorMethodValid(kTRUE);811 fCam->SetFFactorMethodValid(kTRUE); 843 812 else 844 813 { 845 814 *fLog << warn << "Could not calculate the photons flux from the F-Factor method " << endl; 846 chargecam->SetFFactorMethodValid(kFALSE);847 if (!f IntensCam)848 815 fCam->SetFFactorMethodValid(kFALSE); 816 if (!fContinousCalibration) 817 return kFALSE; 849 818 } 850 819 … … 916 885 "Deviating F-Factor: "); 917 886 918 chargecam->SetReadyToSave();919 fQECam 887 fCam->SetReadyToSave(); 888 fQECam->SetReadyToSave(); 920 889 fBadPixels->SetReadyToSave(); 921 890 … … 1109 1078 if (!cal.CalcConvFFactor()) 1110 1079 { 1111 *fLog << warn << desc << "Could not calculate the Conv. FADC counts to Phes" << endl;1080 *fLog << warn << desc << "Could not calculate the conv. FADC cts to phes" << endl; 1112 1081 bad.SetUncalibrated(MBadPixelsPix::kDeviatingNumPhes); 1113 1082 return kFALSE; … … 1149 1118 // - MBadPixelsPix::kLoGainOverFlow 1150 1119 // 1151 // - Call MCalibrationPix::SetExcluded() for the bad pixels1152 //1153 1120 // Sets pixel to MBadPixelsPix::kUnreliableRun, if one of the following flags is set: 1154 1121 // - MBadPixelsPix::kChargeSigmaNotValid … … 1176 1143 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1177 1144 } 1178 1145 1179 1146 if (IsCheckDeviatingBehavior()) 1180 1147 { … … 1182 1149 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1183 1150 } 1184 1151 1185 1152 if (IsCheckHistOverflow()) 1186 1153 { 1187 1154 if (bad.IsUncalibrated( MBadPixelsPix::kHiGainOverFlow )) 1188 1155 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1189 1156 1190 1157 if (bad.IsUncalibrated( MBadPixelsPix::kLoGainOverFlow )) 1191 1158 bad.SetUnsuitable( MBadPixelsPix::kUnsuitableRun ); 1192 1159 } 1193 1160 1194 1161 if (IsCheckArrivalTimes()) 1195 1162 { … … 1235 1202 Bool_t MCalibrationChargeCalc::FinalizeFFactorMethod() 1236 1203 { 1237 MCalibrationChargeCam *chargecam = fIntensCam1238 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam;1239 1240 1204 const Int_t npixels = fGeom->GetNumPixels(); 1241 1205 const Int_t nareas = fGeom->GetNumAreas(); … … 1260 1224 for (Int_t i=0; i<npixels; i++) 1261 1225 { 1262 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];1226 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1263 1227 1264 1228 MBadPixelsPix &bad = (*fBadPixels)[i]; … … 1385 1349 { 1386 1350 1387 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];1351 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1388 1352 1389 1353 if (!pix.IsFFactorMethodValid()) … … 1440 1404 { 1441 1405 1442 MCalibrationChargePix &apix = (MCalibrationChargePix&) chargecam->GetAverageArea(aidx);1406 MCalibrationChargePix &apix = (MCalibrationChargePix&)fCam->GetAverageArea(aidx); 1443 1407 1444 1408 if (numareavalid[aidx] == 1) … … 1495 1459 } 1496 1460 1497 MCalibrationChargePix &spix = (MCalibrationChargePix&) chargecam->GetAverageSector(sector);1461 MCalibrationChargePix &spix = (MCalibrationChargePix&)fCam->GetAverageSector(sector); 1498 1462 1499 1463 if (sectorweights[sector] < 0. || sectorphes[sector] <= 0.) … … 1524 1488 { 1525 1489 1526 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];1490 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1527 1491 1528 1492 MBadPixelsPix &bad = (*fBadPixels)[i]; … … 1534 1498 { 1535 1499 const Int_t aidx = (*fGeom)[i].GetAidx(); 1536 MCalibrationChargePix &apix = (MCalibrationChargePix&) chargecam->GetAverageArea(aidx);1500 MCalibrationChargePix &apix = (MCalibrationChargePix&)fCam->GetAverageArea(aidx); 1537 1501 1538 1502 pix.SetPheFFactorMethod ( apix.GetPheFFactorMethod() ); … … 1726 1690 } 1727 1691 1728 MCalibrationChargeCam *chargecam = fIntensCam 1729 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam; 1730 1731 MCalibrationChargePix &avpix = (MCalibrationChargePix&)chargecam->GetAverageArea(0); 1692 MCalibrationChargePix &avpix = (MCalibrationChargePix&)fCam->GetAverageArea(0); 1732 1693 MCalibrationQEPix &qepix = (MCalibrationQEPix&) fQECam->GetAverageArea(0); 1733 1694 … … 1757 1718 // Set the results in the MCalibrationChargeCam 1758 1719 // 1759 chargecam->SetNumPhotonsFFactorMethod (avphotons);1720 fCam->SetNumPhotonsFFactorMethod (avphotons); 1760 1721 1761 1722 if (avphotrelvar > 0.) 1762 chargecam->SetNumPhotonsFFactorMethodErr(TMath::Sqrt( avphotrelvar * avphotons * avphotons));1723 fCam->SetNumPhotonsFFactorMethodErr(TMath::Sqrt( avphotrelvar * avphotons * avphotons)); 1763 1724 1764 1725 TArrayF lowlim (nareas); … … 1775 1736 { 1776 1737 1777 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];1778 MCalibrationQEPix &qpix = (MCalibrationQEPix&) (*fQECam) 1738 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1739 MCalibrationQEPix &qpix = (MCalibrationQEPix&) (*fQECam)[i]; 1779 1740 1780 1741 MBadPixelsPix &bad = (*fBadPixels)[i]; … … 1895 1856 { 1896 1857 1897 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i]; 1898 1858 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1899 1859 MBadPixelsPix &bad = (*fBadPixels)[i]; 1900 1860 … … 1920 1880 { 1921 1881 1922 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];1923 MCalibrationQEPix &qpix = (MCalibrationQEPix&) (*fQECam)[i];1882 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1883 MCalibrationQEPix &qpix = (MCalibrationQEPix&)(*fQECam)[i]; 1924 1884 1925 1885 if ((*fBadPixels)[i].IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) … … 1957 1917 return; 1958 1918 1959 MCalibrationChargeCam *chargecam = fIntensCam1960 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam;1961 1962 1963 1919 // 1964 1920 // Set the results in the MCalibrationChargeCam … … 1969 1925 const Float_t photons = fBlindCam->GetFluxInsidePlexiglass() * (*fGeom)[0].GetA() 1970 1926 / fQECam->GetPlexiglassQE(); 1971 chargecam->SetNumPhotonsBlindPixelMethod(photons);1927 fCam->SetNumPhotonsBlindPixelMethod(photons); 1972 1928 1973 1929 const Float_t photrelvar = fBlindCam->GetFluxInsidePlexiglassRelVar() … … 1975 1931 1976 1932 if (photrelvar > 0.) 1977 chargecam->SetNumPhotonsBlindPixelMethodErr(TMath::Sqrt( photrelvar * photons * photons));1933 fCam->SetNumPhotonsBlindPixelMethodErr(TMath::Sqrt( photrelvar * photons * photons)); 1978 1934 } 1979 1935 … … 2002 1958 } 2003 1959 2004 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i];2005 MGeomPix &geo = (*fGeom)[i];1960 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1961 MGeomPix &geo = (*fGeom)[i]; 2006 1962 2007 1963 const Float_t qe = pix.GetPheFFactorMethod() … … 2046 2002 const UInt_t npixels = fGeom->GetNumPixels(); 2047 2003 2048 MCalibrationChargeCam *chargecam = fIntensCam2049 ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam;2050 2051 2004 if (!fPINDiode) 2052 2005 return; … … 2080 2033 continue; 2081 2034 } 2082 2083 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*chargecam)[i];2084 MGeomPix &geo = (*fGeom)[i];2085 2086 const Float_t qe = pix.GetPheFFactorMethod() 2035 2036 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 2037 MGeomPix &geo = (*fGeom)[i]; 2038 2039 const Float_t qe = pix.GetPheFFactorMethod() 2087 2040 / fPINDiode->GetFluxOutsidePlexiglass() 2088 2041 / geo.GetA(); … … 2129 2082 // 2130 2083 // - Print out statistics about BadPixels of type UnsuitableType_t 2131 // - store numbers of bad pixels of each type in fCam or fIntensCam2084 // - store numbers of bad pixels of each type in fCam 2132 2085 // 2133 2086 Bool_t MCalibrationChargeCalc::FinalizeUnsuitablePixels() … … 2143 2096 TArrayI unsuit(nareas); 2144 2097 TArrayI unrel(nareas); 2145 2146 MCalibrationChargeCam *chargecam = fIntensCam ? (MCalibrationChargeCam*)fIntensCam->GetCam() : fCam;2147 2098 2148 2099 Int_t unsuitcnt=0; … … 2159 2110 unrelcnt += unrel[aidx]; 2160 2111 2161 chargecam->SetNumUnsuitable(unsuit[aidx], aidx);2162 chargecam->SetNumUnreliable(unrel[aidx], aidx);2112 fCam->SetNumUnsuitable(unsuit[aidx], aidx); 2113 fCam->SetNumUnreliable(unrel[aidx], aidx); 2163 2114 } 2164 2115 2165 2116 TArrayI counts(nareas); 2166 for (Int_t i=0; i< chargecam->GetSize(); i++)2117 for (Int_t i=0; i<fCam->GetSize(); i++) 2167 2118 { 2168 MCalibrationPix &pix = (*chargecam)[i];2119 const MCalibrationPix &pix = (*fCam)[i]; 2169 2120 if (pix.IsHiGainSaturation()) 2170 2121 { -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCalc.h
r8425 r8452 23 23 class MCalibrationChargePINDiode; 24 24 class MHCalibrationChargeBlindCam; 25 class MCalibrationIntensityBlindCam;26 25 class MCalibrationBlindCam; 27 26 class MCalibrationChargePix; 28 class MCalibrationIntensityChargeCam;29 27 class MCalibrationChargeCam; 30 28 class MHCalibrationChargeCam; … … 81 79 82 80 Int_t fNumProcessed; // Number of processed events (for Intensity calibration) 83 81 82 Bool_t fContinousCalibration; 83 84 84 // Pointers 85 85 // MBadPixelsIntensityCam *fIntensBad; //! Bad Pixels 86 86 MBadPixelsCam *fBadPixels; //! Bad Pixels 87 MCalibrationIntensityChargeCam *fIntensCam; //! Intensity Calibration results of all pixels88 87 MCalibrationChargeCam *fCam; //! Calibrated Charges results of all pixels 89 88 MHCalibrationChargeCam *fHCam; //! Charges histograms of all pixels 90 MCalibrationIntensityBlindCam *fIntensBlind; //! Intensity Calibration results of the Blind Pixels91 89 MCalibrationBlindCam *fBlindCam; //! Calibrated Charges of the Blind Pixels 92 90 MHCalibrationChargeBlindCam *fHBlindCam; //! Charges histograms of the Blind Pixels … … 198 196 void SetUseExternalNumPhes(const Bool_t b=kTRUE) { b ? SETBIT(fFlags, kUseExternalNumPhes) : CLRBIT(fFlags, kUseExternalNumPhes); } 199 197 198 void SetContinousCalibration(const Bool_t b=kTRUE) { fContinousCalibration = b; } 199 200 200 // pointers 201 201 void SetPedestals(MPedestalCam *cam) { fPedestals=cam; } … … 217 217 void SetPheErrUpperLimit ( const Float_t f=fgPheErrUpperLimit ) { fPheErrUpperLimit = f; } 218 218 void SetPulserColor ( const MCalibrationCam::PulserColor_t col ) { fPulserColor = col; } 219 220 ClassDef(MCalibrationChargeCalc, 5) // Task calculating Calibration Containers and Quantum Efficiencies219 220 ClassDef(MCalibrationChargeCalc, 6) // Task calculating Calibration Containers and Quantum Efficiencies 221 221 }; 222 222 -
trunk/MagicSoft/Mars/mcalib/MCalibrationChargeCam.cc
r8106 r8452 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCam.cc,v 1. 69 2006-10-17 17:18:40tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MCalibrationChargeCam.cc,v 1.70 2007-04-27 10:04:46 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 216 216 void MCalibrationChargeCam::Clear(Option_t *o) 217 217 { 218 218 // DO NOT RESET THE HI-/LO-GAIN CONSTANTS 219 219 SetFFactorMethodValid ( kFALSE ); 220 220 221 fNumPhotonsBlindPixelMethod = 0.; 222 fNumPhotonsFFactorMethod = 0.; 223 fNumPhotonsPINDiodeMethod = 0.; 224 fNumPhotonsBlindPixelMethodErr = 0.; 225 fNumPhotonsFFactorMethodErr = 0.; 226 fNumPhotonsPINDiodeMethodErr = 0.; 221 fNumPhotonsBlindPixelMethod = 0.; 222 fNumPhotonsFFactorMethod = 0.; 223 fNumPhotonsPINDiodeMethod = 0.; 224 fNumPhotonsBlindPixelMethodErr = 0.; 225 fNumPhotonsFFactorMethodErr = 0.; 226 fNumPhotonsPINDiodeMethodErr = 0.; 227 227 228 228 MCalibrationCam::Clear(); 229 230 return;231 229 } 232 230 -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCalc.cc
r8428 r8452 64 64 #include "MLogManip.h" 65 65 66 #include "MMath.h" 67 66 68 #include "MParList.h" 67 69 … … 81 83 using namespace std; 82 84 83 const Float_t MCalibrationRelTimeCalc::fgRelTimeResolutionLimit = 0.05;85 const Float_t MCalibrationRelTimeCalc::fgRelTimeResolutionLimit = 5.0; 84 86 85 87 // -------------------------------------------------------------------------- 86 88 // 87 // Default constructor. 89 // Default constructor. 88 90 // 89 91 // Sets all pointers to NULL … … 98 100 : fGeom(NULL), fFlags(0) 99 101 { 100 102 101 103 fName = name ? name : "MCalibrationRelTimeCalc"; 102 104 fTitle = title ? title : "Task to finalize the relative time calibration"; 103 105 104 106 SetCheckFitResults ( kFALSE ); 105 SetCheckDeviatingBehavior( k FALSE);107 SetCheckDeviatingBehavior( kTRUE ); 106 108 SetCheckHistOverflow ( kFALSE ); 107 109 SetCheckOscillations ( kFALSE ); … … 164 166 } 165 167 166 const UInt_t npixels = fGeom->GetNumPixels(); 167 for (UInt_t i=0; i<npixels; i++) 168 if (IsDebug()) 168 169 { 169 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCam)[i]; 170 171 if ((*fBadPixels)[i].IsBad()) 172 { 173 pix.SetExcluded(); 174 continue; 175 } 176 177 if (IsDebug()) 178 pix.SetDebug(); 170 const UInt_t npixels = fGeom->GetNumPixels(); 171 for (UInt_t i=0; i<npixels; i++) 172 (*fCam)[i].SetDebug(); 179 173 } 180 174 … … 233 227 234 228 PrintUncalibrated(MBadPixelsPix::kDeviatingTimeResolution, 235 Form("%s%2.1f%s","Time resol. less than ", fRelTimeResolutionLimit, " FADC sl. from Mean:"));229 Form("%s%2.1f%s","Time resol. less than ", fRelTimeResolutionLimit, " med-dev from median:")); 236 230 PrintUncalibrated(MBadPixelsPix::kRelTimeOscillating, 237 231 "Pixels with changing Rel. Times over time:"); … … 245 239 // ---------------------------------------------------------------------------------------------------- 246 240 // 247 // 248 // First loop: Calculate a mean and mean RMS of time resolution per area index 249 // Include only pixels which are not MBadPixelsPix::kUnsuitableRun or 250 // MBadPixelsPix::kUnreliableRun (see FinalizeBadPixels()) 251 // 252 // Second loop: Exclude those deviating by more than fRelTimeResolutionLimit FADC slices 253 // from the mean (obtained in first loop). Set 254 // MBadPixelsPix::kDeviatingTimeResolution if excluded. 255 // 241 // Check for outliers. They are marked with 242 // MBadPixelsPix::kDeviatingTimeResolution 243 // 256 244 void MCalibrationRelTimeCalc::FinalizeRelTimes() 257 245 { 258 259 const UInt_t npixels = fGeom->GetNumPixels(); 260 const UInt_t nareas = fGeom->GetNumAreas(); 261 262 TArrayF lowlim (nareas); 263 TArrayF upplim (nareas); 264 TArrayF areasum (nareas); 265 TArrayI numareavalid (nareas); 266 TArrayI useunreliable(nareas); 267 268 // 269 // Apero loop: Count number of unreliable pixels: 270 // 271 for (UInt_t i=0; i<npixels; i++) 272 { 273 MBadPixelsPix &bad = (*fBadPixels)[i]; 274 const Int_t aidx = (*fGeom)[i].GetAidx(); 275 276 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 277 continue; 278 279 if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 280 continue; 281 282 numareavalid[aidx] ++; 283 } 284 285 for (UInt_t aidx=0; aidx<nareas; aidx++) 286 if (numareavalid[aidx] < 100) 287 useunreliable[aidx] = 1; 288 289 numareavalid.Reset(); 290 // 291 // First loop: Get mean time resolution the RMS 292 // The loop is only to recognize later pixels with very deviating numbers 293 // 294 for (UInt_t i=0; i<npixels; i++) 295 { 296 297 const MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCam)[i]; 298 299 if (pix.IsExcluded()) 300 continue; 301 302 MBadPixelsPix &bad = (*fBadPixels)[i]; 303 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 304 continue; 305 306 const Int_t aidx = (*fGeom)[i].GetAidx(); 307 308 if (!useunreliable[aidx]) 309 if (bad.IsUnsuitable(MBadPixelsPix::kUnreliableRun)) 310 continue; 311 312 const Float_t res = pix.GetTimePrecision(); 313 314 areasum [aidx] += res; 315 // areasum2 [aidx] += res*res; 316 numareavalid[aidx] ++; 317 } 318 319 320 for (UInt_t aidx=0; aidx<nareas; aidx++) 321 { 322 if (numareavalid[aidx] < 20) 246 const Int_t npixels = fGeom->GetNumPixels(); 247 const Int_t nareas = fGeom->GetNumAreas(); 248 249 // Create an array capable of holding all pixels 250 TArrayF arr(npixels); 251 252 for (Int_t aidx=0; aidx<nareas; aidx++) 253 { 254 Int_t n = 0; 255 for (Int_t i=0; i<npixels; i++) 323 256 { 324 *fLog << warn << "Area " << setw(4) << aidx << ": Less than 20 pixels with valid time resolution found." << endl; 325 continue; 257 // Check for this aidx only 258 if ((*fGeom)[i].GetAidx()!=aidx) 259 continue; 260 261 // check if pixel may not contain a valid value 262 if ((*fBadPixels)[i].IsUnsuitable()) 263 continue; 264 265 // check if it was excluded for some reason 266 const MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCam)[i]; 267 if (pix.IsExcluded()) 268 continue; 269 270 // if TimePrecision is valid fill it into array 271 if (pix.GetTimePrecision()>0) 272 arr[n++] = pix.GetTimePrecision(); 326 273 } 327 274 328 // Calculate the rms out of sum2: 329 /* 330 areasum2[aidx] = (areasum2[aidx] - areasum[aidx]*areasum[aidx]/numareavalid[aidx]); 331 areasum2[aidx] /= (numareavalid[aidx]-1.); 332 */ 333 areasum [aidx] /= numareavalid[aidx]; 334 lowlim [aidx] = 0; 335 upplim [aidx] = areasum [aidx] + fRelTimeResolutionLimit; 336 337 } 338 *fLog << endl; 339 340 341 for (UInt_t i=0; i<npixels; i++) 342 { 343 344 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCam)[i]; 345 346 if (pix.IsExcluded()) 347 continue; 348 349 MBadPixelsPix &bad = (*fBadPixels)[i]; 350 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun)) 351 continue; 352 353 const Float_t res = pix.GetTimePrecision(); 354 const Int_t aidx = (*fGeom)[i].GetAidx(); 355 356 if ( res < lowlim[aidx] || res > upplim[aidx] ) 275 // Check the ratio of valid entries to the ratio of pixels 276 const Float_t ratio = 100*n/fGeom->GetNumPixWithAidx(aidx); 277 if (3*ratio<2) 278 *fLog << warn << "Area " << setw(4) << aidx << ": Only " << ratio << "% pixels with valid time resolution found." << endl; 279 280 // Calculate median and median deviation 281 Double_t med; 282 const Double_t dev = MMath::MedianDev(n, arr.GetArray(), med); 283 284 // Now find the outliers 285 for (Int_t i=0; i<npixels; i++) 357 286 { 358 *fLog << warn << "Pixel " << setw(4) << i << ": Deviating time resolution: " 359 << Form("%4.2f",res) << " out of range [" 360 << Form("%4.2f,%4.2f",lowlim[aidx],upplim[aidx]) << "]" << endl; 361 bad.SetUncalibrated( MBadPixelsPix::kDeviatingTimeResolution); 362 pix.SetExcluded(); 287 // Search only within this aidx 288 if ((*fGeom)[i].GetAidx()!=aidx) 289 continue; 290 291 // skip pixels already known to be unsuitable 292 if ((*fBadPixels)[i].IsUnsuitable()) 293 continue; 294 295 // check if a pixel has been excluded. This 296 const MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCam)[i]; 297 298 // Check if time precision is valid (might be invalid 299 // for example in cae of empty histograms) 300 const Float_t res = pix.GetTimePrecision(); 301 if (res<0) //FIXME!!! How does this happen? 302 { 303 *fLog << warn << "Pixel " << setw(4) << i << ": Time resolution not calculated." << endl; 304 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeviatingTimeResolution); 305 continue; 306 } 307 308 // Now compare to a lower and upper limit 309 const Float_t lolim = TMath::Max(med-fRelTimeResolutionLimit*dev, 0.); 310 const Float_t hilim = TMath::Max(med+fRelTimeResolutionLimit*dev, 0.); 311 312 if (res<=lolim || res>=hilim) 313 { 314 *fLog << warn << "Pixel " << setw(4) << i << ": Deviating time resolution: " 315 << Form("%4.2f", res) << " out of range " 316 << Form("[%4.2f,%4.2f]", lolim, hilim) << endl; 317 318 (*fBadPixels)[i].SetUncalibrated(MBadPixelsPix::kDeviatingTimeResolution); 319 } 363 320 } 364 321 } … … 373 330 // - MBadPixelsPix::kRelTimeRelErrNotValid 374 331 // 375 // - Call MCalibrationPix::SetExcluded() for the bad pixels376 //377 332 void MCalibrationRelTimeCalc::FinalizeBadPixels() 378 333 { … … 380 335 for (Int_t i=0; i<fBadPixels->GetSize(); i++) 381 336 { 382 383 337 MBadPixelsPix &bad = (*fBadPixels)[i]; 384 338 385 339 if (IsCheckDeviatingBehavior()) 386 340 if (bad.IsUncalibrated(MBadPixelsPix::kDeviatingTimeResolution)) 387 bad.SetUnsuitable(MBadPixelsPix::kUn reliableRun);341 bad.SetUnsuitable(MBadPixelsPix::kUnsuitableRun); 388 342 389 343 if (IsCheckFitResults()) … … 394 348 if (bad.IsUncalibrated(MBadPixelsPix::kRelTimeOscillating)) 395 349 bad.SetUnsuitable(MBadPixelsPix::kUnreliableRun); 396 397 if (bad.IsUnsuitable(MBadPixelsPix::kUnsuitableRun))398 {399 MCalibrationRelTimePix &pix = (MCalibrationRelTimePix&)(*fCam)[i];400 pix.SetExcluded();401 }402 350 } 403 351 … … 460 408 void MCalibrationRelTimeCalc::PrintUncalibrated(const char *text, Int_t in, Int_t out) const 461 409 { 462 *fLog << " " << setfill(' ') << setw( 56) << setiosflags(ios::left) << text;410 *fLog << " " << setfill(' ') << setw(48) << setiosflags(ios::left) << text; 463 411 *fLog << " Inner: " << Form("%3i", in); 464 412 *fLog << " Outer: " << Form("%3i", out); -
trunk/MagicSoft/Mars/mcalib/MCalibrationRelTimeCam.cc
r5047 r8452 131 131 *fLog << all << GetDescriptor() << ":" << endl; 132 132 int id = 0; 133 133 134 134 *fLog << all << "Calibrated pixels:" << endl; 135 135 *fLog << all << endl; … … 138 138 MCalibrationRelTimePix *pix; 139 139 while ((pix=(MCalibrationRelTimePix*)Next())) 140 141 142 if (!pix->IsExcluded())143 { 144 145 *fLog << all146 << Form("%s%4i%s%4.2f%s%4.2f%s%4.2f%s%4.2f","Pix ",pix->GetPixId(),147 ": Offset: ",pix->GetTimeOffset()," +- ",pix->GetTimeOffsetErr(),148 " Precision: ",pix->GetTimePrecision()," +- ",pix->GetTimePrecisionErr())149 140 { 141 if (!pix->IsExcluded()) 142 { 143 *fLog << all 144 << "Pix " << Form("%4i", pix->GetPixId()) << ": " 145 << " Offset: " 146 << Form("%4.2f +- %4,2f", pix->GetTimeOffset(), pix->GetTimeOffsetErr()) 147 << " Precision: " 148 << Form("%4.2f +- %4.2f", pix->GetTimePrecision(), pix->GetTimePrecisionErr()) 149 << endl; 150 150 id++; 151 152 153 151 } 152 } 153 154 154 *fLog << all << id << " pixels" << endl; 155 155 id = 0; 156 157 156 157 158 158 *fLog << all << endl; 159 159 *fLog << all << "Excluded pixels:" << endl; 160 160 *fLog << all << endl; 161 161 162 162 id = 0; 163 163 … … 177 177 while ((pix=(MCalibrationRelTimePix*)Next5())) 178 178 { 179 *fLog << all 180 << Form("%s%4i%s%4.2f%s%4.2f%s%4.2f%s%4.2f","Average Area ",pix->GetPixId(), 181 ": Offset: ",pix->GetTimeOffset()," +- ",pix->GetTimeOffsetErr(), 182 " Precision: ",pix->GetTimePrecision()," +- ",pix->GetTimePrecisionErr()) 179 *fLog << all 180 << "Average Area " << Form("%4i", pix->GetPixId()) << ":" 181 << "Offset: " 182 << Form("%4.2f +- %4,2f", pix->GetTimeOffset(), pix->GetTimeOffsetErr()) 183 << " Precision: " 184 << Form("%4.2f +- %4.2f", pix->GetTimePrecision(), pix->GetTimePrecisionErr()) 183 185 << endl; 184 186 } … … 187 189 while ((pix=(MCalibrationRelTimePix*)Next5())) 188 190 { 189 *fLog << all 190 << Form("%s%4i%s%4.2f%s%4.2f%s%4.2f%s%4.2f","Average Sector ",pix->GetPixId(), 191 ": Offset: ",pix->GetTimeOffset()," +- ",pix->GetTimeOffsetErr(), 192 " Precision: ",pix->GetTimePrecision()," +- ",pix->GetTimePrecisionErr()) 191 *fLog << all 192 << "Average Sector " << Form("%4i", pix->GetPixId()) << ":" 193 << "Offset: " 194 << Form("%4.2f +- %4.2f", pix->GetTimeOffset(), pix->GetTimeOffsetErr()) 195 << " Precision: " 196 << Form("%4.2f +- %4.2f", pix->GetTimePrecision(), pix->GetTimePrecisionErr()) 193 197 << endl; 194 198 } … … 232 236 return kFALSE; 233 237 val = pix.GetMean(); 234 break;238 return val!=-1.; 235 239 case 1: 236 240 if (pix.IsExcluded()) … … 257 261 } 258 262 259 return val !=-1.;260 261 } 262 263 return val>=0; 264 265 } 266 -
trunk/MagicSoft/Mars/mcalib/Makefile
r8429 r8452 39 39 MCalibrationPatternDecode.cc \ 40 40 MCalibrateRelTimes.cc \ 41 MCalibrationIntensityCam.cc \42 MCalibrationIntensityChargeCam.cc \43 41 MCalibrationCam.cc \ 44 42 MCalibrationPix.cc \ -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.cc
r8417 r8452 78 78 #include "MLogManip.h" 79 79 80 #include "MCalibrationIntensityCam.h"81 80 #include "MCalibrationCam.h" 82 81 #include "MCalibrationPix.h" … … 144 143 fHistXTitle(gsHistXTitle),fHistYTitle(gsHistYTitle), 145 144 fCurrentNumEvts(0), fColor(MCalibrationCam::kNONE), 146 fBadPixels(NULL), f IntensCam(NULL), fCam(NULL), fGeom(NULL),145 fBadPixels(NULL), fCam(NULL), fGeom(NULL), 147 146 fRunHeader(NULL) 148 147 { … … 606 605 if (!fBadPixels) 607 606 { 607 /* 608 608 fBadPixels = (MBadPixelsCam*)pList->FindCreateObj(AddSerialNumber("MBadPixelsCam")); 609 609 if (!fBadPixels) 610 610 return kFALSE; 611 611 612 fBadPixels->InitSize(npixels); 612 fBadPixels->InitSize(npixels); 613 */ 614 *fLog << err << "MBadPixelsCam not found... abort." << endl; 615 return kFALSE; 613 616 } 614 617 … … 762 765 } 763 766 else 764 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadArea(j) :fCam->GetAverageBadArea(j),j);767 InitHists(pix, fCam->GetAverageBadArea(j),j); 765 768 } 766 769 } … … 775 778 776 779 pix.SetBinning(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nsectors), fFirst, fLast); 777 778 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadSector(j) :fCam->GetAverageBadSector(j),j);780 781 InitHists(pix, fCam->GetAverageBadSector(j),j); 779 782 } 780 783 } … … 835 838 } 836 839 else 837 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadArea(j) :fCam->GetAverageBadArea(j),j);840 InitHists(pix, fCam->GetAverageBadArea(j),j); 838 841 } 839 842 } … … 849 852 pix.SetBinning(fNbins*(Int_t)TMath::Sqrt((Float_t)npixels/nsectors), fFirst, fLast); 850 853 851 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadSector(j) :fCam->GetAverageBadSector(j),j);854 InitHists(pix, fCam->GetAverageBadSector(j),j); 852 855 } 853 856 } … … 1034 1037 // ------------------------------------------------------------- 1035 1038 // 1036 // - Searches for the CalibrationIntensity*Cam corresponding to 'name'. 1037 // - In case, it does not exist in the parameter list, it searches 1038 // for the corresponding MCalibration*Cam. 1039 // - Searches for the Calibration*Cam corresponding to 'name'. 1039 1040 // - Initializes the MCalibration*Cam, if not yet done. 1040 1041 // … … 1042 1043 { 1043 1044 1044 TString intensname = "MCalibrationIntensity"; 1045 intensname += name; 1046 intensname += "Cam"; 1047 1048 TString ordname = "MCalibration"; 1049 ordname += name; 1050 ordname += "Cam"; 1051 1052 fIntensCam = (MCalibrationIntensityCam*)plist->FindObject(AddSerialNumber(intensname)); 1053 if (fIntensCam) 1054 *fLog << inf << "Found " << intensname << "... " << endl; 1055 else 1056 { 1057 fCam = (MCalibrationCam*)plist->FindObject(AddSerialNumber(ordname)); 1045 TString ordname = "MCalibration"; 1046 ordname += name; 1047 ordname += "Cam"; 1048 1049 fCam = (MCalibrationCam*)plist->FindObject(AddSerialNumber(ordname)); 1050 if (!fCam) 1051 { 1052 fCam = (MCalibrationCam*)plist->FindCreateObj(AddSerialNumber(ordname)); 1058 1053 if (!fCam) 1059 { 1060 fCam = (MCalibrationCam*)plist->FindCreateObj(AddSerialNumber(ordname)); 1061 if (!fCam) 1062 return kFALSE; 1063 1064 fCam->Init(*fGeom); 1065 } 1066 } 1054 return kFALSE; 1055 1056 fCam->Init(*fGeom); 1057 } 1058 1067 1059 return kTRUE; 1068 1060 } … … 1182 1174 if (!IsAverageing()) 1183 1175 return; 1184 1185 MCalibrationCam *cam = f IntensCam ? fIntensCam->GetCam() : fCam;1176 1177 MCalibrationCam *cam = fCam; 1186 1178 if (!cam) 1187 1179 return; 1188 1180 1189 1181 for (UInt_t j=0; j<fGeom->GetNumAreas(); j++) 1190 1182 { 1191 1183 1192 1184 MCalibrationPix &pix = cam->GetAverageArea(j); 1193 1185 … … 1241 1233 if (hist.IsEmpty()) 1242 1234 { 1243 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Hi-Gain histogram empty." << endl; 1235 //*fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Hi-Gain histogram empty." << endl; 1236 //bad.SetUncalibrated( fittyp ); 1237 return; 1238 } 1239 if (hist.IsOnlyOverflow()) 1240 { 1241 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Hi-Gain histogram contains only overflows (Check Binning!)." << endl; 1244 1242 bad.SetUncalibrated( fittyp ); 1245 1243 return; 1246 1244 } 1247 if (hist.IsOnlyOverflow())1248 {1249 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Hi-Gain histogram contains only overflows." << endl;1250 bad.SetUncalibrated( fittyp );1251 return;1252 }1253 1245 if (hist.IsOnlyUnderflow()) 1254 1246 { 1255 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Hi-Gain histogram contains only underflows ." << endl;1247 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Hi-Gain histogram contains only underflows (Check Binning!)." << endl; 1256 1248 bad.SetUncalibrated( fittyp ); 1257 1249 return; … … 1346 1338 if (hist.IsEmpty()) 1347 1339 { 1348 // *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Lo-Gain histogram empty." << endl; 1340 //*fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Lo-Gain histogram empty." << endl; 1341 //bad.SetUncalibrated( fittyp ); // FIXME: Combine with HiGain! 1342 return; 1343 } 1344 if (hist.IsOnlyOverflow()) 1345 { 1346 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Lo-Gain histogram contains only overflows (Check Binning!)." << endl; 1349 1347 bad.SetUncalibrated( fittyp ); 1350 1348 return; 1351 1349 } 1352 if (hist.IsOnlyOverflow())1353 {1354 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Lo-Gain histogram contains only overflows." << endl;1355 bad.SetUncalibrated( fittyp );1356 return;1357 }1358 1350 if (hist.IsOnlyUnderflow()) 1359 1351 { 1360 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Lo-Gain histogram contains only underflows ." << endl;1352 *fLog << warn << "Pixel " << setw(4) << pix.GetPixId() << ": Lo-Gain histogram contains only underflows (Check Binning!)." << endl; 1361 1353 bad.SetUncalibrated( fittyp ); 1362 1354 return; -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationCam.h
r8417 r8452 29 29 class MGeomCam; 30 30 class MRawRunHeader; 31 class MCalibrationIntensityCam;32 31 class MCalibrationCam; 33 32 class MCalibrationPix; … … 100 99 101 100 MBadPixelsCam *fBadPixels; //! Bad Pixels storage container 102 MCalibrationIntensityCam *fIntensCam; //! Intensity Calibration Cam with the results103 101 MCalibrationCam *fCam; //! Calibration Cam with the results 104 102 MGeomCam *fGeom; //! Camera geometry -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationChargeCam.cc
r8446 r8452 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.5 7 2007-04-25 14:39:43tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MHCalibrationChargeCam.cc,v 1.58 2007-04-27 10:04:47 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 143 143 #include "MHCalibrationPix.h" 144 144 145 #include "MCalibrationIntensityCam.h"146 145 #include "MCalibrationChargeCam.h" 147 146 #include "MCalibrationChargePix.h" … … 339 338 // Gets or creates the pointers to: 340 339 // - MExtractedSignalCam 341 // - MCalibrationChargeCam or MCalibrationIntensityChargeCam340 // - MCalibrationChargeCam 342 341 // - MBadPixelsCam 343 342 // … … 472 471 pix.SetBinningAbsTime(higainsamples, -0.5, higainsamples-0.5); 473 472 474 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadArea(j) :fCam->GetAverageBadArea(j),j);473 InitHists(pix, fCam->GetAverageBadArea(j),j); 475 474 476 475 h = pix.GetHAbsTime(); … … 498 497 pix.SetBinningAbsTime(higainsamples, -0.5, higainsamples-0.5); 499 498 500 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadSector(j) :fCam->GetAverageBadSector(j),j);499 InitHists(pix, fCam->GetAverageBadSector(j),j); 501 500 502 501 h = pix.GetHAbsTime(); … … 582 581 pix.SetBinningAbsTime(logainsamples, -0.5, logainsamples-0.5); 583 582 584 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadArea(j) :fCam->GetAverageBadArea(j),j);583 InitHists(pix, fCam->GetAverageBadArea(j),j); 585 584 586 585 h = pix.GetHAbsTime(); … … 609 608 pix.SetBinningAbsTime(logainsamples, -0.5, logainsamples-0.5); 610 609 611 InitHists(pix, fIntensCam ? fIntensCam->GetAverageBadSector(j) :fCam->GetAverageBadSector(j),j);610 InitHists(pix, fCam->GetAverageBadSector(j),j); 612 611 613 612 h = pix.GetHAbsTime(); … … 862 861 TH1F *h = NULL; 863 862 864 MCalibrationCam *chargecam = fIntensCam ? fIntensCam->GetCam() : fCam;865 866 863 const Int_t hifirst = fSignal->GetFirstUsedSliceHiGain(); 867 864 const Int_t hilast = fSignal->GetLastUsedSliceHiGain(); … … 871 868 for (Int_t i=0; i<fHiGainArray->GetSize(); i++) 872 869 { 873 870 874 871 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)(*this)[i]; 875 876 872 if (histhi.IsExcluded()) 877 873 continue; 878 874 879 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];875 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 880 876 881 877 const Int_t numsat = histhi.GetSaturated(); … … 935 931 } 936 932 937 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i] ;933 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i] ; 938 934 if (!pix.IsHiGainSaturation()) 939 935 continue; … … 966 962 967 963 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)GetAverageHiGainArea(j); 968 MCalibrationChargePix &pix = (MCalibrationChargePix&) chargecam->GetAverageArea(j);964 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageArea(j); 969 965 970 966 if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries()) … … 976 972 } 977 973 978 MBadPixelsPix &bad = chargecam->GetAverageBadArea(j);974 MBadPixelsPix &bad = fCam->GetAverageBadArea(j); 979 975 FinalizeAbsTimes(histhi, pix, bad, hifirst, hilast); 980 976 } … … 994 990 } 995 991 996 MCalibrationChargePix &pix = (MCalibrationChargePix&)chargecam->GetAverageArea(j); 997 992 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageArea(j); 998 993 if (pix.IsHiGainSaturation()) 999 994 { 1000 MBadPixelsPix &bad = chargecam->GetAverageBadArea(j);995 MBadPixelsPix &bad = fCam->GetAverageBadArea(j); 1001 996 FinalizeAbsTimes(histlo, pix, bad, lofirst, lolast); 1002 997 } 1003 998 1004 999 } 1005 1000 … … 1008 1003 1009 1004 MHCalibrationChargePix &histhi = (MHCalibrationChargePix&)GetAverageHiGainSector(j); 1010 MCalibrationChargePix &pix = (MCalibrationChargePix&) chargecam->GetAverageSector(j);1005 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageSector(j); 1011 1006 1012 1007 if (histhi.GetSaturated() > fNumHiGainSaturationLimit*histhi.GetHGausHist()->GetEntries()) … … 1018 1013 } 1019 1014 1020 MBadPixelsPix &bad = chargecam->GetAverageBadSector(j);1015 MBadPixelsPix &bad = fCam->GetAverageBadSector(j); 1021 1016 FinalizeAbsTimes(histhi, pix, bad, hifirst, hilast); 1022 1017 } … … 1025 1020 for (Int_t j=0; j<fAverageLoGainSectors->GetSize(); j++) 1026 1021 { 1027 1022 1028 1023 MHCalibrationChargePix &histlo = (MHCalibrationChargePix&)GetAverageLoGainSector(j); 1029 MBadPixelsPix &bad = chargecam->GetAverageBadSector(j);1030 1024 MBadPixelsPix &bad = fCam->GetAverageBadSector(j); 1025 1031 1026 if (histlo.GetSaturated() > fNumLoGainSaturationLimit*histlo.GetHGausHist()->GetEntries()) 1032 1027 { … … 1037 1032 continue; 1038 1033 } 1039 1040 MCalibrationChargePix &pix = (MCalibrationChargePix&)chargecam->GetAverageSector(j); 1041 1034 1035 MCalibrationChargePix &pix = (MCalibrationChargePix&)fCam->GetAverageSector(j); 1042 1036 if (pix.IsHiGainSaturation()) 1043 1037 FinalizeAbsTimes(histlo, pix, bad, lofirst, lolast); … … 1047 1041 // Perform the fitting for the High Gain (done in MHCalibrationCam) 1048 1042 // 1049 FitHiGainArrays(* chargecam, *fBadPixels,1043 FitHiGainArrays(*fCam, *fBadPixels, 1050 1044 MBadPixelsPix::kHiGainNotFitted, 1051 1045 MBadPixelsPix::kHiGainOscillating); … … 1055 1049 // 1056 1050 if (IsLoGain()) 1057 FitLoGainArrays(* chargecam, *fBadPixels,1051 FitLoGainArrays(*fCam, *fBadPixels, 1058 1052 MBadPixelsPix::kLoGainNotFitted, 1059 1053 MBadPixelsPix::kLoGainOscillating); … … 1071 1065 continue; 1072 1066 1073 MCalibrationChargePix &pix = (MCalibrationChargePix&)(* chargecam)[i];1067 MCalibrationChargePix &pix = (MCalibrationChargePix&)(*fCam)[i]; 1074 1068 if (!pix.IsHiGainSaturation()) 1075 1069 continue; … … 1143 1137 { 1144 1138 1145 MCalibrationCam *chargecam = fIntensCam ? fIntensCam->GetCam() : fCam;1146 1147 1139 for (Int_t i=0; i<fBadPixels->GetSize(); i++) 1148 1140 { 1149 1150 MBadPixelsPix &bad= (*fBadPixels)[i];1151 MCalibrationPix &pix = (*chargecam)[i];1141 1142 MBadPixelsPix &bad = (*fBadPixels)[i]; 1143 MCalibrationPix &pix = (*fCam)[i]; 1152 1144 1153 1145 if (bad.IsUncalibrated(MBadPixelsPix::kHiGainNotFitted)) -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
r8428 r8452 125 125 126 126 const Float_t MHCalibrationRelTimeCam::fgNumHiGainSaturationLimit = 0.25; 127 const UInt_t MHCalibrationRelTimeCam::fgReferencePixel = 1;127 //const UInt_t MHCalibrationRelTimeCam::fgReferencePixel = 1; 128 128 const Int_t MHCalibrationRelTimeCam::fgNbins = 400; 129 129 const Axis_t MHCalibrationRelTimeCam::fgFirst = -9.975; … … 141 141 // 142 142 // Sets: 143 // - fReferencePixel to fgReferencePixel144 143 // - fNbins to fgNbins 145 144 // - fFirst to fgFirst … … 159 158 SetNumHiGainSaturationLimit(fgNumHiGainSaturationLimit); 160 159 161 SetReferencePixel();160 // SetReferencePixel(); 162 161 163 162 SetBinning(fgNbins, fgFirst, fgLast); … … 263 262 return kFALSE; 264 263 265 MArrivalTimeCam *signal = (MArrivalTimeCam*)pList->FindObject("MArrivalTimeCam");266 if (!signal)267 {268 *fLog << err << "MArrivalTimeCam not found... abort." << endl;269 return kFALSE;270 }271 272 264 const Int_t npixels = fGeom->GetNumPixels(); 273 265 const Int_t nsectors = fGeom->GetNumSectors(); … … 313 305 return kFALSE; 314 306 } 315 307 316 308 const Int_t npixels = fGeom->GetNumPixels(); 317 309 const Int_t nareas = fGeom->GetNumAreas(); … … 327 319 fNumsectorlo.Reset(); 328 320 329 const MArrivalTimePix &refpix = (*arrtime)[fReferencePixel];330 // FIXME: What do we do if pixel is invalid?331 if (!refpix.IsArrivalTimeValid())321 TArrayF arr(npixels); 322 Int_t n = 0; 323 for (Int_t i=0; i<npixels; i++) 332 324 { 333 gLog << warn << "WARNING - Arrival time in refrence pixel " << fReferencePixel << " invalid." << endl; 334 return kTRUE; 325 if ((*fGeom)[i].GetAidx()>0) 326 continue; 327 328 const MArrivalTimePix &pix = (*arrtime)[i]; 329 if (pix.IsHiGainValid() && !pix.IsHiGainSaturated()) 330 arr[n++] = pix.GetArrivalTimeHiGain(); 335 331 } 336 332 337 const Float_t reftime = refpix.GetArrivalTime(); 338 // refpix.IsHiGainSaturated() 339 // ? refpix.GetArrivalTimeLoGain() : refpix.GetArrivalTimeHiGain(); 333 const Float_t reftime = TMath::Median(n, arr.GetArray()); 340 334 341 335 for (Int_t i=0; i<npixels; i++) … … 345 339 continue; 346 340 347 const Int_t aidx = (*fGeom)[i].GetAidx();348 const Int_t sector = (*fGeom)[i].GetSector();349 350 341 const MArrivalTimePix &pix = (*arrtime)[i]; 351 342 … … 361 352 histhi.FillHist(time-reftime); 362 353 354 const Int_t aidx = (*fGeom)[i].GetAidx(); 355 const Int_t sector = (*fGeom)[i].GetSector(); 356 363 357 fSumareahi [aidx] += time; 364 358 fNumareahi [aidx] ++; … … 373 367 /* 374 368 // If lo-gain arrival time has been extracted successfully, 375 // the hi-gain has saturate ed and the lo-gain is switched on369 // the hi-gain has saturated and the lo-gain is switched on 376 370 // fill hi-gain histograms and arrays 377 371 if (pix.IsLoGainValid() && IsLoGain()) 378 372 { 379 373 const Float_t time = pix.GetArrivalTimeLoGain(); 374 375 // FIXME: We need the reference time of the lo-gains! 380 376 381 377 MHCalibrationPix &histlo = (*this)(i); … … 393 389 394 390 for (Int_t j=0; j<nareas; j++) 395 { 396 MHCalibrationPix &histhi = GetAverageHiGainArea(j); 397 if (IsOscillations()) 398 histhi.FillHistAndArray(fNumareahi[j] == 0 ? 0. : fSumareahi[j]/fNumareahi[j]); 399 else 400 histhi.FillHist(fNumareahi[j] == 0 ? 0. : fSumareahi[j]/fNumareahi[j]); 401 402 if (IsLoGain()) 403 { 391 { 392 if (fNumareahi[j]>0) 393 { 394 MHCalibrationPix &histhi = GetAverageHiGainArea(j); 395 if (IsOscillations()) 396 histhi.FillHistAndArray(fSumareahi[j]/fNumareahi[j]); 397 else 398 histhi.FillHist(fSumareahi[j]/fNumareahi[j]); 399 } 400 401 if (IsLoGain() && fNumarealo[j]>0) 402 { 404 403 MHCalibrationPix &histlo = GetAverageLoGainArea(j); 405 406 histlo.FillHistAndArray(f Numarealo[j] == 0 ? 0. : fSumarealo[j]/fNumarealo[j]);404 if (IsOscillations()) 405 histlo.FillHistAndArray(fSumarealo[j]/fNumarealo[j]); 407 406 else 408 histlo.FillHist(f Numarealo[j] == 0 ? 0. : fSumarealo[j]/fNumarealo[j]);409 410 411 407 histlo.FillHist(fSumarealo[j]/fNumarealo[j]); 408 } 409 } 410 412 411 for (Int_t j=0; j<nsectors; j++) 413 { 414 MHCalibrationPix &histhi = GetAverageHiGainSector(j); 415 if (IsOscillations()) 416 histhi.FillHistAndArray(fNumsectorhi[j] == 0 ? 0. : fSumsectorhi[j]/fNumsectorhi[j]); 417 else 418 histhi.FillHist(fNumsectorhi[j] == 0 ? 0. : fSumsectorhi[j]/fNumsectorhi[j]); 419 420 if (IsLoGain()) 421 { 412 { 413 if (fNumsectorhi[j]>0) 414 { 415 MHCalibrationPix &histhi = GetAverageHiGainSector(j); 416 if (IsOscillations()) 417 histhi.FillHistAndArray(fSumsectorhi[j]/fNumsectorhi[j]); 418 else 419 histhi.FillHist(fSumsectorhi[j]/fNumsectorhi[j]); 420 } 421 422 if (IsLoGain() && fNumsectorlo[j]>0) 423 { 422 424 MHCalibrationPix &histlo = GetAverageLoGainSector(j); 423 424 histlo.FillHistAndArray(f Numsectorlo[j] == 0 ? 0. : fSumsectorlo[j]/fNumsectorlo[j]);425 if (IsOscillations()) 426 histlo.FillHistAndArray(fSumsectorlo[j]/fNumsectorlo[j]); 425 427 else 426 histlo.FillHist(f Numsectorlo[j] == 0 ? 0. : fSumsectorlo[j]/fNumsectorlo[j]);427 428 428 histlo.FillHist(fSumsectorlo[j]/fNumsectorlo[j]); 429 } 430 } 429 431 430 432 return kTRUE; … … 459 461 if (histhi.IsExcluded()) 460 462 continue; 461 463 462 464 const Int_t aidx = (*fGeom)[i].GetAidx(); 463 465 const Int_t sector = (*fGeom)[i].GetSector(); … … 562 564 563 565 if (bad.IsUncalibrated( MBadPixelsPix::kRelTimeNotFitted )) 564 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun );566 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun ); 565 567 566 568 if (bad.IsUncalibrated( MBadPixelsPix::kRelTimeOscillating)) 567 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun );568 569 bad.SetUnsuitable( MBadPixelsPix::kUnreliableRun ); 570 569 571 } 570 572 } … … 577 579 // ============== 578 580 // 579 // 0: Fitted Mean Relative Arrival Time in FADC slices(MHGausEvents::GetMean()580 // 1: Error Mean Relative Arrival Time in FADC slices(MHGausEvents::GetMeanErr()581 // 0: Fitted Mean Relative Arrival Time in FADC slices (MHGausEvents::GetMean() 582 // 1: Error Mean Relative Arrival Time in FADC slices (MHGausEvents::GetMeanErr() 581 583 // 2: Sigma fitted Relative Arrival Time in FADC slices (MHGausEvents::GetSigma() 582 // 3: Error Sigma Relative Arrival Time in FADC slices(MHGausEvents::GetSigmaErr()584 // 3: Error Sigma Relative Arrival Time in FADC slices (MHGausEvents::GetSigmaErr() 583 585 // 584 586 // Useful variables derived from the fit results: 585 587 // ============================================= 586 588 // 587 // 4: Returned probability of Gauss fit (calls:MHGausEvents::GetProb())589 // 4: Returned probability of Gauss fit (MHGausEvents::GetProb()) 588 590 // 589 591 // Localized defects: 590 592 // ================== 591 593 // 592 // 5: Gaus fit not OK (calls:MHGausEvents::IsGausFitOK())593 // 6: Fourier spectrum not OK (calls:MHGausEvents::IsFourierSpectrumOK())594 // 5: Gaus fit not OK (MHGausEvents::IsGausFitOK()) 595 // 6: Fourier spectrum not OK (MHGausEvents::IsFourierSpectrumOK()) 594 596 // 595 597 Bool_t MHCalibrationRelTimeCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const … … 849 851 } 850 852 851 if (IsEnvDefined(env, prefix, "ReferencePixel", print))852 {853 SetReferencePixel(GetEnvValue(env, prefix, "ReferencePixel", (Int_t)fReferencePixel));854 rc = kTRUE;855 }856 857 853 TEnv refenv(fReferenceFile); 858 854 -
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.h
r8001 r8452 22 22 23 23 static const Float_t fgNumHiGainSaturationLimit; //! The default for fNumHiGainSaturationLimit (now at: 0.25) 24 static const UInt_t fgReferencePixel; //! Default for fReferencePixel (now set to: 1)25 24 static const Int_t fgNbins; //! Default number of bins (now set to: 900 ) 26 25 static const Axis_t fgFirst; //! Default lower histogram limit (now set to: -13.5 ) … … 35 34 static const TString fgReferenceFile; //! default for fReferenceFile ("mjobs/calibrationref.rc") 36 35 37 UInt_t fReferencePixel; // The reference pixel for rel. times38 36 Float_t fInnerRefTime; // The reference mean arrival time inner pixels 39 37 Float_t fOuterRefTime; // The reference mean arrival time outer pixels … … 66 64 ~MHCalibrationRelTimeCam() {} 67 65 68 UInt_t GetReferencePixel() const { return fReferencePixel; }69 70 66 // Clone 71 67 TObject *Clone(const char *name="") const; 72 68 73 69 // Setters 74 void SetReferencePixel( const UInt_t i=fgReferencePixel ) { fReferencePixel = i; }75 70 void SetReferenceFile ( const TString ref=fgReferenceFile ) { fReferenceFile = ref; } 76 71 -
trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc
r8445 r8452 69 69 70 70 #include "MCalibConstCam.h" 71 #include "MCalibrationIntensityChargeCam.h"72 71 73 72 #include "MHCalibrationChargeCam.h" … … 125 124 // 126 125 MJCalibrateSignal::MJCalibrateSignal(const char *name, const char *title) 127 : fExtractor(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(k FALSE), fIsMovieMode(kFALSE)126 : fExtractor(0), fIsInterlaced(kTRUE), fIsRelTimesUpdate(kTRUE), fIsMovieMode(kFALSE) 128 127 { 129 128 fName = name ? name : "MJCalibrateSignal"; … … 250 249 251 250 // Read File 252 MCalibrationIntensityChargeCam ichcam;253 254 251 MHCalibrationChargeCam hchacam; 255 252 MHCalibrationChargeBlindCam hbndcam; … … 276 273 if (fIsInterlaced) 277 274 { 278 interlacedcont.Add(&ichcam);279 275 interlacedcont.Add(&hchacam); 280 276 if (IsUseBlindPixel()) … … 531 527 532 528 MCalibrationChargeCalc chcalc; 529 chcalc.SetContinousCalibration(); 533 530 chcalc.SetExtractor(extractor3); 534 531 … … 546 543 547 544 // 548 // IntensityCalibration histogramming545 // Calibration histogramming 549 546 // 550 547 MFillH filpin(&hpndiod, "MExtractedSignalPINDiode", "FillPINDiode"); … … 695 692 tlist3.SetFilter(&fcalib); 696 693 697 //MFDataPhrase filcalco("MCalibration IntensityConstCam.IsReadyToSave>0.5", "CalibConstFilter");694 //MFDataPhrase filcalco("MCalibrationConstCam.IsReadyToSave>0.5", "CalibConstFilter"); 698 695 if (fIsInterlaced) 699 696 { -
trunk/MagicSoft/Mars/mjobs/MJCalibration.cc
r8434 r8452 19 19 ! Author(s): Markus Gaug, 02/2004 <mailto:markus@ifae.es> 20 20 ! 21 ! Copyright: MAGIC Software Development, 2000-200 521 ! Copyright: MAGIC Software Development, 2000-2007 22 22 ! 23 23 ! … … 218 218 fRefConvFADC2PheInner = 0.14; 219 219 fRefConvFADC2PheOuter = 0.52; 220 fRefQEInner = 0.18; 220 fRefQEInner = 0.18; 221 221 fRefQEOuter = 0.12; 222 fRefArrivalTimeInner = 4.5; 222 fRefArrivalTimeInner = 4.5; 223 223 fRefArrivalTimeOuter = 5.0; 224 fRefArrivalTimeRmsInner = 0.5; 224 fRefArrivalTimeRmsInner = 0.5; 225 225 fRefArrivalTimeRmsOuter = 0.5; 226 fRefTimeOffsetInner = -0.23; 227 fRefTimeOffsetOuter = 0.39; 228 fRefTimeResolutionInner = 0.153; 229 fRefTimeResolutionOuter = 0.128; 226 fRefTimeOffsetOuter = 0.62; 227 fRefTimeResolutionInner = 0.12; 228 fRefTimeResolutionOuter = 0.09; 230 229 231 230 } … … 813 812 // for the datacheck, fix the ranges!! 814 813 // 815 const Double_t max = 1 1.;814 const Double_t max = 12.; 816 815 obj8->SetMinimum(0.); 817 816 obj8->SetMaximum(max); … … 825 824 const Int_t numcol = gStyle->GetNumberOfColors()-3; 826 825 827 TPaveText *pave = new TPaveText(0.05,0.02,0.975,0.99 );826 TPaveText *pave = new TPaveText(0.05,0.02,0.975,0.999); 828 827 pave->SetBit(kCanDelete); 829 828 pave->ConvertNDCtoPad(); … … 866 865 t17->SetTextColor(gStyle->GetColorPalette(Int_t(9./max*numcol))); 867 866 t17->SetTextAlign(12); 867 TText *t18 = pave->AddText(Form("Deviating Rel. Arrival Time RMS: %3i pixels", 868 CountBadPixels(&disp24,10 ))); 869 t18->SetTextColor(gStyle->GetColorPalette(Int_t(10./max*numcol))); 870 t18->SetTextAlign(12); 868 871 TText *t15= pave->AddText(Form("Too many Low-Gain Blackout Events: %3i pixels", 869 CountBadPixels(&disp24,1 0)));870 t15->SetTextColor(gStyle->GetColorPalette(Int_t(1 0./max*numcol)));872 CountBadPixels(&disp24,11 ))); 873 t15->SetTextColor(gStyle->GetColorPalette(Int_t(11./max*numcol))); 871 874 t15->SetTextAlign(12); 872 875 TText *t14= pave->AddText(Form("Previously Excluded: %3i pixels", 873 CountBadPixels(&disp24,1 1)));874 t14->SetTextColor(gStyle->GetColorPalette(Int_t(1 1./max*numcol)));876 CountBadPixels(&disp24,12))); 877 t14->SetTextColor(gStyle->GetColorPalette(Int_t(12./max*numcol))); 875 878 t14->SetTextAlign(12); 876 879 pave->Draw(); … … 903 906 gStyle->SetPalette(1); 904 907 905 TPaveText *pave2 = new TPaveText(0.025,0.02,0.95,0.99 );908 TPaveText *pave2 = new TPaveText(0.025,0.02,0.95,0.999); 906 909 pave2->SetBit(kCanDelete); 907 910 pave2->ConvertNDCtoPad(); … … 1239 1242 break; 1240 1243 case 5: 1241 l1 = line.DrawLine(0, fRefTimeOffsetInner, x, fRefTimeOffsetInner);1244 l1 = line.DrawLine(0, 0, x, 0); 1242 1245 break; 1243 1246 case 6: … … 1391 1394 // RefArrivalTimeRmsOuter 1392 1395 // 1393 // RefTimeOffsetInner1394 1396 // RefTimeOffsetOuter 1395 1397 // RefTimeResolutionInner … … 1425 1427 fRefArrivalTimeRmsInner = refenv.GetValue("RefArrivalTimeRmsInner",fRefArrivalTimeRmsInner); 1426 1428 fRefArrivalTimeRmsOuter = refenv.GetValue("RefArrivalTimeRmsOuter",fRefArrivalTimeRmsOuter); 1427 fRefTimeOffsetInner = refenv.GetValue("RefTimeOffsetInner",fRefTimeOffsetInner);1428 1429 fRefTimeOffsetOuter = refenv.GetValue("RefTimeOffsetOuter",fRefTimeOffsetOuter); 1429 1430 fRefTimeResolutionInner = refenv.GetValue("RefTimeResolutionInner",fRefTimeResolutionInner); … … 1894 1895 tlist.AddToList(&cont); 1895 1896 1896 if (IsRelTimes())1897 {1898 tlist.AddToList(&filltme);1899 tlist.AddToList(&timecalc);1900 }1901 1902 1897 tlist.AddToList(&fillcam); 1903 1898 … … 1909 1904 tlist.AddToList(&calcalc); 1910 1905 1906 if (IsRelTimes()) 1907 { 1908 tlist.AddToList(&filltme); 1909 tlist.AddToList(&timecalc); 1910 } 1911 1911 1912 1912 MHCamEvent evt2(0, "Extra'd", "Extracted Calibration Signal;;S [cnts/sl]"); -
trunk/MagicSoft/Mars/mjobs/calibrationref.rc
r7013 r8452 63 63 # Relative Time Calibration: 64 64 # 65 RefTimeOffsetInner: -0.23 66 RefTimeOffsetOuter: 0.39 67 RefTimeResolutionInner: 0.153 68 RefTimeResolutionOuter: 0.128 65 RefTimeOffsetOuter: 0.62 66 RefTimeResolutionInner: 0.12 67 RefTimeResolutionOuter: 0.09 69 68 # 70 69 # Mean Absolute Time: -
trunk/MagicSoft/Mars/mjobs/calibrationref_Dec04.rc
r7013 r8452 63 63 # Relative Time Calibration: 64 64 # 65 RefTimeOffsetInner: -0.23 66 RefTimeOffsetOuter: 0.39 67 RefTimeResolutionInner: 0.153 68 RefTimeResolutionOuter: 0.128 65 RefTimeOffsetOuter: 0.62 66 RefTimeResolutionInner: 0.12 67 RefTimeResolutionOuter: 0.09 69 68 # 70 69 # Mean Absolute Time: -
trunk/MagicSoft/Mars/mjobs/calibrationref_Nov04.rc
r7013 r8452 63 63 # Relative Time Calibration: 64 64 # 65 RefTimeOffsetInner: -0.23 66 RefTimeOffsetOuter: 0.39 67 RefTimeResolutionInner: 0.153 68 RefTimeResolutionOuter: 0.128 65 RefTimeOffsetOuter: 0.62 66 RefTimeResolutionInner: 0.12 67 RefTimeResolutionOuter: 0.09 69 68 # 70 69 # Mean Absolute Time: -
trunk/MagicSoft/Mars/resources/calibrationref_mux.rc
r8370 r8452 30 30 # 31 31 TimeOffsetMin: -9. 32 TimeOffsetMax: 9.32 TimeOffsetMax: 12. 33 33 34 TimeResolutionMin: 1.35 TimeResolutionMax: 1. 534 TimeResolutionMin: 0.45 35 TimeResolutionMax: 1.25 36 36 37 37 ###################################################################### … … 68 68 # Relative Time Calibration: 69 69 # 70 RefTimeOffsetInner: -3.5 71 RefTimeOffsetOuter: 2 72 RefTimeResolutionInner: 1.25 73 RefTimeResolutionOuter: 1.1 70 RefTimeOffsetOuter: 5.5 71 RefTimeResolutionInner: 0.9 72 RefTimeResolutionOuter: 0.7 74 73 75 74 #
Note:
See TracChangeset
for help on using the changeset viewer.