Changeset 8955 for trunk/MagicSoft/Mars/mcamera/MCameraTH.cc
- Timestamp:
- 06/14/08 15:19:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mcamera/MCameraTH.cc
r7719 r8955 40 40 #include "MLogManip.h" 41 41 42 #include "MCameraTD.h" 43 42 44 ClassImp(MCameraTH); 43 45 … … 53 55 fName = name ? name : "MCameraTH"; 54 56 fTitle = title ? title : "Storage container for the pixel discriminator threshold"; 57 } 58 59 // -------------------------------------------------------------------------- 60 // 61 // Interprete the TH (discriminator thresholds) part of the report 62 // 63 Bool_t MCameraTH::InterpreteTH(TString &str, Int_t ver, MCameraTD &td) 64 { 65 // Skip the TH (discriminator thresholds) part of the report (for old 66 // CC files with wrong or nonsense number of TH-Bytes) 67 if (ver<200507190) 68 { 69 Ssiz_t pr = str.First(' '); 70 if (pr<0) 71 { 72 *fLog << warn << "WARNING - No TH information found at all." << endl; 73 return kFALSE; 74 } 75 if (pr!=1154) 76 { 77 td.Invalidate(); 78 79 str.Remove(0, pr); 80 str=str.Strip(TString::kLeading); 81 return kTRUE; 82 } 83 } 84 85 const char *pos = str.Data(); 86 const char *end = str.Data()+577*2; 87 88 Int_t i=0; 89 while (pos<end) 90 { 91 const Char_t hex[3] = { pos[0], pos[1], 0 }; 92 pos += 2; 93 94 const Int_t n=sscanf(hex, "%2hhx", &fTH[i++]); 95 if (n==1) 96 continue; 97 98 *fLog << warn << "WARNING - Reading hexadecimal TH information." << endl; 99 return kFALSE; 100 } 101 102 SetValid(); 103 104 str.Remove(0, end-str.Data()); // Remove TH 105 str=str.Strip(TString::kLeading); 106 return kTRUE; 55 107 } 56 108
Note:
See TracChangeset
for help on using the changeset viewer.