Bool_t ExampleFilteredSimDataAnalysis::Analysis()
{
   // EVENT BY EVENT ANALYSIS

   // Reject events with less good particles than acquisition trigger for run
   if (!GetEvent()->IsOK()) return kTRUE;

   mult = GetEvent()->GetMult("ok");

   // if we can access the events of the unfiltered simulation, read in the event corresponding
   // to the currently analysed reconstructed event
   if (link_to_unfiltered_simulation) GetFriendTreeEntry(GetEvent()->GetParameters()->GetIntValue("SIMEVENT_TREE_ENTRY"));

   for (int i = 0; i < mult; i++) {
      KVReconstructedNucleus* part = (KVReconstructedNucleus*)ZMAX->GetZmax(i);
      Z[i] = part->GetZ();
      A[i] = part->GetA();
      idcode[i] = part->GetIDCode();
      ecode[i] = part->GetECode();
      Ameasured[i] = part->IsAMeasured();
      // Example for events filtered with FAZIA@INDRA set-up
      if (part->GetParameters()->GetTStringValue("ARRAY") == "INDRA") array[i] = 0;
      else if (part->GetParameters()->GetTStringValue("ARRAY") == "FAZIA") array[i] = 1;
      else array[i] = -1;
      Vper[i] = part->GetFrame("cm")->GetVperp();
      Vpar[i] = part->GetFrame("cm")->GetVpar();
      ELab[i] = part->GetEnergy();
      ThetaLab[i] = part->GetTheta();
      PhiLab[i] = part->GetPhi();
      // if we can access the events of the unfiltered simulation, and if Gemini++ was used
      // to decay events before filtering, this is how you can access the "parent" nucleus
      // of the current detected decay product
      // KVSimNucleus* papa = (KVSimNucleus*)GetFriendEvent()->GetParticle( part->GetParameters()->GetIntValue("GEMINI_PARENT_INDEX") );
   }

   GetGVList()->FillBranches();
   FillTree();

   return kTRUE;
}