
Computes calibration coefficients by fitting amplitude spectrum.
Note on using calibration GUI feature
To use the calibration GUI, follow the steps below:
1. Add the line GUIFilesPrefix=[prefix] to your config file, where [prefix] is replaced by your desired file prefix. This will cause the module to produce a gui session file named "[prefix].gui"
containing histograms for any channel which failed the automatic calibration. 2. Open the file [prefix].gui in dianagui. Follow the instructions to enter information for each peak that you can identify. When you are finished, hit the "save" button, which will produce a file named "[prefix].txt".
3. Re-run your inital .cfg file. The module will read in the information saved in [prefix].txt to calibrate the channels which failed before.
module CalCoefficients verbosity = info enable = true Souce = Th Function = [0]+[1]*x InitialValue0 = .5 InitialValue1 = 1 StoreTemporaryData = tempdata.root OutputFilename = calibration.txt SeedFilename = oldcalibration.txt UseSeedFileConditionally = true GUIFilesPrefix = GUIFile ForceFits = false
Public Member Functions | |
| MCalCoefficients (QSequence *s) | |
| virtual void | Init () |
| Init method is called before event loop. | |
| virtual QEvent * | Do (QEvent *ev) |
| Doit method is called for each event, getting the event as argument. | |
| virtual void | Done () |
| Done method is called after event loop. | |
Private Member Functions | |
| void | InitCalPeaks (std::string source) |
| Initializes the set of peaks to be used for calibration. | |
| bool | AutoSeed (int channel, double resolution=-1, int iter=0, double binscale=1) |
| Tries to find primary peaks in spectrum from scratch. | |
| double | NearestNeighbor (double energy) |
| Finds peak nearest to energy given. | |
| void | SetGUIHistogram (int channel) |
| Method to add a histogram to GUI session. | |
Private Attributes | |
|
std::map< int, std::vector < double > > | fAmplitudes |
| Map holding a vector of stabilized amplitudes for each channel. | |
| std::map< int, double > | fMaxAmplitude |
| Map maximum amplitude for each channel (based on heater energies). | |
| double | fMaxEnergy |
| Maximum and minimum of energy range containing calibration peaks. | |
| double | fMinEnergy |
| std::set< int > | fRuns |
| List of runs in calibration set. | |
| std::vector< QCalPeak * > | fCalPeaks1 |
| Vector holding primary calibration peaks. | |
| std::vector< QCalPeak * > | fCalPeaks2 |
| Vector holding secondary calibration peaks. | |
| TF1 * | fCalFunction |
| Calibration function. | |
| double * | fCalFunctionInit |
| Array of inital values for calibration function fit. | |
| std::string | fTempFilename |
| Name of file to store temporary data. | |
| std::map< double, double > | fChisquares |
| Stores chisquare values from AutoSeed function for diagnostic purposes. | |
| std::map< double, double > | fReducedChisquares |
| QMatrix * | fPeaksMatrix |
| Matrix containing peak locations from GUI. | |
| std::string | fGUIPrefix |
| Prefix to use for GUI file names. | |
| QGuiSession * | fGUISession |
| GUI session. | |
| bool | fForceFits |
| Force peak fits to be accepted even if they are not very good. | |
1.5.6