Changeset 4196 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
05/26/04 18:14:22 (21 years ago)
Author:
stamerra
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mpisa
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mpisa/Changelog_pisa

    r4185 r4196  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20 2004/05/24: Antonio Stamerra
     21
     22   * mpisa/classes/mtrigger/*, mpisa/classes/MTriggerReport.[h,cc]
     23     - classes almost completed; compiles. 
     24       
     25
    2026 2004/05/24: Antonio Stamerra
    2127
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/MReportTrigger.cc

    r4195 r4196  
    126126  Int_t gsNPrescFacts=8;
    127127 
    128       *fLog << warn << "Presca"<<endl;
     128  str.Remove(0, 1);
     129  *fLog << warn << str<<endl;
     130
    129131  for (i=0;i<gsNPrescFacts;i++)
    130132    {
    131133    const Int_t ws = str.First(' ');
    132     *fLog << str << endl;
    133 
    134134    if (ws<=0)
    135135       {
    136         *fLog << warn << "WARNING - Cannot determine name of L1 trigger table." << endl;
     136         *fLog << warn << "WARNING - Cannot determine Prescaling factor #" << i << " descriptor" << endl;
    137137        return kCONTINUE;
    138138       }
    139    
    140     TString L1tablename = str(0, ws);
    141     *fLog << "Presc " <<L1tablename <<endl;
     139    TString descriptor = str(0, ws);
     140    *fLog  << descriptor <<endl;
    142141    str.Remove(0, ws);
    143142     
    144143      n = sscanf(str.Data(), " %li %n", &fPrescFactor->fPrescFact[i], &len);
    145       if (n!=2)
     144      if (n!=1)
    146145        {
    147146          *fLog << warn << "WARNING - prescaler factor " << i << " missing." << endl;
     
    153152  str=str.Strip(TString::kLeading); 
    154153 
    155   *fLog << warn << "PrescFact ok!" <<endl;
    156154  return kTRUE;
    157155}
     
    166164  Int_t len, n, i=0;
    167165  Int_t gsNScalers=5;
    168   Int_t D_LSB, D_MSB,L_LSB, L_MSB;
    169 
    170   const char *pos = str.Data();
    171   const char *end = str.Data() + gsNScalers;
    172 
    173   while (pos < end)
    174     {
    175       i++;
    176       n = sscanf(pos, " %d %d %d %d %n", &L_LSB, &L_MSB,&D_LSB, &D_MSB, &len);
     166  Int_t  dLSB, dMSB,lLSB, lMSB;
     167
     168  for (i=0;i<gsNScalers;i++)
     169    {
     170      n = sscanf(str.Data(), " %d %d %d %d %n", &lLSB, &lMSB,&dLSB, &dMSB, &len);
    177171      if (n!=4)
    178172        {
     
    180174          return kCONTINUE;
    181175        }
    182       pos += len;
     176
     177      str.Remove(0, len); // Remove Live-Deadtimes from string
    183178
    184179      //convert to seconds and fill container
    185180      // (FIXME! only the MSB (seconds is now considered)
    186       fLiveTime->fLiveTime[i] = L_MSB;
    187       fLiveTime->fDeadTime[i] = D_MSB;     
    188     }
    189 
    190   str.Remove(0, end-str.Data()); // Remove Live-Deadtimes from report string
    191   str=str.Strip(TString::kLeading); 
    192 
    193   *fLog << warn << "LiveTime ok!" <<endl;
     181      (fLiveTime->fLiveTime)[i] = lMSB;
     182      (fLiveTime->fDeadTime)[i] = dMSB;     
     183    }
     184
     185  str=str.Strip(TString::kLeading); 
     186
    194187  return kTRUE;
    195188}
     
    205198  Int_t gsNBits=20;
    206199 
    207   const char *pos = str.Data();
    208   const char *end = str.Data() + gsNBits;
    209 
    210   while (pos < end)
    211     {
    212       n = sscanf(pos, " %f %n", &fBit->fBit[i++], &len);
     200  for (i=0;i<gsNBits;i++)
     201    {
     202      n = sscanf(str.Data(), " %f %n", &fBit->fBit[i], &len);
    213203      if (n!=1)
    214204        {
     
    216206          return kCONTINUE;
    217207        }
    218       pos += len;
    219     }
    220 
    221   str.Remove(0, end-str.Data()); // Remove output bit rates from report string
    222   str=str.Strip(TString::kLeading); 
    223 
    224   *fLog << warn << "Bit ok!" <<endl;
     208      str.Remove(0, len); // Remove output bit rates from string
     209    }
     210
     211  str=str.Strip(TString::kLeading); 
     212
    225213  return kTRUE;
    226214}
     
    242230   
    243231    TString L1tablename = str(0, wsL1);
    244     *fLog << "L1: " <<L1tablename <<endl;
    245232    str.Remove(0, wsL1);
    246233
     
    265252      }   
    266253    TString L2tablename = str(0, wsL2);
    267     *fLog << "L2: " <<L2tablename <<endl;
    268254    str.Remove(0,wsL2);
    269255    str.Strip(TString::kBoth);
     
    283269  Int_t dummy; 
    284270
    285   const char *pos = str.Data();
    286   const char *end = str.Data() + gsNDummies;
    287 
    288   while (pos < end)
    289     {
    290       n = sscanf(pos, " %d %n", &dummy, &len);
     271  for (i=0;i<gsNDummies;i++)
     272    {
     273      n = sscanf(str.Data(), " %d %n", &dummy, &len);
    291274      if (n!=1)
    292275        {
     
    294277          return kCONTINUE;
    295278        }
    296       pos += len;
    297     }
    298 
    299   str.Remove(0, end-str.Data()); // Remove dummies from report string
    300   str=str.Strip(TString::kLeading); 
    301 
    302   *fLog << warn << "Dummy ok!" <<endl;
     279      str.Remove(0, len); // Remove dummies from report string
     280    }
     281
     282  str=str.Strip(TString::kLeading); 
     283
    303284  return kTRUE;
    304285}
     
    378359
    379360    /*
    380     for (int i=0; i < 19; i++)
    381     {
    382         n = sscanf(pos, " %f %n", &fPrescalerRates[i], &len);
    383         if (n!=1)
    384         {
    385             *fLog << warn << "WARNING - Cell Scaler Value #" << i << " missing." << endl;
    386             return kCONTINUE;
    387         }
    388         pos += len;
    389     }
    390     n = sscanf(pos, " %f %f %n", &fL2BeforePrescaler, &fL2AfterPrescaler, &len);
    391     if (n!=2)
    392     {
    393         *fLog << warn << "WARNING - Couldn't read Trigger rates." << endl;
    394         return kFALSE;
    395     }
    396     pos += len;
    397     */
    398                            /*
    399361
    400362    // Read Individual pixel rates
     
    415377    }
    416378
    417                            */
     379    */
    418380
    419381    str.Remove(0,len);
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/MReportTrigger.h

    r4195 r4196  
    1919{
    2020private:
    21   Byte_t fStatus;    // Trigger status
    2221 
    23   Float_t fL2BeforePrescaler; // L2 trigger rate before prescaler
    24   Float_t fL2AfterPrescaler;  // L2 trigger rate after prescaler
     22  Float_t fL2BeforePrescaler; //! L2 trigger rate before prescaler
     23  Float_t fL2AfterPrescaler;  //! L2 trigger rate after prescaler
    2524 
    26   MTriggerBit *fBit;        // container of the L2 prescaler rates
    27   MTriggerIPR *fPixel;      // container of the IPR
    28   //TArrayF fRates;            //[Hz] IPR (Individual Pixel Rates)
    29   MTriggerCell *fCell;      // container of the L1 cell trigger rates
    30   MTriggerPrescFact *fPrescFactor;   //container of the L2 prescaling factors
    31   MTriggerLiveTime *fLiveTime; //container of the scaler live-deadtime
     25  MTriggerBit *fBit;        //! container of the L2 prescaler rates
     26  MTriggerIPR *fPixel;      //! container of the IPR
     27  MTriggerCell *fCell;      //! container of the L1 cell trigger rates
     28  MTriggerPrescFact *fPrescFactor;  //! container of the L2 prescaling factors
     29  MTriggerLiveTime *fLiveTime; //! container of the scaler live-deadtime
    3230 
    3331  Bool_t SetupReading(MParList &plist);
     
    4644    MReportTrigger();
    4745
    48     Byte_t GetStatus() const { return fStatus; }
    49 
    5046    Float_t GetL2BeforePrescaler() const { return fL2BeforePrescaler; }
    5147    Float_t GetL2AfterPrescaler() const { return fL2AfterPrescaler; }
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/mtrigger/MTriggerBit.h

    r4195 r4196  
    1818
    1919private:
    20     Byte_t  fStatus;        // Monitor of the L2T status
    2120   
    2221    static const Int_t gsNBits=20;        // number of output bits
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/mtrigger/MTriggerCell.h

    r4185 r4196  
    1717    friend class MReportTrigger;
    1818private:
    19     Byte_t  fStatus;         // Monitor of the L2T status
    20 
    2119    static const Int_t gsNCells=32; //Number of fields with cell rates
    2220                                    // 19 cells and 12 dummy
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/mtrigger/MTriggerIPR.h

    r4185 r4196  
    1717    friend class MReportTrigger;
    1818private:
    19     Byte_t  fStatus;        // Monitor of the L2T status
    20 
    2119    TArrayL fIPR;            // [Hz] IPR (Individual Pixel Rates)
    2220   
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/mtrigger/MTriggerLiveTime.h

    r4185 r4196  
    1818
    1919private:
    20     Byte_t  fStatus;        // Monitor of the L2T status
    21    
    2220    static const Int_t gsNScalers=5;        // number of scalers
    2321
     
    2624
    2725public:
    28     MTriggerLiveTime() : fLiveTime(gsNScalers) 
     26    MTriggerLiveTime() : fLiveTime(gsNScalers), fDeadTime(gsNScalers) 
    2927    {
    3028        fName  = "MTriggerLiveTime";
  • trunk/MagicSoft/Mars/mtemp/mpisa/classes/mtrigger/MTriggerPrescFact.h

    r4185 r4196  
    1818
    1919private:
    20     Byte_t  fStatus;        // Monitor of the L2T status
    2120   
    2221    static const Int_t gsNPrescFacts=8;        // number of factors
Note: See TracChangeset for help on using the changeset viewer.