示例#1
0
void KVINDRAUpDater_e475s::SetCalibrationParameters(UInt_t run){


    //Set calibration parameters for this run.
    //This will:
    //      remove all the calibrators of all the detectors ready to receive the calibrators for the run (handled by child classes),
    //      set calibration parameters for the run
    //      set pedestals for the run
    
    cout << "Setting calibration parameters of INDRA array for run " << run << ":" <<
    endl;
    KVDBRun *kvrun = gIndraDB->GetRun(run);
    if (!kvrun)
    {
        Error("SetParameters(UInt_t)", "Run %u not found in database!", run);
        return;
    }
    //Reset all calibrators of all detectors first
    TIter next(gIndra->GetListOfDetectors());
    KVDetector *kvd;
    while ((kvd = (KVDetector *) next()))
    {
      if (kvd->InheritsFrom("KVSiLi") || kvd->InheritsFrom("KVSi75")){
		 	if (kvd->GetListOfCalibrators())
			kvd->RemoveCalibrators();
		 	kvd->SetCalibrators();
		  }
		 else {
		  if (kvd->GetListOfCalibrators())
        {
            kvd->RemoveCalibrators();
				TIter lacq(kvd->GetACQParamList());
				KVACQParam* acq = 0;
				while ( (acq = (KVACQParam* )lacq()) ){
					acq->SetPedestal(0);
				}
		  }
    	}
	 }
    SetCalibParameters(kvrun);
    SetPedestals(kvrun);

}
示例#2
0
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
}