コード例 #1
0
ファイル: KVGeoImport.cpp プロジェクト: pwigg/kaliveda
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;
}
コード例 #2
0
ファイル: KVFAZIA.cpp プロジェクト: GiuseppePast/kaliveda
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);
   }

}