#include <CalScheme.h>
Inheritance diagram for CalScheme:

|
|
|
|
|
Referenced by PrintErrorStats(). |
|
|
Definition at line 149 of file CalScheme.h. 00149 {
00150 kGeneralErr = 0, // Catch-all catagory
00151 kMissingTable = 1, // Table was completely empty for context
00152 kMissingRow = 2, // Table didn't have requested entry
00153 kFPE = 3, // Computation generated illegal quantity.
00154 kDataInsufficient = 4,
00155 kBadInput = 5,
00156 kNumberOfErrorTypes
00157 } ErrorType_t;
|
|
|
Definition at line 102 of file CalScheme.h. 00102 {
00103 kUnknown = 0,
00104 kTimeCalibrator,
00105 kPeCalibrator,
00106 kVALinCalibrator,
00107 kLinCalibrator,
00108 kDriftCalibrator,
00109 kStripCalibrator,
00110 kAttenCalibrator,
00111 kMIPCalibrator,
00112 kThermometer,
00113 kNumberOfSchemeTypes
00114 } SchemeType_t;
|
|
|
Definition at line 31 of file CalScheme.cxx. 00031 : fContext() 00032 { 00033 }
|
|
|
Definition at line 35 of file CalScheme.cxx. 00036 {
00037 }
|
|
||||||||||||
|
|
|
|
Implements CfgPromptConfigurable. Reimplemented in Calibrator, MIPCalScheme, MuonDriftCalScheme, PEGainAggCalScheme, PEGainCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserLinearityCalScheme, PulserSigLinCalScheme, PulserTimeCalScheme, QuadLinearityCalScheme, SimpleCalScheme, StripAttenCalScheme, StripToStripCalScheme, TemperatureCalScheme, TimeCalScheme, and VaLinearityCalScheme. Definition at line 73 of file CalScheme.h. 00073 {}; // Perform changes the current configuration.
|
|
||||||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Get atttenuation correction Input: Light expected if energy deposited in middle of strip True position of hit along strip Strip end Output: Light seen at end of WLS pigtail Must be implimented by: AttenCalibrator Reimplemented in Calibrator, SimpleCalScheme, and StripAttenCalScheme. Definition at line 303 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalAttenCorrected(). 00304 {
00318
00319 Unimplimented(); return 0;
00320 }
|
|
||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Get gain drift Input: True gain of phototube in PEs, Strip end Output: Drifted gain of phototube Must be implimented by: DriftCalibrator Reimplemented in Calibrator, MuonDriftCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserSigLinCalScheme, and SimpleCalScheme. Definition at line 250 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalDrift(). 00251 {
00264 Unimplimented(); return 0;
00265 }
|
|
||||||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Get PMT gain and width of single PE response Input: Pixel spot Output: Gain and and width of 1-pe response in ADCs Should be slightly more clever than the strip-end based one.. i.e. it should make guesses. Must be implimented by: PeCalibrator Reimplemented in Calibrator, PEGainAggCalScheme, PEGainCalScheme, and SimpleCalScheme. Definition at line 215 of file CalScheme.cxx. References FloatErr, and Unimplimented(). 00216 {
00230 Unimplimented(); return;
00231 }
|
|
||||||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Get PMT gain and width of single PE response Input: Strip end Output: Gain and and width of 1-pe response in ADCs Must be implimented by: PeCalibrator Reimplemented in Calibrator, PEGainAggCalScheme, PEGainCalScheme, and SimpleCalScheme. Definition at line 199 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalGainAndWidth(). 00200 {
00212 Unimplimented(); return;
00213 }
|
|
||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Apply nonlinearity function. Input: Linear charge expected from a perfect phototube, Strip end Output: Realistic charge after PMT and electronics nonlinearity Must be implimented by: LinCalibrator Reimplemented in Calibrator, PulserLinearityCalScheme, PulserSigLinCalScheme, QuadLinearityCalScheme, and SimpleCalScheme. Definition at line 267 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalLinearity(). 00268 {
00281
00282 Unimplimented(); return 0;
00283 }
|
|
||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Get atttenuation correction Input: True energy of hit in MIPs Strip end (may be ignored, depending on implimentation) Output: SigMaps that this hit will result in. Must be implimented by: MIPCalibrator Reimplemented in Calibrator, MIPCalScheme, and SimpleCalScheme. Definition at line 322 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalMIP(). 00323 {
00336
00337 Unimplimented(); return 0;
00338 }
|
|
||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Get strip-to-strip variation Input: Charge expected from a perfect strip with a perfect phototube Strip end Output: Charge expected from this strip, including PMT gain Must be implimented by: StripCalibrator Reimplemented in Calibrator, SimpleCalScheme, and StripToStripCalScheme. Definition at line 285 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalStripToStrip(). 00286 {
00299
00300 Unimplimented(); return 0;
00301 }
|
|
||||||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Go from calibrated time to raw time Input: True time Raw charge on strip end Strip end Output: Raw, uncalibrated time. Must be implimented by: TimeCalibrator Reimplemented in Calibrator, PulserTimeCalScheme, SimpleCalScheme, and TimeCalScheme. Definition at line 181 of file CalScheme.cxx. References DoubleErr, FloatErr, and Unimplimented(). Referenced by Calibrator::DecalTime(). 00182 {
00196 Unimplimented(); return 0;
00197 }
|
|
||||||||||||
|
Inverse-calibration for use by Monte-Carlo Purpose: Apply VA nonlinearity Input: linear charge channel ID Output: nonlinear charge Must be implimented by: VALinCalibrator Reimplemented in Calibrator, SimpleCalScheme, and VaLinearityCalScheme. Definition at line 233 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::DecalVALinearity(). 00234 {
00247 Unimplimented(); return 0;
00248 }
|
|
|
Reimplemented in Calibrator, MIPCalScheme, MuonDriftCalScheme, PEGainAggCalScheme, PEGainCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserLinearityCalScheme, PulserSigLinCalScheme, PulserTimeCalScheme, QuadLinearityCalScheme, SimpleCalScheme, StripAttenCalScheme, StripToStripCalScheme, TemperatureCalScheme, TimeCalScheme, and VaLinearityCalScheme. Definition at line 70 of file CalScheme.h. Referenced by Reset(). 00070 {};
|
|
||||||||||||||||
|
Purpose: Correct for attenuation along strip. In: sigcorr, position along strip (in strip coordinates: 0 is center of strip.) strip end Out: position-corrected charge (SigMap) Must be implimented by: AttenCalibrator Reimplemented in Calibrator, SimpleCalScheme, and StripAttenCalScheme. Definition at line 142 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetAttenCorrected(). 00143 {
00155
00156 Unimplimented(); return 0;
00157 }
|
|
||||||||||||||||
|
Purpose: Apply time calibration In: raw time in seconds raw charge on stripend strip end Out: calibrated time. Must be implimented by: TimeCalibrator Reimplemented in Calibrator, PulserTimeCalScheme, SimpleCalScheme, and TimeCalScheme. Definition at line 43 of file CalScheme.cxx. References DoubleErr, FloatErr, and Unimplimented(). Referenced by Calibrator::GetCalibratedTime(). 00044 {
00056 Unimplimented();
00057 return 0;
00058 }
|
|
|
||||||||||||
|
Purpose: Apply drift correction In: raw adc strip end Out: drift-corrected adcs Must be implimented by: DriftCalibrator Reimplemented in Calibrator, MuonDriftCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserSigLinCalScheme, and SimpleCalScheme. Definition at line 94 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetDriftCorrected(). 00095 {
00106 Unimplimented(); return 0;
00107 }
|
|
||||||||||||
|
Purpose: Apply linearity correction In: drifted-corrected or raw ADC, strip end Out: linearized adc (siglin) Must be implimented by: LinCalibrator Reimplemented in Calibrator, PulserLinearityCalScheme, PulserSigLinCalScheme, QuadLinearityCalScheme, and SimpleCalScheme. Definition at line 109 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetLinearized(). 00110 {
00121 Unimplimented(); return 0;
00122 }
|
|
||||||||||||
|
Purpose: Linearize a VA channel to charge injection data. Usually applies only to pin diodes In: raw adc raw channel ID Out: number of pes. Must be implimented by: VALinCalibrator Reimplemented in Calibrator, SimpleCalScheme, and VaLinearityCalScheme. Definition at line 76 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetLinearizedVA(). 00077 {
00089
00090 Unimplimented(); return 0;
00091 }
|
|
||||||||||||
|
Purpose: Convert from corrected charge to energy units. MIPs are usually defined as the the light seen from a muon going in the Z-direction through the center of the strip (i.e. ~2 MeV of muon energy) In: sigcorr or sigmap Strip end (May be ignored, depending upon implimentation) Out: energy in MIPs Must be implimented by: MIPCalibrator Reimplemented in Calibrator, MIPCalScheme, and SimpleCalScheme. Definition at line 159 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetMIP(). 00160 {
00173 Unimplimented(); return 0;
00174 }
|
|
||||||||||||
|
Purpose: Apply PE calibration In: raw adc strip end Out: number of pes. Must be implimented by: PeCalibrator Reimplemented in Calibrator, PEGainAggCalScheme, PEGainCalScheme, and SimpleCalScheme. Definition at line 60 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetPhotoElectrons(). 00061 {
00072
00073 Unimplimented(); return 0;
00074 }
|
|
||||||||||||
|
Purpose: Apply strip-to-strip correction i.e. scintillator light output, PMT gain, and light loss By default, assumes hit is in center of strip. In: linearized or raw adc (siglin) strip end Out: corrected adc (sigcorr) Must be implimented by: StripCalibrator Reimplemented in Calibrator, SimpleCalScheme, and StripToStripCalScheme. Definition at line 124 of file CalScheme.cxx. References FloatErr, and Unimplimented(). Referenced by Calibrator::GetStripToStripCorrected(). 00125 {
00139 Unimplimented(); return 0;
00140 }
|
|
|
Request temperature at current vld context Purpose: Get temperature Input: User-defined. Output: Temperature in degrees Celcius Must be implimented by: Thermometer Reimplemented in Calibrator, SimpleCalScheme, and TemperatureCalScheme. Definition at line 343 of file CalScheme.cxx. References Unimplimented(). Referenced by Calibrator::GetTemperature(). 00344 {
00356 Unimplimented(); return 0;
00357 }
|
|
|
Increment count of number of calls. Definition at line 471 of file CalScheme.cxx. References fsCalls. Referenced by Calibrator::DecalAttenCorrected(), Calibrator::DecalDrift(), Calibrator::DecalGainAndWidth(), Calibrator::DecalLinearity(), Calibrator::DecalMIP(), Calibrator::DecalStripToStrip(), Calibrator::DecalTime(), Calibrator::DecalVALinearity(), Calibrator::GetAttenCorrected(), Calibrator::GetCalibratedTime(), Calibrator::GetDriftCorrected(), Calibrator::GetLinearized(), Calibrator::GetLinearizedVA(), Calibrator::GetMIP(), Calibrator::GetPhotoElectrons(), Calibrator::GetStripToStripCorrected(), and Calibrator::GetTemperature(). 00472 {
00476
00477 // Mod by the max value to prevent buffer overflows.
00478 fsCalls[i % kNumberOfSchemeTypes]++;
00479 }
|
|
||||||||||||||||
|
Definition at line 464 of file CalScheme.cxx. References IncrementErrors(). 00466 {
00467 IncrementErrors(i,j,GenericThingId(c));
00468 }
|
|
||||||||||||||||
|
Definition at line 446 of file CalScheme.cxx. References IncrementErrors(). 00448 {
00449 IncrementErrors(i,j,GenericThingId(c));
00450 }
|
|
||||||||||||||||
|
Definition at line 458 of file CalScheme.cxx. References IncrementErrors(). 00460 {
00461 IncrementErrors(i,j,GenericThingId(c));
00462 }
|
|
||||||||||||||||
|
Definition at line 452 of file CalScheme.cxx. References IncrementErrors(). 00454 {
00455 IncrementErrors(i,j,GenericThingId(c));
00456 }
|
|
||||||||||||||||
|
Definition at line 440 of file CalScheme.cxx. References IncrementErrors(). 00442 {
00443 IncrementErrors(i,j,GenericThingId(c));
00444 }
|
|
||||||||||||||||
|
Increment an error count. Definition at line 426 of file CalScheme.cxx. References fsChannelErrors, and IncrementErrors(). 00429 {
00433
00434 // Mod the values by the max value to prevent buffer overflows.
00435 IncrementErrors(i,j);
00436 fsChannelErrors[id]++;
00437 }
|
|
||||||||||||
|
|
Definition at line 544 of file CalScheme.cxx. Referenced by PrintConfig(). 00545 {
00546 PrintConfig(*(MsgService::Instance()->GetStream("Calib")));
00547 }
|
|
|
Definition at line 537 of file CalScheme.cxx. References PrintConfig(). 00538 {
00539 stringstream oss;
00540 PrintConfig(oss);
00541 ms << oss.str();
00542 }
|
|
|
Prints out the current configuration status Should be overridden by implimentation. Reimplemented in Calibrator, MIPCalScheme, MuonDriftCalScheme, PEGainAggCalScheme, PEGainCalScheme, PmtDriftCalScheme, PulserDriftCalScheme, PulserLinearityCalScheme, PulserSigLinCalScheme, PulserTimeCalScheme, QuadLinearityCalScheme, StripAttenCalScheme, StripToStripCalScheme, TemperatureCalScheme, TimeCalScheme, and VaLinearityCalScheme. Definition at line 524 of file CalScheme.cxx. References CfgPromptConfigurable::GetConfig(), and Registry::PrettyPrint(). Referenced by operator<<(), and Calibrator::PrintConfig(). 00525 {
00530 os << "Generic CalScheme PrintConfig()" <<endl;
00531 const Registry& r = this->GetConfig();
00532 r.PrettyPrint(os);
00533 }
|
|
|
Definition at line 557 of file CalScheme.cxx. Referenced by PrintErrorStats(), and Calibrator::~Calibrator(). 00558 {
00559 PrintErrorStats(*(MsgService::Instance()->GetStream("Calib")));
00560 }
|
|
|
Definition at line 550 of file CalScheme.cxx. References PrintErrorStats(). 00551 {
00552 stringstream oss;
00553 PrintErrorStats(oss);
00554 ms << oss.str();
00555 }
|
|
|
Definition at line 483 of file CalScheme.cxx. References VldContext::AsString(), Form(), fsCalls, fsChannelErrors, fsErrors, kBadInput, kDataInsufficient, kFPE, kGeneralErr, kMissingRow, kMissingTable, SchemeType_t, and SchemeTypeName(). 00484 {
00485 os << "Calibrator Errors Statistics:" << endl;
00486 os << Form("%20s %10s ||%10s|%10s|%10s|%10s|%10s|%10s\n",
00487 "Calibrator","Calls","General","Miss Table","Miss Row","FP Error","Insuf.Data","Bad Input");
00488 for(int type = 0; type < kNumberOfSchemeTypes; type ++) {
00489 os << Form("%20s %10d || %8d | %8d | %8d | %8d | %8d | %8d\n",
00490 SchemeTypeName((SchemeType_t)type),
00491 fsCalls[type],
00492 fsErrors[type][kGeneralErr],
00493 fsErrors[type][kMissingTable],
00494 fsErrors[type][kMissingRow],
00495 fsErrors[type][kFPE],
00496 fsErrors[type][kDataInsufficient],
00497 fsErrors[type][kBadInput]);
00498 }
00499 // Print out channel errors.
00500 // This bit of arcane code basically does an
00501 // insertion sort on the number of errors generated
00502 // in order to figure out which channels have generated
00503 // the most errors.
00504
00505 os << "Channels with the most errors: " << endl;
00506 std::multimap<int,GenericThingId> sortedChannels;
00507 std::map<GenericThingId,int>::iterator it;
00508 for(it = fsChannelErrors.begin(); it!= fsChannelErrors.end(); it++) {
00509 sortedChannels.insert(std::pair<int,GenericThingId>(-(it->second),it->first));
00510 }
00511
00512 std::multimap<int,GenericThingId>::iterator it2;
00513 it2 = sortedChannels.begin();
00514 int i=0;
00515 while((i<10) && (it2!=sortedChannels.end())) {
00516 os << "Errors: " << Form("%8d",-(it2->first)) << " " << (it2->second).AsString() << endl;
00517 it2++; i++;
00518 }
00519 }
|
|
||||||||||||
|
|
Sets all error count statistics to zero. Usually called by Calibrator c'tor at start of job. Definition at line 399 of file CalScheme.cxx. References fsCalls, fsChannelErrors, and fsErrors. Referenced by Calibrator::Instance(). 00400 {
00406 for(int i=0;i<kNumberOfSchemeTypes;i++) {
00407 fsCalls[i] = 0;
00408 for(int j=0;j<kNumberOfErrorTypes;j++)
00409 fsErrors[i][j] = 0;
00410 }
00411 fsChannelErrors.clear();
00412 }
|
|
|
Definition at line 116 of file CalScheme.h. Referenced by PrintErrorStats(), and Calibrator::ResetHistograms(). 00116 {
00117 static const char* sTypeNames[] = {
00118 "Unknown",
00119 "TimeCalibrator",
00120 "PeCalibrator",
00121 "VALinCalibrator",
00122 "LinCalibrator",
00123 "DriftCalibrator",
00124 "StripCalibrator",
00125 "AttenCalibrator",
00126 "MIPCalibrator",
00127 "Thermometer",
00128 "???"};
00129 return sTypeNames[t%kNumberOfSchemeTypes];
00130 };
|
|
|
A short routine that warns the user that an improper scheme has been implimented. Then crashes, just to show 'em. Definition at line 387 of file CalScheme.cxx. References Nav::GetName(), and MSG. Referenced by DecalAttenCorrected(), DecalDrift(), DecalGainAndWidth(), DecalLinearity(), DecalMIP(), DecalStripToStrip(), DecalTime(), DecalVALinearity(), GetAttenCorrected(), GetCalibratedTime(), GetDriftCorrected(), GetLinearized(), GetLinearizedVA(), GetMIP(), GetPhotoElectrons(), GetStripToStripCorrected(), and GetTemperature(). 00388 {
00393 MSG("Calib",Msg::kFatal) << this->GetName() << " called with unimplimented function. " << endl
00394 << "Calibrator is not set up correctly!" << endl;
00395 assert(0);
00396 }
|
|
|
Definition at line 132 of file CalScheme.h. 00132 {
00133 static const char* sUnitNames[] = {
00134 "Unknown",
00135 "Seconds",
00136 "PE",
00137 "ADC",
00138 "SigLin",
00139 "SigDrift",
00140 "SigCorr",
00141 "SigMap",
00142 "SigMip",
00143 "C",
00144 "???"};
00145 return sUnitNames[t%kNumberOfSchemeTypes];
00146 };
|
|
||||||||||||
|
Definition at line 25 of file CalScheme.cxx. 00026 {
00027 s.PrintConfig(os);
00028 return os;
00029 }
|
|
|
Definition at line 98 of file CalScheme.h. Referenced by Reset(). |
|
|
Definition at line 21 of file CalScheme.cxx. Referenced by IncrementCalls(), PrintErrorStats(), and ResetStatistics(). |
|
|
Definition at line 23 of file CalScheme.cxx. Referenced by IncrementErrors(), PrintErrorStats(), and ResetStatistics(). |
|
|
Definition at line 22 of file CalScheme.cxx. Referenced by IncrementErrors(), PrintErrorStats(), and ResetStatistics(). |
1.3.9.1