Ejemplo n.º 1
0
//___________________________________________________________________________________________
void KVIDTelescope::Print(Option_t* opt) const
{
   // print out telescope structure
   //if opt="fired" only fired detectors are printed

   TIter next(fDetectors);
   KVDetector* obj;

   if (!strcmp(opt, "fired")) {
      while ((obj = (KVDetector*) next())) {

         if (obj->Fired() || obj->GetEnergy())
            obj->Print("data");
      }
   } else {
      cout << "\n" << opt << "Structure of KVIDTelescope object: " <<
           GetName() << " " << GetType() << endl;
      cout << opt <<
           "--------------------------------------------------------" <<
           endl;
      while ((obj = (KVDetector*) next())) {
         cout << opt << "Detector: " << obj->GetName() << endl;
      }
   }
}
Ejemplo n.º 2
0
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());
      }
   }
}
Ejemplo n.º 3
0
void KVGeoImport::ParticleEntersNewVolume(KVNucleus *)
{
    // All detectors crossed by the particle's trajectory are added to the multidetector
    // and the groups (KVGroup) of aligned detectors are set up

    KVDetector* detector = GetCurrentDetector();
    if(!detector) return;
	 Bool_t group_inconsistency = kFALSE;
    if(fCreateArray){
        if(!fCurrentGroup){
            if(detector->GetGroup()) {
                fCurrentGroup=detector->GetGroup();
            }
            else {
                fCurrentGroup = new KVGroup;
                fCurrentGroup->SetNumber(++fGroupNumber);
                fCurrentGroup->Add(detector);
                fArray->Add(fCurrentGroup);
            }
        }
        else
        {
            KVGroup* det_group = detector->GetGroup();
            if(!det_group) {
                fCurrentGroup->Add(detector);
            }
            else {
                if(det_group!=fCurrentGroup){
//                     Warning("ParticleEntersNewVolume",
//                             "Detector %s : already belongs to %s, now seems to be in %s",
//                             detector->GetName(), det_group->GetName(),
//                             fCurrentGroup->GetName());
						  group_inconsistency = kTRUE;
					 }
            }
        }
    }
    detector->GetNode()->SetName(detector->GetName());
	 if(fLastDetector && detector!=fLastDetector && !group_inconsistency) {
        fLastDetector->GetNode()->AddBehind(detector);
        detector->GetNode()->AddInFront(fLastDetector);
    }
    fLastDetector = detector;
}
Ejemplo n.º 4
0
void KVFAZIA::GetDetectorEvent(KVDetectorEvent* detev, TSeqCollection* signals)
{
   // First step in event reconstruction based on current status of detectors in array.
   // Fills the given KVDetectorEvent with the list of all groups which have fired.
   // i.e. loop over all groups of the array and test whether KVGroup::Fired() returns true or false.
   //
   // If the list of fired acquisition parameters 'signals' is given, KVMultiDetArray::GetDetectorEvent
   // is called
   //

   if (signals) {
      // list of fired acquisition parameters given
      TIter next_par(signals);

      KVSignal* par = 0;
      KVDetector* det = 0;
      KVGroup* grp = 0;
      while ((par = (KVSignal*)next_par())) {
         if (!(par->GetN() > 0))
            Info("GetDetectorEvent", "%s empty", par->GetName());
         par->DeduceFromName();
         if ((det = GetDetector(par->GetDetectorName()))) {
            ((KVFAZIADetector*)det)->SetSignal(par, par->GetType());
            if ((!(((KVFAZIADetector*)det)->GetSignal(par->GetType())->GetN() > 0)))
               Warning("Error", "%s %s empty signal is returned", det->GetName(), par->GetType());
            if ((grp = det->GetGroup())  && !detev->GetGroups()->FindObject(grp)) {
               detev->AddGroup(grp);
            }
         } else {
            Error("GetDetectedEvent", "Unknown detector %s !!!", par->GetDetectorName());
         }
      }
   } else {
      KVMultiDetArray::GetDetectorEvent(detev, 0);
   }

}
Ejemplo n.º 5
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);



}