Changeset 4890


Ignore:
Timestamp:
09/08/04 19:57:18 (20 years ago)
Author:
stamerra
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mpisa/classes
Files:
1 added
2 edited

Legend:

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

    r4196 r4890  
    2929//
    3030// This is the class interpreting and storing the TRIGGER-REPORT information.
    31 //  Updated to add IPR; data format follows TDAS 00-07
     31//  Updated to add IPR; data format follows TDAS 00-07 ver.6.3 jul-04
     32//  http://hegra1.mppmu.mpg.de/MAGIC/private/software/doc/control/tdas0007_v6.3.ps.gz
     33// 
     34//  *Input:
     35//
     36//  The report is divided into 8 sections:
     37//  - the cell rates                       (32 fields)
     38//  - L1 and L2 table name                 ( 2 fields)
     39//  - prescaling factors                  (2x8 fields)
     40//  - livetime and deadtime               (5x4 fields)
     41//  - L2 output bit rates                (20 integers)
     42//  - global rates (before/after presc.)    (2 floats)
     43//  - 18 dummy fields                      (18 fields)
     44//  - IPR                    (325 hexs + 397 integers)
     45//
     46//  *Output:
     47//
     48//  The values read from the report string are used to fill the following
     49//  containers:
     50//  - MTriggerIPR        (Individual Pixel Rates)
     51//  - MTriggerCell       (Rate of trigger cells)
     52//  - MTriggerBit        (Output Bits from prescaler (before and after presc.)
     53//  - MTriggerPrescFact  (Prescaling factors for each bit)
     54//  - MTriggerLiveTime   (Values of counters for dead/livetime)
    3255//
    3356//////////////////////////////////////////////////////////////////////////////
     
    3760
    3861#include "MLogManip.h"
     62
    3963#include "MTriggerIPR.h"
    4064#include "MTriggerCell.h"
     
    4367#include "MTriggerLiveTime.h"
    4468
     69#include "MReportFileRead.h"
     70
    4571ClassImp(MReportTrigger);
    4672
     
    6490//  - MTriggerBit
    6591//  - MTriggerPrescFact
     92//  - MTriggerLiveTime
    6693//
    6794Bool_t MReportTrigger::SetupReading(MParList &plist)
     
    86113  if (!fLiveTime)
    87114    return kFALSE;
     115
    88116 
    89117  return MReport::SetupReading(plist);
    90118}
    91119
    92 // --------------------------------------------------------------------------
    93 //
    94 // Interprete the Cell rates part of the report
     120
     121// --------------------------------------------------------------------------
     122//
     123// Interprete the Cell rates section of the report
    95124//  Read 32 floats separated with a blank
    96125//
     
    113142  str=str.Strip(TString::kLeading); 
    114143
    115       *fLog << warn << "Cell ok!" <<endl;
    116   return kTRUE;
    117 }
    118 
    119 // --------------------------------------------------------------------------
    120 //
    121 // Interprete the Prescaling factors part of the report
     144  return kTRUE;
     145}
     146
     147// --------------------------------------------------------------------------
     148//
     149// Interprete the Prescaling factors section of the report
    122150//
    123151Bool_t MReportTrigger::InterpretePrescFact(TString &str)
     
    127155 
    128156  str.Remove(0, 1);
    129   *fLog << warn << str<<endl;
    130157
    131158  for (i=0;i<gsNPrescFacts;i++)
     
    157184// --------------------------------------------------------------------------
    158185//
    159 // Interprete the Scaler with Live-Deadtime part of the report
     186// Interprete the Scaler with Live-Deadtime section of the report
    160187//  Read 4x5 integers separated with a blank
    161188//
     
    190217// --------------------------------------------------------------------------
    191218//
    192 // Interprete the Bit rates part of the report
     219// Interprete the Bit rates section of the report
    193220// 20 integers. First and last two are not used
    194221//
     
    260287// --------------------------------------------------------------------------
    261288//
    262 // Interprete a part of the report without meaning by this time
     289// Interprete an unused section of the report
    263290// 18 integers
    264291//
     
    282309  str=str.Strip(TString::kLeading); 
    283310
    284   return kTRUE;
    285 }
    286 
    287 // --------------------------------------------------------------------------
    288 //
    289 // Interprete the IPR part of the report
     311
     312  return kTRUE;
     313}
     314
     315// --------------------------------------------------------------------------
     316//
     317// Interprete the IPR section of the report
    290318//
    291319Bool_t MReportTrigger::InterpreteIPR(TString &str)
     
    303331//  Read comments for details
    304332//
    305 Int_t MReportTrigger::InterpreteBody(TString &str)
    306 {
     333Int_t MReportTrigger::InterpreteBody(TString &str, Int_t ver )
     334{
     335
    307336    str = str.Strip(TString::kLeading);
    308337 
     
    318347    TString tablename = str(0, ws);
    319348    str.Remove(0, ws);
     349
     350    // Check the Version of CC file, and takes care of the differences
     351    // introduced in the format of the report.
     352
     353    //if (ver<)....
     354       
     355    // Check the length of the report to take care of the differences
     356    // introduced in the format of the report (!Preliminary! the
     357    // Version number of the CC file should be used instead)
     358
     359    if (str.Length() < 1000)
     360      {
     361        *fLog << warn << " TRIGGER-REPORT: old report without IPRs" <<endl;
     362        return InterpreteOldBody(str);
     363      }
    320364
    321365    // Read the cell rates (32 fields)
     
    384428    return str==(TString)"OVER" ? kTRUE : kCONTINUE;
    385429}
     430
     431
     432// --------------------------------------------------------------------------
     433//
     434// Interprete the body of the TRIGGER-REPORT string
     435//  for OLD runs (older than may-04)
     436//
     437Bool_t MReportTrigger::InterpreteOldBody(TString &str)
     438{
     439
     440  Int_t len, n;
     441  Float_t fPrescalerRates[100];
     442
     443    const char *pos = str.Data();
     444    for (int i=0; i<19; i++)
     445      {
     446        n = sscanf(pos, " %f %n", &fPrescalerRates[i], &len);
     447        if (n!=1)
     448          {
     449            *fLog << warn << "WARNING - Scaler Value #" << i << " missing." << endl;
     450            return kCONTINUE;
     451          }
     452        pos += len;
     453      }
     454
     455    n = sscanf(pos, " %f %f %n", &fL2BeforePrescaler, &fL2AfterPrescaler, &len);    if (n!=2)
     456      {
     457        *fLog << warn << "WARNING - Couldn't read Trigger rates." << endl;
     458        return kFALSE;
     459      }
     460    pos += len;
     461    for (int i=0; i<11; i++)
     462      {
     463        Float_t dummy;
     464        n = sscanf(pos, " %f %n", &dummy/*fRates[i]*/, &len);
     465        if (n!=1)
     466          {
     467            *fLog << warn << "WARNING - Rate #" << i << " missing." << endl;
     468            return kFALSE;
     469          }
     470        pos += len;
     471      }
     472    str.Remove(0, pos-str.Data());
     473    str.Strip(TString::kBoth);
     474   
     475    return str==(TString)"OVER" ? kTRUE : kCONTINUE;
     476}
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/MReportTrigger.h

    r4196 r4890  
    3939  Bool_t InterpreteL1L2Table(TString &str);
    4040
    41   Int_t InterpreteBody(TString &str);
     41  Int_t InterpreteBody(TString &str, Int_t ver);
    4242 
     43  Bool_t InterpreteOldBody(TString &str);
     44
    4345public:
    4446    MReportTrigger();
Note: See TracChangeset for help on using the changeset viewer.