Пример #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::CheckStatusOfDetectors(KVDBRun* kvrun)
{

   KVRList* absdet = kvrun->GetLinks("Absent Detectors");
   KVRList* oooacq = kvrun->GetLinks("OoO ACQPars");
   KVRList* ooodet = kvrun->GetLinks("OoO Detectors");

   TIter next(fArray->GetDetectors());
   KVDetector* det;
   KVACQParam* acq;

   Int_t ndet_absent = 0;
   Int_t ndet_ooo = 0;
   Int_t nacq_ooo = 0;

   while ((det = (KVDetector*)next())) {
      //Test de la presence ou non du detecteur
      if (!absdet) {
         det->SetPresent();
      }
      else {
         if (absdet->FindObject(det->GetName(), "Absent Detector")) {
            det->SetPresent(kFALSE);
            ndet_absent += 1;
         }
         else {
            det->SetPresent();
         }
      }
      if (det->IsPresent()) {
         //Test du bon fonctionnement ou non du detecteur
         if (!ooodet) {
            det->SetDetecting();
         }
         else {
            if (ooodet->FindObject(det->GetName(), "OoO Detector")) {
               det->SetDetecting(kFALSE);
               ndet_ooo += 1;
            }
            else {
               det->SetDetecting();
            }
         }
         //Test du bon fonctionnement ou non des parametres d acquisition
         if (det->IsDetecting()) {
            TIter next_acq(det->GetACQParamList());
            if (!oooacq) {
               while ((acq = (KVACQParam*)next_acq())) {
                  acq->SetWorking();
               }
            }
            else {
               Int_t noff = 0;
               while ((acq = (KVACQParam*)next_acq())) {
                  if (oooacq->FindObject(acq->GetName(), "OoO ACQPar")) {
                     acq->SetWorking(kFALSE);
                     noff += 1;
                     nacq_ooo += 1;
                  }
                  else {
                     acq->SetWorking();
                  }
               }
               if (noff == 3) {
                  det->SetDetecting(kFALSE);
                  ndet_ooo += 1;
                  nacq_ooo -= 3;
               }
            }
         }
      }
   }

   Info("KVINDRAUpDater", "%d detecteurs absents", ndet_absent);
   Info("KVINDRAUpDater", "%d detecteurs ne fonctionnent pas", ndet_ooo);
   Info("KVINDRAUpDater", "%d parametres d acquisition ne fonctionnent pas", nacq_ooo);



}