STDMETHODIMP CVisWindow::put_calibrated(double newVal) { if(newVal){ ReadCalibration(); calibrated = IsCalibrated(); } else{ ClearCalibration(); calibrated = IsCalibrated(); } return S_OK; }
Short_t KVChIo::GetCalcACQParam(KVACQParam* ACQ, Double_t ECalc) const { // Calculates & returns value of given acquisition parameter corresponding to // given calculated energy loss in the detector // Returns -1 if detector is not calibrated if(!IsCalibrated()) return -1; Double_t volts = const_cast<KVChIo*>(this)->GetVoltsFromEnergy( ECalc ); if(ACQ->IsType("PG")) return (Short_t)const_cast<KVChIo*>(this)->GetCanalPGFromVolts(volts); else if(ACQ->IsType("GG")) return (Short_t)const_cast<KVChIo*>(this)->GetCanalGGFromVolts(volts); return -1; }
Double_t KVChIo::GetCalibratedEnergy() { //Calculate energy in MeV from coder values. //Returns 0 if calibration not ready or detector not fired //(we require that at least one acquisition parameter have a value //greater than the current pedestal value) if (IsCalibrated() && Fired("Pany")) { return (fVoltE->Compute( GetVolts() )); } return 0; }
CVisWindow::CVisWindow() { if(VisWindow) return; // Only one should be open! // Initialize Variables VisWindow = this; bufferId=0; dispList[0]=dispList[1]=0; // Not a valid list id *errorString='\0'; blockmode=0; batchmode=0; logmode=0; // Create the Window FullScreen=1; if (!CreateGLWindow()) PostQuitMessage(0); // Check on Calibration ReadCalibration(); calibrated = IsCalibrated(); // Priority put_priority(0); // Normal Priority Class // Action Logging tagCount=0; actionCount=0; logIndex=0; actionLog = new double*[VISWIN_MAX_LOG_ACTIONS]; for(int i=0; i<VISWIN_MAX_LOG_ACTIONS; i++) actionLog[i]=NULL; // Counter Window counterPos[0]=counterPos[1]=0; counterX = (int)(counterPos[0]*width); counterY = (int)(counterPos[1]*height); counterSize[0]=.05; counterSize[1]=.02; counterW = (int)(counterSize[0]*width); counterH = (int)(counterSize[1]*height); }
Double_t KVBIC::GetEnergy() { //Redefinition of KVChIo::GetEnergy(). //If energy lost in active layer is already set (e.g. by calculation of energy loss //of charged particles), return its value. //If not, we calculate it and set it using the values read from coders //and the linear channel-energy calibration if initialised // //Returns -99 if (i) no calibration present (ii) calibration present but no data in acquisition parameters //fELoss already set, return its value if (KVDetector::GetEnergy()) return KVDetector::GetEnergy(); Double_t ELoss = -99; //is detector calibration available and ready ? if (IsCalibrated()) { ELoss = fLinCal->Compute(-1); if (ELoss > -99.) { SetEnergy(ELoss); } } return ELoss; }