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;
            }
         }
      }
   }
}
Exemplo n.º 2
0
YESorNO
match_pattern(const char *s, const char *pattern)
{
    const char *org_s;
    const char *org_pattern;

    org_s = s;
    org_pattern = pattern;

    s = next_s(s-1);
    for ( ; (*pattern != '\0'); ++pattern)
    {
        switch(*pattern)
        {
        case 'a':			/* single letter */
            if (!Isalpha((int)*s))
                RETURN_MATCH_FAILURE("single letter");
            s = next_s(s);
            break;

        case 'A':			/* one or more letters */
            if (!Isalpha((int)*s))
                RETURN_MATCH_FAILURE("one or more letters");
            while (Isalpha((int)*s))
                s = next_s(s);
            break;

        case 'd':
            if (!Isdigit((int)*s))	/* single digit */
                RETURN_MATCH_FAILURE("single digit");
            s = next_s(s);
            break;

        case 'D':			/* one or more digits */
            if (!Isdigit((int)*s))
                RETURN_MATCH_FAILURE("one or more digits");
            while (Isdigit((int)*s))
                s = next_s(s);
            break;

        case 'r':			/* single roman numeral */
            if (!is_roman((int)*s))
                RETURN_MATCH_FAILURE("single roman numeral");
            s = next_s(s);
            break;

        case 'R':			/* one or more roman numerals */
            if (!is_roman((int)*s))
                RETURN_MATCH_FAILURE("one or more roman numerals");
            while (is_roman((int)*s))
                s = next_s(s);
            break;

        case 'w':			/* one word (letters and digits) */
            if (!Isalnum((int)*s))
                RETURN_MATCH_FAILURE("one word (letters and digits)");
            while (Isalnum((int)*s))
                s = next_s(s);
            break;

        case 'W':			/* one or more space-separated words */
            if (!Isalnum((int)*s))
                RETURN_MATCH_FAILURE("one or more space-separated words");
            while (Isalnum((int)*s))		/* parse first word */
                s = next_s(s);
            for (;;)
            {
                if (!Isspace((int)*s))
                    break;
                while (Isspace((int)*s))	/* parse separators */
                    s = next_s(s);
                while (Isalnum((int)*s))	/* parse another word */
                    s = next_s(s);
            }
            break;

        case 'X':		/* one or more special-separated words */
            if (!Isalnum((int)*s))
                RETURN_MATCH_FAILURE("one or more special-separated words");
            while (Isalnum((int)*s))		/* parse first word */
                s = next_s(s);
            for (;;)
            {
                if (!is_special(*s))
                    break;
                while (is_special(*s))	/* parse separators */
                    s = next_s(s);
                while (Isalnum((int)*s))	/* parse another word */
                    s = next_s(s);
            }
            break;

        case ' ':			/* one or more whitespace characters */
            if (!Isspace((int)*s))
                RETURN_MATCH_FAILURE("one or more whitespace characters");
            while (Isspace((int)*s))
                s = next_s(s);
            break;

        case '.':			/* exactly one special character */
            if (!is_special(*s))
                RETURN_MATCH_FAILURE("exactly one special character");
            s = next_s(s);		/* [07-Mar-1999] bug fix: missing before bibclean 2.12 */
            break;

        case ':':			/* one or more special characters */
            if (!is_special(*s))
                RETURN_MATCH_FAILURE("one or more special characters");
            while (is_special(*s))
                s = next_s(s);
            break;

        case '\\':			/* literal next character */
            pattern++;
            /* fall through to exact match test */
            /*@fallthrough@*/ /*FALLTHROUGH*/

        default:			/* anything else: exact match */
            if (*pattern != *s)
                RETURN_MATCH_FAILURE("anything else: exact match");
            s = next_s(s);
        }				/* end switch */
    }					/* end for (; ;) */
    if (*s == '\0')
        return (YES);
    else
        RETURN_MATCH_FAILURE("end of string");
}