void KVINDRAUpDater::SetGains(KVDBRun* kvrun) { //Set gains used during this run //First all detector gains are set to 1. //Then, any detectors for which a different gain has been defined //will have its gain set to the value for the run TIter next(fArray->GetDetectors()); KVDetector* kvd; while ((kvd = (KVDetector*) next())) kvd->SetGain(1.00); KVRList* gain_list = kvrun->GetLinks("Gains"); if (!gain_list) { return; } cout << "--> Setting Gains:" << endl; Int_t ndets = gain_list->GetSize(); cout << " Setting gains for " << ndets << " detectors : " << endl; for (int i = 0; i < ndets; i++) { KVDBParameterSet* dbps = (KVDBParameterSet*) gain_list->At(i); kvd = fArray->GetDetector(dbps->GetName()); if (kvd) { kvd->SetGain(dbps->GetParameter(0)); cout << " " << kvd->GetName() << " : G=" << kvd-> GetGain() << endl; } else { Error("SetGains", "le detecteur %s n ext pas present", dbps->GetName()); } } }
void KVINDRAUpDater_e475s::SetPedestals(KVDBRun* kvrun) { KVRList *param_list = kvrun->GetLinks("Pedestals"); if (!param_list) return; if (!param_list->GetSize()) return; KVDetector *det; KVDBParameterSet *kvps; TIter next_ps(param_list); KVString str; Double_t pied_value; // Setting all pedestal values available while ((kvps = (KVDBParameterSet *) next_ps())) { // boucle sur les parametres str = kvps->GetName(); if ( (det = gIndra->GetDetector(str.Data())) ){ pied_value = kvps->GetParameter(1); det->SetPedestal(kvps->GetTitle(),pied_value); } //detector found } //boucle sur les parameters }
void KVINDRAUpDater::SetCsIGainCorrectionParameters(KVDBRun* kvrun) { // Sets KVCsI::fGainCorrection data member, used by KVCsI::GetCorrectedLumiereTotale // to return the total light output corrected by a run-dependent factor. // We set all detectors' correction to 1, then set the corrections defined for this // run, if any. TIter next_csi(GetINDRA()->GetListOfCsI()); KVCsI* csi; while ((csi = (KVCsI*)next_csi())) { csi->SetTotalLightGainCorrection(1.0); } KVRList* param_list = kvrun->GetLinks("CsIGainCorr"); if (!param_list) { return; } if (!param_list->GetSize()) { return; } TIter next_ps(param_list); KVDBParameterSet* dbps; while ((dbps = (KVDBParameterSet*)next_ps())) { csi = (KVCsI*)fArray->GetDetector(dbps->GetName()); if (!csi) { // the name of the parameter set should be the name of the detector; // however, it may be the name of an acquisition parameter associated with // the detector! KVACQParam* a = fArray->GetACQParam(dbps->GetName()); if (a) csi = (KVCsI*)a->GetDetector(); // still no good ? if (!csi) { Warning("SetCsIGainCorrectionParameters", "Cannot find detector associated with %s", dbps->GetName()); continue; } } csi->SetTotalLightGainCorrection(dbps->GetParameter()); Info("SetCsIGainCorrectionParameters", "%s gain correction = %f", csi->GetName(), csi->GetTotalLightGainCorrection()); } }
void KVINDRAUpDater::SetChVoltParameters(KVDBRun* kvrun) { KVRList* param_list = kvrun->GetLinks("Channel-Volt"); if (!param_list) return; if (!param_list->GetSize()) return; KVDetector* kvd; KVDBParameterSet* kvps; KVCalibrator* kvc; TIter next_ps(param_list); TString str; // Setting Channel-Volts calibration parameters while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres str = kvps->GetName(); str.Remove(str.Sizeof() - 4, 3); //Removing 3 last letters (ex : "_PG") kvd = fArray->GetDetector(str.Data()); if (!kvd) Warning("SetChVoltParameters(UInt_t)", "Dectector %s not found !", str.Data()); else { // detector found kvc = kvd->GetCalibrator(kvps->GetName(), kvps->GetTitle()); if (!kvc) Warning("SetChVoltParameters(UInt_t)", "Calibrator %s %s not found !", kvps->GetName(), kvps->GetTitle()); else { //calibrator found for (Int_t i = 0; i < kvc->GetNumberParams(); i++) { kvc->SetParameter(i, kvps->GetParameter(i)); } kvc->SetStatus(kTRUE); // calibrator ready } //calibrator found } //detector found } //boucle sur les parameters }
void KVINDRAUpDater::SetVoltEnergyChIoSiParameters(KVDBRun* kvrun) { KVRList* param_list = kvrun->GetLinks("Volt-Energy ChIo-Si"); if (!param_list) return; if (!param_list->GetSize()) { return; } KVDetector* kvd; KVDBParameterSet* kvps; KVCalibrator* kvc; TIter next_ps(param_list); // Setting Channel-Volts calibration parameters while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres kvd = fArray->GetDetector(kvps->GetName()); if (!kvd) { /* Warning("SetVoltEnergyParameters(UInt_t)", "Dectector %s not found !", kvps->GetName()); */ } else { // detector found kvc = kvd->GetCalibrator(kvps->GetName(), kvps->GetTitle()); if (!kvc) Warning("SetVoltEnergyParameters(UInt_t)", "Calibrator %s %s not found !", kvps->GetName(), kvps->GetTitle()); else { //calibrator found for (Int_t i = 0; i < kvc->GetNumberParams(); i++) { kvc->SetParameter(i, kvps->GetParameter(i)); } kvc->SetStatus(kTRUE); // calibrator ready } //calibrator found } //detector found } //boucle sur les parameters }
void KVINDRAUpDater_e475s::SetCalibParameters(KVDBRun* kvrun) { KVRList *param_list = kvrun->GetLinks("Calibrations"); if (!param_list) return; if (!param_list->GetSize()) return; //KVDetector *kvd; KVDBParameterSet *kvps; TIter next_ps(param_list); TString str; // Setting all calibration parameters available while ((kvps = (KVDBParameterSet *) next_ps())) { // boucle sur les parametres str = kvps->GetName(); if (gIndra->GetDetector(str.Data())){ if (gIndra->GetDetector(str.Data())->InheritsFrom("KVSilicon_e475s")) { ((KVSilicon_e475s *)gIndra->GetDetector(str.Data()))->SetCalibrator(kvps); } else if (gIndra->GetDetector(str.Data())->InheritsFrom("KVChIo_e475s")){ ((KVChIo_e475s *)gIndra->GetDetector(str.Data()))->SetCalibrator(kvps); } else if (gIndra->GetDetector(str.Data())->InheritsFrom("KVCsI_e475s")){ ((KVCsI_e475s *)gIndra->GetDetector(str.Data()))->SetCalibrator(kvps); } else { Warning("SetCalibParameters(KVDBRun*)", "Calibrator %s %s not found ! ", kvps->GetName(), kvps->GetTitle()); } } //detector found } //boucle sur les parameters }
void KVINDRAUpDater::SetLitEnergyCsIParameters(KVDBRun* kvrun) { // Setting Light- Energy CsI calibration parameters for Z=1 KVRList* param_list = kvrun->GetLinks("Light-Energy CsI Z=1"); if (param_list && param_list->GetSize()) { KVDetector* kvd; KVDBParameterSet* kvps; KVCalibrator* kvc; TIter next_ps(param_list); TString str; while ((kvps = (KVDBParameterSet*) next_ps())) { // boucle sur les parametres str = kvps->GetName(); kvd = fArray->GetDetector(str.Data()); if (!kvd) Warning("SetLitEnergyCsIParameters(UInt_t)", "Dectector %s not found !", str.Data()); else { // detector found kvc = kvd->GetCalibrator(kvps->GetTitle()); if (!kvc) { Warning("SetLitEnergyCsIParameters(UInt_t)", "Calibrator %s %s not found ! - it will be created", kvps->GetName(), kvps->GetTitle()); kvd->SetCalibrators(); kvc = kvd->GetCalibrator(kvps->GetTitle()); } for (Int_t i = 0; i < kvc->GetNumberParams(); i++) { kvc->SetParameter(i, kvps->GetParameter(i)); kvc->SetStatus(kTRUE); // calibrator ready } } //detector found } //boucle sur les parameters } // Setting Light- Energy CsI calibration parameters for Z>1 param_list = kvrun->GetLinks("Light-Energy CsI Z>1"); if (!param_list || !param_list->GetSize()) { return; } KVDetector* kvd; KVDBParameterSet* kvps; KVCalibrator* kvc; TString str; TIter next_ps2(param_list); while ((kvps = (KVDBParameterSet*) next_ps2())) { // boucle sur les parametres str = kvps->GetName(); kvd = fArray->GetDetector(str.Data()); if (!kvd) Warning("SetLitEnergyCsIParameters(UInt_t)", "Dectector %s not found !", str.Data()); else { // detector found kvc = kvd->GetCalibrator(kvps->GetTitle()); if (!kvc) { Warning("SetLitEnergyCsIParameters(UInt_t)", "Calibrator %s %s not found ! - it will be created", kvps->GetName(), kvps->GetTitle()); kvd->SetCalibrators(); kvc = kvd->GetCalibrator(kvps->GetTitle()); } for (Int_t i = 0; i < kvc->GetNumberParams(); i++) { kvc->SetParameter(i, kvps->GetParameter(i)); kvc->SetStatus(kTRUE); // calibrator ready } } //detector found } //boucle sur les parameters }