Changeset 12605
- Timestamp:
- 11/21/11 17:55:18 (13 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DataWriteFits.cc
r12494 r12605 4 4 #include "FAD.h" 5 5 #include "Converter.h" 6 6 7 7 8 using namespace std; … … 177 178 } 178 179 180 // This is a workaround for the missing information in the event builder 181 fTstart[0] = 0; 182 fTstop[0] = 0; 183 179 184 //Last but not least, add header keys that will be updated when closing the file 180 185 return WriteFooter(NULL); … … 190 195 if (!fFile.AddRow()) 191 196 return false; 192 int realRoiTM = (e->RoiTM > e->Roi) ? e->Roi : 0; 197 198 if (!(e->TriggerType & FAD::EventHeader::kAll)) 199 fTriggerCounter[0]++; 200 else if ((e->TriggerType&FAD::EventHeader::kPedestal) && !(e->TriggerType&FAD::EventHeader::kTIM)) 201 fTriggerCounter[1]++; 202 else if (e->TriggerType & FAD::EventHeader::kLPext) 203 fTriggerCounter[2]++; 204 else if (e->TriggerType & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal)) 205 fTriggerCounter[3]++; 206 else if (e->TriggerType & FAD::EventHeader::kLPint) 207 fTriggerCounter[4]++; 208 else if (e->TriggerType & FAD::EventHeader::kExt1) 209 fTriggerCounter[5]++; 210 else if (e->TriggerType & FAD::EventHeader::kExt2) 211 fTriggerCounter[6]++; 212 else 213 fTriggerCounter[7]++; 214 215 memcpy(fTstop, &e->PCTime, 2*sizeof(uint32_t)); 216 if (fTstart[0]==0) 217 memcpy(fTstart, fTstop, 2*sizeof(uint32_t)); 218 219 const int realRoiTM = (e->RoiTM > e->Roi) ? e->Roi : 0; 193 220 const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*realRoiTM; //ETIENNE from RoiTm to Roi 194 221 … … 216 243 //FIXME shouldn't we also add an MjD reference ? 217 244 218 fFile.WriteKey("TSTART", rt ? rt->PCtime0 : uint32_t(0), 245 const Time start(fTstart[0], fTstart[1]); 246 const Time stop (fTstop[0], fTstop[1]); 247 248 fFile.WriteKey("TSTART", start.Iso(), 219 249 "Time when first event received"); 220 250 221 fFile.WriteKey("TSTOP", rt ? rt->PCtimeX : uint32_t(0),251 fFile.WriteKey("TSTOP", stop.Iso(), 222 252 "Time when last event received"); 253 254 fFile.WriteKey("NTRG", fTriggerCounter[0], "Number of physics triggers written"); 255 fFile.WriteKey("NTRGPED", fTriggerCounter[1], "Number of pure pedestal triggers written"); 256 fFile.WriteKey("NTRGLPE", fTriggerCounter[2], "Number of external light pulser triggers written"); 257 fFile.WriteKey("NTRGTIM", fTriggerCounter[3], "Number of time calibration triggers written"); 258 fFile.WriteKey("NTRGLPI", fTriggerCounter[4], "Number of internal light pulser triggers written"); 259 fFile.WriteKey("NTRGEXT1", fTriggerCounter[5], "Number of triggers from ext1 written"); 260 fFile.WriteKey("NTRGEXT2", fTriggerCounter[6], "Number of triggers from ext2 written"); 261 fFile.WriteKey("NTRGMISC", fTriggerCounter[7], "Number of triggers belonging to no other category written"); 223 262 } 224 263 catch (const CCfits::FitsException &e) -
trunk/FACT++/src/DataWriteFits.h
r12478 r12605 4 4 #include "DataProcessorImp.h" 5 5 #include "FitsFile.h" 6 7 #include <array> 6 8 7 9 class Converter; … … 12 14 13 15 FitsFile fFile; 16 17 std::array<uint32_t, 8> fTriggerCounter; 18 19 uint32_t fTstart[2]; 20 uint32_t fTstop[2]; 14 21 15 22 template <typename T>
Note:
See TracChangeset
for help on using the changeset viewer.