Changeset 14278 for fact/FADctrl
- Timestamp:
- 07/19/12 15:33:14 (12 years ago)
- Location:
- fact/FADctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/FADctrl/FAD.cc
r14260 r14278 63 63 Mode = idle; 64 64 Datafile = -1; 65 EventUpdateDelay = atof(GetConfig("EventUpdateDelay", "2").c_str()); 65 EventUpdateDelay = atof(GetConfig("EventUpdateDelay", "1").c_str()); 66 ModifiedCalibration = false; 66 67 67 68 // Create pipe for data exchange … … 606 607 } 607 608 609 // Modified calibration procedure for new FAD-based scope (Ulf) 610 if (Parameter.size() == 3 && Match(Parameter[2], "modified")) ModifiedCalibration = true; 611 else ModifiedCalibration = false; 612 608 613 // Start calibration by setting mode 609 614 Mode = acalib; 610 Message(INFO, "Starting amplitude calibration run with 3x%d events", NumEventsRequested); 615 if (!ModifiedCalibration) Message(INFO, "Starting amplitude calibration run with 3x%d events", NumEventsRequested); 616 else Message(INFO, "Starting modified amplitude calibration run with 3x%d events", NumEventsRequested); 611 617 } 612 618 -
fact/FADctrl/FAD.h
r12891 r14278 96 96 float EventUpdateDelay; 97 97 std::vector<std::string> BoardList; 98 99 bool ModifiedCalibration; // for new FAD scope test / Ulf 98 100 }; 99 101 -
fact/FADctrl/FADBoard.cc
r14174 r14278 205 205 } 206 206 207 if (m->ModifiedCalibration) ModifiedCalibCount = 0; 208 207 209 if (m->Mode == m->dynrange) { 208 210 // No amplitude calibration allowed! … … 275 277 // Determine gain if integration finished 276 278 if (Count < m->NumEventsRequested) break; 279 280 // Check for modified calibration procedure, then repeat gain calibration 281 if (m->ModifiedCalibration) { 282 if (ModifiedCalibCount == 0) { 283 DACCmd[1] = htons(65000); 284 DACCmd[3] = htons(0); 285 DACCmd[5] = htons(0); 286 } 287 else if (ModifiedCalibCount == 1) { 288 for (unsigned int i=0; i<NChips; i++) { 289 for (unsigned int j=0; j<NChannels; j++) { 290 if (i*NChannels+j >= 12) continue; 291 for (unsigned int k=0; k<NBins; k++) { 292 ACalib.Gain[i][j][k] = (Sum[i][j][k] / m->NumEventsRequested) - ACalib.Baseline[i][j][k]; 293 } 294 } 295 } 296 297 DACCmd[1] = htons(0); 298 DACCmd[3] = htons(50000); 299 DACCmd[5] = htons(0); 300 } 301 else if (ModifiedCalibCount == 2) { 302 for (unsigned int i=0; i<NChips; i++) { 303 for (unsigned int j=0; j<NChannels; j++) { 304 if (i*NChannels+j < 12 || i*NChannels+j >= 24) continue; 305 for (unsigned int k=0; k<NBins; k++) { 306 ACalib.Gain[i][j][k] = (Sum[i][j][k] / m->NumEventsRequested) - ACalib.Baseline[i][j][k]; 307 } 308 } 309 } 310 311 DACCmd[1] = htons(4000); 312 DACCmd[3] = htons(0); 313 DACCmd[5] = htons(0); 314 } 315 else { 316 for (unsigned int i=0; i<NChips; i++) { 317 for (unsigned int j=0; j<NChannels; j++) { 318 if (i*NChannels+j < 24) continue; 319 for (unsigned int k=0; k<NBins; k++) { 320 ACalib.Gain[i][j][k] = (Sum[i][j][k] / m->NumEventsRequested) - ACalib.Baseline[i][j][k]; 321 } 322 } 323 } 324 DACCmd[1] = htons(0); 325 DACCmd[3] = htons(0); 326 DACCmd[5] = htons(0); 327 State = secondary; 328 } 329 Send(DACCmd, sizeof(DACCmd)); 330 331 ModifiedCalibCount++; 332 333 memset(Sum, 0, sizeof(Sum)); 334 Count = 0; 335 break; 336 } 277 337 278 338 for (unsigned int i=0; i<NChips; i++) { -
fact/FADctrl/FADBoard.h
r14174 r14278 119 119 double Mean[NChips][NChannels], Mean_low[NChips][NChannels]; 120 120 int DR_low[NChips][NChannels], DR_high[NChips][NChannels]; 121 122 unsigned int ModifiedCalibCount; 121 123 }; 122 124
Note:
See TracChangeset
for help on using the changeset viewer.