Changeset 12148 for trunk/FACT++/src/DataWriteFits.cc
- Timestamp:
- 09/26/11 14:55:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DataWriteFits.cc
r11893 r12148 121 121 WriteKey("FWVER", i, hh.version_no, "Firmware Version"); 122 122 } 123 124 // FIXME: Calculate average ref clock frequency 125 for (int i=0; i<h->NBoard; i++) 126 { 127 const PEVNT_HEADER &hh = h->FADhead[i]; 128 129 if (hh.start_package_flag==0) 130 continue; 131 132 fFile.WriteKey("RUN", hh.runnumber, "Run number"); 133 fFile.WriteKey("PRESC", hh.trigger_generator_prescaler, "Trigger generator prescaler"); 134 fFile.WriteKey("PHASE", hh.adc_clock_phase_shift, "ADC clock phase shift"); 135 136 for (int j=0; j<8; j++) 137 { 138 ostringstream dac; 139 dac << "DAC" << j; 140 fFile.WriteKey(dac.str(), hh.dac[j], "DAC command value"); 141 } 142 143 break; 144 } 145 146 double avg = 0; 147 int cnt = 0; 148 for (int i=0; i<h->NBoard; i++) 149 { 150 const PEVNT_HEADER &hh = h->FADhead[i]; 151 152 if (hh.start_package_flag==0) 153 continue; 154 155 avg += hh.REFCLK_frequency; 156 cnt ++; 157 } 158 159 fFile.WriteKey("REFCLK", avg/cnt, "Average reference clock frequency in Hz"); 123 160 } 124 161 catch (const CCfits::FitsException &e) … … 127 164 return false; 128 165 } 129 130 /*131 //now the boards related keywords132 for (int i=0; i<h->NBoard; i++)133 {134 const PEVNT_HEADER &hh = h->FADhead[i];135 136 WriteKey("STPKGFG", i, hh.start_package_flag, "Start package flag");137 WriteKey("PKGLEN", i, hh.package_length, "Package length");138 WriteKey("STATUS", i, hh.PLLLCK, "");139 140 // WriteKey("TRIGCRC", i, hh.trigger_crc, "Trigger CRC");141 // WriteKey("TRIGTYP", i, hh.trigger_type, "Trigger type");142 // WriteKey("TRIGID", i, hh.trigger_id, "Trigger ID");143 // WriteKey("EVTCNTR", i, hh.fad_evt_counter, "FAD Event Counter");144 // WriteKey("REFCLK", i, hh.REFCLK_frequency, "Reference Clock Frequency");145 146 WriteKey("PHASESH", i, hh.adc_clock_phase_shift, "ADC clock phase shift");147 WriteKey("TRGGEN", i, hh.number_of_triggers_to_generate, "Number of triggers to generate");148 WriteKey("PRESC", i, hh.trigger_generator_prescaler, "Trigger generator prescaler");149 WriteKey("RUNNB", i, hh.runnumber, "Run number");150 151 WriteKey("TIME", i, hh.time, "Time");152 153 // for (int j=0;j<NTemp;j++)154 // {155 // str.str(""); str2.str("");156 // str << "DRS_T" << i << j;157 // str2 << "DRS temperature #" << i << " " << j;158 // WriteKey(str.str(), h->FADhead[i].drs_temperature[j], str2.str());159 // }160 for (int j=0;j<NDAC;j++)161 WriteKey("DAC", i*NDAC+j, hh.dac[j], "DAC");162 }163 */164 166 165 167 //Last but not least, add header keys that will be updated when closing the file
Note:
See TracChangeset
for help on using the changeset viewer.