Example #1
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);
   }

}
Example #2
0
//________________________________________________________________
Bool_t KVFAZIADetector::Fired(Option_t *)
{
    // Returns kTRUE if detector was hit (fired) in an event
    //
    // The actual meaning of hit/fired depends on the context and the option string opt.
    //
    // If the detector is in "simulation mode", i.e. if SetSimMode(kTRUE) has been called,
    // this method returns kTRUE if the calculated energy loss in the active layer is > 0.
    //
    // In "experimental mode" (i.e. IsSimMode() returns kFALSE), depending on the option:
    //
 	 //Info("Fired","Appel - %s",GetName());	
    if (!IsDetecting()) return kFALSE; //detector not working, no answer at all
    if (IsSimMode()) return (GetActiveLayer()->GetEnergyLoss()>0.); // simulation mode: detector fired if energy lost in active layer
	 KVSignal* sig;	
	 if (fSignals){
    	TIter next(fSignals);
    	while ( (sig = (KVSignal* )next()) )
    	{
    		if (sig->GetN()>0){
      		if (!strcmp(sig->GetTitle(),"Charge") && sig->GetRawAmplitude()>20){
         		return kTRUE;
         	}
         	else{
      		}
      	}
         else{
         	Warning("Fired","%s has empty signal %s",GetName(),sig->GetName());
         }
      }
    }
    else{
    	Warning("Fired","%s : No signal attached to this detector ...",GetName());
      return kFALSE;
    }
    return kFALSE;
}