Changeset 4890
- Timestamp:
- 09/08/04 19:57:18 (20 years ago)
- 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 29 29 // 30 30 // 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) 32 55 // 33 56 ////////////////////////////////////////////////////////////////////////////// … … 37 60 38 61 #include "MLogManip.h" 62 39 63 #include "MTriggerIPR.h" 40 64 #include "MTriggerCell.h" … … 43 67 #include "MTriggerLiveTime.h" 44 68 69 #include "MReportFileRead.h" 70 45 71 ClassImp(MReportTrigger); 46 72 … … 64 90 // - MTriggerBit 65 91 // - MTriggerPrescFact 92 // - MTriggerLiveTime 66 93 // 67 94 Bool_t MReportTrigger::SetupReading(MParList &plist) … … 86 113 if (!fLiveTime) 87 114 return kFALSE; 115 88 116 89 117 return MReport::SetupReading(plist); 90 118 } 91 119 92 // -------------------------------------------------------------------------- 93 // 94 // Interprete the Cell rates part of the report 120 121 // -------------------------------------------------------------------------- 122 // 123 // Interprete the Cell rates section of the report 95 124 // Read 32 floats separated with a blank 96 125 // … … 113 142 str=str.Strip(TString::kLeading); 114 143 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 122 150 // 123 151 Bool_t MReportTrigger::InterpretePrescFact(TString &str) … … 127 155 128 156 str.Remove(0, 1); 129 *fLog << warn << str<<endl;130 157 131 158 for (i=0;i<gsNPrescFacts;i++) … … 157 184 // -------------------------------------------------------------------------- 158 185 // 159 // Interprete the Scaler with Live-Deadtime partof the report186 // Interprete the Scaler with Live-Deadtime section of the report 160 187 // Read 4x5 integers separated with a blank 161 188 // … … 190 217 // -------------------------------------------------------------------------- 191 218 // 192 // Interprete the Bit rates partof the report219 // Interprete the Bit rates section of the report 193 220 // 20 integers. First and last two are not used 194 221 // … … 260 287 // -------------------------------------------------------------------------- 261 288 // 262 // Interprete a part of the report without meaning by this time289 // Interprete an unused section of the report 263 290 // 18 integers 264 291 // … … 282 309 str=str.Strip(TString::kLeading); 283 310 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 290 318 // 291 319 Bool_t MReportTrigger::InterpreteIPR(TString &str) … … 303 331 // Read comments for details 304 332 // 305 Int_t MReportTrigger::InterpreteBody(TString &str) 306 { 333 Int_t MReportTrigger::InterpreteBody(TString &str, Int_t ver ) 334 { 335 307 336 str = str.Strip(TString::kLeading); 308 337 … … 318 347 TString tablename = str(0, ws); 319 348 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 } 320 364 321 365 // Read the cell rates (32 fields) … … 384 428 return str==(TString)"OVER" ? kTRUE : kCONTINUE; 385 429 } 430 431 432 // -------------------------------------------------------------------------- 433 // 434 // Interprete the body of the TRIGGER-REPORT string 435 // for OLD runs (older than may-04) 436 // 437 Bool_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 39 39 Bool_t InterpreteL1L2Table(TString &str); 40 40 41 Int_t InterpreteBody(TString &str );41 Int_t InterpreteBody(TString &str, Int_t ver); 42 42 43 Bool_t InterpreteOldBody(TString &str); 44 43 45 public: 44 46 MReportTrigger();
Note:
See TracChangeset
for help on using the changeset viewer.