Changeset 2386 for trunk/MagicSoft/Mars/mraw
- Timestamp:
- 10/15/03 19:15:13 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mraw
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.cc
r2328 r2386 237 237 int MRawEvtHeader::ReadEvt(istream &fin) 238 238 { 239 fin.read((char*)&fDAQEvtNumber, 4); 239 fin.read((char*)&fDAQEvtNumber, 4); // Total=4 240 240 241 241 UInt_t fAbsTime[2]; 242 fin.read((char*)fAbsTime, 8); 242 fin.read((char*)fAbsTime, 8); // Total=12 243 243 244 244 // … … 246 246 // 247 247 const Double_t mhz = 9.375; // [1e6 ticks/s] 248 const Double_t t = (Double_t)fAbsTime[0]/mhz *1e-3;// [ns]249 const UShort_t ns = (UShort_t)fmod(t , 1e9);250 const Byte_t s = (Byte_t)fmod(t/1e 9, 60);251 const Byte_t m = (Byte_t)fmod(t/60e 9, 60);252 const Byte_t h = (Byte_t)(t/3600e 9);248 const Double_t t = (Double_t)fAbsTime[0]/mhz; // [ns] 249 const UShort_t ns = (UShort_t)fmod(t*1e-3, 1e9); 250 const Byte_t s = (Byte_t)fmod(t/1e12, 60); 251 const Byte_t m = (Byte_t)fmod(t/60e12, 60); 252 const Byte_t h = (Byte_t)(t/3600e12); 253 253 254 254 fTime->SetTime(h, m, s, ns); … … 257 257 Byte_t dummy[4]; 258 258 259 fin.read((char*)&fNumTrigLvl1, 4); 260 fin.read((char*)&fNumTrigLvl2, 4); 261 fin.read((char*)fTrigPattern, 8); 262 fin.read((char*)&fTrigType, 2); 263 fin.read((char*)dummy, 2); //was fAllLoGainOn259 fin.read((char*)&fNumTrigLvl1, 4); // Total=16 260 fin.read((char*)&fNumTrigLvl2, 4); // Total=20 261 fin.read((char*)fTrigPattern, 8); // Total=28 262 fin.read((char*)&fTrigType, 2); // Total=30 263 fin.read((char*)dummy, 2); // Total=32, was fAllLoGainOn 264 264 fin.read((char*)fPixLoGainOn->GetArray(), fPixLoGainOn->GetSize()); 265 265 -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.cc
r2299 r2386 94 94 // read one RUN HEADER from the input stream 95 95 // 96 fin.read((char*)&fMagicNumber, 2); 96 fMagicNumber = 0; 97 98 fin.read((char*)&fMagicNumber, 2); // Total=2 97 99 98 100 // … … 101 103 if (fMagicNumber != kMagicNumber && fMagicNumber != kMagicNumber+1) 102 104 { 103 *fLog << err << "Error: Wrong Magic Number : Not a Magic File!" << endl;105 *fLog << err << "Error: Wrong Magic Number (0x" << hex << fMagicNumber << "): Not a Magic File!" << endl; 104 106 return; 105 107 } 106 108 107 if (fMagicNumber == kMagicNumber && fMagicNumber != kMagicNumber+1)109 if (fMagicNumber == kMagicNumber+1) 108 110 *fLog << warn << "WARNING - This file maybe broken (0xc0c1) - DAQ didn't close it correctly!" << endl; 109 111 110 112 Byte_t dummy[16]; 111 113 112 fin.read((char*)&fFormatVersion, 2); 113 fin.read((char*)&fSoftVersion, 2); 114 fin.read((char*)&fRunType, 2); 115 fin.read((char*)&fRunNumber, 4); 116 fin.read((char*)&fProjectName, 22); 117 fin.read((char*)&fSourceName, 12); 114 fin.read((char*)&fFormatVersion, 2); // Total=4 115 fin.read((char*)&fSoftVersion, 2); // Total=6 116 fin.read((char*)&fRunType, 2); // Total=8 117 fin.read((char*)&fRunNumber, 4); // Total=12 118 fin.read((char*)&fProjectName, 22); // Total=34 119 fin.read((char*)&fSourceName, 12); // Total=46 118 120 fin.read((char*)dummy, 4); // was RA (moved to tracking system) 119 121 fin.read((char*)dummy, 4); // was DEC (moved to tracking system) 120 fin.read((char*)&fSourceEpochChar, 2); 121 fin.read((char*)&fSourceEpochDate, 2); 122 fin.read((char*)&fMJD, 4); 123 fin.read((char*)&fDateYear, 2); 124 fin.read((char*)&fDateMonth, 2); 125 fin.read((char*)&fDateDay, 2); 126 fin.read((char*)&fNumCrates, 2); 127 fin.read((char*)&fNumPixInCrate, 2); 128 fin.read((char*)&fNumSamplesLoGain, 2); 129 fin.read((char*)&fNumSamplesHiGain, 2); 130 fin.read((char*)&fNumEvents, 4); 122 fin.read((char*)&fSourceEpochChar, 2); // Total=56 123 fin.read((char*)&fSourceEpochDate, 2); // Total=58 124 fin.read((char*)&fMJD, 4); // Total=62 125 fin.read((char*)&fDateYear, 2); // Total=64 126 fin.read((char*)&fDateMonth, 2); // Total=66 127 fin.read((char*)&fDateDay, 2); // Total=68 128 fin.read((char*)&fNumCrates, 2); // Total=70 129 fin.read((char*)&fNumPixInCrate, 2); // Total=72 130 fin.read((char*)&fNumSamplesLoGain, 2); // Total=74 131 fin.read((char*)&fNumSamplesHiGain, 2); // Total=76 132 fin.read((char*)&fNumEvents, 4); // Total=80 131 133 132 134 … … 148 150 { 149 151 *fLog << all << endl; 150 *fLog << "MagicNumber: 0x" << hex << fMagicNumber << " - " << (fMagicNumber==kMagicNumber?"OK":"Wrong!") << endl; 152 *fLog << "MagicNumber: 0x" << hex << fMagicNumber << " - "; 153 switch (fMagicNumber) 154 { 155 case kMagicNumber: *fLog << "OK"; break; 156 case kMagicNumber+1: *fLog << "File not closed!"; break; 157 default: *fLog << "Wrong!"; break; 158 } 159 *fLog << endl; 151 160 *fLog << "Version: " << dec << "Format=" << fFormatVersion << " "; 152 161 *fLog << "Software=" << fSoftVersion << endl; … … 213 222 return fPixAssignment->GetSize(); 214 223 } 224 225 // -------------------------------------------------------------------------- 226 // 227 // Returns absolute size in bytes of the run header as read from a raw file. 228 // This must be done _after_ the header is read, because the header doesn't 229 // have a fixed size (used in MRawSocketRead) 230 // 231 Int_t MRawRunHeader::GetNumTotalBytes() const 232 { 233 return 80+fNumCrates*fNumPixInCrate*2+16; 234 } -
trunk/MagicSoft/Mars/mraw/MRawRunHeader.h
r2316 r2386 104 104 105 105 UShort_t GetNumPixel() const; 106 Int_t GetNumTotalBytes() const; 106 107 107 108 void Print(Option_t *t=NULL) const; -
trunk/MagicSoft/Mars/mraw/Makefile
r2207 r2386 34 34 MRawCrateArray.cc \ 35 35 MRawCrateData.cc \ 36 MRawFileWrite.cc \ 36 37 MRawFileRead.cc \ 37 MRaw FileWrite.cc38 MRawSocketRead.cc 38 39 39 40 SRCS = $(SRCFILES) -
trunk/MagicSoft/Mars/mraw/RawLinkDef.h
r1020 r2386 14 14 #pragma link C++ class MRawCrateData+; 15 15 16 #pragma link C++ class MRawSocketRead+; 16 17 #pragma link C++ class MRawFileRead+; 17 18 #pragma link C++ class MRawFileWrite+;
Note:
See TracChangeset
for help on using the changeset viewer.