Changeset 16055
- Timestamp:
- 05/22/13 22:40:10 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DataCalib.cc
r15628 r16055 89 89 } 90 90 91 bool DataCalib::Open(const RUN_HEAD *h, const FAD::RunDescription &d)92 { 93 if (h ->NPix != 1440)91 bool DataCalib::Open(const RUN_HEAD &h, const FAD::RunDescription &d) 92 { 93 if (h.NPix != 1440) 94 94 { 95 95 Error("Number of pixels in header for run "+to_string(GetRunId())+" not 1440."); … … 109 109 } 110 110 111 if (fData.fStep!=2 && h ->Nroi != 1024)111 if (fData.fStep!=2 && h.Nroi != 1024) 112 112 { 113 113 ostringstream msg; 114 msg << "Region of interest of run " << GetRunId() << " not 1024, but " << h ->Nroi << " in step " << fData.fStep << " ... as it ought to be.";114 msg << "Region of interest of run " << GetRunId() << " not 1024, but " << h.Nroi << " in step " << fData.fStep << " ... as it ought to be."; 115 115 Error(msg); 116 116 return false; … … 121 121 // We don't check consistency over several boards because this is done 122 122 // by the eventCheck routine already 123 for (int i=0; i<h ->NBoard; i++)124 { 125 const PEVNT_HEADER &hh = h ->FADhead[i];123 for (int i=0; i<h.NBoard; i++) 124 { 125 const PEVNT_HEADER &hh = h.FADhead[i]; 126 126 127 127 if (hh.start_package_flag==0) … … 164 164 fProcessing = true; 165 165 166 const bool hastm = h ->Nroi<=512 && h->NroiTM>=2*h->Nroi;166 const bool hastm = h.Nroi<=512 && h.NroiTM>=2*h.Nroi; 167 167 168 168 Reset(); 169 InitSize(hastm ? 1600 : 1440, h ->Nroi);169 InitSize(hastm ? 1600 : 1440, h.Nroi); 170 170 171 171 fData.fRoi = fNumSamples; … … 175 175 } 176 176 177 bool DataCalib::WriteEvt(const EVENT *e)177 bool DataCalib::WriteEvt(const EVENT &e) 178 178 { 179 179 // FIXME: SET StartPix to 0 if StartPix is -1 … … 181 181 if (fData.fStep==0) 182 182 { 183 AddRel(e ->Adc_Data, e->StartPix);183 AddRel(e.Adc_Data, e.StartPix); 184 184 } 185 185 if (fData.fStep==1) 186 186 { 187 AddRel(e ->Adc_Data, e->StartPix, fData.fOffset.data(), fData.fNumOffset);187 AddRel(e.Adc_Data, e.StartPix, fData.fOffset.data(), fData.fNumOffset); 188 188 } 189 189 if (fData.fStep==2) 190 190 { 191 AddAbs(e ->Adc_Data, e->StartPix, fData.fOffset.data(), fData.fNumOffset);191 AddAbs(e.Adc_Data, e.StartPix, fData.fOffset.data(), fData.fNumOffset); 192 192 } 193 193 -
trunk/FACT++/src/DataCalib.h
r15628 r16055 37 37 static void Update(DimDescribedService &dim, DimDescribedService &runs); 38 38 39 bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);40 bool WriteEvt(const EVENT *e);39 bool Open(const RUN_HEAD &h, const FAD::RunDescription &d); 40 bool WriteEvt(const EVENT &e); 41 41 bool Close(const RUN_TAIL * = 0); 42 42 … … 51 51 static bool IsValid() { return fData.IsValid(); } 52 52 static int GetStep() { return fData.fStep; } 53 54 static const DrsCalibration &GetCalibration() { return fData; } 53 55 }; 54 56 -
trunk/FACT++/src/DataProcessorImp.cc
r15628 r16055 45 45 // ======================================================================= 46 46 47 bool DataDump::Open(const RUN_HEAD *h, const FAD::RunDescription &)47 bool DataDump::Open(const RUN_HEAD &h, const FAD::RunDescription &) 48 48 { 49 49 fFileName = "/dev/null"; … … 52 52 str << this << " - " 53 53 << "OPEN_FILE #" << GetRunId() << ":" 54 << " Ver=" << h ->Version55 << " Typ=" << h ->RunType56 << " Nb=" << h ->NBoard57 << " Np=" << h ->NPix58 << " NTm=" << h ->NTm59 << " roi=" << h ->Nroi;54 << " Ver=" << h.Version 55 << " Typ=" << h.RunType 56 << " Nb=" << h.NBoard 57 << " Np=" << h.NPix 58 << " NTm=" << h.NTm 59 << " roi=" << h.Nroi; 60 60 61 61 Debug(str); … … 66 66 } 67 67 68 bool DataDump::WriteEvt(const EVENT *e)68 bool DataDump::WriteEvt(const EVENT &e) 69 69 { 70 70 const Time now; … … 75 75 76 76 ostringstream str; 77 str << this << " - EVENT #" << e ->EventNum << " / " << e->TriggerNum;77 str << this << " - EVENT #" << e.EventNum << " / " << e.TriggerNum; 78 78 Debug(str); 79 79 … … 93 93 // ======================================================================= 94 94 95 bool DataDebug::WriteEvt(const EVENT *e)95 bool DataDebug::WriteEvt(const EVENT &e) 96 96 { 97 cout << "WRITE_EVENT #" << GetRunId() << " (" << e ->EventNum << ")" << endl;98 cout << " Typ=" << e ->TriggerType << endl;99 cout << " roi=" << e ->Roi << endl;100 cout << " trg=" << e ->SoftTrig << endl;101 cout << " tim=" << e ->PCTime << endl;97 cout << "WRITE_EVENT #" << GetRunId() << " (" << e.EventNum << ")" << endl; 98 cout << " Typ=" << e.TriggerType << endl; 99 cout << " roi=" << e.Roi << endl; 100 cout << " trg=" << e.SoftTrig << endl; 101 cout << " tim=" << e.PCTime << endl; 102 102 103 103 return true; -
trunk/FACT++/src/DataProcessorImp.h
r15628 r16055 4 4 #include "MessageImp.h" 5 5 6 struct _RUN_HEAD;6 struct RUN_HEAD; 7 7 struct _EVENT; 8 8 struct _RUN_TAIL; … … 13 13 }; 14 14 15 typedef struct _RUN_HEAD RUN_HEAD;16 15 typedef struct _EVENT EVENT; 17 16 typedef struct _RUN_TAIL RUN_TAIL; … … 20 19 { 21 20 std::string fPath; 22 uint 64_t fNight;21 uint32_t fNight; 23 22 uint32_t fRunId; 24 23 … … 36 35 virtual ~DataProcessorImp() { } 37 36 38 virtual bool Open(const RUN_HEAD *h, const FAD::RunDescription &desc) = 0;39 virtual bool WriteEvt(const EVENT *) = 0;37 virtual bool Open(const RUN_HEAD &h, const FAD::RunDescription &desc) = 0; 38 virtual bool WriteEvt(const EVENT &) = 0; 40 39 virtual bool Close(const RUN_TAIL * = 0) = 0; 41 40 … … 43 42 44 43 std::string GetPath() const { return fPath; } 44 uint32_t GetNight() const { return fNight; } 45 45 uint32_t GetRunId() const { return fRunId; } 46 46 … … 61 61 DataDump(const std::string &path, uint64_t night, uint32_t id, MessageImp &imp) : DataProcessorImp(path, night, id, imp) { } 62 62 63 bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);64 bool WriteEvt(const EVENT *e);63 bool Open(const RUN_HEAD &h, const FAD::RunDescription &d); 64 bool WriteEvt(const EVENT &e); 65 65 bool Close(const RUN_TAIL * = 0); 66 66 }; … … 71 71 DataDebug(const std::string &path, uint64_t night, uint32_t id, MessageImp &imp) : DataDump(path, night, id, imp) { } 72 72 73 bool WriteEvt(const EVENT *e);73 bool WriteEvt(const EVENT &e); 74 74 }; 75 75 -
trunk/FACT++/src/DataWriteFits.cc
r15628 r16055 32 32 //! @param h a pointer to the RUN_HEAD structure that contains the informations relative to this run 33 33 // 34 bool DataWriteFits::Open(const RUN_HEAD *h, const FAD::RunDescription &d)34 bool DataWriteFits::Open(const RUN_HEAD &h, const FAD::RunDescription &d) 35 35 { 36 36 if (fConv) … … 40 40 } 41 41 42 const int16_t realRoiTM = (h ->NroiTM >= 2*h->Nroi && h->Nroi<=512) ? h->Nroi : 0;42 const int16_t realRoiTM = (h.NroiTM >= 2*h.Nroi && h.Nroi<=512) ? h.Nroi : 0; 43 43 44 44 fFile.AddColumn('I', "EventNum"); … … 52 52 fFile.AddColumn('S', "StartCellData", NPIX); 53 53 fFile.AddColumn('S', "StartCellTimeMarker", NTMARK); 54 fFile.AddColumn('S', "Data", h ->NPix*h->Nroi);55 fFile.AddColumn('S', "TimeMarker", h ->NTm*realRoiTM);54 fFile.AddColumn('S', "Data", h.NPix*h.Nroi); 55 fFile.AddColumn('S', "TimeMarker", h.NTm*realRoiTM); 56 56 57 57 // Write length of physical pipeline (1024) 58 58 fConv = new Converter(Converter::ToFormat(fFile.GetColumnTypes())); 59 59 60 const size_t sz = (h ->NPix*h->Nroi + h->NTm*realRoiTM)*2;60 const size_t sz = (h.NPix*h.Nroi + h.NTm*realRoiTM)*2; 61 61 if (fConv->GetSize()-sz+4!=sizeof(EVENT)) 62 62 { … … 86 86 try 87 87 { 88 fFile.WriteKey("BLDVER", h ->Version, "Builder version");88 fFile.WriteKey("BLDVER", h.Version, "Builder version"); 89 89 fFile.WriteKey("RUNID", GetRunId(), "Run number"); 90 // fFile.WriteKey("RUNTYPE", h ->RunType, "Type of run");91 fFile.WriteKey("NBOARD", h ->NBoard, "Number of acquisition boards");92 fFile.WriteKey("NPIX", h ->NPix, "Number of pixels");93 fFile.WriteKey("NTMARK", h ->NTm, "Number of time marker channels");90 // fFile.WriteKey("RUNTYPE", h.RunType, "Type of run"); 91 fFile.WriteKey("NBOARD", h.NBoard, "Number of acquisition boards"); 92 fFile.WriteKey("NPIX", h.NPix, "Number of pixels"); 93 fFile.WriteKey("NTMARK", h.NTm, "Number of time marker channels"); 94 94 fFile.WriteKey("NCELLS", 1024, "Maximum number of slices per pixels"); 95 fFile.WriteKey("NROI", h ->Nroi, "Number of slices per pixels");95 fFile.WriteKey("NROI", h.Nroi, "Number of slices per pixels"); 96 96 fFile.WriteKey("NROITM", realRoiTM, "Number of slices per time-marker"); 97 97 98 const uint16_t realOffset = (h ->NroiTM > h->Nroi) ? h->NroiTM - 2*h->Nroi : 0;98 const uint16_t realOffset = (h.NroiTM > h.Nroi) ? h.NroiTM - 2*h.Nroi : 0; 99 99 fFile.WriteKey("TMSHIFT", realOffset, "Shift of the start of the time marker readout wrt to data"); 100 100 … … 119 119 // DAC 120 120 121 for (int i=0; i<h ->NBoard; i++)121 for (int i=0; i<h.NBoard; i++) 122 122 { 123 const PEVNT_HEADER &hh = h ->FADhead[i];123 const PEVNT_HEADER &hh = h.FADhead[i]; 124 124 125 125 // Header values whihc won't change during the run … … 133 133 134 134 // FIXME: Calculate average ref clock frequency 135 for (int i=0; i<h ->NBoard; i++)135 for (int i=0; i<h.NBoard; i++) 136 136 { 137 const PEVNT_HEADER &hh = h ->FADhead[i];137 const PEVNT_HEADER &hh = h.FADhead[i]; 138 138 139 139 if (hh.start_package_flag==0) … … 158 158 double avg = 0; 159 159 int cnt = 0; 160 for (int i=0; i<h ->NBoard; i++)160 for (int i=0; i<h.NBoard; i++) 161 161 { 162 const PEVNT_HEADER &hh = h ->FADhead[i];162 const PEVNT_HEADER &hh = h.FADhead[i]; 163 163 164 164 if (hh.start_package_flag==0) … … 198 198 //! @param e the pointer to the EVENT 199 199 // 200 bool DataWriteFits::WriteEvt(const EVENT *e)200 bool DataWriteFits::WriteEvt(const EVENT &e) 201 201 { 202 202 if (!fFile.AddRow()) 203 203 return false; 204 204 205 if (e ->TriggerType && !(e->TriggerType & FAD::EventHeader::kAll))205 if (e.TriggerType && !(e.TriggerType & FAD::EventHeader::kAll)) 206 206 fTriggerCounter[0]++; 207 else if ((e ->TriggerType&FAD::EventHeader::kPedestal) && !(e->TriggerType&FAD::EventHeader::kTIM))207 else if ((e.TriggerType&FAD::EventHeader::kPedestal) && !(e.TriggerType&FAD::EventHeader::kTIM)) 208 208 fTriggerCounter[1]++; 209 else if (e ->TriggerType & FAD::EventHeader::kLPext)209 else if (e.TriggerType & FAD::EventHeader::kLPext) 210 210 fTriggerCounter[2]++; 211 else if (e ->TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))211 else if (e.TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal)) 212 212 fTriggerCounter[3]++; 213 else if (e ->TriggerType & FAD::EventHeader::kLPint)213 else if (e.TriggerType & FAD::EventHeader::kLPint) 214 214 fTriggerCounter[4]++; 215 else if (e ->TriggerType & FAD::EventHeader::kExt1)215 else if (e.TriggerType & FAD::EventHeader::kExt1) 216 216 fTriggerCounter[5]++; 217 else if (e ->TriggerType & FAD::EventHeader::kExt2)217 else if (e.TriggerType & FAD::EventHeader::kExt2) 218 218 fTriggerCounter[6]++; 219 219 else 220 220 fTriggerCounter[7]++; 221 221 222 memcpy(fTstop, &e ->PCTime, 2*sizeof(uint32_t));222 memcpy(fTstop, &e.PCTime, 2*sizeof(uint32_t)); 223 223 if (fTstart[0]==0) 224 224 memcpy(fTstart, fTstop, 2*sizeof(uint32_t)); 225 225 226 const int realRoiTM = (e ->RoiTM > e->Roi) ? e->Roi : 0;227 const size_t sz = sizeof(EVENT) + sizeof(e ->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi228 229 const vector<char> data = fConv->ToFits(reinterpret_cast<const char*>( e)+4, sz-4);226 const int realRoiTM = (e.RoiTM > e.Roi) ? e.Roi : 0; 227 const size_t sz = sizeof(EVENT) + sizeof(e.StartPix)*e.Roi+sizeof(e.StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi 228 229 const vector<char> data = fConv->ToFits(reinterpret_cast<const char*>(&e)+4, sz-4); 230 230 231 231 return fFile.WriteData(data.data(), data.size()); -
trunk/FACT++/src/DataWriteFits.h
r15628 r16055 35 35 ~DataWriteFits(); 36 36 37 bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);38 bool WriteEvt(const EVENT *e);37 bool Open(const RUN_HEAD &h, const FAD::RunDescription &d); 38 bool WriteEvt(const EVENT &e); 39 39 bool Close(const RUN_TAIL *rt = 0); 40 40 }; -
trunk/FACT++/src/DataWriteFits2.cc
r15628 r16055 1 1 #include "DataWriteFits2.h" 2 3 #include <boost/filesystem.hpp> 2 4 3 5 #include "HeadersFAD.h" … … 24 26 } 25 27 26 void DataWriteFits2::WriteHeader(const RUN_HEAD *h, const FAD::RunDescription &d)27 { 28 const int16_t realRoiTM = (h ->NroiTM >= 2*h->Nroi && h->Nroi<=512) ? h->Nroi : 0;28 void DataWriteFits2::WriteHeader(const RUN_HEAD &h, const FAD::RunDescription &d) 29 { 30 const int16_t realRoiTM = (h.NroiTM >= 2*h.Nroi && h.Nroi<=512) ? h.Nroi : 0; 29 31 30 32 fFile.AddColumnInt("EventNum", "uint32", "FAD board event counter"); … … 38 40 fFile.AddColumnShort(NPIX, "StartCellData", "uint16", "DRS4 start cell of readout"); 39 41 fFile.AddColumnShort(NTMARK, "StartCellTimeMarker", "uint16", "DRS4 start cell of readout time marker"); 40 fFile.AddColumnShort(h ->NPix*h->Nroi, "Data", "int16", "Digitized data");41 fFile.AddColumnShort(h ->NTm*realRoiTM, "TimeMarker", "int16", "Digitized time marker - if available");42 43 const size_t sz = (h ->NPix*h->Nroi + h->NTm*realRoiTM)*2;42 fFile.AddColumnShort(h.NPix*h.Nroi, "Data", "int16", "Digitized data"); 43 fFile.AddColumnShort(h.NTm*realRoiTM, "TimeMarker", "int16", "Digitized time marker - if available"); 44 45 const size_t sz = (h.NPix*h.Nroi + h.NTm*realRoiTM)*2; 44 46 if (fFile.GetBytesPerRow()-sz+4!=sizeof(EVENT)) 45 47 { … … 54 56 55 57 // ================ Header keys for raw-data ================= 56 fFile.SetInt("BLDVER", h ->Version, "Builder version");58 fFile.SetInt("BLDVER", h.Version, "Builder version"); 57 59 fFile.SetInt("RUNID", GetRunId(), "Run number"); 58 fFile.SetInt("NBOARD", h ->NBoard, "Number of acquisition boards");59 fFile.SetInt("NPIX", h ->NPix, "Number of pixels");60 fFile.SetInt("NTMARK", h ->NTm, "Number of time marker channels");60 fFile.SetInt("NBOARD", h.NBoard, "Number of acquisition boards"); 61 fFile.SetInt("NPIX", h.NPix, "Number of pixels"); 62 fFile.SetInt("NTMARK", h.NTm, "Number of time marker channels"); 61 63 fFile.SetInt("NCELLS", 1024, "Maximum number of slices per pixels"); 62 fFile.SetInt("NROI", h ->Nroi, "Number of slices per pixels");64 fFile.SetInt("NROI", h.Nroi, "Number of slices per pixels"); 63 65 fFile.SetInt("NROITM", realRoiTM, "Number of slices per time-marker"); 64 66 65 const uint16_t realOffset = (h ->NroiTM > h->Nroi) ? h->NroiTM - 2*h->Nroi : 0;67 const uint16_t realOffset = (h.NroiTM > h.Nroi) ? h.NroiTM - 2*h.Nroi : 0; 66 68 fFile.SetInt("TMSHIFT", realOffset, "Shift of marker readout w.r.t. to data"); 67 69 … … 86 88 // DAC 87 89 88 for (int i=0; i<h ->NBoard; i++)89 { 90 const PEVNT_HEADER &hh = h ->FADhead[i];90 for (int i=0; i<h.NBoard; i++) 91 { 92 const PEVNT_HEADER &hh = h.FADhead[i]; 91 93 92 94 ostringstream sout; … … 100 102 101 103 // FIXME: Calculate average ref clock frequency 102 for (int i=0; i<h ->NBoard; i++)103 { 104 const PEVNT_HEADER &hh = h ->FADhead[i];104 for (int i=0; i<h.NBoard; i++) 105 { 106 const PEVNT_HEADER &hh = h.FADhead[i]; 105 107 106 108 if (hh.start_package_flag==0) … … 124 126 double avg = 0; 125 127 int cnt = 0; 126 for (int i=0; i<h ->NBoard; i++)127 { 128 const PEVNT_HEADER &hh = h ->FADhead[i];128 for (int i=0; i<h.NBoard; i++) 129 { 130 const PEVNT_HEADER &hh = h.FADhead[i]; 129 131 130 132 if (hh.start_package_flag==0) … … 160 162 //! @param h a pointer to the RUN_HEAD structure that contains the informations relative to this run 161 163 // 162 bool DataWriteFits2::Open(const RUN_HEAD *h, const FAD::RunDescription &d)164 bool DataWriteFits2::Open(const RUN_HEAD &h, const FAD::RunDescription &d) 163 165 { 164 166 //Form filename, based on runid and run-type 165 167 fFileName = FormFileName("fits"); 166 168 169 if (boost::filesystem::exists(fFileName)) 170 { 171 Error("ofits - file '"+fFileName+"' already exists."); 172 return false; 173 } 174 167 175 try 168 176 { … … 209 217 //! @param e the pointer to the EVENT 210 218 // 211 bool DataWriteFits2::WriteEvt(const EVENT *e)212 { 213 if (e ->TriggerType && !(e->TriggerType & FAD::EventHeader::kAll))219 bool DataWriteFits2::WriteEvt(const EVENT &e) 220 { 221 if (e.TriggerType && !(e.TriggerType & FAD::EventHeader::kAll)) 214 222 fTriggerCounter[0]++; 215 else if ((e ->TriggerType&FAD::EventHeader::kPedestal) && !(e->TriggerType&FAD::EventHeader::kTIM))223 else if ((e.TriggerType&FAD::EventHeader::kPedestal) && !(e.TriggerType&FAD::EventHeader::kTIM)) 216 224 fTriggerCounter[1]++; 217 else if (e ->TriggerType & FAD::EventHeader::kLPext)225 else if (e.TriggerType & FAD::EventHeader::kLPext) 218 226 fTriggerCounter[2]++; 219 else if (e ->TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))227 else if (e.TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal)) 220 228 fTriggerCounter[3]++; 221 else if (e ->TriggerType & FAD::EventHeader::kLPint)229 else if (e.TriggerType & FAD::EventHeader::kLPint) 222 230 fTriggerCounter[4]++; 223 else if (e ->TriggerType & FAD::EventHeader::kExt1)231 else if (e.TriggerType & FAD::EventHeader::kExt1) 224 232 fTriggerCounter[5]++; 225 else if (e ->TriggerType & FAD::EventHeader::kExt2)233 else if (e.TriggerType & FAD::EventHeader::kExt2) 226 234 fTriggerCounter[6]++; 227 235 else 228 236 fTriggerCounter[7]++; 229 237 230 memcpy(fTstop, &e ->PCTime, 2*sizeof(uint32_t));238 memcpy(fTstop, &e.PCTime, 2*sizeof(uint32_t)); 231 239 if (fTstart[0]==0) 232 240 memcpy(fTstart, fTstop, 2*sizeof(uint32_t)); 233 241 234 const int realRoiTM = (e ->RoiTM > e->Roi) ? e->Roi : 0;235 const size_t sz = sizeof(EVENT) + sizeof(e ->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi236 237 try 238 { 239 fFile.WriteRow(reinterpret_cast<const char*>( e)+4, sz-4);242 const int realRoiTM = (e.RoiTM > e.Roi) ? e.Roi : 0; 243 const size_t sz = sizeof(EVENT) + sizeof(e.StartPix)*e.Roi+sizeof(e.StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi 244 245 try 246 { 247 fFile.WriteRow(reinterpret_cast<const char*>(&e)+4, sz-4); 240 248 } 241 249 catch (const exception &ex) -
trunk/FACT++/src/DataWriteFits2.h
r15628 r16055 16 16 uint32_t fTstop[2]; 17 17 18 void WriteHeader(const RUN_HEAD *h, const FAD::RunDescription &d);18 void WriteHeader(const RUN_HEAD &h, const FAD::RunDescription &d); 19 19 void WriteFooter(const RUN_TAIL *rt); 20 20 … … 27 27 } 28 28 29 bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);30 bool WriteEvt(const EVENT *e);29 bool Open(const RUN_HEAD &h, const FAD::RunDescription &d); 30 bool WriteEvt(const EVENT &e); 31 31 bool Close(const RUN_TAIL *rt = 0); 32 32 -
trunk/FACT++/src/DataWriteRaw.cc
r15628 r16055 19 19 } 20 20 21 bool DataWriteRaw::Open(const RUN_HEAD *h, const FAD::RunDescription &)21 bool DataWriteRaw::Open(const RUN_HEAD &h, const FAD::RunDescription &) 22 22 { 23 23 const string name = FormFileName("bin"); … … 52 52 53 53 WriteBlockHeader(kRunHeader, 1, 0, sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*)); 54 fOut.write(reinterpret_cast<const char*>( h), sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*));54 fOut.write(reinterpret_cast<const char*>(&h), sizeof(RUN_HEAD)-sizeof(PEVNT_HEADER*)); 55 55 56 56 for (int i=0; i<40; i++) 57 57 { 58 58 WriteBlockHeader(kBoardHeader, 1, i, sizeof(PEVNT_HEADER)); 59 fOut.write(reinterpret_cast<const char*>(h ->FADhead+i), sizeof(PEVNT_HEADER));59 fOut.write(reinterpret_cast<const char*>(h.FADhead+i), sizeof(PEVNT_HEADER)); 60 60 } 61 61 … … 79 79 } 80 80 81 bool DataWriteRaw::WriteEvt(const EVENT *evt)81 bool DataWriteRaw::WriteEvt(const EVENT &e) 82 82 { 83 const int sh = sizeof(EVENT)-2 + NPIX*e vt->Roi*2;83 const int sh = sizeof(EVENT)-2 + NPIX*e.Roi*2; 84 84 85 85 WriteBlockHeader(kEvent, 1, fCounter++, sh); 86 fOut.write(reinterpret_cast<const char*>( evt)+2, sh);86 fOut.write(reinterpret_cast<const char*>(&e)+2, sh); 87 87 return true; 88 88 } -
trunk/FACT++/src/DataWriteRaw.h
r15628 r16055 81 81 }; 82 82 83 bool Open(const RUN_HEAD *h, const FAD::RunDescription &d);84 bool WriteEvt(const EVENT *evt);83 bool Open(const RUN_HEAD &h, const FAD::RunDescription &d); 84 bool WriteEvt(const EVENT &evt); 85 85 bool Close(const RUN_TAIL *tail= 0); 86 86 };
Note:
See TracChangeset
for help on using the changeset viewer.