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);
   }

}
void KVFAZIARawDataReconstructor::ExtraProcessing()
{
   KVString label = "";

   KVFAZIADetector* det = 0;
   KVSignal* sig = 0;
   KVReconstructedNucleus* recnuc = 0;
   while ((recnuc = recev->GetNextParticle())) {
      TIter next_d(recnuc->GetDetectorList());
      while ((det = (KVFAZIADetector*)next_d())) {
         TIter next_s(det->GetListOfSignals());
         while ((sig = (KVSignal*)next_s())) {
            if (sig->HasFPGA()) {
               for (Int_t ii = 0; ii < sig->GetNFPGAValues(); ii += 1) {
                  //SI2-T3-Q1-B003.Q2.RawAmplitude=14
                  if (ii == 0) label = "FPGAEnergy";
                  if (ii == 1) label = "FPGAFastEnergy"; //only for CsI Q3
                  TString ene = GetEvent()->GetFPGAEnergy(
                                   det->GetBlockNumber(),
                                   det->GetQuartetNumber(),
                                   det->GetTelescopeNumber(),
                                   sig->GetType(),
                                   ii
                                );

                  recnuc->GetParameters()->SetValue(
                     Form("%s.%s.%s", det->GetName(), sig->GetName(), label.Data()),
                     ene.Data()
                  );
               }
            }
            if (!sig->PSAHasBeenComputed()) {
               sig->TreateSignal();
            }

            KVNameValueList* psa = sig->GetPSAResult();
            if (psa) {
               *(recnuc->GetParameters()) += *psa;
               delete psa;
            }
         }
      }
   }
}