Esempio n. 1
0
void KVINDRAReconEvent::AcceptECodes(UChar_t code)
{
   //Define the calibration codes that you want to include in your analysis.
   //Example: to keep only ecodes 1 and 2, use
   //        event.AcceptECodes( kECode2 | kECode3 );
   //Particles which have the correct E codes will have IsOK() = kTRUE
   //i.e.  if( particle.IsOK() ) { // ... analysis ... }
   //although it is easier to loop over all 'correct' particles using:
   //   while ( particle = GetNextParticle("ok") ){ // ... analysis ... }
   //
   //N.B. : this method is preferable to using directly the KVINDRACodeMask pointer
   //as the 'IsOK' status of all particles of the current event are automatically updated
   //when the code mask is changed using this method.
   GetCodeMask()->SetEMask(code);
   KVINDRAReconNuc *par = 0;
   while ((par = GetNextParticle())) {
      if (CheckCodes(par->GetCodes()))
         par->SetIsOK();
      else
         par->SetIsOK(kFALSE);
   }
}
Esempio n. 2
0
void KVINDRAReconEvent::Streamer(TBuffer & R__b)
{
   //Stream an object of class KVINDRAReconEvent.
   //We loop over the newly-read particles in order to set their
   //IsOK() status by comparison with the event's code mask.

    if (R__b.IsReading()) {
        R__b.ReadClassBuffer(KVINDRAReconEvent::Class(), this);
        KVINDRAReconNuc *par;
        while ((par = GetNextParticle())) {
            par->SetIsOK(CheckCodes(par->GetCodes()));
        }
    } else {
        R__b.WriteClassBuffer(KVINDRAReconEvent::Class(), this);
    }
}