Changeset 4919 for trunk/MagicSoft


Ignore:
Timestamp:
09/10/04 11:58:22 (20 years ago)
Author:
stamerra
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/MReportTrigger.cc

    r4917 r4919  
    317317//
    318318// Interprete the IPR section of the report
    319 //
     319//   sep-04
     320//   The IPR are saved as 340 (=number of pixs in trigger area) hex numbers
     321//   and as 397 (= #pixs in inner region) dec numbers.
     322//   Only the dec numbers are now saved in the MTriggerIPR container.
     323// 
     324
    320325Bool_t MReportTrigger::InterpreteIPR(TString &str)
    321326{
    322327
    323     // Read Individual pixel rates
    324     const char *pos = str.Data();
    325     const char *end = str.Data() + 340*8;
    326  
    327     Int_t i=0,n,len;
    328     short dummy;
    329     while (pos < end)
    330     {
    331         const Char_t hex[9] = { pos[0], pos[1], pos[2], pos[3],pos[4],pos[5],pos[6],pos[7],0 };
    332         n = sscanf(hex, "%hx", &dummy);
    333         pos+=8;
    334         if (n!=1)
     328  Int_t gsNhexIPR=340; //number of IPR saved in hex format
     329  Int_t gsNdecIPR=397; //number of IPR saved in dec format
     330 
     331  // Read Individual pixel rates in hex format
     332  const char *pos = str.Data();
     333  const char *end = str.Data() + gsNhexIPR*8;
     334 
     335  Int_t i=0,n,len;
     336  short dummy;
     337  while (pos < end)
     338    {
     339      const Char_t hex[9] = { pos[0], pos[1], pos[2], pos[3],pos[4],pos[5],pos[6],pos[7],0 };
     340      n = sscanf(hex, "%hx", &dummy);
     341      pos+=8;
     342      if (n!=1)
    335343        {
    336             *fLog << warn << "WARNING - Rate #" << i << " missing." << endl;
    337             return kFALSE;
     344          *fLog << warn << "WARNING - Rate #" << i << " missing." << endl;
     345          return kFALSE;
    338346        }
    339         *fLog << warn << " " << hex ;
    340     }
    341     *fLog <<endl;
    342 
    343 
    344     str.Remove(0, end-str.Data()); // Remove IPR hex  from report string
    345     str.Strip(TString::kBoth);
    346 
     347    }
    347348   
    348     *fLog << warn << "string: " << str << " ==== " <<str.Data() << endl;
    349 
    350   for (i=0;i<397;i++)
    351     {
    352       n = sscanf(str.Data(), " %ld %n", &fIPR->fIPR[i++], &len);
     349  str.Remove(0, end-str.Data()); // Remove IPR hex  from report string
     350  str.Strip(TString::kBoth);
     351 
     352  // ------ 
     353  // Read Individual pixel rates in dec format
     354  // and save them in the MTriggerIPR container
     355 
     356  for (i=0;i<gsNdecIPR;i++)
     357    {
     358      n = sscanf(str.Data(), " %ld %n", &fIPR->fIPR[i], &len);
    353359      if (n!=1)
    354360        {
     
    356362          return kCONTINUE;
    357363        }
    358       str.Remove(0, len); // Remove IPR dec from report string
    359 
    360       *fLog << warn<< " - " << dummy ;
    361     }
    362 
     364      str.Remove(0, len); // Remove IPR dec from report string     
     365    }
     366 
    363367  str=str.Strip(TString::kLeading); 
    364    
    365 
    366   *fLog << warn << "IPR ok!" <<endl;
     368
    367369  return kTRUE;
    368370}
Note: See TracChangeset for help on using the changeset viewer.